mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
update to dev07 compose
This commit is contained in:
parent
5b60253e00
commit
40853723ab
11 changed files with 27 additions and 29 deletions
|
|
@ -23,6 +23,7 @@ import android.view.ViewGroup
|
|||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.compose.Composable
|
||||
import androidx.ui.core.ContextAmbient
|
||||
|
||||
/**
|
||||
* Composes an Android [View] given a layout resource [resId]. The method handles the inflation
|
||||
|
|
@ -35,10 +36,11 @@ import androidx.compose.Composable
|
|||
@Composable
|
||||
// TODO(popam): support modifiers here
|
||||
fun AndroidView(@LayoutRes resId: Int, postInflationCallback: (View) -> Unit = { _ -> }) {
|
||||
AndroidViewHolder(
|
||||
postInflationCallback = postInflationCallback,
|
||||
resId = resId
|
||||
)
|
||||
val context = ContextAmbient.current
|
||||
|
||||
val r = AndroidViewHolder(context)
|
||||
r.postInflationCallback = postInflationCallback
|
||||
r.resId = resId
|
||||
}
|
||||
|
||||
private class AndroidViewHolder(context: Context) : ViewGroup(context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue