Browse Source

Rename Color to Colour

As RNN's Color is used frequently with Android's Color class, we had to use fully qualified names, the rename avoids this.
Guy Carmeli 6 years ago
parent
commit
a322875c98
27 changed files with 97 additions and 89 deletions
  1. 6
    6
      lib/android/app/src/main/java/com/reactnativenavigation/parse/BottomTabOptions.java
  2. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/BottomTabsOptions.java
  3. 4
    4
      lib/android/app/src/main/java/com/reactnativenavigation/parse/FabOptions.java
  4. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutOptions.java
  5. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/StatusBarOptions.java
  6. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/SubtitleOptions.java
  7. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/TitleOptions.java
  8. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarBackgroundOptions.java
  9. 6
    6
      lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarOptions.java
  10. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/parse/TopTabsOptions.java
  11. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/params/Button.java
  12. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/params/Colour.java
  13. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/parse/params/NullColor.java
  14. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/parse/parsers/ColorParser.java
  15. 4
    3
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/StackOptionsPresenter.java
  16. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/views/titlebar/TitleBar.java
  17. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/views/topbar/TopBar.java
  18. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/views/toptabs/TopTabs.java
  19. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/views/toptabs/TopTabsStyleHelper.java
  20. 3
    1
      lib/android/app/src/test/java/com/reactnativenavigation/parse/OptionsTest.java
  21. 6
    5
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabOptionsPresenterTest.java
  22. 3
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsControllerTest.java
  23. 2
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/BottomTabsOptionsPresenterTest.java
  24. 3
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
  25. 13
    13
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackOptionsPresenterTest.java
  26. 11
    10
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopBarButtonControllerTest.java
  27. 3
    2
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/button/NavigationIconResolverTest.java

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

3
 import android.graphics.Typeface;
3
 import android.graphics.Typeface;
4
 import android.support.annotation.Nullable;
4
 import android.support.annotation.Nullable;
5
 
5
 
6
-import com.reactnativenavigation.parse.params.Color;
6
+import com.reactnativenavigation.parse.params.Colour;
7
 import com.reactnativenavigation.parse.params.NullColor;
7
 import com.reactnativenavigation.parse.params.NullColor;
8
 import com.reactnativenavigation.parse.params.NullNumber;
8
 import com.reactnativenavigation.parse.params.NullNumber;
9
 import com.reactnativenavigation.parse.params.NullText;
9
 import com.reactnativenavigation.parse.params.NullText;
38
     }
38
     }
39
 
39
 
40
     public Text text = new NullText();
40
     public Text text = new NullText();
41
-    public Color textColor = new NullColor();
42
-    public Color selectedTextColor = new NullColor();
41
+    public Colour textColor = new NullColor();
42
+    public Colour selectedTextColor = new NullColor();
43
     public Text icon = new NullText();
43
     public Text icon = new NullText();
44
-    public Color iconColor = new NullColor();
45
-    public Color selectedIconColor = new NullColor();
44
+    public Colour iconColor = new NullColor();
45
+    public Colour selectedIconColor = new NullColor();
46
     public Text testId = new NullText();
46
     public Text testId = new NullText();
47
     public Text badge = new NullText();
47
     public Text badge = new NullText();
48
-    public Color badgeColor = new NullColor();
48
+    public Colour badgeColor = new NullColor();
49
     public Number fontSize = new NullNumber();
49
     public Number fontSize = new NullNumber();
50
     public Number selectedFontSize = new NullNumber();
50
     public Number selectedFontSize = new NullNumber();
51
     @Nullable public Typeface fontFamily;
51
     @Nullable public Typeface fontFamily;

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

1
 package com.reactnativenavigation.parse;
1
 package com.reactnativenavigation.parse;
2
 
2
 
3
 import com.reactnativenavigation.parse.params.Bool;
3
 import com.reactnativenavigation.parse.params.Bool;
4
-import com.reactnativenavigation.parse.params.Color;
4
+import com.reactnativenavigation.parse.params.Colour;
5
 import com.reactnativenavigation.parse.params.NullBool;
5
 import com.reactnativenavigation.parse.params.NullBool;
6
 import com.reactnativenavigation.parse.params.NullColor;
6
 import com.reactnativenavigation.parse.params.NullColor;
7
 import com.reactnativenavigation.parse.params.NullNumber;
7
 import com.reactnativenavigation.parse.params.NullNumber;
34
 		return options;
34
 		return options;
35
 	}
35
 	}
36
 
36
 
37
-    public Color backgroundColor = new NullColor();
37
+    public Colour backgroundColor = new NullColor();
38
 	public Bool visible = new NullBool();
38
 	public Bool visible = new NullBool();
39
     public Bool drawBehind = new NullBool();
39
     public Bool drawBehind = new NullBool();
40
 	public Bool animate = new NullBool();
40
 	public Bool animate = new NullBool();

+ 4
- 4
lib/android/app/src/main/java/com/reactnativenavigation/parse/FabOptions.java View File

2
 
2
 
3
 
3
 
4
 import com.reactnativenavigation.parse.params.Bool;
4
 import com.reactnativenavigation.parse.params.Bool;
5
-import com.reactnativenavigation.parse.params.Color;
5
+import com.reactnativenavigation.parse.params.Colour;
6
 import com.reactnativenavigation.parse.params.NullBool;
6
 import com.reactnativenavigation.parse.params.NullBool;
7
 import com.reactnativenavigation.parse.params.NullColor;
7
 import com.reactnativenavigation.parse.params.NullColor;
8
 import com.reactnativenavigation.parse.params.NullText;
8
 import com.reactnativenavigation.parse.params.NullText;
45
     }
45
     }
46
 
46
 
47
     public Text id = new NullText();
47
     public Text id = new NullText();
48
-    public Color backgroundColor = new NullColor();
49
-    public Color clickColor = new NullColor();
50
-    public Color rippleColor = new NullColor();
48
+    public Colour backgroundColor = new NullColor();
49
+    public Colour clickColor = new NullColor();
50
+    public Colour rippleColor = new NullColor();
51
     public Text icon = new NullText();
51
     public Text icon = new NullText();
52
     public Bool visible = new NullBool();
52
     public Bool visible = new NullBool();
53
     public ArrayList<FabOptions> actionsArray = new ArrayList<>();
53
     public ArrayList<FabOptions> actionsArray = new ArrayList<>();

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

1
 package com.reactnativenavigation.parse;
1
 package com.reactnativenavigation.parse;
2
 
2
 
3
-import com.reactnativenavigation.parse.params.Color;
3
+import com.reactnativenavigation.parse.params.Colour;
4
 import com.reactnativenavigation.parse.params.NullColor;
