SimonHalvdansson / Harmonic-HN

Modern Android client for Hacker News
https://play.google.com/store/apps/details?id=com.simon.harmonichackernews
Apache License 2.0
620 stars 39 forks source link

Add "Material (auto)" theme that follows the system dark/light mode. #7

Closed kyleatmakrs closed 1 year ago

kyleatmakrs commented 1 year ago

Thanks for the great app! I've wanted a dark mode for HN for a long time :)

This new theme automatically follows the system dark/light mode. Given the existing theme and day/night timer, a new theme seemed like the cleanest way to add support for keeping the app's theme in-sync with the system.

Most of the magic is handled by values-night/theme.xml, but the comments action had a few things I needed to handle in onStart. I haven't done Android development before, but this seemed like the right way to go about it.

Feel free to integrate (or not) this pull request as you see fit. I won't be offended either way.

SimonHalvdansson commented 1 year ago

Thank you very much for the commit! This has been on the todo for a bit but I've been been busy and unsure about how to make it work so it looks like you solved both of those problems :) I'm currently on vacation so cannot test things right now but the only thing I was thinking about was that this isn't promoted on the welcome screen as an option which might be nice to have (although the theme options there are a but crowded right now).

So include this in the WelcomeActivity too if you want, if not that's fine too and I'll do it if it looks nice. And I won't merge until I'm back from vacation so this will remain open for a bit more but again thanks for you work 😃

kyleatmakrs commented 1 year ago

Added to the welcome screen. I put it in the same row as the other "Material You" themes.

SimonHalvdansson commented 1 year ago

Tested it out now and seems to work great - thanks for your very nice work!