diff --git a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/FragmentNavigation.kt b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/FragmentNavigation.kt index 7e3ead2..2a0aa6a 100644 --- a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/FragmentNavigation.kt +++ b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/FragmentNavigation.kt @@ -83,8 +83,8 @@ open class FragmentNavigation( * @param addToStack Flag to add this transaction to the back stack; * @param args Bundle to be set as [Fragment.getArguments] of instantiated [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 tag Optional tag name for the [Fragment]; + * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. */ fun addToStack( fragmentClass: Class, @@ -93,8 +93,8 @@ open class FragmentNavigation( addToStack: Boolean, args: Bundle?, backStackName: String?, - transactionSetup: ((FragmentTransaction) -> Unit)?, - tag: String? + tag: String?, + transactionSetup: ((FragmentTransaction) -> Unit)? ) { if (fragmentManager.isDestroyed) { Lc.assertion("FragmentManager is destroyed") @@ -146,18 +146,18 @@ open class FragmentNavigation( * * @param fragmentClass Class of [Fragment] to instantiate; * @param args Bundle to be set as [Fragment.getArguments] of instantiated [Fragment]; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. * @param tag Optional tag name for the [Fragment]; + * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. */ fun push( fragmentClass: Class, args: Bundle? = null, addToStack: Boolean = true, backStackName: String? = null, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { - addToStack(fragmentClass, null, 0, addToStack, args, backStackName, transactionSetup, tag) + addToStack(fragmentClass, null, 0, addToStack, args, backStackName, tag, transactionSetup) } /** @@ -166,16 +166,16 @@ open class FragmentNavigation( * @param fragmentClass Class of [Fragment] to instantiate; * @param targetFragment Target fragment to be set as [Fragment.getTargetFragment] of instantiated [Fragment]; * @param args Bundle to be set as [Fragment.getArguments] of instantiated [Fragment]; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. * @param tag Optional tag name for the [Fragment]; + * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. */ fun pushForResult( fragmentClass: Class, targetFragment: Fragment, targetRequestCode: Int, args: Bundle? = null, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( fragmentClass, @@ -184,8 +184,8 @@ open class FragmentNavigation( true, args, null, - transactionSetup, - tag + tag, + transactionSetup ) } @@ -195,17 +195,17 @@ open class FragmentNavigation( * * @param fragmentClass Class of [Fragment] to instantiate; * @param args Bundle to be set as [Fragment.getArguments] of instantiated [Fragment]; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. * @param tag Optional tag name for the [Fragment]; + * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. */ fun setAsTop( fragmentClass: Class, args: Bundle? = null, addToStack: Boolean = true, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { - addToStack(fragmentClass, null, 0, addToStack, args, TOP_FRAGMENT_TAG_MARK, transactionSetup, tag) + addToStack(fragmentClass, null, 0, addToStack, args, TOP_FRAGMENT_TAG_MARK, tag, transactionSetup) } /** @@ -213,18 +213,18 @@ open class FragmentNavigation( * * @param fragmentClass Class of [Fragment] to instantiate; * @param args Bundle to be set as [Fragment.getArguments] of instantiated [Fragment]; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. * @param tag Optional tag name for the [Fragment]; + * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info. */ @JvmOverloads fun setInitial( fragmentClass: Class, args: Bundle? = null, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { beforeSetInitialActions() - setAsTop(fragmentClass, args, false, transactionSetup, tag) + setAsTop(fragmentClass, args, false, tag, transactionSetup) } /** diff --git a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewControllerNavigation.kt b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewControllerNavigation.kt index 63b148b..97eeb3b 100644 --- a/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewControllerNavigation.kt +++ b/navigation/src/main/java/ru/touchin/roboswag/components/navigation/viewcontrollers/ViewControllerNavigation.kt @@ -51,8 +51,8 @@ open class ViewControllerNavigation( * @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 tag Optional tag name for the [Fragment]; + * @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. */ fun pushViewController( @@ -60,8 +60,8 @@ open class ViewControllerNavigation( state: TState, addToStack: Boolean = true, backStackName: String? = null, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( ViewControllerFragment::class.java, @@ -70,8 +70,8 @@ open class ViewControllerNavigation( addToStack, ViewControllerFragment.args(viewControllerClass, state), backStackName, - transactionSetup, - tag + tag, + transactionSetup ) } @@ -83,8 +83,8 @@ open class ViewControllerNavigation( * @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 tag Optional tag name for the [Fragment]; + * @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. */ @@ -94,8 +94,8 @@ open class ViewControllerNavigation( targetFragment: TTargetFragment, targetRequestCode: Int, backStackName: String? = null, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( ViewControllerFragment::class.java, @@ -104,8 +104,8 @@ open class ViewControllerNavigation( true, ViewControllerFragment.args(viewControllerClass, state), backStackName, - transactionSetup, - tag + tag, + transactionSetup ) } @@ -115,16 +115,16 @@ open class ViewControllerNavigation( * * @param viewControllerClass Class of [ViewController] to be pushed; * @param state [Parcelable] of [ViewController]'s fragment; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info; * @param tag Optional tag name for the [Fragment]; + * @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. */ fun setViewControllerAsTop( viewControllerClass: Class>, state: TState, addToStack: Boolean = true, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { addToStack( ViewControllerFragment::class.java, @@ -133,8 +133,8 @@ open class ViewControllerNavigation( addToStack, ViewControllerFragment.args(viewControllerClass, state), TOP_FRAGMENT_TAG_MARK, - transactionSetup, - tag + tag, + transactionSetup ) } @@ -144,18 +144,18 @@ open class ViewControllerNavigation( * * @param viewControllerClass Class of [ViewController] to be pushed; * @param state [Parcelable] of [ViewController]'s fragment; - * @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info; * @param tag Optional tag name for the [Fragment]; + * @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. */ fun setInitialViewController( viewControllerClass: Class>, state: TState, - transactionSetup: ((FragmentTransaction) -> Unit)? = null, - tag: String? = null + tag: String? = null, + transactionSetup: ((FragmentTransaction) -> Unit)? = null ) { beforeSetInitialActions() - setViewControllerAsTop(viewControllerClass, state, false, transactionSetup, tag) + setViewControllerAsTop(viewControllerClass, state, false, tag, transactionSetup) } }