Search in sources :

Example 71 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project SeriesGuide by UweTrottmann.

the class ConnectTraktFragment method replaceWithCredentialsFragment.

private void replaceWithCredentialsFragment() {
    ConnectTraktCredentialsFragment f = ConnectTraktCredentialsFragment.newInstance();
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.replace(R.id.content_frame, f);
    ft.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 72 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project SeriesGuide by UweTrottmann.

the class StatsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_singlepane_drawer);
    setupActionBar();
    setupNavDrawer();
    if (savedInstanceState == null) {
        StatsFragment f = new StatsFragment();
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.content_frame, f);
        ft.commit();
    }
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 73 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project SeriesGuide by UweTrottmann.

the class AddListDialogFragment method showAddListDialog.

/**
     * Display a dialog which allows to edit the title of this list or remove it.
     */
public static void showAddListDialog(FragmentManager fm) {
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction. We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag("addlistdialog");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    // Create and show the dialog.
    DialogFragment newFragment = AddListDialogFragment.newInstance();
    newFragment.show(ft, "addlistdialog");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 74 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project Signal-Android by WhisperSystems.

the class LogSubmitActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    dynamicTheme.onCreate(this);
    super.onCreate(icicle);
    setContentView(R.layout.log_submit_activity);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    SubmitLogFragment fragment = SubmitLogFragment.newInstance();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.fragment_container, fragment);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) SubmitLogFragment(org.whispersystems.libpastelog.SubmitLogFragment)

Example 75 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project native-navigation by airbnb.

the class ScreenCoordinator method presentScreen.

public void presentScreen(Fragment fragment, PresentAnimation anim, @Nullable Promise promise) {
    if (fragment == null) {
        throw new IllegalArgumentException("Fragment must not be null.");
    }
    BackStack bsi = new BackStack(getNextStackTag(), anim, promise);
    backStacks.push(bsi);
    // TODO: dry this up with pushScreen
    FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction().setAllowOptimization(true).setCustomAnimations(anim.enter, anim.exit, anim.popEnter, anim.popExit);
    Fragment currentFragment = getCurrentFragment();
    if (currentFragment != null) {
        ft.detach(currentFragment);
    }
    ft.add(container.getId(), fragment).addToBackStack(bsi.getTag()).commit();
    activity.getSupportFragmentManager().executePendingTransactions();
    bsi.pushFragment(fragment);
    Log.d(TAG, toString());
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment)

Aggregations

FragmentTransaction (android.support.v4.app.FragmentTransaction)392 Fragment (android.support.v4.app.Fragment)135 FragmentManager (android.support.v4.app.FragmentManager)79 View (android.view.View)29 DialogFragment (android.support.v4.app.DialogFragment)27 FragmentActivity (android.support.v4.app.FragmentActivity)25 Bundle (android.os.Bundle)21 TextView (android.widget.TextView)19 FragmentTransaction (android.app.FragmentTransaction)18 Intent (android.content.Intent)18 Button (android.widget.Button)17 OnClickListener (android.view.View.OnClickListener)16 SherlockFragment (com.actionbarsherlock.app.SherlockFragment)12 ActionBar (android.support.v7.app.ActionBar)8 TargetApi (android.annotation.TargetApi)6 AppCompatActivity (android.support.v7.app.AppCompatActivity)6 Toolbar (android.support.v7.widget.Toolbar)6 FriendsTimeLineFragment (org.qii.weiciyuan.ui.maintimeline.FriendsTimeLineFragment)6 UserInfoFragment (org.qii.weiciyuan.ui.userinfo.UserInfoFragment)6 Transition (android.transition.Transition)5