Browse Source

Remove animated option

Each animation (push, pop etc) can be enabled or disabled separately
Guy Carmeli 6 years ago
parent
commit
5e1d315b61
17 changed files with 158 additions and 161 deletions
  1. 6
    0
      lib/android/app/src/main/java/com/reactnativenavigation/parse/NestedAnimationsOptions.java
  2. 14
    26
      lib/android/app/src/main/java/com/reactnativenavigation/parse/Options.java
  3. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsOptionsPresenter.java
  4. 11
    12
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java
  5. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java
  6. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java
  7. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/Modal.java
  8. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/views/StackLayout.java
  9. 9
    0
      lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java
  10. 22
    22
      lib/android/app/src/test/java/com/reactnativenavigation/parse/OptionsTest.java
  11. 2
    5
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/FloatingActionButtonTest.java
  12. 6
    8
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java
  13. 19
    19
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
  14. 11
    11
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsMergingTest.java
  15. 5
    5
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ParentControllerTest.java
  16. 37
    37
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackControllerTest.java
  17. 6
    6
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/parse/NestedAnimationsOptions.java View File

1
 package com.reactnativenavigation.parse;
1
 package com.reactnativenavigation.parse;
2
 
2
 
3
 
3
 
4
+import com.reactnativenavigation.parse.params.Bool;
5
+import com.reactnativenavigation.parse.params.NullBool;
6
+
4
 import org.json.JSONObject;
7
 import org.json.JSONObject;
5
 
8
 
6
 public class NestedAnimationsOptions {
9
 public class NestedAnimationsOptions {
15
         return options;
18
         return options;
16
     }
19
     }
17
 
20
 
21
+    public Bool enabled = new NullBool();
18
     public AnimationOptions content = new AnimationOptions();
22
     public AnimationOptions content = new AnimationOptions();
19
     public AnimationOptions bottomTabs = new AnimationOptions();
23
     public AnimationOptions bottomTabs = new AnimationOptions();
20
     public AnimationOptions topBar = new AnimationOptions();
24
     public AnimationOptions topBar = new AnimationOptions();
23
         topBar.mergeWith(other.topBar);
27
         topBar.mergeWith(other.topBar);
24
         content.mergeWith(other.content);
28
         content.mergeWith(other.content);
25
         bottomTabs.mergeWith(other.bottomTabs);
29
         bottomTabs.mergeWith(other.bottomTabs);
30
+        if (other.enabled.hasValue()) enabled = other.enabled;
26
     }
31
     }
27
 
32
 
28
     void mergeWithDefault(NestedAnimationsOptions defaultOptions) {
33
     void mergeWithDefault(NestedAnimationsOptions defaultOptions) {
29
         content.mergeWithDefault(defaultOptions.content);
34
         content.mergeWithDefault(defaultOptions.content);
30
         bottomTabs.mergeWithDefault(defaultOptions.bottomTabs);
35
         bottomTabs.mergeWithDefault(defaultOptions.bottomTabs);
31
         topBar.mergeWithDefault(defaultOptions.topBar);
36
         topBar.mergeWithDefault(defaultOptions.topBar);
37
+        if (!enabled.hasValue()) enabled = defaultOptions.enabled;
32
     }
38
     }
33
 
39
 
34
     public boolean hasValue() {
40
     public boolean hasValue() {

+ 14
- 26
lib/android/app/src/main/java/com/reactnativenavigation/parse/Options.java View File

3
 import android.support.annotation.CheckResult;
3
 import android.support.annotation.CheckResult;
4
 import android.support.annotation.NonNull;
4
 import android.support.annotation.NonNull;
5
 
5
 
6
-import com.reactnativenavigation.parse.params.Bool;
7
 import com.reactnativenavigation.parse.params.Color;
6
 import com.reactnativenavigation.parse.params.Color;
8
-import com.reactnativenavigation.parse.params.NullBool;
9
 import com.reactnativenavigation.parse.params.NullColor;
7
 import com.reactnativenavigation.parse.params.NullColor;
10
-import com.reactnativenavigation.parse.parsers.BoolParser;
11
 import com.reactnativenavigation.parse.parsers.ColorParser;
8
 import com.reactnativenavigation.parse.parsers.ColorParser;
12
 import com.reactnativenavigation.utils.TypefaceLoader;
9
 import com.reactnativenavigation.utils.TypefaceLoader;
13
 
10
 
26
         if (json == null) return result.withDefaultOptions(defaultOptions);
23
         if (json == null) return result.withDefaultOptions(defaultOptions);
27
 
24
 
28
         result.orientationOptions = OrientationOptions.parse(json);
25
         result.orientationOptions = OrientationOptions.parse(json);
29
-        result.topBarOptions = TopBarOptions.parse(typefaceManager, json.optJSONObject("topBar"));
26
+        result.topBar = TopBarOptions.parse(typefaceManager, json.optJSONObject("topBar"));
30
         result.topTabsOptions = TopTabsOptions.parse(json.optJSONObject("topTabs"));
27
         result.topTabsOptions = TopTabsOptions.parse(json.optJSONObject("topTabs"));
31
         result.topTabOptions = TopTabOptions.parse(typefaceManager, json.optJSONObject("topTab"));
28
         result.topTabOptions = TopTabOptions.parse(typefaceManager, json.optJSONObject("topTab"));
32
         result.bottomTabOptions = BottomTabOptions.parse(json.optJSONObject("bottomTab"));
29
         result.bottomTabOptions = BottomTabOptions.parse(json.optJSONObject("bottomTab"));
34
         result.overlayOptions = OverlayOptions.parse(json.optJSONObject("overlay"));
31
         result.overlayOptions = OverlayOptions.parse(json.optJSONObject("overlay"));
35
         result.fabOptions = FabOptions.parse(json.optJSONObject("fab"));
32
         result.fabOptions = FabOptions.parse(json.optJSONObject("fab"));
36
         result.sideMenuRootOptions = SideMenuRootOptions.parse(json.optJSONObject("sideMenu"));
33
         result.sideMenuRootOptions = SideMenuRootOptions.parse(json.optJSONObject("sideMenu"));
37
-        result.animationsOptions = AnimationsOptions.parse(json.optJSONObject("animations"));
38
-        result.animated = BoolParser.parse(json, "animated");
34
+        result.animations = AnimationsOptions.parse(json.optJSONObject("animations"));
39
         result.screenBackgroundColor = ColorParser.parse(json, "screenBackgroundColor");
35
         result.screenBackgroundColor = ColorParser.parse(json, "screenBackgroundColor");
40
 
36
 
41
         return result.withDefaultOptions(defaultOptions);
37
         return result.withDefaultOptions(defaultOptions);
42
     }
38
     }
43
 
39
 
44
     @NonNull public OrientationOptions orientationOptions = new OrientationOptions();
40
     @NonNull public OrientationOptions orientationOptions = new OrientationOptions();
45
-    @NonNull public TopBarOptions topBarOptions = new TopBarOptions();
41
+    @NonNull public TopBarOptions topBar = new TopBarOptions();
46
     @NonNull public TopTabsOptions topTabsOptions = new TopTabsOptions();
42
     @NonNull public TopTabsOptions topTabsOptions = new TopTabsOptions();
47
     @NonNull public TopTabOptions topTabOptions = new TopTabOptions();
43
     @NonNull public TopTabOptions topTabOptions = new TopTabOptions();
48
     @NonNull public BottomTabOptions bottomTabOptions = new BottomTabOptions();
44
     @NonNull public BottomTabOptions bottomTabOptions = new BottomTabOptions();
49
     @NonNull public BottomTabsOptions bottomTabsOptions = new BottomTabsOptions();
45
     @NonNull public BottomTabsOptions bottomTabsOptions = new BottomTabsOptions();
50
     @NonNull public OverlayOptions overlayOptions = new OverlayOptions();
46
     @NonNull public OverlayOptions overlayOptions = new OverlayOptions();
51
     @NonNull public FabOptions fabOptions = new FabOptions();
47
     @NonNull public FabOptions fabOptions = new FabOptions();
52
-    @NonNull public AnimationsOptions animationsOptions = new AnimationsOptions();
48
+    @NonNull public AnimationsOptions animations = new AnimationsOptions();
53
     @NonNull public SideMenuRootOptions sideMenuRootOptions = new SideMenuRootOptions();
49
     @NonNull public SideMenuRootOptions sideMenuRootOptions = new SideMenuRootOptions();
54
-    @NonNull public Bool animated = new NullBool();
55
     @NonNull public Color screenBackgroundColor = new NullColor();
50
     @NonNull public Color screenBackgroundColor = new NullColor();
56
 
51
 
