Struggling to get sensible focus behavior in Jetpack Compose
I’m brand new to Compose and working on a simple Kotlin app to learn; so far I like the paradigm but I definitely don’t know what I don’t know. One of the Activities in the app displays a LazyColumn of string pairs; they are initially displayed as passive Text objects but clicking on one changes both strings in the pair into editable TextFields. I’ve got the multiple-item selection, Save Changes/Cancel, etc. behavior working the way I want it to, but it’s annoying me that the user has to tap twice to actually start editing: once on the Text object to replace it with an (unfocused) TextField, and then again on the TextField to actually shift the input focus there. It would be great if the default focus logic recognized when a new TextField enters the visible portion of the composition and automatically shifted the focus there, but that doesn’t seem to be the case. I tried to manually implement that behavior via FocusRequesters, but even though I seem to be calling requestFocus() on the right requester after field composition, it doesn’t seem to do anything— I still have to tap twice to activate the TextField.
Struggling to get sensible focus behavior in Jetpack Compose
I’m brand new to Compose and working on a simple Kotlin app to learn; so far I like the paradigm but I definitely don’t know what I don’t know. One of the Activities in the app displays a LazyColumn of string pairs; they are initially displayed as passive Text objects but clicking on one changes both strings in the pair into editable TextFields. I’ve got the multiple-item selection, Save Changes/Cancel, etc. behavior working the way I want it to, but it’s annoying me that the user has to tap twice to actually start editing: once on the Text object to replace it with an (unfocused) TextField, and then again on the TextField to actually shift the input focus there. It would be great if the default focus logic recognized when a new TextField enters the visible portion of the composition and automatically shifted the focus there, but that doesn’t seem to be the case. I tried to manually implement that behavior via FocusRequesters, but even though I seem to be calling requestFocus() on the right requester after field composition, it doesn’t seem to do anything— I still have to tap twice to activate the TextField.
Struggling to get sensible focus behavior in Jetpack Compose
I’m brand new to Compose and working on a simple Kotlin app to learn; so far I like the paradigm but I definitely don’t know what I don’t know. One of the Activities in the app displays a LazyColumn of string pairs; they are initially displayed as passive Text objects but clicking on one changes both strings in the pair into editable TextFields. I’ve got the multiple-item selection, Save Changes/Cancel, etc. behavior working the way I want it to, but it’s annoying me that the user has to tap twice to actually start editing: once on the Text object to replace it with an (unfocused) TextField, and then again on the TextField to actually shift the input focus there. It would be great if the default focus logic recognized when a new TextField enters the visible portion of the composition and automatically shifted the focus there, but that doesn’t seem to be the case. I tried to manually implement that behavior via FocusRequesters, but even though I seem to be calling requestFocus() on the right requester after field composition, it doesn’t seem to do anything— I still have to tap twice to activate the TextField.
Jetpack Compose: how to set focus color separate from ripple color
We use a dark ripple color for most of our controls, which gives us a dark grey ripple effect AND dark grey focused state.