Daniel Zlotin 8 years ago
parent
commit
5750f72a7d

+ 0
- 12
android/app/src/main/java/com/reactnativenavigation/params/parsers/StyleParamsParser.java View File

@@ -2,8 +2,6 @@ package com.reactnativenavigation.params.parsers;
2 2
 
3 3
 import android.graphics.Color;
4 4
 import android.os.Bundle;
5
-import android.support.annotation.NonNull;
6
-import android.support.annotation.Nullable;
7 5
 
8 6
 import com.reactnativenavigation.params.AppStyle;
9 7
 import com.reactnativenavigation.params.StyleParams;
@@ -72,7 +70,6 @@ public class StyleParamsParser {
72 70
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedTopTabTextColor;
73 71
     }
74 72
 
75
-    @Nullable
76 73
     private StyleParams.Color getDefaultNavigationColor() {
77 74
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.navigationBarColor;
78 75
     }
@@ -81,17 +78,14 @@ public class StyleParamsParser {
81 78
         return AppStyle.appStyle != null && AppStyle.appStyle.forceTitlesDisplay;
82 79
     }
83 80
 
84
-    @Nullable
85 81
     private StyleParams.Color getDefaultSelectedBottomTabsButtonColor() {
86 82
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedBottomTabsButtonColor;
87 83
     }
88 84
 
89
-    @Nullable
90 85
     private StyleParams.Color getDefaultBottomTabsButtonColor() {
91 86
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.bottomTabsButtonColor;
92 87
     }
93 88
 
94
-    @Nullable
95 89
     private StyleParams.Color getDefaultBottomTabsColor() {
96 90
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.bottomTabsColor;
97 91
     }
@@ -120,17 +114,14 @@ public class StyleParamsParser {
120 114
         return AppStyle.appStyle != null && AppStyle.appStyle.backButtonHidden;
121 115
     }
122 116
 
123
-    @Nullable
124 117
     private StyleParams.Color getDefaultTitleBarColor() {
125 118
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.titleBarTitleColor;
126 119
     }
127 120
 
128
-    @Nullable
129 121
     private StyleParams.Color getTitleBarButtonColor() {
130 122
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.titleBarButtonColor;
131 123
     }
132 124
 
133
-    @Nullable
134 125
     private StyleParams.Color getTitleBarDisabledButtonColor() {
135 126
         return AppStyle.appStyle == null ? new StyleParams.Color(Color.LTGRAY) : AppStyle.appStyle.titleBarDisabledButtonColor;
136 127
     }
@@ -139,12 +130,10 @@ public class StyleParamsParser {
139 130
         return AppStyle.appStyle != null && AppStyle.appStyle.titleBarHidden;
140 131
     }
141 132
 
142
-    @Nullable
143 133
     private StyleParams.Color getDefaultTopBarColor() {
144 134
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.topBarColor;
145 135
     }
146 136
 
147
-    @Nullable
148 137
     private StyleParams.Color getDefaultStatusBarColor() {
149 138
         return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.statusBarColor;
150 139
     }
@@ -153,7 +142,6 @@ public class StyleParamsParser {
153 142
         return params.containsKey(key) ? params.getBoolean(key) : defaultValue;
154 143
     }
155 144
 
