Browse Source

Rename presenters

Guy Carmeli 6 years ago
parent
commit
d4c5ea9243
29 changed files with 77 additions and 77 deletions
  1. 8
    8
      lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java
  2. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/FabPresenter.java
  3. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/Presenter.java
  4. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/SideMenuPresenter.java
  5. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackPresenter.java
  6. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/utils/ButtonPresenter.java
  7. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ChildController.java
  8. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java
  9. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java
  10. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarButtonController.java
  11. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.java
  12. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java
  13. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java
  14. 4
    4
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java
  15. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java
  16. 4
    4
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerBuilder.java
  17. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsController.java
  18. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleComponentViewController.java
  19. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java
  20. 1
    1
      lib/android/app/src/test/java/com/reactnativenavigation/utils/TitleBarHelper.java
  21. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java
  22. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ComponentViewControllerTest.java
  23. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
  24. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ParentControllerTest.java
  25. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopBarButtonControllerTest.java
  26. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java
  27. 3
    3
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java
  28. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java
  29. 5
    5
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java

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

5
 import com.facebook.react.ReactInstanceManager;
5
 import com.facebook.react.ReactInstanceManager;
6
 import com.reactnativenavigation.presentation.BottomTabPresenter;
6
 import com.reactnativenavigation.presentation.BottomTabPresenter;
7
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
7
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
8
-import com.reactnativenavigation.presentation.OptionsPresenter;
9
-import com.reactnativenavigation.presentation.SideMenuOptionsPresenter;
8
+import com.reactnativenavigation.presentation.Presenter;
9
+import com.reactnativenavigation.presentation.SideMenuPresenter;
10
 import com.reactnativenavigation.presentation.StackPresenter;
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;
84
                 childRegistry,
84
                 childRegistry,
85
                 node.id,
85
                 node.id,
86
                 parse(typefaceManager, node.getOptions()),
86
                 parse(typefaceManager, node.getOptions()),
87
-                new SideMenuOptionsPresenter(),
88
-                new OptionsPresenter(activity, defaultOptions)
87
+                new SideMenuPresenter(),
88
+                new Presenter(activity, defaultOptions)
89
         );
89
         );
90
 		ViewController childControllerCenter = null, childControllerLeft = null, childControllerRight = null;
90
 		ViewController childControllerCenter = null, childControllerLeft = null, childControllerRight = null;
91
 
91
 
144
                 name,
144
                 name,
145
                 new ComponentViewCreator(reactInstanceManager),
145
                 new ComponentViewCreator(reactInstanceManager),
146
                 parse(typefaceManager, node.getOptions()),
146
                 parse(typefaceManager, node.getOptions()),
147
-                new OptionsPresenter(activity, defaultOptions)
147
+                new Presenter(activity, defaultOptions)
148
         );
148
         );
149
 	}
149
 	}
150
 
150
 
169
                 .setId(node.id)
169
                 .setId(node.id)
170
                 .setInitialOptions(parse(typefaceManager, node.getOptions()))
170
                 .setInitialOptions(parse(typefaceManager, node.getOptions()))
171
                 .setStackPresenter(new StackPresenter(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 Presenter(activity, defaultOptions))
173
                 .build();
173
                 .build();
174
 	}
174
 	}
175
 
175
 
193
                 new ImageLoader(),
193
                 new ImageLoader(),
194
                 node.id,
194
                 node.id,
195
                 parse(typefaceManager, node.getOptions()),
195
                 parse(typefaceManager, node.getOptions()),
196
-                new OptionsPresenter(activity, defaultOptions),
196
+                new Presenter(activity, defaultOptions),
197
                 new BottomTabsPresenter(tabs, defaultOptions),
197
                 new BottomTabsPresenter(tabs, defaultOptions),
198
                 new BottomTabPresenter(activity, tabs, defaultOptions));
198
                 new BottomTabPresenter(activity, tabs, defaultOptions));
199
 	}
199
 	}
206
             options.setTopTabIndex(i);
206
             options.setTopTabIndex(i);
207
             tabs.add(tabController);
207
             tabs.add(tabController);
208
         }
208
         }
209
-        return new TopTabsController(activity, childRegistry, node.id, tabs, new TopTabsLayoutCreator(activity, tabs), parse(typefaceManager, node.getOptions()), new OptionsPresenter(activity, defaultOptions));
209
+        return new TopTabsController(activity, childRegistry, node.id, tabs, new TopTabsLayoutCreator(activity, tabs), parse(typefaceManager, node.getOptions()), new Presenter(activity, defaultOptions));
210
     }
210
     }
211
 }
211
 }

lib/android/app/src/main/java/com/reactnativenavigation/presentation/FabOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/FabPresenter.java View File

21
 import static com.github.clans.fab.FloatingActionButton.SIZE_MINI;
21
 import static com.github.clans.fab.FloatingActionButton.SIZE_MINI;
22
 import static com.github.clans.fab.FloatingActionButton.SIZE_NORMAL;
22
 import static com.github.clans.fab.FloatingActionButton.SIZE_NORMAL;
23
 
23
 
