From ccf249f91b80e535bc84f2fadecee1bd287cc8b6 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 8 Apr 2021 16:57:31 -0400 Subject: [PATCH] Tapping on the same recents tab scrolls back to top --- .../java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt index 4240181f6d..73cbc870df 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt @@ -45,6 +45,7 @@ import eu.kanade.tachiyomi.util.view.requestPermissionsSafe import eu.kanade.tachiyomi.util.view.scrollViewWith import eu.kanade.tachiyomi.util.view.setOnQueryTextChangeListener import eu.kanade.tachiyomi.util.view.setStyle +import eu.kanade.tachiyomi.util.view.smoothScrollToTop import eu.kanade.tachiyomi.util.view.snack import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updatePaddingRelative @@ -570,7 +571,9 @@ class RecentsController(bundle: Bundle? = null) : } override fun onTabUnselected(tab: TabLayout.Tab?) {} - override fun onTabReselected(tab: TabLayout.Tab?) {} + override fun onTabReselected(tab: TabLayout.Tab?) { + binding.recycler.smoothScrollToTop() + } }) (activity as? MainActivity)?.showTabBar(true) }