diff --git a/android/build.gradle b/android/build.gradle index 60f614d..28d669c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,24 +1,30 @@ -buildscript { +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + +allprojects { repositories { + mavenLocal() jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + maven { + // For developing the library outside the context of the example app, expect `react-native` + // to be installed at `./node_modules`. + url "$projectDir/../../react-native-bottom-sheet-behavior/example/node_modules/react-native/android" + } } } apply plugin: 'com.android.library' android { - compileSdkVersion 25 - buildToolsVersion "23.0.1" + compileSdkVersion safeExtGet('compileSdkVersion', 25) + buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1') defaultConfig { - minSdkVersion 16 - targetSdkVersion 25 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 25) versionCode 1 - versionName "1.0" + versionName '1.0' } lintOptions { abortOnError false @@ -29,8 +35,11 @@ repositories { mavenCentral() } +def supportLibraryVersion = safeExtGet('supportLibraryVersion', '25.3.1') + dependencies { - compile 'com.facebook.react:react-native:+' - compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.android.support:design:25.3.1' + implementation "com.android.support:appcompat-v7:$supportLibraryVersion" + implementation "com.android.support:design:$supportLibraryVersion" + //noinspection GradleDynamicVersion + implementation 'com.facebook.react:react-native:+' } diff --git a/android/src/main/java/com/rnnestedscrollview/ReactNestedScrollView.java b/android/src/main/java/com/rnnestedscrollview/ReactNestedScrollView.java index c0844ae..6018214 100644 --- a/android/src/main/java/com/rnnestedscrollview/ReactNestedScrollView.java +++ b/android/src/main/java/com/rnnestedscrollview/ReactNestedScrollView.java @@ -283,9 +283,9 @@ public void fling(int velocityY) { postInvalidateOnAnimation(); // END FB SCROLLVIEW CHANGE - } else { - super.fling(velocityY); } + //Fixed fling issue on support library 26 (see issue https://github.com/cesardeazevedo/react-native-nested-scroll-view/issues/16) + super.fling(velocityY); if (mSendMomentumEvents || isScrollPerfLoggingEnabled()) { mFlinging = true; diff --git a/lib/NestedScrollView.js b/lib/NestedScrollView.js index a0b6b26..54ce120 100644 --- a/lib/NestedScrollView.js +++ b/lib/NestedScrollView.js @@ -25,12 +25,12 @@ const { const createReactClass = require('create-react-class'); const PropTypes = require('prop-types'); -const ColorPropType = require('react-native/Libraries/StyleSheet/ColorPropType'); +const ColorPropType = require('react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType'); const ScrollResponder = require('react-native/Libraries/Components/ScrollResponder'); const ScrollViewStickyHeader = require('react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader'); -const StyleSheetPropType = require('react-native/Libraries/StyleSheet/StyleSheetPropType'); +const StyleSheetPropType = require('react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType'); const flattenStyle = require('react-native/Libraries/StyleSheet/flattenStyle'); -const ViewStylePropTypes = require('react-native/Libraries/Components/View/ViewStylePropTypes'); +const ViewStylePropTypes = require('react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes'); const dismissKeyboard = require('react-native/Libraries/Utilities/dismissKeyboard'); const invariant = require('fbjs/lib/invariant'); diff --git a/package.json b/package.json index fb650d8..3699406 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-nested-scroll-view", - "version": "6.0.1", + "version": "6.0.2", "description": "React Native ScrollView replacement with NestedScrollView", "main": "index.js", "keywords": [