File tree 1 file changed +3
-0
lines changed
mastodon/src/main/java/org/joinmastodon/android/fragments
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import androidx .annotation .NonNull ;
20
20
import androidx .annotation .Nullable ;
21
+ import androidx .recyclerview .widget .LinearLayoutManager ;
21
22
import androidx .recyclerview .widget .RecyclerView ;
22
23
23
24
import org .joinmastodon .android .E ;
@@ -718,6 +719,7 @@ public void updateStatusWithQuote(DisplayItemsParent parent) {
718
719
}
719
720
720
721
if (startIndex !=-1 && endIndex !=-1 ) {
722
+ int scrollPosition = ((LinearLayoutManager ) list .getLayoutManager ()).findFirstVisibleItemPosition ();
721
723
// Only StatusListFragments/NotificationsListFragments can display status with quotes
722
724
assert (this instanceof StatusListFragment ) || (this instanceof NotificationsListFragment );
723
725
List <StatusDisplayItem > items =this .buildDisplayItems ((T ) parent );
@@ -727,6 +729,7 @@ public void updateStatusWithQuote(DisplayItemsParent parent) {
727
729
displayItems .addAll (startIndex , items );
728
730
if (!isEmpty )
729
731
adapter .notifyItemRangeInserted (startIndex , items .size ());
732
+ list .scrollToPosition (scrollPosition );
730
733
}
731
734
}
732
735
You can’t perform that action at this time.
0 commit comments