當前位置: 首頁>>代碼示例>>Java>>正文


Java MediaComparators類代碼示例

本文整理匯總了Java中org.videolan.vlc.gui.audio.MediaComparators的典型用法代碼示例。如果您正苦於以下問題:Java MediaComparators類的具體用法?Java MediaComparators怎麽用?Java MediaComparators使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MediaComparators類屬於org.videolan.vlc.gui.audio包,在下文中一共展示了MediaComparators類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sortList

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
public void sortList(){
    ArrayList<MediaWrapper> files = new ArrayList<MediaWrapper>(), dirs = new ArrayList<MediaWrapper>();
    for (Object item : mMediaList){
        if (item instanceof MediaWrapper) {
            MediaWrapper media = (MediaWrapper) item;
            if (media.getType() == MediaWrapper.TYPE_DIR)
                dirs.add(media);
            else
                files.add(media);
        }
    }
    if (dirs.isEmpty() && files.isEmpty())
        return;
    mMediaList.clear();
    if (!dirs.isEmpty()) {
        Collections.sort(dirs, MediaComparators.byName);
        mMediaList.addAll(dirs);
    }
    if (!files.isEmpty()) {
        Collections.sort(files, MediaComparators.byName);
        mMediaList.addAll(files);
    }
    notifyDataSetChanged();
}
 
開發者ID:jiaZengShen,項目名稱:vlc_android_win,代碼行數:25,代碼來源:BaseBrowserAdapter.java

示例2: setShuffleMode

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
private void setShuffleMode(boolean shuffle) {
    if (mService == null)
        return;
    mShuffling = shuffle;
    mShuffle.setImageResource(shuffle ? R.drawable.ic_shuffle_on :
            R.drawable.ic_shuffle);
    ArrayList<MediaWrapper> medias = (ArrayList<MediaWrapper>) mService.getMedias();
    if (shuffle){
        Collections.shuffle(medias);
    } else {
        Collections.sort(medias, MediaComparators.byTrackNumber);
    }
    mService.load(medias, 0);
    mAdapter.updateList(medias);
    update();
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:17,代碼來源:AudioPlayerActivity.java

示例3: sortList

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
public void sortList(){
    ArrayList<MediaWrapper> files = new ArrayList<MediaWrapper>(), dirs = new ArrayList<MediaWrapper>();
    for (Object item : mMediaList){
        if (item instanceof MediaWrapper) {
            MediaWrapper media = (MediaWrapper) item;
            if (media.getType() == MediaWrapper.TYPE_DIR)
                dirs.add(media);
            else
                files.add(media);
        }
    }
    Collections.sort(dirs, MediaComparators.byName);
    Collections.sort(files, MediaComparators.byName);
    mMediaList.clear();
    mMediaList.addAll(dirs);
    mMediaList.addAll(files);
    mAdapter.clear();
    mAdapter.addAll(0, mMediaList);
    mAdapter.notifyArrayItemRangeChanged(0, mMediaList.size());
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:21,代碼來源:BrowserGridFragment.java

示例4: sort

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
private void sort(){
    VLCApplication.runBackground(new Runnable() {
        @Override
        public void run() {
            mMediaItemMap = new TreeMap<>(mMediaItemMap); //sort sections
            for (ListItem item : mMediaItemMap.values()) {
                Collections.sort(item.mediaList, MediaComparators.byName);
            }
            mHandler.sendEmptyMessage(UPDATE_DISPLAY);
        }
    });
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:13,代碼來源:NetworkBrowserFragment.java

示例5: onPostExecute

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
@Override
protected void onPostExecute(String title) {
    ((BrowserActivity)getActivity()).showProgress(false);
    setTitle(title);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                                  RowPresenter.ViewHolder rowViewHolder, Row row) {
            ListItem listItem = (ListItem) item;
            Intent intent;
            if (CATEGORY_ARTISTS == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_ARTIST);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getArtist());
            } else if (CATEGORY_GENRES == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_GENRE);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getGenre());
            } else {
                if (CATEGORY_ALBUMS == mCategory)
                    Collections.sort(listItem.mediaList, MediaComparators.byTrackNumber);
                intent = new Intent(mContext, AudioPlayerActivity.class);
                intent.putExtra(AudioPlayerActivity.MEDIA_LIST, listItem.mediaList);
            }
            startActivity(intent);
        }
    });
}
 
開發者ID:xuie0000,項目名稱:vlc-android,代碼行數:33,代碼來源:MusicFragment.java

示例6: onPostExecute

import org.videolan.vlc.gui.audio.MediaComparators; //導入依賴的package包/類
@Override
protected void onPostExecute(String title) {
    ((BrowserActivityInterface)getActivity()).showProgress(false);
    setTitle(title);
    setOnItemViewClickedListener(new OnItemViewClickedListener() {
        @Override
        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
                                  RowPresenter.ViewHolder rowViewHolder, Row row) {
            ListItem listItem = (ListItem) item;
            Intent intent;
            if (CATEGORY_ARTISTS == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_ARTIST);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getArtist());
            } else if (CATEGORY_GENRES == mCategory) {
                intent = new Intent(mContext, VerticalGridActivity.class);
                intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_CATEGORIES);
                intent.putExtra(AUDIO_CATEGORY, CATEGORY_ALBUMS);
                intent.putExtra(MEDIA_SECTION, FILTER_GENRE);
                intent.putExtra(AUDIO_FILTER, listItem.mediaList.get(0).getGenre());
            } else {
                intent = new Intent(mContext, AudioPlayerActivity.class);
                if (CATEGORY_ALBUMS == mCategory) {
                    Collections.sort(listItem.mediaList, MediaComparators.byTrackNumber);
                    intent.putExtra(AudioPlayerActivity.MEDIA_LIST, listItem.mediaList);
                } else {
                    int position = 0;
                    String location = listItem.mediaList.get(0).getLocation();
                    for (int i = 0 ; i< audioList.size() ; ++i) {
                        if (TextUtils.equals(location, audioList.get(i).getLocation())) {
                            position = i;
                            break;
                        }
                    }
                    intent.putExtra(AudioPlayerActivity.MEDIA_LIST, audioList);
                    intent.putExtra(AudioPlayerActivity.MEDIA_POSITION, position);
                }
            }
            startActivity(intent);
        }
    });
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:45,代碼來源:MusicFragment.java


注:本文中的org.videolan.vlc.gui.audio.MediaComparators類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。