Преглед на файлове

Fix for WrapContentViewPager should apply max child height to children to correctly support scrolling. Resolves #1692. (#1710)

Dmitriy Krivoruchko преди 6 години
родител
ревизия
b53e544bfa
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      color/src/main/java/com/afollestad/materialdialogs/color/view/WrapContentViewPager.kt

+ 3 - 0
color/src/main/java/com/afollestad/materialdialogs/color/view/WrapContentViewPager.kt

@@ -45,6 +45,9 @@ internal class WrapContentViewPager(
       if (h > maxChildHeight) maxChildHeight = h
     }
 
+    val maxAllowedHeightFromParent = MeasureSpec.getSize(heightMeasureSpec)
+    if (maxChildHeight > maxAllowedHeightFromParent) maxChildHeight = maxAllowedHeightFromParent
+
     if (maxChildHeight != 0) {
       newHeightSpec = makeMeasureSpec(maxChildHeight, EXACTLY)