当前位置: 首页>>代码示例>>Java>>正文


Java MediaBrowserFragment类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:21,代码来源:AudioPlayerContainerActivity.java

示例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();
    }
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:21,代码来源:AudioPlayerContainerActivity.java

示例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);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:41,代码来源:MainActivity.java


注:本文中的org.videolan.vlc.gui.browser.MediaBrowserFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。