Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the manual dark theme is rendering correctly regarding -night resource and keyboard #3216

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jul 18, 2024

Content

Ensure that the system is aware about "forced" dark theme.
Using AppCompatDelegate.setDefaultNightMode is actually working like a charm, I have not found any regression.

Motivation and context

Full dark theme when system setting is set to light and application setting is set to dark.

Closes #3168

Screenshots / GIFs

Before After
Screenshot 2024-07-18 at 14 34 45 Screenshot 2024-07-18 at 14 34 51

Tests

image

Try to change system theme and application theme and observe that the application is always rendering the expected theme.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner July 18, 2024 12:45
@bmarty bmarty requested review from ganfra and removed request for a team July 18, 2024 12:45
Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/X5mPAd

Copy link

sonarcloud bot commented Jul 18, 2024

@bmarty bmarty added the PR-Bugfix For bug fix label Jul 18, 2024
Theme.Dark -> AppCompatDelegate.MODE_NIGHT_YES
}
)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that it could be done elsewhere, for instance in RootPresenter, but when the value is the same, setDefaultNightMode has no effect, so I guess it's fine to do it here.

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.13%. Comparing base (0d41788) to head (5ca0f64).
Report is 3 commits behind head on develop.

Files Patch % Lines
...id/libraries/designsystem/theme/ElementThemeApp.kt 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3216      +/-   ##
===========================================
- Coverage    76.14%   76.13%   -0.01%     
===========================================
  Files         1645     1645              
  Lines        38809    38815       +6     
  Branches      7516     7517       +1     
===========================================
+ Hits         29552    29553       +1     
- Misses        5356     5362       +6     
+ Partials      3901     3900       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

LGTM!

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 18, 2024
@bmarty bmarty enabled auto-merge July 18, 2024 13:12
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 18, 2024
@bmarty bmarty merged commit 4aa3961 into develop Jul 18, 2024
33 of 34 checks passed
@bmarty bmarty deleted the feature/bma/forceDarkTheme branch July 18, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assets in -nightly folder are not used when theme is forced to "Dark"
2 participants