|
@@ -35,14 +35,14 @@ public class BottomTabsPresenter {
|
35
|
35
|
this.defaultOptions = defaultOptions;
|
36
|
36
|
}
|
37
|
37
|
|
38
|
|
- public void bindView(BottomTabs bottomTabs, TabSelector tabSelector) {
|
|
38
|
+ public void bindView(BottomTabs bottomTabs, TabSelector tabSelector, BottomTabsAnimator animator) {
|
39
|
39
|
this.bottomTabs = bottomTabs;
|
40
|
40
|
this.tabSelector = tabSelector;
|
41
|
|
- animator = new BottomTabsAnimator(bottomTabs);
|
|
41
|
+ this.animator = animator;
|
42
|
42
|
}
|
43
|
43
|
|
44
|
|
- public void mergeOptions(Options options) {
|
45
|
|
- mergeBottomTabsOptions(options);
|
|
44
|
+ public void mergeOptions(Options options, ViewController view) {
|
|
45
|
+ mergeBottomTabsOptions(options, view);
|
46
|
46
|
}
|
47
|
47
|
|
48
|
48
|
public void applyOptions(Options options) {
|
|
@@ -58,12 +58,12 @@ public class BottomTabsPresenter {
|
58
|
58
|
}
|
59
|
59
|
|
60
|
60
|
public void mergeChildOptions(Options options, ViewController child) {
|
61
|
|
- mergeBottomTabsOptions(options);
|
|
61
|
+ mergeBottomTabsOptions(options, child);
|
62
|
62
|
int tabIndex = bottomTabFinder.findByControllerId(child.getId());
|
63
|
63
|
if (tabIndex >= 0) mergeDrawBehind(tabIndex);
|
64
|
64
|
}
|
65
|
65
|
|
66
|
|
- private void mergeBottomTabsOptions(Options options) {
|
|
66
|
+ private void mergeBottomTabsOptions(Options options, ViewController view) {
|
67
|
67
|
BottomTabsOptions bottomTabsOptions = options.bottomTabsOptions;
|
68
|
68
|
AnimationsOptions animations = options.animations;
|
69
|
69
|
|
|
@@ -86,18 +86,20 @@ public class BottomTabsPresenter {
|
86
|
86
|
int tabIndex = bottomTabFinder.findByControllerId(bottomTabsOptions.currentTabId.get());
|
87
|
87
|
if (tabIndex >= 0) tabSelector.selectTab(tabIndex);
|
88
|
88
|
}
|
89
|
|
- if (bottomTabsOptions.visible.isTrue()) {
|
90
|
|
- if (bottomTabsOptions.animate.isTrueOrUndefined()) {
|
91
|
|
- animator.show(animations);
|
92
|
|
- } else {
|
93
|
|
- bottomTabs.restoreBottomNavigation(false);
|
|
89
|
+ if (view.isViewShown()) {
|
|
90
|
+ if (bottomTabsOptions.visible.isTrue()) {
|
|
91
|
+ if (bottomTabsOptions.animate.isTrueOrUndefined()) {
|
|
92
|
+ animator.show(animations);
|
|
93
|
+ } else {
|
|
94
|
+ bottomTabs.restoreBottomNavigation(false);
|
|
95
|
+ }
|
94
|
96
|
}
|
95
|
|
- }
|
96
|
|
- if (bottomTabsOptions.visible.isFalse()) {
|
97
|
|
- if (bottomTabsOptions.animate.isTrueOrUndefined()) {
|
98
|
|
- animator.hide(animations);
|
99
|
|
- } else {
|
100
|
|
- bottomTabs.hideBottomNavigation(false);
|
|
97
|
+ if (bottomTabsOptions.visible.isFalse()) {
|
|
98
|
+ if (bottomTabsOptions.animate.isTrueOrUndefined()) {
|
|
99
|
+ animator.hide(animations);
|
|
100
|
+ } else {
|
|
101
|
+ bottomTabs.hideBottomNavigation(false);
|
|
102
|
+ }
|
101
|
103
|
}
|
102
|
104
|
}
|
103
|
105
|
}
|