B4A Library CoolAndroidAnim

I am leaving this project for whoever want to take it further or want to do something with it. Add to the wrapper and change the code of the Github project whichever way you want.

Posting the following:
1. B4A project
2. The Java Code (the src folder - no other folders are required)
3. The B4A library files

You cannot change the word Loading unless you go and change code in the original project.

Quite a cool animation...;)

2.png



1.png



Sample code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aCoolAnimView
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: landscape
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim t As Timer

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private cav1 As CoolAnimView
    Dim cnt As Int = 0
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    t.Initialize("t", 1000)

End Sub

Sub Activity_Resume
    t.Enabled = True
    cav1.init

End Sub

Sub Activity_Pause (UserClosed As Boolean)
   
t.Enabled = False

End Sub

Sub t_tick

    If cnt < 15 Then
        cnt = cnt + 1
    Else
        t.Enabled = False
        cnt = 0
        cav1.stopAnim   
    End If
   
   
End Sub

Library as it is at present:

CoolAnimView
Author:
Github: TomWithJerry , Wrapped by: Johan Schoeman
Version: 1
  • CoolAnimView
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • init
    • stopAnim
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

  • CoolAnimViewLibFiles.zip
    70.7 KB · Views: 320
  • b4aCoolAnimView.zip
    7.8 KB · Views: 298
  • TheJavaCode.zip
    25.1 KB · Views: 287
Top