4
 import com.reactnativenavigation.parse.params.NullColor;
5
 import com.reactnativenavigation.parse.params.NullNumber;
5
 import com.reactnativenavigation.parse.params.NullNumber;
6
 import com.reactnativenavigation.parse.params.Number;
6
 import com.reactnativenavigation.parse.params.Number;
21
         return result;
21
         return result;
22
     }
22
     }
23
 
23
 
24
-    public Color backgroundColor = new NullColor();
24
+    public Colour backgroundColor = new NullColor();
25
     public Number topMargin = new NullNumber();
25
     public Number topMargin = new NullNumber();
26
     public OrientationOptions orientation = new OrientationOptions();
26
     public OrientationOptions orientation = new OrientationOptions();
27
 
27
 

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

3
 import android.support.annotation.Nullable;
3
 import android.support.annotation.Nullable;
4
 
4
 
5
 import com.reactnativenavigation.parse.params.Bool;
5
 import com.reactnativenavigation.parse.params.Bool;
6
-import com.reactnativenavigation.parse.params.Color;
6
+import com.reactnativenavigation.parse.params.Colour;
7
 import com.reactnativenavigation.parse.params.NullBool;
7
 import com.reactnativenavigation.parse.params.NullBool;
8
 import com.reactnativenavigation.parse.params.NullColor;
8
 import com.reactnativenavigation.parse.params.NullColor;
9
 import com.reactnativenavigation.parse.parsers.BoolParser;
9
 import com.reactnativenavigation.parse.parsers.BoolParser;
50
         return result;
50
         return result;
51
     }
51
     }
52
 
52
 
53
-    public Color backgroundColor = new NullColor();
53
+    public Colour backgroundColor = new NullColor();
54
     public TextColorScheme textColorScheme = TextColorScheme.None;
54
     public TextColorScheme textColorScheme = TextColorScheme.None;
55
     public Bool visible = new NullBool();
55
     public Bool visible = new NullBool();
56
     public Bool drawBehind = new NullBool();
56
     public Bool drawBehind = new NullBool();

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

3
 import android.graphics.Typeface;
3
 import android.graphics.Typeface;
4
 import android.support.annotation.Nullable;
4
 import android.support.annotation.Nullable;
5
 
5
 
6
-import com.reactnativenavigation.parse.params.Color;
6
+import com.reactnativenavigation.parse.params.Colour;
7
 import com.reactnativenavigation.parse.params.Fraction;
7
 import com.reactnativenavigation.parse.params.Fraction;
8
 import com.reactnativenavigation.parse.params.NullColor;
8
 import com.reactnativenavigation.parse.params.NullColor;
9
 import com.reactnativenavigation.parse.params.NullFraction;
9
 import com.reactnativenavigation.parse.params.NullFraction;
33
     }
33
     }
34
 
34
 
35
     public Text text = new NullText();
35
     public Text text = new NullText();
36
-    public Color color = new NullColor();
36
+    public Colour color = new NullColor();
37
     public Fraction fontSize = new NullFraction();
37
     public Fraction fontSize = new NullFraction();
38
     @Nullable public Typeface fontFamily;
38
     @Nullable public Typeface fontFamily;
39
     public Alignment alignment = Alignment.Default;
39
     public Alignment alignment = Alignment.Default;

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

3
 import android.graphics.Typeface;
3
 import android.graphics.Typeface;
4
 import android.support.annotation.Nullable;
4
 import android.support.annotation.Nullable;
5
 
5
 
6
-import com.reactnativenavigation.parse.params.Color;
6
+import com.reactnativenavigation.parse.params.Colour;
7
 import com.reactnativenavigation.parse.params.Fraction;
7
 import com.reactnativenavigation.parse.params.Fraction;
8
 import com.reactnativenavigation.parse.params.NullColor;
8
 import com.reactnativenavigation.parse.params.NullColor;
9
 import com.reactnativenavigation.parse.params.NullFraction;
9
 import com.reactnativenavigation.parse.params.NullFraction;
35
     }
35
     }
36
 
36
 
37
     public Text text = new NullText();
37
     public Text text = new NullText();
38
-    public Color color = new NullColor();
38
+    public Colour color = new NullColor();
39
     public Fraction fontSize = new NullFraction();
39
     public Fraction fontSize = new NullFraction();
40
     public Alignment alignment = Alignment.Default;
40
     public Alignment alignment = Alignment.Default;
41
     @Nullable public Typeface fontFamily;
41
     @Nullable public Typeface fontFamily;

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/parse/TopBarBackgroundOptions.java View File

1
 package com.reactnativenavigation.parse;
1
 package com.reactnativenavigation.parse;
2
 
2
 
3
-import com.reactnativenavigation.parse.params.Color;
3
+import com.reactnativenavigation.parse.params.Colour;
4
 import com.reactnativenavigation.parse.params.NullColor;
4
 import com.reactnativenavigation.parse.params.NullColor;
5
 import com.reactnativenavigation.parse.parsers.ColorParser;
5
 import com.reactnativenavigation.parse.parsers.ColorParser;
6
 
6
 
15
         options.component = Component.parse(json.optJSONObject("component"));
15
         options.component = Component.parse(json.optJSONObject("component"));
16
 
16
 
17
         if (options.component.hasValue()) {
17
         if (options.component.hasValue()) {
18
-            options.color = new Color(android.graphics.Color.TRANSPARENT);
18
+            options.color = new Colour(android.graphics.Color.TRANSPARENT);
19
         }
19
         }
20
 
20
 
21
         return options;
21
         return options;
22
     }
22
     }
23
 
23
 
24
-    public Color color = new NullColor();
24
+    public Colour color = new NullColor();
25
     public Component component = new Component();
25
     public Component component = new Component();
26
 
26
 
