B4X Store

ELEVATEUI · B4A · XUI

UICartButton

Cart-style button with expandable quantity controls, value boundaries, badge and animation customization.

78 modules 1,780 APIs

Inputs & forms

What it solves

Cart-style button with expandable quantity controls, value boundaries, badge and animation customization.

Animated conceptual demonstration, not an exact Android control screenshot.

69 methods14 Designer7 events

When to use this module

See verified public methods and events to integrate this component.

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.

Create a cart button
Reviewed integration tutorial Not B4A-compiled
Dim cart As UICartButton
cart.Initialize(Me, "cart")
cart.AddToParent(Activity, 16dip, 24dip, 240dip, 56dip)
cart.setMinValue(0)
cart.setMaxValue(10)
cart.setValue(1)
cart.setBackgroundColors(Array As Int(0xFF6750A4, 0xFF03DAC6))

Public methods reference

69 audited signatures

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

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

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

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Base As ObjectLbl As LabelProps As Map
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Parent As B4XViewLeft As IntTop As IntWidth As IntHeight As Int
Public Sub getBase As B4XView

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: B4XView

Public Sub setBadgeBackgroundColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setBadgeTextColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setBadgeBorderColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub getCustomContent As B4XView

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: B4XView

Public Sub getCollapseAtMinimum As Boolean

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Boolean

