All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidMain.tech.skot.core.components.SKStackView.kt Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
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