Skip to content

Commit 8290f7d

Browse files
authored
Rn51upgrade (#70)
* Changed dependency to 0.51.0 * Fixed tags input native crash * Linked android native BlurView package, supports Toast * lint * clean code
1 parent f3468b6 commit 8290f7d

File tree

8 files changed

+166
-16
lines changed

8 files changed

+166
-16
lines changed

android/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ android {
2020
ndk {
2121
abiFilters "armeabi-v7a", "x86"
2222
}
23+
renderscriptTargetApi 21
24+
renderscriptSupportModeEnabled true
2325
}
2426
splits {
2527
abi {

android/app/src/main/java/com/uilib/MainApplication.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.support.annotation.Nullable;
44

5+
import com.cmcewen.blurview.BlurViewPackage;
56
import com.facebook.react.ReactPackage;
67
import com.reactnativenavigation.NavigationApplication;
78
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
@@ -10,8 +11,6 @@
1011
import java.util.Arrays;
1112
import java.util.List;
1213

13-
//import com.wix.interactable.Interactable;
14-
1514
public class MainApplication extends NavigationApplication {
1615
@Override
1716
public boolean isDebug() {
@@ -23,8 +22,8 @@ public boolean isDebug() {
2322
public List<ReactPackage> createAdditionalReactPackages() {
2423
return Arrays.<ReactPackage>asList(
2524
new TextInputDelKeyHandlerPackage(),
25+
new BlurViewPackage(),
2626
new HighlighterViewPackage()
27-
// new Interactable()
2827
);
2928
}
3029
}

ios/uilib.xcodeproj/project.pbxproj

Lines changed: 140 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,69 @@
7373
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
7474
remoteInfo = uilib;
7575
};
76+
067D853D1FFBD2100038846C /* PBXContainerItemProxy */ = {
77+
isa = PBXContainerItemProxy;
78+
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
79+
proxyType = 2;
80+
remoteGlobalIDString = 3DBE0D001F3B181A0099AA32;
81+
remoteInfo = fishhook;
82+
};
83+
067D853F1FFBD2100038846C /* PBXContainerItemProxy */ = {
84+
isa = PBXContainerItemProxy;
85+
containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
86+
proxyType = 2;
87+
remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
88+
remoteInfo = "fishhook-tvOS";
89+
};
90+
067D854F1FFBD2100038846C /* PBXContainerItemProxy */ = {
91+
isa = PBXContainerItemProxy;
92+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
93+
proxyType = 2;
94+
remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
95+
remoteInfo = "third-party";
96+
};
97+
067D85511FFBD2100038846C /* PBXContainerItemProxy */ = {
98+
isa = PBXContainerItemProxy;
99+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
100+
proxyType = 2;
101+
remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
102+
remoteInfo = "third-party-tvOS";
103+
};
104+
067D85531FFBD2100038846C /* PBXContainerItemProxy */ = {
105+
isa = PBXContainerItemProxy;
106+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
107+
proxyType = 2;
108+
remoteGlobalIDString = 139D7E881E25C6D100323FB7;
109+
remoteInfo = "double-conversion";
110+
};
111+
067D85551FFBD2100038846C /* PBXContainerItemProxy */ = {
112+
isa = PBXContainerItemProxy;
113+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
114+
proxyType = 2;
115+
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
116+
remoteInfo = "double-conversion-tvOS";
117+
};
118+
067D85571FFBD2100038846C /* PBXContainerItemProxy */ = {
119+
isa = PBXContainerItemProxy;
120+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
121+
proxyType = 2;
122+
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
123+
remoteInfo = privatedata;
124+
};
125+
067D85591FFBD2100038846C /* PBXContainerItemProxy */ = {
126+
isa = PBXContainerItemProxy;
127+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
128+
proxyType = 2;
129+
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
130+
remoteInfo = "privatedata-tvOS";
131+
};
132+
067D855F1FFBD2100038846C /* PBXContainerItemProxy */ = {
133+
isa = PBXContainerItemProxy;
134+
containerPortal = 58CA453CF9884711B2FC29AF /* RNBlur.xcodeproj */;
135+
proxyType = 2;
136+
remoteGlobalIDString = 64D1BD361EEFE88700F3F219;
137+
remoteInfo = "RNBlur-tvOS";
138+
};
76139
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
77140
isa = PBXContainerItemProxy;
78141
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
@@ -394,6 +457,8 @@
394457
children = (
395458
139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
396459
8EB68AB61E4B57C200F5CA08 /* libRCTWebSocket-tvOS.a */,
460+
067D853E1FFBD2100038846C /* libfishhook.a */,
461+
067D85401FFBD2100038846C /* libfishhook-tvOS.a */,
397462
);
398463
name = Products;
399464
sourceTree = "<group>";
@@ -424,6 +489,12 @@
424489
8EE25FC11EAE57C300CBF596 /* libcxxreact.a */,
425490
8EE25FC31EAE57C300CBF596 /* libjschelpers.a */,
426491
8EE25FC51EAE57C300CBF596 /* libjschelpers.a */,
492+
067D85501FFBD2100038846C /* libthird-party.a */,
493+
067D85521FFBD2100038846C /* libthird-party.a */,
494+
067D85541FFBD2100038846C /* libdouble-conversion.a */,
495+
067D85561FFBD2100038846C /* libdouble-conversion.a */,
496+
067D85581FFBD2100038846C /* libprivatedata.a */,
497+
067D855A1FFBD2100038846C /* libprivatedata-tvOS.a */,
427498
);
428499
name = Products;
429500
sourceTree = "<group>";
@@ -527,7 +598,7 @@
527598
isa = PBXGroup;
528599
children = (
529600
8EEDAA4C1E6723E8007266C9 /* libRNBlur.a */,
530-
D8D93EAB20161B4600A39331 /* libRNBlur.a */,
601+
067D85601FFBD2100038846C /* libRNBlur.a */,
531602
);
532603
name = Products;
533604
sourceTree = "<group>";
@@ -550,7 +621,10 @@
550621
/* End PBXGroup section */
551622

552623
/* Begin PBXNativeTarget section */
553-
00E356ED1AD99517003FC87E /* uilibTests */ = {
624+
00E356ED1AD99
625+
626+
627+
7003FC87E /* uilibTests */ = {
554628
isa = PBXNativeTarget;
555629
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "uilibTests" */;
556630
buildPhases = (
@@ -725,6 +799,69 @@
725799
remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
726800
sourceTree = BUILT_PRODUCTS_DIR;
727801
};
802+
067D853E1FFBD2100038846C /* libfishhook.a */ = {
803+
isa = PBXReferenceProxy;
804+
fileType = archive.ar;
805+
path = libfishhook.a;
806+
remoteRef = 067D853D1FFBD2100038846C /* PBXContainerItemProxy */;
807+
sourceTree = BUILT_PRODUCTS_DIR;
808+
};
809+
067D85401FFBD2100038846C /* libfishhook-tvOS.a */ = {
810+
isa = PBXReferenceProxy;
811+
fileType = archive.ar;
812+
path = "libfishhook-tvOS.a";
813+
remoteRef = 067D853F1FFBD2100038846C /* PBXContainerItemProxy */;
814+
sourceTree = BUILT_PRODUCTS_DIR;
815+
};
816+
067D85501FFBD2100038846C /* libthird-party.a */ = {
817+
isa = PBXReferenceProxy;
818+
fileType = archive.ar;
819+
path = "libthird-party.a";
820+
remoteRef = 067D854F1FFBD2100038846C /* PBXContainerItemProxy */;
821+
sourceTree = BUILT_PRODUCTS_DIR;
822+
};
823+
067D85521FFBD2100038846C /* libthird-party.a */ = {
824+
isa = PBXReferenceProxy;
825+
fileType = archive.ar;
826+
path = "libthird-party.a";
827+
remoteRef = 067D85511FFBD2100038846C /* PBXContainerItemProxy */;
828+
sourceTree = BUILT_PRODUCTS_DIR;
829+
};
830+
067D85541FFBD2100038846C /* libdouble-conversion.a */ = {
831+
isa = PBXReferenceProxy;
832+
fileType = archive.ar;
833+
path = "libdouble-conversion.a";
834+
remoteRef = 067D85531FFBD2100038846C /* PBXContainerItemProxy */;
835+
sourceTree = BUILT_PRODUCTS_DIR;
836+
};
837+
067D85561FFBD2100038846C /* libdouble-conversion.a */ = {
838+
isa = PBXReferenceProxy;
839+
fileType = archive.ar;
840+
path = "libdouble-conversion.a";
841+
remoteRef = 067D85551FFBD2100038846C /* PBXContainerItemProxy */;
842+
sourceTree = BUILT_PRODUCTS_DIR;
843+
};
844+
067D85581FFBD2100038846C /* libprivatedata.a */ = {
845+
isa = PBXReferenceProxy;
846+
fileType = archive.ar;
847+
path = libprivatedata.a;
848+
remoteRef = 067D85571FFBD2100038846C /* PBXContainerItemProxy */;
849+
sourceTree = BUILT_PRODUCTS_DIR;
850+
};
851+
067D855A1FFBD2100038846C /* libprivatedata-tvOS.a */ = {
852+
isa = PBXReferenceProxy;
853+
fileType = archive.ar;
854+
path = "libprivatedata-tvOS.a";
855+
remoteRef = 067D85591FFBD2100038846C /* PBXContainerItemProxy */;
856+
sourceTree = BUILT_PRODUCTS_DIR;
857+
};
858+
067D85601FFBD2100038846C /* libRNBlur.a */ = {
859+
isa = PBXReferenceProxy;
860+
fileType = archive.ar;
861+
path = libRNBlur.a;
862+
remoteRef = 067D855F1FFBD2100038846C /* PBXContainerItemProxy */;
863+
sourceTree = BUILT_PRODUCTS_DIR;
864+
};
728865
139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
729866
isa = PBXReferenceProxy;
730867
fileType = archive.ar;
@@ -941,7 +1078,7 @@
9411078
);
9421079
runOnlyForDeploymentPostprocessing = 0;
9431080
shellPath = /bin/sh;
944-
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
1081+
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
9451082
};
9461083
/* End PBXShellScriptBuildPhase section */
9471084

lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.wix.reactnativeuilib.textinput;
22

3+
import android.util.Log;
34
import android.view.View;
45

56
import com.facebook.react.bridge.ReactApplicationContext;
67
import com.facebook.react.bridge.ReactContextBaseJavaModule;
78
import com.facebook.react.bridge.ReactMethod;
9+
import com.facebook.react.uimanager.IllegalViewOperationException;
810
import com.facebook.react.uimanager.NativeViewHierarchyManager;
911
import com.facebook.react.uimanager.UIBlock;
1012
import com.facebook.react.uimanager.UIManagerModule;
@@ -30,10 +32,19 @@ public void register(final Integer textInputTag) {
3032

3133
uiManager.addUIBlock(new UIBlock() {
3234
public void execute(NativeViewHierarchyManager viewHierarchyManager) {
33-
final View view = viewHierarchyManager.resolveView(textInputTag);
35+
Log.d("ReactNativeJS","registering tag = " + textInputTag);
36+
final View view;
37+
try {
38+
view = viewHierarchyManager.resolveView(textInputTag);
39+
} catch (IllegalViewOperationException e) {
40+
Log.d("ReactNativeJS","no view for tag = " + textInputTag);
41+
e.printStackTrace();
42+
return;
43+
}
3444
final ReactEditText editText = ViewUtils.getEditTextInView(view);
3545

3646
if (editText != null) {
47+
Log.d("ReactNativeJS","has editText for tag = " + textInputTag);
3748
final KeyListenerProxy keyListenerProxy = new KeyListenerProxy(reactContext, editText.getKeyListener());
3849
editText.setKeyListener(keyListenerProxy);
3950
}

lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
1616
return Arrays.<NativeModule>asList(new TextInputDelKeyHandlerModule(reactContext));
1717
}
1818

19-
// Deprecated in RN 0.47
20-
public List<Class<? extends JavaScriptModule>> createJSModules() {
21-
return Collections.emptyList();
22-
}
19+
// @Override
20+
// public List<Class<? extends JavaScriptModule>> createJSModules() {
21+
// return Collections.emptyList();
22+
// }
2323

2424
@Override
2525
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
"gatsby": "^1.9.128",
5252
"gh-pages": "^1.1.0",
5353
"jest": "^20.0.4",
54-
"react": "16.0.0-alpha.6",
54+
"react": "16.0.0",
5555
"react-addons-test-utils": "^15.4.2",
5656
"react-autobind": "^1.0.6",
5757
"react-dom": "^15.4.2",
58-
"react-native": "0.44.2",
59-
"react-native-keyboard-aware-scrollview": "^1.1.6",
58+
"react-native": "0.51.0",
59+
"react-native-keyboard-aware-scrollview": "^2.0.0",
6060
"react-native-navigation": "^1.1.19"
6161
},
6262
"peerDependencies": {

src/components/inputs/TextInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export default class TextInput extends BaseInput {
317317
const underlineStyle = this.getUnderlineStyle();
318318

319319
return (
320-
<View style={[this.styles.container, containerStyle]}>
320+
<View style={[this.styles.container, containerStyle]} collapsable={false}>
321321
<View style={[this.styles.innerContainer, underlineStyle]}>
322322
{this.renderPlaceholder()}
323323
{expandable ? this.renderExpandableInput() : this.renderTextInput()}

src/components/tagsInput/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export default class TagsInput extends BaseComponent {
275275
return (
276276
<View style={styles.inputWrapper}>
277277
<TextInput
278-
ref={r => (this.input = r)}
278+
ref={r => this.input = r}
279279
text80
280280
blurOnSubmit={false}
281281
{...others}
@@ -288,6 +288,7 @@ export default class TagsInput extends BaseComponent {
288288
selectionColor={isLastTagMarked ? 'transparent' : undefined}
289289
style={inputStyle}
290290
containerStyle={{flexGrow: 0}}
291+
collapsable={false}
291292
/>
292293
</View>
293294
);

0 commit comments

Comments
 (0)