57
     void setTopTabIndex(int i) {
52
     void setTopTabIndex(int i) {
62
     public Options copy() {
57
     public Options copy() {
63
         Options result = new Options();
58
         Options result = new Options();
64
         result.orientationOptions.mergeWith(orientationOptions);
59
         result.orientationOptions.mergeWith(orientationOptions);
65
-        result.topBarOptions.mergeWith(topBarOptions);
60
+        result.topBar.mergeWith(topBar);
66
         result.topTabsOptions.mergeWith(topTabsOptions);
61
         result.topTabsOptions.mergeWith(topTabsOptions);
67
         result.topTabOptions.mergeWith(topTabOptions);
62
         result.topTabOptions.mergeWith(topTabOptions);
68
         result.bottomTabOptions.mergeWith(bottomTabOptions);
63
         result.bottomTabOptions.mergeWith(bottomTabOptions);
70
         result.overlayOptions = overlayOptions;
65
         result.overlayOptions = overlayOptions;
71
         result.fabOptions.mergeWith(fabOptions);
66
         result.fabOptions.mergeWith(fabOptions);
72
         result.sideMenuRootOptions.mergeWith(sideMenuRootOptions);
67
         result.sideMenuRootOptions.mergeWith(sideMenuRootOptions);
73
-        result.animationsOptions.mergeWith(animationsOptions);
74
-        result.animated = animated;
68
+        result.animations.mergeWith(animations);
75
         result.screenBackgroundColor = screenBackgroundColor;
69
         result.screenBackgroundColor = screenBackgroundColor;
76
         return result;
70
         return result;
77
     }
71
     }
80
 	public Options mergeWith(final Options other) {
74
 	public Options mergeWith(final Options other) {
81
         Options result = copy();
75
         Options result = copy();
82
         result.orientationOptions.mergeWith(other.orientationOptions);
76
         result.orientationOptions.mergeWith(other.orientationOptions);
83
-        result.topBarOptions.mergeWith(other.topBarOptions);
77
+        result.topBar.mergeWith(other.topBar);
84
         result.topTabsOptions.mergeWith(other.topTabsOptions);
78
         result.topTabsOptions.mergeWith(other.topTabsOptions);
85
         result.topTabOptions.mergeWith(other.topTabOptions);
79
         result.topTabOptions.mergeWith(other.topTabOptions);
86
         result.bottomTabOptions.mergeWith(other.bottomTabOptions);
80
         result.bottomTabOptions.mergeWith(other.bottomTabOptions);
87
         result.bottomTabsOptions.mergeWith(other.bottomTabsOptions);
81
         result.bottomTabsOptions.mergeWith(other.bottomTabsOptions);
88
         result.fabOptions.mergeWith(other.fabOptions);
82
         result.fabOptions.mergeWith(other.fabOptions);
89
-        result.animationsOptions.mergeWith(other.animationsOptions);
83
+        result.animations.mergeWith(other.animations);
90
         result.sideMenuRootOptions.mergeWith(other.sideMenuRootOptions);
84
         result.sideMenuRootOptions.mergeWith(other.sideMenuRootOptions);
91
-        if (other.animated.hasValue()) result.animated = other.animated;
92
-        if (other.screenBackgroundColor.hasValue()) {
93
-            result.screenBackgroundColor = other.screenBackgroundColor;
94
-        }
85
+        if (other.screenBackgroundColor.hasValue()) result.screenBackgroundColor = other.screenBackgroundColor;
95
         return result;
86
         return result;
96
     }
87
     }
97
 
88
 
98
     Options withDefaultOptions(final Options defaultOptions) {
89
     Options withDefaultOptions(final Options defaultOptions) {
99
         orientationOptions.mergeWithDefault(defaultOptions.orientationOptions);
90
         orientationOptions.mergeWithDefault(defaultOptions.orientationOptions);
100
-        topBarOptions.mergeWithDefault(defaultOptions.topBarOptions);
91
+        topBar.mergeWithDefault(defaultOptions.topBar);
101
         topTabOptions.mergeWithDefault(defaultOptions.topTabOptions);
92
         topTabOptions.mergeWithDefault(defaultOptions.topTabOptions);
102
         topTabsOptions.mergeWithDefault(defaultOptions.topTabsOptions);
93
         topTabsOptions.mergeWithDefault(defaultOptions.topTabsOptions);
103
         bottomTabOptions.mergeWithDefault(defaultOptions.bottomTabOptions);
94
         bottomTabOptions.mergeWithDefault(defaultOptions.bottomTabOptions);
104
         bottomTabsOptions.mergeWithDefault(defaultOptions.bottomTabsOptions);
95
         bottomTabsOptions.mergeWithDefault(defaultOptions.bottomTabsOptions);
105
         fabOptions.mergeWithDefault(defaultOptions.fabOptions);
96
         fabOptions.mergeWithDefault(defaultOptions.fabOptions);
106
-        animationsOptions.mergeWithDefault(defaultOptions.animationsOptions);
97
+        animations.mergeWithDefault(defaultOptions.animations);
107
         sideMenuRootOptions.mergeWithDefault(defaultOptions.sideMenuRootOptions);
98
         sideMenuRootOptions.mergeWithDefault(defaultOptions.sideMenuRootOptions);
108
-        if (!animated.hasValue()) animated = defaultOptions.animated;
109
-        if (!screenBackgroundColor.hasValue()) {
110
-            screenBackgroundColor = defaultOptions.screenBackgroundColor;
111
-        }
99
+        if (!screenBackgroundColor.hasValue()) screenBackgroundColor = defaultOptions.screenBackgroundColor;
112
         return this;
100
         return this;
113
     }
101
     }
114
 
102
 
115
     public Options clearTopBarOptions() {
103
     public Options clearTopBarOptions() {
116
-        topBarOptions = new TopBarOptions();
104
+        topBar = new TopBarOptions();
117
         return this;
105
         return this;
118
     }
106
     }
119
 
107
 
143
     }
131
     }
144
 
132
 
145
     public Options clearAnimationOptions() {
133
     public Options clearAnimationOptions() {
146
-        animationsOptions = new AnimationsOptions();
134
+        animations = new AnimationsOptions();
147
         return this;
135
         return this;
148
     }
136
     }
149
 
137
 

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsOptionsPresenter.java View File

20
     }
20
     }
21
 
21
 
22
     public void present(Options options) {
22
     public void present(Options options) {
23
-        applyBottomTabsOptions(options.bottomTabsOptions, options.animationsOptions);
23
+        applyBottomTabsOptions(options.bottomTabsOptions, options.animations);
24
     }
24
     }
25
 
25
 
26
     public void present(Options options, int tabIndex) {
26
     public void present(Options options, int tabIndex) {

+ 11
- 12
lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java View File

9
 import com.reactnativenavigation.parse.TopBarOptions;
9
 import com.reactnativenavigation.parse.TopBarOptions;
10
 import com.reactnativenavigation.parse.TopTabOptions;
10
 import com.reactnativenavigation.parse.TopTabOptions;
11
 import com.reactnativenavigation.parse.TopTabsOptions;
11
 import com.reactnativenavigation.parse.TopTabsOptions;
12
-import com.reactnativenavigation.parse.params.Bool;
13
 import com.reactnativenavigation.parse.params.Button;
12
 import com.reactnativenavigation.parse.params.Button;
14
 import com.reactnativenavigation.utils.UiUtils;
13
 import com.reactnativenavigation.utils.UiUtils;
15
 import com.reactnativenavigation.viewcontrollers.IReactView;
14
 import com.reactnativenavigation.viewcontrollers.IReactView;
34
 
33
 
35
     public void applyChildOptions(Options options, Component child) {
34
     public void applyChildOptions(Options options, Component child) {
36
         applyOrientation(options.orientationOptions);
35
         applyOrientation(options.orientationOptions);
37
-        applyButtons(options.topBarOptions.leftButtons, options.topBarOptions.rightButtons);
38
-        applyTopBarOptions(options.topBarOptions, options.animationsOptions, child, options.animated);
36
+        applyButtons(options.topBar.leftButtons, options.topBar.rightButtons);
37
+        applyTopBarOptions(options.topBar, options.animations, child, options);
39
         applyTopTabsOptions(options.topTabsOptions);
38
         applyTopTabsOptions(options.topTabsOptions);
40
         applyTopTabOptions(options.topTabOptions);
39
         applyTopTabOptions(options.topTabOptions);
41
     }
40
     }
44
         ((Activity) topBar.getContext()).setRequestedOrientation(options.getValue());
43
         ((Activity) topBar.getContext()).setRequestedOrientation(options.getValue());
45
     }
44
     }
46
 
45
 
