• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MediaLibrary类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.videolan.vlc.MediaLibrary的典型用法代码示例。如果您正苦于以下问题:Java MediaLibrary类的具体用法?Java MediaLibrary怎么用?Java MediaLibrary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MediaLibrary类属于org.videolan.vlc包,在下文中一共展示了MediaLibrary类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateLib

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
public void updateLib() {
    if (mPreventRescan){
        mPreventRescan = false;
        return;
    }
    FragmentManager fm = getSupportFragmentManager();
    Fragment current = fm.findFragmentById(R.id.fragment_placeholder);
    if (current != null && current instanceof IRefreshable)
        ((IRefreshable) current).refresh();
    else
        MediaLibrary.getInstance().loadMediaItems();
    Fragment fragment = fm.findFragmentByTag(SidebarAdapter.SidebarEntry.ID_AUDIO);
    if (fragment != null && !fragment.equals(current)) {
        ((MediaBrowserFragment)fragment).clear();
    }
    fragment = fm.findFragmentByTag(SidebarAdapter.SidebarEntry.ID_VIDEO);
    if (fragment != null && !fragment.equals(current)) {
        ((MediaBrowserFragment)fragment).clear();
    }
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:21,
代码来源:AudioPlayerContainerActivity.java

示例2: onOptionsItemSelected

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    // Handle item selection
    switch (item.getItemId()) {
        case android.R.id.home:
            Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
            if (current instanceof StorageBrowserFragment)
                ((StorageBrowserFragment) current).goBack();
            else
                finish();
            return true;
        case R.id.ml_menu_sortby_name:
        case R.id.ml_menu_sortby_length:
            ((ISortable) mFragment).sortBy(item.getItemId() == R.id.ml_menu_sortby_name
            ? VideoListAdapter.SORT_BY_TITLE
            : VideoListAdapter.SORT_BY_LENGTH);
            break;
        case R.id.ml_menu_refresh:
            if (!MediaLibrary.getInstance().isWorking())
                MediaLibrary.getInstance().loadMediaItems(true);
            break;
    }
    return super.onOptionsItemSelected(item);
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:26,
代码来源:SecondaryActivity.java

示例3: onCreate

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mMediaLibrary = MediaLibrary.getInstance();

    mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mArtistsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mGenresAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);
    mPlaylistAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);

    mSongsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mArtistsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mAlbumsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mGenresAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mPlaylistAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:19,
代码来源:AudioBrowserFragment.java

