react-native-pager-view icon indicating copy to clipboard operation
react-native-pager-view copied to clipboard

Curl not working properly

Open mqtik opened this issue 4 years ago • 9 comments

The curl effect it's not working properly for me. When you start sliding, it always goes on the X axis, image

Has someone else also experience this?

<ViewPager
      initialPage={page - offset}
      ref={vpRef}
      style={[props.style, StyleSheet.absoluteFillObject, {flex:1}]}
      onStartShouldSetResponder={() => props.onStartShouldSetResponder()}
      pageMargin={0}
      orientation={'horizontal'} 
      scrollEnabled={true}
      transitionStyle={'curl'} 
      onPageSelected={onPageSelected}>
      {props.data
        .slice(offset, offset + windowLength)
        .map((item, index) =>
          renderPage(
            props.renderItem,
            item,
            offset + index,
            page,
            buffer - internalBuffer,
          ),
        )}
    </ViewPager>

It's like, it doesn't lean like a page effect

Is someone else also experiencing this problem?

mqtik avatar Oct 15 '20 17:10 mqtik

Android currently does not support curl type

mqtik avatar Oct 24 '20 06:10 mqtik

Hello @mqtik,

I'm experiencing the same issue. The curl mode worked properly until yesterday when I upgraded my project from Expo v36.0 to v39.0. Now, the curl is shown, but locked on the X axis.

I don't know if Expo is the problem, or if when I upgraded Expo version it has updated some dependencies as well. Do you use Expo as well or pure React Native?

julienpetit avatar Oct 25 '20 16:10 julienpetit

another interesting point with curl.

If you set transition to curl, tap on the side of the screen start the transition to another page. Without curl, tap do nothing

batical avatar Oct 30 '20 12:10 batical

@batical, yes this is the native behavior of the Pager on iOS. The pain point of that is we cannot disable the tap from the lib react-native-viewpager for now. It means we can't add buttons in this area of the screen because the pager will change the page instead of firing onPress on the button.

julienpetit avatar Oct 30 '20 13:10 julienpetit

is there a way to implement the curl effect on Android?

brayanL avatar Apr 20 '21 20:04 brayanL

I noticed that the onPageScrollStateChanged event not fired when the transition == curl Is it the expected behaviour?

alachab avatar Apr 23 '21 18:04 alachab

I noticed that the onPageScrollStateChanged event not fired when the transition == curl Is it the expected behaviour?

I was trying to fix this, but the native component does not have the ability to listening on scrolling.

troZee avatar Apr 29 '21 07:04 troZee

is there a way to implement the curl effect on Android?

Probably there is a way to do it, but this kind of behavior is not supported by default. On android a custom solution should be used.

troZee avatar Apr 29 '21 07:04 troZee

@troZee what is the custome solution of creating curl effect on react native Android . Please give us Link to solution

jawadkodextech avatar Mar 30 '22 11:03 jawadkodextech