mirror of https://github.com/M66B/FairEmail.git
Hide in unified folder list if all messages are read
This commit is contained in:
parent
1ee4717659
commit
a40aa805ac
|
@ -226,7 +226,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
|
|
||||||
private void bindTo(final TupleFolderEx folder) {
|
private void bindTo(final TupleFolderEx folder) {
|
||||||
boolean disabled = isDisabled(folder);
|
boolean disabled = isDisabled(folder);
|
||||||
boolean hide_seen = (folder.hide_seen && folder.unseen + folder.childs_unseen == 0);
|
boolean hide_seen = (account < 0 && !primary &&
|
||||||
|
folder.hide_seen && folder.unseen + folder.childs_unseen == 0);
|
||||||
|
|
||||||
int p = (show_compact && all.size() < DENSE_ITEMS_THRESHOLD ? dp3 : 0);
|
int p = (show_compact && all.size() < DENSE_ITEMS_THRESHOLD ? dp3 : 0);
|
||||||
view.setPadding(p, p, p, p);
|
view.setPadding(p, p, p, p);
|
||||||
|
@ -1265,9 +1266,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
if (account < 0 && !primary) {
|
if (account < 0 && !primary) {
|
||||||
List<TupleFolderEx> filtered = new ArrayList<>();
|
List<TupleFolderEx> filtered = new ArrayList<>();
|
||||||
for (TupleFolderEx folder : folders)
|
for (TupleFolderEx folder : folders)
|
||||||
if (show_hidden ||
|
if (show_hidden || !folder.hide_seen || folder.unseen + folder.childs_unseen > 0)
|
||||||
!(folder.hide ||
|
|
||||||
(folder.hide_seen && folder.unseen + folder.childs_unseen == 0)))
|
|
||||||
filtered.add(folder);
|
filtered.add(folder);
|
||||||
|
|
||||||
if (filtered.size() > 0)
|
if (filtered.size() > 0)
|
||||||
|
@ -1473,9 +1472,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent.hide_seen && parent.unseen + parent.childs_unseen == 0 && !show_hidden)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!subscribed_only ||
|
if (!subscribed_only ||
|
||||||
EntityFolder.INBOX.equals(parent.type) ||
|
EntityFolder.INBOX.equals(parent.type) ||
|
||||||
parent.accountProtocol != EntityAccount.TYPE_IMAP ||
|
parent.accountProtocol != EntityAccount.TYPE_IMAP ||
|
||||||
|
@ -1533,9 +1529,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
while (p1 != null && p2 != null) {
|
while (p1 != null && p2 != null) {
|
||||||
if (p1.hide != p2.hide)
|
if (p1.hide != p2.hide)
|
||||||
return false;
|
return false;
|
||||||
if ((p1.hide_seen && p1.unseen + p1.childs_unseen == 0) !=
|
|
||||||
(p2.hide_seen && p2.unseen + p2.childs_unseen == 0))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (p1.collapsed != p2.collapsed)
|
if (p1.collapsed != p2.collapsed)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2305,7 +2305,6 @@ public abstract class DB extends RoomDatabase {
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||||
logMigration(startVersion, endVersion);
|
logMigration(startVersion, endVersion);
|
||||||
db.execSQL("ALTER TABLE `folder` ADD COLUMN `hide_seen` INTEGER NOT NULL DEFAULT 0");
|
db.execSQL("ALTER TABLE `folder` ADD COLUMN `hide_seen` INTEGER NOT NULL DEFAULT 0");
|
||||||
db.execSQL("UPDATE `folder` SET hide = 0 WHERE unified");
|
|
||||||
}
|
}
|
||||||
}).addMigrations(new Migration(230, 231) {
|
}).addMigrations(new Migration(230, 231) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -118,6 +118,18 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cbHide" />
|
app:layout_constraintTop_toBottomOf="@id/cbHide" />
|
||||||
|
|
||||||
|
<eu.faircode.email.FixedTextView
|
||||||
|
android:id="@+id/tvHideSeenHint"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="@string/title_hide_seen_folder_hint"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
android:textStyle="italic"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/cbHideSeen" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cbUnified"
|
android:id="@+id/cbUnified"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -125,7 +137,7 @@
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:text="@string/title_unified_folder"
|
android:text="@string/title_unified_folder"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/cbHideSeen" />
|
app:layout_constraintTop_toBottomOf="@id/tvHideSeenHint" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cbNavigation"
|
android:id="@+id/cbNavigation"
|
||||||
|
|
|
@ -1065,6 +1065,7 @@
|
||||||
<string name="title_edit_account_name">Edit account name</string>
|
<string name="title_edit_account_name">Edit account name</string>
|
||||||
<string name="title_hide_folder">Hide folder</string>
|
<string name="title_hide_folder">Hide folder</string>
|
||||||
<string name="title_hide_seen_folder">Hide if all messages are read</string>
|
<string name="title_hide_seen_folder">Hide if all messages are read</string>
|
||||||
|
<string name="title_hide_seen_folder_hint">Only in the unified folder list shown on the start screen</string>
|
||||||
<string name="title_unified_folder">Show in unified inbox</string>
|
<string name="title_unified_folder">Show in unified inbox</string>
|
||||||
<string name="title_navigation_folder">Show in navigation menu</string>
|
<string name="title_navigation_folder">Show in navigation menu</string>
|
||||||
<string name="title_synchronize_folder">Synchronize (receive messages)</string>
|
<string name="title_synchronize_folder">Synchronize (receive messages)</string>
|
||||||
|
|
Loading…
Reference in New Issue