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

Android: Set up Day/Night mode for system-compatible optional dark theme #8660

Merged
merged 2 commits into from
Mar 24, 2020
Merged

Conversation

TheRealPSV
Copy link
Contributor

@TheRealPSV TheRealPSV commented Mar 5, 2020

Updated Material Components dependency and implemented System-controlled Day/Night (Light/Dark) theming

Testing notes: Dark theme can be toggled through system settings in Android 10 (Q) and higher, or through an app like Night Mode for earlier Android versions.

Light Mode vs Dark Mode Screenshots:




@MayImilae
Copy link
Contributor

Please provide some screenshots.

@TheRealPSV
Copy link
Contributor Author

TheRealPSV commented Mar 5, 2020

Please provide some screenshots.

Done. I'm actually glad you asked, I found a bug I somehow missed with the Settings screen.
Let me know if there's anything else I can provide.

@Techjar
Copy link
Contributor

Techjar commented Mar 5, 2020

Um, perhaps add | height=350 after the URL in the markdown to make the images easier to look at, I think this syntax works on GitHub. They can still be clicked on for full size. Nevermind this does not work. GitHub really should have a way to scale down images. Or I guess it does work, cool.

@TheRealPSV
Copy link
Contributor Author

TheRealPSV commented Mar 5, 2020

Um, perhaps add | height=350 after the URL in the markdown to make the images easier to look at. They can still be clicked on for full size.

Github doesn't support that syntax anymore, see here. I had to switch to an <img> tag, as mentioned in the comments in that link.

@Techjar
Copy link
Contributor

Techjar commented Mar 5, 2020

Github doesn't support that syntax anymore, see here. I had to switch to an tag, as mentioned in its comments.

Oooh, okay, well that's a bit annoying but I appreciate you going through the trouble.

@TheRealPSV
Copy link
Contributor Author

TheRealPSV commented Mar 5, 2020

Oooh, okay, well that's a bit annoying but I appreciate you going through the trouble.

Sure, I also went ahead and made the screenshots side-by-side comparisons, which I think is a better way to show the changes.

@Techjar
Copy link
Contributor

Techjar commented Mar 5, 2020

Sure, I also went ahead and made the screenshots side-by-side comparisons, which I think is a better way to show the changes.

Yeah that looks much nicer.

Copy link
Member

@Ebola16 Ebola16 left a comment

Choose a reason for hiding this comment

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

Can you rebase this to the latest master? And in styles.xml, can you replace all MaterialComponents with AppCompat (see #8659)?

Also note that the color of the "+" button has changed, but I don't mind that.

@TheRealPSV
Copy link
Contributor Author

@Ebola16

Can you rebase this to the latest master? And in styles.xml, can you replace all MaterialComponents with AppCompat (see #8659)?

Done and done. I was going to remove the gradle dependency entirely, but it looks like its components are still used throughout the app elsewhere.

Also note that the color of the "+" button has changed, but I don't mind that.

Apparently switching the MaterialComponents to AppCompat in styles fixed it.

@JosJuice
Copy link
Member

This PR has had master merged into it instead of being rebased on top of master. Could you rebase the PR to get rid of the unrelated commits?

@TheRealPSV
Copy link
Contributor Author

@JosJuice

This PR has had master merged into it instead of being rebased on top of master. Could you rebase the PR to get rid of the unrelated commits?

Sorry about that! Should be fixed now.

@Ebola16
Copy link
Member

Ebola16 commented Mar 13, 2020

Can you squash those two commits?
If you don't know how see https://gist.github.com/patik/b8a9dc5cd356f9f6f980 and use "The hard(er) and less flexible way"

@TheRealPSV
Copy link
Contributor Author

@Ebola16

Can you squash those two commits?
If you don't know how see https://gist.github.com/patik/b8a9dc5cd356f9f6f980 and use "The hard(er) and less flexible way"

Sure, does it look alright now?

@Ebola16
Copy link
Member

Ebola16 commented Mar 17, 2020

Settings submenu transition animations don't work properly in this PR. They appear to be fine in 5.0-11770.

Tested on:
Samsung Galaxy Note8 (SM-N950U)
Qualcomm Snapdragon 835
Octa-core (4x2.35 GHz Kryo & 4x1.9 GHz Kryo)
Adreno 540
6GB RAM (LPDDR4)
Android 9
OpenGL ES 3.2 V@331.0

@TheRealPSV
Copy link
Contributor Author

@Ebola16

Settings submenu transition animations don't work properly in this PR. They appear to be fine in 5.0-11770.

I took a look and it turns out it's related to the hardcoded color value that was set in the settings recyclerview. I removed the color so the background would change along with the day/night theme, but it seems that the color is part of what makes the transition look the way it does. I replaced it with the default background color based on day/night.

This is the relevant line:

android:background="?android:attr/colorBackground"

I tested it out and the transition works properly with both day and night mode now. Let me know if you encounter any more issues.

@leoetlino
Copy link
Member

The contrast level for the purple text seems to be a bit low. Is it possible to use a less saturated colour for the dark theme?

@TheRealPSV
Copy link
Contributor Author

@leoetlino

The contrast level for the purple text seems to be a bit low. Is it possible to use a less saturated colour for the dark theme?

Yeah, I see what you mean. How does this look? I can make the purple accent color lighter in dark mode, like this.

@TheRealPSV
Copy link
Contributor Author

Anything more I can do to get this merged? Don't want it to sit around forever.

@leoetlino leoetlino merged commit 584eee8 into dolphin-emu:master Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants