Based on @narek adonts answer here:
this is a ShowPage animation Code Module
usage:
thanx a lot @narek adonts
this is a ShowPage animation Code Module
B4X:
'Code module
Sub Process_Globals
End Sub
'Transition: 0 = cameraIris, 1 = cameraIrisHollowOpen, 2 = cameraIrisHollowClose, 3 = cube, 4 = alignedCube, 5 = flip,
' 6 = alignedFlip, 7 = oglFlip, 8 = rotate, 9 = pageCurl, 10 = pageUnCurl, 11 = rippleEffect, 12 = suckEffect
'Direction: 0 = FromTop, 1 = FromBottom, 2 = FromLeft, 3 = FromRight
Public Sub showPage(NavigationControl As NavigationController,PageToShow As Page,TransType As Int, Direction As Int)
Dim TransitionType As String
Select TransType
Case 0
TransitionType = "cameraIris"
Case 1
TransitionType = "cameraIrisHollowOpen"
Case 2
TransitionType = "cameraIrisHollowClose"
Case 3
TransitionType = "cube"
Case 4
TransitionType = "alignedCube"
Case 5
TransitionType = "flip"
Case 6
TransitionType = "alignedFlip"
Case 7
TransitionType = "oglFlip"
Case 8
TransitionType = "rotate"
Case 9
TransitionType = "pageCurl"
Case 10
TransitionType = "pageUnCurl"
Case 11
TransitionType = "rippleEffect"
Case 12
TransitionType = "suckEffect"
End Select
Dim FromDirection As String
Select Direction
Case 0
FromDirection = "fromTop"
Case 1
FromDirection = "fromBottom"
Case 2
FromDirection = "fromLeft"
Case 3
FromDirection = "fromRight"
End Select
Dim no As NativeObject=Me
no.RunMethod("trans:::",Array(NavigationControl,TransitionType,FromDirection))
NavigationControl.ShowPage2(PageToShow,False)
End Sub
#if OBJC
-(void) trans: (UINavigationController*)nav :(NSString*)tp :(NSString*)from
{
CATransition *transition = [CATransition animation];
transition.duration = 0.6f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = tp;
transition.subtype = from;
[nav.view.layer addAnimation:transition forKey:nil];
}
#End If
usage:
B4X:
Transition.showPage(NavControl,menuPage,6,3)
thanx a lot @narek adonts