27
     void mergeWith(final TopBarBackgroundOptions other) {
27
     void mergeWith(final TopBarBackgroundOptions other) {

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

5
 
5
 
6
 import com.reactnativenavigation.BuildConfig;
6
 import com.reactnativenavigation.BuildConfig;
7
 import com.reactnativenavigation.parse.params.Bool;
7
 import com.reactnativenavigation.parse.params.Bool;
8
-import com.reactnativenavigation.parse.params.Color;
8
+import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.Fraction;
9
 import com.reactnativenavigation.parse.params.Fraction;
10
 import com.reactnativenavigation.parse.params.NullBool;
10
 import com.reactnativenavigation.parse.params.NullBool;
11
 import com.reactnativenavigation.parse.params.NullColor;
11
 import com.reactnativenavigation.parse.params.NullColor;
62
     public Number height = new NullNumber();
62
     public Number height = new NullNumber();
63
     public Fraction elevation = new NullFraction();
63
     public Fraction elevation = new NullFraction();
64
     public Fraction borderHeight = new NullFraction();
64
     public Fraction borderHeight = new NullFraction();
65
-    public Color borderColor = new NullColor();
65
+    public Colour borderColor = new NullColor();
66
 
66
 
67
     // Deprecated
67
     // Deprecated
68
-    public Color rightButtonColor = new NullColor();
69
-    public Color leftButtonColor = new NullColor();
70
-    public Color rightButtonDisabledColor = new NullColor();
71
-    public Color leftButtonDisabledColor = new NullColor();
68
+    public Colour rightButtonColor = new NullColor();
69
+    public Colour leftButtonColor = new NullColor();
70
+    public Colour rightButtonDisabledColor = new NullColor();
71
+    public Colour leftButtonDisabledColor = new NullColor();
72
 
72
 
73
     public TopBarOptions copy() {
73
     public TopBarOptions copy() {
74
         TopBarOptions result = new TopBarOptions();
74
         TopBarOptions result = new TopBarOptions();

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/parse/TopTabsOptions.java View File

4
 import android.support.annotation.Nullable;
4
 import android.support.annotation.Nullable;
5
 
5
 
6
 import com.reactnativenavigation.parse.params.Bool;
6
 import com.reactnativenavigation.parse.params.Bool;
7
-import com.reactnativenavigation.parse.params.Color;
7
+import com.reactnativenavigation.parse.params.Colour;
8
 import com.reactnativenavigation.parse.params.NullBool;
8
 import com.reactnativenavigation.parse.params.NullBool;
9
 import com.reactnativenavigation.parse.params.NullColor;
9
 import com.reactnativenavigation.parse.params.NullColor;
10
 import com.reactnativenavigation.parse.params.NullNumber;
10
 import com.reactnativenavigation.parse.params.NullNumber;
17
 
17
 
18
 public class TopTabsOptions {
18
 public class TopTabsOptions {
19
 
19
 
20
-    @NonNull public Color selectedTabColor = new NullColor();
21
-    @NonNull public Color unselectedTabColor = new NullColor();
20
+    @NonNull public Colour selectedTabColor = new NullColor();
21
+    @NonNull public Colour unselectedTabColor = new NullColor();
22
     @NonNull public Number fontSize = new NullNumber();
22
     @NonNull public Number fontSize = new NullNumber();
23
     @NonNull public Bool visible = new NullBool();
23
     @NonNull public Bool visible = new NullBool();
24
     @NonNull public Number height = new NullNumber();
24
     @NonNull public Number height = new NullNumber();

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

22
     public Bool enabled = new NullBool();
22
     public Bool enabled = new NullBool();
23
     public Bool disableIconTint = new NullBool();
23
     public Bool disableIconTint = new NullBool();
24
     public Number showAsAction = new NullNumber();
24
     public Number showAsAction = new NullNumber();
25
-    public Color color = new NullColor();
26
-    public Color disabledColor = new NullColor();
25
+    public Colour color = new NullColor();
26
+    public Colour disabledColor = new NullColor();
27
     public Number fontSize = new NullNumber();
27
     public Number fontSize = new NullNumber();
28
     private Text fontWeight = new NullText();
28
     private Text fontWeight = new NullText();
29
     @Nullable public Typeface fontFamily;
29
     @Nullable public Typeface fontFamily;

lib/android/app/src/main/java/com/reactnativenavigation/parse/params/Color.java → lib/android/app/src/main/java/com/reactnativenavigation/parse/params/Colour.java View File

2
 
2
 
3
 import android.support.annotation.ColorInt;
3
 import android.support.annotation.ColorInt;
4
 
4
 
5
-public class Color extends Param<Integer>{
5
+public class Colour extends Param<Integer>{
6
 
6
 
7
-    public Color(@ColorInt int color) {
7
+    public Colour(@ColorInt int color) {
8
         super(color);
8
         super(color);
9
     }
9
     }
10
 
10
 

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/parse/params/NullColor.java View File

1
 package com.reactnativenavigation.parse.params;
1
 package com.reactnativenavigation.parse.params;
2
 
2
 
3
-public class NullColor extends Color {
3
+public class NullColor extends Colour {
4
 
4
 
5
     public NullColor() {
5
     public NullColor() {
6
         super(0);
6
         super(0);

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/parse/parsers/ColorParser.java View File

1
 package com.reactnativenavigation.parse.parsers;
1
 package com.reactnativenavigation.parse.parsers;
2
 
2
 
3
-import com.reactnativenavigation.parse.params.Color;
3
+import com.reactnativenavigation.parse.params.Colour;
4
 import com.reactnativenavigation.parse.params.NullColor;
4
 import com.reactnativenavigation.parse.params.NullColor;
5
 
5
 
6
 import org.json.JSONObject;
6
 import org.json.JSONObject;
7
 
7
 
8
 public class ColorParser {
8
 public class ColorParser {
9
-    public static Color parse(JSONObject json, String color) {
10
-        return json.has(color) ? new Color(json.optInt(color)) : new NullColor();
9
+    public static Colour parse(JSONObject json, String color) {
10
+        return json.has(color) ? new Colour(json.optInt(color)) : new NullColor();
11
     }
11
     }
12
 }
12
 }

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

18
 import com.reactnativenavigation.parse.TopTabOptions;
18
 import com.reactnativenavigation.parse.TopTabOptions;
19
 import com.reactnativenavigation.parse.TopTabsOptions;
19
 import com.reactnativenavigation.parse.TopTabsOptions;
20
 import com.reactnativenavigation.parse.params.Button;
20
 import com.reactnativenavigation.parse.params.Button;
21
+import com.reactnativenavigation.parse.params.Colour;
21
 import com.reactnativenavigation.utils.UiUtils;
22
 import com.reactnativenavigation.utils.UiUtils;
22
 import com.reactnativenavigation.viewcontrollers.IReactView;
23
 import com.reactnativenavigation.viewcontrollers.IReactView;
23
 import com.reactnativenavigation.viewcontrollers.TitleBarReactViewController;
24
 import com.reactnativenavigation.viewcontrollers.TitleBarReactViewController;
165
         }
166
         }
166
     }
167
     }
167
 
168
 
168
-    private void applyButtons(TopBarOptions options, com.reactnativenavigation.parse.params.Color rightButtonColor, com.reactnativenavigation.parse.params.Color leftButtonColor, com.reactnativenavigation.parse.params.Color rightButtonDisabledColor, com.reactnativenavigation.parse.params.Color leftButtonDisabledColor) {
169
+    private void applyButtons(TopBarOptions options, Colour rightButtonColor, Colour leftButtonColor, Colour rightButtonDisabledColor, Colour leftButtonDisabledColor) {
169
         List<Button> rightButtons = mergeButtonsWithColor(options.buttons.right, rightButtonColor, rightButtonDisabledColor);
170
         List<Button> rightButtons = mergeButtonsWithColor(options.buttons.right, rightButtonColor, rightButtonDisabledColor);
170
         List<Button> leftButtons = mergeButtonsWithColor(options.buttons.left, leftButtonColor, leftButtonDisabledColor);
171
         List<Button> leftButtons = mergeButtonsWithColor(options.buttons.left, leftButtonColor, leftButtonDisabledColor);
171
         topBar.setRightButtons(rightButtons);
172
         topBar.setRightButtons(rightButtons);
212
         if (orientationOptions.hasValue()) applyOrientation(orientationOptions);
213
         if (orientationOptions.hasValue()) applyOrientation(orientationOptions);
213
     }
214
     }
214
 
215
 
215
-    private void mergeButtons(TopBarButtons buttons, com.reactnativenavigation.parse.params.Color rightButtonColor, com.reactnativenavigation.parse.params.Color leftButtonColor, com.reactnativenavigation.parse.params.Color rightButtonDisabledColor, com.reactnativenavigation.parse.params.Color leftButtonDisabledColor) {
216
+    private void mergeButtons(TopBarButtons buttons, Colour rightButtonColor, Colour leftButtonColor, Colour rightButtonDisabledColor, Colour leftButtonDisabledColor) {
216
         List<Button> rightButtons = mergeButtonsWithColor(buttons.right, rightButtonColor, rightButtonDisabledColor);
217
         List<Button> rightButtons = mergeButtonsWithColor(buttons.right, rightButtonColor, rightButtonDisabledColor);
217
         List<Button> leftButtons = mergeButtonsWithColor(buttons.left, leftButtonColor, leftButtonDisabledColor);
218
         List<Button> leftButtons = mergeButtonsWithColor(buttons.left, leftButtonColor, leftButtonDisabledColor);
218
         if (buttons.right != null) topBar.setRightButtons(rightButtons);
219
         if (buttons.right != null) topBar.setRightButtons(rightButtons);
221
     }
222
     }
222
 
223
 
223
     @Nullable
224
     @Nullable
224
-    private List<Button> mergeButtonsWithColor(List<Button> buttons, com.reactnativenavigation.parse.params.Color buttonColor, com.reactnativenavigation.parse.params.Color disabledColor) {
225
+    private List<Button> mergeButtonsWithColor(List<Button> buttons, Colour buttonColor, Colour disabledColor) {
225
         List<Button> result = null;
226
         List<Button> result = null;
226
         if (buttons != null) {
227
         if (buttons != null) {
227
             result = new ArrayList<>();
228
             result = new ArrayList<>();

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/views/titlebar/TitleBar.java View File

13
 import com.reactnativenavigation.parse.Alignment;
13
 import com.reactnativenavigation.parse.Alignment;
14
 import com.reactnativenavigation.parse.BackButton;
14
 import com.reactnativenavigation.parse.BackButton;
15
 import com.reactnativenavigation.parse.params.Button;
15
 import com.reactnativenavigation.parse.params.Button;
16
-import com.reactnativenavigation.parse.params.Color;
16
+import com.reactnativenavigation.parse.params.Colour;
17
 import com.reactnativenavigation.utils.ButtonOptionsPresenter;
17
 import com.reactnativenavigation.utils.ButtonOptionsPresenter;
18
 import com.reactnativenavigation.utils.ImageLoader;
18
 import com.reactnativenavigation.utils.ImageLoader;
19
 import com.reactnativenavigation.utils.UiUtils;
19
 import com.reactnativenavigation.utils.UiUtils;
57
         return super.getTitle() == null ? "" : (String) super.getTitle();
57
         return super.getTitle() == null ? "" : (String) super.getTitle();
58
     }
58
     }
59
 
59
 
60
-    public void setTitleTextColor(Color color) {
60
+    public void setTitleTextColor(Colour color) {
61
         if (color.hasValue()) setTitleTextColor(color.get());
61
         if (color.hasValue()) setTitleTextColor(color.get());
62
     }
62
     }
63
 
63
 
68
         addView(component);
68
         addView(component);
69
     }
69
     }
70
 
70
 
71
-    public void setBackgroundColor(Color color) {
71
+    public void setBackgroundColor(Colour color) {
72
         if (color.hasValue()) setBackgroundColor(color.get());
72
         if (color.hasValue()) setBackgroundColor(color.get());
73
     }
73
     }
74
 
74
 

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/views/topbar/TopBar.java View File

29
 import com.reactnativenavigation.parse.BackButton;
29
 import com.reactnativenavigation.parse.BackButton;
30
 import com.reactnativenavigation.parse.Component;
30
 import com.reactnativenavigation.parse.Component;
31
 import com.reactnativenavigation.parse.params.Button;
31
 import com.reactnativenavigation.parse.params.Button;
32
-import com.reactnativenavigation.parse.params.Color;
32
+import com.reactnativenavigation.parse.params.Colour;
33
 import com.reactnativenavigation.parse.params.Number;
33
 import com.reactnativenavigation.parse.params.Number;
34
 import com.reactnativenavigation.utils.CompatUtils;
34
 import com.reactnativenavigation.utils.CompatUtils;
35
 import com.reactnativenavigation.utils.ImageLoader;
35
 import com.reactnativenavigation.utils.ImageLoader;
191
         topTabs.setFontFamily(tabIndex, fontFamily);
191
         topTabs.setFontFamily(tabIndex, fontFamily);
192
     }
192
     }
193
 
193
 
194
-    public void applyTopTabsColors(Color selectedTabColor, Color unselectedTabColor) {
194
+    public void applyTopTabsColors(Colour selectedTabColor, Colour unselectedTabColor) {
195
         topTabs.applyTopTabsColors(selectedTabColor, unselectedTabColor);
195
         topTabs.applyTopTabsColors(selectedTabColor, unselectedTabColor);
196
     }
196
     }
197
 
197
 

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

6
 import android.support.v4.view.ViewPager;
6
 import android.support.v4.view.ViewPager;
7
 import android.view.ViewManager;
7
 import android.view.ViewManager;
8
 
8
 
9
-import com.reactnativenavigation.parse.params.Color;
9
+import com.reactnativenavigation.parse.params.Colour;
10
 import com.reactnativenavigation.parse.params.Number;
10
 import com.reactnativenavigation.parse.params.Number;
11
 import com.reactnativenavigation.views.topbar.TopBar;
11
 import com.reactnativenavigation.views.topbar.TopBar;
12
 
12
 
30
         return EMPTY_STATE_SET;
30
         return EMPTY_STATE_SET;
31
     }
31
     }
32
 
32
 
33
-    public void applyTopTabsColors(Color selectedTabColor, Color unselectedTabColor) {
33
+    public void applyTopTabsColors(Colour selectedTabColor, Colour unselectedTabColor) {
34
         styleHelper.applyTopTabsColors(selectedTabColor, unselectedTabColor);
34
         styleHelper.applyTopTabsColors(selectedTabColor, unselectedTabColor);
35
     }
35
     }
36
 
36
 

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

5
 import android.view.ViewGroup;
5
 import android.view.ViewGroup;
6
 import android.widget.TextView;
6
 import android.widget.TextView;
7
 
7
 
8
-import com.reactnativenavigation.parse.params.Color;
8
+import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.Number;
9
 import com.reactnativenavigation.parse.params.Number;
10
 import com.reactnativenavigation.utils.Task;
10
 import com.reactnativenavigation.utils.Task;
11
 import com.reactnativenavigation.utils.ViewUtils;
11
 import com.reactnativenavigation.utils.ViewUtils;
24
         }
24
         }
25
     }
25
     }
