-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Dark theme #3459
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
Dark theme #3459
Conversation
6087ae9 to
1e2961e
Compare
@tobiasKaminsky yes I also saw that, other than that the PR needs a lot of testing since with the move to AndroidX and supporting day/night via theming I had to abandon the Bridge base themes from the material components, so the theme crashes for legacy AppCompat UI elements (which we shouldn't have in placce anymore, but still), also I can't say if we need to upgrade dialogs, since material components 1.1.0 will introduce new dialog support classes... but well, this is Android dev life... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ddd054b to
232aa15
Compare
This comment has been minimized.
This comment has been minimized.
232aa15 to
4a1c4a5
Compare
|
@splitt3r thanks for testing, your issues should now be fixed with the latest commits 🚀 @tobiasKaminsky @dan0xii I'd be fine with merging this to master and start with small(er) fixes for papercuts |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11441.apk |
Codacy299Lint
SpotBugs (new)
SpotBugs (master)
Lint increased! |
Codacy299Lint
SpotBugs (new)
SpotBugs (master)
Lint increased! |
Agreed. I'll just continue to try and tidy up the theme to get it to look right and then I'll go back and try and make the code slicker. |
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11443.apk |
Codacy299Lint
SpotBugs (new)
SpotBugs (master)
|
|
|
||
| Button providerButton = findViewById(R.id.signup); | ||
| providerButton.setBackgroundColor(getResources().getColor(R.color.primary_dark)); | ||
| providerButton.setBackgroundColor(getResources().getColor(R.color.primary)); |
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.
This might lead to problems with branding, please revert.
| Canvas c = new Canvas(resultBitmap); | ||
|
|
||
| c.drawColor(MainApp.getAppContext().getResources().getColor(R.color.background_color)); | ||
| c.drawColor(MainApp.getAppContext().getResources().getColor(R.color.bg_default)); |
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.
If we change this on demand to dark/light value, this will be permanent in cache and thus might be wrong.
Doing this dynamic would be a way, but for now I think we should just use light background for PNG as always.
(I'll create a ticket to investigate this later).
| new int[][]{new int[]{android.R.attr.state_checked}, | ||
| new int[]{}}, | ||
| new int[]{trackColor, trackColorUnchecked}); | ||
| // new int[]{trackColor, Color.parseColor("#4D000000")}); |
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.
remove commented line
| * Base activity with common behaviour for activities dealing with ownCloud {@link Account}s . | ||
| */ | ||
| public abstract class BaseActivity extends AppCompatActivity implements Injectable { | ||
| public abstract class BaseActivity extends AppCompatActivity implements Injectable, SharedPreferences.OnSharedPreferenceChangeListener { |
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.
Line wrap
| * Tracks whether the activity should be recreate()'d after a theme change | ||
| */ | ||
| private boolean mThemeChangePending; | ||
| private boolean mPaused; |
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.
no m prefix
src/main/res/values-night/colors.xml
Outdated
| @@ -0,0 +1,82 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <!-- | |||
| ownCloud Android client application | |||
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.
New license header, as it is a new file
src/main/res/values-v21/styles.xml
Outdated
|
|
||
| <style name="DatePickerStyle" parent=""> | ||
| <item name="android:headerBackground">@color/bg_fallback_highlight</item> | ||
| <!-- TODO for < API21 --> |
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.
Is this a real todo? Then please remove it here and create a new issue with label "darkTheme".
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.
removed since v16 simply shows a (holo) date picker atm. cc @dan0xii
src/main/res/values/colors.xml
Outdated
| <color name="black">#000000</color> | ||
| <color name="white">#FFFFFF</color> | ||
| <color name="textColor">@color/black</color> | ||
| <!--<color name="white">#FFFFFF</color>--> |
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.
remove
src/main/res/values/strings.xml
Outdated
| <string name="prefs_imprint">Imprint</string> | ||
| <string name="prefs_value_theme_light">Light</string> | ||
| <string name="prefs_value_theme_dark">Dark</string> | ||
| <string name="prefs_key_theme">darkTheme</string> |
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.
This is a preference internal key, please move it
src/main/res/xml/preferences.xml
Outdated
| @@ -1,5 +1,4 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <!-- | |||
| <?xml version="1.0" encoding="utf-8"?><!-- | |||
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.
should be 2 lines (though I know that Android Studio likes to put this into one line…)
|
Only minor changes due to code review. Once it is merged, I'll create some issues so that we can fix this in smaller steps. |
|
taking care of the review comments right now |
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
|
@tobiasKaminsky code review changes are ✔️ DONE Feel free to re-review, test-drive and merge :) |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11455.apk |
Codacy299Lint
SpotBugs (new)
SpotBugs (master)
|
|
Hi everyone, |
|
So glad to get this merged. Thanks for the help getting it over the line, @AndyScherzinger. |
2a43da6 Merge pull request #4746 from nextcloud/createChooser f8d7ddd Merge pull request #4758 from nextcloud/fixDarkTheme bee8770 - fix typo in styles - fix sign up with provider in dark primary color cc710b0 Merge pull request #3459 from nextcloud/dark_theme c1aa005 changes due to code review c801a2c Merge pull request #4744 from nextcloud/v3100_Alpha1 12fe91a use default open chooser with "just once", "always" 8b4481f [tx-robot] updated from transifex 2ea1f4e daily dev 20191029
|
And this is the link: https://github.com/nextcloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature%3A+theming%22 Some are bugs, some are enhancements :-) |
Always a pleasure to help @dan0xii ❤️ |





Resolves #2188
improvement for #3107 (AMOLED, needs a black variant, not a dark grey to improve AMOLED)
dark theme implementation has been done by @dan0xii 🎉
TODO
update to material 1.1.0 (when released)Update to material 1.1.0 #4749"Sharing" search box has black-on-grey text in dark mode."Sharing" search box has black-on-grey text in dark mode. #4750Rename dialog doesn't match styling of other edittext boxes.Rename dialog doesn't match styling of other edittext boxes. #4751I've lightened the track up in dark mode. Example:
(Fix by dan0xii although the colours could be tweaked).
(Possibly fixed. See Dark theme #3459 (comment)).
Note: Floating action button is black-on-primary colour on API 19.