Browse Source

Use hardcoded BottomTabs height in visibility animator constructor (#1353)

Guy Carmeli 7 years ago
parent
commit
1d9b02d4a1

+ 4
- 8
android/app/src/main/java/com/reactnativenavigation/views/BottomTabs.java View File

11
 import com.reactnativenavigation.params.ScreenParams;
11
 import com.reactnativenavigation.params.ScreenParams;
12
 import com.reactnativenavigation.params.StyleParams;
12
 import com.reactnativenavigation.params.StyleParams;
13
 import com.reactnativenavigation.utils.ViewUtils;
13
 import com.reactnativenavigation.utils.ViewUtils;
14
+import com.reactnativenavigation.views.utils.Constants;
14
 
15
 
15
 import java.util.List;
16
 import java.util.List;
16
 
17
 
100
     }
101
     }
101
 
102
 
102
     private void createVisibilityAnimator() {
103
     private void createVisibilityAnimator() {
103
-        ViewUtils.runOnPreDraw(this, new Runnable() {
104
-            @Override
105
-            public void run() {
106
-                visibilityAnimator = new VisibilityAnimator(BottomTabs.this,
107
-                        VisibilityAnimator.HideDirection.Down,
108
-                        getHeight());
109
-            }
110
-        });
104
+        visibilityAnimator = new VisibilityAnimator(BottomTabs.this,
105
+                VisibilityAnimator.HideDirection.Down,
106
+                (int) ViewUtils.convertDpToPixel(Constants.BOTTOM_TABS_HEIGHT));
111
     }
107
     }
112
 
108
 
113
     private void setStyle() {
109
     private void setStyle() {

+ 7
- 0
android/app/src/main/java/com/reactnativenavigation/views/utils/Constants.java View File

1
+package com.reactnativenavigation.views.utils;
2
+
3
+import com.reactnativenavigation.utils.ViewUtils;
4
+
5
+public class Constants {
6
+    public static final int BOTTOM_TABS_HEIGHT = (int) ViewUtils.convertDpToPixel(56);
7
+}