|
@@ -10,7 +10,6 @@ import com.reactnativenavigation.anim.BottomTabsAnimator;
|
10
|
10
|
import com.reactnativenavigation.parse.AnimationsOptions;
|
11
|
11
|
import com.reactnativenavigation.parse.BottomTabsOptions;
|
12
|
12
|
import com.reactnativenavigation.parse.Options;
|
13
|
|
-import com.reactnativenavigation.utils.UiUtils;
|
14
|
13
|
import com.reactnativenavigation.viewcontrollers.ViewController;
|
15
|
14
|
import com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabFinder;
|
16
|
15
|
import com.reactnativenavigation.viewcontrollers.bottomtabs.TabSelector;
|
|
@@ -19,6 +18,8 @@ import com.reactnativenavigation.views.Component;
|
19
|
18
|
|
20
|
19
|
import java.util.List;
|
21
|
20
|
|
|
21
|
+import static com.reactnativenavigation.utils.ViewUtils.getHeight;
|
|
22
|
+
|
22
|
23
|
public class BottomTabsPresenter {
|
23
|
24
|
private final BottomTabFinder bottomTabFinder;
|
24
|
25
|
private final List<ViewController> tabs;
|
|
@@ -111,13 +112,8 @@ public class BottomTabsPresenter {
|
111
|
112
|
MarginLayoutParams lp = (MarginLayoutParams) tab.getLayoutParams();
|
112
|
113
|
if (options.drawBehind.isTrue()) {
|
113
|
114
|
lp.bottomMargin = 0;
|
114
|
|
- }
|
115
|
|
- if (options.visible.isTrueOrUndefined() && options.drawBehind.isFalseOrUndefined()) {
|
116
|
|
- if (bottomTabs.getHeight() == 0) {
|
117
|
|
- UiUtils.runOnPreDrawOnce(bottomTabs, () -> lp.bottomMargin = bottomTabs.getHeight());
|
118
|
|
- } else {
|
119
|
|
- lp.bottomMargin = bottomTabs.getHeight();
|
120
|
|
- }
|
|
115
|
+ } else if (options.visible.isTrueOrUndefined()) {
|
|
116
|
+ lp.bottomMargin = getHeight(bottomTabs);
|
121
|
117
|
}
|
122
|
118
|
}
|
123
|
119
|
|
|
@@ -126,13 +122,8 @@ public class BottomTabsPresenter {
|
126
|
122
|
MarginLayoutParams lp = (MarginLayoutParams) tab.getLayoutParams();
|
127
|
123
|
if (options.drawBehind.isTrue()) {
|
128
|
124
|
lp.bottomMargin = 0;
|
129
|
|
- }
|
130
|
|
- if (options.visible.isTrue() && options.drawBehind.isFalse()) {
|
131
|
|
- if (bottomTabs.getHeight() == 0) {
|
132
|
|
- UiUtils.runOnPreDrawOnce(bottomTabs, () -> lp.bottomMargin = bottomTabs.getHeight());
|
133
|
|
- } else {
|
134
|
|
- lp.bottomMargin = bottomTabs.getHeight();
|
135
|
|
- }
|
|
125
|
+ } else if (options.visible.isTrue() && options.drawBehind.isFalse()) {
|
|
126
|
+ lp.bottomMargin = getHeight(bottomTabs);
|
136
|
127
|
}
|
137
|
128
|
}
|
138
|
129
|
|