Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 7e4da5c

Browse files
committed
Hardcode mmm.getForegroundColor() colors using activity.isLightTheme()
1 parent c28538b commit 7e4da5c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

app/src/main/java/com/fox2code/mmm/androidacy/AndroidacyWebAPI.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.fox2code.mmm.androidacy;
22

33
import android.content.res.Resources;
4+
import android.graphics.Color;
45
import android.net.Uri;
56
import android.os.Build;
67
import android.util.Log;
@@ -459,15 +460,7 @@ public int getAccentColor() {
459460
*/
460461
@JavascriptInterface
461462
public int getForegroundColor() {
462-
Resources.Theme theme = this.activity.getTheme();
463-
TypedValue typedValue = new TypedValue();
464-
theme.resolveAttribute(R.attr.colorOnPrimary, typedValue, true);
465-
if (typedValue.type >= TypedValue.TYPE_FIRST_COLOR_INT &&
466-
typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) {
467-
return typedValue.data;
468-
}
469-
theme.resolveAttribute(android.R.attr.foreground, typedValue, true);
470-
return typedValue.data;
463+
return this.activity.isLightTheme() ? Color.BLACK : Color.WHITE;
471464
}
472465

473466
/**

0 commit comments

Comments
 (0)