Blink widget refresh icon

This commit is contained in:
M66B 2021-09-01 10:22:59 +02:00
parent 74cdcf9599
commit 9a6b6af5d9
2 changed files with 3 additions and 4 deletions

View File

@ -60,7 +60,7 @@ public class ServiceUI extends IntentService {
static final int PI_SNOOZE = 10; static final int PI_SNOOZE = 10;
static final int PI_IGNORED = 11; static final int PI_IGNORED = 11;
private static final long WIDGET_SYNC_DURATION = 1500L; private static final long WIDGET_SYNC_DURATION = 500;
public ServiceUI() { public ServiceUI() {
this(ServiceUI.class.getName()); this(ServiceUI.class.getName());

View File

@ -105,10 +105,9 @@ public class WidgetUnified extends AppWidgetProvider {
views.setViewPadding(R.id.refresh, px, px, px, px); views.setViewPadding(R.id.refresh, px, px, px, px);
views.setOnClickPendingIntent(R.id.refresh, piSync); views.setOnClickPendingIntent(R.id.refresh, piSync);
long now = new Date().getTime();
long refreshing = prefs.getLong("widget." + appWidgetId + ".sync", 0L); long refreshing = prefs.getLong("widget." + appWidgetId + ".sync", 0L);
views.setImageViewResource(R.id.refresh, views.setViewVisibility(R.id.refresh, refreshing < now ? View.VISIBLE : View.INVISIBLE);
refreshing < new Date().getTime()
? R.drawable.twotone_sync_24 : R.drawable.twotone_compare_arrows_24);
views.setViewVisibility(R.id.compose, compose ? View.VISIBLE : View.GONE); views.setViewVisibility(R.id.compose, compose ? View.VISIBLE : View.GONE);
views.setViewPadding(R.id.compose, px, px, px, px); views.setViewPadding(R.id.compose, px, px, px, px);