Skip to content

Commit f86720e

Browse files
committed
Merge branch 'release/v0.4.0'
2 parents 1c3efc8 + caaeeee commit f86720e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1050
-93
lines changed

example/Sample1/.flowconfig

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99

1010
# Ignore react-tools where there are overlaps, but don't ignore anything that
1111
# react-native relies on
12-
.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js
13-
.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js
14-
.*/node_modules/react-tools/src/browser/ui/React.js
15-
.*/node_modules/react-tools/src/core/ReactInstanceHandles.js
16-
.*/node_modules/react-tools/src/event/EventPropagators.js
12+
.*/node_modules/react-tools/src/React.js
13+
.*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js
14+
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js
15+
.*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js
1716

1817
# Ignore commoner tests
1918
.*/node_modules/commoner/test/.*
@@ -22,7 +21,10 @@
2221
.*/react-tools/node_modules/commoner/lib/reader.js
2322

2423
# Ignore jest
25-
.*/react-native/node_modules/jest-cli/.*
24+
.*/node_modules/jest-cli/.*
25+
26+
# Ignore Website
27+
.*/website/.*
2628

2729
[include]
2830

@@ -32,5 +34,18 @@ node_modules/react-native/Libraries/react-native/react-native-interface.js
3234
[options]
3335
module.system=haste
3436

37+
munge_underscores=true
38+
39+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
40+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub'
41+
42+
suppress_type=$FlowIssue
43+
suppress_type=$FlowFixMe
44+
suppress_type=$FixMe
45+
46+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-7]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
47+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-7]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+
48+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
49+
3550
[version]
36-
0.12.0
51+
0.17.0

example/Sample1/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ DerivedData
2222
*.xcuserstate
2323
project.xcworkspace
2424

25+
# Android/IJ
26+
#
27+
.idea
28+
.gradle
29+
local.properties
30+
2531
# node.js
2632
#
2733
node_modules/

example/Sample1/.npmignore

Lines changed: 0 additions & 27 deletions
This file was deleted.

example/Sample1/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.1"
6+
7+
defaultConfig {
8+
applicationId "com.sample1"
9+
minSdkVersion 16
10+
targetSdkVersion 22
11+
versionCode 1
12+
versionName "1.0"
13+
ndk {
14+
abiFilters "armeabi-v7a", "x86"
15+
}
16+
}
17+
buildTypes {
18+
release {
19+
minifyEnabled false // Set this to true to enable Proguard
20+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
compile fileTree(dir: 'libs', include: ['*.jar'])
27+
compile 'com.android.support:appcompat-v7:23.0.1'
28+
compile 'com.facebook.react:react-native:0.13.+'
29+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Disabling obfuscation is useful if you collect stack traces from production crashes
20+
# (unless you are using a system that supports de-obfuscate the stack traces).
21+
-dontobfuscate
22+
23+
# React Native
24+
25+
# Keep our interfaces so they can be used by other ProGuard rules.
26+
# See http://sourceforge.net/p/proguard/bugs/466/
27+
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28+
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29+
30+
# Do not strip any method/class that is annotated with @DoNotStrip
31+
-keep @com.facebook.proguard.annotations.DoNotStrip class *
32+
-keepclassmembers class * {
33+
@com.facebook.proguard.annotations.DoNotStrip *;
34+
}
35+
36+
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
37+
void set*(***);
38+
*** get*();
39+
}
40+
41+
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
42+
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
43+
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
44+
-keepclassmembers class * { @com.facebook.react.uimanager.ReactProp <methods>; }
45+
-keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup <methods>; }
46+
47+
# okhttp
48+
49+
-keepattributes Signature
50+
-keepattributes *Annotation*
51+
-keep class com.squareup.okhttp.** { *; }
52+
-keep interface com.squareup.okhttp.** { *; }
53+
-dontwarn com.squareup.okhttp.**
54+
55+
# okio
56+
57+
-keep class sun.misc.Unsafe { *; }
58+
-dontwarn java.nio.file.*
59+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
60+
-dontwarn okio.**
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.sample1">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
6+
<application
7+
android:allowBackup="true"
8+
android:label="@string/app_name"
9+
android:icon="@mipmap/ic_launcher"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:name=".MainActivity"
13+
android:label="@string/app_name">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
20+
</application>
21+
22+
</manifest>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.sample1;
2+
3+
import android.app.Activity;
4+
import android.os.Bundle;
5+
import android.view.KeyEvent;
6+
7+
import com.facebook.react.LifecycleState;
8+
import com.facebook.react.ReactInstanceManager;
9+
import com.facebook.react.ReactRootView;
10+
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
11+
import com.facebook.react.shell.MainReactPackage;
12+
import com.facebook.soloader.SoLoader;
13+
14+
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
15+
16+
private ReactInstanceManager mReactInstanceManager;
17+
private ReactRootView mReactRootView;
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
mReactRootView = new ReactRootView(this);
23+
24+
mReactInstanceManager = ReactInstanceManager.builder()
25+
.setApplication(getApplication())
26+
.setBundleAssetName("index.android.bundle")
27+
.setJSMainModuleName("index.android")
28+
.addPackage(new MainReactPackage())
29+
.setUseDeveloperSupport(BuildConfig.DEBUG)
30+
.setInitialLifecycleState(LifecycleState.RESUMED)
31+
.build();
32+
33+
mReactRootView.startReactApplication(mReactInstanceManager, "Sample1", null);
34+
35+
setContentView(mReactRootView);
36+
}
37+
38+
@Override
39+
public boolean onKeyUp(int keyCode, KeyEvent event) {
40+
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
41+
mReactInstanceManager.showDevOptionsDialog();
42+
return true;
43+
}
44+
return super.onKeyUp(keyCode, event);
45+
}
46+
47+
@Override
48+
public void onBackPressed() {
49+
if (mReactInstanceManager != null) {
50+
mReactInstanceManager.onBackPressed();
51+
} else {
52+
super.onBackPressed();
53+
}
54+
}
55+
56+
@Override
57+
public void invokeDefaultOnBackPressed() {
58+
super.onBackPressed();
59+
}
60+
61+
@Override
62+
protected void onPause() {
63+
super.onPause();
64+
65+
if (mReactInstanceManager != null) {
66+
mReactInstanceManager.onPause();
67+
}
68+
}
69+
70+
@Override
71+
protected void onResume() {
72+
super.onResume();
73+
74+
if (mReactInstanceManager != null) {
75+
mReactInstanceManager.onResume(this);
76+
}
77+
}
78+
}
Loading
Loading

0 commit comments

Comments
 (0)