Sub Class_Globals
Private Root As B4XView
Private xui As XUI
' Declare the component
Private myTagSphere As B4XDaisyTagSphere
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.Color = xui.Color_White
' 1. Initialize the component (Pass the callback module and event prefix)
myTagSphere.Initialize(Me, "myTagSphere") [12]
' 2. Add it to your parent view (Parent, Left, Top, Width, Height)
myTagSphere.AddToParent(Root, 10dip, 10dip, 300dip, 300dip) [13]
' 3. Set visual and behavioral properties
myTagSphere.setRadius(1.5) ' 1.0 to 10.0 (Larger value = smaller visual sphere) [14]
myTagSphere.setSensitivity(11) ' Drag touch sensitivity [15]
myTagSphere.setAutoRotate(True) ' Enable automatic spinning [15]
myTagSphere.setAutoSpeed(0.3) ' Set the speed of auto-rotation [16]
myTagSphere.setTextSize(15) ' Font size [14]
myTagSphere.setTextColor(0xFF374151) ' Text color [14]
' 4. Add your data (List of strings)
Dim tags As List
tags.Initialize
tags.AddAll(Array("B4A", "B4i", "B4J", "Flutter", "React", "Python", "SQL")) [17]
myTagSphere.setItems(tags) [2]
End Sub
' 5. Trap interactive events!
' Triggered when a user taps a specific tag
Private Sub myTagSphere_TagTap(Tag As String) [1]
Log("User tapped on: " & Tag)
End Sub
' Triggered when a user long-presses a specific tag
Private Sub myTagSphere_TagLongPress(Tag As String) [1]
Log("User long-pressed on: " & Tag)
' Example: Remove the tag dynamically!
myTagSphere.removeTag(Tag) [18]
End Sub