Search input box
AUSearchInputBox (formerly APSocialTagSearchBar) provides a search title bar with a search box and a search button on the right. You must set the height of the View when you use this component.
API reference
/**
* Sets the maximum input length.
*/
public void setInputMaxLength();
/**
* Gets the delete button.
* @return
*/
public AUIconView getClearButton();
/**
* Gets the search input box.
* @return
*/
public AUEditText getSearchEditView();
/**
* Gets the voice search button.
* @return
*/
public AUIconView getVoiceButton();
Custom properties
|
Property |
Description |
Type |
|
isShowSearchBtn |
Whether to display the search button. |
boolean |
|
isShowVoiceSearch |
Whether to display the voice search button. |
boolean |
|
searchEditText |
The default text of the search box. |
string, reference |
|
searchEditHint |
The default hint text of the search box. |
string, reference |
|
inputMaxLength |
The maximum input length of the search box. |
integer, reference |
|
hintIconUnicode |
The Unicode value of the icon to the left of the edit box. |
string, reference |
|
hintIconDrawable |
The drawable resource of the icon to the left of the edit box. |
reference |
|
editHintColor |
The hint text color of the edit box. |
color, reference |
|
editTextColor |
The text color of the edit box. |
color, reference |
|
editIconColor |
The icon color of the edit box. |
color, reference |
Code examples
XML example:
<com.alipay.mobile.antui.basic.AUSearchInputBox
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="10dp"
app:searchEditHint="Hint text" />AUSearchInputBox inputBox = new AUSearchInputBox(this);
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,300);
inputBox.setLayoutParams(layoutParams);
layout.addView(inputBox);