Public Sub setValue(Value As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Value As Int
Public Sub setValue2(Value As Int, FireEvent As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Value As IntFireEvent As Boolean
Public Sub getValue As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setProgrammaticEvents(Enabled As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Enabled As Boolean
Public Sub setMinValue(Value As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Value As Int
Public Sub getMinValue As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setMaxValue(Value As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Value As Int
Public Sub getMaxValue As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setStep(Value As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Value As Int
Public Sub getStep As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setEnabled(Enabled As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Enabled As Boolean
Public Sub getEnabled As Boolean

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Boolean

Public Sub setExpanded(Expanded As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Expanded As Boolean
Public Sub getExpanded As Boolean

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Boolean

Public Sub setText(Text As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Text As String
Public Sub getText As String

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: String

Public Sub setTextColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub getTextColor As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setTextSize(Size As Float)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Size As Float
Public Sub getTextSize As Float

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Float

Public Sub setTextAlignment(Horizontal As String, Vertical As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Horizontal As StringVertical As String
Public Sub setBackgroundColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setBackgroundColors(ColorsList As List)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

ColorsList As List
Public Sub setGradientDirection(Direction As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Direction As String
Public Sub getGradientDirection As String

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: String

Public Sub getBackgroundColors As Int()

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int()

Public Sub setCounterColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setControlColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setControlTextColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setBorderColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setBorderWidth(Width As Float)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Width As Float
Public Sub setCornerRadius(Radius As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Radius As Int
Public Sub getCornerRadius As Int

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Int

Public Sub setMainTextTypeface(TextTypeface As Typeface)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

TextTypeface As Typeface
Public Sub getMainTextTypeface As Typeface

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Typeface

Public Sub Elevation(BtElevation As Float, Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

BtElevation As FloatColor As Int
Public Sub SetTextGlow(Radius As Float, GlowColor As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Radius As FloatGlowColor As Int
Public Sub setColorEffectSelecting(Enabled As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Enabled As Boolean
Public Sub getColorEffectSelecting As Boolean

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: Boolean

Public Sub setPadding(Padding As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Padding As Int
Public Sub setControlWidth(Width As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Width As Int
Public Sub setCustomContentWidth(Width As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Width As Int
Public Sub setAnimationDuration(Duration As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Duration As Int
Public Sub setShowAnimation(Enabled As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Enabled As Boolean
Public Sub setCollapseAtMinimum(Enabled As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Enabled As Boolean
Public Sub setShowShadow(Show As Boolean)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Show As Boolean
Public Sub setShadow(Color As Int, Offset As Float)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As IntOffset As Float
Public Sub SetIcon(Icon As String, FontIcon As B4XFont, Color As Int, Position As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Icon As StringFontIcon As B4XFontColor As IntPosition As String
Public Sub setIconTypeface(Icon As String, Color As Int, IconTypeface As Typeface, Position As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Icon As StringColor As IntIconTypeface As TypefacePosition As String
Public Sub setIconColor(Color As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Color As Int
Public Sub setIconSize(Size As Float)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Size As Float
Public Sub setImageSize(Size As Int)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Size As Int
Public Sub setIconPosition(Position As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Position As String
Public Sub setContentPosition(Position As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Position As String
Public Sub getContentPosition As String

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: String

Public Sub setImagePosition(Position As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Position As String
Public Sub getImagePosition As String

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Returns: String

Public Sub SetImage(Directory As String, FileName As String)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Directory As StringFileName As String
Public Sub SetImageBitmap(Bitmap As B4XBitmap)

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Bitmap As B4XBitmap
Public Sub Reset

Public API declaration; refer to the library behavior for usage details.

Original catalog note: Verified against supplied 2026-11-28 .b4xlib

Designer · 14

#DesignerProperty: Key: DefaultValue, DisplayName: Default Value, FieldType: Int, DefaultValue: 0, MinRange: -999999, MaxRange: 999999#DesignerProperty: Key: MinValue, DisplayName: Minimum Value, FieldType: Int, DefaultValue: 0, MinRange: 0, MaxRange: 999999#DesignerProperty: Key: MaxValue, DisplayName: Maximum Value, FieldType: Int, DefaultValue: 99, MinRange: -999999, MaxRange: 999999#DesignerProperty: Key: Step, DisplayName: Step, FieldType: Int, DefaultValue: 1, MinRange: 1, MaxRange: 9999#DesignerProperty: Key: Text, DisplayName: Text, FieldType: String, DefaultValue: Add to cart#DesignerProperty: Key: TextColor, DisplayName: Text Color, FieldType: Color, DefaultValue: 0xFFFFFFFF#DesignerProperty: Key: BackgroundColor, DisplayName: Background Color, FieldType: Color, DefaultValue: 0xFF6750A4#DesignerProperty: Key: IconColor, DisplayName: Icon Color, FieldType: Color, DefaultValue: 0xFFFFFFFF#DesignerProperty: Key: CornerRadius, DisplayName: Corner Radius, FieldType: Int, DefaultValue: 14, MinRange: 0, MaxRange: 100#DesignerProperty: Key: AnimationEnabled, DisplayName: Animation Enabled, FieldType: Boolean, DefaultValue: True#DesignerProperty: Key: AnimationDuration, DisplayName: Animation Duration, FieldType: Int, DefaultValue: 220, MinRange: 0, MaxRange: 2000#DesignerProperty: Key: TextSize, DisplayName: Text Size, FieldType: Int, DefaultValue: 15, MinRange: 8, MaxRange: 40#DesignerProperty: Key: GradientDirection, DisplayName: Gradient Direction, FieldType: String, DefaultValue: AUTO, List: AUTO|TOP_BOTTOM|TR_BL|RIGHT_LEFT|BR_TL|BOTTOM_TOP|BL_TR|LEFT_RIGHT|TL_BR#DesignerProperty: Key: ColorEffectSelecting, DisplayName: Color Effect Selecting, FieldType: Boolean, DefaultValue: True

Public events and how to implement them · 7

Initialize with Me and the event prefix Demo, then add the following handler to your B4A module. Names and arguments come from the library declaration.

Click

Raised when the user taps the control; use it to trigger a real action.

B4A handler signature with Demo prefix

Private Sub Demo_Click()
    Log("Click")
End Sub
LongClick

Raised when the user taps the control; use it to trigger a real action.

B4A handler signature with Demo prefix

Private Sub Demo_LongClick()
    Log("LongClick")
End Sub
ValueChanged(Value As Int)

Raised when a selection or value changes; use it to update dependent data.

B4A handler signature with Demo prefix

Private Sub Demo_ValueChanged(Value As Int)
    Log("ValueChanged")
End Sub
Increment(Value As Int)

Event declared by this module. Handle the indicated action in the callback.

B4A handler signature with Demo prefix

Private Sub Demo_Increment(Value As Int)
    Log("Increment")
End Sub
Decrement(Value As Int)

Event declared by this module. Handle the indicated action in the callback.

B4A handler signature with Demo prefix

Private Sub Demo_Decrement(Value As Int)
    Log("Decrement")
End Sub
LimitReached(Value As Int)

Event declared by this module. Handle the indicated action in the callback.

B4A handler signature with Demo prefix

Private Sub Demo_LimitReached(Value As Int)
    Log("LimitReached")
End Sub
StateChanged(Expanded As Boolean)

Raised when a selection or value changes; use it to update dependent data.

B4A handler signature with Demo prefix

Private Sub Demo_StateChanged(Expanded As Boolean)
    Log("StateChanged")
End Sub

For code-created controls use Initialize(Me, "Demo") when that signature exists; for Designer controls set the event name there. Replace Demo with the actual prefix.

Public fields, constants and types

Public Const CONTENT_POSITION_LEFT As String = "Left"Public Const CONTENT_POSITION_RIGHT As String = "Right"Public Const CONTENT_POSITION_TOP As String = "Top"Public Const CONTENT_POSITION_BOTTOM As String = "Bottom"Public Const ICON_POSITION_LEFT As String = "Left"Public Const ICON_POSITION_RIGHT As String = "Right"Public Const ICON_POSITION_TOP As String = "Top"Public Const ICON_POSITION_BOTTOM As String = "Bottom"Public Const GRADIENT_AUTO As String = "AUTO"Public Const GRADIENT_TOP_BOTTOM As String = "TOP_BOTTOM"Public Const GRADIENT_TR_BL As String = "TR_BL"Public Const GRADIENT_RIGHT_LEFT As String = "RIGHT_LEFT"Public Const GRADIENT_BR_TL As String = "BR_TL"Public Const GRADIENT_BOTTOM_TOP As String = "BOTTOM_TOP"Public Const GRADIENT_BL_TR As String = "BL_TR"Public Const GRADIENT_LEFT_RIGHT As String = "LEFT_RIGHT"Public Const GRADIENT_TL_BR As String = "TL_BR"Public mBase As B4XViewPublic Tag As Object
Source: ElevateUI public API catalog; tutorials cross-checked against ElevateUI(6).b4xlib. Visualizations are illustrative; sample code requires B4A compilation.