Skip to content

Latest commit

 

History

History
151 lines (123 loc) · 3.88 KB

README.md

File metadata and controls

151 lines (123 loc) · 3.88 KB

DialogPreviewImage


Simple Dialog Preview.


Content List


Download

Add maven jitpack.io and dependencies in build.gradle (Project) :

// build.gradle project
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

// build.gradle app/module
dependencies {
    ...
    implementation 'com.github.gzeinnumer:DialogPreviewImage:version'

    implementation 'com.github.gzeinnumer:EasyDialogFragment:last-vesion'
    //check on https://github.com/gzeinnumer/EasyDialogFragment

    implementation 'com.github.gzeinnumer:SimpleMaterialStyle:last-vesion'
    //check on https://github.com/gzeinnumer/SimpleMaterialStyle

    //required
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}

Feature List


Tech stack and 3rd library


Usage

Image From Bitmap

Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
new DialogPreviewImage(getSupportFragmentManager()).setImage(bitmap).show();

Image From Path/File Image

Required permission to external/internal

String path = "YOUR_IMAGE_PATH";
new DialogPreviewImage(getSupportFragmentManager()).setImage(path).show();

Image From ImageView

new DialogPreviewImage(getSupportFragmentManager()).setImage(imageView).show();

Image From Internet

String url = "https://avatars3.githubusercontent.com/u/45892408?s=460&u=94158c6479290600dcc39bc0a52c74e4971320fc&v=4";
new DialogPreviewImage(getSupportFragmentManager()).setImage(url).show();

Add Content Message

new DialogPreviewImage(getSupportFragmentManager())
    .setContent("ini content")
    ...
    .show();

Preview :

Image Preview Add Content Message

Example Code/App

MainActivity.java & activity_main.xml

Sample Code And App


Version

  • 1.0.0
    • First Release
  • 1.0.1
    • Bug Fixing
  • 1.0.2
    • Bug Fixing
  • 1.1.0
    • From ImageView
  • 1.1.1
    • Bug Fixing
  • 1.2.1
    • Remove Zoom
    • Add load from URL
    • Bug Fixing
  • 1.2.2
    • Bug Fixing

Contribution

You can sent your constibution to branch open-pull.

Fore More All My Library


Copyright 2021 M. Fadli Zein