react-native-cube-transition icon indicating copy to clipboard operation
react-native-cube-transition copied to clipboard

Programmatic transition?

Open aksonov opened this issue 7 years ago • 5 comments

Could you please help me with fully automatic transition (when user clicks some button, for example) ?

aksonov avatar Jul 19 '17 20:07 aksonov

@aksonov Sure! I'll try the best I can, I have been outside of RN work for quite some time now but I can try to point you in the right direction

tlackemann avatar Jul 19 '17 22:07 tlackemann

It is even more about iOS animations. I tried to use parts of handlePan, but got reverse ordering of views during transition...

20 июля 2017 г., в 0:40, Thomas Lackemann [email protected] написал(а):

@aksonov Sure! I'll try the best I can, I have been outside of RN work for quite some time now but I can try to point you in the right direction

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

aksonov avatar Jul 20 '17 05:07 aksonov

Finally made it working via emulating of pan gestures via inherited UIPanGestureRecognizer. But it would be great to know how to do it with pure iOS animation..

-(void)moveRight {
    OwnPanGestureRecognizer *pan = [[OwnPanGestureRecognizer alloc] init];
    [pan setTotalState:UIGestureRecognizerStateBegan];
    [self handlePan:pan withTranslation:CGPointMake(-10, 0)];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        [pan setTotalState:UIGestureRecognizerStateChanged];
        [self handlePan:pan withTranslation:CGPointMake(-120, 0)];
    });
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.4 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
        [pan setTotalState:UIGestureRecognizerStateChanged];
        [self handlePan:pan withTranslation:CGPointMake(-250, 0)];
        [pan setTotalState:UIGestureRecognizerStateEnded];
        [self handlePan:pan withTranslation:CGPointMake(-250, 0)];
    });
}

aksonov avatar Jul 20 '17 07:07 aksonov

HI any luck with this? Would love to use this library for a project.. but need ability to programtticaly transition.

aaggarwa88 avatar Oct 01 '17 18:10 aaggarwa88

@aaggarwa88 Sorry, no progress as this isn't a project that pays the bills for me. You're welcome to read my blog post on how this works and submit a PR.

https://lacke.mn/blog/react-native-experiments-instagram-stories/

tlackemann avatar Oct 02 '17 12:10 tlackemann