Fix issue #391 - Add an icon when a media description is available.

This commit is contained in:
Thomas 2022-11-03 17:07:47 +01:00
parent 209d698223
commit 88e2f0cb7c
2 changed files with 20 additions and 2 deletions

View File

@ -1255,7 +1255,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
focusX = statusToDeal.media_attachments.get(0).meta.focus.x; focusX = statusToDeal.media_attachments.get(0).meta.focus.x;
focusY = statusToDeal.media_attachments.get(0).meta.focus.y; focusY = statusToDeal.media_attachments.get(0).meta.focus.y;
} }
if (statusToDeal.media_attachments.get(0).description != null && !statusToDeal.media_attachments.get(0).description.isEmpty()) {
layoutMediaBinding.viewDescription.setVisibility(View.VISIBLE);
} else {
layoutMediaBinding.viewDescription.setVisibility(View.GONE);
}
if (!mediaObfuscated(statusToDeal) || expand_media) { if (!mediaObfuscated(statusToDeal) || expand_media) {
layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24); layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24);
RequestBuilder<Drawable> requestBuilder = Glide.with(layoutMediaBinding.media.getContext()) RequestBuilder<Drawable> requestBuilder = Glide.with(layoutMediaBinding.media.getContext())
@ -1329,6 +1333,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else { } else {
layoutMediaBinding.playMusic.setVisibility(View.GONE); layoutMediaBinding.playMusic.setVisibility(View.GONE);
} }
if (attachment.description != null && !attachment.description.isEmpty()) {
layoutMediaBinding.viewDescription.setVisibility(View.VISIBLE);
} else {
layoutMediaBinding.viewDescription.setVisibility(View.GONE);
}
lp.setMargins(0, 0, (int) Helper.convertDpToPixel(5, context), 0); lp.setMargins(0, 0, (int) Helper.convertDpToPixel(5, context), 0);
if (!mediaObfuscated(statusToDeal) || expand_media) { if (!mediaObfuscated(statusToDeal) || expand_media) {
layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24); layoutMediaBinding.viewHide.setImageResource(R.drawable.ic_baseline_visibility_24);

View File

@ -38,5 +38,14 @@
android:contentDescription="@string/visibility" android:contentDescription="@string/visibility"
android:src="@drawable/ic_baseline_visibility_24" /> android:src="@drawable/ic_baseline_visibility_24" />
<ImageView
android:id="@+id/view_description"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:contentDescription="@string/description"
android:src="@drawable/ic_outline_note_alt_24"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>