From 877754e77dcac16e54f89581d427fca30342897b Mon Sep 17 00:00:00 2001 From: Anton Domnikov Date: Tue, 30 Oct 2018 12:01:26 +0300 Subject: [PATCH] navigation update (#2) * added ability to set tag when pushing ViewController * added getter for ViewController container --- .../navigation/viewcontrollers/ViewController.java | 4 ++++ .../viewcontrollers/ViewControllerNavigation.kt | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewController.java b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewController.java index 84c5d5c..ca831f1 100644 --- a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewController.java +++ b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewController.java @@ -431,6 +431,10 @@ public class ViewController( * @param viewControllerClass Class of [ViewController] to be pushed; * @param state [Parcelable] of [ViewController]'s fragment; * @param addToStack Flag to add this transaction to the back stack; + * @param backStackName Name of [Fragment] in back stack; * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info; * @param TState Type of state of fragment. */ @@ -57,6 +58,7 @@ open class ViewControllerNavigation( viewControllerClass: Class>, state: TState, addToStack: Boolean = true, + backStackName: String? = null, transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( @@ -65,7 +67,7 @@ open class ViewControllerNavigation( 0, addToStack, ViewControllerFragment.args(viewControllerClass, state), - null, + backStackName, transactionSetup ) } @@ -77,6 +79,7 @@ open class ViewControllerNavigation( * @param viewControllerClass Class of [ViewController] to be pushed; * @param targetFragment [ViewControllerFragment] to be set as target; * @param state [Parcelable] of [ViewController]'s fragment; + * @param backStackName Name of [Fragment] in back stack; * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info; * @param TState Type of state of fragment; * @param TTargetFragment Type of target fragment. @@ -86,6 +89,7 @@ open class ViewControllerNavigation( state: TState, targetFragment: TTargetFragment, targetRequestCode: Int, + backStackName: String? = null, transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( @@ -94,7 +98,7 @@ open class ViewControllerNavigation( targetRequestCode, true, ViewControllerFragment.args(viewControllerClass, state), - null, + backStackName, transactionSetup ) }