Przeglądaj źródła

Rename presenters

Guy Carmeli 6 lat temu
rodzic
commit
d4c5ea9243
29 zmienionych plików z 77 dodań i 77 usunięć
  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 Wyświetl plik

@@ -5,8 +5,8 @@ import android.app.Activity;
5 5
 import com.facebook.react.ReactInstanceManager;
6 6
 import com.reactnativenavigation.presentation.BottomTabPresenter;
7 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 10
 import com.reactnativenavigation.presentation.StackPresenter;
11 11
 import com.reactnativenavigation.react.EventEmitter;
12 12
 import com.reactnativenavigation.utils.ImageLoader;
@@ -84,8 +84,8 @@ public class LayoutFactory {
84 84
                 childRegistry,
85 85
                 node.id,
86 86
                 parse(typefaceManager, node.getOptions()),
87
-                new SideMenuOptionsPresenter(),
88
-                new OptionsPresenter(activity, defaultOptions)
87
+                new SideMenuPresenter(),
88
+                new Presenter(activity, defaultOptions)
89 89
         );
90 90
 		ViewController childControllerCenter = null, childControllerLeft = null, childControllerRight = null;
91 91
 
@@ -144,7 +144,7 @@ public class LayoutFactory {
144 144
                 name,
145 145
                 new ComponentViewCreator(reactInstanceManager),
146 146
                 parse(typefaceManager, node.getOptions()),
147
-                new OptionsPresenter(activity, defaultOptions)
147
+                new Presenter(activity, defaultOptions)
148 148
         );
149 149
 	}
150 150
 
@@ -169,7 +169,7 @@ public class LayoutFactory {
169 169
                 .setId(node.id)
170 170
                 .setInitialOptions(parse(typefaceManager, node.getOptions()))
171 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 173
                 .build();
174 174
 	}
175 175
 
@@ -193,7 +193,7 @@ public class LayoutFactory {
193 193
                 new ImageLoader(),
194 194
                 node.id,
195 195
                 parse(typefaceManager, node.getOptions()),
196
-                new OptionsPresenter(activity, defaultOptions),
196
+                new Presenter(activity, defaultOptions),
197 197
                 new BottomTabsPresenter(tabs, defaultOptions),
198 198
                 new BottomTabPresenter(activity, tabs, defaultOptions));
199 199
 	}
