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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }