1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 18:27:43 +00:00

Images needs to be available for storing/sharing

This commit is contained in:
M66B 2022-11-04 17:55:21 +01:00
parent 0216388b29
commit 313582be8f
2 changed files with 12 additions and 4 deletions

View file

@ -1771,6 +1771,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSeenBottom.setVisibility(View.GONE); ibSeenBottom.setVisibility(View.GONE);
ibStoreMedia.setVisibility(View.GONE); ibStoreMedia.setVisibility(View.GONE);
ibShareImages.setVisibility(View.GONE);
} }
private void clearButtons() { private void clearButtons() {
@ -3434,16 +3435,23 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
}); });
int iavailable = 0;
List<EntityAttachment> images = new ArrayList<>(); List<EntityAttachment> images = new ArrayList<>();
if (thumbnails && bind_extras) if (thumbnails && bind_extras) {
for (EntityAttachment attachment : attachments) for (EntityAttachment attachment : attachments)
if (attachment.isAttachment() && attachment.isImage()) if (attachment.isAttachment() && attachment.isImage()) {
images.add(attachment); images.add(attachment);
if (attachment.available)
iavailable++;
}
}
adapterImage.set(images); adapterImage.set(images);
grpImages.setVisibility(images.size() > 0 ? View.VISIBLE : View.GONE); grpImages.setVisibility(images.size() > 0 ? View.VISIBLE : View.GONE);
ibStoreMedia.setVisibility( ibStoreMedia.setVisibility(
images.size() > 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q iavailable > 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
? View.VISIBLE : View.GONE); ? View.VISIBLE : View.GONE);
ibShareImages.setVisibility(iavailable > 0 ? View.VISIBLE : View.GONE);
} }
private void bindCalendar(final TupleMessageEx message, EntityAttachment attachment) { private void bindCalendar(final TupleMessageEx message, EntityAttachment attachment) {

View file

@ -53,5 +53,5 @@
android:id="@+id/grpImages" android:id="@+id/grpImages"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="vSeparatorImages,ibShareImages,rvImage" /> app:constraint_referenced_ids="vSeparatorImages,rvImage" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>