Skip to content

Commit 84e420c

Browse files
authored
Upgrade example app. (#451)
1 parent 4849f2b commit 84e420c

File tree

31 files changed

+2067
-1953
lines changed

31 files changed

+2067
-1953
lines changed

.prettierignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
ios/Vendor
1+
/ios/Vendor/
2+
/react-native-fast-image-example/
3+
/react-native-fast-image-example-cocoapods/
4+
node_modules
5+
coverage

react-native-fast-image-example/.babelrc

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

react-native-fast-image-example/.flowconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
[libs]
2525
node_modules/react-native/Libraries/react-native/react-native-interface.js
2626
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2827

2928
[options]
3029
emoji=true
@@ -67,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6766
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6867

6968
[version]
70-
^0.78.0
69+
^0.92.0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: test renderer must be required after react-native.
10+
import renderer from 'react-test-renderer';
11+
12+
it('renders correctly', () => {
13+
renderer.create(<App />);
14+
});

react-native-fast-image-example/android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

react-native-fast-image-example/android/app/build.gradle

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,49 +95,39 @@ def enableProguardInReleaseBuilds = false
9595

9696
android {
9797
compileSdkVersion rootProject.ext.compileSdkVersion
98-
buildToolsVersion rootProject.ext.buildToolsVersion
98+
99+
compileOptions {
100+
sourceCompatibility JavaVersion.VERSION_1_8
101+
targetCompatibility JavaVersion.VERSION_1_8
102+
}
99103

100104
defaultConfig {
101105
applicationId "com.reactnativefastimageexample"
102106
minSdkVersion rootProject.ext.minSdkVersion
103107
targetSdkVersion rootProject.ext.targetSdkVersion
104108
versionCode 1
105109
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109-
}
110-
signingConfigs {
111-
release {
112-
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
113-
storeFile file(MYAPP_RELEASE_STORE_FILE)
114-
storePassword MYAPP_RELEASE_STORE_PASSWORD
115-
keyAlias MYAPP_RELEASE_KEY_ALIAS
116-
keyPassword MYAPP_RELEASE_KEY_PASSWORD
117-
}
118-
}
119110
}
120111
splits {
121112
abi {
122113
reset()
123114
enable enableSeparateBuildPerCPUArchitecture
124115
universalApk false // If true, also generate a universal APK
125-
include "armeabi-v7a", "x86"
116+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
126117
}
127118
}
128119
buildTypes {
129120
release {
130121
minifyEnabled enableProguardInReleaseBuilds
131122
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
132-
signingConfig signingConfigs.release
133123
}
134124
}
135125
// applicationVariants are e.g. debug, release
136126
applicationVariants.all { variant ->
137127
variant.outputs.each { output ->
138128
// For each separate APK per architecture, set a unique version code as described here:
139129
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
140-
def versionCodes = ["armeabi-v7a":1, "x86":2]
130+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
141131
def abi = output.getFilter(OutputFile.ABI)
142132
if (abi != null) { // null for the universal-debug, universal-release variants
143133
output.versionCodeOverride =
@@ -148,6 +138,7 @@ android {
148138
}
149139

150140
dependencies {
141+
implementation project(':react-native-gesture-handler')
151142
implementation project(':react-native-vector-icons')
152143
implementation project(':react-native-image-picker')
153144
implementation project(':react-native-fast-image')
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
8+
</manifest>

react-native-fast-image-example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.reactnativefastimageexample">
2+
package="com.reactnativefastimageexample">
33

44
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
<uses-permission android:name="android.permission.CAMERA" />
7-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
85

96
<application
107
android:name=".MainApplication"
118
android:label="@string/app_name"
129
android:icon="@mipmap/ic_launcher"
10+
android:roundIcon="@mipmap/ic_launcher_round"
1311
android:allowBackup="false"
1412
android:theme="@style/AppTheme">
1513
<activity
Binary file not shown.

0 commit comments

Comments
 (0)