Hello everyone, i need to create a smooth horizontal flip animation for any view, i have something more or less working using ICOSFlip3DView library which works great, the only problem is that i would like the animation to be even, what I mean by even is that when the panel or imageview rotates 180 degrees, there is always this effect around the top and bottom that looks as if view stretches, i've seen other tutorials online where they've made the animation even and smooth, i've tried following those tutorials but none of them have worked, one of them suggests changing the camera distance which I did using in-line java code but I don't see any changes.
here's a small video of what I have so far, notice around the top when the view rotates and you will see that it seems as if it stretches a bit.
and here is what i'm actually looking to accomplish, i realize i can easily wrap any of the libraries out there but i'm trying to find a solution that won't have to force me to add any more libraries to my project.
Here's the code I have
Thanks in advance all.
here's a small video of what I have so far, notice around the top when the view rotates and you will see that it seems as if it stretches a bit.
and here is what i'm actually looking to accomplish, i realize i can easily wrap any of the libraries out there but i'm trying to find a solution that won't have to force me to add any more libraries to my project.
Here's the code I have
B4X:
Sub btn1_Click
'' a1 = xml.LoadAnimation("anim_animation", "in")
''a1.Duration = 2000
''a1.Start(pnl1)
Private NativeMe As JavaObject
NativeMe.InitializeContext
Dim Distance As Float = 5000
Log("distance: " & Distance)
Log("scale0: " & GetDeviceLayoutValues.Scale)
Dim scale As Float = NativeMe.RunMethod("Scale", Null)
Log("scale: " & scale)
increaseCameraDistance(pnl1, Distance, scale)
If direction = False Then
flip.Flip3DView("flip", pnl1, 180, 700, flip.FLIP_HORIZONTAL)
''a1.InitializeRotate("a1", 0, 180)
''a1.InitializeRotateCenter("a1", 0, 180, pnl1)
pnl1.SetColorAnimated(700, Colors.blue, Colors.Green)
''a1.Duration = 2000
''a1.InitializeAlpha("a1", 0, 1)
''a1.Duration = 1000
''a1.Start(pnl1)
Else
flip.Flip3DView("flip", pnl1, 180, 700, flip.FLIP_HORIZONTAL)
''a1.InitializeRotate("a1", 0, 180)
''a1.InitializeRotateCenter("a1", 0, 180, pnl1)
pnl1.SetColorAnimated(700, Colors.green, Colors.blue)
'' a1.Duration = 2000
''a1.InitializeAlpha("a1", 1, 0)
''a1.Duration = 1000
''a1.Start(pnl1)
'' pnl1.Color = Colors.blue
End If
''float scale = context.getResources().getDisplayMetrics().density;
''view.setCameraDistance(Distance * scale);
If a1.IsInitialized Then
a1.Stop(pnl1)
pnl1.Invalidate
a1.Start(pnl1)
End If
flip.StartAnim(pnl1)
''
End Sub
Sub increaseCameraDistance(v As View, Distance As Float, scale As Float)
Dim jo = v As JavaObject
Log("camera distance: " & Distance)
jo.RunMethod("setCameraDistance", Array(Distance * scale))
End Sub
Thanks in advance all.