From 7e4da5c7d6192b29531cc2d3bcc5c8f589682425 Mon Sep 17 00:00:00 2001 From: Fox2Code Date: Thu, 12 May 2022 15:57:06 +0200 Subject: [PATCH] Hardcode mmm.getForegroundColor() colors using activity.isLightTheme() --- .../com/fox2code/mmm/androidacy/AndroidacyWebAPI.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyWebAPI.java b/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyWebAPI.java index 1ee1aaf..d440547 100644 --- a/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyWebAPI.java +++ b/app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyWebAPI.java @@ -1,6 +1,7 @@ package com.fox2code.mmm.androidacy; import android.content.res.Resources; +import android.graphics.Color; import android.net.Uri; import android.os.Build; import android.util.Log; @@ -459,15 +460,7 @@ public class AndroidacyWebAPI { */ @JavascriptInterface public int getForegroundColor() { - Resources.Theme theme = this.activity.getTheme(); - TypedValue typedValue = new TypedValue(); - theme.resolveAttribute(R.attr.colorOnPrimary, typedValue, true); - if (typedValue.type >= TypedValue.TYPE_FIRST_COLOR_INT && - typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) { - return typedValue.data; - } - theme.resolveAttribute(android.R.attr.foreground, typedValue, true); - return typedValue.data; + return this.activity.isLightTheme() ? Color.BLACK : Color.WHITE; } /**