Skip to content

Conversation

@troZee
Copy link
Contributor

@troZee troZee commented Jun 26, 2020

Motivation

Closes #1597

Android 10 and iOS 13 added support for dark theme. User (like me ;p) can set dark theme as default theme. Application should adapt to this theme automatically, hence I would like to have automatically theme changing in my app, so I don't need to care about user preferences.

TODO

  • Add an example, which demonstrates this api

Screenshots

Simulator Screen Shot - iPhone X - 2020-06-27 at 16 00 29

Simulator Screen Shot - iPhone X - 2020-06-27 at 15 59 25

Test plan

@callstack-bot
Copy link

callstack-bot commented Jun 26, 2020

Hey @troZee, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

} else {
const theme =
this.state.colorScheme === 'light' ? DefaultTheme : DarkTheme;
return Object.assign(theme as ReactNativePaper.Theme, {
Copy link
Member

Choose a reason for hiding this comment

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

Probably not from your change, but Object.assign incorrect here since:

  1. It'll mutate our theme
  2. Adding animation property will override anything else defined in this property. We don't have anything else right now, but might have in future.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's my change. This PR fixes the issues you mentioned @satya164

@troZee troZee force-pushed the feat/dark-light-theme branch 3 times, most recently from 36791a5 to de8c2ec Compare June 27, 2020 13:57
@troZee troZee marked this pull request as ready for review June 27, 2020 14:01
@troZee
Copy link
Contributor Author

troZee commented Jun 27, 2020

Simulator Screen Shot - iPhone X - 2020-06-27 at 16 00 29

Simulator Screen Shot - iPhone X - 2020-06-27 at 15 59 25

@matkoson
Copy link
Contributor

@troZee I opened a PR to fix theme merging, beyond that lgtm. Animation scale adjustment works fine.

@troZee troZee force-pushed the feat/dark-light-theme branch from a627ee3 to 58ab6a0 Compare June 29, 2020 12:30
@troZee troZee requested review from matkoson and satya164 June 29, 2020 12:31
@Trancever Trancever merged commit 7d4e006 into 4.0 Jun 29, 2020
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.

6 participants