156
-    @NonNull
157 145
     private StyleParams.Color getColor(String key, StyleParams.Color defaultColor) {
158 146
         StyleParams.Color color = StyleParams.Color.parse(params.getString(key));
159 147
         if (color.hasColor()) {

+ 3
- 1
android/app/src/main/java/com/reactnativenavigation/screens/ScreenStack.java View File

@@ -111,12 +111,14 @@ public class ScreenStack {
111 111
         final Screen previous = stack.peek();
112 112
 
113 113
         if (keyboardVisibilityDetector.isKeyboardVisible()) {
114
-            keyboardVisibilityDetector.closeKeyboard(new Runnable() {
114
+            keyboardVisibilityDetector.setKeyboardCloseListener(new Runnable() {
115 115
                 @Override
116 116
                 public void run() {
117
+                    keyboardVisibilityDetector.setKeyboardCloseListener(null);
117 118
                     swapScreens(animated, toRemove, previous, onScreenPop);
118 119
                 }
119 120
             });
121
+            keyboardVisibilityDetector.closeKeyboard();
120 122
         } else {
121 123
             swapScreens(animated, toRemove, previous, onScreenPop);
122 124
         }

+ 5
- 2
android/app/src/main/java/com/reactnativenavigation/utils/KeyboardVisibilityDetector.java View File

@@ -26,8 +26,11 @@ public class KeyboardVisibilityDetector {
26 26
         return keyboardVisibilityListener.isKeyboardVisible();
27 27
     }
28 28
 
29
-    public void closeKeyboard(Runnable keyboardClosedListener) {
30
-        this.keyboardCloseListener = keyboardClosedListener;
29
+    public void setKeyboardCloseListener(Runnable keyboardCloseListener) {
30
+        this.keyboardCloseListener = keyboardCloseListener;
31
+    }
32
+
33
+    public void closeKeyboard() {
31 34
         InputMethodManager imm = (InputMethodManager) screen.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
32 35
         imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
33 36
     }

+ 1
- 1
package.json View File

@@ -7,7 +7,7 @@
7 7
     "type": "git",
8 8
     "url": "https://github.com/wix/react-native-navigation.git"
9 9
   },
10
-  "version": "2.0.0-experimental.64",
10
+  "version": "2.0.0-experimental.66",
11 11
   "description": "React Native Navigation - truly native navigation for iOS and Android",
12 12
   "nativePackage": true,
13 13
   "bugs": {

+ 20
- 4
src/Navigation.js View File

@@ -29,12 +29,20 @@ function _registerComponentNoRedux(screenID, generator) {
29 29
 
30 30
       constructor(props) {
31 31
         super(props);
32
-        this.allProps = {...props, ...PropRegistry.load(props.screenInstanceID)};
32
+        this.state = {
33
+          internalProps: {...props, ...PropRegistry.load(props.screenInstanceID)}
34
+        }
35
+      }
36
+  
37
+      componentWillReceiveProps(nextProps) {
38
+        this.setState({
39
+          internalProps: {...PropRegistry.load(this.props.screenInstanceID), ...nextProps}
40
+        })
33 41
       }
34 42
 
35 43
       render() {
36 44
         return (
37
-          <InternalComponent navigator={this.navigator} {...this.allProps} />
45
+          <InternalComponent navigator={this.navigator} {...this.state.internalProps} />
38 46
         );
39 47
       }
40 48
     };
@@ -52,13 +60,21 @@ function _registerComponentRedux(screenID, generator, store, Provider) {
52 60
 
53 61
       constructor(props) {
54 62
         super(props);
55
-        this.allProps = {...props, ...PropRegistry.load(props.screenInstanceID)};
63
+        this.state = {
64
+          internalProps: {...props, ...PropRegistry.load(props.screenInstanceID)}
65
+        }
66
+      }
67
+      
68
+      componentWillReceiveProps(nextProps) {
69
+        this.setState({
70
+          internalProps: {...PropRegistry.load(this.props.screenInstanceID), ...nextProps}
71
+        })
56 72
       }
57 73
 
58 74
       render() {
59 75
         return (
60 76
           <Provider store={store}>
61
-            <InternalComponent navigator={this.navigator} {...this.allProps} />
77
+            <InternalComponent navigator={this.navigator} {...this.state.internalProps} />
62 78
           </Provider>
63 79
         );
64 80
       }

+ 1
- 0
src/deprecated/platformSpecificDeprecated.android.js View File

@@ -115,6 +115,7 @@ function convertStyleParams(originalStyleObject) {
115 115
     titleBarHidden: originalStyleObject.navBarHidden,
116 116
     titleBarTitleColor: originalStyleObject.navBarTextColor,
117 117
     titleBarButtonColor: originalStyleObject.navBarButtonColor,
118
+    titleBarDisabledButtonColor: originalStyleObject.titleBarDisabledButtonColor,
118 119
     backButtonHidden: originalStyleObject.backButtonHidden,
119 120
     topTabsHidden: originalStyleObject.topTabsHidden,
120 121