All Products
Search
Document Center

Input dialog

Last Updated: May 25, 2021

AUInputDialog (formerly APInputDialog) provides a dialog box containing a title, body, Confirm and Cancel buttons, and an input box.

Sample image

Dependency

See Quick start.

API description

 
  1. /**
  2. * Construct AUInputDialog based on Input parameters.
  3. *
  4. * @param context The context object.
  5. * @param title The title.
  6. * @param msg The message.
  7. * @param positiveString Confirm button text.
  8. * @param negativeString Cancel button text.
  9. * @param isAutoCancel Indicates whether to automatically cancel actions in the area outside the pop-up window.
  10. */
  11. public AUInputDialog(Context context, String title, String msg, String positiveString,
  12. String negativeString, boolean isAutoCancel)
  13. /**
  14. * Obtain the Cancel button.
  15. */
  16. public Button getCancelBtn();
  17. /**
  18. * Obtain the Confirm button.
  19. */
  20. public Button getEnsureBtn();
  21. /**
  22. * Obtain title TextView.
  23. */
  24. public TextView getTitle();
  25. /**
  26. * Obtain message TextView.
  27. */
  28. public TextView getMsg();
  29. /**
  30. * Obtain LinearLayout of the bottom button.
  31. */
  32. public LinearLayout getBottomLayout();
  33. /**
  34. * Obtain RelativeLayout at the outermost layer of the pop-up window.
  35. */
  36. public RelativeLayout getDialogBg();
  37. /**
  38. * Set the Confirm button listener.
  39. */
  40. public void setPositiveListener(OnClickPositiveListener listener);
  41. /**
  42. * Set the Cancel button listener.
  43. */
  44. public void setNegativeListener(OnClickNegativeListener listener);
  45. /**
  46. * Obtain EditText of the input box.
  47. */
  48. public AUEditText getInputContent() {
  49. return inputContent;
  50. }
  51. /**
  52. * Starts and display the dialog.
  53. */
  54. public void show();

Sample code

 
  1. AUInputDialog dialog = new AUInputDialog(this, "标题文字", "辅助说明文字文字文字文字文字",
  2. "确认", "取消", true);
  3. dialog.show();