From a9000cfc6451d0c7762db53b325e8523c233bbc2 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 1 Sep 2021 11:25:01 +0200 Subject: [PATCH] Fixed widget refresh button --- app/src/main/java/eu/faircode/email/WidgetUnified.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index 1f6570b6f2..e2507d1867 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -101,13 +101,12 @@ public class WidgetUnified extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.title, pi); - views.setViewVisibility(R.id.refresh, refresh ? View.VISIBLE : View.GONE); - 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.setViewVisibility(R.id.refresh, refreshing < now ? View.VISIBLE : View.INVISIBLE); + views.setViewVisibility(R.id.refresh, refresh && refreshing < now ? View.VISIBLE : View.INVISIBLE); + + views.setViewPadding(R.id.refresh, px, px, px, px); + views.setOnClickPendingIntent(R.id.refresh, piSync); views.setViewVisibility(R.id.compose, compose ? View.VISIBLE : View.GONE); views.setViewPadding(R.id.compose, px, px, px, px);