react-native-flip-page icon indicating copy to clipboard operation
react-native-flip-page copied to clipboard

Return to first FlipPage page - feature request

Open leslielyj opened this issue 6 years ago • 3 comments

Just curious if there is any further development on this package?

Feature Request: I would like to navigate to the first flippage page. With the existing ref feature, we can put a ref on the first flip and have a button listener on each subsequent page to click and which will direct to the first page, but there is no way to flip to the first flip, the only thing coming close is the window.scrollTo which only works for ScrollView.

leslielyj avatar Jul 10 '19 02:07 leslielyj

Yes, this could be an interesting feature. The idea would be to trigger animation, wait a delay, then trigger animation again until reaching first page.

I can try to work on that some time.

darenju avatar Jul 10 '19 16:07 darenju

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) animationLoop=async(count=6,value= 60)=>{ for(intTimes=1;intTimes<=count;intTimes++){ for(index=0;index<value;index++){ if(intTimes%2 == 0){ this.handlePanResponderMove(null,{dx:intTimes,dy:-(value-(index*2))}) }else{ this.handlePanResponderMove(null,{dx:intTimes,dy:-(0+(index))}) } await sleep(1) } } }

vivekjain751 avatar Jan 28 '22 08:01 vivekjain751

@leslielyj @darenju check this trick :)

vivekjain751 avatar Jan 28 '22 08:01 vivekjain751