Browse Source

Rename NavigationIconResolver to IconResolver

New class name is 54% shorter, thus better.
Guy Carmeli 5 years ago
parent
commit
18be994e3f

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

@@ -20,7 +20,7 @@ import com.reactnativenavigation.viewcontrollers.ComponentViewController;
20 20
 import com.reactnativenavigation.viewcontrollers.ViewController;
21 21
 import com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsAttacher;
22 22
 import com.reactnativenavigation.viewcontrollers.bottomtabs.BottomTabsController;
23
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
23
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
24 24
 import com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentCreator;
25 25
 import com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentViewController;
26 26
 import com.reactnativenavigation.viewcontrollers.sidemenu.SideMenuController;
@@ -187,7 +187,7 @@ public class LayoutFactory {
187 187
                         new TitleBarReactViewCreator(reactInstanceManager),
188 188
                         new TopBarBackgroundViewCreator(reactInstanceManager),
189 189
                         new TitleBarButtonCreator(reactInstanceManager),
190
-                        new NavigationIconResolver(activity, new ImageLoader()),
190
+                        new IconResolver(activity, new ImageLoader()),
191 191
                         new RenderChecker(),
192 192
                         defaultOptions
193 193
                 ))

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

@@ -29,7 +29,7 @@ import com.reactnativenavigation.viewcontrollers.ReactViewCreator;
29 29
 import com.reactnativenavigation.viewcontrollers.TitleBarButtonController;
30 30
 import com.reactnativenavigation.viewcontrollers.TitleBarReactViewController;
31 31
 import com.reactnativenavigation.viewcontrollers.ViewController;
32
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
32
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
33 33
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
34 34
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarBackgroundViewController;
35 35
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarController;
@@ -74,13 +74,13 @@ public class StackPresenter {
74 74
     private Map<View, TopBarBackgroundViewController> backgroundControllers = new HashMap();
75 75
     private Map<View, Map<String, TitleBarButtonController>> componentRightButtons = new HashMap();
76 76
     private Map<View, Map<String, TitleBarButtonController>> componentLeftButtons = new HashMap();
77
-    private NavigationIconResolver iconResolver;
77
+    private IconResolver iconResolver;
78 78
 
79 79
     public StackPresenter(Activity activity,
80 80
                           TitleBarReactViewCreator titleViewCreator,
81 81
                           TopBarBackgroundViewCreator topBarBackgroundViewCreator,
82 82
                           ReactViewCreator buttonCreator,
83
-                          NavigationIconResolver iconResolver,
83
+                          IconResolver iconResolver,
84 84
                           RenderChecker renderChecker,
85 85
                           Options defaultOptions) {
86 86
         this.activity = activity;

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

@@ -19,7 +19,7 @@ import com.reactnativenavigation.utils.ImageLoader;
19 19
 import com.reactnativenavigation.utils.ImageLoadingListenerAdapter;
20 20
 import com.reactnativenavigation.utils.UiUtils;
21 21
 import com.reactnativenavigation.utils.ViewUtils;
22
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
22
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
23 23
 import com.reactnativenavigation.views.titlebar.TitleBarReactButtonView;
24 24
 
25 25
 import java.util.List;
@@ -34,7 +34,7 @@ public class TitleBarButtonController extends ViewController<TitleBarReactButton
34 34
         void onPress(String buttonId);
35 35
     }
36 36
 
37
-    private final NavigationIconResolver navigationIconResolver;
37
+    private final IconResolver navigationIconResolver;
38 38
     private ButtonPresenter optionsPresenter;
39 39
     private final Button button;
40 40
     private final ReactViewCreator viewCreator;
@@ -51,7 +51,7 @@ public class TitleBarButtonController extends ViewController<TitleBarReactButton
51 51
     }
52 52
 
