From 9726da053ce71225dd5b40b92d50ddee03dbcf33 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 18 May 2024 23:02:29 +0200 Subject: [PATCH] Fixed tabular background color --- .../java/eu/faircode/email/FragmentDialogTheme.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java b/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java index 7d80c72906..02029d8791 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java @@ -29,6 +29,7 @@ import android.graphics.Paint; import android.os.Build; import android.os.Bundle; import android.provider.Settings; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -675,10 +676,14 @@ public class FragmentDialogTheme extends FragmentDialogBase { if (color == null) if (black) color = Color.BLACK; - else - color = ContextCompat.getColor(context, dark - ? android.R.color.system_background_dark - : android.R.color.system_background_light); + else { + TypedValue a = new TypedValue(); + context.getTheme().resolveAttribute(android.R.attr.windowBackground, a, true); + if (a.type >= TypedValue.TYPE_FIRST_COLOR_INT && a.type <= TypedValue.TYPE_LAST_COLOR_INT) + color = a.data; + else + color = Color.parseColor(dark ? "#121316" : "#FAF9FD"); + } view.setBackgroundColor(color); }