Travis Griggs
02/09/2024, 9:03 PMobject Forever {
var characterCount by mutableIntStateOf(20)
val text by derivedStateOf {
"It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness.".take(
characterCount
)
}
var textSize by mutableIntStateOf(21)
var lowerSize by mutableIntStateOf(14)
}
at the "root" of one's MainActivity file (I know this is bad coding and all that, I'm interested on what (if anything) breaks when you do this)Stylianos Gakis
02/09/2024, 9:10 PMTravis Griggs
02/09/2024, 9:13 PMTravis Griggs
02/09/2024, 9:14 PMTravis Griggs
02/09/2024, 9:21 PMMichael Paus
02/09/2024, 9:56 PMandroid:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
You will see that all relevant config change resets are disabled because Compose deals with them. So why are people constantly overcomplicating things and argument with things that are not really relevant anymore? (I am not talking about old legacy apps here.)
You could even create a main Application class in addition to the Activity and place the singleton there. That Application class would even survive the reset of all Activities. See: https://guides.codepath.com/android/Understanding-the-Android-Application-Class I don’t say one should do that but why not? The argument brought forward agains such an approach should at least be valid.shikasd
02/09/2024, 10:28 PMSnapshot.withMutableSnapshot
to ensure state changes are mutated atomically.Travis Griggs
02/09/2024, 10:34 PMMark
02/10/2024, 3:21 AMColton Idle
02/10/2024, 3:34 AMColton Idle
02/10/2024, 3:35 AMStylianos Gakis
02/10/2024, 7:31 AMdorche
02/10/2024, 10:31 AMStylianos Gakis
02/10/2024, 4:15 PMdorche
02/10/2024, 4:42 PMColton Idle
02/10/2024, 7:31 PMOleksandr Balan
02/10/2024, 8:34 PMKeeping it updated
Last release 17 Aug 2023
homer disappear 😅
Colton Idle
02/11/2024, 4:59 AM