Bladeren bron

rename to component

Daniel Zlotin 7 jaren geleden
bovenliggende
commit
c18dcbf2c3

+ 7
- 7
lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java Bestand weergeven

@@ -5,7 +5,7 @@ import com.reactnativenavigation.parse.NavigationOptions;
5 5
 import com.reactnativenavigation.parse.TopBarOptions;
6 6
 import com.reactnativenavigation.parse.TopTabOptions;
7 7
 import com.reactnativenavigation.parse.TopTabsOptions;
8
-import com.reactnativenavigation.views.Container;
8
+import com.reactnativenavigation.views.Component;
9 9
 import com.reactnativenavigation.views.TopBar;
10 10
 
11 11
 import java.util.ArrayList;
@@ -15,12 +15,12 @@ import static com.reactnativenavigation.parse.NavigationOptions.BooleanOptions.T
15 15
 
16 16
 public class OptionsPresenter {
17 17
 
18
-    private Container reactContainer;
18
+    private Component reactComponent;
19 19
     private TopBar topBar;
20 20
 
21
-    public OptionsPresenter(Container reactContainer) {
22
-        this.reactContainer = reactContainer;
23
-        this.topBar = reactContainer.getTopBar();
21
+    public OptionsPresenter(Component reactComponent) {
22
+        this.reactComponent = reactComponent;
23
+        this.topBar = reactComponent.getTopBar();
24 24
     }
25 25
 
26 26
     public void applyOptions(NavigationOptions options) {
@@ -44,9 +44,9 @@ public class OptionsPresenter {
44 44
             topBar.show(options.animateHide);
45 45
         }
46 46
         if (options.drawBehind == True) {
47
-            reactContainer.drawBehindTopBar();
47
+            reactComponent.drawBehindTopBar();
48 48
         } else if (options.drawBehind == False) {
49
-            reactContainer.drawBelowTopBar();
49
+            reactComponent.drawBelowTopBar();
50 50
         }
51 51
 
52 52
         if (options.hideOnScroll == True) {

+ 9
- 12
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java Bestand weergeven

@@ -1,17 +1,14 @@
1 1
 package com.reactnativenavigation.viewcontrollers;
2 2
 
3
-import android.app.Activity;
4
-import android.support.annotation.NonNull;
5
-import android.support.annotation.RestrictTo;
6
-import android.util.Log;
7
-import android.view.View;
8
-
9
-import com.reactnativenavigation.parse.NavigationOptions;
10
-import com.reactnativenavigation.presentation.NavigationOptionsListener;
11
-import com.reactnativenavigation.views.ReactComponent;
12
-import com.reactnativenavigation.views.TopBar;
13
-
14
-public class ContainerViewController extends ViewController implements NavigationOptionsListener {
3
+import android.app.*;
4
+import android.support.annotation.*;
5
+import android.view.*;
6
+
7
+import com.reactnativenavigation.parse.*;
8
+import com.reactnativenavigation.presentation.*;
9
+import com.reactnativenavigation.views.*;
10
+
11
+public class ComponentViewController extends ViewController implements NavigationOptionsListener {
15 12
 
16 13
     public interface ReactViewCreator {
17 14
 

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/views/Component.java Bestand weergeven

@@ -4,7 +4,7 @@ import android.support.annotation.RestrictTo;
4 4
 import android.view.View;
5 5
 
6 6
 import com.reactnativenavigation.parse.NavigationOptions;
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
8 8
 
9 9
 public interface Component {
10 10
     void applyOptions(NavigationOptions options);

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentLayout.java Bestand weergeven

@@ -7,7 +7,7 @@ import android.widget.RelativeLayout;
7 7
 
8 8
 import com.reactnativenavigation.parse.NavigationOptions;
9 9
 import com.reactnativenavigation.presentation.OptionsPresenter;
10
-import com.reactnativenavigation.views.ReactContainer;
10
+import com.reactnativenavigation.views.ReactComponent;
11 11
 import com.reactnativenavigation.views.TopBar;
12 12
 
13 13
 public class TestComponentLayout extends RelativeLayout implements ReactComponent {

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentView.java Bestand weergeven

@@ -4,7 +4,7 @@ import android.content.Context;
4 4
 import android.view.View;
5 5
 
6 6
 import com.reactnativenavigation.parse.NavigationOptions;
7
-import com.reactnativenavigation.views.ReactContainer;
7
+import com.reactnativenavigation.views.ReactComponent;
8 8
 import com.reactnativenavigation.views.TopBar;
9 9
 
10 10
 public class TestComponentView extends View implements ReactComponent {

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java Bestand weergeven

@@ -144,14 +144,14 @@ public class OptionsApplyingTest extends BaseTest {
144 144
         initialNavigationOptions.topBarOptions.title = "the title";
145 145
         initialNavigationOptions.topBarOptions.drawBehind = NavigationOptions.BooleanOptions.False;
146 146
         uut.onViewAppeared();
147
-        RelativeLayout.LayoutParams uutLayoutParams = (RelativeLayout.LayoutParams) ((ViewGroup) uut.getContainer().asView()).getChildAt(1).getLayoutParams();
147
+        RelativeLayout.LayoutParams uutLayoutParams = (RelativeLayout.LayoutParams) ((ViewGroup) uut.getComponent().asView()).getChildAt(1).getLayoutParams();
148 148
         assertThat(uutLayoutParams.getRule(BELOW)).isNotEqualTo(0);
149 149
 
150 150
         NavigationOptions opts = new NavigationOptions();
151 151
         opts.topBarOptions.drawBehind = NavigationOptions.BooleanOptions.True;
152 152
         uut.mergeNavigationOptions(opts);
153 153
 
154
-        uutLayoutParams = (RelativeLayout.LayoutParams) ((ViewGroup) uut.getContainer().asView()).getChildAt(1).getLayoutParams();
154
+        uutLayoutParams = (RelativeLayout.LayoutParams) ((ViewGroup) uut.getComponent().asView()).getChildAt(1).getLayoutParams();
155 155
         assertThat(uutLayoutParams.getRule(BELOW)).isEqualTo(0);
156 156
     }
157 157
 }