From 59ee0b0cb160696d6da63078fc1a27422d8dd861 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 12 Nov 2024 13:27:04 +0100 Subject: [PATCH 1/2] fix to provide all call emojis As the number of provided emojis grew, there was a bug that only one emoji was shown. Putting all 12 emojis would have been too close, so it's implemented to scroll them horizontally Signed-off-by: Marcel Hibbe --- .../talk/ui/dialog/MoreCallActionsDialog.kt | 6 ++--- .../res/layout/dialog_more_call_actions.xml | 26 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt index 22850892a..fae07ab3e 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt @@ -96,9 +96,8 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee capabilities?.spreedCapability?.config!!["call"]!!["supported-reactions"] as ArrayList<*> val param = LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.MATCH_PARENT, - 1.0f + EMOJI_WIDTH, + LinearLayout.LayoutParams.MATCH_PARENT ) availableReactions.forEach { @@ -185,5 +184,6 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee companion object { private const val TAG = "MoreCallActionsDialog" private const val TEXT_SIZE = 20f + private const val EMOJI_WIDTH = 80 } } diff --git a/app/src/main/res/layout/dialog_more_call_actions.xml b/app/src/main/res/layout/dialog_more_call_actions.xml index 2bc62e2a7..74df6cf98 100644 --- a/app/src/main/res/layout/dialog_more_call_actions.xml +++ b/app/src/main/res/layout/dialog_more_call_actions.xml @@ -18,18 +18,26 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - - + android:requiresFadingEdge="horizontal" + android:scrollbars="none"> + + + + + Date: Thu, 14 Nov 2024 15:36:40 +0100 Subject: [PATCH 2/2] fix to support different screen densities Signed-off-by: Marcel Hibbe --- .../com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt index fae07ab3e..d18e63be2 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/MoreCallActionsDialog.kt @@ -22,6 +22,7 @@ import com.nextcloud.talk.databinding.DialogMoreCallActionsBinding import com.nextcloud.talk.raisehand.viewmodel.RaiseHandViewModel import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.CapabilitiesUtil +import com.nextcloud.talk.utils.DisplayUtils import com.nextcloud.talk.viewmodels.CallRecordingViewModel import com.vanniktech.emoji.EmojiTextView import javax.inject.Inject @@ -96,7 +97,7 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee capabilities?.spreedCapability?.config!!["call"]!!["supported-reactions"] as ArrayList<*> val param = LinearLayout.LayoutParams( - EMOJI_WIDTH, + DisplayUtils.convertDpToPixel(EMOJI_WIDTH.toFloat(), callActivity).toInt(), LinearLayout.LayoutParams.MATCH_PARENT ) @@ -184,6 +185,6 @@ class MoreCallActionsDialog(private val callActivity: CallActivity) : BottomShee companion object { private const val TAG = "MoreCallActionsDialog" private const val TEXT_SIZE = 20f - private const val EMOJI_WIDTH = 80 + private const val EMOJI_WIDTH = 40 } }