Android Image Swapping in 3D Animation Tutorial

In this tutorial, it is not simply swapping images by coding the image visibility to true or false but in this kind of tutorial I will introduce a unique swapping of images with 3D flipping in which it will swap in 3D Animation. First you need to have your abstract design like this and have two ImageView and named it as i1 and i2 and then one label and put the text on it as "Click the image above". The abstract designer must be like below and named the layout it as "flip3dview1". swap abstract design Here's the complete code for this Swapping Images in 3D Animation Application:
  1. Sub Process_Globals
  2.  
  3. End Sub
  4.  
  5. Sub Globals
  6.        
  7.         Dim a As ICOSFlip3DView
  8.         Dim i1,i2 As ImageView
  9.        
  10. End Sub
  11.  
  12. Sub Activity_Create(FirstTime As Boolean)
  13.         Activity.LoadLayout("flip3dview1")
  14.         Activity.Title="Swapping 3D View - Lyndon Bermoy"
  15. End Sub
  16.  
  17. Sub Activity_Resume
  18. End Sub
  19.  
  20. Sub i1_Click
  21.          a.Swap2View("a",i1,i2,300,a.FLIP_HORIZONTAL)
  22. End Sub
  23.        
  24. Sub a_animationend
  25.         ToastMessageShow("DONE",False)
  26. End Sub
  27.  
  28. Sub esci_Click
  29.         ExitApplication
  30. End Sub
Note for this code: * Dim a As ICOSFlip3DView - you need to create a variable for our image flipping and declare it on the Sub_Global. The ICOSFlip3DView can only be imported if you checked the library for ICOSFlip3DView. *  a.Swap2View("a",i1,i2,300,a.FLIP_HORIZONTAL) - is a syntax where a is our variable for ICOSFlip3DView library, "a" is the title in string, i1 is the first image to view in 3D, i2 is the second image to view in 3D, 300 is the duration in millisecond to swap the two image in 3D flipping, FLIP_HORIZONTAL is a method name to flip the image in a horizontal way. *
  1.  Sub a_animationend
  2.         ToastMessageShow("DONE",False)
  3.        End Sub  
- The code above will prompt the user when the swapping of images in 3D is ended. It will prompt the user "DONE". Best regards, Engr. Lyndon R. Bermoy IT Instructor/System Developer/Mobile Developer 09126450702 [email protected] Visit my page on Facebook at: https://www.facebook.com/BermzISware

Add new comment