Skip to content

Commit 0a1654a

Browse files
Update example project to work with RN 0.56.0
1 parent 0343979 commit 0a1654a

File tree

6 files changed

+5174
-14
lines changed

6 files changed

+5174
-14
lines changed

example/android/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def enableSeparateBuildPerCPUArchitecture = false
8484
def enableProguardInReleaseBuilds = false
8585

8686
android {
87-
compileSdkVersion 25
88-
buildToolsVersion "23.0.1"
87+
compileSdkVersion rootProject.ext.compileSdkVersion
88+
buildToolsVersion rootProject.ext.buildToolsVersion
8989

9090
defaultConfig {
9191
applicationId "com.rncollapsingtoolbarexample"
92-
minSdkVersion 16
93-
targetSdkVersion 25
92+
minSdkVersion rootProject.ext.minSdkVersion
93+
targetSdkVersion rootProject.ext.targetSdkVersion
9494
versionCode 1
9595
versionName "1.0"
9696
ndk {
@@ -128,9 +128,9 @@ android {
128128

129129
dependencies {
130130
compile fileTree(dir: "libs", include: ["*.jar"])
131-
compile 'com.android.support:appcompat-v7:25.3.1'
132131
compile "com.facebook.react:react-native:+" // From node_modules
133-
compile 'com.android.support:design:25.3.1'
132+
compile 'com.android.support:appcompat-v7:26.1.0'
133+
compile 'com.android.support:design:26.1.0'
134134
compile project(':react-native-vector-icons')
135135
compile project(':react-native-collapsing-toolbar')
136136
compile project(':react-native-nested-scroll-view')

example/android/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
maven {
7+
url 'https://maven.google.com/'
8+
name 'Google'
9+
}
610
}
711
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
12+
classpath 'com.android.tools.build:gradle:2.3.3'
913

1014
// NOTE: Do not place your application dependencies here; they belong
1115
// in the individual module build.gradle files
@@ -20,5 +24,17 @@ allprojects {
2024
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2125
url "$rootDir/../node_modules/react-native/android"
2226
}
27+
maven {
28+
url 'https://maven.google.com/'
29+
name 'Google'
30+
}
2331
}
2432
}
33+
34+
ext {
35+
buildToolsVersion = "26.0.3"
36+
minSdkVersion = 16
37+
compileSdkVersion = 26
38+
targetSdkVersion = 26
39+
supportLibVersion = "26.1.0"
40+
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
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-2.14.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip

example/index.android.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {
2424

2525
import NestedScrollView from 'react-native-nested-scroll-view'
2626

27-
const data = Array(20).fill().map((_, index) => ({key: index}))
27+
const data = Array(20).fill().map((_, index) => ({key: index.toString()}))
2828

2929
const HEADER_HEIGHT = 250
30-
const { width } = Dimensions.get('window')
30+
const { width, height } = Dimensions.get('window')
3131

3232
export default class RNCollapsingToolbar extends Component {
3333
state = {
@@ -129,7 +129,7 @@ export default class RNCollapsingToolbar extends Component {
129129

130130
const styles = StyleSheet.create({
131131
container: {
132-
paddingBottom: 550
132+
height: height - HEADER_HEIGHT,
133133
},
134134
appbar: {
135135
height: HEADER_HEIGHT,

example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"test": "jest"
99
},
1010
"dependencies": {
11-
"react": "16.0.0",
12-
"react-native": "0.51.0",
11+
"react": "16.4.1",
12+
"react-native": "^0.56.0",
1313
"react-native-nested-scroll-view": "6.0.0",
1414
"react-native-collapsing-toolbar": "file:../",
1515
"react-native-vector-icons": "^4.3.0"
1616
},
1717
"devDependencies": {
1818
"babel-jest": "20.0.3",
19-
"babel-preset-react-native": "1.9.2",
19+
"babel-preset-react-native": "^5",
2020
"jest": "20.0.4",
2121
"react-test-renderer": "16.0.0-alpha.6"
2222
},

0 commit comments

Comments
 (0)