Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ScrollView and Animated with gesturehandler and reanimated #637

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ PODS:
- React-cxxreact (= 0.61.5)
- React-jsi (= 0.61.5)
- ReactCommon/jscallinvoker (= 0.61.5)
- RNGestureHandler (1.5.2):
- React
- RNReanimated (1.4.0):
- React
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -250,6 +254,8 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -307,6 +313,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/Vibration"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -337,6 +347,8 @@ SPEC CHECKSUMS:
React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
RNGestureHandler: 946a7691e41df61e2c4b1884deab41a4cdc3afff
RNReanimated: b2ab0b693dddd2339bd2f300e770f6302d2e960c
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b

PODFILE CHECKSUM: 79310af6b976c356911a8a833e9b99c3399fdda3
Expand Down
2 changes: 2 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-linear-gradient": "2.5.6",
"react-native-gesture-handler": "^1.5.2",
"react-native-reanimated": "^1.4.0",
"react-native-snap-carousel": "file:../"
},
"devDependencies": {
Expand Down
27 changes: 27 additions & 0 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2466,6 +2466,11 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=

hammerjs@^2.0.8:
version "2.0.8"
resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1"
integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=

handlebars@^4.1.2:
version "4.5.3"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482"
Expand Down Expand Up @@ -2543,6 +2548,11 @@ hermes-engine@^0.2.1:
resolved "https://registry.yarnpkg.com/hermes-engine/-/hermes-engine-0.2.1.tgz#25c0f1ff852512a92cb5c5cc47cf967e1e722ea2"
integrity sha512-eNHUQHuadDMJARpaqvlCZoK/Nitpj6oywq3vQ3wCwEsww5morX34mW5PmKWQTO7aU0ck0hgulxR+EVDlXygGxQ==

hoist-non-react-statics@^2.3.1:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==

hosted-git-info@^2.1.4:
version "2.8.5"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
Expand Down Expand Up @@ -4550,16 +4560,33 @@ react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==

react-native-gesture-handler@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.2.tgz#281111550bf1eee10b7feba5278d142169892731"
integrity sha512-Xp03dq4XYVTD0xmWx4DW4eX+ox1NQLjHmbykspTdS5FCNIVIOekVXRLFCw1698/v8dYUHApNo6K3s3BCD8fqPA==
dependencies:
hammerjs "^2.0.8"
hoist-non-react-statics "^2.3.1"
invariant "^2.2.4"
prop-types "^15.7.2"

react-native-linear-gradient@2.5.6:
version "2.5.6"
resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0"
integrity sha512-HDwEaXcQIuXXCV70O+bK1rizFong3wj+5Q/jSyifKFLg0VWF95xh8XQgfzXwtq0NggL9vNjPKXa016KuFu+VFg==

react-native-reanimated@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.4.0.tgz#7f1acbf9be08492d834f512700570978052be2f9"
integrity sha512-tO7nSNNP+iRLVbkcSS5GXyDBb7tSI02+XuRL3/S39EAr35rnvUy2JfeLUQG+fWSObJjnMVhasUDEUwlENk8IXw==

"react-native-snap-carousel@file:..":
version "3.8.4"
dependencies:
prop-types "^15.6.1"
react-addons-shallow-compare "15.6.2"
react-native-gesture-handler "^1.5.2"
react-native-reanimated "^1.4.0"

react-native@0.61.5:
version "0.61.5"
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"license": "BSD-3-Clause",
"dependencies": {
"prop-types": "^15.6.1",
"react-addons-shallow-compare": "15.6.2"
"react-addons-shallow-compare": "15.6.2",
"react-native-gesture-handler": "^1.5.2",
"react-native-reanimated": "^1.4.0"
},
"peerDependencies": {
"react": ">=15.0.0",
Expand Down
4 changes: 3 additions & 1 deletion src/carousel/Carousel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { Component } from 'react';
import { Animated, Easing, FlatList, I18nManager, Platform, ScrollView, View, ViewPropTypes } from 'react-native';
import { I18nManager, Platform, View, ViewPropTypes } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
import { ScrollView, FlatList } from 'react-native-gesture-handler';
import PropTypes from 'prop-types';
import shallowCompare from 'react-addons-shallow-compare';
import {
Expand Down
5 changes: 3 additions & 2 deletions src/pagination/PaginationDot.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { PureComponent } from 'react';
import { View, Animated, Easing, TouchableOpacity, ViewPropTypes } from 'react-native';
import { View, TouchableOpacity, ViewPropTypes } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
import PropTypes from 'prop-types';
import styles from './Pagination.style';

Expand Down Expand Up @@ -43,7 +44,7 @@ export default class PaginationDot extends PureComponent {

_animate (toValue = 0) {
const { animColor, animOpacity, animTransform } = this.state;
const { animatedDuration, animatedFriction, animatedTension } = this.props
const { animatedDuration, animatedFriction, animatedTension } = this.props;

const commonProperties = {
toValue,
Expand Down
3 changes: 2 additions & 1 deletion src/parallaximage/ParallaxImage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Parallax effect inspired by https://github.com/oblador/react-native-parallax/

import React, { Component } from 'react';
import { View, ViewPropTypes, Image, Animated, Easing, ActivityIndicator, findNodeHandle } from 'react-native';
import { View, ViewPropTypes, Image, ActivityIndicator, findNodeHandle } from 'react-native';
import Animated, { Easing } from 'react-native-reanimated';
import PropTypes from 'prop-types';
import styles from './ParallaxImage.style';

Expand Down