All Products
Search
Document Center

Index component

Last Updated: May 25, 2021

AUBladeView works with ListView which is sorted alphabetically. On the letter index on the left or right side of the page, when you click or slide to the corresponding letter, the event in the corresponding letter position is triggered. The default index ranges from letter A to letter Z. One or two customized single characters can be added to the top of the index.

Sample image

The two characters above A are customized, as shown in the following figure. The default character ranges from A to Z.

Dependency

See Quick start.

API description

 
  1. /**
  2. * Set the letter selection listener.
  3. */
  4. public void setOnItemClickListener(OnItemClickListener listener)
  5. public interface OnItemClickListener {
  6. /**
  7. * Set the letter selection listener.
  8. * @param clickChar The letter clicked or selected.
  9. */
  10. void onItemClick(String clickChar);
  11. /**
  12. * The finger raising event. You do not need to pay attention to this method if there is no special requirement.
  13. */
  14. void onClickUp();
  15. }

Custom properties

Property Description Type
top1Text The first customized text character. Reference
top2Text The second customized text character. Reference
showSelectPop whether to show the floating layer popped-up in the middle during sliding or clicking. Boolean

Sample code

 
  1. <com.alipay.mobile.antui.basic.AUBladeView
  2. android:layout_width="24dp"
  3. android:layout_height="wrap_content"
  4. app:top1Text="⊙"
  5. app:top2Text="才"/>

As shown in Sample image, top1Text and top2Text can be omitted by default.