From 73e9338f3c8ff25ab6ef7ad647cf8069e0e81cf2 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Thu, 3 Mar 2022 20:01:47 +0100 Subject: [PATCH] fix timeline jumping to top when activity is recreated (#2364) --- .../tusky/components/timeline/TimelinePagingAdapter.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelinePagingAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelinePagingAdapter.kt index e8b23c61..063e9f39 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelinePagingAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/timeline/TimelinePagingAdapter.kt @@ -41,6 +41,10 @@ class TimelinePagingAdapter( ) } + init { + stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY + } + override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): RecyclerView.ViewHolder { return when (viewType) { VIEW_TYPE_STATUS -> {