26
 
26
 
27
-    void applyTopTabsColors(Color selected, Color unselected) {
27
+    void applyTopTabsColors(Colour selected, Colour unselected) {
28
         ColorStateList originalColors = topTabs.getTabTextColors();
28
         ColorStateList originalColors = topTabs.getTabTextColors();
29
         int selectedTabColor = originalColors != null ? originalColors.getColorForState(topTabs.getSelectedTabColors(), -1) : -1;
29
         int selectedTabColor = originalColors != null ? originalColors.getColorForState(topTabs.getSelectedTabColors(), -1) : -1;
30
         int tabTextColor = originalColors != null ? originalColors.getColorForState(topTabs.getDefaultTabColors(), -1) : -1;
30
         int tabTextColor = originalColors != null ? originalColors.getColorForState(topTabs.getDefaultTabColors(), -1) : -1;

+ 3
- 1
lib/android/app/src/test/java/com/reactnativenavigation/parse/OptionsTest.java View File

1
 package com.reactnativenavigation.parse;
1
 package com.reactnativenavigation.parse;
2
 
2
 
3
+import android.graphics.Color;
3
 import android.graphics.Typeface;
4
 import android.graphics.Typeface;
4
 import android.support.annotation.NonNull;
5
 import android.support.annotation.NonNull;
5
 
6
 
6
 import com.reactnativenavigation.BaseTest;
7
 import com.reactnativenavigation.BaseTest;
7
 import com.reactnativenavigation.mocks.TypefaceLoaderMock;
8
 import com.reactnativenavigation.mocks.TypefaceLoaderMock;
8
 import com.reactnativenavigation.parse.params.Bool;
9
 import com.reactnativenavigation.parse.params.Bool;
10
+import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.NullText;
11
 import com.reactnativenavigation.parse.params.NullText;
10
 import com.reactnativenavigation.parse.params.Number;
12
 import com.reactnativenavigation.parse.params.Number;
11
 import com.reactnativenavigation.parse.params.Text;
13
 import com.reactnativenavigation.parse.params.Text;
269
     @Test
271
     @Test
270
     public void clear_bottomTabsOptions() {
272
     public void clear_bottomTabsOptions() {
271
         Options uut = new Options();
273
         Options uut = new Options();
272
-        uut.bottomTabsOptions.backgroundColor = new com.reactnativenavigation.parse.params.Color(android.graphics.Color.RED);
274
+        uut.bottomTabsOptions.backgroundColor = new Colour(Color.RED);
273
         uut.clearBottomTabsOptions();
275
         uut.clearBottomTabsOptions();
274
         assertThat(uut.bottomTabsOptions.backgroundColor.hasValue()).isFalse();
276
         assertThat(uut.bottomTabsOptions.backgroundColor.hasValue()).isFalse();
275
     }
277
     }

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

1
 package com.reactnativenavigation.viewcontrollers;
1
 package com.reactnativenavigation.viewcontrollers;
2
 
2
 
3
 import android.app.Activity;
3
 import android.app.Activity;
4
+import android.graphics.Color;
4
 
5
 
5
 import com.reactnativenavigation.BaseTest;
6
 import com.reactnativenavigation.BaseTest;
6
 import com.reactnativenavigation.mocks.SimpleViewController;
7
 import com.reactnativenavigation.mocks.SimpleViewController;
7
 import com.reactnativenavigation.parse.Options;
8
 import com.reactnativenavigation.parse.Options;
8
-import com.reactnativenavigation.parse.params.Color;
9
+import com.reactnativenavigation.parse.params.Colour;
9
 import com.reactnativenavigation.parse.params.Text;
10
 import com.reactnativenavigation.parse.params.Text;
10
 import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
11
 import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
11
 import com.reactnativenavigation.views.BottomTabs;
12
 import com.reactnativenavigation.views.BottomTabs;
81
     private Options createTab1Options() {
82
     private Options createTab1Options() {
82
         Options options = new Options();
83
         Options options = new Options();
83
         options.bottomTabOptions.badge = new Text("tab1badge");
84
         options.bottomTabOptions.badge = new Text("tab1badge");
84
-        options.bottomTabOptions.iconColor = new Color(android.graphics.Color.RED);
85
-        options.bottomTabOptions.selectedIconColor = new Color(android.graphics.Color.RED);
85
+        options.bottomTabOptions.iconColor = new Colour(Color.RED);
86
+        options.bottomTabOptions.selectedIconColor = new Colour(Color.RED);
86
         return options;
87
         return options;
87
     }
88
     }
88
 
89
 
89
     private Options createTab2Options() {
90
     private Options createTab2Options() {
90
         Options options = new Options();
91
         Options options = new Options();
91
         options.bottomTabOptions.badge = new Text("tab2badge");
92
         options.bottomTabOptions.badge = new Text("tab2badge");
92
-        options.bottomTabOptions.iconColor = new Color(android.graphics.Color.RED);
93
-        options.bottomTabOptions.selectedIconColor = new Color(android.graphics.Color.RED);
93
+        options.bottomTabOptions.iconColor = new Colour(Color.RED);
94
+        options.bottomTabOptions.selectedIconColor = new Colour(Color.RED);
94
         return options;
95
         return options;
95
     }
96
     }
96
 }
97
 }

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

