mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Attempt to keep scroll position on rotating
This commit is contained in:
@@ -264,6 +264,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
private static boolean debug;
|
||||
|
||||
private boolean gotoTop = false;
|
||||
private Integer gotoPos = null;
|
||||
private boolean firstClick = false;
|
||||
private int searchResult = 0;
|
||||
private AsyncPagedListDiffer<TupleMessageEx> differ;
|
||||
@@ -5441,6 +5442,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
}
|
||||
}
|
||||
|
||||
if (gotoPos != null && currentList != null && currentList.size() > 0) {
|
||||
properties.scrollTo(gotoPos, 0);
|
||||
gotoPos = null;
|
||||
}
|
||||
|
||||
if (selectionTracker != null && selectionTracker.hasSelection()) {
|
||||
Selection<Long> selection = selectionTracker.getSelection();
|
||||
|
||||
@@ -5530,6 +5536,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||
this.gotoTop = true;
|
||||
}
|
||||
|
||||
void gotoPos(int pos) {
|
||||
if (pos != RecyclerView.NO_POSITION)
|
||||
gotoPos = pos;
|
||||
}
|
||||
|
||||
void submitList(PagedList<TupleMessageEx> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TupleMessageEx message = list.get(i);
|
||||
|
||||
Reference in New Issue
Block a user