B4A Library FidgetSpinnerImageView

A partial wrap for this Github project. Do with it (the Java code) as you like.

Take note of the file in the /Object/res/drawable folder of the B4A project. the file (spinner.png) needs to be set to READ ONLY (or else change the attached B4A project to make use of #AdditionalRes)

Spin it around with your finger.....

1.png


Sample code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aFridgetSpinner
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #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.

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 fs As FidgetSpinner
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")
    fs.addImage("spinner")
  

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub fs_angle_changed(angle As Double)
  
    Log("angle = " & angle)
  
End Sub

Library:
FidgetSpinnerImageView
Author: Github: Michael jentsch(https://github.com/msoftware/Fidget...nal.com&utm_medium=referral&utm_campaign=6148), Wrapped by: Johan Schoeman
Version: 1
  • FidgetSpinner
    Events:
    • angle_changed (angle As Double)
    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
    • SetBackgroundImageNew (arg0 As Bitmap) As BitmapDrawable
    • 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)
    • addImage (draw As String)
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Padding()() As Int
    • Parent As Object [read only]
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
 

Attachments

  • LibraryFiles.zip
    22.5 KB · Views: 229
  • TheJavaCode.zip
    17.7 KB · Views: 208
  • b4aFidgetSpinner.zip
    226 KB · Views: 198
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Thanks for this,
Can you spin it programmatically?
Will have to look into that but it does not seem to be the case as it is relying on touch events.
 
Top