Hide unnamed attachments, layout improvements

pull/147/head
M66B 6 years ago
parent 28a7d33ba0
commit 05d26cbc70

@ -109,6 +109,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
ivDelete.setVisibility(readonly ? View.GONE : attachment.isInline() ? View.INVISIBLE : View.VISIBLE); ivDelete.setVisibility(readonly ? View.GONE : attachment.isInline() ? View.INVISIBLE : View.VISIBLE);
tvName.setText(attachment.name); tvName.setText(attachment.name);
tvType.setText(attachment.type); tvType.setText(attachment.type);
tvType.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
if (attachment.size != null) if (attachment.size != null)
tvSize.setText(Helper.humanReadableByteCount(attachment.size, true)); tvSize.setText(Helper.humanReadableByteCount(attachment.size, true));

@ -899,7 +899,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean downloading = false; boolean downloading = false;
List<EntityAttachment> a = new ArrayList<>(); List<EntityAttachment> a = new ArrayList<>();
for (EntityAttachment attachment : attachments) { for (EntityAttachment attachment : attachments) {
if (attachment.isInline()) if (attachment.isInline() || TextUtils.isEmpty(attachment.name))
inline = true; inline = true;
if (attachment.progress == null && !attachment.available) if (attachment.progress == null && !attachment.available)
download = true; download = true;

@ -8,8 +8,9 @@
<ImageView <ImageView
android:id="@+id/ivDelete" android:id="@+id/ivDelete"
android:layout_width="24dp" android:layout_width="36dp"
android:layout_height="24dp" android:layout_height="24dp"
android:paddingEnd="12dp"
android:src="@drawable/baseline_delete_24" android:src="@drawable/baseline_delete_24"
android:visibility="visible" android:visibility="visible"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -78,9 +79,9 @@
<ImageView <ImageView
android:id="@+id/ivSave" android:id="@+id/ivSave"
android:layout_width="24dp" android:layout_width="36dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="6dp" android:paddingStart="12dp"
android:src="@drawable/baseline_save_24" android:src="@drawable/baseline_save_24"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivStatus" app:layout_constraintStart_toEndOf="@id/ivStatus"

Loading…
Cancel
Save