AUImageDialog (formerly SalesPromotionLimitDialog) provides a dialog box containing a title, three-level text, one confirm button or two buttons (left and right) at the bottom, and an ImageView in the middle. This component can be used to display message in throttling scenarios.
Sample image
Dependency
See Quick start.
API description
public interface OnItemClickListener {
void onItemClick(int index);
}
public static AUImageDialog getInstance(Context context)
public void setCloseBtnClickListener(View.OnClickListener mCloseBtnClickListener)
public void setTitle(CharSequence title)
public void setTitleTextSize(float size)
public void setTitleTextVisibility(int visibility)
}
public void setSubTitleTextVisibility(int visibility)
public void setTitleTextColor(int color)
public void setSubTitle(CharSequence title)
public void setSubTitleTextSize(float size)
public void setSubTitleTextColor(int color)
public void setThirdTitleText(String text)
public void setThirdTitleTextColor(int color)
public void setLogoBackground(Drawable drawable)
public void setLogoBackgroundResource(int resid)
public void setLogoBackgroundColor(int color)
public void setBackgroundTransparency(float alpha)
public boolean isUsdAnim()
public void setUsdAnim(boolean usdAnim)
public void setCloseButtonVisibility(int visibility)
public void setConfirmBtnText(String text)
public Button getConfirmBtn()
public void setOnConfirmBtnClickListener(View.OnClickListener clickListener)
public void showWithoutAnim()
public void showWithTimer(int seconds, String tickColor, String action, View.OnClickListener clickListener, TimerListener timerListener)
public void showWithTimer(int seconds, View.OnClickListener clickListener, TimerListener timerListener)
public String getDefaultTimeColorStr()
public void dismissWithoutAnim()
@Override
public void dismiss()
public boolean isCanceledOnTouch() {
return canceledOnTouch;
}
public void setCanceledOnTouch(boolean canceledOnTouch)
public void setButtonListInfo(List<String> buttonListInfo, OnItemClickListener listener)
public ImageView getLogoImageView() {
return bgImageView;
}
public TextView getTitleTextView() {
return titleTextView_1;
}
public TextView getSubTitleTextView() {
return titleTextView_2;
}
public TextView getThirdTitleTextView() {
return titleTextView_3;
}
public ImageView getBottomLine() {
return bottomLine;
}
Sample code
AUImageDialog dialog = AUImageDialog.getInstance(this);
dialog.showWithTimer(5, null, null);
AUImageDialog dialog = AUImageDialog.getInstance(this)
dialog.setCanceledOnTouch(true)
dialog.setTitle("Single-line Title")
dialog.setSubTitle("Describe the current state and prompt the solution in two rows.")
dialog.setConfirmBtnText("Action Button")
dialog.showWithoutAnim()
AUImageDialog dialog = AUImageDialog.getInstance(this)
dialog.setCanceledOnTouch(true)
dialog.setTitle("Level-1 textLevel-2 textLevel-2 textLevel-2 textLevel-2 text")
dialog.setSubTitle("Level-2 textLevel-2 textLevel-2 textLevel-2 textLevel-2 textLevel-2 text")
dialog.setThirdTitleText("Accept xxx agreementAccept xxx agreementAccept xxx agreementAccept xxx agreementAccept xxx agreementAccept xxx agreementAccept xxx agreement")
dialog.setConfirmBtnText("Action Button")
dialog.showWithoutAnim()
AUImageDialog dialog = AUImageDialog.getInstance(this);
dialog.setTitle("Single-line Title");
dialog.setSubTitle("The description should not exceed 3 rows, and no ending mark is needed at the end of the last sentence.");
dialog.setButtonListInfo(getData(), new AUImageDialog.OnItemClickListener() {
@Override
public void onItemClick(int index) {
}
});
dialog.showWithoutAnim();