示例4: update

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void update() {
    if (mService == null)
        return;
    mPlayPauseButton.setImageResource(mService.isPlaying() ? R.drawable.ic_pause : R.drawable.ic_play);
    if (mService.hasMedia()) {
        SharedPreferences mSettings= PreferenceManager.getDefaultSharedPreferences(this);
        if (mSettings.getBoolean(PreferencesActivity.VIDEO_RESTORE, false)){
            Util.commitPreferences(mSettings.edit().putBoolean(PreferencesActivity.VIDEO_RESTORE, false));
            mService.switchToVideo();
            finish();
            return;
        }
        mTitleTv.setText(mService.getTitle());
        mArtistTv.setText(mService.getArtist());
        mProgressBar.setMax((int) mService.getLength());
        MediaWrapper MediaWrapper = MediaLibrary.getInstance().getMediaItem(mService.getCurrentMediaLocation());
        Bitmap cover = AudioUtil.getCover(this, MediaWrapper, mCover.getWidth());
        if (cover == null)
            cover = mService.getCover();
        if (cover == null)
            mCover.setImageResource(R.drawable.background_cone);
        else
            mCover.setImageBitmap(cover);
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:27,
代码来源:AudioPlayerActivity.java

示例5: doRecommendations

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
private boolean doRecommendations() {
    mNotificationManager.cancelAll();
    String last = Uri.decode(PreferenceManager.getDefaultSharedPreferences(mContext).getString(PreferencesActivity.VIDEO_LAST, null));
    int id = 0;
    if (last != null) {
        buildRecommendation(MediaLibrary.getInstance().getMediaItem(last), id, Notification.PRIORITY_HIGH);
    }
    ArrayList<MediaWrapper> videoList = MediaLibrary.getInstance().getVideoItems();
    if (videoList == null || videoList.isEmpty())
        return false;
    Bitmap pic;
    Collections.shuffle(videoList);
    for (MediaWrapper mediaWrapper : videoList){
        if (TextUtils.equals(mediaWrapper.getLocation(), last))
            continue;
        pic = mMediaDatabase.getPicture(mediaWrapper.getUri());
        if (pic != null && pic.getByteCount() > 4 && mediaWrapper.getTime() == 0) {
            buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
        }
        if (id == NUM_RECOMMANDATIONS)
            break;
    }
    return true;
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:25,
代码来源:RecommendationsService.java

示例6: updateLib

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
public void updateLib() {
    if (mPreventRescan){
        mPreventRescan = false;
        return;
    }
    FragmentManager fm = getSupportFragmentManager();
    Fragment current = fm.findFragmentById(R.id.fragment_placeholder);
    if (current != null && current instanceof IRefreshable)
        ((IRefreshable) current).refresh();
    else
        MediaLibrary.getInstance().scanMediaItems();
    Fragment fragment = fm.findFragmentByTag(SidebarAdapter.SidebarEntry.ID_AUDIO);
    if (fragment != null && !fragment.equals(current)) {
        ((MediaBrowserFragment)fragment).clear();
    }
    fragment = fm.findFragmentByTag(SidebarAdapter.SidebarEntry.ID_VIDEO);
    if (fragment != null && !fragment.equals(current)) {
        ((MediaBrowserFragment)fragment).clear();
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:21,
代码来源:AudioPlayerContainerActivity.java

示例7: onOptionsItemSelected

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    // Handle item selection
    switch (item.getItemId()) {
        case android.R.id.home:
            Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
            if (current instanceof StorageBrowserFragment)
                ((StorageBrowserFragment) current).goBack();
            else
                finish();
            return true;
        case R.id.ml_menu_sortby_name:
        case R.id.ml_menu_sortby_length:
            ((ISortable) mFragment).sortBy(item.getItemId() == R.id.ml_menu_sortby_name
            ? VideoListAdapter.SORT_BY_TITLE
            : VideoListAdapter.SORT_BY_LENGTH);
            break;
        case R.id.ml_menu_refresh:
            if (!MediaLibrary.getInstance().isWorking())
                MediaLibrary.getInstance().scanMediaItems(true);
            break;
    }
    return super.onOptionsItemSelected(item);
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:26,
代码来源:SecondaryActivity.java

示例8: onResume

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
protected void onResume() {
	super.onResume();
	mAudioController.addAudioPlayer(mAudioPlayer);
	AudioServiceController.getInstance().bindAudioService(this);

	/*
	 * FIXME: this is used to avoid having MainActivity twice in the
	 * backstack
	 */
	if (getIntent().hasExtra(AudioService.START_FROM_NOTIFICATION))
		getIntent().removeExtra(AudioService.START_FROM_NOTIFICATION);

	/* Load media items from database and storage */
	if (mScanNeeded)
		MediaLibrary.getInstance().loadMediaItems();
}
 

开发者ID:smyhvae,
项目名称:VlcTest,
代码行数:18,
代码来源:MainActivity.java

示例9: onPause

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
/**
 * Stop audio player and save opened tab
 */
@Override
protected void onPause() {
	super.onPause();

	/* Check for an ongoing scan that needs to be resumed during onResume */
	mScanNeeded = MediaLibrary.getInstance().isWorking();
	/* Stop scanning for files */
	MediaLibrary.getInstance().stop();
	/* Save the tab status in pref */
	SharedPreferences.Editor editor = getSharedPreferences("MainActivity",
			MODE_PRIVATE).edit();
	editor.putString("fragment", mCurrentFragment);
	editor.commit();

	mAudioController.removeAudioPlayer(mAudioPlayer);
	AudioServiceController.getInstance().unbindAudioService(this);
}
 

开发者ID:smyhvae,
项目名称:VlcTest,
代码行数:21,
代码来源:MainActivity.java

示例10: onCreate

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mAudioController = AudioServiceController.getInstance();

    mMediaLibrary = MediaLibrary.getInstance();

    mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mArtistsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mGenresAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);

    mSongsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mArtistsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mAlbumsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mGenresAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
}
 

开发者ID:smyhvae,
项目名称:VlcTest,
代码行数:19,
代码来源:AudioBrowserFragment.java

示例11: handleMessage

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    VideoGridFragment fragment = getOwner();
    if(fragment == null) return;

    switch (msg.what) {
    case UPDATE_ITEM:
        fragment.updateItem();
        break;
    case MediaLibrary.MEDIA_ITEMS_UPDATED:
        // Don't update the adapter while the layout animation is running
        if (fragment.mAnimator.isAnimationDone())
            fragment.updateList();
        else
            sendEmptyMessageDelayed(msg.what, 500);
        break;
    }
}
 

开发者ID:smyhvae,
项目名称:VlcTest,
代码行数:19,
代码来源:VideoGridFragment.java

示例12: onPause

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
/**
 * Stop audio player and save opened tab
 */
@Override
protected void onPause() {
    super.onPause();

    /* Check for an ongoing scan that needs to be resumed during onResume */
    mScanNeeded = MediaLibrary.getInstance(this).isWorking();
    /* Stop scanning for files */
    MediaLibrary.getInstance(this).stop();
    /* Save the tab status in pref */
    SharedPreferences.Editor editor = getSharedPreferences("MainActivity", MODE_PRIVATE).edit();
    /* Do not save the albums songs fragment as the current fragment. */
    if (mCurrentFragment.equals("albumsSongs")
        || mCurrentFragment.equals("equalizer"))
        mCurrentFragment = "audio";
    editor.putString("fragment", mCurrentFragment);
    editor.commit();

    mAudioController.removeAudioPlayer(mAudioPlayer);
    AudioServiceController.getInstance().unbindAudioService(this);
}
 

开发者ID:KlepikovMD,
项目名称:popcorntime-android-kitkat,
代码行数:24,
代码来源:MainActivity.java

示例13: onCreate

点赞 3

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mAudioController = AudioServiceController.getInstance();

    mMediaLibrary = MediaLibrary.getInstance(getActivity());

    mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mArtistsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mGenresAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);

    mSongsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mArtistsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mAlbumsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mGenresAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
}
 

