Fix issue #603 - Fix status bar color

This commit is contained in:
Thomas 2022-12-12 14:51:34 +01:00
parent 5a0eff4ae8
commit 202e527b5f
4 changed files with 36 additions and 0 deletions

View File

@ -19,8 +19,11 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -81,6 +84,9 @@ public class BaseActivity extends AppCompatActivity {
break;
case "BLACK":
setTheme(R.style.BlackAppTheme);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
currentThemeId = R.style.BlackAppTheme;
break;
case "DRACULA":
@ -115,6 +121,9 @@ public class BaseActivity extends AppCompatActivity {
case "BLACK":
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
setTheme(R.style.BlackAppTheme);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
currentThemeId = R.style.BlackAppTheme;
break;
case "DRACULA":

View File

@ -19,8 +19,11 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -74,6 +77,9 @@ public class BaseAlertDialogActivity extends AppCompatActivity {
setTheme(R.style.SolarizedAlertDialog);
break;
case "BLACK":
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.BlackAlertDialog);
break;
case "DRACULA":
@ -102,6 +108,9 @@ public class BaseAlertDialogActivity extends AppCompatActivity {
break;
case "BLACK":
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.BlackAlertDialog);
break;
case "DRACULA":

View File

@ -19,8 +19,11 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -73,6 +76,9 @@ public class BaseBarActivity extends AppCompatActivity {
setTheme(R.style.SolarizedAppThemeBar);
break;
case "BLACK":
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.BlackAppThemeBar);
break;
case "DRACULA":
@ -102,6 +108,9 @@ public class BaseBarActivity extends AppCompatActivity {
break;
case "BLACK":
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.BlackAppThemeBar);
break;
case "DRACULA":

View File

@ -19,8 +19,11 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
@ -73,6 +76,9 @@ public class BaseTransparentActivity extends AppCompatActivity {
setTheme(R.style.TransparentSolarized);
break;
case "BLACK":
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.TransparentBlack);
break;
case "DRACULA":
@ -102,6 +108,9 @@ public class BaseTransparentActivity extends AppCompatActivity {
break;
case "BLACK":
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.BLACK);
setTheme(R.style.TransparentBlack);
break;
case "DRACULA":