From 85003d0f36c9029f5a8438f1480a7ab189bb0d2f Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 25 Apr 2022 13:08:45 +0200 Subject: [PATCH] Fixed widget button colors --- .../java/eu/faircode/email/WidgetUnified.java | 6 ++++++ .../main/res/drawable/twotone_edit_24_black.xml | 15 +++++++++++++++ .../main/res/drawable/twotone_edit_24_white.xml | 15 +++++++++++++++ .../main/res/drawable/twotone_sync_24_black.xml | 9 +++++++++ .../main/res/drawable/twotone_sync_24_white.xml | 10 ++++++++++ app/src/main/res/layout/widget_unified.xml | 8 ++------ 6 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/twotone_edit_24_black.xml create mode 100644 app/src/main/res/drawable/twotone_edit_24_white.xml create mode 100644 app/src/main/res/drawable/twotone_sync_24_black.xml create mode 100644 app/src/main/res/drawable/twotone_sync_24_white.xml diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index a983e588c5..4546f4c388 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -138,6 +138,8 @@ public class WidgetUnified extends AppWidgetProvider { views.setInt(R.id.background, "setBackgroundColor", background); views.setTextColor(R.id.title, colorWidgetForeground); + views.setImageViewResource(R.id.refresh, R.drawable.twotone_sync_24_white); + views.setImageViewResource(R.id.compose, R.drawable.twotone_edit_24_white); } else { float lum = (float) ColorUtils.calculateLuminance(background); @@ -148,6 +150,10 @@ public class WidgetUnified extends AppWidgetProvider { int fg = (lum > 0.7f ? Color.BLACK : colorWidgetForeground); views.setTextColor(R.id.title, fg); + views.setImageViewResource(R.id.refresh, lum > 0.7f + ? R.drawable.twotone_sync_24_black : R.drawable.twotone_sync_24_white); + views.setImageViewResource(R.id.compose, lum > 0.7f + ? R.drawable.twotone_edit_24_black : R.drawable.twotone_edit_24_white); } int dp6 = Helper.dp2pixels(context, 6); diff --git a/app/src/main/res/drawable/twotone_edit_24_black.xml b/app/src/main/res/drawable/twotone_edit_24_black.xml new file mode 100644 index 0000000000..f668feaf7f --- /dev/null +++ b/app/src/main/res/drawable/twotone_edit_24_black.xml @@ -0,0 +1,15 @@ + + + + diff --git a/app/src/main/res/drawable/twotone_edit_24_white.xml b/app/src/main/res/drawable/twotone_edit_24_white.xml new file mode 100644 index 0000000000..679dc780d9 --- /dev/null +++ b/app/src/main/res/drawable/twotone_edit_24_white.xml @@ -0,0 +1,15 @@ + + + + diff --git a/app/src/main/res/drawable/twotone_sync_24_black.xml b/app/src/main/res/drawable/twotone_sync_24_black.xml new file mode 100644 index 0000000000..0175248dcb --- /dev/null +++ b/app/src/main/res/drawable/twotone_sync_24_black.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/twotone_sync_24_white.xml b/app/src/main/res/drawable/twotone_sync_24_white.xml new file mode 100644 index 0000000000..b926b26636 --- /dev/null +++ b/app/src/main/res/drawable/twotone_sync_24_white.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/widget_unified.xml b/app/src/main/res/layout/widget_unified.xml index 9ba18d9a0e..6a990a0add 100644 --- a/app/src/main/res/layout/widget_unified.xml +++ b/app/src/main/res/layout/widget_unified.xml @@ -38,9 +38,7 @@ android:layout_weight="0" android:contentDescription="@string/tile_synchronize" android:padding="6dp" - android:src="@drawable/twotone_sync_24" - android:visibility="gone" - app:tint="@color/colorWidgetForeground" /> + android:src="@drawable/twotone_sync_24_white" /> + android:src="@drawable/twotone_edit_24_white" />