예제 #1
0
  private void replaceChildFragment(android.support.v4.app.Fragment fragment) {
    android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(CONTENT_VIEW_ID, fragment);

    fragmentTransaction.commitAllowingStateLoss();
  }
예제 #2
0
 protected void addChildFragment(android.support.v4.app.Fragment fragment, String tag) {
   android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
   fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
   fragmentTransaction.add(CONTENT_VIEW_ID, fragment, tag);
   fragmentTransaction.commitAllowingStateLoss();
 }
예제 #3
0
  protected void hideFragment(android.support.v4.app.Fragment fragment) {
    if (null == fragment) {
      return;
    }

    android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.hide(fragment);
    fragmentTransaction.commitAllowingStateLoss();
  }
예제 #4
0
 protected void showFragment(
     android.support.v4.app.Fragment fragment, String tag, boolean fromLeftToRight) {
   android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
   if (fromLeftToRight) {
     fragmentTransaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left);
   } else {
     fragmentTransaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);
   }
   fragmentTransaction.show(fragment);
   fragmentTransaction.commit();
 }
예제 #5
0
  protected void addChildFragment(
      android.support.v4.app.Fragment fragment, String tag, boolean fromLeftToRight) {
    android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    if (fromLeftToRight) {
      fragmentTransaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left);
    } else {

      fragmentTransaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);
    }
    fragmentTransaction.add(CONTENT_VIEW_ID, fragment, tag);
    // fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    // fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    // fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commitAllowingStateLoss();
  }
예제 #6
0
  protected void hideFragment(android.support.v4.app.Fragment fragment, boolean fromLeftToRight) {
    if (null == fragment) {
      return;
    }

    android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    if (fromLeftToRight) {
      fragmentTransaction.setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left);
    } else {

      fragmentTransaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    fragmentTransaction.hide(fragment);
    fragmentTransaction.commitAllowingStateLoss();
  }
예제 #7
0
 protected void removeFragment(android.support.v4.app.Fragment fragment) {
   android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
   fragmentTransaction.remove(fragment);
   fragmentTransaction.commitAllowingStateLoss();
 }
예제 #8
0
 protected void showChildFragment(android.support.v4.app.Fragment fragment, String tag) {
   android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
   fragmentTransaction.replace(CONTENT_VIEW_ID, fragment, tag);
   fragmentTransaction.commit();
 }
예제 #9
0
 private void addChildFragment(android.support.v4.app.Fragment childFragment) {
   android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
   fragmentTransaction.add(CONTENT_VIEW_ID, childFragment);
   fragmentTransaction.commit();
 }