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

View File

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