All Products
Search
Document Center

Pop up menu

Last Updated: May 25, 2021

AUPopMenu provides a pop-up menu displayed when the user taps an option card on the navigation bar, which is essentially a pop-up window.

Different from AUFloatMenu, AUPopMenu has no bottom layer mask but has menu outlines, and all menu texts are centered.

Basic features

  • Whether the menu pops upwards or downwards is controlled by the service system.
  • The string list passed by the service system shall use the default style, or pass adapter directly.

Sample image

Dependency

See Quick start.

API description

 
  1. /**
  2. * The data structure. Use the default style.
  3. * @param context
  4. * @param itemArrayList
  5. */
  6. public AUPopMenu(Context context, ArrayList<MessagePopItem> itemArrayList)
  7. /**
  8. * The adapter structure. Use the custom style.
  9. * @param context
  10. * @param listAdapter
  11. */
  12. public AUPopMenu(Context context, BaseAdapter listAdapter)
  13. /**
  14. * tip toast down
  15. * @param anchorView
  16. */
  17. public void showTipView(View anchorView)
  18. /**
  19. * tip toast with direction
  20. * @param anchorView
  21. * @param isDown
  22. */
  23. public void showTipView(View anchorView, boolean isDown)
  24. /**
  25. * Make the window disappear.
  26. */
  27. public void dismiss()
  28. /**
  29. * Set the option tapping listener.
  30. * @param listener
  31. */
  32. public void setOnItemClickListener(AdapterView.OnItemClickListener listener)

Custom properties

No customized property is available. The XML layout is not supported.

Sample code

 
  1. final AUPopMenu popMenu = new AUPopMenu(ScrollTitleBarActivity.this, getItemList());
  2. popMenu.showTipView(view);
  3. popMenu.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  4. @Override
  5. public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  6. }
  7. });