24
-public class FabOptionsPresenter {
24
+public class FabPresenter {
25
     private ViewGroup viewGroup;
25
     private ViewGroup viewGroup;
26
     private ReactComponent component;
26
     private ReactComponent component;
27
 
27
 

lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/Presenter.java View File

14
 import com.reactnativenavigation.utils.UiUtils;
14
 import com.reactnativenavigation.utils.UiUtils;
15
 
15
 
16
 @SuppressWarnings("FieldCanBeLocal")
16
 @SuppressWarnings("FieldCanBeLocal")
17
-public class OptionsPresenter {
17
+public class Presenter {
18
 
18
 
19
     private Activity activity;
19
     private Activity activity;
20
     private Options defaultOptions;
20
     private Options defaultOptions;
21
 
21
 
22
-    public OptionsPresenter(Activity activity, Options defaultOptions) {
22
+    public Presenter(Activity activity, Options defaultOptions) {
23
         this.activity = activity;
23
         this.activity = activity;
24
         this.defaultOptions = defaultOptions;
24
         this.defaultOptions = defaultOptions;
25
     }
25
     }

lib/android/app/src/main/java/com/reactnativenavigation/presentation/SideMenuOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/presentation/SideMenuPresenter.java View File

5
 
5
 
6
 import com.reactnativenavigation.parse.SideMenuRootOptions;
6
 import com.reactnativenavigation.parse.SideMenuRootOptions;
7
 
7
 
8
-public class SideMenuOptionsPresenter {
8
+public class SideMenuPresenter {
9
 
9
 
10
     private DrawerLayout sideMenu;
10
     private DrawerLayout sideMenu;
11
 
11
 

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackPresenter.java View File

20
 import com.reactnativenavigation.parse.TopTabsOptions;
20
 import com.reactnativenavigation.parse.TopTabsOptions;
21
 import com.reactnativenavigation.parse.params.Button;
21
 import com.reactnativenavigation.parse.params.Button;
22
 import com.reactnativenavigation.parse.params.Colour;
22
 import com.reactnativenavigation.parse.params.Colour;
23
-import com.reactnativenavigation.utils.ButtonOptionsPresenter;
23
+import com.reactnativenavigation.utils.ButtonPresenter;
24
 import com.reactnativenavigation.utils.ImageLoader;
24
 import com.reactnativenavigation.utils.ImageLoader;
25
 import com.reactnativenavigation.utils.UiUtils;
25
 import com.reactnativenavigation.utils.UiUtils;
26
 import com.reactnativenavigation.viewcontrollers.IReactView;
26
 import com.reactnativenavigation.viewcontrollers.IReactView;
281
         return new TitleBarButtonController(activity,
281
         return new TitleBarButtonController(activity,
282
                 new NavigationIconResolver(activity, imageLoader),
282
                 new NavigationIconResolver(activity, imageLoader),
283
                 imageLoader,
283
                 imageLoader,
284
-                new ButtonOptionsPresenter(topBar.getTitleBar(), button),
284
+                new ButtonPresenter(topBar.getTitleBar(), button),
285
                 button,
285
                 button,
286
                 buttonCreator,
286
                 buttonCreator,
287
                 onClickListener
287
                 onClickListener

lib/android/app/src/main/java/com/reactnativenavigation/utils/ButtonOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/utils/ButtonPresenter.java View File

19
 
19
 
20
 import java.util.ArrayList;
20
 import java.util.ArrayList;
21
 
21
 
22
-public class ButtonOptionsPresenter {
22
+public class ButtonPresenter {
23
     private final Toolbar toolbar;
23
     private final Toolbar toolbar;
24
     private final ActionMenuView actionMenuView;
24
     private final ActionMenuView actionMenuView;
25
     private Button button;
25
     private Button button;
26
 
26
 
27
-    public ButtonOptionsPresenter(Toolbar toolbar, Button button) {
27
+    public ButtonPresenter(Toolbar toolbar, Button button) {
28
         this.toolbar = toolbar;
28
         this.toolbar = toolbar;
29
         actionMenuView = ViewUtils.findChildrenByClass(toolbar, ActionMenuView.class).get(0);
29
         actionMenuView = ViewUtils.findChildrenByClass(toolbar, ActionMenuView.class).get(0);
30
         this.button = button;
30
         this.button = button;

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

5
 import android.view.ViewGroup;
5
 import android.view.ViewGroup;
6
 
6
 
7
 import com.reactnativenavigation.parse.Options;
7
 import com.reactnativenavigation.parse.Options;
8
-import com.reactnativenavigation.presentation.OptionsPresenter;
8
+import com.reactnativenavigation.presentation.Presenter;
9
 import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
9
 import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
10
 import com.reactnativenavigation.views.Component;
10
 import com.reactnativenavigation.views.Component;
11
 
11
 
12
 public abstract class ChildController<T extends ViewGroup> extends ViewController<T>  {
12
 public abstract class ChildController<T extends ViewGroup> extends ViewController<T>  {
13
-    final OptionsPresenter presenter;
13
+    final Presenter presenter;
14
     private final ChildControllersRegistry childRegistry;
14
     private final ChildControllersRegistry childRegistry;
15
 
15
 
16
     public ChildControllersRegistry getChildRegistry() {
16
     public ChildControllersRegistry getChildRegistry() {
17
         return childRegistry;
17
         return childRegistry;
18
     }
18
     }
19
 
19
 
20
-    public ChildController(Activity activity, ChildControllersRegistry childRegistry, String id, OptionsPresenter presenter, Options initialOptions) {
20
+    public ChildController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, Options initialOptions) {
21
         super(activity, id, new NoOpYellowBoxDelegate(), initialOptions);
21
         super(activity, id, new NoOpYellowBoxDelegate(), initialOptions);
22
         this.presenter = presenter;
22
         this.presenter = presenter;
23
         this.childRegistry = childRegistry;
23
         this.childRegistry = childRegistry;

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java View File

4
 import android.support.annotation.NonNull;
4
 import android.support.annotation.NonNull;
5
 
5
 
6
 import com.reactnativenavigation.parse.Options;
6
 import com.reactnativenavigation.parse.Options;
7
-import com.reactnativenavigation.presentation.OptionsPresenter;
7
+import com.reactnativenavigation.presentation.Presenter;
8
 import com.reactnativenavigation.views.ComponentLayout;
8
 import com.reactnativenavigation.views.ComponentLayout;
9
 import com.reactnativenavigation.views.ReactComponent;
9
 import com.reactnativenavigation.views.ReactComponent;
10
 
10
 
20
                                    final String componentName,
20
                                    final String componentName,
21
                                    final ReactViewCreator viewCreator,
21
                                    final ReactViewCreator viewCreator,
22
                                    final Options initialOptions,
22
                                    final Options initialOptions,
23
-                                   final OptionsPresenter presenter) {
23
+                                   final Presenter presenter) {
24
         super(activity, childRegistry, id, presenter, initialOptions);
24
         super(activity, childRegistry, id, presenter, initialOptions);
25
         this.componentName = componentName;
25
         this.componentName = componentName;
26
         this.viewCreator = viewCreator;
26
         this.viewCreator = viewCreator;

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java View File

10
 
10
 
11
 import com.reactnativenavigation.parse.Options;
11
 import com.reactnativenavigation.parse.Options;
12
 import com.reactnativenavigation.parse.params.Bool;
12
 import com.reactnativenavigation.parse.params.Bool;
13
-import com.reactnativenavigation.presentation.OptionsPresenter;
13
+import com.reactnativenavigation.presentation.Presenter;
14
 import com.reactnativenavigation.utils.CollectionUtils;
14
 import com.reactnativenavigation.utils.CollectionUtils;
15
 import com.reactnativenavigation.views.Component;
15
 import com.reactnativenavigation.views.Component;
16
 
16
 
18
 
18
 
19
 public abstract class ParentController<T extends ViewGroup> extends ChildController {
19
 public abstract class ParentController<T extends ViewGroup> extends ChildController {
20
 
20
 
21
-	public ParentController(Activity activity, ChildControllersRegistry childRegistry, String id, OptionsPresenter presenter, Options initialOptions) {
21
+	public ParentController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, Options initialOptions) {
22
 		super(activity, childRegistry, id, presenter, initialOptions);
22
 		super(activity, childRegistry, id, presenter, initialOptions);
23
 	}
23
 	}
24
 
24
 

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

17
 import com.reactnativenavigation.parse.params.Button;
17
 import com.reactnativenavigation.parse.params.Button;
18
 import com.reactnativenavigation.parse.params.Text;
18
 import com.reactnativenavigation.parse.params.Text;
19
 import com.reactnativenavigation.utils.ArrayUtils;
19
 import com.reactnativenavigation.utils.ArrayUtils;
20
-import com.reactnativenavigation.utils.ButtonOptionsPresenter;
20
+import com.reactnativenavigation.utils.ButtonPresenter;
21
 import com.reactnativenavigation.utils.ImageLoader;
21
 import com.reactnativenavigation.utils.ImageLoader;
22
 import com.reactnativenavigation.utils.ImageLoadingListenerAdapter;
22
 import com.reactnativenavigation.utils.ImageLoadingListenerAdapter;
23
 import com.reactnativenavigation.utils.UiUtils;
23
 import com.reactnativenavigation.utils.UiUtils;
35
 
35
 
36
     private final NavigationIconResolver navigationIconResolver;
36
     private final NavigationIconResolver navigationIconResolver;
37
     private final ImageLoader imageLoader;
37
     private final ImageLoader imageLoader;
38
-    private ButtonOptionsPresenter optionsPresenter;
38
+    private ButtonPresenter optionsPresenter;
39
     private final Button button;
39
     private final Button button;
40
     private final ReactViewCreator viewCreator;
40
     private final ReactViewCreator viewCreator;
41
     private TitleBarButtonController.OnClickListener onPressListener;
41
     private TitleBarButtonController.OnClickListener onPressListener;
53
     public TitleBarButtonController(Activity activity,
53
     public TitleBarButtonController(Activity activity,
54
                                     NavigationIconResolver navigationIconResolver,
54
                                     NavigationIconResolver navigationIconResolver,
55
                                     ImageLoader imageLoader,
55
                                     ImageLoader imageLoader,
56
-                                    ButtonOptionsPresenter optionsPresenter,
56
+                                    ButtonPresenter optionsPresenter,
57
                                     Button button,
57
                                     Button button,
58
                                     ReactViewCreator viewCreator,
58
                                     ReactViewCreator viewCreator,
59
                                     OnClickListener onClickListener) {
59
                                     OnClickListener onClickListener) {

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.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.NullBool;
16
 import com.reactnativenavigation.parse.params.NullBool;
17
-import com.reactnativenavigation.presentation.FabOptionsPresenter;
17
+import com.reactnativenavigation.presentation.FabPresenter;
18
 import com.reactnativenavigation.utils.CommandListener;
18
 import com.reactnativenavigation.utils.CommandListener;
19
 import com.reactnativenavigation.utils.StringUtils;
19
 import com.reactnativenavigation.utils.StringUtils;
20
 import com.reactnativenavigation.utils.Task;
20
 import com.reactnativenavigation.utils.Task;
56
     private boolean isShown;
56
     private boolean isShown;
57
     private boolean isDestroyed;
57
     private boolean isDestroyed;
58
     private ViewVisibilityListener viewVisibilityListener = new ViewVisibilityListenerAdapter();
58
     private ViewVisibilityListener viewVisibilityListener = new ViewVisibilityListenerAdapter();
59
-    protected FabOptionsPresenter fabOptionsPresenter;
59
+    protected FabPresenter fabOptionsPresenter;
60
 
60
 
61
     public boolean isDestroyed() {
61
     public boolean isDestroyed() {
62
         return isDestroyed;
62
         return isDestroyed;
66
         this.activity = activity;
66
         this.activity = activity;
67
         this.id = id;
67
         this.id = id;
68
         this.yellowBoxDelegate = yellowBoxDelegate;
68
         this.yellowBoxDelegate = yellowBoxDelegate;
69
-        fabOptionsPresenter = new FabOptionsPresenter();
69
+        fabOptionsPresenter = new FabPresenter();
70
         this.initialOptions = initialOptions;
70
         this.initialOptions = initialOptions;
71
         options = initialOptions.copy();
71
         options = initialOptions.copy();
72
     }
72
     }

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

14
 import com.reactnativenavigation.parse.Options;
14
 import com.reactnativenavigation.parse.Options;
15
 import com.reactnativenavigation.presentation.BottomTabPresenter;
15
 import com.reactnativenavigation.presentation.BottomTabPresenter;
16
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
16
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
17
-import com.reactnativenavigation.presentation.OptionsPresenter;
17
+import com.reactnativenavigation.presentation.Presenter;
18
 import com.reactnativenavigation.react.EventEmitter;
18
 import com.reactnativenavigation.react.EventEmitter;
19
 import com.reactnativenavigation.utils.CommandListener;
19
 import com.reactnativenavigation.utils.CommandListener;
20
 import com.reactnativenavigation.utils.ImageLoader;
20
 import com.reactnativenavigation.utils.ImageLoader;
42
     private BottomTabsPresenter presenter;
42
     private BottomTabsPresenter presenter;
43
     private BottomTabPresenter tabPresenter;
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, BottomTabsPresenter bottomTabsPresenter, BottomTabPresenter bottomTabPresenter) {
45
+    public BottomTabsController(Activity activity, List<ViewController> tabs, ChildControllersRegistry childRegistry, EventEmitter eventEmitter, ImageLoader imageLoader, String id, Options initialOptions, Presenter 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;

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

8
 import android.widget.FrameLayout;
8
 import android.widget.FrameLayout;
9
 
9
 
10
 import com.reactnativenavigation.parse.Options;
10
 import com.reactnativenavigation.parse.Options;
11
-import com.reactnativenavigation.presentation.OptionsPresenter;
11
+import com.reactnativenavigation.presentation.Presenter;
12
 import com.reactnativenavigation.presentation.OverlayManager;
12
 import com.reactnativenavigation.presentation.OverlayManager;
13
 import com.reactnativenavigation.react.EventEmitter;
13
 import com.reactnativenavigation.react.EventEmitter;
14
 import com.reactnativenavigation.utils.CommandListener;
14
 import com.reactnativenavigation.utils.CommandListener;
62
     }
62
     }
63
 
63
 
64
     public Navigator(final Activity activity, ChildControllersRegistry childRegistry, ModalStack modalStack, OverlayManager overlayManager, RootPresenter rootPresenter) {
64
     public Navigator(final Activity activity, ChildControllersRegistry childRegistry, ModalStack modalStack, OverlayManager overlayManager, RootPresenter rootPresenter) {
65
-        super(activity, childRegistry,"navigator" + CompatUtils.generateViewId(), new OptionsPresenter(activity, new Options()), new Options());
65
+        super(activity, childRegistry,"navigator" + CompatUtils.generateViewId(), new Presenter(activity, new Options()), new Options());
66
         this.modalStack = modalStack;
66
         this.modalStack = modalStack;
67
         this.overlayManager = overlayManager;
67
         this.overlayManager = overlayManager;
68
         this.rootPresenter = rootPresenter;
68
         this.rootPresenter = rootPresenter;

+ 4
- 4
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java View File

11
 
11
 
12
 import com.reactnativenavigation.parse.Options;
12
 import com.reactnativenavigation.parse.Options;
13
 import com.reactnativenavigation.parse.SideMenuOptions;
13
 import com.reactnativenavigation.parse.SideMenuOptions;
14
-import com.reactnativenavigation.presentation.OptionsPresenter;
15
-import com.reactnativenavigation.presentation.SideMenuOptionsPresenter;
14
+import com.reactnativenavigation.presentation.Presenter;
15
+import com.reactnativenavigation.presentation.SideMenuPresenter;
16
 import com.reactnativenavigation.utils.CommandListener;
16
 import com.reactnativenavigation.utils.CommandListener;
17
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
17
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
18
 import com.reactnativenavigation.viewcontrollers.ParentController;
18
 import com.reactnativenavigation.viewcontrollers.ParentController;
29
 	private ViewController center;
29
 	private ViewController center;
30
 	private ViewController left;
30
 	private ViewController left;
31
 	private ViewController right;
31
 	private ViewController right;
32
-    private SideMenuOptionsPresenter presenter;
32
+    private SideMenuPresenter presenter;
33
 
33
 
34
-    public SideMenuController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions, SideMenuOptionsPresenter sideMenuOptionsPresenter, OptionsPresenter presenter) {
34
+    public SideMenuController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions, SideMenuPresenter sideMenuOptionsPresenter, Presenter presenter) {
35
 		super(activity, childRegistry, id, presenter, initialOptions);
35
 		super(activity, childRegistry, id, presenter, initialOptions);
36
         this.presenter = sideMenuOptionsPresenter;
36
         this.presenter = sideMenuOptionsPresenter;
37
     }
37
     }

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

11
 
11
 
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.Presenter;
15
 import com.reactnativenavigation.presentation.StackPresenter;
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;
42
     private BackButtonHelper backButtonHelper;
42
     private BackButtonHelper backButtonHelper;
43
     private final StackPresenter 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, StackPresenter 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, Presenter 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;

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

4
 
4
 
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.Presenter;
8
 import com.reactnativenavigation.presentation.StackPresenter;
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;
26
     private Options initialOptions = new Options();
26
     private Options initialOptions = new Options();
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 Presenter presenter;
30
     private StackPresenter 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) {
34
         this.activity = activity;
34
         this.activity = activity;
35
-        presenter = new OptionsPresenter(activity, new Options());
35
+        presenter = new Presenter(activity, new Options());
36
         animator = new NavigationAnimator(activity, new ElementTransitionManager());
36
         animator = new NavigationAnimator(activity, new ElementTransitionManager());
37
     }
37
     }
38
 
38
 
46
         return this;
46
         return this;
47
     }
47
     }
48
 
48
 
49
-    public StackControllerBuilder setPresenter(OptionsPresenter presenter) {
49
+    public StackControllerBuilder setPresenter(Presenter presenter) {
50
         this.presenter = presenter;
50
         this.presenter = presenter;
51
         return this;
51
         return this;
52
     }
52
     }

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsController.java View File

6
 import android.view.View;
6
 import android.view.View;
7
 
7
 
8
 import com.reactnativenavigation.parse.Options;
8
 import com.reactnativenavigation.parse.Options;
9
-import com.reactnativenavigation.presentation.OptionsPresenter;
9
+import com.reactnativenavigation.presentation.Presenter;
10
 import com.reactnativenavigation.utils.Task;
10
 import com.reactnativenavigation.utils.Task;
11
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
11
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
12
 import com.reactnativenavigation.viewcontrollers.ParentController;
12
 import com.reactnativenavigation.viewcontrollers.ParentController;
24
     private List<ViewController> tabs;
24
     private List<ViewController> tabs;
25
     private TopTabsLayoutCreator viewCreator;
25
     private TopTabsLayoutCreator viewCreator;
26
 
26
 
27
-    public TopTabsController(Activity activity, ChildControllersRegistry childRegistry, String id, List<ViewController> tabs, TopTabsLayoutCreator viewCreator, Options options, OptionsPresenter presenter) {
27
+    public TopTabsController(Activity activity, ChildControllersRegistry childRegistry, String id, List<ViewController> tabs, TopTabsLayoutCreator viewCreator, Options options, Presenter presenter) {
28
         super(activity, childRegistry, id, presenter, options);
28
         super(activity, childRegistry, id, presenter, options);
29
         this.viewCreator = viewCreator;
29
         this.viewCreator = viewCreator;
30
         this.tabs = tabs;
30
         this.tabs = tabs;

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

3
 import android.app.*;
3
 import android.app.*;
4
 
4
 
5
 import com.reactnativenavigation.parse.*;
5
 import com.reactnativenavigation.parse.*;
6
-import com.reactnativenavigation.presentation.OptionsPresenter;
6
+import com.reactnativenavigation.presentation.Presenter;
7
 import com.reactnativenavigation.viewcontrollers.*;
7
 import com.reactnativenavigation.viewcontrollers.*;
8
 
8
 
9
 public class SimpleComponentViewController extends ComponentViewController {
9
 public class SimpleComponentViewController extends ComponentViewController {
10
     public SimpleComponentViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions) {
10
     public SimpleComponentViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions) {
11
-        super(activity, childRegistry,id, "theComponentName", new TestComponentViewCreator(), initialOptions, new OptionsPresenter(activity, new Options()));
11
+        super(activity, childRegistry,id, "theComponentName", new TestComponentViewCreator(), initialOptions, new Presenter(activity, new Options()));
12
     }
12
     }
13
 }
13
 }

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java View File

9
 import com.facebook.react.ReactInstanceManager;
9
 import com.facebook.react.ReactInstanceManager;
10
 import com.reactnativenavigation.interfaces.ScrollEventListener;
10
 import com.reactnativenavigation.interfaces.ScrollEventListener;
11
 import com.reactnativenavigation.parse.Options;
11
 import com.reactnativenavigation.parse.Options;
12
-import com.reactnativenavigation.presentation.OptionsPresenter;
12
+import com.reactnativenavigation.presentation.Presenter;
13
 import com.reactnativenavigation.react.ReactView;
13
 import com.reactnativenavigation.react.ReactView;
14
 import com.reactnativenavigation.utils.ViewUtils;
14
 import com.reactnativenavigation.utils.ViewUtils;
15
 import com.reactnativenavigation.viewcontrollers.ChildController;
15
 import com.reactnativenavigation.viewcontrollers.ChildController;
23
 
23
 
24
 
24
 
25
     public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Options options) {
25
     public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Options options) {
26
-        this(activity, childRegistry, id, new OptionsPresenter(activity, new Options()), options);
26
+        this(activity, childRegistry, id, new Presenter(activity, new Options()), options);
27
     }
27
     }
28
 
28
 
29
-    public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id, OptionsPresenter presenter, Options options) {
29
+    public SimpleViewController(Activity activity, ChildControllersRegistry childRegistry, String id, Presenter presenter, Options options) {
30
         super(activity, childRegistry, id, presenter, options);
30
         super(activity, childRegistry, id, presenter, options);
31
     }
31
     }
32
 
32
 

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/utils/TitleBarHelper.java View File

46
         return new TitleBarButtonController(activity,
46
         return new TitleBarButtonController(activity,
47
                 new NavigationIconResolver(activity, ImageLoaderMock.mock()),
47
                 new NavigationIconResolver(activity, ImageLoaderMock.mock()),
48
                 ImageLoaderMock.mock(),
48
                 ImageLoaderMock.mock(),
49
-                new ButtonOptionsPresenter(titleBar, button),
49
+                new ButtonPresenter(titleBar, button),
50
                 button,
50
                 button,
51
                 new TopBarButtonCreatorMock(),
51
                 new TopBarButtonCreatorMock(),
52
                 buttonId -> {}
52
                 buttonId -> {}

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

18
 import com.reactnativenavigation.parse.params.Text;
18
 import com.reactnativenavigation.parse.params.Text;
19
 import com.reactnativenavigation.presentation.BottomTabPresenter;
19
 import com.reactnativenavigation.presentation.BottomTabPresenter;
20
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
20
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
21
-import com.reactnativenavigation.presentation.OptionsPresenter;
21
+import com.reactnativenavigation.presentation.Presenter;
22
 import com.reactnativenavigation.react.EventEmitter;
22
 import com.reactnativenavigation.react.EventEmitter;
23
 import com.reactnativenavigation.utils.CommandListenerAdapter;
23
 import com.reactnativenavigation.utils.CommandListenerAdapter;
24
 import com.reactnativenavigation.utils.ImageLoader;
24
 import com.reactnativenavigation.utils.ImageLoader;
229
                 imageLoaderMock,
229
                 imageLoaderMock,
230
                 "uut",
230
                 "uut",
231
                 initialOptions,
231
                 initialOptions,
232
-                new OptionsPresenter(activity, new Options()),
232
+                new Presenter(activity, new Options()),
233
                 presenter,
233
                 presenter,
234
                 new BottomTabPresenter(activity, tabs, new Options())) {
234
                 new BottomTabPresenter(activity, tabs, new Options())) {
235
             @Override
235
             @Override
338
                 imageLoaderMock,
338
                 imageLoaderMock,
339
                 "uut",
339
                 "uut",
340
                 initialOptions,
340
                 initialOptions,
341
-                new OptionsPresenter(activity, new Options()),
341
+                new Presenter(activity, new Options()),
342
                 presenter,
342
                 presenter,
343
                 new BottomTabPresenter(activity, tabs, new Options())) {
343
                 new BottomTabPresenter(activity, tabs, new Options())) {
344
             @Override
344
             @Override

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

7
 import com.reactnativenavigation.mocks.TestComponentLayout;
7
 import com.reactnativenavigation.mocks.TestComponentLayout;
8
 import com.reactnativenavigation.mocks.TestReactView;
8
 import com.reactnativenavigation.mocks.TestReactView;
9
 import com.reactnativenavigation.parse.Options;
9
 import com.reactnativenavigation.parse.Options;
10
-import com.reactnativenavigation.presentation.OptionsPresenter;
10
+import com.reactnativenavigation.presentation.Presenter;
11
 import com.reactnativenavigation.views.StackLayout;
11
 import com.reactnativenavigation.views.StackLayout;
12
 
12
 
13
 import org.junit.Test;
13
 import org.junit.Test;
29
         Activity activity = newActivity();
29
         Activity activity = newActivity();
30
         view = spy(new TestComponentLayout(activity, new TestReactView(activity)));
30
         view = spy(new TestComponentLayout(activity, new TestReactView(activity)));
31
         ParentController<StackLayout> parentController = TestUtils.newStackController(activity).build();
31
         ParentController<StackLayout> parentController = TestUtils.newStackController(activity).build();
32
-        OptionsPresenter presenter = new OptionsPresenter(activity, new Options());
32
+        Presenter presenter = new Presenter(activity, new Options());
33
         uut = new ComponentViewController(activity, new ChildControllersRegistry(), "componentId1", "componentName", (activity1, componentId, componentName) -> view, new Options(), presenter);
33
         uut = new ComponentViewController(activity, new ChildControllersRegistry(), "componentId1", "componentName", (activity1, componentId, componentName) -> view, new Options(), presenter);
34
         uut.setParentController(parentController);
34
         uut.setParentController(parentController);
35
         parentController.ensureViewIsCreated();
35
         parentController.ensureViewIsCreated();

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

22
 import com.reactnativenavigation.parse.params.Colour;
22
 import com.reactnativenavigation.parse.params.Colour;
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.Presenter;
26
 import com.reactnativenavigation.presentation.StackPresenter;
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;
65
                 "componentName",
65
                 "componentName",
66
                 (activity1, componentId, componentName) -> view,
66
                 (activity1, componentId, componentName) -> view,
67
                 initialNavigationOptions,
67
                 initialNavigationOptions,
68
-                new OptionsPresenter(activity, new Options())
68
+                new Presenter(activity, new Options())
69
         ) {
69
         ) {
70
             @Override
70
             @Override
71
             public boolean isViewShown() {
71
             public boolean isViewShown() {

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

10
 import com.reactnativenavigation.mocks.SimpleViewController;
10
 import com.reactnativenavigation.mocks.SimpleViewController;
11
 import com.reactnativenavigation.parse.Options;
11
 import com.reactnativenavigation.parse.Options;
12
 import com.reactnativenavigation.parse.params.Text;
12
 import com.reactnativenavigation.parse.params.Text;
13
-import com.reactnativenavigation.presentation.OptionsPresenter;
13
+import com.reactnativenavigation.presentation.Presenter;
14
 import com.reactnativenavigation.utils.CommandListenerAdapter;
14
 import com.reactnativenavigation.utils.CommandListenerAdapter;
15
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
15
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
16
 import com.reactnativenavigation.views.ReactComponent;
16
 import com.reactnativenavigation.views.ReactComponent;
36
     private ChildControllersRegistry childRegistry;
36
     private ChildControllersRegistry childRegistry;
37
     private List<ViewController> children;
37
     private List<ViewController> children;
38
     private ParentController uut;
38
     private ParentController uut;
39
-    private OptionsPresenter presenter;
39
+    private Presenter presenter;
40
 
40
 
41
     @Override
41
     @Override
42
     public void beforeEach() {
42
     public void beforeEach() {
46
         children = new ArrayList<>();
46
         children = new ArrayList<>();
47
         Options initialOptions = new Options();
47
         Options initialOptions = new Options();
48
         initialOptions.topBar.title.text = new Text(INITIAL_TITLE);
48
         initialOptions.topBar.title.text = new Text(INITIAL_TITLE);
49
-        presenter = spy(new OptionsPresenter(activity, new Options()));
49
+        presenter = spy(new Presenter(activity, new Options()));
50
         uut = spy(new ParentController(activity, childRegistry, "uut", presenter, initialOptions) {
50
         uut = spy(new ParentController(activity, childRegistry, "uut", presenter, initialOptions) {
51
 
51
 
52
             @Override
52
             @Override

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

16
 import com.reactnativenavigation.parse.params.NullText;
16
 import com.reactnativenavigation.parse.params.NullText;
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.utils.ButtonOptionsPresenter;
19
+import com.reactnativenavigation.utils.ButtonPresenter;
20
 import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
20
 import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
21
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
21
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
22
 
22
 
35
     private TitleBarButtonController uut;
35
     private TitleBarButtonController uut;
36
     private StackController stackController;
36
     private StackController stackController;
37
     private Button button;
37
     private Button button;
38
-    private ButtonOptionsPresenter optionsPresenter;
38
+    private ButtonPresenter optionsPresenter;
39
 
39
 
40
     @Override
40
     @Override
41
     public void beforeEach() {
41
     public void beforeEach() {
52
         stackController.getTopBar().layout(0, 0, 1080, 200);
52
         stackController.getTopBar().layout(0, 0, 1080, 200);
53
         getTitleBar().layout(0, 0, 1080, 200);
53
         getTitleBar().layout(0, 0, 1080, 200);
54
 
54
 
55
-        optionsPresenter = spy(new ButtonOptionsPresenter(getTitleBar(), button));
55
+        optionsPresenter = spy(new ButtonPresenter(getTitleBar(), button));
56
         uut = new TitleBarButtonController(activity, new NavigationIconResolver(activity, ImageLoaderMock.mock()), ImageLoaderMock.mock(), optionsPresenter, button, buttonCreatorMock, (buttonId) -> {});
56
         uut = new TitleBarButtonController(activity, new NavigationIconResolver(activity, ImageLoaderMock.mock()), ImageLoaderMock.mock(), optionsPresenter, button, buttonCreatorMock, (buttonId) -> {});
57
 
57
 
58
         stackController.ensureViewIsCreated();
58
         stackController.ensureViewIsCreated();

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

12
 import com.reactnativenavigation.parse.Options;
12
 import com.reactnativenavigation.parse.Options;
13
 import com.reactnativenavigation.parse.params.Bool;
13
 import com.reactnativenavigation.parse.params.Bool;
14
 import com.reactnativenavigation.parse.params.Text;
14
 import com.reactnativenavigation.parse.params.Text;
15
-import com.reactnativenavigation.presentation.OptionsPresenter;
15
+import com.reactnativenavigation.presentation.Presenter;
16
 import com.reactnativenavigation.utils.CommandListenerAdapter;
16
 import com.reactnativenavigation.utils.CommandListenerAdapter;
17
 import com.reactnativenavigation.utils.ViewHelper;
17
 import com.reactnativenavigation.utils.ViewHelper;
18
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
18
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
59
         topTabsLayout = spy(new TopTabsViewPager(activity, tabControllers, new TopTabsAdapter(tabControllers)));
59
         topTabsLayout = spy(new TopTabsViewPager(activity, tabControllers, new TopTabsAdapter(tabControllers)));
60
         TopTabsLayoutCreator layoutCreator = Mockito.mock(TopTabsLayoutCreator.class);
60
         TopTabsLayoutCreator layoutCreator = Mockito.mock(TopTabsLayoutCreator.class);
61
         Mockito.when(layoutCreator.create()).thenReturn(topTabsLayout);
61
         Mockito.when(layoutCreator.create()).thenReturn(topTabsLayout);
62
-        OptionsPresenter presenter = new OptionsPresenter(activity, new Options());
62
+        Presenter presenter = new Presenter(activity, new Options());
63
         options.topBar.buttons.back.visible = new Bool(false);
63
         options.topBar.buttons.back.visible = new Bool(false);
64
         uut = spy(new TopTabsController(activity, childRegistry, "componentId", tabControllers, layoutCreator, options, presenter));
64
         uut = spy(new TopTabsController(activity, childRegistry, "componentId", tabControllers, layoutCreator, options, presenter));
65
         tabControllers.forEach(viewController -> viewController.setParentController(uut));
65
         tabControllers.forEach(viewController -> viewController.setParentController(uut));
90
                     "theComponentName",
90
                     "theComponentName",
91
                     new TestComponentViewCreator(),
91
                     new TestComponentViewCreator(),
92
                     tabOptions.get(i),
92
                     tabOptions.get(i),
93
-                    new OptionsPresenter(activity, new Options())
93
+                    new Presenter(activity, new Options())
94
             );
94
             );
95
             tabControllers.add(spy(viewController));
95
             tabControllers.add(spy(viewController));
96
         }
96
         }

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

3
 import com.reactnativenavigation.BaseTest;
3
 import com.reactnativenavigation.BaseTest;
4
 import com.reactnativenavigation.mocks.SimpleViewController;
4
 import com.reactnativenavigation.mocks.SimpleViewController;
5
 import com.reactnativenavigation.parse.Options;
5
 import com.reactnativenavigation.parse.Options;
6
-import com.reactnativenavigation.presentation.OptionsPresenter;
6
+import com.reactnativenavigation.presentation.Presenter;
7
 import com.reactnativenavigation.viewcontrollers.ChildController;
7
 import com.reactnativenavigation.viewcontrollers.ChildController;
8
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
8
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
9
 import com.reactnativenavigation.viewcontrollers.ParentController;
9
 import com.reactnativenavigation.viewcontrollers.ParentController;
20
 
20
 
21
     private ChildController uut;
21
     private ChildController uut;
22
     private ChildControllersRegistry childRegistry;
22
     private ChildControllersRegistry childRegistry;
23
-    private OptionsPresenter presenter;
23
+    private Presenter presenter;
24
     private Options resolvedOptions = new Options();
24
     private Options resolvedOptions = new Options();
25
 
25
 
26
     @Override
26
     @Override
27
     public void beforeEach() {
27
     public void beforeEach() {
28
         childRegistry = spy(new ChildControllersRegistry());
28
         childRegistry = spy(new ChildControllersRegistry());
29
-        presenter = Mockito.mock(OptionsPresenter.class);
29
+        presenter = Mockito.mock(Presenter.class);
30
         uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options()) {
30
         uut = new SimpleViewController(newActivity(), childRegistry, "childId", presenter, new Options()) {
31
             @Override
31
             @Override
32
             public Options resolveCurrentOptions() {
32
             public Options resolveCurrentOptions() {

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

16
 import com.reactnativenavigation.parse.params.Text;
16
 import com.reactnativenavigation.parse.params.Text;
17
 import com.reactnativenavigation.presentation.BottomTabPresenter;
17
 import com.reactnativenavigation.presentation.BottomTabPresenter;
18
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
18
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
19
-import com.reactnativenavigation.presentation.OptionsPresenter;
19
+import com.reactnativenavigation.presentation.Presenter;
20
 import com.reactnativenavigation.presentation.OverlayManager;
20
 import com.reactnativenavigation.presentation.OverlayManager;
21
 import com.reactnativenavigation.react.EventEmitter;
21
 import com.reactnativenavigation.react.EventEmitter;
22
 import com.reactnativenavigation.utils.CommandListener;
22
 import com.reactnativenavigation.utils.CommandListener;
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 BottomTabsPresenter(tabs, new Options()), new BottomTabPresenter(activity, tabs, new Options()));
349
+        return new BottomTabsController(activity, tabs, childRegistry, eventEmitter, imageLoaderMock, "tabsController", new Options(), new Presenter(activity, new Options()), new BottomTabsPresenter(tabs, new Options()), new BottomTabPresenter(activity, tabs, new Options()));
350
     }
350
     }
351
 
351
 
352
     @NonNull
352
     @NonNull

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

12
 import com.reactnativenavigation.parse.SideMenuOptions;
12
 import com.reactnativenavigation.parse.SideMenuOptions;
13
 import com.reactnativenavigation.parse.params.Bool;
13
 import com.reactnativenavigation.parse.params.Bool;
14
 import com.reactnativenavigation.parse.params.Number;
14
 import com.reactnativenavigation.parse.params.Number;
15
-import com.reactnativenavigation.presentation.OptionsPresenter;
16
-import com.reactnativenavigation.presentation.SideMenuOptionsPresenter;
15
+import com.reactnativenavigation.presentation.Presenter;
16
+import com.reactnativenavigation.presentation.SideMenuPresenter;
17
 import com.reactnativenavigation.utils.CommandListenerAdapter;
17
 import com.reactnativenavigation.utils.CommandListenerAdapter;
18
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
18
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
19
 
19
 
31
     private SideMenuController uut;
31
     private SideMenuController uut;
32
     private Activity activity;
32
     private Activity activity;
33
     private ChildControllersRegistry childRegistry;
33
     private ChildControllersRegistry childRegistry;
34
-    private SideMenuOptionsPresenter presenter;
34
+    private SideMenuPresenter presenter;
35
     private SimpleComponentViewController left;
35
     private SimpleComponentViewController left;
36
     private SimpleComponentViewController right;
36
     private SimpleComponentViewController right;
37
     private SimpleComponentViewController center;
37
     private SimpleComponentViewController center;
40
     public void beforeEach() {
40
     public void beforeEach() {
41
         activity = newActivity();
41
         activity = newActivity();
42
         childRegistry = new ChildControllersRegistry();
42
         childRegistry = new ChildControllersRegistry();
43
-        presenter = spy(new SideMenuOptionsPresenter());
43
+        presenter = spy(new SideMenuPresenter());
44
         left = new SimpleComponentViewController(activity, childRegistry, "left", new Options());
44
         left = new SimpleComponentViewController(activity, childRegistry, "left", new Options());
45
         right = new SimpleComponentViewController(activity, childRegistry, "right", new Options());
45
         right = new SimpleComponentViewController(activity, childRegistry, "right", new Options());
46
         center = spy(new SimpleComponentViewController(activity, childRegistry, "center", new Options()));
46
         center = spy(new SimpleComponentViewController(activity, childRegistry, "center", new Options()));
47
-        uut = new SideMenuController(activity, childRegistry, "sideMenu", new Options(), presenter, new OptionsPresenter(activity, new Options()));
47
+        uut = new SideMenuController(activity, childRegistry, "sideMenu", new Options(), presenter, new Presenter(activity, new Options()));
48
         uut.setCenterController(center);
48
         uut.setCenterController(center);
49
     }
49
     }
50
 
50