Using with for recycler in library

This commit is contained in:
Jays2Kings 2021-04-19 16:11:39 -04:00
parent d45d3014f4
commit d731027b2e

View File

@ -784,23 +784,27 @@ class LibraryController(
}
private fun setRecyclerLayout() {
binding.libraryGridRecycler.recycler.post {
binding.libraryGridRecycler.recycler.updatePaddingRelative(bottom = 50.dpToPx + (activityBinding?.bottomNav?.height ?: 0))
with(binding.libraryGridRecycler.recycler) {
post {
updatePaddingRelative(
bottom = 50.dpToPx + (activityBinding?.bottomNav?.height ?: 0)
)
}
if (libraryLayout == 0) {
binding.libraryGridRecycler.recycler.spanCount = 1
binding.libraryGridRecycler.recycler.updatePaddingRelative(
spanCount = 1
updatePaddingRelative(
start = 0,
end = 0
)
} else {
binding.libraryGridRecycler.recycler.setGridSize(preferences)
binding.libraryGridRecycler.recycler.updatePaddingRelative(
setGridSize(preferences)
updatePaddingRelative(
start = 5.dpToPx,
end = 5.dpToPx
)
}
}
}
private fun setPreferenceFlows() {
listOf(