mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-12 03:07:11 +01:00
Fix status bar color in MainActivity.
This commit is contained in:
parent
fe658dd9e2
commit
751a515a7d
@ -40,6 +40,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
private boolean immersiveInterface;
|
private boolean immersiveInterface;
|
||||||
private boolean changeStatusBarIconColor = true;
|
private boolean changeStatusBarIconColor = true;
|
||||||
private boolean transparentStatusBarAfterToolbarCollapsed;
|
private boolean transparentStatusBarAfterToolbarCollapsed;
|
||||||
|
private boolean hasDrawerLayout = false;
|
||||||
private int systemVisibilityToolbarExpanded = 0;
|
private int systemVisibilityToolbarExpanded = 0;
|
||||||
private int systemVisibilityToolbarCollapsed = 0;
|
private int systemVisibilityToolbarCollapsed = 0;
|
||||||
private CustomThemeWrapper customThemeWrapper;
|
private CustomThemeWrapper customThemeWrapper;
|
||||||
@ -105,7 +106,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
Window window = getWindow();
|
Window window = getWindow();
|
||||||
View decorView = window.getDecorView();
|
View decorView = window.getDecorView();
|
||||||
window.setStatusBarColor(customThemeWrapper.getColorPrimaryDark());
|
if (!hasDrawerLayout) {
|
||||||
|
window.setStatusBarColor(customThemeWrapper.getColorPrimaryDark());
|
||||||
|
}
|
||||||
boolean isLightStatusbar = customThemeWrapper.isLightStatusBar();
|
boolean isLightStatusbar = customThemeWrapper.isLightStatusBar();
|
||||||
boolean isLightNavBar = customThemeWrapper.isLightNavBar();
|
boolean isLightNavBar = customThemeWrapper.isLightNavBar();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
@ -208,6 +211,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
this.transparentStatusBarAfterToolbarCollapsed = true;
|
this.transparentStatusBarAfterToolbarCollapsed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setHasDrawerLayout() {
|
||||||
|
hasDrawerLayout = true;
|
||||||
|
}
|
||||||
|
|
||||||
protected void applyToolbarTheme(Toolbar toolbar) {
|
protected void applyToolbarTheme(Toolbar toolbar) {
|
||||||
toolbar.setTitleTextColor(customThemeWrapper.getToolbarPrimaryTextAndIconColor());
|
toolbar.setTitleTextColor(customThemeWrapper.getToolbarPrimaryTextAndIconColor());
|
||||||
}
|
}
|
||||||
|
@ -193,6 +193,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
|
|
||||||
setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar);
|
setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar);
|
||||||
|
|
||||||
|
setHasDrawerLayout();
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
@ -292,6 +294,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
|||||||
protected void applyCustomTheme() {
|
protected void applyCustomTheme() {
|
||||||
int backgroundColor = mCustomThemeWrapper.getBackgroundColor();
|
int backgroundColor = mCustomThemeWrapper.getBackgroundColor();
|
||||||
drawer.setBackgroundColor(backgroundColor);
|
drawer.setBackgroundColor(backgroundColor);
|
||||||
|
drawer.setStatusBarBackgroundColor(mCustomThemeWrapper.getColorPrimaryDark());
|
||||||
navigationView.setBackgroundColor(backgroundColor);
|
navigationView.setBackgroundColor(backgroundColor);
|
||||||
appBarLayout.setBackgroundColor(mCustomThemeWrapper.getToolbarAndTabBackgroundColor());
|
appBarLayout.setBackgroundColor(mCustomThemeWrapper.getToolbarAndTabBackgroundColor());
|
||||||
applyTabLayoutTheme(tabLayout);
|
applyTabLayoutTheme(tabLayout);
|
||||||
|
Loading…
Reference in New Issue
Block a user