https://kotlinlang.org logo
#compose
Title
# compose
p

Patrick Yin

08/06/2020, 9:50 PM
One question about wrapping the classic android view inside of a compose component: See code below, if you click TextView area, it’s not clickable, but if you click the Box’s padding area, it’s clickable. And if replace
emitView(::TextView)
with a compose
Text("")
, it works well. Is it an intentional behavior? Or there is something wrong?
Copy code
@Composable
fun MarketLabel(text: String) {
//  Android classic view
  emitView(::TextView) {
    it.text = text
  }
}

@Composable
fun SomeThing() {
  Box(
    modifier = Modifier
      .clickable(
        onClick = {
          doingSomething()
        }
      )
      .padding(16.dp)
  ) {
    MarketLabel("Test")
  }
}
r

romainguy

08/06/2020, 9:54 PM
The team has been making fixing in the input handling across boundaries. Looks like not all fixes made it to dev16.
p

Patrick Yin

08/06/2020, 10:11 PM
Ah, nice call. I’m on dev15. It works on dev16. thanks @romainguy
7 Views