mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 18:51:51 +01:00
Using with for recycler in library
This commit is contained in:
parent
d45d3014f4
commit
d731027b2e
@ -784,21 +784,25 @@ class LibraryController(
|
||||
}
|
||||
|
||||
private fun setRecyclerLayout() {
|
||||
binding.libraryGridRecycler.recycler.post {
|
||||
binding.libraryGridRecycler.recycler.updatePaddingRelative(bottom = 50.dpToPx + (activityBinding?.bottomNav?.height ?: 0))
|
||||
}
|
||||
if (libraryLayout == 0) {
|
||||
binding.libraryGridRecycler.recycler.spanCount = 1
|
||||
binding.libraryGridRecycler.recycler.updatePaddingRelative(
|
||||
start = 0,
|
||||
end = 0
|
||||
)
|
||||
} else {
|
||||
binding.libraryGridRecycler.recycler.setGridSize(preferences)
|
||||
binding.libraryGridRecycler.recycler.updatePaddingRelative(
|
||||
start = 5.dpToPx,
|
||||
end = 5.dpToPx
|
||||
)
|
||||
with(binding.libraryGridRecycler.recycler) {
|
||||
post {
|
||||
updatePaddingRelative(
|
||||
bottom = 50.dpToPx + (activityBinding?.bottomNav?.height ?: 0)
|
||||
)
|
||||
}
|
||||
if (libraryLayout == 0) {
|
||||
spanCount = 1
|
||||
updatePaddingRelative(
|
||||
start = 0,
|
||||
end = 0
|
||||
)
|
||||
} else {
|
||||
setGridSize(preferences)
|
||||
updatePaddingRelative(
|
||||
start = 5.dpToPx,
|
||||
end = 5.dpToPx
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user