diff --git a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt index 13e100c0a..26538e32a 100644 --- a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt +++ b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt @@ -9,9 +9,11 @@ import org.schabi.newpipe.R import org.schabi.newpipe.ui.components.common.ScaffoldWithToolbar import org.schabi.newpipe.ui.screens.AboutScreen import org.schabi.newpipe.ui.theme.AppTheme +import org.schabi.newpipe.util.ThemeHelper class AboutActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { + setTheme(ThemeHelper.getTheme(this)) enableEdgeToEdge() super.onCreate(savedInstanceState) diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java index d5089cb7d..0e86939f8 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java @@ -86,9 +86,9 @@ public class SettingsActivity extends AppCompatActivity implements @Override protected void onCreate(final Bundle savedInstanceBundle) { - setTheme(ThemeHelper.getSettingsThemeStyle(this)); - + setTheme(ThemeHelper.getTheme(this)); super.onCreate(savedInstanceBundle); + Bridge.restoreInstanceState(this, savedInstanceBundle); final boolean restored = savedInstanceBundle != null; diff --git a/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java b/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java index f6c9c4c3f..109f8354b 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java @@ -158,35 +158,33 @@ public final class ThemeHelper { } @StyleRes - public static int getSettingsThemeStyle(final Context context) { + public static int getTheme(@NonNull final Context context) { final Resources res = context.getResources(); final String lightTheme = res.getString(R.string.light_theme_key); final String blackTheme = res.getString(R.string.black_theme_key); final String automaticDeviceTheme = res.getString(R.string.auto_device_theme_key); - - final String selectedTheme = getSelectedThemeKey(context); if (selectedTheme.equals(lightTheme)) { - return R.style.LightSettingsTheme; + return R.style.LightTheme; } else if (selectedTheme.equals(blackTheme)) { - return R.style.BlackSettingsTheme; + return R.style.BlackTheme; } else if (selectedTheme.equals(automaticDeviceTheme)) { if (isDeviceDarkThemeEnabled(context)) { // use the dark theme variant preferred by the user final String selectedNightTheme = getSelectedNightThemeKey(context); if (selectedNightTheme.equals(blackTheme)) { - return R.style.BlackSettingsTheme; + return R.style.BlackTheme; } else { - return R.style.DarkSettingsTheme; + return R.style.DarkTheme; } } else { // there is only one day theme - return R.style.LightSettingsTheme; + return R.style.LightTheme; } } else { // default to dark theme - return R.style.DarkSettingsTheme; + return R.style.DarkTheme; } } diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index e8b6cdbbf..3269a690f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -127,21 +127,14 @@ true - - @@ -177,31 +170,6 @@ ?attr/colorSurfaceContainerHigh - - - - - - -