Skip to content

Commit 25f8f0d

Browse files
authored
feat: Upgrade example apps. (DylanVann#453)
1 parent 292223d commit 25f8f0d

File tree

43 files changed

+2057
-1965
lines changed

Some content is hidden

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

43 files changed

+2057
-1965
lines changed

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

-3
This file was deleted.

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

+1-2
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
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-cocoapods/android/app/BUCK

+4-14
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-cocoapods/android/app/build.gradle

+7-9
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,25 @@ 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.reactnativefastimageexamplecocoapods"
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-
}
109110
}
110111
splits {
111112
abi {
112113
reset()
113114
enable enableSeparateBuildPerCPUArchitecture
114115
universalApk false // If true, also generate a universal APK
115-
include "armeabi-v7a", "x86"
116+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
116117
}
117118
}
118119
buildTypes {
@@ -126,7 +127,7 @@ android {
126127
variant.outputs.each { output ->
127128
// For each separate APK per architecture, set a unique version code as described here:
128129
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129-
def versionCodes = ["armeabi-v7a":1, "x86":2]
130+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
130131
def abi = output.getFilter(OutputFile.ABI)
131132
if (abi != null) { // null for the universal-debug, universal-release variants
132133
output.versionCodeOverride =
@@ -137,9 +138,6 @@ android {
137138
}
138139

139140
dependencies {
140-
compile project(':react-native-vector-icons')
141-
compile project(':react-native-image-picker')
142-
compile project(':react-native-fast-image')
143141
implementation fileTree(dir: "libs", include: ["*.jar"])
144142
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
145143
implementation "com.facebook.react:react-native:+" // From node_modules
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+
)
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-cocoapods/android/app/src/main/AndroidManifest.xml

+2-4
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.reactnativefastimageexamplecocoapods">
2+
package="com.reactnativefastimageexamplecocoapods">
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

react-native-fast-image-example-cocoapods/android/app/src/main/java/com/reactnativefastimageexamplecocoapods/MainApplication.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
package com.reactnativefastimageexample;
1+
package com.reactnativefastimageexamplecocoapods;
22

33
import android.app.Application;
44

55
import com.facebook.react.ReactApplication;
6-
import com.oblador.vectoricons.VectorIconsPackage;
7-
import com.imagepicker.ImagePickerPackage;
8-
import com.dylanvann.fastimage.FastImageViewPackage;
96
import com.facebook.react.ReactNativeHost;
107
import com.facebook.react.ReactPackage;
118
import com.facebook.react.shell.MainReactPackage;
@@ -25,10 +22,7 @@ public boolean getUseDeveloperSupport() {
2522
@Override
2623
protected List<ReactPackage> getPackages() {
2724
return Arrays.<ReactPackage>asList(
28-
new MainReactPackage(),
29-
new VectorIconsPackage(),
30-
new ImagePickerPackage(),
31-
new FastImageViewPackage()
25+
new MainReactPackage()
3226
);
3327
}
3428

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

+7-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "27.0.3"
5+
buildToolsVersion = "28.0.3"
66
minSdkVersion = 16
7-
compileSdkVersion = 27
8-
targetSdkVersion = 26
9-
supportLibVersion = "27.1.1"
7+
compileSdkVersion = 28
8+
targetSdkVersion = 28
9+
supportLibVersion = "28.0.0"
1010
}
1111
repositories {
12-
jcenter()
1312
google()
13+
jcenter()
1414
}
1515
dependencies {
16-
classpath 'com.android.tools.build:gradle:3.1.4'
16+
classpath 'com.android.tools.build:gradle:3.3.1'
1717

1818
// NOTE: Do not place your application dependencies here; they belong
1919
// in the individual module build.gradle files
@@ -23,17 +23,11 @@ buildscript {
2323
allprojects {
2424
repositories {
2525
mavenLocal()
26+
google()
2627
jcenter()
2728
maven {
2829
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2930
url "$rootDir/../node_modules/react-native/android"
3031
}
31-
google()
3232
}
3333
}
34-
35-
36-
task wrapper(type: Wrapper) {
37-
gradleVersion = '4.4'
38-
distributionUrl = distributionUrl.replace("bin", "all")
39-
}

react-native-fast-image-example-cocoapods/android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
rootProject.name = 'ReactNativeFastImageExampleCocoaPods'
2-
include ':react-native-image-picker'
3-
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
4-
include ':react-native-vector-icons'
5-
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
6-
include ':react-native-fast-image'
7-
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
82

93
include ':app'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:metro-react-native-babel-preset'],
3+
};
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import { AppRegistry } from 'react-native'
4-
import App from './src'
54
import { name as appName } from './app.json'
5+
import App from './src'
66

77
AppRegistry.registerComponent(appName, () => App)
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
platform :ios, '9.0'
22

3+
# The target name is most likely the name of your project.
34
target 'ReactNativeFastImageExampleCocoaPods' do
4-
pod 'React', :path => '../node_modules/react-native', :subspecs => [
5-
'Core',
6-
'CxxBridge',
7-
'DevSupport',
8-
'RCTText',
9-
'RCTNetwork',
10-
'RCTWebSocket',
11-
'RCTAnimation',
12-
'RCTImage',
13-
]
14-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
15-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
16-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
17-
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
185

19-
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
20-
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
21-
pod 'react-native-fast-image', :path => '../node_modules/react-native-fast-image'
22-
end
6+
# Your 'node_modules' directory is probably in the root of your project,
7+
# but if not, adjust the `:path` accordingly
8+
pod 'React', :path => '../node_modules/react-native', :subspecs => [
9+
'Core',
10+
'CxxBridge', # Include this for RN >= 0.47
11+
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
12+
'RCTText',
13+
'RCTNetwork',
14+
'RCTWebSocket', # Needed for debugging
15+
'RCTAnimation', # Needed for FlatList and animations running on native UI thread
16+
# Add any other subspecs you want to use in your project
17+
'RCTImage',
18+
]
19+
# Explicitly include Yoga if you are using RN >= 0.42.0
20+
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
21+
22+
# Third party deps podspec link
23+
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
24+
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
25+
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
26+
27+
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
28+
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
29+
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
30+
pod 'react-native-fast-image', :path => '../node_modules/react-native-fast-image'
31+
32+
end

0 commit comments

Comments
 (0)