开发者ID:KlepikovMD,
项目名称:popcorntime-android-kitkat,
代码行数:19,
代码来源:AudioBrowserFragment.java

示例14: onCreate

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);
    mAdapter.addAll(MediaLibrary.getInstance().getPlaylistDbItems());
    mTracks = getArguments().getParcelableArrayList(KEY_TRACKS);
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:8,
代码来源:SavePlaylistDialog.java

示例15: onCreate

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
    mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);

    mAlbumsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);
    mSongsAdapter.setContextPopupMenuListener(mContextPopupMenuListener);

    mMediaLibrary = MediaLibrary.getInstance();
    if (savedInstanceState != null)
        setMediaList(savedInstanceState.<MediaWrapper>getParcelableArrayList("list"), savedInstanceState.getString("title"));
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:14,
代码来源:AudioAlbumsSongsFragment.java

示例16: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    final AudioBrowserFragment fragment = getOwner();
    if(fragment == null) return;

    switch (msg.what) {
        case MediaLibrary.MEDIA_ITEMS_UPDATED:
            fragment.updateLists();
            break;
        case MSG_LOADING:
            if (fragment.mArtistsAdapter.isEmpty() && fragment.mAlbumsAdapter.isEmpty() &&
                    fragment.mSongsAdapter.isEmpty() && fragment.mGenresAdapter.isEmpty())
                fragment.mSwipeRefreshLayout.setRefreshing(true);
            break;
        case DELETE_MEDIA:
            MediaWrapper mw = fragment.mSongsAdapter.getItem(msg.arg1).mMediaList.get(0);
            final String path = mw.getUri().getPath();
            //Let's keep this toast while duration is not set correctly
            new Thread(new Runnable() {
                public void run() {
                    Util.recursiveDelete(VLCApplication.getAppContext(), new File(path));
                }
            }).start();
            fragment.mMediaLibrary.getMediaItems().remove(mw);
            refresh(fragment, path);
            break;
        case DELETE_PLAYLIST:
            AudioBrowserListAdapter.ListItem listItem = fragment.mPlaylistAdapter.getItem(msg.arg1);
            //Let's keep this toast while duration is not set correctly
            if (!MediaDatabase.getInstance().playlistExists(listItem.mTitle)) { //File playlist
                MediaWrapper media = listItem.mMediaList.get(0);
                fragment.mMediaLibrary.getMediaItems().remove(media);
                refresh(fragment, media.getLocation());
            } else {
                MediaDatabase.getInstance().playlistDelete(listItem.mTitle);
            }
            fragment.updateLists();
            break;
    }
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:41,
代码来源:AudioBrowserFragment.java

