B4X Store

ELEVATEUI · B4A · XUI

UIAnimationButton

Use an animated action control when a button needs stronger visual feedback.

78 modules 1,780 APIs

Effects & interface utilities

What it solves

Use an animated action control when a button needs stronger visual feedback.

Animated conceptual demonstration, not an exact Android control screenshot.

22 methods7 Designer0 events

When to use this module

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.

B4A integration examples

Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.

Animated submit button: form validation, progress and completion events
Reviewed integration tutorial ElevateUI(6).b4xlib — UIAnimationButton.bas and Snippets/Add UIAnimationButton.txt Not B4A-compiled

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

Public methods reference

22 audited signatures

Public Sub Initialize (Callback As Object, EventName As String)

Prepare the instance before its other methods.

Original catalog note: ===== Initialization =====

Callback As ObjectEventName As String
Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map)

Invoked automatically by the B4A Visual Designer; do not call manually.

Base As ObjectLbl As LabelProps As Map
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.

Value As Float
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.

Icon As StringIconColor As IntIconTypeface As Typeface
Public Sub SetImage(DirImage As String, FileImage As String)

Use SetImage for its named operation; follow its exact signature.

DirImage As StringFileImage As String
Public Sub setButtonColor(c As Int)

Update button color at runtime when this setting changes.

c As Int
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.

c As Int
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.

c As Int
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.

t As String
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.

s As Float
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.

b As Boolean
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.

r As Float
Public Sub getCornerRadius As Float

Read the current corner radius value for validation or UI synchronization.

Returns: Float

Designer · 7

#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.

Public events and how to implement them · 0

No public callback events are declared in the catalog. You can still handle B4A events for controls inserted inside it.

Source: ElevateUI public API catalog; tutorials cross-checked against ElevateUI(6).b4xlib. Visualizations are illustrative; sample code requires B4A compilation.