mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Constrain freeform gird height to some degree
in case theres some insanely tall title out there
This commit is contained in:
parent
679303fce3
commit
67a0a64809
1 changed files with 3 additions and 1 deletions
|
@ -167,7 +167,7 @@ fun MangaGridItemBinding.setFreeformCoverRatio(manga: Manga?, parent: AutofitRec
|
|||
val itemWidth = parent?.itemWidth ?: root.width
|
||||
if (ratio != null) {
|
||||
coverThumbnail.adjustViewBounds = false
|
||||
coverThumbnail.maxHeight = Int.MAX_VALUE
|
||||
coverThumbnail.maxHeight = (itemWidth / 3f * 10f).toInt()
|
||||
coverThumbnail.minimumHeight = 56.dpToPx
|
||||
constraintLayout.minHeight = 56.dpToPx
|
||||
} else {
|
||||
|
@ -181,6 +181,8 @@ fun MangaGridItemBinding.setFreeformCoverRatio(manga: Manga?, parent: AutofitRec
|
|||
coverThumbnail.updateLayoutParams<ConstraintLayout.LayoutParams> {
|
||||
if (ratio != null) {
|
||||
height = ConstraintLayout.LayoutParams.MATCH_CONSTRAINT
|
||||
matchConstraintMaxHeight = coverThumbnail.maxHeight
|
||||
matchConstraintMinHeight = coverThumbnail.minimumHeight
|
||||
dimensionRatio = "W,1:$ratio"
|
||||
} else {
|
||||
height = ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue