androidMain.tech.skot.core.components.SKStackView.kt Maven / Gradle / Ivy
package tech.skot.core.components
import android.widget.FrameLayout
import androidx.fragment.app.Fragment
class SKStackView(
proxy: SKStackViewProxy,
activity: SKActivity,
fragment: Fragment?,
private val frameLayout: FrameLayout
) : SKComponentView(proxy, activity, fragment, frameLayout) {
fun onState(state: StateProxy) {
val lastScreen = state.screens.lastOrNull()
if (lastScreen != null) {
fragmentManager.apply {
val oldFrag = findFragmentById(frameLayout.id)
beginTransaction().apply {
replace(frameLayout.id, lastScreen.createFragment())
commit()
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy