UI Components

Your app’s user interface and everything that users can see and interact with.

VGSEditText

A base user interface element that displays text.

setFieldType

Sets type of current input field. Choosing the input type you configure the limitations for this type.

Related xml attributes: app:fieldType

FieldType Description
cardNumber Type: the card number.
cvc Type: card security code.
expDate Type: card expiration date.
cardHolderName Type: cardHolderName.
info Type: any type of data.

public void setFieldType(FieldType type)

Parameter
type enum: type of EditText.

getFieldType

Returns the current type of the field.

public FieldType getFieldType()

Returns
FieldType The type of EditText.

setFieldName

Sets the text to be used for data transfer to VGS proxy. Usually, it is similar to field-name in JSON path in your inbound route filters.

Related xml attributes: app:fieldName

public void setFieldName(int resId)

Parameter
resId Int: the resource identifier of the string resource to be displayed.

public void setFieldName(String text)

Parameter
text String: text to be used.

getFieldName

Return the text that field is using for data transfer to VGS proxy.

public String getFieldName()

Returns
String The text used by the field.

setIsRequired

Specifies whether the text inside input field is required to be filled.

Related xml attributes: app:isRequired

public void setIsRequired(boolean state)

Parameter
state Boolean: field required to be filled (the default) or can be skipped.

Additional XML attributes:

Attribute Description
app:textSize Size of the text.
app:ellipsize If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle.
app:text Text to display.
app:textColor Text color.
app:maxLines Makes the View be at most this many lines tall.
app:minLines Makes the View be at least this many lines tall.
app:textStyle Style (normal, bold, italic) for text.
app:cursorVisible Makes the cursor visible (the default) or invisible.
app:gravity Specifies how to align the text by the view’s x- or y-axis when the text is smaller than the view.
app:scrollHorizontally When the text is allowed to be wider than the view (and therefore can be scrolled horizontally).
app:hint Hint text to display when the text is empty.

VGSCardNumberEditText

A user interface element that displays text to the user in card number format.

setCardBrandIconGravity

Specifies how to align the icon by the view’s x-axis. To specify gravity programmatically you could use android Gravity class.

Related xml attributes: app:cardBrandIconGravity

public void setCardBrandIconGravity(int gravity)

Note

At the current moment we support only start and end position.

Parameter
gravity Int: Specifies how to align the icon by the view’s x-axis.

setDivider

Sets the symbol that will divide groups of digits in the card number.

Related xml attributes: app:numberDivider

public void setDivider(Char char)

Parameter
char Char: The divider symbol.

Additional XML attributes:

Attribute Description
app:fieldName Sets the text to be used for data transfer to VGS proxy
app:isRequired Specifies whether the text inside input field is required to be filled.
app:textSize Size of the text.
app:ellipsize If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle.
app:text Text to display.
app:textColor Text color.
app:maxLines Makes the View be at most this many lines tall.
app:minLines Makes the View be at least this many lines tall.
app:textStyle Style (normal, bold, italic) for text.
app:cursorVisible Makes the cursor visible (the default) or invisible.
app:gravity Specifies how to align the text by the view’s x- or y-axis when the text is smaller than the view.
app:scrollHorizontally When the text is allowed to be wider than the view (and therefore can be scrolled horizontally).
app:hint Hint text to display when the text is empty.

VGSTextInputLayout

Material component which wraps the VGS fields to show a floating label when the hint is hidden due to user inputting text.

setError

Sets an error message that will be displayed below

public void setError(CharSequence text)

Parameter
text CharSequence: error message to be displayed

Additional XML attributes:

Attribute Description
app:hint Hint text to display when the text is empty.
app:passwordToggleEnabled When enabled, a button is placed at the end of the EditText which enables the user to switch between the field’s input being visibly disguised or not.
app:passwordToggleTint Applies a tint to the the password visibility toggle drawable.
app:passwordToggleDrawable Applies a drawable on the the password toggle.
app:hintEnabled Sets whether the floating label functionality is enabled or not in this layout.
app:hintAnimationEnabled Set whether any hint state change, due to being focused or non-empty text, are animated.
app:boxBackgroundModes Set the box background more(filled, outline, or none).
app:boxBackgroundColor Set the resource used for the filled box’s background color.
app:boxStrokeColor Set the outline box’s stroke color.
app:boxCornerRadiusTopStart Set the box’s top start corner radius.
app:boxCornerRadiusTopEnd Set the box’s top end corner radius.
app:boxCornerRadiusBottomStart Set the box’s bottom start corner radius.
app:boxCornerRadiusBottomEnd Set the box’s bottom end corner radius.
app:boxCornerRadius Set the box corners radius.