fix errors with fragmentwithstate
This commit is contained in:
parent
62d3467a59
commit
2015daf5d1
|
|
@ -28,7 +28,7 @@ import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.fragment.app.FragmentTransaction
|
import androidx.fragment.app.FragmentTransaction
|
||||||
import ru.touchin.roboswag.core.log.Lc
|
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
|
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.
|
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
|
||||||
*/
|
*/
|
||||||
fun <T : Parcelable> push(
|
fun <T : Parcelable> push(
|
||||||
fragmentClass: KClass<out BaseFragment<*, out T>>,
|
fragmentClass: KClass<out FragmentWithState<*, out T>>,
|
||||||
state: T,
|
state: T,
|
||||||
addToStack: Boolean = true,
|
addToStack: Boolean = true,
|
||||||
backStackName: String? = null,
|
backStackName: String? = null,
|
||||||
tag: String? = null,
|
tag: String? = null,
|
||||||
transactionSetup: ((FragmentTransaction) -> Unit)? = 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.
|
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
|
||||||
*/
|
*/
|
||||||
fun <T : Parcelable> pushForResult(
|
fun <T : Parcelable> pushForResult(
|
||||||
fragmentClass: KClass<out BaseFragment<*, out T>>,
|
fragmentClass: KClass<out FragmentWithState<*, out T>>,
|
||||||
targetFragment: Fragment,
|
targetFragment: Fragment,
|
||||||
targetRequestCode: Int,
|
targetRequestCode: Int,
|
||||||
state: T,
|
state: T,
|
||||||
tag: String? = null,
|
tag: String? = null,
|
||||||
transactionSetup: ((FragmentTransaction) -> Unit)? = 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.
|
* @param transactionSetup Function to setup transaction before commit. It is useful to specify transition animations or additional info.
|
||||||
*/
|
*/
|
||||||
fun <T : Parcelable> setInitial(
|
fun <T : Parcelable> setInitial(
|
||||||
fragmentClass: KClass<out BaseFragment<*, out T>>,
|
fragmentClass: KClass<out FragmentWithState<*, out T>>,
|
||||||
state: T,
|
state: T,
|
||||||
tag: String? = null,
|
tag: String? = null,
|
||||||
transactionSetup: ((FragmentTransaction) -> Unit)? = null
|
transactionSetup: ((FragmentTransaction) -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
beforeSetInitialActions()
|
beforeSetInitialActions()
|
||||||
setAsTop(fragmentClass.java, BaseFragment.args(state), false, tag, transactionSetup)
|
setAsTop(fragmentClass.java, FragmentWithState.args(state), false, tag, transactionSetup)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -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.BaseActivity
|
||||||
import ru.touchin.roboswag.navigation_base.activities.OnBackPressedListener
|
import ru.touchin.roboswag.navigation_base.activities.OnBackPressedListener
|
||||||
import ru.touchin.roboswag.navigation_base.fragments.BaseFragment
|
import ru.touchin.roboswag.navigation_base.fragments.BaseFragment
|
||||||
|
import ru.touchin.roboswag.navigation_base.fragments.FragmentWithState
|
||||||
|
|
||||||
abstract class KeyboardResizeableFragment<TActivity : BaseActivity, TState : Parcelable>(
|
abstract class KeyboardResizeableFragment<TActivity : BaseActivity, TState : Parcelable>(
|
||||||
@LayoutRes layoutRes: Int
|
@LayoutRes layoutRes: Int
|
||||||
) : BaseFragment<TActivity, TState>(
|
) : FragmentWithState<TActivity, TState>(
|
||||||
layoutRes
|
layoutRes
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue