-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Add a dark/night mode #1306
Add a dark/night mode #1306
Conversation
(1) Hmm, why do you use so much transparency there (e.g. for buildings?) Can't you just use solid (darker) colors? (2) Also it really looks like a "night theme". It is e.g. not really suited for OLED-devices to be used at day times, as it does not have a string contrast. (3) Considering this a "night theme", what really sparks my eye in the second screenshot are the very light & bright icons. The do not at all fit the (map) theme/background and thus not only look displayed, but also strain your eyes if you are looking at this in the night. |
Well, that's probably a thing of the mapstyle (https://github.com/ENT8R/streetcomplete-mapstyle)... |
It is pretty cool that you do this. Creating a night-theme has been on my list since I redid the quest UI. I have not looked at the PR yet because I currently do not have so much time, just a few things that come to my mind regarding this:
|
Yes, the whole thing is using the DayNight themes which are built-in. They are compatible back to API 14 or something like that using AppCompat. I only said that beginning from Android Pie, there is a system setting which allows the user to select a theme. All other apps should adapt this setting and theme their app accordingly
Yes, this is part of the DayNight theme feature π
I also noticed this while testing. I will think about what might suit better here... |
Is this already ready for review? |
Mmhh.. I'd say not yet, I am still doing some tests. I will tell you if I think I'm done |
app/src/main/java/de/westnordost/streetcomplete/location/LocationRequestFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/de/westnordost/streetcomplete/settings/SettingsFragment.java
Show resolved
Hide resolved
getActivity().recreate(); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? The user can only change the setting in another activity.
(Also, this code should be in the activity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know, but the other activity (MainActivity
) is not destroyed by switching to the settings activity, so the view is also not re-rendered when switching back from the settings activity to the main acitivity. But as it is stated here: https://blog.iamsuleiman.com/daynight-theme-android-tutorial-example/
Calling
AppCompatDelegate.setDefaultNightMode(mode)
must be done BEFORE callingsuper()
in ActivityonCreate()
. Otherwise you mustrecreate()
the Activity for the set theme to take effect
I added this small check in order to recreate the activity if necessary...
The conflicts that need to be resolved are from the appcompat -> androidx migration, replacing the imports with the new paths will solve it. |
I finally found some time to continue to work on this branch... |
I checked it out and made some small adjustments in the hope that I can press it into the v10.0 release I want to do today, but I think I rather not rush it. Things that I would like to change still:
|
Also, I noticed a crash happening sometimes when I switch to the settings activity. The stack trace is:
It might have something to do with the Activity recreation: |
β¦sible RuntimeException
I don't really get what you mean... Do you want the quest form to be see-through? But I fixed two more points of your last comment:
|
No. In the screenshots you posted, at the very bottom, there is a triangle, a circle and a square on black / violet background. It is possible in Android to make that background transparent and let the view extend to under these buttons. Like for example in the launcher (the "desktop"). |
Thank you for clarification! I directly tried some things, but with no luck too π |
I just watched https://www.youtube.com/watch?v=_mGDMVRO3iE , but I am still confused. Apparently, |
On the other hand, neither Gmaps, nor maps.me, nor mapy.cz has a transparent navigation bar where the map is drawn below. So maybe it is not desirable for sc as well. |
# Conflicts: # app/src/main/res/values/strings.xml
I noticed a few more things. Some I fixed right away, the ones that are still open:
|
I like them. In contrast to before it now does not look so futuristic anymore. But BTW, don't forget to push the changes to https://github.com/ENT8R/streetcomplete-mapstyle, too. π |
No. I probably just forgot to remove it.
I like it, but maybe the contrast between the building color and the normal landuse color is a little bit too low? |
As said in #942 (comment) I put some more work β into this branch and it is not a setting π¨βπ§ for selecting a mapstyle anymore but rather a setting for selecting a theme π which implicates an automatic selection of a mapstyle πΊ.
I also made some other smaller changes which I noticed while testing:
And finally, here are some images of the new dark mode:
Fixes #198 and fixes #673