From 8f093eb4a293e2a587c0f3e504ccb746524fda39 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sat, 30 Oct 2021 17:56:00 +0200 Subject: [PATCH] Add true black background for dark theme --- .../java/com/readrops/app/itemslist/MainActivity.java | 9 ++++++--- .../main/res/layout/activity_notification_permission.xml | 1 - app/src/main/res/values-night/styles.xml | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/readrops/app/itemslist/MainActivity.java b/app/src/main/java/com/readrops/app/itemslist/MainActivity.java index fc456d30..2eba17e0 100644 --- a/app/src/main/java/com/readrops/app/itemslist/MainActivity.java +++ b/app/src/main/java/com/readrops/app/itemslist/MainActivity.java @@ -10,6 +10,7 @@ import static com.readrops.app.utils.ReadropsKeys.SETTINGS; import static com.readrops.app.utils.ReadropsKeys.SYNCING; import android.content.Intent; +import android.content.res.Configuration; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; @@ -760,10 +761,12 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou private void startAboutActivity() { Libs.ActivityStyle activityStyle; - if (SharedPreferencesManager.readString(SharedPreferencesManager.SharedPrefKey.DARK_THEME).equals(getString(R.string.theme_value_light))) { - activityStyle = Libs.ActivityStyle.LIGHT_DARK_TOOLBAR; - } else { + int uiMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + + if (uiMode == Configuration.UI_MODE_NIGHT_YES) { activityStyle = Libs.ActivityStyle.DARK; + } else { + activityStyle = Libs.ActivityStyle.LIGHT_DARK_TOOLBAR; } new LibsBuilder() diff --git a/app/src/main/res/layout/activity_notification_permission.xml b/app/src/main/res/layout/activity_notification_permission.xml index fa78aa28..db6c3d56 100644 --- a/app/src/main/res/layout/activity_notification_permission.xml +++ b/app/src/main/res/layout/activity_notification_permission.xml @@ -15,7 +15,6 @@ android:id="@+id/notif_permission_account_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/md_white_1000" android:padding="12dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index c4e428b0..4871b41c 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -5,6 +5,10 @@ @color/colorPrimaryDark @color/colorAccent + @android:color/black + @android:color/black + @android:color/black + @color/colorPrimary @style/ThemeOverlay.AppCompat.Dark.ActionBar