Skip to content

SimpleImageDialog

Philipp Niedermayer edited this page Mar 4, 2017 · 9 revisions

SimpleImageDialog

extends CustomViewDialog

A Dialog that displays an image

Building dialogs

Example

SimpleImageDialog.build()
                 .image(R.drawable.image_sample)
                 .show(Activity.this);

Additional customizations

  • Image
    .image(int resourceId)
    .image(Bitmap image)
    .image(Uri imageUri)
  • Scale / Scroll
    scaleType(Scale scale)
    Sets the scale type to one of:
  • Scale.FIT: scales the image down ensuring the image is fully visible
  • Scale.SCROLL_HORIZONTAL: scales the image up, allowing horizontal scrolling ("panorama")
  • Scale.SCROLL_VERTICAL: scales the image up, allowing vertical scrolling

Theme

Note that you have to use a special theme as parent when styling this dialog.
You can specify the theme using the imageDialogTheme attribute (rather than alertDialogTheme) or the theme(int resId) method.
Make sure that your theme's parent is the ImageDialogTheme, otherwise the dialog will not shrink to the image and there will be white stripes on either side of the image.

Clone this wiki locally