Skip to content

Commit 607cf81

Browse files
committed
upgrade example app
1 parent ad8ae19 commit 607cf81

33 files changed

+11603
-7078
lines changed

example/.buckconfig

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

example/.flowconfig

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

example/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/.gitignore

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

example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}
File renamed without changes.

example/android/app/build.gradle

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,21 @@ def jscFlavor = 'org.webkit:android-jsc:+'
114114
/**
115115
* Whether to enable the Hermes VM.
116116
*
117-
* This should be set on project.ext.react and mirrored here. If it is not set
117+
* This should be set on project.ext.react and that value will be read here. If it is not set
118118
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119119
* and the benefits of using Hermes will therefore be sharply reduced.
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,11 +196,12 @@ 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}") {
195203
exclude group:'com.facebook.flipper'
204+
exclude group:'com.squareup.okhttp3', module:'okhttp'
196205
}
197206

198207
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
@@ -211,7 +220,7 @@ dependencies {
211220
// Run this once to be able to run the application with BUCK
212221
// puts all compile dependencies into folder libs for BUCK to use
213222
task copyDownloadableDepsToLibs(type: Copy) {
214-
from configurations.compile
223+
from configurations.implementation
215224
into 'libs'
216225
}
217226

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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@
2121
<category android:name="android.intent.category.LAUNCHER" />
2222
</intent-filter>
2323
</activity>
24-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
2524
</application>
26-
2725
</manifest>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2014 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<inset xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18+
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19+
android:insetTop="@dimen/abc_edit_text_inset_top_material"
20+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
21+
22+
<selector>
23+
<!--
24+
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
25+
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
26+
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
27+
28+
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
29+
30+
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
31+
-->
32+
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
33+
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
34+
</selector>
35+
36+
</inset>

0 commit comments

Comments
 (0)