Moe
02/05/2025, 8:16 PMSkaldebane
02/05/2025, 8:54 PMLocalDensity
is the way to go for scaling. You don't have to change anything about your composables with this, because all drawing/layout/placement operations use scaled values through density.Skaldebane
02/05/2025, 8:57 PMCompositionLocalProvider
, passing in a custom value for LocalDensity:
CompositionLocalProvider(
LocalDensity provides Density(someValue)
) {
// your component / app
}
How you calculate which density to use is up to you, whether it's by the user, or based on the viewport size, depends on what you need.