-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Bugfix/status bar color #3241
Bugfix/status bar color #3241
Conversation
please work on the code analysis failure, you can run. |
@@ -112,6 +113,14 @@ public void initStatusBarResources(View parentView) { | |||
|
|||
if (getBoolean(PREFERENCE_COLORED_NAVIGATION) && SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
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 should be:
if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (getBoolean(PREFERENCE_COLORED_NAVIGATION)) {
window.setNavigationBarColor(PreferenceUtils.getStatusColor(getPrimary()));
} else {
if (getAppTheme().equals(AppTheme.LIGHT)) {
window.setNavigationBarColor(Utils.getColor(this, android.R.color.white));
} else if (getAppTheme().equals(AppTheme.BLACK)) {
window.setNavigationBarColor(Utils.getColor(this, android.R.color.black));
} else {
window.setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background));
}
}
}
setTheme(R.style.aboutBlack); | ||
} else { | ||
setTheme(R.style.aboutLight); | ||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { |
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.
And for versions older that lollipop?
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.
I have checked the official documentation and found that the color of the navigation bar cannot be manipulated for sdk versions before Lollipop, the closest you can get is making the bar translucent
@@ -105,23 +105,22 @@ public void initStatusBarResources(View parentView) { | |||
} else { | |||
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | |||
} | |||
if (getBoolean(PREFERENCE_COLORED_NAVIGATION)) { |
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.
@EmmanuelMess I have transfered the code to the right block as requested hope its fine now
Thanks for contribution. Sorry that it took some time to review. Changeset looks fine now. |
Description
In response to the issue reported in #3234:
Colorize Navigation Bar
insettings -> Apperance
the navigation bar turns black no matter the current theme.Issue tracker
Addresses issue at #3234
Colorize Navigation Bar
is ticked in settings, navigation bar color is consistent with primary color(blue) in all activities.Colorize Navigation Bar
is unticked in settings, navigation bar color always follows the current theme.Automatic tests
Manual tests
Done
Device: Huawei p30 lite
OS: Android 10
Device: Sharp Aquos 803SH
OS: Android 10
Device: Redmi Note 7
OS: Android 10
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug
./gradlew spotlessCheck