From 503075f4d04786b9b83b6433a44b8f48c2b6a391 Mon Sep 17 00:00:00 2001 From: dece Date: Wed, 12 Apr 2023 19:57:29 +0200 Subject: [PATCH] PageFragment: scroll to top on new page Fixes an issue where new pages sometimes are shown at the position of the previous page instead of from their start. --- app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt index bbb959b..469ab7a 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt @@ -134,6 +134,7 @@ class PageFragment : Fragment(), PageAdapter.Listener { binding.addressBar.setTextColor(resources.getColor(R.color.url_bar_loading, null)) } PageViewModel.State.RECEIVING -> { + binding.contentRecycler.smoothScrollToPosition(0) binding.contentSwipeLayout.isRefreshing = false } }