示例17: updateLists

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
private void updateLists() {
    clear();
    mAudioList = MediaLibrary.getInstance().getAudioItems();
    if (mAudioList.isEmpty()){
        updateEmptyView(mViewPager.getCurrentItem());
        mSwipeRefreshLayout.setRefreshing(false);
        mTabLayout.setVisibility(View.GONE);
        focusHelper(true, R.id.artists_list);
    } else {
        mTabLayout.setVisibility(View.VISIBLE);
        mHandler.sendEmptyMessageDelayed(MSG_LOADING, 300);

        ExecutorService tpe = Executors.newSingleThreadExecutor();
        ArrayList<Runnable> tasks = new ArrayList<Runnable>(Arrays.asList(updateArtists,
                updateAlbums, updateSongs, updateGenres, updatePlaylists));

        //process the visible list first
        tasks.add(0, tasks.remove(mViewPager.getCurrentItem()));
        tasks.add(new Runnable() {
            @Override
            public void run() {
                if (!mAdaptersToNotify.isEmpty())
                    display();
            }
        });
        for (Runnable task : tasks)
            tpe.submit(task);
    }
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:30,
代码来源:AudioBrowserFragment.java

示例18: onCreate

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mVideoAdapter = new VideoListAdapter(this);
    mMediaLibrary = MediaLibrary.getInstance();

    if (savedInstanceState != null)
        setGroup(savedInstanceState.getString(KEY_GROUP));
    /* Load the thumbnailer */
    FragmentActivity activity = getActivity();
    if (activity != null)
        mThumbnailer = new Thumbnailer(activity, activity.getWindowManager().getDefaultDisplay());
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:15,
代码来源:VideoGridFragment.java

示例19: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    MediaInfoFragment fragment = getOwner();
    if(fragment == null) return;

    switch (msg.what) {
        case NEW_IMAGE:
            fragment.updateImage();
            break;
        case NEW_TEXT:
            fragment.updateText();
            break;
        case NEW_SIZE:
            fragment.updateSize((Long) msg.obj);
            break;
        case HIDE_DELETE:
            fragment.mDelete.setClickable(false);
            fragment.mDelete.setVisibility(View.GONE);
            break;
        case EXIT:
            fragment.getActivity().finish();
            MediaLibrary.getInstance().loadMediaItems(true);
            break;
        case SHOW_SUBTITLES:
            fragment.mSubtitles.setVisibility(View.VISIBLE);
            break;
    }
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:29,
代码来源:MediaInfoFragment.java

示例20: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    IVideoBrowser owner = getOwner();
    if(owner == null) return;

    switch (msg.what) {
        case UPDATE_ITEM:
            owner.updateItem();
            break;
        case MediaLibrary.MEDIA_ITEMS_UPDATED:
            owner.updateList();
            break;
    }
}
 

开发者ID:jiaZengShen,
项目名称:vlc_android_win,
代码行数:15,
代码来源:VideoListHandler.java

示例21: onActivityResult

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
        if (resultCode == PreferencesActivity.RESULT_RESCAN)
            MediaLibrary.getInstance().scanMediaItems(true);
        else if (resultCode == PreferencesActivity.RESULT_RESTART) {
            Intent intent = getIntent();
            finish();
            startActivity(intent);
        }
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:14,
代码来源:MainTvActivity.java

