use of android.support.v4.app.FragmentTransaction in project cw-omnibus by commonsguy.
the class ActionBarImpl method selectTab.
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
FragmentTransaction trans = null;
if (mActivity instanceof FragmentActivity) {
trans = ((FragmentActivity) mActivity).getSupportFragmentManager().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 != null && !trans.isEmpty()) {
trans.commit();
}
}
use of android.support.v4.app.FragmentTransaction in project Signal-Android by WhisperSystems.
the class MmsPreferencesActivity method onCreate.
@Override
protected void onCreate(Bundle icicle, @NonNull MasterSecret masterSecret) {
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Fragment fragment = new MmsPreferencesFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, fragment);
fragmentTransaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project Android-Developers-Samples by johnjohndoe.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
BasicAndroidKeyStoreFragment fragment = new BasicAndroidKeyStoreFragment();
transaction.add(fragment, FRAGTAG);
transaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project Android-Developers-Samples by johnjohndoe.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
AdvancedImmersiveModeFragment fragment = new AdvancedImmersiveModeFragment();
transaction.replace(R.id.sample_content_fragment, fragment);
transaction.commit();
}
use of android.support.v4.app.FragmentTransaction in project Android-ObservableScrollView by ksoichiro.
the class FragmentActionBarControlListViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragmentactionbarcontrol);
FragmentManager fm = getSupportFragmentManager();
if (fm.findFragmentByTag(FragmentTransitionDefaultFragment.FRAGMENT_TAG) == null) {
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.id.container, new FragmentActionBarControlListViewFragment(), FragmentActionBarControlListViewFragment.FRAGMENT_TAG);
ft.commit();
fm.executePendingTransactions();
}
}
Aggregations