Added close headers button

This commit is contained in:
M66B 2021-03-12 08:12:30 +01:00
parent 966cb48513
commit f190b37f56
2 changed files with 19 additions and 1 deletions

View File

@ -430,6 +430,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private TextView tvKeywordsEx;
private TextView tvHeaders;
private ImageButton ibCloseHeaders;
private ContentLoadingProgressBar pbHeaders;
private TextView tvNoInternetHeaders;
@ -636,6 +637,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvKeywordsEx = vsBody.findViewById(R.id.tvKeywordsEx);
tvHeaders = vsBody.findViewById(R.id.tvHeaders);
ibCloseHeaders = vsBody.findViewById(R.id.ibCloseHeaders);
pbHeaders = vsBody.findViewById(R.id.pbHeaders);
tvNoInternetHeaders = vsBody.findViewById(R.id.tvNoInternetHeaders);
@ -764,6 +766,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibPinContact.setOnClickListener(this);
ibAddContact.setOnClickListener(this);
ibCloseHeaders.setOnClickListener(this);
ibSaveAttachments.setOnClickListener(this);
ibDownloadAttachments.setOnClickListener(this);
@ -876,6 +880,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibPinContact.setOnClickListener(null);
ibAddContact.setOnClickListener(null);
ibCloseHeaders.setOnClickListener(null);
ibSaveAttachments.setOnClickListener(null);
ibDownloadAttachments.setOnClickListener(null);
@ -3023,6 +3029,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int id = view.getId();
if (id == R.id.ibExpanderAddress) {
onToggleAddresses(message);
} else if (id == R.id.ibCloseHeaders) {
onMenuShowHeaders(message);
} else if (id == R.id.ibSaveAttachments) {
onSaveAttachments(message);
} else if (id == R.id.ibDownloadAttachments) {

View File

@ -30,6 +30,16 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHeaders" />
<ImageButton
android:id="@+id/ibCloseHeaders"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:padding="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHeaders"
app:srcCompat="@drawable/twotone_cancel_24" />
<eu.faircode.email.ContentLoadingProgressBar
android:id="@+id/pbHeaders"
style="@style/Base.Widget.AppCompat.ProgressBar"
@ -56,5 +66,5 @@
android:id="@+id/grpHeaders"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="vSeparatorHeaders,tvHeaders" />
app:constraint_referenced_ids="vSeparatorHeaders,tvHeaders,ibCloseHeaders" />
</androidx.constraintlayout.widget.ConstraintLayout>