Skip to content

feat(android): auto-switch dark theme#35

Merged
mateusz1913 merged 4 commits into
callstackincubator:mainfrom
shovel-kun:feat/android-dark-theme
May 13, 2025
Merged

feat(android): auto-switch dark theme#35
mateusz1913 merged 4 commits into
callstackincubator:mainfrom
shovel-kun:feat/android-dark-theme

Conversation

@shovel-kun
Copy link
Copy Markdown
Contributor

@shovel-kun shovel-kun commented May 7, 2025

ReactNativeLegalActivity will automatically switch between dark/light theme based on Android device's theme. This feature is only available API 29+, on lower APIs, ReactNativeLegalActivity will remain light.

Perhaps launchLicenseListScreen function could accept a bool "isDark" argument to make this programmatic.

Tested API 29, 33, and 35.

See attached video for demonstration.

dark.webm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2025

⚠️ No Changeset found

Latest commit: 9f9e7da

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Collaborator

@mateusz1913 mateusz1913 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Could I ask you on which devices (manufacturers) you tested your change?

I remember that some of the devices are problematic with dark mode (mainly some chinese e.g. Xiaomi) - I can test on one of older Xiaomis in next few days and will probably merge it

Comment thread package.json Outdated
@shovel-kun
Copy link
Copy Markdown
Contributor Author

@mateusz1913 Tested on physical Xiaomi device and Pixel (emulated).

@mateusz1913
Copy link
Copy Markdown
Collaborator

Great! I'll give it a shot tomorrow

Comment thread package.json Outdated
Copy link
Copy Markdown
Collaborator

@mateusz1913 mateusz1913 left a comment

Choose a reason for hiding this comment

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

I gave it a shot and it's almost there 🎉, left 2 last comments

@shovel-kun
Copy link
Copy Markdown
Contributor Author

Done and tested, switching themes works just as before.

@mateusz1913 mateusz1913 merged commit 8a892a5 into callstackincubator:main May 13, 2025
1 check passed
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.

2 participants