Пример #1
0
  protected android.support.v4.app.Fragment findFragmentByTag(String tag) {
    android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
    android.support.v4.app.Fragment fragment = fragmentManager.findFragmentByTag(tag);
    EFLogger.i(TAG, "findFragmentByTag,tag=" + tag + ",fragment=" + fragment);

    return fragment;
  }
Пример #2
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();
  }
Пример #3
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();
 }
Пример #4
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();
  }
Пример #5
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();
 }
Пример #6
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();
  }
Пример #7
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();
  }
Пример #8
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();
 }
Пример #9
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();
 }
Пример #10
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();
 }