From 292ec56815512cd7a6ebed27c4e1693c28681c7d Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 17 Oct 2019 17:20:35 +0300 Subject: [PATCH] state as val --- .../tabbarnavigation/BottomNavigationFragment.kt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tabbar-navigation/src/main/java/ru/touchin/roboswag/components/tabbarnavigation/BottomNavigationFragment.kt b/tabbar-navigation/src/main/java/ru/touchin/roboswag/components/tabbarnavigation/BottomNavigationFragment.kt index 51d9ed1..9e008be 100644 --- a/tabbar-navigation/src/main/java/ru/touchin/roboswag/components/tabbarnavigation/BottomNavigationFragment.kt +++ b/tabbar-navigation/src/main/java/ru/touchin/roboswag/components/tabbarnavigation/BottomNavigationFragment.kt @@ -10,6 +10,7 @@ import android.view.ViewGroup import androidx.annotation.IdRes import androidx.fragment.app.Fragment import ru.touchin.roboswag.components.navigation.activities.OnBackPressedListener +import ru.touchin.roboswag.components.navigation.viewcontrollers.EmptyState import ru.touchin.roboswag.components.navigation.viewcontrollers.ViewController abstract class BottomNavigationFragment : Fragment() { @@ -75,7 +76,7 @@ abstract class BottomNavigationFragment : Fragment() { class TabData( val viewControllerClass: Class>, - viewControllerState: Parcelable, + val viewControllerState: Parcelable, /** * It can be useful in some cases when it is necessary to create ViewController * with initial state every time when tab opens. @@ -83,14 +84,6 @@ abstract class BottomNavigationFragment : Fragment() { val saveStateOnSwitching: Boolean = true ) { - /** - * It is value as class body property instead of value as constructor parameter to specify - * custom getter of this field which returns copy of Parcelable every time it be called. - * This is necessary to avoid modifying this value if it would be a value as constructor parameter - * and every getting of this value would return the same instance. - */ - val viewControllerState = viewControllerState - operator fun component1() = viewControllerClass operator fun component2() = viewControllerState