public final class FragmentUtils
extends java.lang.Object
desc : Fragment 相关工具类
author : xuexiang
time : 2018/4/28 上午12:27
| Modifier and Type | Class and Description |
|---|---|
static class |
FragmentUtils.FragmentNode |
static interface |
FragmentUtils.OnBackClickListener |
| Modifier and Type | Method and Description |
|---|---|
static void |
add(FragmentManager fm,
Fragment[] adds,
int containerId,
int showIndex)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment[] adds,
int containerId,
java.lang.String[] tags,
int showIndex)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
boolean isHide)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
boolean isHide,
boolean isAddStack)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
android.view.View... sharedElements)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
int enterAnim,
int exitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isHide)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isHide,
boolean isAddStack)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
int enterAnim,
int exitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
android.view.View... sharedElements)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
int enterAnim,
int exitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
android.view.View... sharedElements)
Add fragment.
|
static void |
add(FragmentManager fm,
Fragment add,
int containerId,
android.view.View... sharedElements)
Add fragment.
|
static void |
add(FragmentManager fm,
java.util.List<Fragment> adds,
int containerId,
int showIndex)
Add fragment.
|
static void |
add(FragmentManager fm,
java.util.List<Fragment> adds,
int containerId,
java.lang.String[] tags,
int showIndex)
Add fragment.
|
static boolean |
dispatchBackPress(Fragment fragment)
Dispatch the back press for fragment.
|
static boolean |
dispatchBackPress(FragmentManager fm)
Dispatch the back press for fragment.
|
static Fragment |
findFragment(FragmentManager fm,
java.lang.Class<? extends Fragment> findClz)
Find fragment.
|
static Fragment |
findFragment(FragmentManager fm,
java.lang.String tag)
Find fragment.
|
static java.util.List<FragmentUtils.FragmentNode> |
getAllFragments(FragmentManager fm)
Return all fragments in manager.
|
static java.util.List<FragmentUtils.FragmentNode> |
getAllFragmentsInStack(FragmentManager fm)
Return all fragments in stack in manager.
|
static java.util.List<Fragment> |
getFragments(FragmentManager fm)
Return the fragments in manager.
|
static java.util.List<Fragment> |
getFragmentsInStack(FragmentManager fm)
Return the fragments in stack in manager.
|
static java.lang.String |
getSimpleName(Fragment fragment)
Return the simple name of fragment.
|
static Fragment |
getTop(FragmentManager fm)
Return the top fragment.
|
static Fragment |
getTopInStack(FragmentManager fm)
Return the top fragment in stack.
|
static Fragment |
getTopShow(FragmentManager fm)
Return the top fragment which is shown.
|
static Fragment |
getTopShowInStack(FragmentManager fm)
Return the top fragment which is shown in stack.
|
static void |
hide(Fragment hide)
Hide fragment.
|
static void |
hide(FragmentManager fm)
Hide fragment.
|
static void |
pop(FragmentManager fm)
Pop fragment.
|
static void |
pop(FragmentManager fm,
boolean isImmediate)
Pop fragment.
|
static void |
popAll(FragmentManager fm)
Pop all fragments.
|
static void |
popAll(FragmentManager fm,
boolean isImmediate)
Pop all fragments.
|
static void |
popTo(FragmentManager fm,
java.lang.Class<? extends Fragment> popClz,
boolean isIncludeSelf)
Pop to fragment.
|
static void |
popTo(FragmentManager fm,
java.lang.Class<? extends Fragment> popClz,
boolean isIncludeSelf,
boolean isImmediate)
Pop to fragment.
|
static void |
remove(Fragment remove)
Remove fragment.
|
static void |
removeAll(FragmentManager fm)
Remove all fragments.
|
static void |
removeTo(Fragment removeTo,
boolean isIncludeSelf)
Remove to fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(Fragment srcFragment,
Fragment destFragment,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
int enterAnim,
int exitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
android.view.View... sharedElements)
Replace fragment.
|
static void |
replace(FragmentManager fm,
Fragment fragment,
int containerId,
android.view.View... sharedElements)
Replace fragment.
|
static void |
setBackground(Fragment fragment,
android.graphics.drawable.Drawable background)
Set background color for fragment.
|
static void |
setBackgroundColor(Fragment fragment,
int color)
Set background color for fragment.
|
static void |
setBackgroundResource(Fragment fragment,
int resId)
Set background resource for fragment.
|
static void |
show(Fragment show)
Show fragment.
|
static void |
show(FragmentManager fm)
Show fragment.
|
static void |
showHide(Fragment show,
Fragment... hide)
Show fragment then hide other fragment.
|
static void |
showHide(Fragment show,
Fragment hide)
Show fragment then hide other fragment.
|
static void |
showHide(Fragment show,
java.util.List<Fragment> hide)
Show fragment then hide other fragment.
|
static void |
showHide(int showIndex,
Fragment... fragments)
Show fragment then hide other fragment.
|
static void |
showHide(int showIndex,
java.util.List<Fragment> fragments)
Show fragment then hide other fragment.
|
public static void add(FragmentManager fm,
Fragment add,
int containerId)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.public static void add(FragmentManager fm,
Fragment add,
int containerId,
boolean isHide)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.isHide - True to hide, false otherwise.public static void add(FragmentManager fm,
Fragment add,
int containerId,
boolean isHide,
boolean isAddStack)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.isHide - True to hide, false otherwise.isAddStack - True to add fragment in stack, false otherwise.public static void add(FragmentManager fm,
Fragment add,
int containerId,
int enterAnim,
int exitAnim)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim)
fm - The manager of fragment.containerId - The id of container.add - The fragment will be add.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void add(FragmentManager fm,
Fragment add,
int containerId,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.containerId - The id of container.add - The fragment will be add.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.containerId - The id of container.add - The fragment will be add.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void add(FragmentManager fm,
Fragment add,
int containerId,
android.view.View... sharedElements)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void add(FragmentManager fm,
Fragment add,
int containerId,
boolean isAddStack,
android.view.View... sharedElements)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void add(FragmentManager fm,
java.util.List<Fragment> adds,
int containerId,
int showIndex)
fm - The manager of fragment.adds - The fragments will be add.containerId - The id of container.showIndex - The index of fragment will be shown.public static void add(FragmentManager fm,
Fragment[] adds,
int containerId,
int showIndex)
fm - The manager of fragment.adds - The fragments will be add.containerId - The id of container.showIndex - The index of fragment will be shown.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isHide)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.isHide - True to hide, false otherwise.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isHide,
boolean isAddStack)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.isHide - True to hide, false otherwise.isAddStack - True to add fragment in stack, false otherwise.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
int enterAnim,
int exitAnim)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
int enterAnim,
int exitAnim)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.tag - The tag of fragment.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
android.view.View... sharedElements)
fm - The manager of fragment.add - The fragment will be add.tag - The tag of fragment.containerId - The id of container.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void add(FragmentManager fm,
Fragment add,
int containerId,
java.lang.String tag,
boolean isAddStack,
android.view.View... sharedElements)
fm - The manager of fragment.add - The fragment will be add.containerId - The id of container.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void add(FragmentManager fm,
java.util.List<Fragment> adds,
int containerId,
java.lang.String[] tags,
int showIndex)
fm - The manager of fragment.adds - The fragments will be add.containerId - The id of container.showIndex - The index of fragment will be shown.public static void add(FragmentManager fm,
Fragment[] adds,
int containerId,
java.lang.String[] tags,
int showIndex)
fm - The manager of fragment.adds - The fragments will be add.containerId - The id of container.showIndex - The index of fragment will be shown.public static void show(Fragment show)
show - The fragment will be show.public static void show(FragmentManager fm)
fm - The manager of fragment.public static void hide(Fragment hide)
hide - The fragment will be hide.public static void hide(FragmentManager fm)
fm - The manager of fragment.public static void showHide(int showIndex,
java.util.List<Fragment> fragments)
showIndex - The index of fragment will be shown.fragments - The fragments will be hide.public static void showHide(Fragment show,
java.util.List<Fragment> hide)
show - The fragment will be show.hide - The fragment will be hide.public static void showHide(int showIndex,
Fragment... fragments)
showIndex - The index of fragment will be shown.fragments - The fragment will be hide.public static void showHide(Fragment show,
Fragment... hide)
show - The fragment will be show.hide - The fragment will be hide.public static void showHide(Fragment show,
Fragment hide)
show - The fragment will be show.hide - The fragment will be hide.public static void replace(Fragment srcFragment,
Fragment destFragment)
srcFragment - The source of fragment.destFragment - The destination of fragment.public static void replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack)
srcFragment - The source of fragment.destFragment - The destination of fragment.isAddStack - True to add fragment in stack, false otherwise.public static void replace(Fragment srcFragment,
Fragment destFragment,
int enterAnim,
int exitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
int enterAnim,
int exitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(Fragment srcFragment,
Fragment destFragment,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(Fragment srcFragment,
Fragment destFragment,
android.view.View... sharedElements)
srcFragment - The source of fragment.destFragment - The destination of fragment.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(Fragment srcFragment,
Fragment destFragment,
boolean isAddStack,
android.view.View... sharedElements)
srcFragment - The source of fragment.destFragment - The destination of fragment.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.isAddStack - True to add fragment in stack, false otherwise.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
int enterAnim,
int exitAnim)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
android.view.View... sharedElements)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
boolean isAddStack,
android.view.View... sharedElements)
fm - The manager of fragment.containerId - The id of container.fragment - The new fragment to place in the container.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
int enterAnim,
int exitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
android.view.View... sharedElements)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(Fragment srcFragment,
Fragment destFragment,
java.lang.String destTag,
boolean isAddStack,
android.view.View... sharedElements)
srcFragment - The source of fragment.destFragment - The destination of fragment.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
int enterAnim,
int exitAnim)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
int enterAnim,
int exitAnim,
int popEnterAnim,
int popExitAnim)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.enterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being added or attached.exitAnim - An animation or animator resource ID used for the exit animation on the
view of the fragment being removed or detached.popEnterAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being readded or reattached caused by
popBackStack() or similar methods.popExitAnim - An animation or animator resource ID used for the enter animation on the
view of the fragment being removed or detached caused by
popBackStack() or similar methods.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
android.view.View... sharedElements)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void replace(FragmentManager fm,
Fragment fragment,
int containerId,
java.lang.String destTag,
boolean isAddStack,
android.view.View... sharedElements)
fm - The manager of fragment.fragment - The new fragment to place in the container.containerId - The id of container.destTag - The destination of fragment's tag.isAddStack - True to add fragment in stack, false otherwise.sharedElements - A View in a disappearing Fragment to match with a View in an
appearing Fragment.public static void pop(FragmentManager fm)
fm - The manager of fragment.public static void pop(FragmentManager fm,
boolean isImmediate)
fm - The manager of fragment.isImmediate - True to pop immediately, false otherwise.public static void popTo(FragmentManager fm,
java.lang.Class<? extends Fragment> popClz,
boolean isIncludeSelf)
fm - The manager of fragment.popClz - The class of fragment will be popped to.isIncludeSelf - True to include the fragment, false otherwise.public static void popTo(FragmentManager fm,
java.lang.Class<? extends Fragment> popClz,
boolean isIncludeSelf,
boolean isImmediate)
fm - The manager of fragment.popClz - The class of fragment will be popped to.isIncludeSelf - True to include the fragment, false otherwise.isImmediate - True to pop immediately, false otherwise.public static void popAll(FragmentManager fm)
fm - The manager of fragment.public static void popAll(FragmentManager fm,
boolean isImmediate)
fm - The manager of fragment.public static void remove(Fragment remove)
remove - The fragment will be removed.public static void removeTo(Fragment removeTo,
boolean isIncludeSelf)
removeTo - The fragment will be removed to.isIncludeSelf - True to include the fragment, false otherwise.public static void removeAll(FragmentManager fm)
fm - The manager of fragment.public static Fragment getTop(FragmentManager fm)
fm - The manager of fragment.public static Fragment getTopInStack(FragmentManager fm)
fm - The manager of fragment.public static Fragment getTopShow(FragmentManager fm)
fm - The manager of fragment.public static Fragment getTopShowInStack(FragmentManager fm)
fm - The manager of fragment.public static java.util.List<Fragment> getFragments(FragmentManager fm)
fm - The manager of fragment.public static java.util.List<Fragment> getFragmentsInStack(FragmentManager fm)
fm - The manager of fragment.public static java.util.List<FragmentUtils.FragmentNode> getAllFragments(FragmentManager fm)
fm - The manager of fragment.public static java.util.List<FragmentUtils.FragmentNode> getAllFragmentsInStack(FragmentManager fm)
fm - The manager of fragment.public static Fragment findFragment(FragmentManager fm,
java.lang.Class<? extends Fragment> findClz)
fm - The manager of fragment.findClz - The class of fragment will be found.public static Fragment findFragment(FragmentManager fm,
java.lang.String tag)
fm - The manager of fragment.tag - The tag of fragment will be found.public static boolean dispatchBackPress(Fragment fragment)
fragment - The fragment.true: the fragment consumes the back pressfalse: otherwisepublic static boolean dispatchBackPress(FragmentManager fm)
fm - The manager of fragment.true: the fragment consumes the back pressfalse: otherwisepublic static void setBackgroundColor(Fragment fragment,
int color)
fragment - The fragment.color - The background color.public static void setBackgroundResource(Fragment fragment,
int resId)
fragment - The fragment.resId - The resource id.public static void setBackground(Fragment fragment,
android.graphics.drawable.Drawable background)
fragment - The fragment.background - The background.public static java.lang.String getSimpleName(Fragment fragment)
fragment - The fragment.