Fix downloads scroll issue at the bottom

Fixes #696
This commit is contained in:
Jays2Kings 2021-03-31 14:06:15 -04:00
parent 48d04e9008
commit f0fb7b3d49
2 changed files with 6 additions and 2 deletions

View File

@ -13,7 +13,6 @@ import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.databinding.DownloadBottomSheetBinding import eu.kanade.tachiyomi.databinding.DownloadBottomSheetBinding
import eu.kanade.tachiyomi.ui.extension.ExtensionDividerItemDecoration import eu.kanade.tachiyomi.ui.extension.ExtensionDividerItemDecoration
import eu.kanade.tachiyomi.ui.recents.RecentsController import eu.kanade.tachiyomi.ui.recents.RecentsController
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
import eu.kanade.tachiyomi.util.view.collapse import eu.kanade.tachiyomi.util.view.collapse
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
import eu.kanade.tachiyomi.util.view.expand import eu.kanade.tachiyomi.util.view.expand
@ -64,7 +63,6 @@ class DownloadBottomSheet @JvmOverloads constructor(
adapter?.fastScroller = binding.fastScroller adapter?.fastScroller = binding.fastScroller
binding.dlRecycler.setHasFixedSize(true) binding.dlRecycler.setHasFixedSize(true)
binding.dlRecycler.addItemDecoration(ExtensionDividerItemDecoration(context)) binding.dlRecycler.addItemDecoration(ExtensionDividerItemDecoration(context))
binding.dlRecycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener)
this.controller = controller this.controller = controller
updateDLTitle() updateDLTitle()

View File

@ -124,12 +124,18 @@ class RecentsController(bundle: Bundle? = null) :
afterInsets = { afterInsets = {
headerHeight = it.systemWindowInsetTop + appBarHeight headerHeight = it.systemWindowInsetTop + appBarHeight
binding.recycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0) binding.recycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0)
binding.downloadBottomSheet.dlRecycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0)
}, },
onBottomNavUpdate = { onBottomNavUpdate = {
setBottomPadding() setBottomPadding()
} }
) )
activityBinding?.bottomNav?.post {
binding.recycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0)
binding.downloadBottomSheet.dlRecycler.updatePaddingRelative(bottom = activityBinding?.bottomNav?.height ?: 0)
}
presenter.onCreate() presenter.onCreate()
if (presenter.recentItems.isNotEmpty()) { if (presenter.recentItems.isNotEmpty()) {
adapter.updateDataSet(presenter.recentItems) adapter.updateDataSet(presenter.recentItems)