diff --git a/CHANGELOG.md b/CHANGELOG.md index a0197014fee..91649dd3449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ ### ⬆️ Improved - Improved UI customization for Audio Recording feature. [#4906](https://github.com/GetStream/stream-chat-android/pull/4906) +- Improved trailing buttons customization for `MessageComposerView`. [#4915](https://github.com/GetStream/stream-chat-android/pull/4915) ### ✅ Added diff --git a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api index acd9ffc6a26..81f920ab70e 100644 --- a/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api +++ b/stream-chat-android-ui-components/api/stream-chat-android-ui-components.api @@ -911,7 +911,7 @@ public final class io/getstream/chat/android/ui/feature/messages/composer/Messag public final class io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle { public static final field Companion Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle$Companion; - public fun (ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;ZZZLandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;)V + public fun (ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;IIIZZZLandroid/graphics/drawable/Drawable;IIILio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;)V public final fun component1 ()I public final fun component10 ()Lio/getstream/chat/android/ui/font/TextStyle; public final fun component11 ()I @@ -977,25 +977,31 @@ public final class io/getstream/chat/android/ui/feature/messages/composer/Messag public final fun component66 ()Landroid/graphics/drawable/Drawable; public final fun component67 ()Z public final fun component68 ()Landroid/graphics/drawable/Drawable; - public final fun component69 ()Z + public final fun component69 ()I public final fun component7 ()I - public final fun component70 ()Z - public final fun component71 ()Z - public final fun component72 ()Landroid/graphics/drawable/Drawable; - public final fun component73 ()Lio/getstream/chat/android/ui/font/TextStyle; - public final fun component74 ()Landroid/graphics/drawable/Drawable; - public final fun component75 ()I - public final fun component76 ()Lio/getstream/chat/android/ui/font/TextStyle; + public final fun component70 ()I + public final fun component71 ()I + public final fun component72 ()Z + public final fun component73 ()Z + public final fun component74 ()Z + public final fun component75 ()Landroid/graphics/drawable/Drawable; + public final fun component76 ()I public final fun component77 ()I - public final fun component78 ()F + public final fun component78 ()I public final fun component79 ()Lio/getstream/chat/android/ui/font/TextStyle; public final fun component8 ()Lio/getstream/chat/android/ui/font/TextStyle; - public final fun component80 ()I - public final fun component81 ()F - public final fun component82 ()Lio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle; + public final fun component80 ()Landroid/graphics/drawable/Drawable; + public final fun component81 ()I + public final fun component82 ()Lio/getstream/chat/android/ui/font/TextStyle; + public final fun component83 ()I + public final fun component84 ()F + public final fun component85 ()Lio/getstream/chat/android/ui/font/TextStyle; + public final fun component86 ()I + public final fun component87 ()F + public final fun component88 ()Lio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle; public final fun component9 ()Ljava/lang/String; - public final fun copy (ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;ZZZLandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;)Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle; - public static synthetic fun copy$default (Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle;ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;ZZZLandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;IIILjava/lang/Object;)Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle; + public final fun copy (ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;IIIZZZLandroid/graphics/drawable/Drawable;IIILio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;)Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle; + public static synthetic fun copy$default (Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle;ILjava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ILandroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;ZZLio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZZILjava/lang/String;IZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/Integer;FFIIIILjava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;Landroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/Integer;ZLandroid/graphics/drawable/Drawable;Ljava/lang/String;Lio/getstream/chat/android/ui/font/TextStyle;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Ljava/lang/String;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;ZLandroid/graphics/drawable/Drawable;IIIZZZLandroid/graphics/drawable/Drawable;IIILio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;ILio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/font/TextStyle;IFLio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle;IIILjava/lang/Object;)Lio/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle; public fun equals (Ljava/lang/Object;)Z public final fun getAlsoSendToChannelCheckboxDrawable ()Landroid/graphics/drawable/Drawable; public final fun getAlsoSendToChannelCheckboxText ()Ljava/lang/String; @@ -1006,9 +1012,12 @@ public final class io/getstream/chat/android/ui/feature/messages/composer/Messag public final fun getAttachmentsButtonVisible ()Z public final fun getAttachmentsPickerDialogStyle ()Lio/getstream/chat/android/ui/feature/messages/composer/attachment/picker/AttachmentsPickerDialogStyle; public final fun getAudioRecordingButtonEnabled ()Z + public final fun getAudioRecordingButtonHeight ()I public final fun getAudioRecordingButtonIconDrawable ()Landroid/graphics/drawable/Drawable; + public final fun getAudioRecordingButtonPadding ()I public final fun getAudioRecordingButtonPreferred ()Z public final fun getAudioRecordingButtonVisible ()Z + public final fun getAudioRecordingButtonWidth ()I public final fun getAudioRecordingFloatingButtonBackgroundDrawable ()Landroid/graphics/drawable/Drawable; public final fun getAudioRecordingFloatingButtonBackgroundDrawableTint ()Ljava/lang/Integer; public final fun getAudioRecordingFloatingButtonIconDrawable ()Landroid/graphics/drawable/Drawable; @@ -1078,7 +1087,10 @@ public final class io/getstream/chat/android/ui/feature/messages/composer/Messag public final fun getReplyModeIconDrawable ()Landroid/graphics/drawable/Drawable; public final fun getReplyModeText ()Ljava/lang/String; public final fun getSendMessageButtonEnabled ()Z + public final fun getSendMessageButtonHeight ()I public final fun getSendMessageButtonIconDrawable ()Landroid/graphics/drawable/Drawable; + public final fun getSendMessageButtonPadding ()I + public final fun getSendMessageButtonWidth ()I public fun hashCode ()I public final fun toMessageReplyStyle ()Lio/getstream/chat/android/ui/feature/messages/list/MessageReplyStyle; public fun toString ()Ljava/lang/String; diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.kt index c0cc5f18f52..ad6a7910753 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.kt @@ -32,6 +32,7 @@ import io.getstream.chat.android.ui.feature.messages.composer.attachment.picker. import io.getstream.chat.android.ui.feature.messages.list.MessageReplyStyle import io.getstream.chat.android.ui.font.TextStyle import io.getstream.chat.android.ui.helper.TransformStyle +import io.getstream.chat.android.ui.utils.extensions.dpToPx import io.getstream.chat.android.ui.utils.extensions.dpToPxPrecise import io.getstream.chat.android.ui.utils.extensions.getColorCompat import io.getstream.chat.android.ui.utils.extensions.getColorOrNull @@ -230,10 +231,16 @@ public data class MessageComposerViewStyle( // Trailing content public val sendMessageButtonEnabled: Boolean, public val sendMessageButtonIconDrawable: Drawable, + @Px public val sendMessageButtonWidth: Int, + @Px public val sendMessageButtonHeight: Int, + @Px public val sendMessageButtonPadding: Int, public val audioRecordingButtonVisible: Boolean, public val audioRecordingButtonEnabled: Boolean, public val audioRecordingButtonPreferred: Boolean, public val audioRecordingButtonIconDrawable: Drawable, + @Px public val audioRecordingButtonWidth: Int, + @Px public val audioRecordingButtonHeight: Int, + @Px public val audioRecordingButtonPadding: Int, public val cooldownTimerTextStyle: TextStyle, public val cooldownTimerBackgroundDrawable: Drawable, // Message reply customization, by default belongs to center content as well @@ -684,6 +691,22 @@ public data class MessageComposerViewStyle( R.styleable.MessageComposerView_streamUiMessageComposerSendMessageButtonIconDrawable, ) ?: context.getDrawableCompat(R.drawable.stream_ui_ic_send_message)!! + val sendMessageButtonWidth: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerSendMessageButtonWidth, + DEFAULT_TRAILING_BUTTON_SIZE.dpToPx(), + ) + val sendMessageButtonHeight: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerSendMessageButtonHeight, + DEFAULT_TRAILING_BUTTON_SIZE.dpToPx(), + ) + val sendMessageButtonPadding: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerSendMessageButtonPadding, + DEFAULT_TRAILING_BUTTON_PADDING.dpToPx(), + ) + val audioRecordingButtonEnabled = a.getBoolean( R.styleable.MessageComposerView_streamUiMessageComposerAudioRecordingButtonEnabled, true, @@ -701,6 +724,22 @@ public data class MessageComposerViewStyle( R.styleable.MessageComposerView_streamUiMessageComposerAudioRecordingButtonIconDrawable, ) ?: context.getDrawableCompat(R.drawable.stream_ui_ic_mic)!! + val audioRecordingButtonWidth: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerAudioRecordingButtonWidth, + DEFAULT_TRAILING_BUTTON_SIZE.dpToPx(), + ) + val audioRecordingButtonHeight: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerAudioRecordingButtonHeight, + DEFAULT_TRAILING_BUTTON_SIZE.dpToPx(), + ) + val audioRecordingButtonPadding: Int = + a.getDimensionPixelSize( + R.styleable.MessageComposerView_streamUiMessageComposerAudioRecordingButtonPadding, + DEFAULT_TRAILING_BUTTON_PADDING.dpToPx(), + ) + val cooldownTimerTextStyle = TextStyle.Builder(a) .size( R.styleable.MessageComposerView_streamUiMessageComposerCooldownTimerTextSize, @@ -941,10 +980,16 @@ public data class MessageComposerViewStyle( // Trailing content sendMessageButtonEnabled = sendMessageButtonEnabled, sendMessageButtonIconDrawable = sendMessageButtonIconDrawable, + sendMessageButtonWidth = sendMessageButtonWidth, + sendMessageButtonHeight = sendMessageButtonHeight, + sendMessageButtonPadding = sendMessageButtonPadding, audioRecordingButtonEnabled = audioRecordingButtonEnabled, audioRecordingButtonVisible = audioRecordingButtonVisible, audioRecordingButtonPreferred = audioRecordingButtonPreferred, audioRecordingButtonIconDrawable = audioRecordingButtonIconDrawable, + audioRecordingButtonWidth = audioRecordingButtonWidth, + audioRecordingButtonHeight = audioRecordingButtonHeight, + audioRecordingButtonPadding = audioRecordingButtonPadding, cooldownTimerTextStyle = cooldownTimerTextStyle, cooldownTimerBackgroundDrawable = cooldownTimerBackgroundDrawable, messageReplyBackgroundColor = messageReplyBackgroundColor, @@ -1261,5 +1306,7 @@ public data class MessageComposerViewStyle( } private const val DEFAULT_MESSAGE_REPLY_BACKGROUND_STROKE_WIDTH = 4F + private const val DEFAULT_TRAILING_BUTTON_SIZE = 32 + private const val DEFAULT_TRAILING_BUTTON_PADDING = 4 } } diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerTrailingContent.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerTrailingContent.kt index a12363a9ff8..64fd7380435 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerTrailingContent.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerTrailingContent.kt @@ -24,6 +24,7 @@ import android.view.View import android.view.ViewGroup import android.widget.FrameLayout import androidx.core.view.isVisible +import androidx.core.view.updateLayoutParams import io.getstream.chat.android.client.ChatClient import io.getstream.chat.android.models.AttachmentType import io.getstream.chat.android.models.ChannelCapabilities @@ -97,6 +98,16 @@ public class DefaultMessageComposerTrailingContent : FrameLayout, MessageCompose this.style = messageComposerContext.style binding.sendMessageButton.setImageDrawable(style.sendMessageButtonIconDrawable) + binding.sendMessageButton.updateLayoutParams { + width = style.sendMessageButtonWidth + height = style.sendMessageButtonHeight + } + binding.sendMessageButton.setPadding( + style.sendMessageButtonPadding, + style.sendMessageButtonPadding, + style.sendMessageButtonPadding, + style.sendMessageButtonPadding, + ) style.buttonIconDrawableTintColor?.let { tintColor -> binding.sendMessageButton.imageTintList = getColorList( normalColor = tintColor, @@ -112,6 +123,16 @@ public class DefaultMessageComposerTrailingContent : FrameLayout, MessageCompose disabledColor = context.getColorCompat(R.color.stream_ui_grey_gainsboro), ) } + binding.recordAudioButton.updateLayoutParams { + width = style.audioRecordingButtonWidth + height = style.audioRecordingButtonHeight + } + binding.recordAudioButton.setPadding( + style.audioRecordingButtonPadding, + style.audioRecordingButtonPadding, + style.audioRecordingButtonPadding, + style.audioRecordingButtonPadding, + ) binding.cooldownBadgeTextView.setTextStyle(style.cooldownTimerTextStyle) binding.cooldownBadgeTextView.background = style.cooldownTimerBackgroundDrawable diff --git a/stream-chat-android-ui-components/src/main/res/values/attrs_message_composer_view.xml b/stream-chat-android-ui-components/src/main/res/values/attrs_message_composer_view.xml index 2b6c5ac7e87..acec603f005 100644 --- a/stream-chat-android-ui-components/src/main/res/values/attrs_message_composer_view.xml +++ b/stream-chat-android-ui-components/src/main/res/values/attrs_message_composer_view.xml @@ -196,10 +196,16 @@ + + + + + + diff --git a/stream-chat-android-ui-components/src/main/res/values/styles.xml b/stream-chat-android-ui-components/src/main/res/values/styles.xml index d2a63c39f8c..7942cd30eb5 100644 --- a/stream-chat-android-ui-components/src/main/res/values/styles.xml +++ b/stream-chat-android-ui-components/src/main/res/values/styles.xml @@ -1090,10 +1090,16 @@ true @drawable/stream_ui_ic_send_message + @dimen/stream_ui_message_composer_trailing_content_button_send_message_width + @dimen/stream_ui_message_composer_trailing_content_button_send_message_height + @dimen/stream_ui_message_composer_trailing_content_button_send_message_padding false true false @drawable/stream_ui_ic_mic + @dimen/stream_ui_message_composer_trailing_content_button_record_audio_width + @dimen/stream_ui_message_composer_trailing_content_button_record_audio_height + @dimen/stream_ui_message_composer_trailing_content_button_record_audio_padding @dimen/stream_ui_text_large @color/stream_ui_literal_white @drawable/stream_ui_cooldown_badge_background