javiersantos / MaterialStyledDialogs

A library that shows a beautiful and customizable Material-based dialog with header. API 14+ required.
Apache License 2.0
1.17k stars 155 forks source link

Dismiss Listener #35

Open AladdinHZ opened 7 years ago

AladdinHZ commented 7 years ago

Hello . I was wondering if there is any way to Add on Dismiss Listener ?

F4bioo commented 7 years ago

if you are using a custom view, you can make that.

... MaterialStyledDialog.Builder builder = new materialStyledDialog.Builder(this); builder.setCustomView(custoView); //<----- builder.setHeaderColor(...); builder.setIcon(...);

final Dialog dialog = builder.show(); //<-----

mButtomInCustomView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ... dialog.dismiss(); //<----- } });

fxmeister commented 7 years ago

I think the author is suggesting there be a way to listen for an onTouchOutside event. This is much needed.