kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fighting compose
rodzic
606dc0fd07
commit
8d5c6742be
|
@ -14,6 +14,7 @@ fun androidx.fragment.app.Fragment.setComposable(
|
|||
): View? =
|
||||
context?.let {
|
||||
FrameLayout(it).apply {
|
||||
this.isClickable = true
|
||||
this.id =
|
||||
id // Compose requires a unique ID for the containing view to make savedInstanceState work
|
||||
|
||||
|
@ -30,11 +31,26 @@ open class ComposeFragment(
|
|||
screenName: String,
|
||||
id: Int,
|
||||
private val content: @Composable() () -> Unit
|
||||
) :
|
||||
ScreenFragment(screenName) {
|
||||
) : ScreenFragment(screenName) {
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? =
|
||||
setComposable(id, content)
|
||||
}
|
||||
FrameLayout(context!!).apply {
|
||||
this.isClickable = true
|
||||
this.id =
|
||||
id // Compose requires a unique ID for the containing view to make savedInstanceState work
|
||||
|
||||
layoutParams = ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
|
||||
setContent(content)
|
||||
}
|
||||
|
||||
/* override fun onStart() {
|
||||
super.onStart()
|
||||
(view as ViewGroup).setContent(content)
|
||||
} */
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue