Skip to content

Match the Appearance screen's Dark Mode section to iOS - #2279

Draft
mpretty-cyro wants to merge 2 commits into
session-foundation:devfrom
mpretty-cyro:appearance-dark-mode-section
Draft

mpretty-cyro wants to merge 2 commits into
session-foundation:devfrom
mpretty-cyro:appearance-dark-mode-section

Conversation

@mpretty-cyro

Copy link
Copy Markdown
Collaborator

Contributor checklist

  • I have tested my contribution on these devices:
  • Virtual device: Pixel 7 profile, API 37 (arm64), play flavour, debug
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

The Dark Mode section on the Appearance screen didn't match iOS. Its header read "Auto Dark Mode", and its only row was the sentence "Follow system settings." set as a bold title. It now matches iOS:

  • the header is "Dark Mode" (darkMode);
  • the row has the title "Auto Dark Mode" (appearanceAutoDarkMode) with "Follow system settings." (followSystemSettings) as its subtitle.

All three strings already existed and are translated, so no strings are added. The row copies the styles of the Compose switch rows (SwitchActionRowItem): a 16sp bold title over a 12sp subtitle, both in the primary text colour, 2dp apart. The title's style is the same as the old row's.

The second commit makes the row act as one switch:

  • TalkBack used to read the label and the switch as separate items. It now reads the row as a single switch: "On, Auto Dark Mode, Follow system settings., Switch". The Compose switch is hidden from accessibility services, so it isn't a second stop. Its QA tag is still in the uiautomator tree.
  • Touch: a tap anywhere on the row now toggles the setting, as on iOS and in the Compose switch rows. Before, only the switch itself responded. The switch, the preference and AppearanceSettingsViewModel are unchanged.

Confidence: high. It's a layout change plus an accessibility delegate on one row.

Testing: on an emulator, before and after, in Classic Dark, Classic Light, Arabic (RTL), German, and at 1.5× and 2× font size. At the large sizes the subtitle wraps cleanly beside the switch. I also checked:

  • a tap on the row and a tap on the switch both toggle it, and the two stay in sync;
  • with the setting on, switching the system between light and dark changes the app's theme;
  • with TalkBack on, the row is one focus stop, reads the label and state as above, and Enter toggles it.

Toggling the setting recreates the activity, as it already did, so TalkBack focus moves away after a toggle.

The section header read "Auto Dark Mode" and its only row was the sentence
"Follow system settings." set as a bold title. The header is now "Dark Mode",
and the row has the title "Auto Dark Mode" with "Follow system settings." as
its subtitle, styled like the Compose switch rows (16sp bold over 12sp).
TalkBack read the label and the switch as separate items, and only the switch
itself responded to a tap. The row now toggles the setting when tapped, as on
iOS and in the Compose switch rows, and TalkBack reads it as a single switch:
"On, Auto Dark Mode, Follow system settings., Switch".

@mpretty-cyro mpretty-cyro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant