Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-20.0] Bugfix/3993/fix flickering unread mention popup #4189

Merged
merged 4 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,9 @@ class ConversationsListActivity :
if (searchHelper != null) {
// cancel any pending searches
searchHelper!!.cancelSearch()
binding.swipeRefreshLayoutView?.isRefreshing = false
searchBehaviorSubject.onNext(false)
}
binding.swipeRefreshLayoutView?.isRefreshing = false
searchBehaviorSubject.onNext(false)
binding.swipeRefreshLayoutView?.isEnabled = true
searchView!!.onActionViewCollapsed()

Expand Down Expand Up @@ -1009,13 +1009,15 @@ class ConversationsListActivity :
newFragment.show(supportFragmentManager, FilterConversationFragment.TAG)
}

binding.newMentionPopupBubble?.hide()
binding.newMentionPopupBubble?.setPopupBubbleListener {
binding.recyclerView?.smoothScrollToPosition(
nextUnreadConversationScrollPosition
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.setPopupBubbleListener {
val layoutManager = binding.recyclerView.layoutManager as SmoothScrollLinearLayoutManager?
layoutManager?.scrollToPositionWithOffset(
nextUnreadConversationScrollPosition,
binding.recyclerView.height / 3
)
}
binding.newMentionPopupBubble?.let { viewThemeUtils.material.colorMaterialButtonPrimaryFilled(it) }
binding.newMentionPopupBubble.let { viewThemeUtils.material.colorMaterialButtonPrimaryFilled(it) }
}

private fun hideLogoForBrandedClients() {
Expand All @@ -1039,14 +1041,14 @@ class ConversationsListActivity :
val position = adapter!!.getGlobalPositionOf(flexItem)
if (hasUnreadItems(conversation) && position > lastVisibleItem) {
nextUnreadConversationScrollPosition = position
if (!binding.newMentionPopupBubble?.isShown!!) {
binding.newMentionPopupBubble?.show()
if (!binding.newMentionPopupBubble.isShown) {
binding.newMentionPopupBubble.show()
}
return@subscribe
}
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble?.hide()
}
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
} catch (e: NullPointerException) {
Log.d(
TAG,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ object CapabilitiesUtil {
}

fun isUnifiedSearchAvailable(spreedCapabilities: SpreedCapability): Boolean {
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.FEDERATION_V1)) {
if (!hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.FEDERATION_V1)) {
return false
}
return hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.UNIFIED_SEARCH)
Expand Down
Loading