From f853579038e061d8fe01db7a547b047affb9610e Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 1 Sep 2021 15:46:06 +0200 Subject: [PATCH] Fixed messages widget empty space --- app/src/main/java/eu/faircode/email/WidgetUnified.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index e2507d1867..87bba6f228 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -101,9 +101,12 @@ public class WidgetUnified extends AppWidgetProvider { views.setOnClickPendingIntent(R.id.title, pi); - long now = new Date().getTime(); - long refreshing = prefs.getLong("widget." + appWidgetId + ".sync", 0L); - views.setViewVisibility(R.id.refresh, refresh && refreshing < now ? View.VISIBLE : View.INVISIBLE); + if (refresh) { + long now = new Date().getTime(); + long refreshing = prefs.getLong("widget." + appWidgetId + ".sync", 0L); + views.setViewVisibility(R.id.refresh, refreshing < now ? View.VISIBLE : View.INVISIBLE); + } else + views.setViewVisibility(R.id.refresh, View.GONE); views.setViewPadding(R.id.refresh, px, px, px, px); views.setOnClickPendingIntent(R.id.refresh, piSync);