Allow turning off black dark theme when md2 enabled (#61)

This commit is contained in:
tehcneko 2021-02-03 20:59:23 +08:00 committed by GitHub
parent 49b80387ee
commit 8b69bdd30d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 9 deletions

View File

@ -44,7 +44,7 @@ public class BaseActivity extends AppCompatActivity {
}
public static boolean isBlackNightTheme() {
return preferences.getBoolean("black_dark_theme", false) || preferences.getBoolean("md2", true);
return preferences.getBoolean("black_dark_theme", false);
}
public String getTheme(Context context) {
@ -107,7 +107,7 @@ public class BaseActivity extends AppCompatActivity {
if (coreVersionStr != null) {
Version managerVersion = new Version(BuildConfig.VERSION_NAME);
Version coreVersion = new Version(coreVersionStr);
if (managerVersion.equals(coreVersion)) {
if (!managerVersion.equals(coreVersion)) {
new MaterialAlertDialogBuilder(this)
.setMessage(R.string.outdated_manager)
.setPositiveButton(R.string.ok, (dialog, id) -> {

View File

@ -251,10 +251,6 @@ public class SettingsActivity extends BaseActivity {
}
private void updatePreference(boolean show) {
Preference black_dark_theme = findPreference("black_dark_theme");
if (black_dark_theme != null) {
black_dark_theme.setVisible(show);
}
Preference transparent_status_bar = findPreference("transparent_status_bar");
if (transparent_status_bar != null) {
transparent_status_bar.setVisible(show);

View File

@ -1,4 +1,14 @@
<resources>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Dark" />
<style name="ThemeOverlay.Md2">
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorActionBar">@color/colorPrimaryDark</item>
<item name="android:colorBackground">@color/colorPrimaryDark</item>
<item name="android:windowBackground">@color/colorPrimaryDark</item>
<item name="listItemBackground">@drawable/item_background_md2</item>
<item name="roundBackground">@drawable/item_background_md2</item>
<item name="liftOnScroll">true</item>
</style>
</resources>

View File

@ -4,7 +4,6 @@
<attr name="listItemBackground" format="reference" />
<attr name="roundBackground" format="reference" />
<attr name="actionBarTheme" format="reference" />
<attr name="modulesHorizontalPadding" format="dimension" />
<attr name="actionBarPopupTheme" format="reference" />
<attr name="tabLayoutTheme" format="reference" />

View File

@ -7,7 +7,6 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorActionBar">@color/colorActionBar</item>
<item name="modulesHorizontalPadding">8dp</item>
<item name="actionBarTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
<item name="android:colorBackground">@color/colorBackground</item>
<item name="android:windowBackground">@color/colorBackground</item>
@ -60,7 +59,6 @@
<item name="colorActionBar">@color/colorActionBar_md2</item>
<item name="android:colorBackground">@color/colorBackground_md2</item>
<item name="android:windowBackground">@color/colorBackground_md2</item>
<item name="modulesHorizontalPadding">16dp</item>
<item name="listItemBackground">@drawable/item_background_md2</item>
<item name="roundBackground">@drawable/item_background_md2</item>
<item name="liftOnScroll">true</item>