mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
scroll to first unread mention and place it to the top
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
3954025dcb
commit
74e693d95c
1 changed files with 5 additions and 1 deletions
|
@ -207,6 +207,8 @@ public class ConversationsListController extends BaseController implements Searc
|
|||
|
||||
private boolean forwardMessage;
|
||||
|
||||
private int nextUnreadConversationScrollPosition = 0;
|
||||
|
||||
private SmoothScrollLinearLayoutManager layoutManager;
|
||||
|
||||
public ConversationsListController(Bundle bundle) {
|
||||
|
@ -619,7 +621,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||
newMentionPopupBubble.setPopupBubbleListener(new PopupBubble.PopupBubbleClickListener() {
|
||||
@Override
|
||||
public void bubbleClicked(Context context) {
|
||||
recyclerView.smoothScrollToPosition(callItems.size());
|
||||
recyclerView.smoothScrollToPosition(nextUnreadConversationScrollPosition);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -634,12 +636,14 @@ public class ConversationsListController extends BaseController implements Searc
|
|||
(conversationItem.unreadMessages > 0 &&
|
||||
conversationItem.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) &&
|
||||
position > lastVisibleItem) {
|
||||
nextUnreadConversationScrollPosition = position;
|
||||
if (!newMentionPopupBubble.isShown()) {
|
||||
newMentionPopupBubble.show();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
nextUnreadConversationScrollPosition = 0;
|
||||
newMentionPopupBubble.hide();
|
||||
} catch (NullPointerException e) {
|
||||
Log.d(TAG, "A NPE was caught when trying to show the unread popup bubble. This might happen when the " +
|
||||
|
|
Loading…
Reference in a new issue