mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-12 10:32:36 +00:00
Merge pull request #4041 from nextcloud/issue-4040
Typing Indicator fix after recent refactoring
This commit is contained in:
commit
8e8066d83d
@ -1297,25 +1297,14 @@ class ChatActivity :
|
|||||||
binding.typingIndicator.text = typingString
|
binding.typingIndicator.text = typingString
|
||||||
|
|
||||||
if (participantNames.size > 0) {
|
if (participantNames.size > 0) {
|
||||||
|
binding.typingIndicatorWrapper.visibility = View.VISIBLE
|
||||||
binding.typingIndicatorWrapper.animate()
|
binding.typingIndicatorWrapper.animate()
|
||||||
.translationY(binding.fragmentContainerActivityChat.y - DisplayUtils.convertDpToPixel(18f, context))
|
.translationYBy(DisplayUtils.convertDpToPixel(-18f, context))
|
||||||
.setInterpolator(AccelerateDecelerateInterpolator())
|
.setInterpolator(AccelerateDecelerateInterpolator())
|
||||||
.duration = TYPING_INDICATOR_ANIMATION_DURATION
|
.duration = TYPING_INDICATOR_ANIMATION_DURATION
|
||||||
} else {
|
} else {
|
||||||
if (binding.typingIndicator.lineCount == 1) {
|
binding.typingIndicatorWrapper.visibility = View.GONE
|
||||||
binding.typingIndicatorWrapper.animate()
|
binding.typingIndicatorWrapper.y += DisplayUtils.convertDpToPixel(18f, context)
|
||||||
.translationY(binding.fragmentContainerActivityChat.y)
|
|
||||||
.setInterpolator(AccelerateDecelerateInterpolator())
|
|
||||||
.duration = TYPING_INDICATOR_ANIMATION_DURATION
|
|
||||||
} else if (binding.typingIndicator.lineCount == 2) {
|
|
||||||
binding.typingIndicatorWrapper.animate()
|
|
||||||
.translationY(
|
|
||||||
binding.fragmentContainerActivityChat.y +
|
|
||||||
DisplayUtils.convertDpToPixel(15f, context)
|
|
||||||
)
|
|
||||||
.setInterpolator(AccelerateDecelerateInterpolator())
|
|
||||||
.duration = TYPING_INDICATOR_ANIMATION_DURATION
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3384,10 +3373,12 @@ class ChatActivity :
|
|||||||
val messageTemp = message as ChatMessage
|
val messageTemp = message as ChatMessage
|
||||||
messageTemp.lastEditTimestamp = message.lastEditTimestamp
|
messageTemp.lastEditTimestamp = message.lastEditTimestamp
|
||||||
|
|
||||||
val index = adapter?.getMessagePositionById(messageTemp.id) ?: 0
|
val index = adapter?.getMessagePositionById(messageTemp.id)!!
|
||||||
val adapterMsg = adapter?.items?.get(index)?.item as ChatMessage
|
if (index > 0) {
|
||||||
|
val adapterMsg = adapter?.items?.get(index)?.item as ChatMessage
|
||||||
|
messageTemp.parentMessage = adapterMsg.parentMessage
|
||||||
|
}
|
||||||
|
|
||||||
messageTemp.parentMessage = adapterMsg.parentMessage
|
|
||||||
messageTemp.isOneToOneConversation =
|
messageTemp.isOneToOneConversation =
|
||||||
currentConversation?.type == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
currentConversation?.type == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||||
messageTemp.activeUser = conversationUser
|
messageTemp.activeUser = conversationUser
|
||||||
|
@ -226,8 +226,8 @@
|
|||||||
android:id="@+id/typing_indicator"
|
android:id="@+id/typing_indicator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/side_margin"
|
android:paddingStart="@dimen/side_margin"
|
||||||
android:layout_marginEnd="@dimen/side_margin"
|
android:paddingEnd="@dimen/side_margin"
|
||||||
android:background="@color/bg_default"
|
android:background="@color/bg_default"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
|
Loading…
Reference in New Issue
Block a user