mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Don't scroll to last seen until the recyclerview has been measured
// FREEBIE
This commit is contained in:
parent
acca4a72d3
commit
a075bf7505
@ -442,10 +442,15 @@ public class ConversationFragment extends Fragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scrollToLastSeenPosition(long lastSeen) {
|
private void scrollToLastSeenPosition(long lastSeen) {
|
||||||
int lastSeenPosition = getListAdapter().findLastSeenPosition(lastSeen);
|
final int lastSeenPosition = getListAdapter().findLastSeenPosition(lastSeen);
|
||||||
|
|
||||||
if (lastSeenPosition > 0) {
|
if (lastSeenPosition > 0) {
|
||||||
((LinearLayoutManager)list.getLayoutManager()).scrollToPositionWithOffset(lastSeenPosition, list.getHeight());
|
list.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
((LinearLayoutManager)list.getLayoutManager()).scrollToPositionWithOffset(lastSeenPosition, list.getHeight());
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setLastSeen(0);
|
setLastSeen(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user