meliorence / react-native-snap-carousel

Swiper/carousel component for React Native featuring previews, multiple layouts, parallax images, performant handling of huge numbers of items, and more. Compatible with Android & iOS.
BSD 3-Clause "New" or "Revised" License
10.37k stars 2.29k forks source link

Inverted behaviour of Android when layout is 'stack' #901

Open Saad9624 opened 2 years ago

Saad9624 commented 2 years ago

Question.

Is there any fix available for inverted behaviour in android when the layout is stack.Almost tried every way but have no luck.

Screenshot 2021-12-27 at 6 02 16 PM
nessor commented 2 years ago

Did you figured sth. out? Have the same problem.

Saad9624 commented 2 years ago

Did you figured sth. out? Have the same problem.

Still not. Did you figure out anything?

hammadwahab12 commented 2 years ago

any update on this ?

anuragfexle commented 2 years ago

have the same issue, any luck

dhruvpvx commented 1 year ago

node_modules -> react-native-snap-carousel -> src -> utils -> animations.js

LINE 3

from

const IS_ANDROID = Platform.OS === 'android';

to

const IS_ANDROID = false;

CristianFigueredo commented 12 months ago

This patch fix my issue, thanks @dhruvpvx.

diff --git a/node_modules/react-native-snap-carousel/src/utils/animations.ts b/node_modules/react-native-snap-carousel/src/utils/animations.ts
index bf1c50f..a438f1a 100644
--- a/node_modules/react-native-snap-carousel/src/utils/animations.ts
+++ b/node_modules/react-native-snap-carousel/src/utils/animations.ts
@@ -1,7 +1,7 @@
 import { Platform, Animated } from 'react-native';
 import type { CarouselProps } from 'src/carousel/types';

-const IS_ANDROID = Platform.OS === 'android';
+const IS_ANDROID = false;

 // Get scroll interpolator's input range from an array of slide indexes
 // Indexes are relative to the current active slide (index 0)

Steps

  1. setup patch-package in your project (see a tutorial)
  2. Make the change in node_modules/react-native-snap-carousel/src/utils/animations.ts
  3. Runnpx patch-package react-native-snap-carousel