From c7585c559451b8b83f44ce36f8980c746dd40309 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Mon, 7 Dec 2020 22:40:43 -0500 Subject: [PATCH] Fix issues with jumpToMessage behavior. --- .../securesms/conversation/ConversationFragment.java | 2 +- .../org/thoughtcrime/securesms/util/SnapToTopDataObserver.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java index 571ded5638..158df5b8a4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationFragment.java @@ -1005,7 +1005,7 @@ public class ConversationFragment extends LoggingFragment { private void moveToPosition(int position, @Nullable Runnable onMessageNotFound) { Log.d(TAG, "moveToPosition(" + position + ")"); - conversationViewModel.onConversationDataAvailable(threadId, position); + conversationViewModel.getPagingController().onDataNeededAroundIndex(position); snapToTopDataObserver.buildScrollPosition(position) .withOnPerformScroll(((layoutManager, p) -> list.post(() -> { diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/SnapToTopDataObserver.java b/app/src/main/java/org/thoughtcrime/securesms/util/SnapToTopDataObserver.java index 333823c7bd..a18a88003a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/SnapToTopDataObserver.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/SnapToTopDataObserver.java @@ -127,6 +127,7 @@ public class SnapToTopDataObserver extends RecyclerView.AdapterDataObserver { } if (layoutManager.findFirstVisibleItemPosition() == 0) { + Log.d(TAG, "Scrolling to top."); scrollToTop.scrollToTop(); } }