Swap percent fields for DisplaySizeLevel enum end-to-end

The three v1 free sliders (UI scale, Card size, Spacing) become two
discrete enum-based controls (Card size, Spacing) and a new Text size
control, each selecting one of four DisplaySizeLevel values
(Extra small / Small / Default / Large). UI scale is dropped entirely;
the density override at the MainContent root goes with it.

Proto: replaces ui_scale_percent / card_size_percent / spacing_percent
with text_size_level / card_size_level / spacing_level on InterfacePreferences.
DisplaySizeLevel enum is ordered DEFAULT = 0 so proto-zero-default lands
new installs and any unset upgrader on DEFAULT for free; no upgrade-reset
block needed, no serializer default-setting needed.

AppPreference UiScale / CardSize / Spacing slider objects become three
AppChoicePreference<AppPreferences, DisplaySizeLevel> entries
(TextSize, CardSize, Spacing). DisplaySizeLevels.kt holds the user-facing
display order and the three per-control percent-mapping extensions
(textPercent / cardPercent / spacingPercent).

InterfaceCustomization stores the three level fields and exposes
cardSizePercent / spacingPercent as derived getters off the levels, so
every consumer of cardHeightDp / episodeCardHeightDp / spacingDp stays
unchanged.

DisplaySizePage keeps the preview infrastructure (sample-item viewmodel,
HomePageContent-based canvas, fake nav rail, two-column layout) and
swaps the slider column for three ChoicePreference selectors bound to
the new AppPreferences. The density-override wrap on the preview pane
is removed.

InterfaceHelpersTest withinBoundsOrDefault now exercises SkipForward
since CardSize / Spacing are no longer AppSliderPreference. The two
InterfaceCustomization scaling tests assert against cardSizeLevel = LARGE
(116%) and spacingLevel = LARGE (125%).
This commit is contained in:
Justin Visser 2026-05-28 11:26:27 +02:00
parent b6c4f0dd4f
commit c9433fbf57
10 changed files with 220 additions and 228 deletions

View file

@ -177,6 +177,13 @@ enum DisplayToggle{
COMMUNITY_RATING = 2;
}
enum DisplaySizeLevel{
DEFAULT = 0;
EXTRA_SMALL = 1;
SMALL = 2;
LARGE = 3;
}
message InterfacePreferences {
ThemeSongVolume play_theme_songs = 1;
bool remember_selected_tab = 2;
@ -193,9 +200,9 @@ message InterfacePreferences {
bool show_logos = 13;
SearchPreferences search_preferences = 14;
repeated DisplayToggle display_toggles = 15;
int32 ui_scale_percent = 16;
int32 card_size_percent = 17;
int32 spacing_percent = 18;
DisplaySizeLevel text_size_level = 19;
DisplaySizeLevel card_size_level = 20;
DisplaySizeLevel spacing_level = 21;
}
message AdvancedPreferences {