mikehearn
05/26/2023, 1:48 PMTextField
and any other focusable composable returned an object (interface) instead of unit that exposes methods for inherently imperative actions like focus()
. If everything you want to do can be done by changing params, you ignore the result. Otherwise you can just assign it to a value and then use it from within a side effect. There'd be less code required and it'd be way clearer from auto-complete what you can do. To compose more functionality with it, you'd use Kotlin delegation to wrap the returned control object and add things to it.
Is there some important reason this wouldn't work well?Kirill Grouchnikov
05/26/2023, 2:42 PMmikehearn
05/26/2023, 2:43 PMmikehearn
05/26/2023, 2:44 PMremember {}
Kirill Grouchnikov
05/26/2023, 2:45 PMmikehearn
05/26/2023, 2:47 PMChris Fillmore
05/26/2023, 2:51 PMmikehearn
05/26/2023, 3:03 PMChris Fillmore
05/26/2023, 3:19 PMThe code required was awkwardI take this to mean there’s more boilerplate to a basic form? “awkward” may imply a few different things
Chris Fillmore
05/26/2023, 3:21 PMmikehearn
05/26/2023, 3:52 PMdewildte
05/26/2023, 5:35 PMMore boilerplateBoilerplate is what creates flexibility. This can decrease as you build out the core components of your systems UI over time.
more things to learnMore things to learn is a natural by product of doing things in a new fashion. Eventually that too will feel less cumbersome as you have established a firm foundation of knowledge and understanding. New things will be but a small portion to add to your already vast amount of knowledge over time and will come with ease.
more steps to get wrong etc.This is really unavoidable. Learning any new/non-trivial skill is this way. I think you are just going through the growing pains of “new” and if you persist with diligence they will subside.
dewildte
05/26/2023, 5:37 PM