aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java9
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java3
2 files changed, 11 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
index 7cdec427..61beaee0 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/BaseActivity.java
@@ -40,6 +40,7 @@ public abstract class BaseActivity extends AppCompatActivity {
private boolean immersiveInterface;
private boolean changeStatusBarIconColor = true;
private boolean transparentStatusBarAfterToolbarCollapsed;
+ private boolean hasDrawerLayout = false;
private int systemVisibilityToolbarExpanded = 0;
private int systemVisibilityToolbarCollapsed = 0;
private CustomThemeWrapper customThemeWrapper;
@@ -105,7 +106,9 @@ public abstract class BaseActivity extends AppCompatActivity {
Window window = getWindow();
View decorView = window.getDecorView();
- window.setStatusBarColor(customThemeWrapper.getColorPrimaryDark());
+ if (!hasDrawerLayout) {
+ window.setStatusBarColor(customThemeWrapper.getColorPrimaryDark());
+ }
boolean isLightStatusbar = customThemeWrapper.isLightStatusBar();
boolean isLightNavBar = customThemeWrapper.isLightNavBar();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -208,6 +211,10 @@ public abstract class BaseActivity extends AppCompatActivity {
this.transparentStatusBarAfterToolbarCollapsed = true;
}
+ protected void setHasDrawerLayout() {
+ hasDrawerLayout = true;
+ }
+
protected void applyToolbarTheme(Toolbar toolbar) {
toolbar.setTitleTextColor(customThemeWrapper.getToolbarPrimaryTextAndIconColor());
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
index 03a489d5..315b81ed 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
@@ -193,6 +193,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar);
+ setHasDrawerLayout();
+
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@@ -292,6 +294,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
protected void applyCustomTheme() {
int backgroundColor = mCustomThemeWrapper.getBackgroundColor();
drawer.setBackgroundColor(backgroundColor);
+ drawer.setStatusBarBackgroundColor(mCustomThemeWrapper.getColorPrimaryDark());
navigationView.setBackgroundColor(backgroundColor);
appBarLayout.setBackgroundColor(mCustomThemeWrapper.getToolbarAndTabBackgroundColor());
applyTabLayoutTheme(tabLayout);