Open Bug 1919488 Opened 2 years ago Updated 1 year ago

Update splashscreen background color to match application's set theme

Categories

(Firefox for Android :: Design System and Theming, enhancement)

All
Android
enhancement

Tracking

()

REOPENED

People

(Reporter: petru, Assigned: petru)

References

(Depends on 1 open bug)

Details

(Whiteboard: [fxdroid][group3])

Attachments

(2 files, 2 external files, 1 obsolete file)

Idea got from a conversation about the isSystemInDarkTheme API - https://kotlinlang.slack.com/archives/CJLTWPH7S/p1726654545685589?thread_ts=1726652145.491239&cid=CJLTWPH7S

Looks like a new API in UIModeManager - setApplicationNightMode allows to persist the application's dark theme outside of the lifecycle of AppCompatDelegate.setDefaultNightMode.
And this allows to automagically use the matching background for our splashscreen.

What the result would be in Fenix debug vs current Nightly, both set to dark theme while the device uses light theme.

Summary: Update splashscreen background colorto match application's set theme → Update splashscreen background color to match application's set theme
Blocks: 1916300
Assignee: nobody → petru
Status: NEW → ASSIGNED
Whiteboard: [fxdroid][group3]
Pushed by plingurar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2c48aa9b6764 Persist night theme changes on Android S+ r=android-reviewers,Roger
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch

This reverts commit f26d0b8c729b1c0f0c102be4873dc024bb7bceb5.

Comment on attachment 9444937 [details]
Revert "Bug 1919488 - Persist night theme changes on Android S+" r=#android-reviewers

Revision D232832 was moved to bug 1938824. Setting attachment 9444937 [details] to obsolete.

Attachment #9444937 - Attachment is obsolete: true

In the case of theme changes that trigger an UI mode change applies in the application
after the current activity is restarted it should also apply the new ui mode to it's
configuration.

Regressions: 1938824
Pushed by plingurar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a5c5bfff3e12 Apply ui mode changes to activities r=android-reviewers,pollymce
Flags: qe-verify+

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

For the future, it would have been cleaner if the new patch had landed in bug 1938824 so we can better track cause and effect (that bug is now both effectively caused and fixed by the same bug #).

Regressions: 1938868
Regressions: 1938966
Backout by agoloman@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/40da57a51d95 Backed out changeset a5c5bfff3e12 requested by developer. https://hg.mozilla.org/mozilla-central/rev/a9a5b02885fb Backed out changeset 2c48aa9b6764 because it was requested by developer.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
Target Milestone: 135 Branch → ---

This is the current behavior on the latest Nightly 135.0a1 build from 12/27:

  • the device's theme is different from the app's theme,
  • when opening the app, the splashscreen has the same background as the device's.

Tested with Oppo Find N2 Flip (Android 14), Realme GT Master Edition (Android 13), and google Pixel 6 (Android 15).
Removing the qe-verify+ flag for now.

Flags: qe-verify+
No longer regressions: 1938966
Pushed by plingurar@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35b9fb7dc782 Persist night theme changes on Android S+ r=android-reviewers,Roger https://hg.mozilla.org/integration/autoland/rev/ddd04bc48281 Apply ui mode changes to activities r=android-reviewers,pollymce
Status: ASSIGNED → RESOLVED
Closed: 1 year ago → 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch

@ QA These patches were previously reverted.
After being merged back please help verify here and in bug 1916300 that the splashscreen has the right background color on Android 12+ and no ill effects are observed.

Flags: qe-verify+

Thanks Petru,

Verified on multiple devices with the Fenix Nightly 136.0a1 from 1/9.
Everything looks good on Google Pixel 6 (Android 15), Samsung Galaxy S24 (Android 14), Oppo Find N2 Flip (Android 14), Vivo v23 (Android 14). The splashscreen follows Fenix' theme, even when the device's theme is different.

However on some devices, the difference between the device's theme and the app's theme messes up the UI in Settings - I filed Bug 1940902.

Flags: qe-verify+ → needinfo?(petru)
Regressions: 1940902

The newly reported regression seems to show a race from setting both the selected theme here and the selected locale.
Seems like something specific to our implementation of in-app locale switching so I recommend re-evaluating supporting the splashscreen color updates only after moving to the new APIs for per-app language preferences that we have planned in bug 1813857.

Depends on: 1813857

This was reverted again in bug 1940902.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 136 Branch → ---

Thanks Ryan!
Yeah, this seems too unstable in the context of other configurations that we have.
After bug 1813857 the implementation should be more straight-forward - no conflict with also applying locale changes.

Flags: needinfo?(petru)
See Also: → 1998506
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: