Fixed scroll position

This commit is contained in:
M66B
2020-05-05 17:39:07 +02:00
parent 270c6d3ded
commit e30e4d47e1
2 changed files with 6 additions and 2 deletions

View File

@@ -1546,7 +1546,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
public void run() {
LinearLayoutManager llm = (LinearLayoutManager) rvMessage.getLayoutManager();
llm.scrollToPositionWithOffset(pos, -y);
View child = llm.getChildAt(pos);
int dy = (child == null ? 0 : llm.getTopDecorationHeight(child));
llm.scrollToPositionWithOffset(pos, -y - dy);
}
});
}