mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix staggered grid jumping slightly when scrolling up
This commit is contained in:
parent
7be308d75d
commit
1e1d6b296b
2 changed files with 2 additions and 6 deletions
|
@ -90,7 +90,8 @@ class LibraryGridHolder(
|
||||||
binding.title.post {
|
binding.title.post {
|
||||||
val hasAuthorInFilter =
|
val hasAuthorInFilter =
|
||||||
item.filter.isNotBlank() && authorArtist.contains(item.filter, true)
|
item.filter.isNotBlank() && authorArtist.contains(item.filter, true)
|
||||||
binding.subtitle.isVisible = (binding.title.lineCount <= 1 || hasAuthorInFilter) && authorArtist.isNotBlank()
|
binding.subtitle.isVisible =
|
||||||
|
(binding.title.lineCount <= 1 || hasAuthorInFilter) && authorArtist.isNotBlank()
|
||||||
binding.title.maxLines = if (hasAuthorInFilter) 1 else 2
|
binding.title.maxLines = if (hasAuthorInFilter) 1 else 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,11 +97,6 @@ class LibraryItem(
|
||||||
binding.card.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
binding.card.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||||
bottomMargin = (if (isStaggered) 2 else 6).dpToPx
|
bottomMargin = (if (isStaggered) 2 else 6).dpToPx
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
binding.textLayout.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
||||||
height =
|
|
||||||
if (isStaggered) ViewGroup.LayoutParams.WRAP_CONTENT else 31.spToPx
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
binding.setBGAndFG(libraryLayout)
|
binding.setBGAndFG(libraryLayout)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue