Fixed minor UI issues with files in chat bubbles

This commit is contained in:
Sylvain Berfini 2021-03-11 10:36:55 +01:00
parent 59a050ba54
commit f33709d77b
3 changed files with 10 additions and 2 deletions

View file

@ -82,6 +82,11 @@ fun View.setLayoutHeight(dimension: Float) {
this.layoutParams.height = dimension.toInt()
}
@BindingAdapter("android:maxHeight")
fun ImageView.setImageMaxHeight(dimension: Float) {
this.maxHeight = dimension.toInt()
}
@BindingAdapter("android:layout_size")
fun View.setLayoutSize(dimension: Float) {
this.layoutParams.height = dimension.toInt()

View file

@ -21,7 +21,8 @@
android:onLongClick="@{longClickListener}"
android:contentDescription="@string/content_description_downloaded_file_transfer"
android:layout_width="wrap_content"
android:layout_height="@{data.alone ? @dimen/chat_message_bubble_image_height_big : @dimen/chat_message_bubble_image_height_small, default=wrap_content}"
android:layout_height="wrap_content"
android:maxHeight="@{data.alone ? @dimen/chat_message_bubble_image_height_big : @dimen/chat_message_bubble_image_height_small}"
android:layout_margin="5dp"
app:glidePath="@{data.content.filePath}"
android:visibility="@{data.image ? View.VISIBLE : View.GONE}"
@ -32,7 +33,8 @@
android:onLongClick="@{longClickListener}"
android:contentDescription="@string/content_description_downloaded_file_transfer"
android:layout_width="wrap_content"
android:layout_height="@{data.alone ? @dimen/chat_message_bubble_image_height_big : @dimen/chat_message_bubble_image_height_small, default=wrap_content}"
android:layout_height="wrap_content"
android:maxHeight="@{data.alone ? @dimen/chat_message_bubble_image_height_big : @dimen/chat_message_bubble_image_height_small}"
android:layout_margin="5dp"
android:src="@{data.videoPreview}"
android:visibility="@{data.video ? View.VISIBLE : View.GONE, default=gone}"

View file

@ -133,6 +133,7 @@
app:layout="@{@layout/chat_message_content_cell}"
app:onLongClick="@{contextMenuClickListener}"
app:flexWrap="wrap"
app:alignItems="center"
app:justifyContent="@{viewModel.chatMessage.outgoing ? JustifyContent.FLEX_END : JustifyContent.FLEX_START}"/>
<org.linphone.activities.main.chat.views.MultiLineWrapContentWidthTextView