Sha256: 06e8a7cd126d01f037fa4a6a1203c998832d24f1347a233ea6f9b4bd0081246c
Contents?: true
Size: 956 Bytes
Versions: 34
Compression:
Stored size: 956 Bytes
Contents
package <%= package_name %>.features.native import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.compose.runtime.Composable import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.platform.ViewCompositionStrategy import dev.hotwire.turbo.fragments.TurboFragment import <%= package_name %>.R import <%= package_name %>.base.NavDestination abstract class NativeFragment : TurboFragment(), NavDestination { fun setContent(inflater: LayoutInflater, container: ViewGroup?, content: @Composable () -> Unit): View? { val root = inflater.inflate(R.layout.fragment_native, container, false) val composeView = root.findViewById<ComposeView>(R.id.compose_view) composeView.apply { setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) setContent { content.invoke() } } return root } }
Version data entries
34 entries across 17 versions & 1 rubygems