mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
parent
d4742e157f
commit
7e5d4bc715
2 changed files with 6 additions and 35 deletions
|
@ -267,14 +267,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
|
||||
private RecyclerView rvAttachment;
|
||||
private CheckBox cbInline;
|
||||
private ImageButton ibDecrypt;
|
||||
private Button btnDownloadAttachments;
|
||||
private Button btnSaveAttachments;
|
||||
private TextView tvNoInternetAttachments;
|
||||
|
||||
private BottomNavigationView bnvActions;
|
||||
|
||||
private ImageButton ibDecrypt;
|
||||
private ImageButton ibQuotes;
|
||||
private ImageButton ibImages;
|
||||
private ImageButton ibFull;
|
||||
private TextView tvBody;
|
||||
|
@ -411,7 +410,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
|
||||
ibDecrypt = vsBody.findViewById(R.id.ibDecrypt);
|
||||
ibQuotes = vsBody.findViewById(R.id.ibQuotes);
|
||||
ibImages = vsBody.findViewById(R.id.ibImages);
|
||||
ibFull = vsBody.findViewById(R.id.ibFull);
|
||||
tvBody = vsBody.findViewById(R.id.tvBody);
|
||||
|
@ -472,7 +470,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibAddContact.setOnClickListener(this);
|
||||
|
||||
ibDecrypt.setOnClickListener(this);
|
||||
ibQuotes.setOnClickListener(this);
|
||||
btnDownloadAttachments.setOnClickListener(this);
|
||||
btnSaveAttachments.setOnClickListener(this);
|
||||
|
||||
|
@ -506,7 +503,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
ibAddContact.setOnClickListener(null);
|
||||
|
||||
ibDecrypt.setOnClickListener(null);
|
||||
ibQuotes.setOnClickListener(null);
|
||||
btnDownloadAttachments.setOnClickListener(null);
|
||||
btnSaveAttachments.setOnClickListener(null);
|
||||
|
||||
|
@ -839,14 +835,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
pbCalendarWait.setVisibility(View.GONE);
|
||||
|
||||
cbInline.setVisibility(View.GONE);
|
||||
ibDecrypt.setVisibility(View.GONE);
|
||||
btnDownloadAttachments.setVisibility(View.GONE);
|
||||
btnSaveAttachments.setVisibility(View.GONE);
|
||||
tvNoInternetAttachments.setVisibility(View.GONE);
|
||||
|
||||
bnvActions.setVisibility(View.GONE);
|
||||
|
||||
ibDecrypt.setVisibility(View.GONE);
|
||||
ibQuotes.setVisibility(View.GONE);
|
||||
ibImages.setVisibility(View.GONE);
|
||||
ibFull.setVisibility(View.GONE);
|
||||
tvBody.setVisibility(View.GONE);
|
||||
|
@ -1392,7 +1387,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (message == null)
|
||||
return;
|
||||
|
||||
if (view.getId() == R.id.ivSnoozed)
|
||||
if (view.getId() == R.id.ibDecrypt)
|
||||
onMenuDecrypt(message);
|
||||
else if (view.getId() == R.id.ivSnoozed)
|
||||
onShowSnoozed(message);
|
||||
else if (view.getId() == R.id.ivFlagged)
|
||||
onToggleFlag(message);
|
||||
|
@ -1413,12 +1410,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
case R.id.btnSaveAttachments:
|
||||
onSaveAttachments(message);
|
||||
break;
|
||||
case R.id.ibDecrypt:
|
||||
onMenuDecrypt(message);
|
||||
break;
|
||||
case R.id.ibQuotes:
|
||||
onShowQuotes(message);
|
||||
break;
|
||||
case R.id.ibImages:
|
||||
onShowImages(message);
|
||||
break;
|
||||
|
@ -1835,11 +1826,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
}
|
||||
|
||||
private void onShowQuotes(TupleMessageEx message) {
|
||||
properties.setValue("quotes", message.id, true);
|
||||
loadText(message);
|
||||
}
|
||||
|
||||
private void onShowImages(final TupleMessageEx message) {
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
if (prefs.getBoolean("show_images_confirmed", false)) {
|
||||
|
@ -1928,7 +1914,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
Bundle args = new Bundle();
|
||||
args.putSerializable("message", message);
|
||||
args.putBoolean("show_images", show_images);
|
||||
args.putBoolean("show_quotes", show_quotes || !threading);
|
||||
args.putBoolean("show_quotes", show_quotes);
|
||||
args.putInt("zoom", zoom);
|
||||
bodyTask.setCount(false).execute(context, owner, args, "message:body");
|
||||
}
|
||||
|
@ -2012,7 +1998,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
builder.getSpanFlags(squote));
|
||||
}
|
||||
|
||||
args.putBoolean("has_quotes", quoteSpans.length > 0);
|
||||
args.putBoolean("has_images", builder.getSpans(0, body.length(), ImageSpan.class).length > 0);
|
||||
|
||||
return builder;
|
||||
|
@ -2031,13 +2016,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (!show_expanded)
|
||||
return;
|
||||
|
||||
boolean has_quotes = args.getBoolean("has_quotes");
|
||||
boolean has_images = args.getBoolean("has_images");
|
||||
boolean show_quotes = (properties.getValue("quotes", message.id) || !collapse_quotes);
|
||||
boolean show_images = properties.getValue("images", message.id);
|
||||
|
||||
ibFull.setVisibility(hasWebView ? View.VISIBLE : View.GONE);
|
||||
ibQuotes.setVisibility(has_quotes && threading && !show_quotes ? View.VISIBLE : View.GONE);
|
||||
ibImages.setVisibility(has_images && !show_images ? View.VISIBLE : View.GONE);
|
||||
|
||||
tvBody.setText(body);
|
||||
|
|
|
@ -26,17 +26,6 @@
|
|||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/title_decrypt"
|
||||
android:src="@drawable/baseline_no_encryption_24"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibQuotes"
|
||||
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibQuotes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:contentDescription="@string/title_legend_show_quotes"
|
||||
android:src="@drawable/baseline_format_quote_24"
|
||||
app:layout_constraintEnd_toStartOf="@+id/ibImages"
|
||||
app:layout_constraintTop_toBottomOf="@id/bnvActions" />
|
||||
|
||||
|
|
Loading…
Reference in a new issue