@@ -206,6 +206,6 @@ public class LayoutFactory {
206 206
             options.setTopTabIndex(i);
207 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 Wyświetl plik

@@ -21,7 +21,7 @@ import static android.widget.RelativeLayout.ALIGN_PARENT_TOP;
21 21
 import static com.github.clans.fab.FloatingActionButton.SIZE_MINI;
22 22
 import static com.github.clans.fab.FloatingActionButton.SIZE_NORMAL;
23 23
 
24
-public class FabOptionsPresenter {
24
+public class FabPresenter {
25 25
     private ViewGroup viewGroup;
26 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 Wyświetl plik

@@ -14,12 +14,12 @@ import com.reactnativenavigation.parse.params.Bool;
14 14
 import com.reactnativenavigation.utils.UiUtils;
15 15
 
16 16
 @SuppressWarnings("FieldCanBeLocal")
17
-public class OptionsPresenter {
17
+public class Presenter {
18 18
 
19 19
     private Activity activity;
20 20
     private Options defaultOptions;
21 21
 
22
-    public OptionsPresenter(Activity activity, Options defaultOptions) {
22
+    public Presenter(Activity activity, Options defaultOptions) {
23 23
         this.activity = activity;
24 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 Wyświetl plik

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

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackPresenter.java Wyświetl plik

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

lib/android/app/src/main/java/com/reactnativenavigation/utils/ButtonOptionsPresenter.java → lib/android/app/src/main/java/com/reactnativenavigation/utils/ButtonPresenter.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ChildController.java Wyświetl plik

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

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java Wyświetl plik

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

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java Wyświetl plik

@@ -10,7 +10,7 @@ import android.view.ViewGroup;
10 10
 
11 11
 import com.reactnativenavigation.parse.Options;
12 12
 import com.reactnativenavigation.parse.params.Bool;
13
-import com.reactnativenavigation.presentation.OptionsPresenter;
13
+import com.reactnativenavigation.presentation.Presenter;
14 14
 import com.reactnativenavigation.utils.CollectionUtils;
15 15
 import com.reactnativenavigation.views.Component;
16 16
 
@@ -18,7 +18,7 @@ import java.util.Collection;
18 18
 
19 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 22
 		super(activity, childRegistry, id, presenter, initialOptions);
23 23
 	}
24 24
 

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarButtonController.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.java Wyświetl plik

@@ -14,7 +14,7 @@ import android.view.ViewTreeObserver;
14 14
 import com.reactnativenavigation.parse.Options;
15 15
 import com.reactnativenavigation.parse.params.Bool;
16 16
 import com.reactnativenavigation.parse.params.NullBool;
17
-import com.reactnativenavigation.presentation.FabOptionsPresenter;
17
+import com.reactnativenavigation.presentation.FabPresenter;
18 18
 import com.reactnativenavigation.utils.CommandListener;
19 19
 import com.reactnativenavigation.utils.StringUtils;
20 20
 import com.reactnativenavigation.utils.Task;
@@ -56,7 +56,7 @@ public abstract class ViewController<T extends ViewGroup> implements ViewTreeObs
56 56
     private boolean isShown;
57 57
     private boolean isDestroyed;
58 58
     private ViewVisibilityListener viewVisibilityListener = new ViewVisibilityListenerAdapter();
59
-    protected FabOptionsPresenter fabOptionsPresenter;
59
+    protected FabPresenter fabOptionsPresenter;
60 60
 
61 61
     public boolean isDestroyed() {
62 62
         return isDestroyed;
@@ -66,7 +66,7 @@ public abstract class ViewController<T extends ViewGroup> implements ViewTreeObs
66 66
         this.activity = activity;
67 67
         this.id = id;
68 68
         this.yellowBoxDelegate = yellowBoxDelegate;
69
-        fabOptionsPresenter = new FabOptionsPresenter();
69
+        fabOptionsPresenter = new FabPresenter();
70 70
         this.initialOptions = initialOptions;
71 71
         options = initialOptions.copy();
72 72
     }

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java Wyświetl plik

@@ -14,7 +14,7 @@ import com.reactnativenavigation.parse.BottomTabOptions;
14 14
 import com.reactnativenavigation.parse.Options;
15 15
 import com.reactnativenavigation.presentation.BottomTabPresenter;
16 16
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
17
-import com.reactnativenavigation.presentation.OptionsPresenter;
17
+import com.reactnativenavigation.presentation.Presenter;
18 18
 import com.reactnativenavigation.react.EventEmitter;
19 19
 import com.reactnativenavigation.utils.CommandListener;
20 20
 import com.reactnativenavigation.utils.ImageLoader;
@@ -42,7 +42,7 @@ public class BottomTabsController extends ParentController implements AHBottomNa
42 42
     private BottomTabsPresenter presenter;
43 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 46
 		super(activity, childRegistry, id, presenter, initialOptions);
47 47
         this.tabs = tabs;
48 48
         this.eventEmitter = eventEmitter;

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java Wyświetl plik

@@ -8,7 +8,7 @@ import android.view.ViewGroup;
8 8
 import android.widget.FrameLayout;
9 9
 
10 10
 import com.reactnativenavigation.parse.Options;
11
-import com.reactnativenavigation.presentation.OptionsPresenter;
11
+import com.reactnativenavigation.presentation.Presenter;
12 12
 import com.reactnativenavigation.presentation.OverlayManager;
13 13
 import com.reactnativenavigation.react.EventEmitter;
14 14
 import com.reactnativenavigation.utils.CommandListener;
@@ -62,7 +62,7 @@ public class Navigator extends ParentController {
62 62
     }
63 63
 
64 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 66
         this.modalStack = modalStack;
67 67
         this.overlayManager = overlayManager;
68 68
         this.rootPresenter = rootPresenter;

+ 4
- 4
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuController.java Wyświetl plik

@@ -11,8 +11,8 @@ import android.view.View;
11 11
 
12 12
 import com.reactnativenavigation.parse.Options;
13 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 16
 import com.reactnativenavigation.utils.CommandListener;
17 17
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
18 18
 import com.reactnativenavigation.viewcontrollers.ParentController;
@@ -29,9 +29,9 @@ public class SideMenuController extends ParentController<DrawerLayout> {
29 29
 	private ViewController center;
30 30
 	private ViewController left;
31 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 35
 		super(activity, childRegistry, id, presenter, initialOptions);
36 36
         this.presenter = sideMenuOptionsPresenter;
37 37
     }

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackController.java Wyświetl plik

@@ -11,7 +11,7 @@ import android.widget.RelativeLayout;
11 11
 
12 12
 import com.reactnativenavigation.anim.NavigationAnimator;
13 13
 import com.reactnativenavigation.parse.Options;
14
-import com.reactnativenavigation.presentation.OptionsPresenter;
14
+import com.reactnativenavigation.presentation.Presenter;
15 15
 import com.reactnativenavigation.presentation.StackPresenter;
16 16
 import com.reactnativenavigation.react.Constants;
17 17
 import com.reactnativenavigation.utils.CommandListener;
@@ -42,7 +42,7 @@ public class StackController extends ParentController<StackLayout> {
42 42
     private BackButtonHelper backButtonHelper;
43 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 46
         super(activity, childRegistry, id, presenter, initialOptions);
47 47
         this.topBarController = topBarController;
48 48
         this.topBarBackgroundViewController = topBarBackgroundViewController;

+ 4
- 4
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/stack/StackControllerBuilder.java Wyświetl plik

@@ -4,7 +4,7 @@ import android.app.Activity;
4 4
 
5 5
 import com.reactnativenavigation.anim.NavigationAnimator;
6 6
 import com.reactnativenavigation.parse.Options;
7
-import com.reactnativenavigation.presentation.OptionsPresenter;
7
+import com.reactnativenavigation.presentation.Presenter;
8 8
 import com.reactnativenavigation.presentation.StackPresenter;
9 9
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
10 10
 import com.reactnativenavigation.viewcontrollers.ReactViewCreator;
@@ -26,13 +26,13 @@ public class StackControllerBuilder {
26 26
     private Options initialOptions = new Options();
27 27
     private NavigationAnimator animator;
28 28
     private BackButtonHelper backButtonHelper = new BackButtonHelper();
29
-    private OptionsPresenter presenter;
29
+    private Presenter presenter;
30 30
     private StackPresenter stackPresenter;
31 31
     private List<ViewController> children = new ArrayList<>();
32 32
 
33 33
     public StackControllerBuilder(Activity activity) {
34 34
         this.activity = activity;
35
-        presenter = new OptionsPresenter(activity, new Options());
35
+        presenter = new Presenter(activity, new Options());
36 36
         animator = new NavigationAnimator(activity, new ElementTransitionManager());
37 37
     }
38 38
 
@@ -46,7 +46,7 @@ public class StackControllerBuilder {
46 46
         return this;
47 47
     }
48 48
 
49
-    public StackControllerBuilder setPresenter(OptionsPresenter presenter) {
49
+    public StackControllerBuilder setPresenter(Presenter presenter) {
50 50
         this.presenter = presenter;
51 51
         return this;
52 52
     }

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsController.java Wyświetl plik

@@ -6,7 +6,7 @@ import android.support.annotation.NonNull;
6 6
 import android.view.View;
7 7
 
8 8
 import com.reactnativenavigation.parse.Options;
9
-import com.reactnativenavigation.presentation.OptionsPresenter;
9
+import com.reactnativenavigation.presentation.Presenter;
10 10
 import com.reactnativenavigation.utils.Task;
11 11
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
12 12
 import com.reactnativenavigation.viewcontrollers.ParentController;
@@ -24,7 +24,7 @@ public class TopTabsController extends ParentController<TopTabsViewPager> {
24 24
     private List<ViewController> tabs;
25 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 28
         super(activity, childRegistry, id, presenter, options);
29 29
         this.viewCreator = viewCreator;
30 30
         this.tabs = tabs;

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleComponentViewController.java Wyświetl plik

@@ -3,11 +3,11 @@ package com.reactnativenavigation.mocks;
3 3
 import android.app.*;
4 4
 
5 5
 import com.reactnativenavigation.parse.*;
6
-import com.reactnativenavigation.presentation.OptionsPresenter;
6
+import com.reactnativenavigation.presentation.Presenter;
7 7
 import com.reactnativenavigation.viewcontrollers.*;
8 8
 
9 9
 public class SimpleComponentViewController extends ComponentViewController {
10 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 Wyświetl plik

@@ -9,7 +9,7 @@ import android.widget.RelativeLayout;
9 9
 import com.facebook.react.ReactInstanceManager;
10 10
 import com.reactnativenavigation.interfaces.ScrollEventListener;
11 11
 import com.reactnativenavigation.parse.Options;
12
-import com.reactnativenavigation.presentation.OptionsPresenter;
12
+import com.reactnativenavigation.presentation.Presenter;
13 13
 import com.reactnativenavigation.react.ReactView;
14 14
 import com.reactnativenavigation.utils.ViewUtils;
15 15
 import com.reactnativenavigation.viewcontrollers.ChildController;
@@ -23,10 +23,10 @@ public class SimpleViewController extends ChildController<SimpleViewController.S
23 23
 
24 24
 
25 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 30
         super(activity, childRegistry, id, presenter, options);
31 31
     }
32 32
 

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/utils/TitleBarHelper.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java Wyświetl plik

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

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ComponentViewControllerTest.java Wyświetl plik

@@ -7,7 +7,7 @@ import com.reactnativenavigation.TestUtils;
7 7
 import com.reactnativenavigation.mocks.TestComponentLayout;
8 8
 import com.reactnativenavigation.mocks.TestReactView;
9 9
 import com.reactnativenavigation.parse.Options;
10
-import com.reactnativenavigation.presentation.OptionsPresenter;
10
+import com.reactnativenavigation.presentation.Presenter;
11 11
 import com.reactnativenavigation.views.StackLayout;
12 12
 
13 13
 import org.junit.Test;
@@ -29,7 +29,7 @@ public class ComponentViewControllerTest extends BaseTest {
29 29
         Activity activity = newActivity();
30 30
         view = spy(new TestComponentLayout(activity, new TestReactView(activity)));
31 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 33
         uut = new ComponentViewController(activity, new ChildControllersRegistry(), "componentId1", "componentName", (activity1, componentId, componentName) -> view, new Options(), presenter);
34 34
         uut.setParentController(parentController);
35 35
         parentController.ensureViewIsCreated();

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java Wyświetl plik

@@ -22,7 +22,7 @@ import com.reactnativenavigation.parse.params.Bool;
22 22
 import com.reactnativenavigation.parse.params.Colour;
23 23
 import com.reactnativenavigation.parse.params.Fraction;
24 24
 import com.reactnativenavigation.parse.params.Text;
25
-import com.reactnativenavigation.presentation.OptionsPresenter;
25
+import com.reactnativenavigation.presentation.Presenter;
26 26
 import com.reactnativenavigation.presentation.StackPresenter;
27 27
 import com.reactnativenavigation.utils.CommandListenerAdapter;
28 28
 import com.reactnativenavigation.utils.ImageLoader;
@@ -65,7 +65,7 @@ public class OptionsApplyingTest extends BaseTest {
65 65
                 "componentName",
66 66
                 (activity1, componentId, componentName) -> view,
67 67
                 initialNavigationOptions,
68
-                new OptionsPresenter(activity, new Options())
68
+                new Presenter(activity, new Options())
69 69
         ) {
70 70
             @Override
71 71
             public boolean isViewShown() {

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ParentControllerTest.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopBarButtonControllerTest.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java Wyświetl plik

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

+ 3
- 3
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/child/ChildControllerTest.java Wyświetl plik

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

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/navigator/NavigatorTest.java Wyświetl plik

@@ -16,7 +16,7 @@ import com.reactnativenavigation.parse.params.Bool;
16 16
 import com.reactnativenavigation.parse.params.Text;
17 17
 import com.reactnativenavigation.presentation.BottomTabPresenter;
18 18
 import com.reactnativenavigation.presentation.BottomTabsPresenter;
19
-import com.reactnativenavigation.presentation.OptionsPresenter;
19
+import com.reactnativenavigation.presentation.Presenter;
20 20
 import com.reactnativenavigation.presentation.OverlayManager;
21 21
 import com.reactnativenavigation.react.EventEmitter;
22 22
 import com.reactnativenavigation.utils.CommandListener;
@@ -346,7 +346,7 @@ public class NavigatorTest extends BaseTest {
346 346
 
347 347
     @NonNull
348 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 352
     @NonNull

+ 5
- 5
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/sidemenu/SideMenuControllerTest.java Wyświetl plik

@@ -12,8 +12,8 @@ import com.reactnativenavigation.parse.Options;
12 12
 import com.reactnativenavigation.parse.SideMenuOptions;
13 13
 import com.reactnativenavigation.parse.params.Bool;
14 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 17
 import com.reactnativenavigation.utils.CommandListenerAdapter;
18 18
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
19 19
 
@@ -31,7 +31,7 @@ public class SideMenuControllerTest extends BaseTest {
31 31
     private SideMenuController uut;
32 32
     private Activity activity;
33 33
     private ChildControllersRegistry childRegistry;
34
-    private SideMenuOptionsPresenter presenter;
34
+    private SideMenuPresenter presenter;
35 35
     private SimpleComponentViewController left;
36 36
     private SimpleComponentViewController right;
37 37
     private SimpleComponentViewController center;
@@ -40,11 +40,11 @@ public class SideMenuControllerTest extends BaseTest {
40 40
     public void beforeEach() {
41 41
         activity = newActivity();
42 42
         childRegistry = new ChildControllersRegistry();
43
-        presenter = spy(new SideMenuOptionsPresenter());
43
+        presenter = spy(new SideMenuPresenter());
44 44
         left = new SimpleComponentViewController(activity, childRegistry, "left", new Options());
45 45
         right = new SimpleComponentViewController(activity, childRegistry, "right", new Options());
46 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 48
         uut.setCenterController(center);
49 49
     }
50 50