mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 17:13:23 +02:00
Added option to hide duplicate messages in thread view
This commit is contained in:
@@ -143,6 +143,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private boolean subject_italic;
|
||||
private int zoom;
|
||||
private String sort;
|
||||
private boolean duplicates;
|
||||
private boolean suitable;
|
||||
private IProperties properties;
|
||||
|
||||
@@ -462,6 +463,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
setDisplacement(0);
|
||||
pbLoading.setVisibility(View.GONE);
|
||||
|
||||
if (viewType == ViewType.THREAD)
|
||||
view.setVisibility(duplicates || !message.duplicate ? View.VISIBLE : View.GONE);
|
||||
|
||||
// Text size
|
||||
if (textSize != 0) {
|
||||
tvDay.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
@@ -2923,7 +2927,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
}
|
||||
|
||||
AdapterMessage(Context context, LifecycleOwner owner,
|
||||
ViewType viewType, boolean compact, int zoom, String sort, IProperties properties) {
|
||||
ViewType viewType, boolean compact, int zoom, String sort, boolean duplicates, IProperties properties) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
this.context = context;
|
||||
@@ -2935,6 +2939,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
this.subject_italic = prefs.getBoolean("subject_italic", true);
|
||||
this.zoom = zoom;
|
||||
this.sort = sort;
|
||||
this.duplicates = duplicates;
|
||||
this.suitable = Helper.getNetworkState(context).isSuitable();
|
||||
this.properties = properties;
|
||||
|
||||
@@ -3016,6 +3021,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
}
|
||||
}
|
||||
|
||||
void setDuplicates(boolean duplicates) {
|
||||
if (this.duplicates != duplicates) {
|
||||
this.duplicates = duplicates;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void checkInternet() {
|
||||
boolean suitable = Helper.getNetworkState(context).isSuitable();
|
||||
if (this.suitable != suitable) {
|
||||
|
||||
Reference in New Issue
Block a user