示例22: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    super.handleMessage(msg);
    switch (msg.what){
        case MediaLibrary.MEDIA_ITEMS_UPDATED:
            if (getOwner() != null)
                getOwner().updateList();
            break;
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:11,
代码来源:MusicFragment.java

示例23: loadRows

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
private void loadRows(String query, int type) {
    ArrayList<MediaWrapper> mediaList = MediaLibrary.getInstance().searchMedia(query);
    final ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter(mActivity));
    listRowAdapter.addAll(0, mediaList);
    mHandler.post(new Runnable() {
        @Override
        public void run() {
            HeaderItem header = new HeaderItem(0, getResources().getString(R.string.search_results));
            mRowsAdapter.add(new ListRow(header, listRowAdapter));
        }
    });
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:13,
代码来源:SearchFragment.java

示例24: onHandleIntent

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
    if (intent != null && !doRecommendations()) {
        MediaLibrary.getInstance().addUpdateHandler(mHandler);
        MediaLibrary.getInstance().scanMediaItems();
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:8,
代码来源:RecommendationsService.java

示例25: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    final AudioBrowserFragment fragment = getOwner();
    if(fragment == null) return;

    switch (msg.what) {
        case MediaLibrary.MEDIA_ITEMS_UPDATED:
            fragment.updateLists();
            break;
        case MSG_LOADING:
            if (fragment.mArtistsAdapter.isEmpty() && fragment.mAlbumsAdapter.isEmpty() &&
                    fragment.mSongsAdapter.isEmpty() && fragment.mGenresAdapter.isEmpty())
                fragment.mSwipeRefreshLayout.setRefreshing(true);
            break;
        case DELETE_MEDIA:
            MediaWrapper mw = fragment.mSongsAdapter.getItem(msg.arg1).mMediaList.get(0);
            final String path = mw.getUri().getPath();
            //Let's keep this toast while duration is not set correctly
            VLCApplication.runBackground(new Runnable() {
                public void run() {
                    Util.recursiveDelete(VLCApplication.getAppContext(), new File(path));
                }
            });
            fragment.mMediaLibrary.getMediaItems().remove(mw);
            refresh(fragment, path);
            break;
        case DELETE_PLAYLIST:
            AudioBrowserListAdapter.ListItem listItem = fragment.mPlaylistAdapter.getItem(msg.arg1);
            //Let's keep this toast while duration is not set correctly
            if (!MediaDatabase.getInstance().playlistExists(listItem.mTitle)) { //File playlist
                MediaWrapper media = listItem.mMediaList.get(0);
                fragment.mMediaLibrary.getMediaItems().remove(media);
                refresh(fragment, media.getLocation());
            } else {
                MediaDatabase.getInstance().playlistDelete(listItem.mTitle);
            }
            fragment.updateLists();
            break;
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:41,
代码来源:AudioBrowserFragment.java

示例26: updateLists

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
private void updateLists() {
    mAudioList = MediaLibrary.getInstance().getAudioItems();
    if (mAudioList.isEmpty()){
        updateEmptyView(mViewPager.getCurrentItem());
        mSwipeRefreshLayout.setRefreshing(false);
        mTabLayout.setVisibility(View.GONE);
        focusHelper(true, R.id.artists_list);
    } else {
        mTabLayout.setVisibility(View.VISIBLE);
        mHandler.sendEmptyMessageDelayed(MSG_LOADING, 300);

        final ArrayList<Runnable> tasks = new ArrayList<Runnable>(Arrays.asList(updateArtists,
                updateAlbums, updateSongs, updateGenres, updatePlaylists));

        //process the visible list first
        tasks.add(0, tasks.remove(mViewPager.getCurrentItem()));
        tasks.add(new Runnable() {
            @Override
            public void run() {
                if (!mAdaptersToNotify.isEmpty())
                    display();
            }
        });
        VLCApplication.runBackground(new Runnable() {
            @Override
            public void run() {
                for (Runnable task : tasks)
                    task.run();
            }
        });
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:33,
代码来源:AudioBrowserFragment.java

示例27: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    MediaInfoFragment fragment = getOwner();
    if(fragment == null) return;

    switch (msg.what) {
        case NEW_IMAGE:
            fragment.updateImage();
            break;
        case NEW_TEXT:
            fragment.updateText();
            break;
        case NEW_SIZE:
            fragment.updateSize((Long) msg.obj);
            break;
        case HIDE_DELETE:
            fragment.mDelete.setClickable(false);
            fragment.mDelete.setVisibility(View.GONE);
            break;
        case EXIT:
            fragment.getActivity().finish();
            MediaLibrary.getInstance().scanMediaItems(true);
            break;
        case SHOW_SUBTITLES:
            fragment.mSubtitles.setVisibility(View.VISIBLE);
            break;
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:29,
代码来源:MediaInfoFragment.java

示例28: handleMessage

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    IVideoBrowser owner = getOwner();
    if(owner == null) return;

    switch (msg.what) {
        case UPDATE_ITEM:
            owner.updateItem((MediaWrapper)msg.obj);
            break;
        case MediaLibrary.MEDIA_ITEMS_UPDATED:
            Log.d("load", "MEDIA_ITEMS_UPDATED");
            owner.updateList();
            break;
    }
}
 

开发者ID:hanhailong,
项目名称:VCL-Android,
代码行数:16,
代码来源:VideoListHandler.java

示例29: onActivityResult

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
        if (resultCode == PreferencesActivity.RESULT_RESCAN)
            MediaLibrary.getInstance().loadMediaItems(true);
        else if (resultCode == PreferencesActivity.RESULT_RESTART) {
            Intent intent = getIntent();
            finish();
            startActivity(intent);
        }
    }
}
 

开发者ID:xuie0000,
项目名称:vlc-android,
代码行数:14,
代码来源:MainTvActivity.java

示例30: onHandleIntent

点赞 2

import org.videolan.vlc.MediaLibrary; //导入依赖的package包/类
@Override
protected void onHandleIntent(Intent intent) {
    if (intent != null && !doRecommendations()) {
        MediaLibrary.getInstance().addUpdateHandler(mHandler);
        MediaLibrary.getInstance().loadMediaItems();
    }
}
 

开发者ID:xuie0000,
项目名称:vlc-android,
代码行数:8,
代码来源:RecommendationsService.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)