Skip to content

Commit 78f7995

Browse files
committed
update examples
1 parent cf2f71d commit 78f7995

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

+731
-392
lines changed

examples/.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react-native"]
3-
}
2+
"presets": ["react-native"]
3+
}

examples/.flowconfig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ node_modules/react-native/flow
2222
flow/
2323

2424
[options]
25-
module.system=haste
25+
emoji=true
2626

27-
experimental.strict_type_args=true
27+
module.system=haste
2828

2929
munge_underscores=true
3030

@@ -34,11 +34,12 @@ suppress_type=$FlowIssue
3434
suppress_type=$FlowFixMe
3535
suppress_type=$FixMe
3636

37-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
37+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
38+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3939
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4041

4142
unsafe.enable_getters_and_setters=true
4243

4344
[version]
44-
^0.36.0
45+
^0.49.1

examples/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ local.properties
3434
#
3535
node_modules/
3636
npm-debug.log
37+
yarn-error.log
3738

3839
# BUCK
3940
buck-out/
4041
\.buckd/
41-
android/app/libs
4242
*.keystore
4343

4444
# fastlane
-157 KB
Binary file not shown.
-202 KB
Binary file not shown.

examples/android/app/BUCK

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import re
2-
31
# To learn about Buck see [Docs](https://buckbuild.com/).
42
# To run your application with Buck:
53
# - install Buck
@@ -11,56 +9,57 @@ import re
119
#
1210

1311
lib_deps = []
12+
1413
for jarfile in glob(['libs/*.jar']):
15-
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
14+
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
1615
lib_deps.append(':' + name)
1716
prebuilt_jar(
1817
name = name,
1918
binary_jar = jarfile,
2019
)
2120

2221
for aarfile in glob(['libs/*.aar']):
23-
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
22+
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
2423
lib_deps.append(':' + name)
2524
android_prebuilt_aar(
2625
name = name,
2726
aar = aarfile,
2827
)
2928

3029
android_library(
31-
name = 'all-libs',
32-
exported_deps = lib_deps
30+
name = "all-libs",
31+
exported_deps = lib_deps,
3332
)
3433

3534
android_library(
36-
name = 'app-code',
37-
srcs = glob([
38-
'src/main/java/**/*.java',
39-
]),
40-
deps = [
41-
':all-libs',
42-
':build_config',
43-
':res',
44-
],
35+
name = "app-code",
36+
srcs = glob([
37+
"src/main/java/**/*.java",
38+
]),
39+
deps = [
40+
":all-libs",
41+
":build_config",
42+
":res",
43+
],
4544
)
4645

4746
android_build_config(
48-
name = 'build_config',
49-
package = 'com.examples',
47+
name = "build_config",
48+
package = "com.examples",
5049
)
5150

5251
android_resource(
53-
name = 'res',
54-
res = 'src/main/res',
55-
package = 'com.examples',
52+
name = "res",
53+
package = "com.examples",
54+
res = "src/main/res",
5655
)
5756

5857
android_binary(
59-
name = 'app',
60-
package_type = 'debug',
61-
manifest = 'src/main/AndroidManifest.xml',
62-
keystore = '//android/keystores:debug',
63-
deps = [
64-
':app-code',
65-
],
58+
name = "app",
59+
keystore = "//android/keystores:debug",
60+
manifest = "src/main/AndroidManifest.xml",
61+
package_type = "debug",
62+
deps = [
63+
":app-code",
64+
],
6665
)

examples/android/app/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ import com.android.build.OutputFile
3333
* // bundleInPaidRelease: true,
3434
* // bundleInBeta: true,
3535
*
36+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
37+
* // for example: to disable dev mode in the staging build type (if configured)
38+
* devDisabledInStaging: true,
39+
* // The configuration property can be in the following formats
40+
* // 'devDisabledIn${productFlavor}${buildType}'
41+
* // 'devDisabledIn${buildType}'
42+
*
3643
* // the root of your project, i.e. where "package.json" lives
3744
* root: "../../",
3845
*
@@ -58,7 +65,7 @@ import com.android.build.OutputFile
5865
* inputExcludes: ["android/**", "ios/**"],
5966
*
6067
* // override which node gets called and with what additional arguments
61-
* nodeExecutableAndArgs: ["node"]
68+
* nodeExecutableAndArgs: ["node"],
6269
*
6370
* // supply additional arguments to the packager
6471
* extraPackagerArgs: []
@@ -126,7 +133,6 @@ android {
126133
}
127134

128135
dependencies {
129-
compile project(':react-native-splash-screen')
130136
compile fileTree(dir: "libs", include: ["*.jar"])
131137
compile "com.android.support:appcompat-v7:23.0.1"
132138
compile "com.facebook.react:react-native:+" // From node_modules

examples/android/app/proguard-rules.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050

5151
-dontwarn com.facebook.react.**
5252

53+
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54+
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55+
-dontwarn android.text.StaticLayout
56+
5357
# okhttp
5458

5559
-keepattributes Signature

examples/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<activity
2020
android:name=".MainActivity"
2121
android:label="@string/app_name"
22-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
22+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
23+
android:windowSoftInputMode="adjustResize">
2324
<intent-filter>
2425
<action android:name="android.intent.action.MAIN" />
2526
<category android:name="android.intent.category.LAUNCHER" />
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
package com.examples;
22

3-
import android.os.Bundle;
4-
5-
import com.cboy.rn.splashscreen.SplashScreen;
63
import com.facebook.react.ReactActivity;
7-
/**
8-
* SplashScreen
9-
* 启动屏
10-
* from:http://www.devio.org
11-
* Author:CrazyCodeBoy
12-
* GitHub:https://github.com/crazycodeboy
13-
14-
*/
4+
155
public class MainActivity extends ReactActivity {
166

177
/**
@@ -22,10 +12,4 @@ public class MainActivity extends ReactActivity {
2212
protected String getMainComponentName() {
2313
return "examples";
2414
}
25-
26-
@Override
27-
protected void onCreate(Bundle savedInstanceState) {
28-
SplashScreen.show(this,true);
29-
super.onCreate(savedInstanceState);
30-
}
3115
}

0 commit comments

Comments
 (0)