B4J Question [ jSD_XuiView ] Card Flip Animation dont works on b4j

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
I'm trying to convert the example done in b4a to b4j, but it is not showing animation of the flip cards!

flipcards.gif


Can anyone help me? below are the sources.

B4A source ( main source by @LucasMS ) ( Topic Here )
B4J source ( DOWNLOAD ) ( I applied both algorithms, but none of them worked... )

B4j doesn't support flip card animations ?
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
B4j doesn't support flip card animations ?
No. the rotate(x,y,z) method is only for b4a and b4i in SD_XuiView library

See here
 
Last edited:
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
??
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
??
It refers to a specific library not in general how to do this
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
only java B4A sample:

B4X:
private Sub FlipImageJava (RotationX As Float, RotationY As Float, Rotation As Float)
    jo.RunMethod("flipImage", Array As Object(mBaxView, RotationX, RotationY, Rotation, 1280.0f * Density))
End Sub

Java:
#IF JAVA
public void flipImage (ImageView imageView, float RotationX, float RotationY, float Rotation, float CameraDistance)
{
    import android.widget.ImageView;
    import android.util.DisplayMetrics;
  
    //BA.LogInfo("flipImage: In");

    /*---------------------------------------------------------------------------------------
    //Better to use parameter CameraDistance as B4A already provides the information required.
    //However, here's a way to do it:
    DisplayMetrics metrics = getResources().getDisplayMetrics();
    float CameraDistance = 1280.0f * (metrics.density * 160f);
    ----------------------------------------------------------------------------------------
    */
    float PivotX = imageView.getWidth()/2.0f;                    //'width centre
    float PivotY = imageView.getHeight()/2.0f;                    //height centre

    imageView.setPivotX(PivotX);
    imageView.setPivotX(PivotX);
    imageView.setPivotY(PivotY);
    imageView.setRotationX(RotationX);
    imageView.setRotationY(RotationY);
    imageView.setRotation(Rotation);
    imageView.setCameraDistance(CameraDistance);
  
    //BA.LogInfo("flipImage: Out");
}
#End If

simple demo JavaFX - Transformations

 
Last edited:
Upvote 0

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
No. the rotate(x,y,z) method is only for b4a and b4i in SD_XuiViee library

See here

is there any alternative that has the same result but in b4j?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
only java sample:

this is only for b4a
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
simple demo JavaFX - Transformations

It wants to rotate on the Z axis, and there is no general method for views or nodes
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
is there any alternative that has the same result but in b4j?
see here
 
Last edited:
Upvote 0
Top