David Corrado
10/08/2024, 6:34 PMZach Klippenstein (he/him) [MOD]
10/08/2024, 6:54 PMremember
doesn't avoid recomposition, it allows something to persist between recompositions.Zach Klippenstein (he/him) [MOD]
10/08/2024, 6:54 PM1. Do you think if a control does not work well with many recompositions its a bug? Basically its the slider the thumb in Material composeAre you saying you're seeing unexpected Material slider behavior?
Zach Klippenstein (he/him) [MOD]
10/08/2024, 6:56 PMremember
with a key, but it's also possible to misuse it. If you're deriving some value in a composable from your view model and remembering it, does it really need to be remembered if the view model is the source of truth?David Corrado
10/08/2024, 6:56 PMDavid Corrado
10/08/2024, 6:58 PMZach Klippenstein (he/him) [MOD]
10/08/2024, 6:58 PMDavid Corrado
10/08/2024, 6:59 PMZach Klippenstein (he/him) [MOD]
10/08/2024, 7:00 PMZach Klippenstein (he/him) [MOD]
10/08/2024, 7:01 PMDavid Corrado
10/08/2024, 7:01 PMDavid Corrado
10/08/2024, 7:01 PMSo when the slider change callback is invoked, you pass it to the VM, which eventually emits on a flow?Yes
Zach Klippenstein (he/him) [MOD]
10/08/2024, 7:01 PMZach Klippenstein (he/him) [MOD]
10/08/2024, 7:02 PMDavid Corrado
10/08/2024, 7:03 PMDavid Corrado
10/08/2024, 7:03 PMAre you using any flow operators?No.
Zach Klippenstein (he/him) [MOD]
10/08/2024, 7:04 PMDavid Corrado
10/08/2024, 7:06 PMAlex Vanyo
10/08/2024, 7:18 PMSlider
state management have very similar characteristics to text fields that is explored in https://medium.com/androiddevelopers/effective-state-management-for-textfield-in-compose-d6e5b070fbe5
You can get really weird behavior if there’s any asynchronicity between the Slider
changing the value, and when the value passed to the Slider
updates, and a Flow
in a ViewModel
can definitely introduce that asynchronicityDavid Corrado
10/08/2024, 7:42 PMdazza5000
10/08/2024, 9:10 PM