Search in sources :

Example 36 with FragmentManager

use of android.app.FragmentManager in project android_frameworks_base by ResurrectionRemix.

the class BaseActivity method reloadSearch.

private void reloadSearch(String query) {
    FragmentManager fm = getFragmentManager();
    RootInfo root = getCurrentRoot();
    DocumentInfo cwd = getCurrentDirectory();
    DirectoryFragment.reloadSearch(fm, root, cwd, query);
}
Also used : FragmentManager(android.app.FragmentManager) RootInfo(com.android.documentsui.model.RootInfo) DocumentInfo(com.android.documentsui.model.DocumentInfo)

Example 37 with FragmentManager

use of android.app.FragmentManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ExpandedDesktop method removeFragment.

private void removeFragment() {
    FragmentManager fragmentManager = getChildFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag(EXPANDED_DESKTOP_PREFERENCE_TAG);
    if (fragment != null) {
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.remove(fragment).commit();
    }
}
Also used : FragmentManager(android.app.FragmentManager) FragmentTransaction(android.app.FragmentTransaction) SettingsPreferenceFragment(com.android.settings.SettingsPreferenceFragment) Fragment(android.app.Fragment)

Example 38 with FragmentManager

use of android.app.FragmentManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionListViewSettings method onDestroyView.

@Override
public void onDestroyView() {
    super.onDestroyView();
    if (mAdditionalFragmentAttached) {
        FragmentManager fragmentManager = getFragmentManager();
        Fragment fragment = fragmentManager.findFragmentById(R.id.fragment_container);
        if (fragment != null && !fragmentManager.isDestroyed()) {
            fragmentManager.beginTransaction().remove(fragment).commit();
        }
    }
}
Also used : FragmentManager(android.app.FragmentManager) ListFragment(android.app.ListFragment) DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment)

Example 39 with FragmentManager

use of android.app.FragmentManager in project android_frameworks_base by ResurrectionRemix.

the class SharedLibraryMain method ensureVersion.

/**
     * Check that the library's version is at least the given minimum version,
     * displaying a dialog to have the user install an update if that is not true.
     * The dialog is displayed as a DialogFragment in your activity if a newer
     * version is needed.  If a newer version is needed, false is returned.
     */
public static boolean ensureVersion(final Activity activity, int minVersion) {
    final FragmentManager fm = activity.getFragmentManager();
    final String dialogTag = LIBRARY_PACKAGE + ":version";
    Fragment curDialog = fm.findFragmentByTag(dialogTag);
    if (getVersion(activity) >= minVersion) {
        // we had shown is removed before returning.
        if (curDialog != null) {
            fm.beginTransaction().remove(curDialog).commitAllowingStateLoss();
        }
        return true;
    }
    // If we don't already have a version dialog displayed, display it now.
    if (curDialog == null) {
        curDialog = new VersionDialog();
        fm.beginTransaction().add(curDialog, dialogTag).commitAllowingStateLoss();
    }
    // Tell the caller that the current version is not sufficient.
    return false;
}
Also used : FragmentManager(android.app.FragmentManager) Fragment(android.app.Fragment)

Example 40 with FragmentManager

use of android.app.FragmentManager in project android_frameworks_base by ResurrectionRemix.

the class FilesActivity method refreshDirectory.

@Override
void refreshDirectory(int anim) {
    final FragmentManager fm = getFragmentManager();
    final RootInfo root = getCurrentRoot();
    final DocumentInfo cwd = getCurrentDirectory();
    assert (!mSearchManager.isSearching());
    if (cwd == null) {
        DirectoryFragment.showRecentsOpen(fm, anim);
    } else {
        // Normal boring directory
        DirectoryFragment.showDirectory(fm, root, cwd, anim);
    }
}
Also used : FragmentManager(android.app.FragmentManager) RootInfo(com.android.documentsui.model.RootInfo) DocumentInfo(com.android.documentsui.model.DocumentInfo)

Aggregations

FragmentManager (android.app.FragmentManager)177 FragmentTransaction (android.app.FragmentTransaction)84 Fragment (android.app.Fragment)51 Bundle (android.os.Bundle)22 DocumentInfo (com.android.documentsui.model.DocumentInfo)20 DialogFragment (android.app.DialogFragment)15 RootInfo (com.android.documentsui.model.RootInfo)15 ActionBar (android.support.v7.app.ActionBar)12 Intent (android.content.Intent)11 File (java.io.File)6 MediaRouter (android.media.MediaRouter)5 Uri (android.net.Uri)5 StorageManager (android.os.storage.StorageManager)5 VolumeInfo (android.os.storage.VolumeInfo)5 MenuItem (android.view.MenuItem)5 IOException (java.io.IOException)5 Toolbar (android.support.v7.widget.Toolbar)4 View (android.view.View)4 DialogInterface (android.content.DialogInterface)3 ViewGroup (android.view.ViewGroup)3