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

.setHeaderDrawable() Can you display network pictures? #76

Closed ycqchang closed 5 years ago

ycqchang commented 5 years ago

Can you display network pictures?

javiersantos commented 5 years ago

Sure. Use a library like Piccaso or Glide.

Usage example using Glide:

Glide.with(this)
      .asBitmap()
      .load(IMAGE_URL)
      .into(new SimpleTarget<Bitmap>() {
            @Override
            public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
                Drawable drawable = new BitmapDrawable(getResources(), resource);
                new MaterialStyledDialog.Builder(this)
                    .setTitle("Awesome!")
                    .setDescription("What can we improve? Your feedback is always welcome.")
                    .setHeaderDrawable(drawable)
                    .show();
            }
        });
ycqchang commented 5 years ago

Thank you very much, it is very good.