From 19f8f8a8a337aefd48f67eac4daf9692c0be7708 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 12 Jul 2022 13:59:36 +0200 Subject: [PATCH] Should improve chat message cell display time when one or more files are attached + added min height to attached image, useful when sending/receiving GIFs --- ...age_conference_invitation_content_cell.xml | 14 +- .../res/layout/chat_message_content_cell.xml | 143 ++++++++---------- ...message_downloadable_file_content_cell.xml | 53 +++++++ ...chat_message_generic_file_content_cell.xml | 43 ++++++ .../chat_message_image_content_cell.xml | 41 +++++ .../chat_message_video_content_cell.xml | 46 ++++++ ...chat_message_voice_record_content_cell.xml | 6 +- 7 files changed, 255 insertions(+), 91 deletions(-) create mode 100644 app/src/main/res/layout/chat_message_downloadable_file_content_cell.xml create mode 100644 app/src/main/res/layout/chat_message_generic_file_content_cell.xml create mode 100644 app/src/main/res/layout/chat_message_image_content_cell.xml create mode 100644 app/src/main/res/layout/chat_message_video_content_cell.xml diff --git a/app/src/main/res/layout/chat_message_conference_invitation_content_cell.xml b/app/src/main/res/layout/chat_message_conference_invitation_content_cell.xml index aca8cc4bd..97c6f16ea 100644 --- a/app/src/main/res/layout/chat_message_conference_invitation_content_cell.xml +++ b/app/src/main/res/layout/chat_message_conference_invitation_content_cell.xml @@ -11,11 +11,8 @@ name="longClickListener" type="android.view.View.OnLongClickListener"/> - + name="inflatedVisibility" + type="Integer" /> + android:background="@drawable/shape_conference_invite_background" + android:visibility="@{inflatedVisibility}"> - @@ -18,113 +17,93 @@ android:layout_height="wrap_content" android:layout_margin="5dp"> - + app:inflatedVisibility="@{!data.downloadable && data.image ? View.VISIBLE : View.GONE}" + app:data="@{data}" + app:longClickListener="@{longClickListener}"/> - + app:inflatedVisibility="@{!data.downloadable && data.video ? View.VISIBLE : View.GONE}" + app:data="@{data}" + app:longClickListener="@{longClickListener}"/> - - - + app:inflatedVisibility="@{!data.downloadable && data.voiceRecording ? View.VISIBLE : View.GONE}"/> - + app:inflatedVisibility="@{!data.downloadable && data.conferenceSchedule ? View.VISIBLE : View.GONE}" /> - + android:layout="@layout/chat_message_generic_file_content_cell" + android:visibility="@{data.audio || data.pdf || data.genericFile ? View.VISIBLE : View.GONE}" + app:data="@{data}" + app:longClickListener="@{longClickListener}" + app:inflatedVisibility="@{data.audio || data.pdf || data.genericFile ? View.VISIBLE : View.GONE}" /> - + - - - - - + + android:max="100" + android:layout_centerInParent="true" + app:trackColor="?attr/backgroundColor" + android:progress="@{data.downloadProgressInt, default=50}" + android:background="@drawable/background_round_secondary_color" /> - - - - - + diff --git a/app/src/main/res/layout/chat_message_downloadable_file_content_cell.xml b/app/src/main/res/layout/chat_message_downloadable_file_content_cell.xml new file mode 100644 index 000000000..2f5dc5720 --- /dev/null +++ b/app/src/main/res/layout/chat_message_downloadable_file_content_cell.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/chat_message_generic_file_content_cell.xml b/app/src/main/res/layout/chat_message_generic_file_content_cell.xml new file mode 100644 index 000000000..0253b4f10 --- /dev/null +++ b/app/src/main/res/layout/chat_message_generic_file_content_cell.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/chat_message_image_content_cell.xml b/app/src/main/res/layout/chat_message_image_content_cell.xml new file mode 100644 index 000000000..679958afc --- /dev/null +++ b/app/src/main/res/layout/chat_message_image_content_cell.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/chat_message_video_content_cell.xml b/app/src/main/res/layout/chat_message_video_content_cell.xml new file mode 100644 index 000000000..c05c573f3 --- /dev/null +++ b/app/src/main/res/layout/chat_message_video_content_cell.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/chat_message_voice_record_content_cell.xml b/app/src/main/res/layout/chat_message_voice_record_content_cell.xml index 585108aa9..e4d2f206b 100644 --- a/app/src/main/res/layout/chat_message_voice_record_content_cell.xml +++ b/app/src/main/res/layout/chat_message_voice_record_content_cell.xml @@ -11,12 +11,16 @@ + + android:onLongClick="@{longClickListener}" + android:visibility="@{inflatedVisibility}">