Skip to content

Commit

Permalink
Changes to ConversationsListActivity
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Nov 21, 2024
1 parent 5f0331a commit 2b3b83a
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ import java.util.Objects
import java.util.concurrent.TimeUnit
import javax.inject.Inject

@SuppressLint("StringFormatInvalid")
@AutoInjector(NextcloudTalkApplication::class)
class ConversationsListActivity :
BaseActivity(),
Expand Down Expand Up @@ -1024,8 +1025,8 @@ class ConversationsListActivity :
newFragment.show(supportFragmentManager, FilterConversationFragment.TAG)
}

binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.setPopupBubbleListener {
binding.newMentionPopupBubble.visibility = View.GONE
binding.newMentionPopupBubble.setOnClickListener {
val layoutManager = binding.recyclerView.layoutManager as SmoothScrollLinearLayoutManager?
layoutManager?.scrollToPositionWithOffset(
nextUnreadConversationScrollPosition,
Expand All @@ -1047,7 +1048,7 @@ class ConversationsListActivity :
searchBehaviorSubject.subscribe { value ->
if (value) {
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.visibility = View.GONE
} else {
try {
val lastVisibleItem = layoutManager!!.findLastCompletelyVisibleItemPosition()
Expand All @@ -1057,13 +1058,13 @@ class ConversationsListActivity :
if (hasUnreadItems(conversation) && position > lastVisibleItem) {
nextUnreadConversationScrollPosition = position
if (!binding.newMentionPopupBubble.isShown) {
binding.newMentionPopupBubble.show()
binding.newMentionPopupBubble.visibility = View.VISIBLE
}
return@subscribe
}
}
nextUnreadConversationScrollPosition = 0
binding.newMentionPopupBubble.hide()
binding.newMentionPopupBubble.visibility = View.GONE
} catch (e: NullPointerException) {
Log.d(
TAG,
Expand Down

0 comments on commit 2b3b83a

Please sign in to comment.