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

Make Header With Title and Drawable overlay optional #22

Closed willrichman closed 8 years ago

willrichman commented 8 years ago

As of now, if I want to have a header with a title (HEADER_WITH_TITLE), as well as a headerDrawable, the dialog builder adds a gray overlay of a color filter over that drawable:

if (this.style == Style.HEADER_WITH_TITLE) {
    dialogHeader.setColorFilter(Color.rgb(123, 123, 123), Mode.MULTIPLY);
}

I have a background drawable that is already dark enough for text to be visible over it, and as such, would not need this filter to be added. It makes my header appear much darker than it should. Can we add a method to turn off this header filter?

javiersantos commented 8 years ago

Checkout the latest update.

new MaterialStyledDialog(this)
    .setTitle("Awesome!")
    .setDescription("What can we improve? Your feedback is always welcome.")
    .setHeaderDrawable(R.drawable.header)
    .withDarkerOverlay(true)
    .show();

https://github.com/javiersantos/MaterialStyledDialogs/blob/master/README.md#adding-a-darkergrey-overlay-to-the-header-background

willrichman commented 8 years ago

Looks fantastic, thanks!