How should be handled `onFocusChange` for view in ...
# compose
a
How should be handled
onFocusChange
for view in compose? I meant that keyboard is not always called automatically and we need a view reference in order to present it or hide it. It there any clean way to handle from composable?
a
yes, but how could I expose this to activity in order to call imm.showKeyboard() blabla.. ?
and more precise how can I get an id of the view to focus on
z
a
oh, nice. Did not noticed that it returns already keyboard. Thanks.
One more question… if I have a livedata with text coming from input, what is usual way to convert it into TextFieldValue?
z
(although if you're still interested, there's a focus modifier for controlling focus inside Compose - composables do not have Android IDs)
liveData.observeAsState
a
and how pass it later to TextFieldValue(stateName.value ?: “”)?