Fix crash in TimelineFragment (#2317)
This commit is contained in:
parent
db1cc02fb8
commit
d2d52da717
1 changed files with 5 additions and 3 deletions
|
@ -208,9 +208,11 @@ class TimelineFragment :
|
|||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
if (positionStart == 0 && adapter.itemCount != itemCount) {
|
||||
binding.recyclerView.post {
|
||||
if (isSwipeToRefreshEnabled) {
|
||||
binding.recyclerView.scrollBy(0, Utils.dpToPx(requireContext(), -30))
|
||||
} else binding.recyclerView.scrollToPosition(0)
|
||||
if (getView() != null) {
|
||||
if (isSwipeToRefreshEnabled) {
|
||||
binding.recyclerView.scrollBy(0, Utils.dpToPx(requireContext(), -30))
|
||||
} else binding.recyclerView.scrollToPosition(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue