Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Commit 3cad4c3

Browse files
authored
Merge pull request #32 from synonymdev/example-update
Example Update
2 parents 7bdce5d + 0a43acc commit 3cad4c3

File tree

27 files changed

+3411
-3943
lines changed

27 files changed

+3411
-3943
lines changed

example/.flowconfig

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; Flow doesn't support platforms
12+
.*/Libraries/Utilities/LoadingView.js
13+
14+
[untyped]
15+
.*/node_modules/@react-native-community/cli/.*/.*
16+
17+
[include]
18+
19+
[libs]
20+
node_modules/react-native/interface.js
21+
node_modules/react-native/flow/
22+
23+
[options]
24+
emoji=true
25+
26+
exact_by_default=true
27+
28+
format.bracket_spacing=false
29+
30+
module.file_ext=.js
31+
module.file_ext=.json
32+
module.file_ext=.ios.js
33+
34+
munge_underscores=true
35+
36+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
37+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
38+
39+
suppress_type=$FlowIssue
40+
suppress_type=$FlowFixMe
41+
suppress_type=$FlowFixMeProps
42+
suppress_type=$FlowFixMeState
43+
44+
[lints]
45+
sketchy-null-number=warn
46+
sketchy-null-mixed=warn
47+
sketchy-number=warn
48+
untyped-type-import=warn
49+
nonstrict-import=warn
50+
deprecated-type=warn
51+
unsafe-getters-setters=warn
52+
unnecessary-invariant=warn
53+
signature-verification-failure=warn
54+
55+
[strict]
56+
deprecated-type
57+
nonstrict-import
58+
sketchy-null
59+
unclear-type
60+
unsafe-getters-setters
61+
untyped-import
62+
untyped-type-import
63+
64+
[version]
65+
^0.158.0

example/.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.pbxproj -text
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

example/.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ build/
2828
.gradle
2929
local.properties
3030
*.iml
31-
32-
# Visual Studio Code
33-
#
34-
.vscode/
31+
*.hprof
3532

3633
# node.js
3734
#

example/_editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf

example/android/app/build.gradle

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+'
120120
*/
121121
def enableHermes = project.ext.react.get("enableHermes", false);
122122

123+
/**
124+
* Architectures to build native code for in debug.
125+
*/
126+
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
127+
123128
android {
124-
compileSdkVersion rootProject.ext.compileSdkVersion
129+
ndkVersion rootProject.ext.ndkVersion
125130

126-
compileOptions {
127-
sourceCompatibility JavaVersion.VERSION_1_8
128-
targetCompatibility JavaVersion.VERSION_1_8
129-
}
131+
compileSdkVersion rootProject.ext.compileSdkVersion
130132

131133
defaultConfig {
132134
applicationId "com.example"
@@ -154,6 +156,11 @@ android {
154156
buildTypes {
155157
debug {
156158
signingConfig signingConfigs.debug
159+
if (nativeArchitectures) {
160+
ndk {
161+
abiFilters nativeArchitectures.split(',')
162+
}
163+
}
157164
}
158165
release {
159166
// Caution! In production, you need to generate your own keystore file.
@@ -169,11 +176,12 @@ android {
169176
variant.outputs.each { output ->
170177
// For each separate APK per architecture, set a unique version code as described here:
171178
// https://developer.android.com/studio/build/configure-apk-splits.html
179+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172180
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173181
def abi = output.getFilter(OutputFile.ABI)
174182
if (abi != null) { // null for the universal-debug, universal-release variants
175183
output.versionCodeOverride =
176-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
184+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
177185
}
178186

179187
}
@@ -188,7 +196,7 @@ dependencies {
188196
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
189197

190198
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
191-
exclude group:'com.facebook.fbjni'
199+
exclude group:'com.facebook.fbjni'
192200
}
193201

194202
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
@@ -215,7 +223,7 @@ dependencies {
215223
// Run this once to be able to run the application with BUCK
216224
// puts all compile dependencies into folder libs for BUCK to use
217225
task copyDownloadableDepsToLibs(type: Copy) {
218-
from configurations.compile
226+
from configurations.implementation
219227
into 'libs'
220228
}
221229

example/android/app/src/debug/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7+
<application
8+
android:usesCleartextTraffic="true"
9+
tools:targetApi="28"
10+
tools:ignore="GoogleAppIndexingWarning">
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12+
</application>
813
</manifest>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
</activity>
2424
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
2525
</application>
26-
2726
</manifest>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
55
<!-- Customize your theme here. -->
6-
<item name="android:textColor">#000000</item>
76
</style>
87

98
</resources>

example/android/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.2"
5+
buildToolsVersion = "30.0.2"
66
minSdkVersion = 21
7-
compileSdkVersion = 29
7+
compileSdkVersion = 30
88
targetSdkVersion = 29
9+
ndkVersion = "21.4.7075529"
910
}
1011
repositories {
1112
google()
12-
jcenter()
13+
mavenCentral()
1314
}
1415
dependencies {
15-
classpath('com.android.tools.build:gradle:4.1.2')
16+
classpath("com.android.tools.build:gradle:4.2.2")
1617
// NOTE: Do not place your application dependencies here; they belong
1718
// in the individual module build.gradle files
1819
}
1920
}
2021

2122
allprojects {
2223
repositories {
24+
mavenCentral()
2325
mavenLocal()
2426
maven {
2527
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
@@ -31,7 +33,6 @@ allprojects {
3133
}
3234

3335
google()
34-
jcenter()
3536
maven { url 'https://www.jitpack.io' }
3637
}
3738
}

example/android/gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ android.useAndroidX=true
2424
# Automatically convert third-party libraries to use AndroidX
2525
android.enableJetifier=true
2626

27+
org.gradle.jvmargs=-Xmx2048M
28+
2729
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.54.0
30+
FLIPPER_VERSION=0.99.0

0 commit comments

Comments
 (0)