diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index bc4e29b6bb..611c6aa7ec 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -57,6 +57,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; +import java.text.NumberFormat; import java.util.List; import static android.app.Activity.RESULT_OK; @@ -82,6 +83,8 @@ public class FragmentFolders extends FragmentBase { private String searching = null; private AdapterFolder adapter; + private NumberFormat NF = NumberFormat.getNumberInstance(); + static final int REQUEST_SYNC = 1; static final int REQUEST_DELETE_LOCAL = 2; static final int REQUEST_EMPTY_FOLDER = 3; @@ -272,7 +275,12 @@ public class FragmentFolders extends FragmentBase { db.account().liveAccount(account).observe(getViewLifecycleOwner(), new Observer() { @Override public void onChanged(@Nullable EntityAccount account) { - setSubtitle(account == null ? null : account.name); + if (account != null && account.quota_usage != null && account.quota_limit != null) { + int percent = Math.round((float) account.quota_usage * 100 / account.quota_limit); + setSubtitle(getString(R.string.title_name_count, + account.name, NF.format(percent) + "%")); + } else + setSubtitle(account == null ? null : account.name); if (account != null && account.error != null) fabError.show();