Search in sources :

Example 6 with ExtensionBrowser

use of org.videolan.vlc.gui.browser.ExtensionBrowser in project vlc-android by videolan.

the class MainActivity method restoreFragmentsStack.

private void restoreFragmentsStack(Bundle savedInstanceState, FragmentManager fm) {
    final List<Fragment> fragments = fm.getFragments();
    if (fragments != null) {
        final FragmentTransaction ft = fm.beginTransaction();
        final Fragment displayed = fm.getFragment(savedInstanceState, "current_fragment_visible");
        for (Fragment fragment : fragments) if (fragment != null) {
            if (fragment instanceof ExtensionBrowser) {
                ft.remove(fragment);
            } else if ((fragment instanceof MediaBrowserFragment)) {
                mFragmentsStack.put(fragment.getTag(), new WeakReference<>(fragment));
                if (!TextUtils.equals(fragment.getTag(), displayed.getTag()))
                    ft.hide(fragment);
            }
        }
        ft.commit();
    }
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) ExtensionBrowser(org.videolan.vlc.gui.browser.ExtensionBrowser) FileBrowserFragment(org.videolan.vlc.gui.browser.FileBrowserFragment) MediaBrowserFragment(org.videolan.vlc.gui.browser.MediaBrowserFragment) PreferencesFragment(org.videolan.vlc.gui.preferences.PreferencesFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment) NetworkBrowserFragment(org.videolan.vlc.gui.browser.NetworkBrowserFragment) MRLPanelFragment(org.videolan.vlc.gui.network.MRLPanelFragment) BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment) MediaBrowserFragment(org.videolan.vlc.gui.browser.MediaBrowserFragment)

Example 7 with ExtensionBrowser

use of org.videolan.vlc.gui.browser.ExtensionBrowser in project vlc-android by GeoffreyMetais.

the class MainActivity method onBackPressed.

@Override
public void onBackPressed() {
    /* Close the menu first */
    if (mDrawerLayout.isDrawerOpen(mNavigationView)) {
        closeDrawer();
        return;
    }
    /* Close playlist search if open or Slide down the audio player if it is shown entirely. */
    if (isAudioPlayerReady() && (mAudioPlayer.clearSearch() || slideDownAudioPlayer()))
        return;
    // If it's the directory view, a "backpressed" action shows a parent.
    final Fragment fragment = getCurrentFragment();
    if (fragment instanceof BaseBrowserFragment && ((BaseBrowserFragment) fragment).goBack()) {
        return;
    } else if (fragment instanceof ExtensionBrowser) {
        ((ExtensionBrowser) fragment).goBack();
        return;
    }
    if (AndroidUtil.isNougatOrLater && isInMultiWindowMode()) {
        UiTools.confirmExit(this);
        return;
    }
    finish();
}
Also used : BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment) ExtensionBrowser(org.videolan.vlc.gui.browser.ExtensionBrowser) PreferencesFragment(org.videolan.vlc.gui.preferences.PreferencesFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment) BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment)

Example 8 with ExtensionBrowser

use of org.videolan.vlc.gui.browser.ExtensionBrowser in project vlc-android by GeoffreyMetais.

the class MainActivity method onSaveInstanceState.

protected void onSaveInstanceState(Bundle outState) {
    final Fragment current = mNavigator.getCurrentFragment();
    if (!(current instanceof ExtensionBrowser))
        getSupportFragmentManager().putFragment(outState, "current_fragment", current);
    super.onSaveInstanceState(outState);
    outState.putInt("current", mNavigator.getCurrentFragmentId());
}
Also used : ExtensionBrowser(org.videolan.vlc.gui.browser.ExtensionBrowser) PreferencesFragment(org.videolan.vlc.gui.preferences.PreferencesFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment) BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment)

Aggregations

ExtensionBrowser (org.videolan.vlc.gui.browser.ExtensionBrowser)8 Fragment (android.support.v4.app.Fragment)5 AudioBrowserFragment (org.videolan.vlc.gui.audio.AudioBrowserFragment)5 BaseBrowserFragment (org.videolan.vlc.gui.browser.BaseBrowserFragment)5 PreferencesFragment (org.videolan.vlc.gui.preferences.PreferencesFragment)5 VideoGridFragment (org.videolan.vlc.gui.video.VideoGridFragment)5 FragmentTransaction (android.support.v4.app.FragmentTransaction)3 FileBrowserFragment (org.videolan.vlc.gui.browser.FileBrowserFragment)3 MediaBrowserFragment (org.videolan.vlc.gui.browser.MediaBrowserFragment)3 NetworkBrowserFragment (org.videolan.vlc.gui.browser.NetworkBrowserFragment)3 MRLPanelFragment (org.videolan.vlc.gui.network.MRLPanelFragment)3 MenuItem (android.view.MenuItem)2 Filterable (org.videolan.vlc.interfaces.Filterable)2 Bundle (android.os.Bundle)1 FragmentManager (android.support.v4.app.FragmentManager)1 ArrayList (java.util.ArrayList)1 VLCExtensionItem (org.videolan.vlc.extensions.api.VLCExtensionItem)1