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.4'
}
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.setBackgroundColor(Color.BLACK);
imagePopup.setWindowWidth(800);
imagePopup.setWindowHeight(800);
imagePopup.setHideCloseIcon(true);
imagePopup.setImageOnClickClose(true);
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());
}
});
Contributions are always welcome!
The MIT License
Copyright (c) 2017 Chathura Lakmal