From 9a6b6af5d9cfb6af069eda1aa391188918fd496b Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 1 Sep 2021 10:22:59 +0200 Subject: [PATCH] Blink widget refresh icon --- app/src/main/java/eu/faircode/email/ServiceUI.java | 2 +- app/src/main/java/eu/faircode/email/WidgetUnified.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceUI.java b/app/src/main/java/eu/faircode/email/ServiceUI.java index ade2aa0356..d6ca24c9b3 100644 --- a/app/src/main/java/eu/faircode/email/ServiceUI.java +++ b/app/src/main/java/eu/faircode/email/ServiceUI.java @@ -60,7 +60,7 @@ public class ServiceUI extends IntentService { static final int PI_SNOOZE = 10; static final int PI_IGNORED = 11; - private static final long WIDGET_SYNC_DURATION = 1500L; + private static final long WIDGET_SYNC_DURATION = 500; public ServiceUI() { this(ServiceUI.class.getName()); diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index ba56e22c69..1f6570b6f2 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -105,10 +105,9 @@ public class WidgetUnified extends AppWidgetProvider { views.setViewPadding(R.id.refresh, px, px, px, px); views.setOnClickPendingIntent(R.id.refresh, piSync); + long now = new Date().getTime(); long refreshing = prefs.getLong("widget." + appWidgetId + ".sync", 0L); - views.setImageViewResource(R.id.refresh, - refreshing < new Date().getTime() - ? R.drawable.twotone_sync_24 : R.drawable.twotone_compare_arrows_24); + views.setViewVisibility(R.id.refresh, refreshing < now ? View.VISIBLE : View.INVISIBLE); views.setViewVisibility(R.id.compose, compose ? View.VISIBLE : View.GONE); views.setViewPadding(R.id.compose, px, px, px, px);