All Products
Search
Document Center

Mobile Platform as a Service:Search bar

Last Updated:Mar 02, 2023

AUSearchBar (previously known as APSocailSearchBar) provides a search title bar containing a Back button, a search box, and a Search button on the right.

Sample image

Alipay

API description

/**
     * Set the maximum input length.
     */
    public void setInputMaxLength(int length);

    /**
     * Get the Back button.
     * @return
     */
    public AUIconView getBackButton() ;

    /**
     * Get the Delete button.
     * @return
     */
    public AUIconView getClearButton();

    /**
     * Get the search input box.
     * @return
     */
    public AUEditText getSearchEditView();

    /**
     * Get the Search button.
     * @return
     */
    public AUIconView getSearchButton() ;

    /**
     * Get the search layout.
     * @return
     */
    public AURelativeLayout getSearchRelativeLayout() ;

    /**
     * Get the voice search button.
     * @return
     */
    public AUIconView getVoiceButton();

         /**
     * Add editing event listening.
     */
        public void setEditChangedListener(TextWatcher watcher)

Custom properties

Property

Description

Type

isShowSearchBtn

Whether to show the Search button.

Boolean

isShowVoiceSearch

Whether to show the voice search button.

Boolean

searchEditText

The default text in the search box.

String, Reference

searchEditHint

The default prompt content in the search box.

String, Reference

searchButtonText

The text of the Search button.

String, Reference

inputMaxLength

The maximum length of the search box.

Integer, Reference

hintIconUnicode

The Unicode of the icon on the left side of the edit box.

String, Reference

hintIconDrawable

The resource of the icon on the left side of the edit box.

Reference

backIconUnicode

The Unicode of the Back button.

String, Reference

backIconDrawable

The resource of the Back button.

Reference

editHintColor

The color of the prompt content in the edit box.

Color, Reference

editTextColor

The color of the text in the edit box.

Color, Reference

editIconColor

The color of the icon in the edit box.

Color, Reference

Code sample

Input text

<com.alipay.mobile.antui.basic.AUSearchBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        app:searchEditText="Input text"
        app:isShowSearchBtn="true"
        app:isShowVoiceSearch="true"/>

    <com.alipay.mobile.antui.basic.AUSearchBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        app:searchEditHint="Dark text prompt"
        app:isShowSearchBtn="true"
        app:isShowVoiceSearch="true"/>