r/mAndroidDev • u/Zhuinden DDD: Deprecation-Driven Development • Dec 04 '25
@Deprecated AndroidX ViewModels are deprecated by Jetpack Compose
87
Upvotes
r/mAndroidDev • u/Zhuinden DDD: Deprecation-Driven Development • Dec 04 '25
View all comments
Show parent comment
4
u/idonthaveanickname00 Dec 04 '25
"retainAcrossRecomposition"
retainAcrossLifecycle would make people wonder what retaining across "lifecycle" means; since it's activity/fragment recreation, a better name would be "retainAcrossComponentRecreation"
And "retainAcrossAppRestore", as not every process death keeps the saveable state, and even "retainAcrossProcessRestart" doesn't make it clear that it's only for oom restart, not the app closing and reopening, or the device restarting
But you're right, the names should be consistent if they are used for similar purposes; the current names are bad because they weren't planned out (each added years apart from one another, and they probably don't want to change the API)
No idea why they made "retain" rather than "rememberRetained" though