47
-    private void applyTopBarOptions(TopBarOptions options, AnimationsOptions animationOptions, Component component, Bool animated) {
46
+    private void applyTopBarOptions(TopBarOptions options, AnimationsOptions animationOptions, Component component, Options componentOptions) {
48
         topBar.setTitle(options.title.text.get(""));
47
         topBar.setTitle(options.title.text.get(""));
49
         if (options.title.component.hasValue()) topBar.setTitleComponent(options.title.component);
48
         if (options.title.component.hasValue()) topBar.setTitleComponent(options.title.component);
50
         topBar.setTitleFontSize(options.title.fontSize.get(defaultTitleFontSize));
49
         topBar.setTitleFontSize(options.title.fontSize.get(defaultTitleFontSize));
63
         if (options.testId.hasValue()) topBar.setTestId(options.testId.get());
62
         if (options.testId.hasValue()) topBar.setTestId(options.testId.get());
64
 
63
 
65
         if (options.visible.isFalse()) {
64
         if (options.visible.isFalse()) {
66
-            if (options.animate.isTrueOrUndefined() && animated.isTrueOrUndefined()) {
65
+            if (options.animate.isTrueOrUndefined() && componentOptions.animations.push.enabled.isTrueOrUndefined()) {
67
                 topBar.hideAnimate(animationOptions.pop.topBar);
66
                 topBar.hideAnimate(animationOptions.pop.topBar);
68
             } else {
67
             } else {
69
                 topBar.hide();
68
                 topBar.hide();
70
             }
69
             }
71
         }
70
         }
72
         if (options.visible.isTrueOrUndefined()) {
71
         if (options.visible.isTrueOrUndefined()) {
73
-            if (options.animate.isTrueOrUndefined() && animated.isTrueOrUndefined()) {
72
+            if (options.animate.isTrueOrUndefined() && componentOptions.animations.push.enabled.isTrueOrUndefined()) {
74
                 topBar.showAnimate(animationOptions.push.topBar);
73
                 topBar.showAnimate(animationOptions.push.topBar);
75
             } else {
74
             } else {
76
                 topBar.show();
75
                 topBar.show();
105
         if (topTabOptions.fontFamily != null) topBar.setTopTabFontFamily(topTabOptions.tabIndex, topTabOptions.fontFamily);
104
         if (topTabOptions.fontFamily != null) topBar.setTopTabFontFamily(topTabOptions.tabIndex, topTabOptions.fontFamily);
106
     }
105
     }
107
 
106
 
108
-    public void onChildWillDisappear(Options disappearing, Options appearing) {
109
-        if (disappearing.topBarOptions.visible.isTrueOrUndefined() && appearing.topBarOptions.visible.isFalse()) {
110
-            if (disappearing.topBarOptions.animate.isTrueOrUndefined() && disappearing.animated.isTrueOrUndefined()) {
111
-                topBar.hideAnimate(disappearing.animationsOptions.pop.topBar);
107
+    public void onChildWillPop(Options disappearing, Options appearing) {
108
+        if (disappearing.topBar.visible.isTrueOrUndefined() && appearing.topBar.visible.isFalse()) {
109
+            if (disappearing.topBar.animate.isTrueOrUndefined() && disappearing.animations.pop.enabled.isTrueOrUndefined()) {
110
+                topBar.hideAnimate(disappearing.animations.pop.topBar);
112
             } else {
111
             } else {
113
                 topBar.hide();
112
                 topBar.hide();
114
             }
113
             }
117
 
116
 
118
     public void mergeChildOptions(Options options, Component child) {
117
     public void mergeChildOptions(Options options, Component child) {
119
         mergeOrientation(options.orientationOptions);
118
         mergeOrientation(options.orientationOptions);
120
-        mergeButtons(options.topBarOptions.leftButtons, options.topBarOptions.rightButtons);
121
-        mergeTopBarOptions(options.topBarOptions, options.animationsOptions, child);
119
+        mergeButtons(options.topBar.leftButtons, options.topBar.rightButtons);
120
+        mergeTopBarOptions(options.topBar, options.animations, child);
122
         mergeTopTabsOptions(options.topTabsOptions);
121
         mergeTopTabsOptions(options.topTabsOptions);
123
         mergeTopTabOptions(options.topTabOptions);
122
         mergeTopTabOptions(options.topTabOptions);
124
     }
123
     }

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java View File

77
         root = viewController;
77
         root = viewController;
78
         View view = viewController.getView();
78
         View view = viewController.getView();
79
 
79
 
80
-        AnimationsOptions animationsOptions = viewController.options.animationsOptions;
80
+        AnimationsOptions animationsOptions = viewController.options.animations;
81
         getView().addView(view);
81
         getView().addView(view);
82
         if (animationsOptions.startApp.hasValue()) {
82
         if (animationsOptions.startApp.hasValue()) {
83
             new NavigationAnimator(viewController.getActivity(), animationsOptions)
83
             new NavigationAnimator(viewController.getActivity(), animationsOptions)

+ 5
- 5
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java View File

58
                         child
58
                         child
59
                 )
59
                 )
60
         );
60
         );
61
-        animator.setOptions(options.animationsOptions);
61
+        animator.setOptions(options.animations);
62
     }
62
     }
63
 
63
 
64
     @Override
64
     @Override
65
     public void mergeChildOptions(Options options, Component child) {
65
     public void mergeChildOptions(Options options, Component child) {
66
         super.mergeChildOptions(options, child);
66
         super.mergeChildOptions(options, child);
67
         getView().mergeChildOptions(options, child);
67
         getView().mergeChildOptions(options, child);
68
-        animator.mergeOptions(options.animationsOptions);
68
+        animator.mergeOptions(options.animations);
69
         if (options.fabOptions.hasValue() && child instanceof ReactComponent) {
69
         if (options.fabOptions.hasValue() && child instanceof ReactComponent) {
70
             fabOptionsPresenter.mergeOptions(options.fabOptions, (ReactComponent) child, getView());
70
             fabOptionsPresenter.mergeOptions(options.fabOptions, (ReactComponent) child, getView());
71
         }
71
         }
96
         getView().addView(child.getView(), MATCH_PARENT, MATCH_PARENT);
96
         getView().addView(child.getView(), MATCH_PARENT, MATCH_PARENT);
97
 
97
 
98
         if (toRemove != null) {
98
         if (toRemove != null) {
99
-            if (child.options.animated.isTrueOrUndefined()) {
99
+            if (child.options.animations.push.enabled.isTrueOrUndefined()) {
100
                 animator.push(child.getView(), () -> {
100
                 animator.push(child.getView(), () -> {
101
                     getView().removeView(toRemove.getView());
101
                     getView().removeView(toRemove.getView());
102
                     listener.onSuccess(child.getId());
102
                     listener.onSuccess(child.getId());
141
         disappearing.onViewWillDisappear();
141
         disappearing.onViewWillDisappear();
142
         appearing.onViewWillAppear();
142
         appearing.onViewWillAppear();
143
         getView().addView(appearing.getView(), 0);
143
         getView().addView(appearing.getView(), 0);
144
-        getView().onChildWillDisappear(disappearing.options, appearing.options);
144
+        getView().onChildWillPop(disappearing.options, appearing.options);
145
 
145
 
146
-        if (disappearing.options.animated.isTrueOrUndefined()) {
146
+        if (disappearing.options.animations.pop.enabled.isTrueOrUndefined()) {
147
             animator.pop(disappearing.getView(), () -> finishPopping(disappearing, listener));
147
             animator.pop(disappearing.getView(), () -> finishPopping(disappearing, listener));
148
         } else {
148
         } else {
149
             finishPopping(disappearing, listener);
149
             finishPopping(disappearing, listener);

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/Modal.java View File

31
         dialog.setOnKeyListener(this);
31
         dialog.setOnKeyListener(this);
32
         dialog.setOnDismissListener(this);
32
         dialog.setOnDismissListener(this);
33
         dialog.setOnShowListener(this);
33
         dialog.setOnShowListener(this);
34
-        animator = new ModalAnimator(viewController.getActivity(), viewController.options.animationsOptions);
34
+        animator = new ModalAnimator(viewController.getActivity(), viewController.options.animations);
35
     }
35
     }
36
 
36
 
37
     public void show() {
37
     public void show() {

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/views/StackLayout.java View File

40
         optionsPresenter.applyChildOptions(options, child);
40
         optionsPresenter.applyChildOptions(options, child);
41
     }
41
     }
42
 
42
 
43
-    public void onChildWillDisappear(Options disappearing, Options appearing) {
44
-        optionsPresenter.onChildWillDisappear(disappearing, appearing);
43
+    public void onChildWillPop(Options disappearing, Options appearing) {
44
+        optionsPresenter.onChildWillPop(disappearing, appearing);
45
     }
45
     }
46
 
46
 
47
     public void mergeChildOptions(Options options, Component child) {
47
     public void mergeChildOptions(Options options, Component child) {

+ 9
- 0
lib/android/app/src/test/java/com/reactnativenavigation/BaseTest.java View File

4
 import android.support.v7.app.*;
4
 import android.support.v7.app.*;
5
 import android.view.*;
5
 import android.view.*;
6
 
6
 
7
+import com.reactnativenavigation.parse.params.Bool;
8
+import com.reactnativenavigation.viewcontrollers.ViewController;
9
+
7
 import org.junit.*;
10
 import org.junit.*;
8
 import org.junit.runner.*;
11
 import org.junit.runner.*;
9
 import org.robolectric.*;
12
 import org.robolectric.*;
41
         assertThat(child.getId()).isNotZero().isPositive();
44
         assertThat(child.getId()).isNotZero().isPositive();
42
         assertThat(parent.findViewById(child.getId())).isNull();
45
         assertThat(parent.findViewById(child.getId())).isNull();
43
     }
46
     }
47
+
48
+    protected void disablePushAnimation(ViewController... controllers) {
49
+        for (ViewController controller : controllers) {
50
+            controller.options.animations.push.enabled = new Bool(false);
51
+        }
52
+    }
44
 }
53
 }

+ 22
- 22
lib/android/app/src/test/java/com/reactnativenavigation/parse/OptionsTest.java View File

77
     }
77
     }
78
 
78
 
79
     private void assertResult(Options result) {
79
     private void assertResult(Options result) {
80
-        assertThat(result.topBarOptions.title.text.get()).isEqualTo(TITLE);
81
-        assertThat(result.topBarOptions.background.color.get()).isEqualTo(TOP_BAR_BACKGROUND_COLOR);
82
-        assertThat(result.topBarOptions.title.color.get()).isEqualTo(TOP_BAR_TEXT_COLOR);
83
-        assertThat(result.topBarOptions.title.fontSize.get()).isEqualTo(TOP_BAR_FONT_SIZE);
84
-        assertThat(result.topBarOptions.title.fontFamily).isEqualTo(TOP_BAR_TYPEFACE);
85
-        assertThat(result.topBarOptions.subtitle.color.get()).isEqualTo(SUBTITLE_TEXT_COLOR);
86
-        assertThat(result.topBarOptions.subtitle.fontSize.get()).isEqualTo(SUBTITLE_FONT_SIZE);
87
-        assertThat(result.topBarOptions.subtitle.alignment).isEqualTo(Alignment.fromString(SUBTITLE_ALIGNMENT));
88
-        assertThat(result.topBarOptions.subtitle.fontFamily).isEqualTo(SUBTITLE_TYPEFACE);
89
-        assertThat(result.topBarOptions.visible.get()).isEqualTo(TOP_BAR_VISIBLE.get());
90
-        assertThat(result.topBarOptions.drawBehind.get()).isEqualTo(TOP_BAR_DRAW_BEHIND.get());
91
-        assertThat(result.topBarOptions.hideOnScroll.get()).isEqualTo(TOP_BAR_HIDE_ON_SCROLL.get());
80
+        assertThat(result.topBar.title.text.get()).isEqualTo(TITLE);
81
+        assertThat(result.topBar.background.color.get()).isEqualTo(TOP_BAR_BACKGROUND_COLOR);
82
+        assertThat(result.topBar.title.color.get()).isEqualTo(TOP_BAR_TEXT_COLOR);
83
+        assertThat(result.topBar.title.fontSize.get()).isEqualTo(TOP_BAR_FONT_SIZE);
84
+        assertThat(result.topBar.title.fontFamily).isEqualTo(TOP_BAR_TYPEFACE);
85
+        assertThat(result.topBar.subtitle.color.get()).isEqualTo(SUBTITLE_TEXT_COLOR);
86
+        assertThat(result.topBar.subtitle.fontSize.get()).isEqualTo(SUBTITLE_FONT_SIZE);
87
+        assertThat(result.topBar.subtitle.alignment).isEqualTo(Alignment.fromString(SUBTITLE_ALIGNMENT));
88
+        assertThat(result.topBar.subtitle.fontFamily).isEqualTo(SUBTITLE_TYPEFACE);
89
+        assertThat(result.topBar.visible.get()).isEqualTo(TOP_BAR_VISIBLE.get());
90
+        assertThat(result.topBar.drawBehind.get()).isEqualTo(TOP_BAR_DRAW_BEHIND.get());
91
+        assertThat(result.topBar.hideOnScroll.get()).isEqualTo(TOP_BAR_HIDE_ON_SCROLL.get());
92
         assertThat(result.bottomTabsOptions.animate.get()).isEqualTo(BOTTOM_TABS_ANIMATE.get());
92
         assertThat(result.bottomTabsOptions.animate.get()).isEqualTo(BOTTOM_TABS_ANIMATE.get());
93
         assertThat(result.bottomTabsOptions.visible.get()).isEqualTo(BOTTOM_TABS_VISIBLE.get());
93
         assertThat(result.bottomTabsOptions.visible.get()).isEqualTo(BOTTOM_TABS_VISIBLE.get());
94
         assertThat(result.bottomTabsOptions.currentTabId.get()).isEqualTo(BOTTOM_TABS_CURRENT_TAB_ID);
94
         assertThat(result.bottomTabsOptions.currentTabId.get()).isEqualTo(BOTTOM_TABS_CURRENT_TAB_ID);
196
         JSONObject json1 = new JSONObject();
196
         JSONObject json1 = new JSONObject();
197
         json1.put("topBar", createTopBar(true));
197
         json1.put("topBar", createTopBar(true));
198
         Options options1 = Options.parse(mockLoader, json1);
198
         Options options1 = Options.parse(mockLoader, json1);
199
-        options1.topBarOptions.title.text = new Text("some title");
199
+        options1.topBar.title.text = new Text("some title");
200
 
200
 
201
         JSONObject json2 = new JSONObject();
201
         JSONObject json2 = new JSONObject();
202
         json2.put("topBar", createTopBar(false));
202
         json2.put("topBar", createTopBar(false));
203
         Options options2 = Options.parse(mockLoader, json2);
203
         Options options2 = Options.parse(mockLoader, json2);
204
-        options2.topBarOptions.title.text = new NullText();
204
+        options2.topBar.title.text = new NullText();
205
 
205
 
206
         Options merged = options1.mergeWith(options2);
206
         Options merged = options1.mergeWith(options2);
207
-        assertThat(options1.topBarOptions.visible.get()).isTrue();
208
-        assertThat(merged.topBarOptions.visible.get()).isFalse();
209
-        assertThat(merged.topBarOptions.title.text.get()).isEqualTo("some title");
207
+        assertThat(options1.topBar.visible.get()).isTrue();
208
+        assertThat(merged.topBar.visible.get()).isFalse();
209
+        assertThat(merged.topBar.title.text.get()).isEqualTo("some title");
210
     }
210
     }
211
 
211
 
212
     @Test
212
     @Test
242
     @Test
242
     @Test
243
     public void defaultEmptyOptions() {
243
     public void defaultEmptyOptions() {
244
         Options uut = new Options();
244
         Options uut = new Options();
245
-        assertThat(uut.topBarOptions.title.text.get("")).isEmpty();
245
+        assertThat(uut.topBar.title.text.get("")).isEmpty();
246
         assertThat(uut.screenBackgroundColor.hasValue()).isFalse();
246
         assertThat(uut.screenBackgroundColor.hasValue()).isFalse();
247
 
247
 
248
     }
248
     }
250
     @Test
250
     @Test
251
     public void topBar_defaultOptions() {
251
     public void topBar_defaultOptions() {
252
         Options uut = new Options();
252
         Options uut = new Options();
253
-        assertThat(uut.topBarOptions.visible.isFalseOrUndefined()).isTrue();
254
-        assertThat(uut.topBarOptions.animate.isTrueOrUndefined()).isTrue();
253
+        assertThat(uut.topBar.visible.isFalseOrUndefined()).isTrue();
254
+        assertThat(uut.topBar.animate.isTrueOrUndefined()).isTrue();
255
     }
255
     }
256
 
256
 
257
     @Test
257
     @Test
258
     public void clear_topBarOptions() {
258
     public void clear_topBarOptions() {
259
         Options uut = new Options();
259
         Options uut = new Options();
260
-        uut.topBarOptions.title.text = new Text("some title");
260
+        uut.topBar.title.text = new Text("some title");
261
         uut.clearTopBarOptions();
261
         uut.clearTopBarOptions();
262
-        assertThat(uut.topBarOptions.title.text.hasValue()).isFalse();
262
+        assertThat(uut.topBar.title.text.hasValue()).isFalse();
263
     }
263
     }
264
 
264
 
265
     @Test
265
     @Test

+ 2
- 5
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/FloatingActionButtonTest.java View File

12
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
12
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
13
 import com.reactnativenavigation.parse.FabOptions;
13
 import com.reactnativenavigation.parse.FabOptions;
14
 import com.reactnativenavigation.parse.Options;
14
 import com.reactnativenavigation.parse.Options;
15
-import com.reactnativenavigation.parse.params.Bool;
16
 import com.reactnativenavigation.parse.params.Text;
15
 import com.reactnativenavigation.parse.params.Text;
17
 import com.reactnativenavigation.utils.CommandListenerAdapter;
16
 import com.reactnativenavigation.utils.CommandListenerAdapter;
18
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarBackgroundViewController;
17
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarBackgroundViewController;
47
     @NonNull
46
     @NonNull
48
     private Options getOptionsWithFab() {
47
     private Options getOptionsWithFab() {
49
         Options options = new Options();
48
         Options options = new Options();
50
-        options.animated = new Bool(false);
51
         FabOptions fabOptions = new FabOptions();
49
         FabOptions fabOptions = new FabOptions();
52
         fabOptions.id = new Text("FAB");
50
         fabOptions.id = new Text("FAB");
53
         options.fabOptions = fabOptions;
51
         options.fabOptions = fabOptions;
100
 
98
 
101
     @Test
99
     @Test
102
     public void hideOnPop() {
100
     public void hideOnPop() {
101
+        disablePushAnimation(childNoFab, childFab);
103
         stackController.push(childNoFab, new CommandListenerAdapter());
102
         stackController.push(childNoFab, new CommandListenerAdapter());
104
         stackController.push(childFab, new CommandListenerAdapter());
103
         stackController.push(childFab, new CommandListenerAdapter());
105
         childFab.onViewAppeared();
104
         childFab.onViewAppeared();
111
 
110
 
112
     @Test
111
     @Test
113
     public void showOnPop() {
112
     public void showOnPop() {
114
-        childFab.options.animated = new Bool(false);
115
-        childNoFab.options.animated = new Bool(false);
116
-
113
+        disablePushAnimation(childFab, childNoFab);
117
         stackController.push(childFab, new CommandListenerAdapter());
114
         stackController.push(childFab, new CommandListenerAdapter());
118
         stackController.push(childNoFab, new CommandListenerAdapter());
115
         stackController.push(childNoFab, new CommandListenerAdapter());
119
         childNoFab.onViewAppeared();
116
         childNoFab.onViewAppeared();

+ 6
- 8
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java View File

213
 
213
 
214
     @Test
214
     @Test
215
     public void setStackRoot() {
215
     public void setStackRoot() {
216
-        child1.options.animated = new Bool(false);
217
-        child2.options.animated = new Bool(false);
218
-        child3.options.animated = new Bool(false);
216
+        disablePushAnimation(child1, child2, child3);
219
 
217
 
220
         StackController stack = newStack();
218
         StackController stack = newStack();
221
         uut.setRoot(stack, new MockPromise());
219
         uut.setRoot(stack, new MockPromise());
248
     public void setOptions_CallsApplyNavigationOptions() {
246
     public void setOptions_CallsApplyNavigationOptions() {
249
         ComponentViewController componentVc = new SimpleComponentViewController(activity, "theId", new Options());
247
         ComponentViewController componentVc = new SimpleComponentViewController(activity, "theId", new Options());
250
         componentVc.setParentController(parentController);
248
         componentVc.setParentController(parentController);
251
-        assertThat(componentVc.options.topBarOptions.title.text.get("")).isEmpty();
249
+        assertThat(componentVc.options.topBar.title.text.get("")).isEmpty();
252
         uut.setRoot(componentVc, new MockPromise());
250
         uut.setRoot(componentVc, new MockPromise());
253
 
251
 
254
         Options options = new Options();
252
         Options options = new Options();
255
-        options.topBarOptions.title.text = new Text("new title");
253
+        options.topBar.title.text = new Text("new title");
256
 
254
 
257
         uut.setOptions("theId", options);
255
         uut.setOptions("theId", options);
258
-        assertThat(componentVc.options.topBarOptions.title.text.get()).isEqualTo("new title");
256
+        assertThat(componentVc.options.topBar.title.text.get()).isEqualTo("new title");
259
     }
257
     }
260
 
258
 
261
     @Test
259
     @Test
348
 
346
 
349
     @Test
347
     @Test
350
     public void pushedStackCanBePopped() {
348
     public void pushedStackCanBePopped() {
351
-        child1.options.animated = new Bool(false);
352
-        child2.options.animated = new Bool(false);
349
+        child1.options.animations.push.enabled = new Bool(false);
350
+        child2.options.animations.push.enabled = new Bool(false);
353
         StackController parent = newStack();
351
         StackController parent = newStack();
354
         parent.ensureViewIsCreated();
352
         parent.ensureViewIsCreated();
355
         uut.setRoot(parent, new MockPromise());
353
         uut.setRoot(parent, new MockPromise());

+ 19
- 19
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java View File

71
 
71
 
72
     @Test
72
     @Test
73
     public void initialOptionsAppliedOnAppear() {
73
     public void initialOptionsAppliedOnAppear() {
74
-        uut.options.topBarOptions.title.text = new Text("the title");
74
+        uut.options.topBar.title.text = new Text("the title");
75
         StackController stackController =
75
         StackController stackController =
76
                 new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewController(activity, new TopBarBackgroundViewCreatorMock()), new TopBarController(), "stackId", new Options());
76
                 new StackController(activity, new TopBarButtonCreatorMock(), new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewController(activity, new TopBarBackgroundViewCreatorMock()), new TopBarController(), "stackId", new Options());
77
         stackController.push(uut, new CommandListenerAdapter());
77
         stackController.push(uut, new CommandListenerAdapter());
84
     @Test
84
     @Test
85
     public void mergeNavigationOptionsUpdatesCurrentOptions() {
85
     public void mergeNavigationOptionsUpdatesCurrentOptions() {
86
         uut.ensureViewIsCreated();
86
         uut.ensureViewIsCreated();
87
-        assertThat(uut.options.topBarOptions.title.text.get("")).isEmpty();
87
+        assertThat(uut.options.topBar.title.text.get("")).isEmpty();
88
         Options options = new Options();
88
         Options options = new Options();
89
-        options.topBarOptions.title.text = new Text("new title");
89
+        options.topBar.title.text = new Text("new title");
90
         uut.mergeOptions(options);
90
         uut.mergeOptions(options);
91
-        assertThat(uut.options.topBarOptions.title.text.get()).isEqualTo("new title");
91
+        assertThat(uut.options.topBar.title.text.get()).isEqualTo("new title");
92
     }
92
     }
93
 
93
 
94
     @Test
94
     @Test
98
         assertThat(stackController.getTopBar().getTitle()).isEmpty();
98
         assertThat(stackController.getTopBar().getTitle()).isEmpty();
99
 
99
 
100
         Options opts = new Options();
100
         Options opts = new Options();
101
-        opts.topBarOptions.title.text = new Text("the new title");
101
+        opts.topBar.title.text = new Text("the new title");
102
         uut.mergeOptions(opts);
102
         uut.mergeOptions(opts);
103
 
103
 
104
         assertThat(stackController.getTopBar().getTitle()).isEqualTo("the new title");
104
         assertThat(stackController.getTopBar().getTitle()).isEqualTo("the new title");
110
         uut.onViewAppeared();
110
         uut.onViewAppeared();
111
 
111
 
112
         Options opts = new Options();
112
         Options opts = new Options();
113
-        opts.topBarOptions.background.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
113
+        opts.topBar.background.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
114
         uut.mergeOptions(opts);
114
         uut.mergeOptions(opts);
115
 
115
 
116
         assertThat(((ColorDrawable) stackController.getTopBar().getTitleBar().getBackground()).getColor()).isEqualTo(Color.RED);
116
         assertThat(((ColorDrawable) stackController.getTopBar().getTitleBar().getBackground()).getColor()).isEqualTo(Color.RED);
123
             @Override
123
             @Override
124
             public void onSuccess(String childId) {
124
             public void onSuccess(String childId) {
125
                 Options opts = new Options();
125
                 Options opts = new Options();
126
-                opts.topBarOptions.title.text = new Text("the title");
127
-                opts.topBarOptions.title.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
126
+                opts.topBar.title.text = new Text("the title");
127
+                opts.topBar.title.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
128
                 uut.mergeOptions(opts);
128
                 uut.mergeOptions(opts);
129
 
129
 
130
                 assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);
130
                 assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);
136
     @Test
136
     @Test
137
     public void appliesTopBarTextSize() {
137
     public void appliesTopBarTextSize() {
138
         assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
138
         assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
139
-        initialNavigationOptions.topBarOptions.title.text = new Text("the title");
139
+        initialNavigationOptions.topBar.title.text = new Text("the title");
140
         uut.ensureViewIsCreated();
140
         uut.ensureViewIsCreated();
141
         uut.onViewAppeared();
141
         uut.onViewAppeared();
142
 
142
 
143
         Options opts = new Options();
143
         Options opts = new Options();
144
-        opts.topBarOptions.title.text = new Text("the title");
145
-        opts.topBarOptions.title.fontSize = new Fraction(18);
144
+        opts.topBar.title.text = new Text("the title");
145
+        opts.topBar.title.fontSize = new Fraction(18);
146
         uut.mergeOptions(opts);
146
         uut.mergeOptions(opts);
147
 
147
 
148
         assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);
148
         assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);
152
     @Test
152
     @Test
153
     public void appliesTopBarVisible() {
153
     public void appliesTopBarVisible() {
154
         assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
154
         assertThat(uut.initialOptions).isSameAs(initialNavigationOptions);
155
-        initialNavigationOptions.topBarOptions.title.text = new Text("the title");
155
+        initialNavigationOptions.topBar.title.text = new Text("the title");
156
         uut.ensureViewIsCreated();
156
         uut.ensureViewIsCreated();
157
         uut.onViewAppeared();
157
         uut.onViewAppeared();
158
         assertThat(stackController.getTopBar().getVisibility()).isNotEqualTo(View.GONE);
158
         assertThat(stackController.getTopBar().getVisibility()).isNotEqualTo(View.GONE);
159
 
159
 
160
         Options opts = new Options();
160
         Options opts = new Options();
161
-        opts.topBarOptions.visible = new Bool(false);
162
-        opts.topBarOptions.animate = new Bool(false);
161
+        opts.topBar.visible = new Bool(false);
162
+        opts.topBar.animate = new Bool(false);
163
         uut.mergeOptions(opts);
163
         uut.mergeOptions(opts);
164
 
164
 
165
         assertThat(stackController.getTopBar().getVisibility()).isEqualTo(View.GONE);
165
         assertThat(stackController.getTopBar().getVisibility()).isEqualTo(View.GONE);
167
 
167
 
168
     @Test
168
     @Test
169
     public void appliesDrawUnder() {
169
     public void appliesDrawUnder() {
170
-        uut.options.topBarOptions.title.text = new Text("the title");
171
-        uut.options.topBarOptions.drawBehind = new Bool(false);
170
+        uut.options.topBar.title.text = new Text("the title");
171
+        uut.options.topBar.drawBehind = new Bool(false);
172
         uut.ensureViewIsCreated();
172
         uut.ensureViewIsCreated();
173
         stackController.ensureViewIsCreated();
173
         stackController.ensureViewIsCreated();
174
         stackController.push(uut, new CommandListenerAdapter() {
174
         stackController.push(uut, new CommandListenerAdapter() {
179
                 assertThat(uutLayoutParams.topMargin).isNotEqualTo(0);
179
                 assertThat(uutLayoutParams.topMargin).isNotEqualTo(0);
180
 
180
 
181
                 Options opts = new Options();
181
                 Options opts = new Options();
182
-                opts.topBarOptions.drawBehind = new Bool(true);
182
+                opts.topBar.drawBehind = new Bool(true);
183
                 uut.mergeOptions(opts);
183
                 uut.mergeOptions(opts);
184
 
184
 
185
                 uutLayoutParams = (RelativeLayout.LayoutParams) (uut.getComponent().asView()).getLayoutParams();
185
                 uutLayoutParams = (RelativeLayout.LayoutParams) (uut.getComponent().asView()).getLayoutParams();
192
     public void appliesTopBarComponent() throws Exception {
192
     public void appliesTopBarComponent() throws Exception {
193
         JSONObject json = new JSONObject();
193
         JSONObject json = new JSONObject();
194
         json.put("component", new JSONObject().put("name","someComponent").put("componentId", "id"));
194
         json.put("component", new JSONObject().put("name","someComponent").put("componentId", "id"));
195
-        uut.options.topBarOptions.background = TopBarBackgroundOptions.parse(json);
195
+        uut.options.topBar.background = TopBarBackgroundOptions.parse(json);
196
         uut.ensureViewIsCreated();
196
         uut.ensureViewIsCreated();
197
         stackController.push(uut, new CommandListenerAdapter());
197
         stackController.push(uut, new CommandListenerAdapter());
198
         uut.onViewAppeared();
198
         uut.onViewAppeared();
205
     public void appliesSubtitle() throws Exception {
205
     public void appliesSubtitle() throws Exception {
206
         JSONObject json = new JSONObject();
206
         JSONObject json = new JSONObject();
207
         json.put("text", "sub");
207
         json.put("text", "sub");
208
-        uut.options.topBarOptions.subtitle = SubtitleOptions.parse(new TypefaceLoaderMock(), json);
208
+        uut.options.topBar.subtitle = SubtitleOptions.parse(new TypefaceLoaderMock(), json);
209
         uut.ensureViewIsCreated();
209
         uut.ensureViewIsCreated();
210
         stackController.push(uut, new CommandListenerAdapter());
210
         stackController.push(uut, new CommandListenerAdapter());
211
         uut.onViewAppeared();
211
         uut.onViewAppeared();

+ 11
- 11
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsMergingTest.java View File

67
         verify(topBar, times(0)).setRightButtons(any());
67
         verify(topBar, times(0)).setRightButtons(any());
68
         verify(topBar, times(0)).setLeftButtons(any());
68
         verify(topBar, times(0)).setLeftButtons(any());
69
 
69
 
70
-        options.topBarOptions.rightButtons = new ArrayList<>();
70
+        options.topBar.rightButtons = new ArrayList<>();
71
         uut.mergeChildOptions(options, child);
71
         uut.mergeChildOptions(options, child);
72
         verify(topBar, times(1)).setRightButtons(any());
72
         verify(topBar, times(1)).setRightButtons(any());
73
 
73
 
74
-        options.topBarOptions.leftButtons = new ArrayList<>();
74
+        options.topBar.leftButtons = new ArrayList<>();
75
         uut.mergeChildOptions(options, child);
75
         uut.mergeChildOptions(options, child);
76
         verify(topBar, times(1)).setLeftButtons(any());
76
         verify(topBar, times(1)).setLeftButtons(any());
77
     }
77
     }
89
         titleOptions.color = new Color(0);
89
         titleOptions.color = new Color(0);
90
         titleOptions.fontSize = new Fraction(1.0f);
90
         titleOptions.fontSize = new Fraction(1.0f);
91
         titleOptions.fontFamily = Typeface.DEFAULT_BOLD;
91
         titleOptions.fontFamily = Typeface.DEFAULT_BOLD;
92
-        options.topBarOptions.title = titleOptions;
92
+        options.topBar.title = titleOptions;
93
         SubtitleOptions subtitleOptions = new SubtitleOptions();
93
         SubtitleOptions subtitleOptions = new SubtitleOptions();
94
         subtitleOptions.text = new Text("Sub");
94
         subtitleOptions.text = new Text("Sub");
95
         subtitleOptions.color = new Color(1);
95
         subtitleOptions.color = new Color(1);
96
-        options.topBarOptions.subtitle = subtitleOptions;
97
-        options.topBarOptions.background.color = new Color(0);
98
-        options.topBarOptions.testId = new Text("test123");
99
-        options.topBarOptions.animate = new Bool(false);
100
-        options.topBarOptions.visible = new Bool(false);
101
-        options.topBarOptions.drawBehind = new Bool(false);
102
-        options.topBarOptions.hideOnScroll = new Bool(false);
96
+        options.topBar.subtitle = subtitleOptions;
97
+        options.topBar.background.color = new Color(0);
98
+        options.topBar.testId = new Text("test123");
99
+        options.topBar.animate = new Bool(false);
100
+        options.topBar.visible = new Bool(false);
101
+        options.topBar.drawBehind = new Bool(false);
102
+        options.topBar.hideOnScroll = new Bool(false);
103
         uut.mergeChildOptions(options, child);
103
         uut.mergeChildOptions(options, child);
104
 
104
 
105
         assertTopBarOptions(1);
105
         assertTopBarOptions(1);
106
 
106
 
107
-        options.topBarOptions.drawBehind = new Bool(true);
107
+        options.topBar.drawBehind = new Bool(true);
108
         uut.mergeChildOptions(options, child);
108
         uut.mergeChildOptions(options, child);
109
         verify(child, times(1)).drawBehindTopBar();
109
         verify(child, times(1)).drawBehindTopBar();
110
     }
110
     }

+ 5
- 5
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ParentControllerTest.java View File

42
         activity = newActivity();
42
         activity = newActivity();
43
         children = new ArrayList<>();
43
         children = new ArrayList<>();
44
         Options initialOptions = new Options();
44
         Options initialOptions = new Options();
45
-        initialOptions.topBarOptions.title.text = new Text(INITIAL_TITLE);
45
+        initialOptions.topBar.title.text = new Text(INITIAL_TITLE);
46
         uut = spy(new ParentController(activity, "uut", initialOptions) {
46
         uut = spy(new ParentController(activity, "uut", initialOptions) {
47
 
47
 
48
             @NonNull
48
             @NonNull
125
     @Test
125
     @Test
126
     public void mergeOptions_optionsAreMergedWhenChildAppears() {
126
     public void mergeOptions_optionsAreMergedWhenChildAppears() {
127
         Options options = new Options();
127
         Options options = new Options();
128
-        options.topBarOptions.title.text = new Text("new title");
128
+        options.topBar.title.text = new Text("new title");
129
         ViewController child1 = spy(new SimpleViewController(activity, "child1", options));
129
         ViewController child1 = spy(new SimpleViewController(activity, "child1", options));
130
         children.add(child1);
130
         children.add(child1);
131
         uut.ensureViewIsCreated();
131
         uut.ensureViewIsCreated();
136
         ArgumentCaptor<ReactComponent> viewCaptor = ArgumentCaptor.forClass(ReactComponent.class);
136
         ArgumentCaptor<ReactComponent> viewCaptor = ArgumentCaptor.forClass(ReactComponent.class);
137
         verify(uut, times(1)).clearOptions();
137
         verify(uut, times(1)).clearOptions();
138
         verify(uut, times(1)).applyChildOptions(optionsCaptor.capture(), viewCaptor.capture());
138
         verify(uut, times(1)).applyChildOptions(optionsCaptor.capture(), viewCaptor.capture());
139
-        assertThat(optionsCaptor.getValue().topBarOptions.title.text.get()).isEqualTo("new title");
139
+        assertThat(optionsCaptor.getValue().topBar.title.text.get()).isEqualTo("new title");
140
         assertThat(viewCaptor.getValue()).isEqualTo(child1.getView());
140
         assertThat(viewCaptor.getValue()).isEqualTo(child1.getView());
141
     }
141
     }
142
 
142
 
143
     @Test
143
     @Test
144
     public void mergeOptions_initialParentOptionsAreNotMutatedWhenChildAppears() {
144
     public void mergeOptions_initialParentOptionsAreNotMutatedWhenChildAppears() {
145
         Options options = new Options();
145
         Options options = new Options();
146
-        options.topBarOptions.title.text = new Text("new title");
146
+        options.topBar.title.text = new Text("new title");
147
         ViewController child1 = spy(new SimpleViewController(activity, "child1", options));
147
         ViewController child1 = spy(new SimpleViewController(activity, "child1", options));
148
         children.add(child1);
148
         children.add(child1);
149
 
149
 
151
 
151
 
152
         child1.ensureViewIsCreated();
152
         child1.ensureViewIsCreated();
153
         child1.onViewAppeared();
153
         child1.onViewAppeared();
154
-        assertThat(uut.initialOptions.topBarOptions.title.text.get()).isEqualTo(INITIAL_TITLE);
154
+        assertThat(uut.initialOptions.topBar.title.text.get()).isEqualTo(INITIAL_TITLE);
155
     }
155
     }
156
 
156
 
157
     private StackController createStack() {
157
     private StackController createStack() {

+ 37
- 37
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackControllerTest.java View File

155
                 uut.pop(new CommandListenerAdapter() {
155
                 uut.pop(new CommandListenerAdapter() {
156
                     @Override
156
                     @Override
157
                     public void onSuccess(String childId) {
157
                     public void onSuccess(String childId) {
158
-                        verify(stackLayout[0], times(1)).onChildWillDisappear(child2.options, child1.options);
158
+                        verify(stackLayout[0], times(1)).onChildWillPop(child2.options, child1.options);
159
                     }
159
                     }
160
                 });
160
                 });
161
             }
161
             }
254
         uut.ensureViewIsCreated();
254
         uut.ensureViewIsCreated();
255
         child1.ensureViewIsCreated();
255
         child1.ensureViewIsCreated();
256
 
256
 
257
-        child1.options.topBarOptions.visible = new Bool(false);
258
-        child1.options.topBarOptions.animate = new Bool(false);
259
-        child1.options.animated = new Bool(false);
260
-        child2.options.animated = new Bool(false);
257
+        child1.options.topBar.visible = new Bool(false);
258
+        child1.options.topBar.animate = new Bool(false);
259
+        disablePushAnimation(child1, child2);
261
 
260
 
262
         uut.push(child1, new CommandListenerAdapter() {
261
         uut.push(child1, new CommandListenerAdapter() {
263
             @Override
262
             @Override
267
 
266
 
268
                 uut.push(child2, new CommandListenerAdapter());
267
                 uut.push(child2, new CommandListenerAdapter());
269
                 child2.onViewAppeared();
268
                 child2.onViewAppeared();
270
-                verify(uut.getTopBar(), times(0)).showAnimate(child2.options.animationsOptions.push.topBar);
269
+                verify(uut.getTopBar(), times(0)).showAnimate(child2.options.animations.push.topBar);
271
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.VISIBLE);
270
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.VISIBLE);
272
                 verify(uut.getTopBar(), times(1)).resetAnimationOptions();
271
                 verify(uut.getTopBar(), times(1)).resetAnimationOptions();
273
             }
272
             }
278
     public void push_animatesAndClearsPreviousAnimationValues() {
277
     public void push_animatesAndClearsPreviousAnimationValues() {
279
         uut.ensureViewIsCreated();
278
         uut.ensureViewIsCreated();
280
 
279
 
281
-        child1.options.topBarOptions.visible = new Bool(false);
282
-        child1.options.topBarOptions.animate = new Bool(false);
283
-        child1.options.animated = new Bool(false);
280
+        child1.options.topBar.visible = new Bool(false);
281
+        child1.options.topBar.animate = new Bool(false);
282
+        child1.options.animations.push.enabled = new Bool(false);
284
 
283
 
285
         uut.push(child1, new CommandListenerAdapter());
284
         uut.push(child1, new CommandListenerAdapter());
286
         uut.push(child2, new CommandListenerAdapter() {
285
         uut.push(child2, new CommandListenerAdapter() {
385
 
384
 
386
     @Test
385
     @Test
387
     public void popToRoot_PopsEverythingAboveFirstController() {
386
     public void popToRoot_PopsEverythingAboveFirstController() {
388
-        child1.options.animated = new Bool(false);
389
-        child2.options.animated = new Bool(false);
387
+        child1.options.animations.push.enabled = new Bool(false);
388
+        child2.options.animations.push.enabled = new Bool(false);
390
 
389
 
391
         uut.push(child1, new CommandListenerAdapter());
390
         uut.push(child1, new CommandListenerAdapter());
392
         uut.push(child2, new CommandListenerAdapter());
391
         uut.push(child2, new CommandListenerAdapter());
409
 
408
 
410
     @Test
409
     @Test
411
     public void popToRoot_onlyTopChildIsAnimated() {
410
     public void popToRoot_onlyTopChildIsAnimated() {
412
-        child1.options.animated = new Bool(false);
413
-        child2.options.animated = new Bool(false);
411
+        child1.options.animations.push.enabled = new Bool(false);
412
+        child2.options.animations.push.enabled = new Bool(false);
414
 
413
 
415
         uut.push(child1, new CommandListenerAdapter());
414
         uut.push(child1, new CommandListenerAdapter());
416
         uut.push(child2, new CommandListenerAdapter());
415
         uut.push(child2, new CommandListenerAdapter());
417
         uut.push(child3, new CommandListenerAdapter() {
416
         uut.push(child3, new CommandListenerAdapter() {
418
             @Override
417
             @Override
419
             public void onSuccess(String childId) {
418
             public void onSuccess(String childId) {
420
-                child1.options.animated = new Bool(true);
421
-                child2.options.animated = new Bool(true);
422
                 uut.popToRoot(new CommandListenerAdapter() {
419
                 uut.popToRoot(new CommandListenerAdapter() {
423
                     @Override
420
                     @Override
424
                     public void onSuccess(String childId) {
421
                     public void onSuccess(String childId) {
431
 
428
 
432
     @Test
429
     @Test
433
     public void popToRoot_topChildrenAreDestroyed() {
430
     public void popToRoot_topChildrenAreDestroyed() {
434
-        child1.options.animated = new Bool(false);
435
-        child2.options.animated = new Bool(false);
436
-        child3.options.animated = new Bool(false);
431
+        child1.options.animations.push.enabled = new Bool(false);
432
+        child2.options.animations.push.enabled = new Bool(false);
433
+        child3.options.animations.push.enabled = new Bool(false);
437
 
434
 
438
         uut.push(child1, new CommandListenerAdapter());
435
         uut.push(child1, new CommandListenerAdapter());
439
         uut.push(child2, new CommandListenerAdapter());
436
         uut.push(child2, new CommandListenerAdapter());
493
 
490
 
494
     @Test
491
     @Test
495
     public void pop_callWillAppearWillDisappear() {
492
     public void pop_callWillAppearWillDisappear() {
496
-        child1.options.animated = new Bool(false);
497
-        child2.options.animated = new Bool(false);
493
+        child1.options.animations.push.enabled = new Bool(false);
494
+        child2.options.animations.push.enabled = new Bool(false);
498
         child1 = spy(child1);
495
         child1 = spy(child1);
499
         child2 = spy(child2);
496
         child2 = spy(child2);
500
         uut.push(child1, new CommandListenerAdapter());
497
         uut.push(child1, new CommandListenerAdapter());
508
     public void pop_animatesTopBar() {
505
     public void pop_animatesTopBar() {
509
         uut.ensureViewIsCreated();
506
         uut.ensureViewIsCreated();
510
 
507
 
511
-        child1.options.topBarOptions.visible = new Bool(false);
512
-        child1.options.animated = new Bool(false);
513
-        child2.options.animated = new Bool(true);
508
+        child1.options.topBar.visible = new Bool(false);
509
+        child1.options.animations.push.enabled = new Bool(false);
510
+        child2.options.animations.push.enabled = new Bool(true);
514
         uut.push(child1, new CommandListenerAdapter() {
511
         uut.push(child1, new CommandListenerAdapter() {
515
             @Override
512
             @Override
516
             public void onSuccess(String childId) {
513
             public void onSuccess(String childId) {
522
                         uut.pop(new CommandListenerAdapter() {
519
                         uut.pop(new CommandListenerAdapter() {
523
                             @Override
520
                             @Override
524
                             public void onSuccess(String childId) {
521
                             public void onSuccess(String childId) {
525
-                                verify(uut.getTopBar(), times(1)).hideAnimate(child2.options.animationsOptions.pop.topBar);
522
+                                verify(uut.getTopBar(), times(1)).hideAnimate(child2.options.animations.pop.topBar);
526
                             }
523
                             }
527
                         });
524
                         });
528
                     }
525
                     }
535
     public void pop_doesNotAnimateTopBarIfScreenIsPushedWithoutAnimation() {
532
     public void pop_doesNotAnimateTopBarIfScreenIsPushedWithoutAnimation() {
536
         uut.ensureViewIsCreated();
533
         uut.ensureViewIsCreated();
537
 
534
 
538
-        child1.options.topBarOptions.visible = new Bool(false);
539
-        child2.options.animated = new Bool(false);
535
+        child1.options.topBar.visible = new Bool(false);
536
+        child1.options.topBar.animate = new Bool(false);
537
+        child2.options.animations.push.enabled = new Bool(false);
538
+        child2.options.topBar.animate = new Bool(false);
539
+
540
         child1.ensureViewIsCreated();
540
         child1.ensureViewIsCreated();
541
         uut.push(child1, new CommandListenerAdapter() {
541
         uut.push(child1, new CommandListenerAdapter() {
542
             @Override
542
             @Override
545
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.VISIBLE);
545
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.VISIBLE);
546
 
546
 
547
                 uut.pop(new CommandListenerAdapter());
547
                 uut.pop(new CommandListenerAdapter());
548
-                verify(uut.getTopBar(), times(0)).hideAnimate(child2.options.animationsOptions.pop.topBar);
548
+                verify(uut.getTopBar(), times(0)).hideAnimate(child2.options.animations.pop.topBar);
549
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.GONE);
549
                 assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.GONE);
550
             }
550
             }
551
         });
551
         });
605
         parent.push(uut, new CommandListenerAdapter());
605
         parent.push(uut, new CommandListenerAdapter());
606
 
606
 
607
         Options childOptions = new Options();
607
         Options childOptions = new Options();
608
-        childOptions.topBarOptions.title.text = new Text("Something");
608
+        childOptions.topBar.title.text = new Text("Something");
609
         child1.options = childOptions;
609
         child1.options = childOptions;
610
         uut.push(child1, new CommandListenerAdapter());
610
         uut.push(child1, new CommandListenerAdapter());
611
         child1.ensureViewIsCreated();
611
         child1.ensureViewIsCreated();
614
         ArgumentCaptor<Options> optionsCaptor = ArgumentCaptor.forClass(Options.class);
614
         ArgumentCaptor<Options> optionsCaptor = ArgumentCaptor.forClass(Options.class);
615
         ArgumentCaptor<ReactComponent> viewCaptor = ArgumentCaptor.forClass(ReactComponent.class);
615
         ArgumentCaptor<ReactComponent> viewCaptor = ArgumentCaptor.forClass(ReactComponent.class);
616
         verify(parent, times(1)).applyChildOptions(optionsCaptor.capture(), viewCaptor.capture());
616
         verify(parent, times(1)).applyChildOptions(optionsCaptor.capture(), viewCaptor.capture());
617
-        assertThat(optionsCaptor.getValue().topBarOptions.title.text.hasValue()).isFalse();
617
+        assertThat(optionsCaptor.getValue().topBar.title.text.hasValue()).isFalse();
618
     }
618
     }
619
 
619
 
620
     @Test
620
     @Test
667
         ParentController parentController = Mockito.mock(ParentController.class);
667
         ParentController parentController = Mockito.mock(ParentController.class);
668
         uut.setParentController(parentController);
668
         uut.setParentController(parentController);
669
         Options optionsToMerge = new Options();
669
         Options optionsToMerge = new Options();
670
-        optionsToMerge.topBarOptions.testId = new Text("topBarID");
670
+        optionsToMerge.topBar.testId = new Text("topBarID");
671
         optionsToMerge.bottomTabsOptions.testId = new Text("bottomTabsID");
671
         optionsToMerge.bottomTabsOptions.testId = new Text("bottomTabsID");
672
         Component component = mock(Component.class);
672
         Component component = mock(Component.class);
673
         uut.mergeChildOptions(optionsToMerge, component);
673
         uut.mergeChildOptions(optionsToMerge, component);
674
 
674
 
675
         ArgumentCaptor<Options> captor = ArgumentCaptor.forClass(Options.class);
675
         ArgumentCaptor<Options> captor = ArgumentCaptor.forClass(Options.class);
676
         verify(parentController, times(1)).mergeChildOptions(captor.capture(), eq(component));
676
         verify(parentController, times(1)).mergeChildOptions(captor.capture(), eq(component));
677
-        assertThat(captor.getValue().topBarOptions.testId.hasValue()).isFalse();
677
+        assertThat(captor.getValue().topBar.testId.hasValue()).isFalse();
678
         assertThat(captor.getValue().bottomTabsOptions.testId.get()).isEqualTo(optionsToMerge.bottomTabsOptions.testId.get());
678
         assertThat(captor.getValue().bottomTabsOptions.testId.get()).isEqualTo(optionsToMerge.bottomTabsOptions.testId.get());
679
     }
679
     }
680
 
680
 
684
         Component component = mock(Component.class);
684
         Component component = mock(Component.class);
685
 
685
 
686
         uut.mergeChildOptions(options, component);
686
         uut.mergeChildOptions(options, component);
687
-        verify(animator, times(0)).setOptions(options.animationsOptions);
688
-        verify(animator, times(1)).mergeOptions(options.animationsOptions);
687
+        verify(animator, times(0)).setOptions(options.animations);
688
+        verify(animator, times(1)).mergeOptions(options.animations);
689
     }
689
     }
690
 
690
 
691
     @Test
691
     @Test
693
         ParentController parentController = Mockito.mock(ParentController.class);
693
         ParentController parentController = Mockito.mock(ParentController.class);
694
         uut.setParentController(parentController);
694
         uut.setParentController(parentController);
695
         Options options = new Options();
695
         Options options = new Options();
696
-        options.animationsOptions.push = NestedAnimationsOptions.parse(new JSONObject());
697
-        options.topBarOptions.testId = new Text("id");
696
+        options.animations.push = NestedAnimationsOptions.parse(new JSONObject());
697
+        options.topBar.testId = new Text("id");
698
         options.fabOptions.id = new Text("fabId");
698
         options.fabOptions.id = new Text("fabId");
699
         Component component = mock(Component.class);
699
         Component component = mock(Component.class);
700
 
700
 
702
         uut.mergeChildOptions(options, component);
702
         uut.mergeChildOptions(options, component);
703
         ArgumentCaptor<Options> captor = ArgumentCaptor.forClass(Options.class);
703
         ArgumentCaptor<Options> captor = ArgumentCaptor.forClass(Options.class);
704
         verify(parentController, times(1)).mergeChildOptions(captor.capture(), eq(component));
704
         verify(parentController, times(1)).mergeChildOptions(captor.capture(), eq(component));
705
-        assertThat(captor.getValue().animationsOptions.push.hasValue()).isFalse();
706
-        assertThat(captor.getValue().topBarOptions.testId.hasValue()).isFalse();
705
+        assertThat(captor.getValue().animations.push.hasValue()).isFalse();
706
+        assertThat(captor.getValue().topBar.testId.hasValue()).isFalse();
707
         assertThat(captor.getValue().fabOptions.hasValue()).isFalse();
707
         assertThat(captor.getValue().fabOptions.hasValue()).isFalse();
708
     }
708
     }
709
 
709
 

+ 6
- 6
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java View File

79
         for (int i = 0; i < SIZE; i++) {
79
         for (int i = 0; i < SIZE; i++) {
80
             final Options options = new Options();
80
             final Options options = new Options();
81
             options.topTabOptions.title = new Text("Tab " + i);
81
             options.topTabOptions.title = new Text("Tab " + i);
82
-            options.topBarOptions.title.text = new Text(createTabTopBarTitle(i));
82
+            options.topBar.title.text = new Text(createTabTopBarTitle(i));
83
             result.add(options);
83
             result.add(options);
84
         }
84
         }
85
         return result;
85
         return result;
181
         uut.onViewAppeared();
181
         uut.onViewAppeared();
182
         ReactComponent currentTab = tabView(0);
182
         ReactComponent currentTab = tabView(0);
183
         verify(uut, times(1)).applyChildOptions(any(Options.class), eq(currentTab));
183
         verify(uut, times(1)).applyChildOptions(any(Options.class), eq(currentTab));
184
-        assertThat(uut.options.topBarOptions.title.text.get()).isEqualTo(createTabTopBarTitle(0));
184
+        assertThat(uut.options.topBar.title.text.get()).isEqualTo(createTabTopBarTitle(0));
185
 
185
 
186
         uut.switchToTab(1);
186
         uut.switchToTab(1);
187
         currentTab = tabView(1);
187
         currentTab = tabView(1);
188
         verify(uut, times(1)).applyChildOptions(any(Options.class), eq(currentTab));
188
         verify(uut, times(1)).applyChildOptions(any(Options.class), eq(currentTab));
189
-        assertThat(uut.options.topBarOptions.title.text.get()).isEqualTo(createTabTopBarTitle(1));
189
+        assertThat(uut.options.topBar.title.text.get()).isEqualTo(createTabTopBarTitle(1));
190
 
190
 
191
         uut.switchToTab(0);
191
         uut.switchToTab(0);
192
         currentTab = tabView(0);
192
         currentTab = tabView(0);
193
         verify(uut, times(2)).applyChildOptions(any(Options.class), eq(currentTab));
193
         verify(uut, times(2)).applyChildOptions(any(Options.class), eq(currentTab));
194
-        assertThat(uut.options.topBarOptions.title.text.get()).isEqualTo(createTabTopBarTitle(0));
194
+        assertThat(uut.options.topBar.title.text.get()).isEqualTo(createTabTopBarTitle(0));
195
     }
195
     }
196
 
196
 
197
     private TestReactView getActualTabView(int index) {
197
     private TestReactView getActualTabView(int index) {
231
                 new TestComponentViewCreator(),
231
                 new TestComponentViewCreator(),
232
                 new Options()
232
                 new Options()
233
         );
233
         );
234
-        first.options.animated = new Bool(false);
235
-        uut.options.animated = new Bool(false);
234
+        first.options.animations.push.enabled = new Bool(false);
235
+        uut.options.animations.push.enabled = new Bool(false);
236
         stackController.push(first, new CommandListenerAdapter());
236
         stackController.push(first, new CommandListenerAdapter());
237
         stackController.push(uut, new CommandListenerAdapter());
237
         stackController.push(uut, new CommandListenerAdapter());
238
 
238