Browse Source

react view measurment fixes (#782)

Guy Carmeli 7 years ago
parent
commit
1d7beaae88

+ 5
- 1
android/app/src/main/java/com/reactnativenavigation/views/collapsingToolbar/CollapsingReactHeaderMeasurer.java View File

@@ -13,7 +13,11 @@ class CollapsingReactHeaderMeasurer extends ViewMeasurer {
13 13
 
14 14
     @Override
15 15
     public int getMeasuredHeight(int heightMeasureSpec) {
16
-        return hasChildren() ? header.getChildAt(0).getMeasuredHeight() : super.getMeasuredHeight(heightMeasureSpec);
16
+        return hasChildren() ? getFirstChildHeightAndTopMargin() : super.getMeasuredHeight(heightMeasureSpec);
17
+    }
18
+
19
+    private int getFirstChildHeightAndTopMargin() {
20
+        return header.getChildAt(0).getHeight() + header.getChildAt(0).getTop();
17 21
     }
18 22
 
19 23
     private boolean hasChildren() {