diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 4b11d98cc2..462400d89e 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -81,6 +81,7 @@ public class AdapterFolder extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); + tvKeywords.setText(debug ? TextUtils.join(" ", folder.keywords) : null); + tvKeywords.setVisibility( + show_flagged || (debug && folder.keywords.length > 0) + ? View.VISIBLE : View.GONE); + + tvFlagged.setText(NF.format(folder.flagged)); tvError.setText(folder.error); tvError.setVisibility(folder.error != null ? View.VISIBLE : View.GONE); if (btnHelp != null) btnHelp.setVisibility(folder.error == null ? View.GONE : View.VISIBLE); + grpFlagged.setVisibility(show_compact || !show_flagged ? View.GONE : View.VISIBLE); grpExtended.setVisibility(show_compact ? View.GONE : View.VISIBLE); } } @@ -352,23 +374,29 @@ public class AdapterFolder extends RecyclerView.Adapter= 0); @@ -448,6 +451,9 @@ public class FragmentFolders extends FragmentBase { case R.id.menu_show_hidden: onMenuShowHidden(); return true; + case R.id.menu_show_flagged: + onMenuShowFlagged(); + return true; case R.id.menu_subscribed_only: onMenuSubscribedOnly(); return true; @@ -487,6 +493,16 @@ public class FragmentFolders extends FragmentBase { adapter.setShowHidden(show_hidden); } + private void onMenuShowFlagged() { + show_flagged = !show_flagged; + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + prefs.edit().putBoolean("flagged_folders", show_flagged).apply(); + + getActivity().invalidateOptionsMenu(); + adapter.setShowFlagged(show_flagged); + } + private void onMenuSubscribedOnly() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean subscribed_only = !prefs.getBoolean("subscribed_only", false); diff --git a/app/src/main/java/eu/faircode/email/TupleFolderEx.java b/app/src/main/java/eu/faircode/email/TupleFolderEx.java index 8702be550c..402d26d052 100644 --- a/app/src/main/java/eu/faircode/email/TupleFolderEx.java +++ b/app/src/main/java/eu/faircode/email/TupleFolderEx.java @@ -46,6 +46,7 @@ public class TupleFolderEx extends EntityFolder implements Serializable { public int messages; public int content; public int unseen; + public int flagged; public int executing; @Ignore @@ -74,6 +75,7 @@ public class TupleFolderEx extends EntityFolder implements Serializable { this.messages == other.messages && this.content == other.content && this.unseen == other.unseen && + this.flagged == other.flagged && this.executing == other.executing); } else return false; diff --git a/app/src/main/res/layout/item_folder.xml b/app/src/main/res/layout/item_folder.xml index 88d4a82192..b1420dd22d 100644 --- a/app/src/main/res/layout/item_folder.xml +++ b/app/src/main/res/layout/item_folder.xml @@ -217,12 +217,37 @@ android:layout_marginTop="3dp" android:layout_marginEnd="6dp" android:gravity="center_vertical" + android:minHeight="24dp" android:text="Keywords" android:textAppearance="@android:style/TextAppearance.Small" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@id/tvFlagged" app:layout_constraintStart_toEndOf="@id/ibExpander" app:layout_constraintTop_toBottomOf="@id/tvType" /> + + + + + + + + Folder name Display name Show hidden folders + Show starred messages Subscribed only Apply to all … Hide folder