Skip to content

Commit

Permalink
translucent status bar and colored navigation bar options fixed
Browse files Browse the repository at this point in the history
dnldsht committed Aug 10, 2016
1 parent 2611d11 commit a61aae9
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ android {
minSdkVersion 19
targetSdkVersion 24
versionCode 10
versionName "v0.5.1"
versionName "v0.5.2"
}
lintOptions {
disable 'MissingTranslation'
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

/*** SW TRANSLUCENT STATUS BAR ***/
swStatusBar = (SwitchCompat) findViewById(R.id.SetTraslucentStatusBar);
swStatusBar.setChecked(isTranslucentStatusBar());
swStatusBar.setChecked(SP.getBoolean(getString(R.string.preference_translucent_status_bar), true));
swStatusBar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -263,16 +263,15 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

/*** SW COLORED NAV BAR ***/
swNavBar = (SwitchCompat) findViewById(R.id.SetColoredNavBar);
swNavBar.setChecked(isNavigationBarColored());
swNavBar.setChecked(SP.getBoolean(getString(R.string.preference_colored_nav_bar), false));
swNavBar.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SP.putBoolean(getString(R.string.preference_colored_nav_bar), isChecked);
updateTheme();
updateSwitchColor(swNavBar, getAccentColor());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
getWindow().setNavigationBarColor(
isNavigationBarColored() ? getPrimaryColor() : ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));
getWindow().setNavigationBarColor(isNavigationBarColored() ? getPrimaryColor() : ContextCompat.getColor(getApplicationContext(), R.color.md_black_1000));

}
});
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ public void onResume(){

public void updateTheme(){
themeHelper.updateTheme();
coloredNavBar = SP. getBoolean(getString(R.string.preference_colored_nav_bar), false);
coloredNavBar = SP.getBoolean(getString(R.string.preference_colored_nav_bar), false);
obscuredStatusBar = SP.getBoolean(getString(R.string.preference_translucent_status_bar),true);
applyThemeImgAct = SP.getBoolean(getString(R.string.preference_apply_theme_pager), true);
}

0 comments on commit a61aae9

Please sign in to comment.