fix errors with fragmentwithstate

This commit is contained in:
Максим Бачинский 2020-05-28 00:26:43 +03:00
parent 62d3467a59
commit 2015daf5d1
2 changed files with 9 additions and 8 deletions

View File

@ -28,7 +28,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import ru.touchin.roboswag.core.log.Lc
import ru.touchin.roboswag.navigation_base.fragments.BaseFragment
import ru.touchin.roboswag.navigation_base.fragments.FragmentWithState
import kotlin.reflect.KClass
/**
@ -169,14 +169,14 @@ open class FragmentNavigation(
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
*/
fun <T : Parcelable> push(
fragmentClass: KClass<out BaseFragment<*, out T>>,
fragmentClass: KClass<out FragmentWithState<*, out T>>,
state: T,
addToStack: Boolean = true,
backStackName: String? = null,
tag: String? = null,
transactionSetup: ((FragmentTransaction) -> Unit)? = null
) {
push(fragmentClass.java, BaseFragment.args(state), addToStack, backStackName, tag, transactionSetup)
push(fragmentClass.java, FragmentWithState.args(state), addToStack, backStackName, tag, transactionSetup)
}
/**
@ -216,14 +216,14 @@ open class FragmentNavigation(
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
*/
fun <T : Parcelable> pushForResult(
fragmentClass: KClass<out BaseFragment<*, out T>>,
fragmentClass: KClass<out FragmentWithState<*, out T>>,
targetFragment: Fragment,
targetRequestCode: Int,
state: T,
tag: String? = null,
transactionSetup: ((FragmentTransaction) -> Unit)? = null
) {
pushForResult(fragmentClass.java, targetFragment, targetRequestCode, BaseFragment.args(state), tag, transactionSetup)
pushForResult(fragmentClass.java, targetFragment, targetRequestCode, FragmentWithState.args(state), tag, transactionSetup)
}
/**
@ -270,13 +270,13 @@ open class FragmentNavigation(
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
*/
fun <T : Parcelable> setInitial(
fragmentClass: KClass<out BaseFragment<*, out T>>,
fragmentClass: KClass<out FragmentWithState<*, out T>>,
state: T,
tag: String? = null,
transactionSetup: ((FragmentTransaction) -> Unit)? = null
) {
beforeSetInitialActions()
setAsTop(fragmentClass.java, BaseFragment.args(state), false, tag, transactionSetup)
setAsTop(fragmentClass.java, FragmentWithState.args(state), false, tag, transactionSetup)
}
/**

View File

@ -10,10 +10,11 @@ import ru.touchin.roboswag.components.utils.UiUtils
import ru.touchin.roboswag.navigation_base.activities.BaseActivity
import ru.touchin.roboswag.navigation_base.activities.OnBackPressedListener
import ru.touchin.roboswag.navigation_base.fragments.BaseFragment
import ru.touchin.roboswag.navigation_base.fragments.FragmentWithState
abstract class KeyboardResizeableFragment<TActivity : BaseActivity, TState : Parcelable>(
@LayoutRes layoutRes: Int
) : BaseFragment<TActivity, TState>(
) : FragmentWithState<TActivity, TState>(
layoutRes
) {