Fix media preview bugs (#3160)

* fix media preview layout issues

* make sure "ALT" label is never shown when media preview is hidden
This commit is contained in:
Konrad Pozniak 2023-01-12 19:40:51 +01:00 committed by GitHub
commit 98eb324aa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 38 deletions

View file

@ -184,12 +184,11 @@ class MediaPreviewLayout(context: Context, attrs: AttributeSet? = null) :
}
}
inline fun forEachIndexed(action: (Int, View, MediaPreviewImageView, TextView) -> Unit) {
inline fun forEachIndexed(action: (Int, MediaPreviewImageView, TextView) -> Unit) {
for (index in 0 until childCount) {
val wrapper = getChildAt(index)
action(
index,
wrapper,
wrapper.findViewById(R.id.preview_image_view) as MediaPreviewImageView,
wrapper.findViewById(R.id.preview_media_description_indicator) as TextView
)