Made receipt icon clickable

This commit is contained in:
M66B 2020-10-10 12:45:37 +02:00
parent 781261d945
commit 29460107da
2 changed files with 22 additions and 8 deletions

View File

@ -363,7 +363,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibExpanderAddress; private ImageButton ibExpanderAddress;
private ImageView ivPlain; private ImageView ivPlain;
private ImageView ivReceipt; private ImageButton ibReceipt;
private ImageView ivAutoSubmitted; private ImageView ivAutoSubmitted;
private ImageView ivBrowsed; private ImageView ivBrowsed;
@ -562,7 +562,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibExpanderAddress = vsBody.findViewById(R.id.ibExpanderAddress); ibExpanderAddress = vsBody.findViewById(R.id.ibExpanderAddress);
ivPlain = vsBody.findViewById(R.id.ivPlain); ivPlain = vsBody.findViewById(R.id.ivPlain);
ivReceipt = vsBody.findViewById(R.id.ivReceipt); ibReceipt = vsBody.findViewById(R.id.ibReceipt);
ivAutoSubmitted = vsBody.findViewById(R.id.ivAutoSubmitted); ivAutoSubmitted = vsBody.findViewById(R.id.ivAutoSubmitted);
ivBrowsed = vsBody.findViewById(R.id.ivBrowsed); ivBrowsed = vsBody.findViewById(R.id.ivBrowsed);
@ -721,6 +721,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (vsBody != null) { if (vsBody != null) {
ibExpanderAddress.setOnClickListener(this); ibExpanderAddress.setOnClickListener(this);
ibReceipt.setOnClickListener(this);
ibSearchContact.setOnClickListener(this); ibSearchContact.setOnClickListener(this);
ibNotifyContact.setOnClickListener(this); ibNotifyContact.setOnClickListener(this);
ibPinContact.setOnClickListener(this); ibPinContact.setOnClickListener(this);
@ -825,6 +826,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (vsBody != null) { if (vsBody != null) {
ibExpanderAddress.setOnClickListener(null); ibExpanderAddress.setOnClickListener(null);
ibReceipt.setOnLongClickListener(null);
ibSearchContact.setOnClickListener(null); ibSearchContact.setOnClickListener(null);
ibNotifyContact.setOnClickListener(null); ibNotifyContact.setOnClickListener(null);
ibPinContact.setOnClickListener(null); ibPinContact.setOnClickListener(null);
@ -1266,7 +1268,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
grpImages.setVisibility(View.GONE); grpImages.setVisibility(View.GONE);
ivPlain.setVisibility(View.GONE); ivPlain.setVisibility(View.GONE);
ivReceipt.setVisibility(View.GONE); ibReceipt.setVisibility(View.GONE);
ivAutoSubmitted.setVisibility(View.GONE); ivAutoSubmitted.setVisibility(View.GONE);
ivBrowsed.setVisibility(View.GONE); ivBrowsed.setVisibility(View.GONE);
@ -1685,7 +1687,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibExpanderAddress.setContentDescription(context.getString(show_addresses ? R.string.title_accessibility_hide_addresses : R.string.title_accessibility_show_addresses)); ibExpanderAddress.setContentDescription(context.getString(show_addresses ? R.string.title_accessibility_hide_addresses : R.string.title_accessibility_show_addresses));
ivPlain.setVisibility(show_addresses && message.plain_only != null && message.plain_only ? View.VISIBLE : View.GONE); ivPlain.setVisibility(show_addresses && message.plain_only != null && message.plain_only ? View.VISIBLE : View.GONE);
ivReceipt.setVisibility(message.receipt_request != null && message.receipt_request ? View.VISIBLE : View.GONE); ibReceipt.setVisibility(message.receipt_request != null && message.receipt_request ? View.VISIBLE : View.GONE);
ivAutoSubmitted.setVisibility(show_addresses && message.auto_submitted != null && message.auto_submitted ? View.VISIBLE : View.GONE); ivAutoSubmitted.setVisibility(show_addresses && message.auto_submitted != null && message.auto_submitted ? View.VISIBLE : View.GONE);
ivBrowsed.setVisibility(show_addresses && message.ui_browsed ? View.VISIBLE : View.GONE); ivBrowsed.setVisibility(show_addresses && message.ui_browsed ? View.VISIBLE : View.GONE);
@ -2855,6 +2857,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
onToggleFlag(message); onToggleFlag(message);
else if (view.getId() == R.id.ibHelp) else if (view.getId() == R.id.ibHelp)
onHelp(message); onHelp(message);
else if (view.getId() == R.id.ibReceipt)
onReceipt(message);
else if (view.getId() == R.id.ibSearchContact) else if (view.getId() == R.id.ibSearchContact)
onSearchContact(message); onSearchContact(message);
else if (view.getId() == R.id.ibNotifyContact) else if (view.getId() == R.id.ibNotifyContact)
@ -3256,6 +3260,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Helper.viewFAQ(context, 130); Helper.viewFAQ(context, 130);
} }
private void onReceipt(TupleMessageEx message) {
Intent reply = new Intent(context, ActivityCompose.class)
.putExtra("action", "receipt")
.putExtra("reference", message.id);
context.startActivity(reply);
}
private void onSearchContact(TupleMessageEx message) { private void onSearchContact(TupleMessageEx message) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("id", message.id); args.putLong("id", message.id);

View File

@ -35,12 +35,15 @@
app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress" app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress"
app:srcCompat="@drawable/twotone_notes_24" /> app:srcCompat="@drawable/twotone_notes_24" />
<eu.faircode.email.ViewImageHint <ImageButton
android:id="@+id/ivReceipt" android:id="@+id/ibReceipt"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_receipt" android:contentDescription="@string/title_legend_receipt"
android:tint="?attr/colorWarning"
android:tooltipText="@string/title_legend_receipt"
app:layout_constraintStart_toEndOf="@id/ivPlain" app:layout_constraintStart_toEndOf="@id/ivPlain"
app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress" app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress"
app:srcCompat="@drawable/twotone_playlist_add_check_24" /> app:srcCompat="@drawable/twotone_playlist_add_check_24" />
@ -51,7 +54,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:contentDescription="@string/title_legend_auto_submitted" android:contentDescription="@string/title_legend_auto_submitted"
app:layout_constraintStart_toEndOf="@id/ivReceipt" app:layout_constraintStart_toEndOf="@id/ibReceipt"
app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress" app:layout_constraintTop_toBottomOf="@id/ibExpanderAddress"
app:srcCompat="@drawable/twotone_remove_circle_outline_24" /> app:srcCompat="@drawable/twotone_remove_circle_outline_24" />
@ -118,7 +121,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:barrierDirection="bottom" app:barrierDirection="bottom"
app:constraint_referenced_ids="ivPlain,ivReceipt,ivAutoSubmitted,ivBrowsed,ibSearchContact,ibNotifyContact,ibPinContact,ibAddContact" /> app:constraint_referenced_ids="ivPlain,ibReceipt,ivAutoSubmitted,ivBrowsed,ibSearchContact,ibNotifyContact,ibPinContact,ibAddContact" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvSubmitterTitle" android:id="@+id/tvSubmitterTitle"