Search in sources :

Example 91 with FragmentTransaction

use of android.app.FragmentTransaction in project Etar-Calendar by Etar-Group.

the class SelectVisibleCalendarsActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    dynamicTheme.onCreate(this);
    setContentView(R.layout.simple_frame_layout);
    mController = CalendarController.getInstance(this);
    mFragment = (SelectVisibleCalendarsFragment) getFragmentManager().findFragmentById(R.id.main_frame);
    if (mFragment == null) {
        mFragment = new SelectVisibleCalendarsFragment(R.layout.calendar_sync_item);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.main_frame, mFragment);
        ft.show(mFragment);
        ft.commit();
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 92 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by DirtyUnicorns.

the class OperationDialogFragment method show.

public static void show(FragmentManager fm, @DialogType int dialogType, ArrayList<DocumentInfo> failedSrcList, DocumentStack dstStack, @OpType int operationType) {
    final Bundle args = new Bundle();
    args.putInt(FileOperationService.EXTRA_DIALOG_TYPE, dialogType);
    args.putInt(FileOperationService.EXTRA_OPERATION, operationType);
    args.putParcelableArrayList(FileOperationService.EXTRA_SRC_LIST, failedSrcList);
    final FragmentTransaction ft = fm.beginTransaction();
    final OperationDialogFragment fragment = new OperationDialogFragment();
    fragment.setArguments(args);
    ft.add(fragment, TAG);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle)

Example 93 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by ParanoidAndroid.

the class ActionBarImpl method selectTab.

@Override
public void selectTab(Tab tab) {
    if (getNavigationMode() != NAVIGATION_MODE_TABS) {
        mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
        return;
    }
    final FragmentTransaction trans = mActivity.getFragmentManager().beginTransaction().disallowAddToBackStack();
    if (mSelectedTab == tab) {
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
            mTabScrollView.animateToTab(tab.getPosition());
        }
    } else {
        mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
        }
        mSelectedTab = (TabImpl) tab;
        if (mSelectedTab != null) {
            mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
        }
    }
    if (!trans.isEmpty()) {
        trans.commit();
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 94 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by AOSPA.

the class PreferenceActivity method startPreferenceFragment.

/**
     * Start a new fragment.
     *
     * @param fragment The fragment to start
     * @param push If true, the current fragment will be pushed onto the back stack.  If false,
     * the current fragment will be replaced.
     */
public void startPreferenceFragment(Fragment fragment, boolean push) {
    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.replace(com.android.internal.R.id.prefs, fragment);
    if (push) {
        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.addToBackStack(BACK_STACK_PREFS);
    } else {
        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    }
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 95 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by AOSPA.

the class RootsFragment method show.

public static void show(FragmentManager fm, Intent includeApps) {
    final Bundle args = new Bundle();
    args.putParcelable(EXTRA_INCLUDE_APPS, includeApps);
    final RootsFragment fragment = new RootsFragment();
    fragment.setArguments(args);
    final FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container_roots, fragment);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)266 FragmentManager (android.app.FragmentManager)84 Fragment (android.app.Fragment)82 Bundle (android.os.Bundle)44 DialogFragment (android.app.DialogFragment)20 Intent (android.content.Intent)18 FragmentActivity (android.support.v4.app.FragmentActivity)16 PreferenceFragment (android.support.v14.preference.PreferenceFragment)7 HashMap (java.util.HashMap)7 View (android.view.View)6 File (java.io.File)6 SuppressLint (android.annotation.SuppressLint)5 Uri (android.net.Uri)5 StorageManager (android.os.storage.StorageManager)5 VolumeInfo (android.os.storage.VolumeInfo)5 Fade (android.transition.Fade)5 TextView (android.widget.TextView)5 Selection (com.android.documentsui.dirlist.MultiSelectManager.Selection)5 IOException (java.io.IOException)5 Map (java.util.Map)4