mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +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 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());
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user