Browse Source

Rename presenters

Guy Carmeli 6 years ago
parent
commit
07e51fc1ac
16 changed files with 55 additions and 55 deletions
  1. 6
    6
      lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java
  2. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabPresenter.java
  3. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsPresenter.java
  4. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackPresenter.java
  5. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarButtonController.java
  6. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java
  7. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java
  8. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerBuilder.java
  9. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/TestUtils.java
  10. 4
    4
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabPresenterTest.java
  11. 6
    6
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java
  12. 4
    4
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsPresenterTest.java
  13. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
  14. 4
    4
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackPresenterTest.java
  15. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java
  16. 6
    6
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerTest.java

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

3
 import android.app.Activity;
3
 import android.app.Activity;
4
 
4
 
5
 import com.facebook.react.ReactInstanceManager;
5
 import com.facebook.react.ReactInstanceManager;
6
-import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
7
-import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
6
+import com.reactnativenavigation.presentation.BottomTabPresenter;
7
+import com.reactnativenavigation.presentation.BottomTabsPresenter;
8
 import com.reactnativenavigation.presentation.OptionsPresenter;
8
 import com.reactnativenavigation.presentation.OptionsPresenter;
9
 import com.reactnativenavigation.presentation.SideMenuOptionsPresenter;
9
 import com.reactnativenavigation.presentation.SideMenuOptionsPresenter;
10
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
10
+import com.reactnativenavigation.presentation.StackPresenter;
11
 import com.reactnativenavigation.react.EventEmitter;
11
 import com.reactnativenavigation.react.EventEmitter;
12
 import com.reactnativenavigation.utils.ImageLoader;
12
 import com.reactnativenavigation.utils.ImageLoader;
13
 import com.reactnativenavigation.utils.TypefaceLoader;
13
 import com.reactnativenavigation.utils.TypefaceLoader;
168
                 .setTopBarController(new TopBarController())
168
                 .setTopBarController(new TopBarController())
169
                 .setId(node.id)
169
                 .setId(node.id)
170
                 .setInitialOptions(parse(typefaceManager, node.getOptions()))
170
                 .setInitialOptions(parse(typefaceManager, node.getOptions()))
171
-                .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreator(reactInstanceManager), new TitleBarButtonCreator(reactInstanceManager), new ImageLoader(), defaultOptions))
171
+                .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreator(reactInstanceManager), new TitleBarButtonCreator(reactInstanceManager), new ImageLoader(), defaultOptions))
172
                 .setPresenter(new OptionsPresenter(activity, defaultOptions))
172
                 .setPresenter(new OptionsPresenter(activity, defaultOptions))
173
                 .build();
173
                 .build();
174
 	}
174
 	}
194
                 node.id,
194
                 node.id,
195
                 parse(typefaceManager, node.getOptions()),
195
                 parse(typefaceManager, node.getOptions()),
196
                 new OptionsPresenter(activity, defaultOptions),
196
                 new OptionsPresenter(activity, defaultOptions),
197
-                new BottomTabsOptionsPresenter(tabs, defaultOptions),
198
-                new BottomTabOptionsPresenter(activity, tabs, defaultOptions));
197
+                new BottomTabsPresenter(tabs, defaultOptions),
198
+                new BottomTabPresenter(activity, tabs, defaultOptions));
199
 	}
199
 	}
200
 
200
 
