Public Sub Initialize (Callback As Object, EventName As String)
Prepare the instance before its other methods.
Original catalog note: ===== Initialization =====
ELEVATEUI · B4A · XUI
Use an animated action control when a button needs stronger visual feedback.
Effects & interface utilities
Use an animated action control when a button needs stronger visual feedback.
Animated conceptual demonstration, not an exact Android control screenshot.
Use the animated state for the primary action of a form, while preserving clear disabled and completed states.
Before integrating, examine its methods, events and Designer options.
Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.
B4A + ElevateUI + XUI. In the Visual Designer create Main.bal with one UIAnimationButton custom view named btnSubmit (event name btnSubmit), sized about 240dip × 60dip, and a standard EditText named txtName. This library builds its child views in DesignerCreateView; calling Initialize alone does not create a visible button.
' Activity Main — UIAnimationButton + EditText
' Designer: Main.bal contains an UIAnimationButton named btnSubmit
' (event prefix btnSubmit) and a standard EditText named txtName.
' Enable ElevateUI and XUI in the Libraries tab.
Sub Process_Globals
End Sub
Sub Globals
Private btnSubmit As UIAnimationButton
Private txtName As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
txtName.Hint = "Your name"
btnSubmit.Text = "Send"
btnSubmit.TextSize = 17
btnSubmit.BoldText = True
btnSubmit.ButtonColor = Colors.RGB(53, 185, 152)
btnSubmit.SuccessColor = Colors.RGB(41, 198, 131)
End Sub
' The custom view invokes this event when tapped.
Private Sub btnSubmit_Click
Dim name As String = txtName.Text.Trim
If name.Length = 0 Then
ToastMessageShow("Enter your name before sending.", False)
Return
End If
Log("Submission requested for " & name)
End Sub
' The button itself runs its built-in visual transition.
Private Sub btnSubmit_AfterStart
Log("The animation has started")
End Sub
Private Sub btnSubmit_Finished
ToastMessageShow("Button animation complete.", False)
Log("Current progress: " & btnSubmit.GetProgress)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause(UserClosed As Boolean)
End Sub
22 audited signatures
Public Sub Initialize (Callback As Object, EventName As String)
Prepare the instance before its other methods.
Original catalog note: ===== Initialization =====
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
Invoked automatically by the B4A Visual Designer; do not call manually.
Public Sub getBase As B4XView
Read the current base value for validation or UI synchronization.
Returns: B4XView
Public Sub Click
Use Click for its named operation; follow its exact signature.
Public Sub SetProgress(Value As Float)
Use SetProgress for its named operation; follow its exact signature.
Public Sub GetProgress As Float
Use GetProgress for its named operation; follow its exact signature.
Returns: Float
Public Sub SetIcon(Icon As String, IconColor As Int, IconTypeface As Typeface)
Use SetIcon for its named operation; follow its exact signature.
Public Sub SetImage(DirImage As String, FileImage As String)
Use SetImage for its named operation; follow its exact signature.
Public Sub setButtonColor(c As Int)
Update button color at runtime when this setting changes.
Public Sub getButtonColor As Int
Read the current button color value for validation or UI synchronization.
Returns: Int
Public Sub setSuccessColor(c As Int)
Update success color at runtime when this setting changes.
Public Sub getSuccessColor As Int
Read the current success color value for validation or UI synchronization.
Returns: Int
Public Sub setIconColor(c As Int)
Update icon color at runtime when this setting changes.
Public Sub getIconColor As Int
Read the current icon color value for validation or UI synchronization.
Returns: Int
Public Sub setText(t As String)
Update text at runtime when this setting changes.
Public Sub getText As String
Read the current text value for validation or UI synchronization.
Returns: String
Public Sub setTextSize(s As Float)
Update text size at runtime when this setting changes.
Public Sub getTextSize As Float
Read the current text size value for validation or UI synchronization.
Returns: Float
Public Sub setBoldText(b As Boolean)
Update bold text at runtime when this setting changes.
Public Sub getBoldText As Boolean
Read the current bold text value for validation or UI synchronization.
Returns: Boolean
Public Sub setCornerRadius(r As Float)
Update corner radius at runtime when this setting changes.
Public Sub getCornerRadius As Float
Read the current corner radius value for validation or UI synchronization.
Returns: Float
#DesignerProperty: Key: ButtonText, DisplayName: Button Text, FieldType: String, DefaultValue: BUTTON, Description: Text displayed on the button.#DesignerProperty: Key: CornerRadius, DisplayName: Corner Radius, FieldType: Int, DefaultValue: 70, MinRange: 0, MaxRange: 100, Description: Corner radius of the button.#DesignerProperty: Key: TextSize, DisplayName: Text Size, FieldType: Float, DefaultValue: 20, MinRange: 8, MaxRange: 60, Description: Size of the button text or icon.#DesignerProperty: Key: BoldText, DisplayName: Bold Text, FieldType: Boolean, DefaultValue: False, Description: Whether the text is bold.#DesignerProperty: Key: ButtonColor, DisplayName: Button Color (Play), FieldType: Color, DefaultValue: #FFFA2D7D, Description: Initial color of the button.#DesignerProperty: Key: SuccessColor, DisplayName: Success Color (Done), FieldType: Color, DefaultValue: 0xFF00E676, Description: Color of the final success circle.#DesignerProperty: Key: IconColor, DisplayName: Text Color, FieldType: Color, DefaultValue: 0xFFFFFFFF, Description: Color of the icon and text.No public callback events are declared in the catalog. You can still handle B4A events for controls inserted inside it.