All Products
Search
Document Center

Mobile Platform as a Service:Amount input box

Last Updated:Jul 21, 2023

The AUAmountInputBox component provides an input box for the capital chain, and the number in the input box is in a special digit font. The input box includes two parts: edit box (AUAmountEditText) and notes (AUAmountFootView). AUAmountFootView has two styles, editable input box and text display, which can be used as needed.

In addition, the component provides AUAmountLabelText for special digit font display.

Dependency

See Quick start.

API description

AUAmountInputBox

/**
     * Get the edit box.
     * @return
     */
    public AUEditText getEditText() 

    /**
     * Get the edit box.
     * @return
     */
    public AUAmountEditText getEditLayout() 

    /**
     * Get footView of the capital chain.
     * @return
     */
    public AUAmountFootView getFootView()

    /**
     * Get the title bar of the output box.
     * @return
     */
    public AUTextView getTitleView() 

    /**
     * Set properties of HeadView.
     * @param style EDIT_STYLE and TEXT_STYLE.
     */
    public void setFootStyle(int style)

    /**
     * Set the FootView edit box prompt.
     * @param hint
     */
    public void setFootHint(String hint)


    /**
     * Set the FootView text.
     * @param text
     */
    public void setFootText(String text)

AUAmountEditText

/**
     * Get EditText.
     * @return
     */
    public AUEditText getEditText() 


    /**
     * Get input box information.
     * @return
     */
    public Editable getEditTextEditable()

    /**
     * Set to show or hide the separation line.
     * @param visible
     */
    public void setDividerVisible(boolean visible)

    /**
     * Set the prompt.
     * @param hint
     */
    public void setHint(String hint)

    /**
     * Specify whether to display the Delete button.
     * @param isShow
     */
    public void isShowClearIcon(boolean isShow)

    /**
     * Add focus listening.
     * @param listener
     */
    public void addOnFocusChangeListeners(OnFocusChangeListener listener)

    /**
     * Bind the external AUNumberKeyboardView ScrollView.
     * @param keyboardView
     * @param scrollView
     */
    public void setKeyBoardView(AUNumberKeyboardView keyboardView, ScrollView scrollView)

    /**
     * Bind the external AUNumberKeyboardView.
     * @param keyboardView
     */
    public void setKeyBoardView(AUNumberKeyboardView keyboardView)

Custom properties

Property

Description

Type

footStyle

Type of header view.

editStyle, textStyle

amountTitleText

Edit box title.

String, Reference

amountHintText

Prompt for edit box.

String, Reference

Code sample

General code sample

<com.alipay.mobile.antui.amount.AUAmountEditText
    android:id="@+id/edit_text"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:amountHintText="Available balance 500.00" />

<com.alipay.mobile.antui.amount.AUAmountLabelText
    android:id="@+id/label_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal" />

<com.alipay.mobile.antui.amount.AUAmountInputBox
      android:id="@+id/amount_input_1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="10dp"
      app:amountTitleText="Transfer amount" />

<com.alipay.mobile.antui.amount.AUAmountInputBox
      android:id="@+id/amount_input_2"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="10dp"
      app:amountTitleText="Transfer amount"
      app:amountHintText="Available balance 500.00"
      app:footStyle="textStyle" />

AUAmountInputBox inputBox1 = (AUAmountInputBox)findViewById(R.id.amount_input_1);
inputBox1.setFootHint("Add remark");

AUAmountInputBox inputBox2 = (AUAmountInputBox)findViewById(R.id.amount_input_2);
inputBox2.setFootText("Input not allowed");

Code sample defining a numeric keypad

<?xml version="1.0" encoding="utf-8"?>
<com.alipay.mobile.antui.basic.AULinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/com.alipay.mobile.antui"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.alipay.mobile.antui.basic.AUScrollView
        android:id="@+id/scroll"
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.alipay.mobile.antui.basic.AULinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <com.alipay.mobile.antui.amount.AUAmountInputBox
                android:id="@+id/amount_input_1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                app:amountTitleText="Transfer amount" />
        </com.alipay.mobile.antui.basic.AULinearLayout>
    </com.alipay.mobile.antui.basic.AUScrollView>

    <com.alipay.mobile.antui.keyboard.AUNumberKeyboardView
        android:id="@+id/keyboard"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="gone"/>
</com.alipay.mobile.antui.basic.AULinearLayout>
// Initialize
keyboardView = (AUNumberKeyboardView) findViewById(R.id.keyboard);
inputBox1 = (AUAmountInputBox)findViewById(R.id.amount_input_1);
ScrollView scrollView = (ScrollView) findViewById(R.id.scroll);

// Bind the keyboard.
inputBox1.getEditLayout().setKeyBoardView(keyboardView, scrollView);