diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt
index dfb8b9e2e..907b3cd1d 100644
--- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt
+++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt
@@ -89,6 +89,7 @@ class OutcomingTextMessageViewHolder(itemView: View) :
itemView
)
+ var isBubbled = true
if (
(message.messageParameters == null || message.messageParameters!!.size <= 0) &&
TextMatchers.isMessageWithSingleEmoticonOnly(message.text)
@@ -96,6 +97,7 @@ class OutcomingTextMessageViewHolder(itemView: View) :
textSize = (textSize * TEXT_SIZE_MULTIPLIER).toFloat()
layoutParams.isWrapBefore = true
realView.isSelected = true
+ isBubbled = false
}
setBubbleOnChatMessage(message)
@@ -154,7 +156,8 @@ class OutcomingTextMessageViewHolder(itemView: View) :
binding.reactions,
context,
true,
- viewThemeUtils
+ viewThemeUtils,
+ isBubbled
)
}
diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt
index 02159ceab..a70173c05 100644
--- a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt
+++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt
@@ -28,13 +28,13 @@ import com.nextcloud.android.common.ui.theme.utils.ColorRole
import com.nextcloud.talk.R
import com.nextcloud.talk.application.NextcloudTalkApplication
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
+import com.nextcloud.talk.chat.data.model.ChatMessage
import com.nextcloud.talk.components.filebrowser.models.BrowserFile
import com.nextcloud.talk.components.filebrowser.webdav.ReadFilesystemOperation
import com.nextcloud.talk.data.user.model.User
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding
import com.nextcloud.talk.extensions.loadChangelogBotAvatar
import com.nextcloud.talk.extensions.loadFederatedUserAvatar
-import com.nextcloud.talk.chat.data.model.ChatMessage
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.users.UserManager
import com.nextcloud.talk.utils.DateUtils
@@ -150,6 +150,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
messageText.text = ""
}
itemView.setTag(R.string.replyable_message_view_tag, message.replyable)
+ val paddingSide = DisplayUtils.convertDpToPixel(HORIZONTAL_REACTION_PADDING, context!!).toInt()
Reaction().showReactions(
message,
::clickOnReaction,
@@ -157,8 +158,10 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
reactionsBinding!!,
messageText.context,
true,
- viewThemeUtils!!
+ viewThemeUtils!!,
+ hasBubbleBackground(message)
)
+ reactionsBinding!!.reactionsEmojiWrapper.setPadding(paddingSide, 0, paddingSide, 0)
if (userAvatar != null) {
if (message.isGrouped || message.isOneToOneConversation) {
@@ -313,6 +316,10 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
this.previewMessageInterface = previewMessageInterface
}
+ fun hasBubbleBackground(message: ChatMessage): Boolean {
+ return !message.isVoiceMessage && message.message != "{file}"
+ }
+
abstract val messageText: EmojiTextView
abstract val messageCaption: EmojiTextView
abstract val previewContainer: View
@@ -332,5 +339,6 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
const val ACTOR_ID_CHANGELOG = "changelog"
const val KEY_NAME = "name"
const val MIN_IMAGE_HEIGHT = 100F
+ const val HORIZONTAL_REACTION_PADDING = 8.0F
}
}
diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
index 801c2220b..d348993e0 100644
--- a/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
+++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
@@ -26,7 +26,8 @@ class Reaction {
binding: ReactionsInsideMessageBinding,
context: Context,
isOutgoingMessage: Boolean,
- viewThemeUtils: ViewThemeUtils
+ viewThemeUtils: ViewThemeUtils,
+ isBubbled: Boolean = true
) {
binding.reactionsEmojiWrapper.removeAllViews()
@@ -64,7 +65,8 @@ class Reaction {
viewThemeUtils,
isOutgoingMessage,
isSelfReaction
- )
+ ),
+ isBubbled
)
emojiWithAmountWrapper.setOnClickListener {
@@ -86,7 +88,8 @@ class Reaction {
context: Context,
emoji: String,
amount: Int,
- layoutInfo: EmojiWithAmountWrapperLayoutInfo
+ layoutInfo: EmojiWithAmountWrapperLayoutInfo,
+ isBubbled: Boolean
): LinearLayout {
val emojiWithAmountWrapper = LinearLayout(context)
emojiWithAmountWrapper.orientation = LinearLayout.HORIZONTAL
@@ -96,7 +99,11 @@ class Reaction {
emojiWithAmountWrapper.layoutParams = layoutInfo.wrapperParams
if (layoutInfo.isSelfReaction) {
- layoutInfo.viewThemeUtils.talk.setCheckedBackground(emojiWithAmountWrapper, layoutInfo.isOutgoingMessage)
+ layoutInfo.viewThemeUtils.talk.setCheckedBackground(
+ emojiWithAmountWrapper,
+ layoutInfo.isOutgoingMessage,
+ isBubbled
+ )
emojiWithAmountWrapper.setPaddingRelative(
layoutInfo.paddingSide,
diff --git a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt
index 33d9e41e5..073ef7434 100644
--- a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt
+++ b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt
@@ -168,12 +168,12 @@ class TalkSpecificViewThemeUtils @Inject constructor(
}
}
- fun setCheckedBackground(linearLayout: LinearLayout, outgoing: Boolean) {
+ fun setCheckedBackground(linearLayout: LinearLayout, outgoing: Boolean, isBubbled: Boolean) {
withScheme(linearLayout) { scheme ->
val drawable = AppCompatResources
.getDrawable(linearLayout.context, R.drawable.reaction_self_background)!!
.mutate()
- val backgroundColor = if (outgoing) {
+ val backgroundColor = if (outgoing && isBubbled) {
ContextCompat.getColor(
linearLayout.context,
R.color.bg_message_list_incoming_bubble
diff --git a/app/src/main/res/drawable/ic_mimetype_application_pdf.xml b/app/src/main/res/drawable/ic_mimetype_application_pdf.xml
index d1ee120cb..f72565666 100755
--- a/app/src/main/res/drawable/ic_mimetype_application_pdf.xml
+++ b/app/src/main/res/drawable/ic_mimetype_application_pdf.xml
@@ -7,10 +7,10 @@
+ android:fillColor="#DC5047"
+ android:fillType="nonZero"
+ android:pathData="M5.75,15.125L7,15.125L7,12.625L8.25,12.625C8.604,12.625 8.901,12.505 9.141,12.265C9.38,12.026 9.5,11.729 9.5,11.375L9.5,10.125C9.5,9.771 9.38,9.474 9.141,9.234C8.901,8.995 8.604,8.875 8.25,8.875L5.75,8.875L5.75,15.125ZM7,11.375L7,10.125L8.25,10.125L8.25,11.375L7,11.375ZM10.75,15.125L13.25,15.125C13.604,15.125 13.901,15.005 14.141,14.765C14.38,14.526 14.5,14.229 14.5,13.875L14.5,10.125C14.5,9.771 14.38,9.474 14.141,9.234C13.901,8.995 13.604,8.875 13.25,8.875L10.75,8.875L10.75,15.125ZM12,13.875L12,10.125L13.25,10.125L13.25,13.875L12,13.875ZM15.75,15.125L17,15.125L17,12.625L18.25,12.625L18.25,11.375L17,11.375L17,10.125L18.25,10.125L18.25,8.875L15.75,8.875L15.75,15.125ZM4.5,22C3.812,22 3.224,21.755 2.735,21.266C2.245,20.776 2,20.188 2,19.5L2,4.5C2,3.813 2.245,3.224 2.735,2.734C3.224,2.245 3.812,2 4.5,2L19.5,2C20.188,2 20.776,2.245 21.266,2.734C21.755,3.224 22,3.813 22,4.5L22,19.5C22,20.188 21.755,20.776 21.266,21.266C20.776,21.755 20.188,22 19.5,22L4.5,22Z" />
diff --git a/app/src/main/res/drawable/reaction_self_background.xml b/app/src/main/res/drawable/reaction_self_background.xml
index 9e088caee..057c39c22 100644
--- a/app/src/main/res/drawable/reaction_self_background.xml
+++ b/app/src/main/res/drawable/reaction_self_background.xml
@@ -19,5 +19,5 @@
android:right="1dp"
android:top="1dp" />
-
+
diff --git a/app/src/main/res/layout/reactions_inside_message.xml b/app/src/main/res/layout/reactions_inside_message.xml
index 089ad0d86..ea083ffcf 100644
--- a/app/src/main/res/layout/reactions_inside_message.xml
+++ b/app/src/main/res/layout/reactions_inside_message.xml
@@ -18,6 +18,7 @@
android:id="@+id/reactions_emoji_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/standard_half_margin"
android:gravity="center_vertical"
- android:orientation="horizontal"/>
+ android:orientation="horizontal" />
diff --git a/detekt.yml b/detekt.yml
index 7ad14df30..f0922b2d9 100644
--- a/detekt.yml
+++ b/detekt.yml
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: GPL-3.0-or-later
build:
- maxIssues: 82
+ maxIssues: 78
weights:
# complexity: 2
# LongParameterList: 1