mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Only animate on banner creation.
This commit is contained in:
@@ -139,7 +139,7 @@ class ConversationBannerView @JvmOverloads constructor(
|
||||
hide(voiceNotePlayerStub)
|
||||
}
|
||||
|
||||
fun showPinnedMessageStub(messages: List<ConversationMessage>, canUnpin: Boolean, hasWallpaper: Boolean) {
|
||||
fun showPinnedMessageStub(messages: List<ConversationMessage>, canUnpin: Boolean, hasWallpaper: Boolean, shouldAnimate: Boolean) {
|
||||
val firstRender = !pinnedMessageStub.isVisible
|
||||
|
||||
val view = pinnedMessageStub.get()
|
||||
@@ -158,7 +158,7 @@ class ConversationBannerView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
if (firstRender) {
|
||||
if (firstRender && shouldAnimate) {
|
||||
view.visibility = INVISIBLE
|
||||
view.post {
|
||||
view.visible = true
|
||||
@@ -172,6 +172,8 @@ class ConversationBannerView @JvmOverloads constructor(
|
||||
.setDuration(ANIMATION_DURATION)
|
||||
.start()
|
||||
}
|
||||
} else {
|
||||
view.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -571,6 +571,7 @@ class ConversationFragment :
|
||||
private var scrollListener: ScrollListener? = null
|
||||
private var keyboardEvents: KeyboardEvents? = null
|
||||
private var progressDialog: ProgressCardDialogFragment? = null
|
||||
private var firstPinRender: Boolean = true
|
||||
|
||||
private val jumpAndPulseScrollStrategy = object : ScrollToPositionDelegate.ScrollStrategy {
|
||||
override fun performScroll(recyclerView: RecyclerView, layoutManager: LinearLayoutManager, position: Int, smooth: Boolean) {
|
||||
@@ -1354,10 +1355,11 @@ class ConversationFragment :
|
||||
|
||||
private fun presentPinnedMessage(pinnedMessages: List<ConversationMessage>, hasWallpaper: Boolean) {
|
||||
if (pinnedMessages.isNotEmpty()) {
|
||||
binding.conversationBanner.showPinnedMessageStub(messages = pinnedMessages, canUnpin = conversationGroupViewModel.canEditGroupInfo(), hasWallpaper = hasWallpaper)
|
||||
binding.conversationBanner.showPinnedMessageStub(messages = pinnedMessages, canUnpin = conversationGroupViewModel.canEditGroupInfo(), hasWallpaper = hasWallpaper, shouldAnimate = !firstPinRender)
|
||||
} else {
|
||||
binding.conversationBanner.hidePinnedMessageStub()
|
||||
}
|
||||
firstPinRender = false
|
||||
}
|
||||
|
||||
private fun presentTypingIndicator() {
|
||||
|
||||
Reference in New Issue
Block a user