本文整理汇总了Java中org.videolan.vlc.gui.browser.MediaBrowserFragment类的典型用法代码示例。如果您正苦于以下问题:Java MediaBrowserFragment类的具体用法?Java MediaBrowserFragment怎么用?Java MediaBrowserFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MediaBrowserFragment类属于org.videolan.vlc.gui.browser包,在下文中一共展示了MediaBrowserFragment类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateLib
import org.videolan.vlc.gui.browser.MediaBrowserFragment; //导入依赖的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();
}
}
示例2: updateLib
import org.videolan.vlc.gui.browser.MediaBrowserFragment; //导入依赖的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();
}
}
示例3: onItemClick
import org.videolan.vlc.gui.browser.MediaBrowserFragment; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
SidebarAdapter.SidebarEntry entry = (SidebarEntry) mListView.getItemAtPosition(position);
Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
if(current == null || (entry != null && current.getTag().equals(entry.id))) { /* Already selected */
if (mFocusedPrior != 0)
requestFocusOnSearch();
mDrawerLayout.closeDrawer(mListView);
return;
}
// This should not happen
if(entry == null || entry.id == null)
return;
if (entry.type == SidebarEntry.TYPE_FRAGMENT) {
/* Slide down the audio player */
slideDownAudioPlayer();
/* Switch the fragment */
Fragment fragment = getFragment(entry.id);
if (fragment instanceof MediaBrowserFragment)
((MediaBrowserFragment)fragment).setReadyToDisplay(false);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.fragment_placeholder, fragment, entry.id);
ft.addToBackStack(mCurrentFragment);
ft.commit();
mCurrentFragment = entry.id;
mSidebarAdapter.setCurrentFragment(mCurrentFragment);
if (mFocusedPrior != 0)
requestFocusOnSearch();
} else if (entry.type == SidebarEntry.TYPE_SECONDARY_FRAGMENT)
showSecondaryFragment(SecondaryActivity.ABOUT);
else if (entry.attributeID == R.attr.ic_menu_preferences)
startActivityForResult(new Intent(this, PreferencesActivity.class), ACTIVITY_RESULT_PREFERENCES);
mDrawerLayout.closeDrawer(mListView);
}