mirror of https://github.com/M66B/FairEmail.git
Blink widget refresh icon
This commit is contained in:
parent
74cdcf9599
commit
9a6b6af5d9
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue