Show image as a popup on a click event or any event. Simply set the image as drawable and thats it!!!. And also you can set width, height & background color as you want.
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.chathuralakmal:AndroidImagePopup:1.0.7'
}
ImagePopup imagePopup = new ImagePopup(this);
/** Set popup height, width & background color as you need or just leave default settings **/
final ImagePopup imagePopup = new ImagePopup(this);
imagePopup.setWindowHeight(800); // Optional
imagePopup.setWindowWidth(800); // Optional
imagePopup.setBackgroundColor(Color.BLACK); // Optional
imagePopup.setHideCloseIcon(true); // Optional
imagePopup.setImageOnClickClose(true); // Optional
final ImageView imageView = (ImageView) findViewById(R.id.imageView);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
/** Initiate Popup view **/
imagePopup.initiatePopup(imageView.getDrawable());
}
});
Let's make this grow. Contributions are always welcome!
The MIT License
2017 Chathura Lakmal