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

bmo

11/04/2019, 9:00 AM
Hello everybody, I'm trying to make a little PoC with Compose and I have encountered something I cannot explain. The code can be found here : https://github.com/bmonjoie/ComposeTipsCalculator/blob/master/app/src/main/java/be/xzan/composetipscalculator/MainActivity.kt As you can see, I have my
@Composable
functions as top level functions. but it brings a weird behavior. Before, those functions were part of
MainActivity
and the behavior was the one you can see in attachment. Meaning, when I would change a
TextField
, it would stay focused. If I move the function as top level functions, it adds a new line on top but keep it focused on the empty one. The only difference between the two are were the functions are. Can somebody explain ? PS : I have tried adding
@Pivotal
or
key(position) { ... }
around the
Entry
but it doesn't change anything.
🔥 1
Obviously it didn't copy the gif ...

https://cdn-images-1.medium.com/max/1600/1*ROZqkdir2qwa1D7iIcU1jw.gif

p

Paul Woitaschek

11/04/2019, 10:03 AM
Interesting. Take a look at the generated bytecode and see what's the difference
b

bmo

11/04/2019, 10:56 AM
I'm not really good at reading bytecode and Android Studio won't decompile bytecode with Compose
a

Andrey Kulikov

11/04/2019, 10:16 PM
could you please create a bug? thanks
b

bmo

11/05/2019, 6:43 AM
@Andrey Kulikov: https://issuetracker.google.com/issues/143911212 Please let me know if there is more information I can provide to help you solve this bug