From 832c4068dbb1e5aae06a4831c177543d39085aaf Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 9 Mar 2019 13:22:49 +0000 Subject: [PATCH] Format folder counts --- app/src/main/java/eu/faircode/email/AdapterFolder.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 3bf2baa750..03d9558d5e 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -40,6 +40,7 @@ import android.widget.TextView; import com.google.android.material.snackbar.Snackbar; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; @@ -66,6 +67,8 @@ public class AdapterFolder extends RecyclerView.Adapter all = new ArrayList<>(); private List filtered = new ArrayList<>(); + private NumberFormat nf = NumberFormat.getInstance(); + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private View itemView; private View vwColor; @@ -169,14 +172,14 @@ public class AdapterFolder extends RecyclerView.Adapter 0 ? colorUnread : textColorSecondary); StringBuilder sb = new StringBuilder(); - sb.append(folder.content); + sb.append(nf.format(folder.content)); sb.append('/'); - sb.append(folder.messages); + sb.append(nf.format(folder.messages)); sb.append('/'); if (folder.total == null) sb.append('?'); else - sb.append(folder.total); + sb.append(nf.format(folder.total)); tvMessages.setText(sb.toString()); ivMessages.setImageResource(folder.download || EntityFolder.OUTBOX.equals(folder.type)