1
 package com.reactnativenavigation.viewcontrollers;
1
 package com.reactnativenavigation.viewcontrollers;
2
 
2
 
3
 import android.app.Activity;
3
 import android.app.Activity;
4
+import android.graphics.Color;
4
 import android.support.annotation.NonNull;
5
 import android.support.annotation.NonNull;
5
 import android.view.View;
6
 import android.view.View;
6
 import android.view.ViewGroup;
7
 import android.view.ViewGroup;
13
 import com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock;
14
 import com.reactnativenavigation.mocks.TitleBarReactViewCreatorMock;
14
 import com.reactnativenavigation.parse.Options;
15
 import com.reactnativenavigation.parse.Options;
15
 import com.reactnativenavigation.parse.params.Bool;
16
 import com.reactnativenavigation.parse.params.Bool;
16
-import com.reactnativenavigation.parse.params.Color;
17
+import com.reactnativenavigation.parse.params.Colour;
17
 import com.reactnativenavigation.parse.params.Number;
18
 import com.reactnativenavigation.parse.params.Number;
18
 import com.reactnativenavigation.parse.params.Text;
19
 import com.reactnativenavigation.parse.params.Text;
19
 import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
20
 import com.reactnativenavigation.presentation.BottomTabOptionsPresenter;
157
     @Test
