|
@@ -47,14 +47,15 @@ public class StackOptionsPresenter {
|
47
|
47
|
}
|
48
|
48
|
|
49
|
49
|
public void applyLayoutParamsOptions(Options options, View view) {
|
50
|
|
- Options withDefaultOptions = options.copy().withDefaultOptions(defaultOptions);
|
|
50
|
+ Options withDefault = options.copy().withDefaultOptions(defaultOptions);
|
51
|
51
|
if (view instanceof Component) {
|
52
|
|
- if (withDefaultOptions.topBar.drawBehind.isTrue() && !withDefaultOptions.layout.topMargin.hasValue()) {
|
|
52
|
+ if (withDefault.topBar.drawBehind.isTrue() && !withDefault.layout.topMargin.hasValue()) {
|
53
|
53
|
((Component) view).drawBehindTopBar();
|
54
|
54
|
} else if (options.topBar.drawBehind.isFalseOrUndefined()) {
|
55
|
55
|
((Component) view).drawBelowTopBar(topBar);
|
56
|
56
|
}
|
57
|
57
|
}
|
|
58
|
+ applyTopBarVisibility(withDefault.topBar, withDefault.animations, options);
|
58
|
59
|
}
|
59
|
60
|
|
60
|
61
|
public void applyChildOptions(Options options, Component child) {
|
|
@@ -95,7 +96,22 @@ public class StackOptionsPresenter {
|
95
|
96
|
topBar.setBackgroundColor(options.background.color.get(Color.WHITE));
|
96
|
97
|
topBar.setBackgroundComponent(options.background.component);
|
97
|
98
|
if (options.testId.hasValue()) topBar.setTestId(options.testId.get());
|
|
99
|
+ applyTopBarVisibility(options, animationOptions, componentOptions);
|
|
100
|
+ if (options.drawBehind.isTrue() && !componentOptions.layout.topMargin.hasValue()) {
|
|
101
|
+ component.drawBehindTopBar();
|
|
102
|
+ } else if (options.drawBehind.isFalseOrUndefined()) {
|
|
103
|
+ component.drawBelowTopBar(topBar);
|
|
104
|
+ }
|
|
105
|
+ if (options.hideOnScroll.isTrue()) {
|
|
106
|
+ if (component instanceof IReactView) {
|
|
107
|
+ topBar.enableCollapse(((IReactView) component).getScrollEventListener());
|
|
108
|
+ }
|
|
109
|
+ } else if (options.hideOnScroll.isFalseOrUndefined()) {
|
|
110
|
+ topBar.disableCollapse();
|
|
111
|
+ }
|
|
112
|
+ }
|
98
|
113
|
|
|
114
|
+ private void applyTopBarVisibility(TopBarOptions options, AnimationsOptions animationOptions, Options componentOptions) {
|
99
|
115
|
if (options.visible.isFalse()) {
|
100
|
116
|
if (options.animate.isTrueOrUndefined() && componentOptions.animations.push.enable.isTrueOrUndefined()) {
|
101
|
117
|
topBar.hideAnimate(animationOptions.pop.topBar);
|
|
@@ -110,18 +126,6 @@ public class StackOptionsPresenter {
|
110
|
126
|
topBar.show();
|
111
|
127
|
}
|
112
|
128
|
}
|
113
|
|
- if (options.drawBehind.isTrue() && !componentOptions.layout.topMargin.hasValue()) {
|
114
|
|
- component.drawBehindTopBar();
|
115
|
|
- } else if (options.drawBehind.isFalseOrUndefined()) {
|
116
|
|
- component.drawBelowTopBar(topBar);
|
117
|
|
- }
|
118
|
|
- if (options.hideOnScroll.isTrue()) {
|
119
|
|
- if (component instanceof IReactView) {
|
120
|
|
- topBar.enableCollapse(((IReactView) component).getScrollEventListener());
|
121
|
|
- }
|
122
|
|
- } else if (options.hideOnScroll.isFalseOrUndefined()) {
|
123
|
|
- topBar.disableCollapse();
|
124
|
|
- }
|
125
|
129
|
}
|
126
|
130
|
|
127
|
131
|
private void applyButtons(TopBarButtons buttons) {
|