use of android.support.v4.app.FragmentTransaction in project weiciyuan by qii.
the class LeftMenuFragment method showProfilePageImp.
private void showProfilePageImp() {
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.hide(rightFragments.get(HOME_INDEX));
ft.hide(rightFragments.get(MENTIONS_INDEX));
ft.hide(rightFragments.get(COMMENTS_INDEX));
ft.hide(rightFragments.get(SEARCH_INDEX));
ft.hide(rightFragments.get(DM_INDEX));
ft.hide(rightFragments.get(FAV_INDEX));
UserInfoFragment fragment = (UserInfoFragment) rightFragments.get(PROFILE_INDEX);
ft.show(fragment);
ft.commit();
((UserInfoFragment) fragment).buildActionBarAndViewPagerTitles();
AnimationUtility.translateFragmentY(fragment, -400, 0, fragment);
}
use of android.support.v4.app.FragmentTransaction in project weiciyuan by qii.
the class LeftMenuFragment method showHomePageImp.
private void showHomePageImp() {
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.hide(rightFragments.get(MENTIONS_INDEX));
ft.hide(rightFragments.get(COMMENTS_INDEX));
ft.hide(rightFragments.get(SEARCH_INDEX));
ft.hide(rightFragments.get(DM_INDEX));
ft.hide(rightFragments.get(FAV_INDEX));
ft.hide(rightFragments.get(PROFILE_INDEX));
FriendsTimeLineFragment fragment = (FriendsTimeLineFragment) rightFragments.get(HOME_INDEX);
ft.show(fragment);
ft.commit();
setTitle("");
fragment.buildActionBarNav();
}
use of android.support.v4.app.FragmentTransaction in project weiciyuan by qii.
the class LeftMenuFragment method showMentionPageImp.
private void showMentionPageImp() {
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.hide(rightFragments.get(HOME_INDEX));
ft.hide(rightFragments.get(COMMENTS_INDEX));
ft.hide(rightFragments.get(SEARCH_INDEX));
ft.hide(rightFragments.get(DM_INDEX));
ft.hide(rightFragments.get(FAV_INDEX));
ft.hide(rightFragments.get(PROFILE_INDEX));
Fragment m = rightFragments.get(MENTIONS_INDEX);
if (firstStart) {
int navPosition = GlobalContext.getInstance().getAccountBean().getNavigationPosition() / 10;
if (navPosition == MENTIONS_INDEX) {
mentionsTabIndex = GlobalContext.getInstance().getAccountBean().getNavigationPosition() % 10;
}
}
m.getArguments().putInt("mentionsTabIndex", mentionsTabIndex);
ft.show(m);
ft.commit();
((MentionsTimeLine) m).buildActionBarAndViewPagerTitles(mentionsTabIndex);
}
use of android.support.v4.app.FragmentTransaction in project robolectric by robolectric.
the class ShadowDialogFragmentTest method removeUsingTransaction_shouldDismissTheDialog.
@Test
public void removeUsingTransaction_shouldDismissTheDialog() throws Exception {
dialogFragment.show(fragmentManager, null);
FragmentTransaction t = fragmentManager.beginTransaction();
t.remove(dialogFragment);
t.commit();
Dialog dialog = ShadowDialog.getLatestDialog();
assertFalse(dialog.isShowing());
assertTrue(shadowOf(dialog).hasBeenDismissed());
}
use of android.support.v4.app.FragmentTransaction in project roboguice by roboguice.
the class FragmentInjectionTest method startFragment.
// http://stackoverflow.com/questions/11333354/how-can-i-test-fragments-with-robolectric
protected static void startFragment(FragmentActivity activity, Fragment fragment) {
final FragmentManager fragmentManager = activity.getSupportFragmentManager();
final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(fragment, null);
fragmentTransaction.commit();
}
Aggregations