158
     @Test
158
     public void applyOptions_bottomTabsOptionsAreClearedAfterApply() {
159
     public void applyOptions_bottomTabsOptionsAreClearedAfterApply() {
159
         Options options = new Options();
160
         Options options = new Options();
160
-        options.bottomTabsOptions.backgroundColor = new Color(android.graphics.Color.RED);
161
+        options.bottomTabsOptions.backgroundColor = new Colour(Color.RED);
161
         child1.mergeOptions(options);
162
         child1.mergeOptions(options);
162
         uut.ensureViewIsCreated();
163
         uut.ensureViewIsCreated();
163
 
164
 

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

6
 import com.reactnativenavigation.mocks.SimpleViewController;
6
 import com.reactnativenavigation.mocks.SimpleViewController;
7
 import com.reactnativenavigation.parse.Options;
7
 import com.reactnativenavigation.parse.Options;
8
 import com.reactnativenavigation.parse.params.Bool;
8
 import com.reactnativenavigation.parse.params.Bool;
9
-import com.reactnativenavigation.parse.params.Color;
9
+import com.reactnativenavigation.parse.params.Colour;
10
 import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
10
 import com.reactnativenavigation.presentation.BottomTabsOptionsPresenter;
11
 import com.reactnativenavigation.viewcontrollers.bottomtabs.TabSelector;
11
 import com.reactnativenavigation.viewcontrollers.bottomtabs.TabSelector;
12
 import com.reactnativenavigation.views.BottomTabs;
12
 import com.reactnativenavigation.views.BottomTabs;
46
         uut.setDefaultOptions(defaultOptions);
46
         uut.setDefaultOptions(defaultOptions);
47
 
47
 
48
         Options options = new Options();
48
         Options options = new Options();
49
-        options.bottomTabsOptions.backgroundColor = new Color(10);
49
+        options.bottomTabsOptions.backgroundColor = new Colour(10);
50
         uut.mergeChildOptions(options, (Component) tabs.get(0).getView());
50
         uut.mergeChildOptions(options, (Component) tabs.get(0).getView());
51
         verify(bottomTabs).setBackgroundColor(options.bottomTabsOptions.backgroundColor.get());
51
         verify(bottomTabs).setBackgroundColor(options.bottomTabsOptions.backgroundColor.get());
52
         verifyNoMoreInteractions(bottomTabs);
52
         verifyNoMoreInteractions(bottomTabs);

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

19
 import com.reactnativenavigation.parse.SubtitleOptions;
19
 import com.reactnativenavigation.parse.SubtitleOptions;
20
 import com.reactnativenavigation.parse.TopBarBackgroundOptions;
20
 import com.reactnativenavigation.parse.TopBarBackgroundOptions;
21
 import com.reactnativenavigation.parse.params.Bool;
21
 import com.reactnativenavigation.parse.params.Bool;
22
+import com.reactnativenavigation.parse.params.Colour;
22
 import com.reactnativenavigation.parse.params.Fraction;
23
 import com.reactnativenavigation.parse.params.Fraction;
23
 import com.reactnativenavigation.parse.params.Text;
24
 import com.reactnativenavigation.parse.params.Text;
24
 import com.reactnativenavigation.presentation.OptionsPresenter;
25
 import com.reactnativenavigation.presentation.OptionsPresenter;
142
         uut.onViewAppeared();
143
         uut.onViewAppeared();
143
 
144
 
144
         Options opts = new Options();
145
         Options opts = new Options();
145
-        opts.topBar.background.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
146
+        opts.topBar.background.color = new Colour(Color.RED);
146
         uut.mergeOptions(opts);
147
         uut.mergeOptions(opts);
147
 
148
 
148
         assertThat(((ColorDrawable) stackController.getTopBar().getBackground()).getColor()).isEqualTo(Color.RED);
149
         assertThat(((ColorDrawable) stackController.getTopBar().getBackground()).getColor()).isEqualTo(Color.RED);
156
             public void onSuccess(String childId) {
157
             public void onSuccess(String childId) {
157
                 Options opts = new Options();
158
                 Options opts = new Options();
158
                 opts.topBar.title.text = new Text("the title");
159
                 opts.topBar.title.text = new Text("the title");
159
-                opts.topBar.title.color = new com.reactnativenavigation.parse.params.Color(Color.RED);
160
+                opts.topBar.title.color = new Colour(Color.RED);
160
                 uut.mergeOptions(opts);
161
                 uut.mergeOptions(opts);
161
 
162
 
162
                 assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);
163
                 assertThat(stackController.getTopBar().getTitleTextView()).isNotEqualTo(null);

+ 13
- 13
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/StackOptionsPresenterTest.java View File

18
 import com.reactnativenavigation.parse.TitleOptions;
18
 import com.reactnativenavigation.parse.TitleOptions;
19
 import com.reactnativenavigation.parse.params.Bool;
19
 import com.reactnativenavigation.parse.params.Bool;
20
 import com.reactnativenavigation.parse.params.Button;
20
 import com.reactnativenavigation.parse.params.Button;
21
-import com.reactnativenavigation.parse.params.Color;
21
+import com.reactnativenavigation.parse.params.Colour;
22
 import com.reactnativenavigation.parse.params.Fraction;
22
 import com.reactnativenavigation.parse.params.Fraction;
23
 import com.reactnativenavigation.parse.params.Number;
23
 import com.reactnativenavigation.parse.params.Number;
24
 import com.reactnativenavigation.parse.params.Text;
24
 import com.reactnativenavigation.parse.params.Text;
154
         title.text = new Text("abc");
154
         title.text = new Text("abc");
155
         title.component.name = new Text("someComponent");
155
         title.component.name = new Text("someComponent");
156
         title.component.componentId = new Text("compId");
156
         title.component.componentId = new Text("compId");
157
-        title.color = new Color(0);
157
+        title.color = new Colour(0);
158
         title.fontSize = new Fraction(1.0f);
158
         title.fontSize = new Fraction(1.0f);
159
         title.fontFamily = Typeface.DEFAULT_BOLD;
159
         title.fontFamily = Typeface.DEFAULT_BOLD;
160
         options.topBar.title = title;
160
         options.topBar.title = title;
161
         SubtitleOptions subtitleOptions = new SubtitleOptions();
161
         SubtitleOptions subtitleOptions = new SubtitleOptions();
162
         subtitleOptions.text = new Text("Sub");
162
         subtitleOptions.text = new Text("Sub");
163
-        subtitleOptions.color = new Color(1);
163
+        subtitleOptions.color = new Colour(1);
164
         options.topBar.subtitle = subtitleOptions;
164
         options.topBar.subtitle = subtitleOptions;
165
-        options.topBar.background.color = new Color(0);
165
+        options.topBar.background.color = new Colour(0);
166
         options.topBar.testId = new Text("test123");
166
         options.topBar.testId = new Text("test123");
167
         options.topBar.animate = new Bool(false);
167
         options.topBar.animate = new Bool(false);
168
         options.topBar.visible = new Bool(false);
168
         options.topBar.visible = new Bool(false);
187
         verify(topBar, times(0)).applyTopTabsFontSize(any());
187
         verify(topBar, times(0)).applyTopTabsFontSize(any());
188
         verify(topBar, times(0)).setTopTabsVisible(anyBoolean());
188
         verify(topBar, times(0)).setTopTabsVisible(anyBoolean());
189
 
189
 
190
-        options.topTabs.selectedTabColor = new Color(1);
191
-        options.topTabs.unselectedTabColor = new Color(1);
190
+        options.topTabs.selectedTabColor = new Colour(1);
191
+        options.topTabs.unselectedTabColor = new Colour(1);
192
         options.topTabs.fontSize = new Number(1);
192
         options.topTabs.fontSize = new Number(1);
193
         options.topTabs.visible = new Bool(true);
193
         options.topTabs.visible = new Bool(true);
194
         uut.mergeChildOptions(options, EMPTY_OPTIONS, child);
194
         uut.mergeChildOptions(options, EMPTY_OPTIONS, child);
225
     @Test
225
     @Test
226
     public void mergeOptions_defaultOptionsAreNotApplied() {
226
     public void mergeOptions_defaultOptionsAreNotApplied() {
227
         Options defaultOptions = new Options();
227
         Options defaultOptions = new Options();
228
-        defaultOptions.topBar.background.color = new Color(10);
228
+        defaultOptions.topBar.background.color = new Colour(10);
229
         uut.setDefaultOptions(defaultOptions);
229
         uut.setDefaultOptions(defaultOptions);
230
 
230
 
231
         Options childOptions = new Options();
231
         Options childOptions = new Options();
242
         Button rightButton2 = new Button();
242
         Button rightButton2 = new Button();
243
         Button leftButton = new Button();
243
         Button leftButton = new Button();
244
 
244
 
245
-        options.topBar.rightButtonColor = new Color(10);
246
-        options.topBar.leftButtonColor = new Color(100);
245
+        options.topBar.rightButtonColor = new Colour(10);
246
+        options.topBar.leftButtonColor = new Colour(100);
247
 
247
 
248
         options.topBar.buttons.right = new ArrayList<>();
248
         options.topBar.buttons.right = new ArrayList<>();
249
         options.topBar.buttons.right.add(rightButton1);
249
         options.topBar.buttons.right.add(rightButton1);
269
     @Test
269
     @Test
270
     public void mergeChildOptions_buttonColorIsResolvedFromAppliedOptions() {
270
     public void mergeChildOptions_buttonColorIsResolvedFromAppliedOptions() {
271
         Options appliedOptions = new Options();
271
         Options appliedOptions = new Options();
272
-        appliedOptions.topBar.rightButtonColor = new Color(10);
273
-        appliedOptions.topBar.leftButtonColor = new Color(100);
272
+        appliedOptions.topBar.rightButtonColor = new Colour(10);
273
+        appliedOptions.topBar.leftButtonColor = new Colour(100);
274
 
274
 
275
         Options options2 = new Options();
275
         Options options2 = new Options();
276
         Button rightButton1 = new Button();
276
         Button rightButton1 = new Button();
301
     @Test
301
     @Test
302
     public void mergeChildOptions_buttonColorIsResolvedFromMergedOptions() {
302
     public void mergeChildOptions_buttonColorIsResolvedFromMergedOptions() {
303
         Options resolvedOptions = new Options();
303
         Options resolvedOptions = new Options();
304
-        resolvedOptions.topBar.rightButtonColor = new Color(10);
305
-        resolvedOptions.topBar.leftButtonColor = new Color(100);
304
+        resolvedOptions.topBar.rightButtonColor = new Colour(10);
305
+        resolvedOptions.topBar.leftButtonColor = new Colour(100);
306
 
306
 
307
         Options options2 = new Options();
307
         Options options2 = new Options();
308
         Button rightButton1 = new Button();
308
         Button rightButton1 = new Button();

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

1
 package com.reactnativenavigation.viewcontrollers;
1
 package com.reactnativenavigation.viewcontrollers;
2
 
2
 
3
 import android.app.Activity;
3
 import android.app.Activity;
4
+import android.graphics.Color;
4
 import android.graphics.Typeface;
5
 import android.graphics.Typeface;
5
 import android.support.v7.widget.Toolbar;
6
 import android.support.v7.widget.Toolbar;
6
 import android.view.MenuItem;
7
 import android.view.MenuItem;
11
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
12
 import com.reactnativenavigation.mocks.TopBarButtonCreatorMock;
12
 import com.reactnativenavigation.parse.params.Bool;
13
 import com.reactnativenavigation.parse.params.Bool;
13
 import com.reactnativenavigation.parse.params.Button;
14
 import com.reactnativenavigation.parse.params.Button;
14
-import com.reactnativenavigation.parse.params.Color;
15
+import com.reactnativenavigation.parse.params.Colour;
15
 import com.reactnativenavigation.parse.params.NullText;
16
 import com.reactnativenavigation.parse.params.NullText;
16
 import com.reactnativenavigation.parse.params.Number;
17
 import com.reactnativenavigation.parse.params.Number;
17
 import com.reactnativenavigation.parse.params.Text;
18
 import com.reactnativenavigation.parse.params.Text;
71
         uut.addToMenu(getTitleBar(), 0);
72
         uut.addToMenu(getTitleBar(), 0);
72
 
73
 
73
         assertThat(getTitleBar().getMenu().size()).isOne();
74
         assertThat(getTitleBar().getMenu().size()).isOne();
74
-        verify(optionsPresenter, times(1)).tint(any(), eq(android.graphics.Color.RED));
75
+        verify(optionsPresenter, times(1)).tint(any(), eq(Color.RED));
75
     }
76
     }
76
 
77
 
77
     @Test
78
     @Test
79
         setIconButton(false);
80
         setIconButton(false);
80
         uut.addToMenu(getTitleBar(), 0);
81
         uut.addToMenu(getTitleBar(), 0);
81
 
82
 
82
-        verify(optionsPresenter, times(1)).tint(any(), eq(android.graphics.Color.LTGRAY));
83
+        verify(optionsPresenter, times(1)).tint(any(), eq(Color.LTGRAY));
83
     }
84
     }
84
 
85
 
85
     @Test
86
     @Test
86
     public void setIconColor_disabledColor() {
87
     public void setIconColor_disabledColor() {
87
         setIconButton(false);
88
         setIconButton(false);
88
-        button.disabledColor = new Color(android.graphics.Color.BLACK);
89
+        button.disabledColor = new Colour(Color.BLACK);
89
         uut.addToMenu(getTitleBar(), 0);
90
         uut.addToMenu(getTitleBar(), 0);
90
 
91
 
91
-        verify(optionsPresenter, times(1)).tint(any(), eq(android.graphics.Color.BLACK));
92
+        verify(optionsPresenter, times(1)).tint(any(), eq(Color.BLACK));
92
     }
93
     }
93
 
94
 
94
     @Test
95
     @Test
128
 
129
 
129
         clearMenu();
130
         clearMenu();
130
         button.enabled = new Bool(true);
131
         button.enabled = new Bool(true);
131
-        button.color = new Color(android.graphics.Color.RED);
132
+        button.color = new Colour(android.graphics.Color.RED);
132
         uut.addToMenu(getTitleBar(), 0);
133
         uut.addToMenu(getTitleBar(), 0);
133
         dispatchPreDraw(getTitleBar());
134
         dispatchPreDraw(getTitleBar());
134
         verify(optionsPresenter, times(1)).setEnabledColor(any());
135
         verify(optionsPresenter, times(1)).setEnabledColor(any());
144
         button.enabled = new Bool(false);
145
         button.enabled = new Bool(false);
145
         uut.addToMenu(getTitleBar(), 0);
146
         uut.addToMenu(getTitleBar(), 0);
146
         dispatchPreDraw(getTitleBar());
147
         dispatchPreDraw(getTitleBar());
147
-        verify(optionsPresenter, times(1)).setDisabledColor(any(), eq(android.graphics.Color.LTGRAY));
148
+        verify(optionsPresenter, times(1)).setDisabledColor(any(), eq(Color.LTGRAY));
148
 
149
 
149
         clearMenu();
150
         clearMenu();
150
-        button.disabledColor = new Color(android.graphics.Color.BLACK);
151
+        button.disabledColor = new Colour(android.graphics.Color.BLACK);
151
         uut.addToMenu(getTitleBar(), 0);
152
         uut.addToMenu(getTitleBar(), 0);
152
         dispatchPreDraw(getTitleBar());
153
         dispatchPreDraw(getTitleBar());
153
-        verify(optionsPresenter, times(1)).setDisabledColor(any(), eq(android.graphics.Color.BLACK));
154
+        verify(optionsPresenter, times(1)).setDisabledColor(any(), eq(Color.BLACK));
154
     }
155
     }
155
 
156
 
156
     private Toolbar getTitleBar() {
157
     private Toolbar getTitleBar() {
167
     private void setIconButton(boolean enabled) {
168
     private void setIconButton(boolean enabled) {
168
         button.id = "btn1";
169
         button.id = "btn1";
169
         button.icon = new Text("someIcon");
170
         button.icon = new Text("someIcon");
170
-        button.color = new Color(android.graphics.Color.RED);
171
+        button.color = new Colour(Color.RED);
171
         button.component.name = new NullText();
172
         button.component.name = new NullText();
172
         button.component.componentId = new NullText();
173
         button.component.componentId = new NullText();
173
         button.enabled = new Bool(enabled);
174
         button.enabled = new Bool(enabled);

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

1
 package com.reactnativenavigation.viewcontrollers.button;
1
 package com.reactnativenavigation.viewcontrollers.button;
2
 
2
 
3
 import android.content.Context;
3
 import android.content.Context;
4
+import android.graphics.Color;
4
 import android.graphics.drawable.Drawable;
5
 import android.graphics.drawable.Drawable;
5
 
6
 
6
 import com.reactnativenavigation.BaseTest;
7
 import com.reactnativenavigation.BaseTest;
7
 import com.reactnativenavigation.mocks.ImageLoaderMock;
8
 import com.reactnativenavigation.mocks.ImageLoaderMock;
8
 import com.reactnativenavigation.parse.params.Button;
9
 import com.reactnativenavigation.parse.params.Button;
9
-import com.reactnativenavigation.parse.params.Color;
10
+import com.reactnativenavigation.parse.params.Colour;
10
 import com.reactnativenavigation.parse.params.Text;
11
 import com.reactnativenavigation.parse.params.Text;
11
 import com.reactnativenavigation.react.Constants;
12
 import com.reactnativenavigation.react.Constants;
12
 import com.reactnativenavigation.utils.ImageLoader;
13
 import com.reactnativenavigation.utils.ImageLoader;
63
         Button button = new Button();
64
         Button button = new Button();
64
         button.id = "iconBtnId";
65
         button.id = "iconBtnId";
65
         button.icon = new Text(ICON_URI);
66
         button.icon = new Text(ICON_URI);
66
-        button.color = new Color(android.graphics.Color.RED);
67
+        button.color = new Colour(Color.RED);
67
         return button;
68
         return button;
68
     }
69
     }
69
 
70