201
     private ViewController createTopTabs(LayoutNode node) {
201
     private ViewController createTopTabs(LayoutNode node) {

lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabPresenter.java View File

13
 
13
 
14
 import java.util.List;
14
 import java.util.List;
15
 
15
 
16
-public class BottomTabOptionsPresenter {
16
+public class BottomTabPresenter {
17
     private Options defaultOptions;
17
     private Options defaultOptions;
18
     private final BottomTabFinder bottomTabFinder;
18
     private final BottomTabFinder bottomTabFinder;
19
     private BottomTabs bottomTabs;
19
     private BottomTabs bottomTabs;
21
     private final int defaultTextColor;
21
     private final int defaultTextColor;
22
     private final List<ViewController> tabs;
22
     private final List<ViewController> tabs;
23
 
23
 
24
-    public BottomTabOptionsPresenter(Context context, List<ViewController> tabs, Options defaultOptions) {
24
+    public BottomTabPresenter(Context context, List<ViewController> tabs, Options defaultOptions) {
25
         this.tabs = tabs;
25
         this.tabs = tabs;
26
         this.bottomTabFinder = new BottomTabFinder(tabs);
26
         this.bottomTabFinder = new BottomTabFinder(tabs);
27
         this.defaultOptions = defaultOptions;
27
         this.defaultOptions = defaultOptions;

lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabsPresenter.java View File

19
 
19
 
20
 import java.util.List;
20
 import java.util.List;
21
 
21
 
22
-public class BottomTabsOptionsPresenter {
22
+public class BottomTabsPresenter {
23
     private final BottomTabFinder bottomTabFinder;
23
     private final BottomTabFinder bottomTabFinder;
24
     private final List<ViewController> tabs;
24
     private final List<ViewController> tabs;
25
     private Options defaultOptions;
25
     private Options defaultOptions;
27
     private BottomTabsAnimator animator;
27
     private BottomTabsAnimator animator;
28
     private TabSelector tabSelector;
28
     private TabSelector tabSelector;
29
 
29
 
30
-    public BottomTabsOptionsPresenter(List<ViewController> tabs, Options defaultOptions) {
30
+    public BottomTabsPresenter(List<ViewController> tabs, Options defaultOptions) {
31
         this.tabs = tabs;
31
         this.tabs = tabs;
32
         this.defaultOptions = defaultOptions;
32
         this.defaultOptions = defaultOptions;
33
         this.bottomTabFinder = new BottomTabFinder(tabs);
33
         this.bottomTabFinder = new BottomTabFinder(tabs);

lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackPresenter.java View File

43
 import static com.reactnativenavigation.utils.CollectionUtils.keyBy;
43
 import static com.reactnativenavigation.utils.CollectionUtils.keyBy;
44
 import static com.reactnativenavigation.utils.CollectionUtils.merge;
44
 import static com.reactnativenavigation.utils.CollectionUtils.merge;
45
 
45
 
46
-public class StackOptionsPresenter {
46
+public class StackPresenter {
47
     private static final int DEFAULT_TITLE_COLOR = Color.BLACK;
47
     private static final int DEFAULT_TITLE_COLOR = Color.BLACK;
48
     private static final int DEFAULT_SUBTITLE_COLOR = Color.GRAY;
48
     private static final int DEFAULT_SUBTITLE_COLOR = Color.GRAY;
49
     private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
49
     private static final int DEFAULT_BORDER_COLOR = Color.BLACK;
62
     private Map<Component, Map<String, TitleBarButtonController>> componentRightButtons = new HashMap<>();
62
     private Map<Component, Map<String, TitleBarButtonController>> componentRightButtons = new HashMap<>();
63
     private Map<Component, Map<String, TitleBarButtonController>> componentLeftButtons = new HashMap<>();
63
     private Map<Component, Map<String, TitleBarButtonController>> componentLeftButtons = new HashMap<>();
64
 
64
 
65
-    public StackOptionsPresenter(Activity activity, TitleBarReactViewCreator titleViewCreator, ReactViewCreator buttonCreator, ImageLoader imageLoader, Options defaultOptions) {
65
+    public StackPresenter(Activity activity, TitleBarReactViewCreator titleViewCreator, ReactViewCreator buttonCreator, ImageLoader imageLoader, Options defaultOptions) {
66
         this.activity = activity;
66
         this.activity = activity;
67
         this.titleViewCreator = titleViewCreator;
67
         this.titleViewCreator = titleViewCreator;
68
         this.buttonCreator = buttonCreator;
68
         this.buttonCreator = buttonCreator;

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

1
-package com.reactnativenavigation.viewcontrollers;
1
+    package com.reactnativenavigation.viewcontrollers;
2
 
2
 
3
 import android.annotation.SuppressLint;
3
 import android.annotation.SuppressLint;
4
 import android.app.Activity;
4
 import android.app.Activity;

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

12
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
12
 import com.aurelhubert.ahbottomnavigation.AHBottomNavigationItem;
13
 import com.reactnativenavigation.parse.BottomTabOptions;
13
 import com.reactnativenavigation.parse.BottomTabOptions;
14
 import com.reactnativenavigation.parse.Options;
14
 import com.reactnativenavigation.parse.Options;
15
-import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
16
-import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
15
+import com.reactnativenavigation.presentation.BottomTabPresenter;
16
+import com.reactnativenavigation.presentation.BottomTabsPresenter;
17
 import com.reactnativenavigation.presentation.OptionsPresenter;
17
 import com.reactnativenavigation.presentation.OptionsPresenter;
18
 import com.reactnativenavigation.react.EventEmitter;
18
 import com.reactnativenavigation.react.EventEmitter;
19
 import com.reactnativenavigation.utils.CommandListener;
19
 import com.reactnativenavigation.utils.CommandListener;
39
 	private List<ViewController> tabs;
39
 	private List<ViewController> tabs;
40
     private EventEmitter eventEmitter;
40
     private EventEmitter eventEmitter;
41
     private ImageLoader imageLoader;
41
     private ImageLoader imageLoader;
42
-    private BottomTabsOptionsPresenter presenter;
43
-    private BottomTabOptionsPresenter tabPresenter;
42
+    private BottomTabsPresenter presenter;
43
+    private BottomTabPresenter tabPresenter;
44
 
44
 
45
-    public BottomTabsController(Activity activity, List<ViewController> tabs, ChildControllersRegistry childRegistry, EventEmitter eventEmitter, ImageLoader imageLoader, String id, Options initialOptions, OptionsPresenter presenter, BottomTabsOptionsPresenter bottomTabsPresenter, BottomTabOptionsPresenter bottomTabPresenter) {
45
+    public BottomTabsController(Activity activity, List<ViewController> tabs, ChildControllersRegistry childRegistry, EventEmitter eventEmitter, ImageLoader imageLoader, String id, Options initialOptions, OptionsPresenter presenter, BottomTabsPresenter bottomTabsPresenter, BottomTabPresenter bottomTabPresenter) {
46
 		super(activity, childRegistry, id, presenter, initialOptions);
46
 		super(activity, childRegistry, id, presenter, initialOptions);
47
         this.tabs = tabs;
47
         this.tabs = tabs;
48
         this.eventEmitter = eventEmitter;
48
         this.eventEmitter = eventEmitter;

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

12
 import com.reactnativenavigation.anim.NavigationAnimator;
12
 import com.reactnativenavigation.anim.NavigationAnimator;
13
 import com.reactnativenavigation.parse.Options;
13
 import com.reactnativenavigation.parse.Options;
14
 import com.reactnativenavigation.presentation.OptionsPresenter;
14
 import com.reactnativenavigation.presentation.OptionsPresenter;
15
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
15
+import com.reactnativenavigation.presentation.StackPresenter;
16
 import com.reactnativenavigation.react.Constants;
16
 import com.reactnativenavigation.react.Constants;
17
 import com.reactnativenavigation.utils.CommandListener;
17
 import com.reactnativenavigation.utils.CommandListener;
18
 import com.reactnativenavigation.utils.CommandListenerAdapter;
18
 import com.reactnativenavigation.utils.CommandListenerAdapter;
40
     private TopBarBackgroundViewController topBarBackgroundViewController;
40
     private TopBarBackgroundViewController topBarBackgroundViewController;
41
     private TopBarController topBarController;
41
     private TopBarController topBarController;
42
     private BackButtonHelper backButtonHelper;
42
     private BackButtonHelper backButtonHelper;
43
-    private final StackOptionsPresenter presenter;
43
+    private final StackPresenter presenter;
44
 
44
 
45
-    public StackController(Activity activity, List<ViewController> children, ChildControllersRegistry childRegistry, TopBarBackgroundViewController topBarBackgroundViewController, TopBarController topBarController, NavigationAnimator animator, String id, Options initialOptions, BackButtonHelper backButtonHelper, StackOptionsPresenter stackPresenter, OptionsPresenter presenter) {
45
+    public StackController(Activity activity, List<ViewController> children, ChildControllersRegistry childRegistry, TopBarBackgroundViewController topBarBackgroundViewController, TopBarController topBarController, NavigationAnimator animator, String id, Options initialOptions, BackButtonHelper backButtonHelper, StackPresenter stackPresenter, OptionsPresenter presenter) {
46
         super(activity, childRegistry, id, presenter, initialOptions);
46
         super(activity, childRegistry, id, presenter, initialOptions);
47
         this.topBarController = topBarController;
47
         this.topBarController = topBarController;
48
         this.topBarBackgroundViewController = topBarBackgroundViewController;
48
         this.topBarBackgroundViewController = topBarBackgroundViewController;

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerBuilder.java View File

5
 import com.reactnativenavigation.anim.NavigationAnimator;
5
 import com.reactnativenavigation.anim.NavigationAnimator;
6
 import com.reactnativenavigation.parse.Options;
6
 import com.reactnativenavigation.parse.Options;
7
 import com.reactnativenavigation.presentation.OptionsPresenter;
7
 import com.reactnativenavigation.presentation.OptionsPresenter;
8
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
8
+import com.reactnativenavigation.presentation.StackPresenter;
9
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
9
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
10
 import com.reactnativenavigation.viewcontrollers.ReactViewCreator;
10
 import com.reactnativenavigation.viewcontrollers.ReactViewCreator;
11
 import com.reactnativenavigation.viewcontrollers.ViewController;
11
 import com.reactnativenavigation.viewcontrollers.ViewController;
27
     private NavigationAnimator animator;
27
     private NavigationAnimator animator;
28
     private BackButtonHelper backButtonHelper = new BackButtonHelper();
28
     private BackButtonHelper backButtonHelper = new BackButtonHelper();
29
     private OptionsPresenter presenter;
29
     private OptionsPresenter presenter;
30
-    private StackOptionsPresenter stackPresenter;
30
+    private StackPresenter stackPresenter;
31
     private List<ViewController> children = new ArrayList<>();
31
     private List<ViewController> children = new ArrayList<>();
32
 
32
 
33
     public StackControllerBuilder(Activity activity) {
33
     public StackControllerBuilder(Activity activity) {
41
         return this;
41
         return this;
42
     }
42
     }
43
 
43
 
44
-    public StackControllerBuilder setStackPresenter(StackOptionsPresenter stackPresenter) {
44
+    public StackControllerBuilder setStackPresenter(StackPresenter stackPresenter) {
45
         this.stackPresenter = stackPresenter;
45
         this.stackPresenter = stackPresenter;
46
         return this;
46
         return this;
47
     }
47
     }

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/TestUtils.java View File

8
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
8
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
9
 import com.reactnativenavigation.parse.Options;
9
 import com.reactnativenavigation.parse.Options;
10
 import com.reactnativenavigation.parse.params.Bool;
10
 import com.reactnativenavigation.parse.params.Bool;
11
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
11
+import com.reactnativenavigation.presentation.StackPresenter;
12
 import com.reactnativenavigation.utils.ImageLoader;
12
 import com.reactnativenavigation.utils.ImageLoader;
13
 import com.reactnativenavigation.utils.UiUtils;
13
 import com.reactnativenavigation.utils.UiUtils;
14
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
14
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
34
                         return topBar;
34
                         return topBar;
35
                     }
35
                     }
36
                 })
36
                 })
37
-                .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options())                )
37
+                .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options())                )
38
                 .setInitialOptions(new Options());
38
                 .setInitialOptions(new Options());
39
     }
39
     }
40
 
40
 

lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabOptionsPresenterTest.java → lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabPresenterTest.java View File

8
 import com.reactnativenavigation.parse.Options;
8
 import com.reactnativenavigation.parse.Options;
9
 import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.Colour;
10
 import com.reactnativenavigation.parse.params.Text;
10
 import com.reactnativenavigation.parse.params.Text;
11
-import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
11
+import com.reactnativenavigation.presentation.BottomTabPresenter;
12
 import com.reactnativenavigation.views.BottomTabs;
12
 import com.reactnativenavigation.views.BottomTabs;
13
 import com.reactnativenavigation.views.Component;
13
 import com.reactnativenavigation.views.Component;
14
 
14
 
26
 import static org.mockito.Mockito.verify;
26
 import static org.mockito.Mockito.verify;
27
 import static org.mockito.Mockito.verifyNoMoreInteractions;
27
 import static org.mockito.Mockito.verifyNoMoreInteractions;
28
 
28
 
29
-public class BottomTabOptionsPresenterTest extends BaseTest {
29
+public class BottomTabPresenterTest extends BaseTest {
30
     private Options tab1Options = createTab1Options();
30
     private Options tab1Options = createTab1Options();
31
     private Options tab2Options = createTab2Options();
31
     private Options tab2Options = createTab2Options();
32
-    private BottomTabOptionsPresenter uut;
32
+    private BottomTabPresenter uut;
33
     private BottomTabs bottomTabs;
33
     private BottomTabs bottomTabs;
34
     private List<ViewController> tabs;
34
     private List<ViewController> tabs;
35
     private ViewController child3;
35
     private ViewController child3;
43
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
43
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", tab2Options));
44
         child3 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
44
         child3 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
45
         tabs = Arrays.asList(child1, child2, child3);
45
         tabs = Arrays.asList(child1, child2, child3);
46
-        uut = new BottomTabOptionsPresenter(activity, tabs, new Options());
46
+        uut = new BottomTabPresenter(activity, tabs, new Options());
47
         uut.bindView(bottomTabs);
47
         uut.bindView(bottomTabs);
48
         uut.setDefaultOptions(new Options());
48
         uut.setDefaultOptions(new Options());
49
     }
49
     }

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

16
 import com.reactnativenavigation.parse.params.Colour;
16
 import com.reactnativenavigation.parse.params.Colour;
17
 import com.reactnativenavigation.parse.params.Number;
17
 import com.reactnativenavigation.parse.params.Number;
18
 import com.reactnativenavigation.parse.params.Text;
18
 import com.reactnativenavigation.parse.params.Text;
19
-import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
20
-import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
19
+import com.reactnativenavigation.presentation.BottomTabPresenter;
20
+import com.reactnativenavigation.presentation.BottomTabsPresenter;
21
 import com.reactnativenavigation.presentation.OptionsPresenter;
21
 import com.reactnativenavigation.presentation.OptionsPresenter;
22
 import com.reactnativenavigation.react.EventEmitter;
22
 import com.reactnativenavigation.react.EventEmitter;
23
 import com.reactnativenavigation.utils.CommandListenerAdapter;
23
 import com.reactnativenavigation.utils.CommandListenerAdapter;
64
     private EventEmitter eventEmitter;
64
     private EventEmitter eventEmitter;
65
     private ChildControllersRegistry childRegistry;
65
     private ChildControllersRegistry childRegistry;
66
     private List<ViewController> tabs;
66
     private List<ViewController> tabs;
67
-    private BottomTabsOptionsPresenter presenter;
67
+    private BottomTabsPresenter presenter;
68
 
68
 
69
     @Override
69
     @Override
70
     public void beforeEach() {
70
     public void beforeEach() {
80
         child6 = spy(new SimpleViewController(activity, childRegistry, "child6", tabOptions));
80
         child6 = spy(new SimpleViewController(activity, childRegistry, "child6", tabOptions));
81
         when(child5.handleBack(any())).thenReturn(true);
81
         when(child5.handleBack(any())).thenReturn(true);
82
         tabs = createTabs();
82
         tabs = createTabs();
83
-        presenter = spy(new BottomTabsOptionsPresenter(tabs, new Options()));
83
+        presenter = spy(new BottomTabsPresenter(tabs, new Options()));
84
         uut = createBottomTabs();
84
         uut = createBottomTabs();
85
         activity.setContentView(uut.getView());
85
         activity.setContentView(uut.getView());
86
     }
86
     }
231
                 initialOptions,
231
                 initialOptions,
232
                 new OptionsPresenter(activity, new Options()),
232
                 new OptionsPresenter(activity, new Options()),
233
                 presenter,
233
                 presenter,
234
-                new BottomTabOptionsPresenter(activity, tabs, new Options())) {
234
+                new BottomTabPresenter(activity, tabs, new Options())) {
235
             @Override
235
             @Override
236
             public Options resolveCurrentOptions() {
236
             public Options resolveCurrentOptions() {
237
                 return resolvedOptions;
237
                 return resolvedOptions;
340
                 initialOptions,
340
                 initialOptions,
341
                 new OptionsPresenter(activity, new Options()),
341
                 new OptionsPresenter(activity, new Options()),
342
                 presenter,
342
                 presenter,
343
-                new BottomTabOptionsPresenter(activity, tabs, new Options())) {
343
+                new BottomTabPresenter(activity, tabs, new Options())) {
344
             @Override
344
             @Override
345
             public void ensureViewIsCreated() {
345
             public void ensureViewIsCreated() {
346
                 super.ensureViewIsCreated();
346
                 super.ensureViewIsCreated();

lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsOptionsPresenterTest.java → lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsPresenterTest.java View File

7
 import com.reactnativenavigation.parse.Options;
7
 import com.reactnativenavigation.parse.Options;
8
 import com.reactnativenavigation.parse.params.Bool;
8
 import com.reactnativenavigation.parse.params.Bool;
9
 import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.Colour;
10
-import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
10
+import com.reactnativenavigation.presentation.BottomTabsPresenter;
11
 import com.reactnativenavigation.viewcontrollers.bottomtabs.TabSelector;
11
 import com.reactnativenavigation.viewcontrollers.bottomtabs.TabSelector;
12
 import com.reactnativenavigation.views.BottomTabs;
12
 import com.reactnativenavigation.views.BottomTabs;
13
 import com.reactnativenavigation.views.Component;
13
 import com.reactnativenavigation.views.Component;
22
 import static org.mockito.Mockito.verify;
22
 import static org.mockito.Mockito.verify;
23
 import static org.mockito.Mockito.verifyNoMoreInteractions;
23
 import static org.mockito.Mockito.verifyNoMoreInteractions;
24
 
24
 
25
-public class BottomTabsOptionsPresenterTest extends BaseTest {
25
+public class BottomTabsPresenterTest extends BaseTest {
26
     private List<ViewController> tabs;
26
     private List<ViewController> tabs;
27
-    private BottomTabsOptionsPresenter uut;
27
+    private BottomTabsPresenter uut;
28
     private BottomTabs bottomTabs;
28
     private BottomTabs bottomTabs;
29
 
29
 
30
     @Override
30
     @Override
34
         ViewController child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
34
         ViewController child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
35
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
35
         ViewController child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
36
         tabs = Arrays.asList(child1, child2);
36
         tabs = Arrays.asList(child1, child2);
37
-        uut = new BottomTabsOptionsPresenter(tabs, new Options());
37
+        uut = new BottomTabsPresenter(tabs, new Options());
38
         bottomTabs = Mockito.mock(BottomTabs.class);
38
         bottomTabs = Mockito.mock(BottomTabs.class);
39
         uut.bindView(bottomTabs, Mockito.mock(TabSelector.class));
39
         uut.bindView(bottomTabs, Mockito.mock(TabSelector.class));
40
     }
40
     }

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

23
 import com.reactnativenavigation.parse.params.Fraction;
23
 import com.reactnativenavigation.parse.params.Fraction;
24
 import com.reactnativenavigation.parse.params.Text;
24
 import com.reactnativenavigation.parse.params.Text;
25
 import com.reactnativenavigation.presentation.OptionsPresenter;
25
 import com.reactnativenavigation.presentation.OptionsPresenter;
26
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
26
+import com.reactnativenavigation.presentation.StackPresenter;
27
 import com.reactnativenavigation.utils.CommandListenerAdapter;
27
 import com.reactnativenavigation.utils.CommandListenerAdapter;
28
 import com.reactnativenavigation.utils.ImageLoader;
28
 import com.reactnativenavigation.utils.ImageLoader;
29
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
29
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
108
                         .setTopBarController(new TopBarController())
108
                         .setTopBarController(new TopBarController())
109
                         .setId("stackId")
109
                         .setId("stackId")
110
                         .setInitialOptions(new Options())
110
                         .setInitialOptions(new Options())
111
-                        .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
111
+                        .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
112
                         .build();
112
                         .build();
113
         stackController.ensureViewIsCreated();
113
         stackController.ensureViewIsCreated();
114
         stackController.push(uut, new CommandListenerAdapter());
114
         stackController.push(uut, new CommandListenerAdapter());

lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackOptionsPresenterTest.java → lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackPresenterTest.java View File

26
 import com.reactnativenavigation.parse.params.Fraction;
26
 import com.reactnativenavigation.parse.params.Fraction;
27
 import com.reactnativenavigation.parse.params.Number;
27
 import com.reactnativenavigation.parse.params.Number;
28
 import com.reactnativenavigation.parse.params.Text;
28
 import com.reactnativenavigation.parse.params.Text;
29
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
29
+import com.reactnativenavigation.presentation.StackPresenter;
30
 import com.reactnativenavigation.utils.TitleBarHelper;
30
 import com.reactnativenavigation.utils.TitleBarHelper;
31
 import com.reactnativenavigation.views.titlebar.TitleBarReactView;
31
 import com.reactnativenavigation.views.titlebar.TitleBarReactView;
32
 import com.reactnativenavigation.views.topbar.TopBar;
32
 import com.reactnativenavigation.views.topbar.TopBar;
51
 import static org.mockito.Mockito.verify;
51
 import static org.mockito.Mockito.verify;
52
 import static org.mockito.Mockito.when;
52
 import static org.mockito.Mockito.when;
53
 
53
 
54
-public class StackOptionsPresenterTest extends BaseTest {
54
+public class StackPresenterTest extends BaseTest {
55
 
55
 
56
     private static final Options EMPTY_OPTIONS = new Options();
56
     private static final Options EMPTY_OPTIONS = new Options();
57
-    private StackOptionsPresenter uut;
57
+    private StackPresenter uut;
58
     private TestComponentLayout child;
58
     private TestComponentLayout child;
59
     private TestComponentLayout otherChild;
59
     private TestComponentLayout otherChild;
60
     private Activity activity;
60
     private Activity activity;
82
                 return spy(super.create(activity, componentId, componentName));
82
                 return spy(super.create(activity, componentId, componentName));
83
             }
83
             }
84
         };
84
         };
85
-        uut = spy(new StackOptionsPresenter(activity, titleViewCreator, new TopBarButtonCreatorMock(), ImageLoaderMock.mock(), new Options()));
85
+        uut = spy(new StackPresenter(activity, titleViewCreator, new TopBarButtonCreatorMock(), ImageLoaderMock.mock(), new Options()));
86
         topBar = mockTopBar();
86
         topBar = mockTopBar();
87
         uut.bindView(topBar);
87
         uut.bindView(topBar);
88
         uut.setButtonOnClickListener(onClickListener);
88
         uut.setButtonOnClickListener(onClickListener);

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

14
 import com.reactnativenavigation.parse.Options;
14
 import com.reactnativenavigation.parse.Options;
15
 import com.reactnativenavigation.parse.params.Bool;
15
 import com.reactnativenavigation.parse.params.Bool;
16
 import com.reactnativenavigation.parse.params.Text;
16
 import com.reactnativenavigation.parse.params.Text;
17
-import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
18
-import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
17
+import com.reactnativenavigation.presentation.BottomTabPresenter;
18
+import com.reactnativenavigation.presentation.BottomTabsPresenter;
19
 import com.reactnativenavigation.presentation.OptionsPresenter;
19
 import com.reactnativenavigation.presentation.OptionsPresenter;
20
 import com.reactnativenavigation.presentation.OverlayManager;
20
 import com.reactnativenavigation.presentation.OverlayManager;
21
 import com.reactnativenavigation.react.EventEmitter;
21
 import com.reactnativenavigation.react.EventEmitter;
346
 
346
 
347
     @NonNull
347
     @NonNull
348
     private BottomTabsController newTabs(List<ViewController> tabs) {
348
     private BottomTabsController newTabs(List<ViewController> tabs) {
349
-        return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, imageLoaderMock, "tabsController", new Options(), new OptionsPresenter(activity, new Options()), new BottomTabsOptionsPresenter(tabs, new Options()), new BottomTabOptionsPresenter(activity, tabs, new Options()));
349
+        return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, imageLoaderMock, "tabsController", new Options(), new OptionsPresenter(activity, new Options()), new BottomTabsPresenter(tabs, new Options()), new BottomTabPresenter(activity, tabs, new Options()));
350
     }
350
     }
351
 
351
 
352
     @NonNull
352
     @NonNull

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

17
 import com.reactnativenavigation.parse.Options;
17
 import com.reactnativenavigation.parse.Options;
18
 import com.reactnativenavigation.parse.params.Bool;
18
 import com.reactnativenavigation.parse.params.Bool;
19
 import com.reactnativenavigation.parse.params.Text;
19
 import com.reactnativenavigation.parse.params.Text;
20
-import com.reactnativenavigation.presentation.StackOptionsPresenter;
20
+import com.reactnativenavigation.presentation.StackPresenter;
21
 import com.reactnativenavigation.utils.CommandListenerAdapter;
21
 import com.reactnativenavigation.utils.CommandListenerAdapter;
22
 import com.reactnativenavigation.utils.ImageLoader;
22
 import com.reactnativenavigation.utils.ImageLoader;
23
 import com.reactnativenavigation.utils.TitleBarHelper;
23
 import com.reactnativenavigation.utils.TitleBarHelper;
68
     private ViewController child4;
68
     private ViewController child4;
69
     private NavigationAnimator animator;
69
     private NavigationAnimator animator;
70
     private TopBarController topBarController;
70
     private TopBarController topBarController;
71
-    private StackOptionsPresenter presenter;
71
+    private StackPresenter presenter;
72
     private BackButtonHelper backButtonHelper;
72
     private BackButtonHelper backButtonHelper;
73
 
73
 
74
     @Override
74
     @Override
78
         activity = newActivity();
78
         activity = newActivity();
79
         animator = spy(new NavigationAnimator(activity, Mockito.mock(ElementTransitionManager.class)));
79
         animator = spy(new NavigationAnimator(activity, Mockito.mock(ElementTransitionManager.class)));
80
         childRegistry = new ChildControllersRegistry();
80
         childRegistry = new ChildControllersRegistry();
81
-        presenter = spy(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), ImageLoaderMock.mock(), new Options()));
81
+        presenter = spy(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), ImageLoaderMock.mock(), new Options()));
82
         child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
82
         child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
83
         child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
83
         child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));
