Open WSTxda opened 1 month ago
I did consider this one, the major issue I saw was that there's no good UX spec for the font, color and spacing etc so I didn't add it.
I did consider this one, the major issue I saw was that there's no good UX spec for the font, color and spacing etc so I didn't add it.
Are you referring to attributes? I don't know how it is in compose, but a cardview or drawable shape can be used for this with primaryContainer
in background color. For text can be usel use textAppearanceTitleLarge
with 20sp
for text size. For the paddings need to adjust according to the background for visual harmony.
Noting that there must be a limit on the margin that visually respects the corners of the background.
It's not as simple as that, because this has a lot of custom design tokens that aren't shared with other preferences so if we add it we'll have to expose all those as separate entries in PreferenceTheme
as well. For instance the title font and the rounded corner size, and the different paddings. You may look at https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SettingsLib/MainSwitchPreference/src/com/android/settingslib/widget/MainSwitchPreference.java to implement one for yourself without supporting theming though, and that will be much simpler.
Just like in settingslib / AOSP settings and other apps, the switch bar is used as a master control for a list of preferences.
This is useful when you need to determine a high priority preference in list, on which the others depend on it.
I think it could be an interesting addition.