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
 
13
 
14
     @Override
14
     @Override
15
     public int getMeasuredHeight(int heightMeasureSpec) {
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
     private boolean hasChildren() {
23
     private boolean hasChildren() {