53 53
     public TitleBarButtonController(Activity activity,
54
-                                    NavigationIconResolver navigationIconResolver,
54
+                                    IconResolver navigationIconResolver,
55 55
                                     ButtonPresenter optionsPresenter,
56 56
                                     Button button,
57 57
                                     ReactViewCreator viewCreator,

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/button/NavigationIconResolver.java → lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/button/IconResolver.java View File

@@ -12,12 +12,12 @@ import com.reactnativenavigation.utils.ImageLoadingListenerAdapter;
12 12
 
13 13
 import androidx.annotation.NonNull;
14 14
 
15
-public class NavigationIconResolver {
15
+public class IconResolver {
16 16
 
17 17
     private Activity context;
18 18
     private ImageLoader imageLoader;
19 19
 
20
-    public NavigationIconResolver(Activity context, ImageLoader imageLoader) {
20
+    public IconResolver(Activity context, ImageLoader imageLoader) {
21 21
         this.context = context;
22 22
         this.imageLoader = imageLoader;
23 23
     }

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

@@ -17,7 +17,7 @@ import com.reactnativenavigation.utils.ImageLoader;
17 17
 import com.reactnativenavigation.utils.UiUtils;
18 18
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
19 19
 import com.reactnativenavigation.viewcontrollers.ViewController;
20
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
20
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
21 21
 import com.reactnativenavigation.viewcontrollers.stack.StackControllerBuilder;
22 22
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarController;
23 23
 import com.reactnativenavigation.views.StackLayout;
@@ -39,7 +39,7 @@ public class TestUtils {
39 39
                 .setId("stack")
40 40
                 .setChildRegistry(new ChildControllersRegistry())
41 41
                 .setTopBarController(topBarController)
42
-                .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TopBarButtonCreatorMock(), new NavigationIconResolver(activity, new ImageLoader()), new RenderChecker(), new Options()))
42
+                .setStackPresenter(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TopBarButtonCreatorMock(), new IconResolver(activity, new ImageLoader()), new RenderChecker(), new Options()))
43 43
                 .setInitialOptions(new Options());
44 44
     }
45 45
 

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

@@ -8,7 +8,7 @@ import com.reactnativenavigation.parse.Component;
8 8
 import com.reactnativenavigation.parse.params.Button;
9 9
 import com.reactnativenavigation.parse.params.Text;
10 10
 import com.reactnativenavigation.viewcontrollers.TitleBarButtonController;
11
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
11
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
12 12
 import com.reactnativenavigation.views.titlebar.TitleBar;
13 13
 
14 14
 import androidx.appcompat.view.menu.ActionMenuItemView;
@@ -45,7 +45,7 @@ public class TitleBarHelper {
45 45
 
46 46
     public static TitleBarButtonController createButtonController(Activity activity, TitleBar titleBar, Button button) {
47 47
         return new TitleBarButtonController(activity,
48
-                new NavigationIconResolver(activity, ImageLoaderMock.mock()),
48
+                new IconResolver(activity, ImageLoaderMock.mock()),
49 49
                 new ButtonPresenter(titleBar, button),
50 50
                 button,
51 51
                 new TopBarButtonCreatorMock(),

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

@@ -32,7 +32,7 @@ import com.reactnativenavigation.presentation.StackPresenter;
32 32
 import com.reactnativenavigation.utils.CommandListenerAdapter;
33 33
 import com.reactnativenavigation.utils.TitleBarHelper;
34 34
 import com.reactnativenavigation.utils.UiUtils;
35
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
35
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
36 36
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
37 37
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarController;
38 38
 import com.reactnativenavigation.views.StackLayout;
@@ -86,7 +86,7 @@ public class StackPresenterTest extends BaseTest {
86 86
     private Button componentBtn2 = TitleBarHelper.reactViewButton("btn2_");
87 87
     private TopBarController topBarController;
88 88
     private ChildControllersRegistry childRegistry;
89
-    private NavigationIconResolver iconResolver;
89
+    private IconResolver iconResolver;
90 90
 
91 91
     @Override
92 92
     public void beforeEach() {
@@ -98,7 +98,7 @@ public class StackPresenterTest extends BaseTest {
98 98
             }
99 99
         };
100 100
         renderChecker = spy(new RenderChecker());
101
-        iconResolver = new NavigationIconResolver(activity, ImageLoaderMock.mock());
101
+        iconResolver = new IconResolver(activity, ImageLoaderMock.mock());
102 102
         uut = spy(new StackPresenter(activity, titleViewCreator, new TopBarBackgroundViewCreatorMock(), new TopBarButtonCreatorMock(), iconResolver, renderChecker, new Options()));
103 103
         createTopBarController();
104 104
 

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

@@ -16,7 +16,7 @@ import com.reactnativenavigation.parse.params.NullText;
16 16
 import com.reactnativenavigation.parse.params.Number;
17 17
 import com.reactnativenavigation.parse.params.Text;
18 18
 import com.reactnativenavigation.utils.ButtonPresenter;
19
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
19
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
20 20
 import com.reactnativenavigation.viewcontrollers.stack.StackController;
21 21
 
22 22
 import org.junit.Test;
@@ -51,7 +51,7 @@ public class TopBarButtonControllerTest extends BaseTest {
51 51
         getTitleBar().layout(0, 0, 1080, 200);
52 52
 
53 53
         optionsPresenter = spy(new ButtonPresenter(getTitleBar(), button));
54
-        uut = new TitleBarButtonController(activity, new NavigationIconResolver(activity, ImageLoaderMock.mock()), optionsPresenter, button, buttonCreatorMock, (buttonId) -> {});
54
+        uut = new TitleBarButtonController(activity, new IconResolver(activity, ImageLoaderMock.mock()), optionsPresenter, button, buttonCreatorMock, (buttonId) -> {});
55 55
 
56 56
         stackController.ensureViewIsCreated();
57 57
     }

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

@@ -23,7 +23,7 @@ import static org.mockito.Mockito.verify;
23 23
 
24 24
 public class NavigationIconResolverTest extends BaseTest {
25 25
     private static final String ICON_URI = "someIconUri";
26
-    private NavigationIconResolver uut;
26
+    private IconResolver uut;
27 27
     private ImageLoader imageLoader;
28 28
     private Activity context;
29 29
 
@@ -31,7 +31,7 @@ public class NavigationIconResolverTest extends BaseTest {
31 31
     public void beforeEach() {
32 32
         imageLoader = ImageLoaderMock.mock();
33 33
         context = newActivity();
34
-        uut = new NavigationIconResolver(context, imageLoader);
34
+        uut = new IconResolver(context, imageLoader);
35 35
     }
36 36
 
37 37
     @Test

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

@@ -32,7 +32,7 @@ import com.reactnativenavigation.utils.ViewUtils;
32 32
 import com.reactnativenavigation.viewcontrollers.ChildControllersRegistry;
33 33
 import com.reactnativenavigation.viewcontrollers.ParentController;
34 34
 import com.reactnativenavigation.viewcontrollers.ViewController;
35
-import com.reactnativenavigation.viewcontrollers.button.NavigationIconResolver;
35
+import com.reactnativenavigation.viewcontrollers.button.IconResolver;
36 36
 import com.reactnativenavigation.viewcontrollers.topbar.TopBarController;
37 37
 import com.reactnativenavigation.views.StackLayout;
38 38
 import com.reactnativenavigation.views.element.ElementTransitionManager;
@@ -96,7 +96,7 @@ public class StackControllerTest extends BaseTest {
96 96
         StatusBarUtils.saveStatusBarHeight(63);
97 97
         animator = spy(new NavigationAnimator(activity, Mockito.mock(ElementTransitionManager.class)));
98 98
         childRegistry = new ChildControllersRegistry();
99
-        presenter = spy(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TopBarButtonCreatorMock(), new NavigationIconResolver(activity, ImageLoaderMock.mock()), new RenderChecker(), new Options()));
99
+        presenter = spy(new StackPresenter(activity, new TitleBarReactViewCreatorMock(), new TopBarBackgroundViewCreatorMock(), new TopBarButtonCreatorMock(), new IconResolver(activity, ImageLoaderMock.mock()), new RenderChecker(), new Options()));
100 100
         child1 = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
101 101
         child1a = spy(new SimpleViewController(activity, childRegistry, "child1", new Options()));
102 102
         child2 = spy(new SimpleViewController(activity, childRegistry, "child2", new Options()));