Search in sources :

Example 76 with FragmentTransaction

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

the class SettingsActivity 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(R.id.main_content, 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 77 with FragmentTransaction

use of android.app.FragmentTransaction in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    if (pager == null) {
        if (getFragmentManager().findFragmentById(R.id.editor1) == null) {
            SamplePagerAdapter adapter = buildAdapter();
            FragmentTransaction ft = getFragmentManager().beginTransaction();
            populateColumn(getFragmentManager(), ft, adapter, 0, R.id.editor1);
            populateColumn(getFragmentManager(), ft, adapter, 1, R.id.editor2);
            populateColumn(getFragmentManager(), ft, adapter, 2, R.id.editor3);
            ft.commit();
        }
    } else {
        SamplePagerAdapter adapter = buildAdapter();
        pager.setAdapter(adapter);
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) ViewPager(android.support.v4.view.ViewPager)

Example 78 with FragmentTransaction

use of android.app.FragmentTransaction in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(String内容).
	 * @param context
	 *
	 */
public static AlertDialogFragment showAlertDialog(Context context, String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, message, null, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Example 79 with FragmentTransaction

use of android.app.FragmentTransaction in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class MapPrefActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MapPrefFragment settingsFragment = new MapPrefFragment();
    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(android.R.id.content, settingsFragment);
    fragmentTransaction.commit();
}
Also used : FragmentManager(android.app.FragmentManager) FragmentTransaction(android.app.FragmentTransaction) MapPrefFragment(com.secupwn.aimsicd.ui.fragments.MapPrefFragment)

Example 80 with FragmentTransaction

use of android.app.FragmentTransaction in project Android-IMSI-Catcher-Detector by CellularPrivacy.

the class PrefActivity method loadFragment.

private void loadFragment() {
    PrefFragment settingsFragment = new PrefFragment();
    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(android.R.id.content, settingsFragment);
    fragmentTransaction.commit();
}
Also used : FragmentManager(android.app.FragmentManager) FragmentTransaction(android.app.FragmentTransaction) PrefFragment(com.secupwn.aimsicd.ui.fragments.PrefFragment)

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