From e3a57e55bacc82084389ae556067b26678c27bc6 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 26 Oct 2020 13:21:43 +0100 Subject: [PATCH] Revised folder waiting state --- .../java/eu/faircode/email/AdapterFolder.java | 33 ++++++++++--- app/src/main/java/eu/faircode/email/Core.java | 1 + .../eu/faircode/email/ServiceSynchronize.java | 10 ++-- .../fragment_legend_synchronization.xml | 46 +++++++++---------- app/src/main/res/values/strings.xml | 2 +- 5 files changed, 57 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 152373b356..d68b355b07 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -67,7 +67,9 @@ import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListUpdateCallback; import androidx.recyclerview.widget.RecyclerView; +import java.text.DateFormat; import java.text.NumberFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -102,6 +104,7 @@ public class AdapterFolder extends RecyclerView.Adapter all = new ArrayList<>(); private List items = new ArrayList<>(); + private DateFormat DTF; private NumberFormat NF = NumberFormat.getNumberInstance(); public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { @@ -223,9 +226,6 @@ public class AdapterFolder extends RecyclerView.Adapter 0) { ivState.setImageResource(R.drawable.twotone_dns_24); ivState.setContentDescription(context.getString(R.string.title_legend_executing)); - } else if ("waiting".equals(folder.state)) { - ivState.setImageResource(R.drawable.twotone_hourglass_top_24); - ivState.setContentDescription(context.getString(R.string.title_legend_waiting)); } else if ("connected".equals(folder.state)) { ivState.setImageResource(R.drawable.twotone_cloud_done_24); ivState.setContentDescription(context.getString(R.string.title_legend_connected)); @@ -315,7 +315,18 @@ public class AdapterFolder extends RecyclerView.Adapter 0) + t.append(' '); + t.append(DTF.format(folder.last_sync)); + } + + tvTotal.setText(t.toString()); if (folder.account == null) { tvAfter.setText(null); @@ -337,8 +348,17 @@ public class AdapterFolder extends RecyclerView.Adapter + + + + - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b00c708684..4c8ec01c0c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1202,6 +1202,7 @@ Download message content on demand Synchronize on Synchronize off + Synchronize periodically Disconnected Connecting Connected @@ -1209,7 +1210,6 @@ Synchronizing Downloading Closing - Waiting for next synchronization Unified inbox / primary account Inbox