Fix category tabs incorrect scroll position (#7120)
(cherry picked from commit 6d655ff7574c0c51c41cfc6b3abed57fb2115acc)
(cherry picked from commit 58db04d8dd)
This commit is contained in:
parent
960d67ec26
commit
3ec11cb81f
1 changed files with 4 additions and 3 deletions
|
|
@ -10,7 +10,6 @@ import android.view.View
|
|||
import android.view.WindowManager
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import androidx.core.view.doOnAttach
|
||||
import androidx.core.view.isVisible
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import com.bluelinelabs.conductor.ControllerChangeType
|
||||
|
|
@ -345,8 +344,10 @@ class LibraryController(
|
|||
onTabsSettingsChanged(firstLaunch = true)
|
||||
|
||||
// Delay the scroll position to allow the view to be properly measured.
|
||||
view.doOnAttach {
|
||||
(activity as? MainActivity)?.binding?.tabs?.setScrollPosition(binding.libraryPager.currentItem, 0f, true)
|
||||
view.post {
|
||||
if (isAttached) {
|
||||
(activity as? MainActivity)?.binding?.tabs?.setScrollPosition(binding.libraryPager.currentItem, 0f, true)
|
||||
}
|
||||
}
|
||||
|
||||
// Send the manga map to child fragments after the adapter is updated.
|
||||
|
|
|
|||
Loading…
Reference in a new issue