84
         child3 = spy(new SimpleViewController(activity, childRegistry, "child3", new Options()));
84
         child3 = spy(new SimpleViewController(activity, childRegistry, "child3", new Options()));
260
                         .setTopBarController(new TopBarController())
260
                         .setTopBarController(new TopBarController())
261
                         .setId("uut")
261
                         .setId("uut")
262
                         .setInitialOptions(new Options())
262
                         .setInitialOptions(new Options())
263
-                        .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
263
+                        .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
264
                         .build();
264
                         .build();
265
         uut.ensureViewIsCreated();
265
         uut.ensureViewIsCreated();
266
         uut.push(child1, new CommandListenerAdapter());
266
         uut.push(child1, new CommandListenerAdapter());
774
                         .setTopBarController(new TopBarController())
774
                         .setTopBarController(new TopBarController())
775
                         .setId("stack")
775
                         .setId("stack")
776
                         .setInitialOptions(new Options())
776
                         .setInitialOptions(new Options())
777
-                        .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
777
+                        .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
778
                         .build());
778
                         .build());
779
         Options optionsToMerge = new Options();
779
         Options optionsToMerge = new Options();
780
         Component component = mock(Component.class);
780
         Component component = mock(Component.class);
791
                         .setTopBarController(new TopBarController())
791
                         .setTopBarController(new TopBarController())
792
                         .setId("stack")
792
                         .setId("stack")
793
                         .setInitialOptions(new Options())
793
                         .setInitialOptions(new Options())
794
-                        .setStackPresenter(new StackOptionsPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
794
+                        .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarButtonCreatorMock(), new ImageLoader(), new Options()))
795
                         .build();
795
                         .build();
796
         ParentController parentController = Mockito.mock(ParentController.class);
796
         ParentController parentController = Mockito.mock(ParentController.class);
797
         uut.setParentController(parentController);
797
         uut.setParentController(parentController);