Simple android image popup Library

Overview

Android Image Popup Android Arsenal DroidControls

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.

NOT MAINTAINING NOW

Preview

Demo Preview

Usage

Step 1. Add the JitPack repository to your build file:

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Step 2. Add the dependency

dependencies {
       compile 'com.github.chathuralakmal:AndroidImagePopup:1.2.2'
}

Implementation

Create instance of the popup class and thats all !!

ImagePopup imagePopup = new ImagePopup(this); 

Example

 /** Set popup height, width & background color as you need or just leave default settings **/
	
	Picasso.setSingletonInstance(new Picasso.Builder(this).build()); // Only needed if you are using Picasso

	final ImagePopup imagePopup = new ImagePopup(this);
	imagePopup.setWindowHeight(800); // Optional
	imagePopup.setWindowWidth(800); // Optional
	imagePopup.setBackgroundColor(Color.BLACK);  // Optional
	imagePopup.setFullScreen(true); // Optional
	imagePopup.setHideCloseIcon(true);  // Optional
	imagePopup.setImageOnClickClose(true);  // Optional

	ImageView imageView = (ImageView) findViewById(R.id.imageView);
	
	imagePopup.initiatePopup(imageView.getDrawable()); // Load Image from Drawable
	

	imageView.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View view) {
		    /** Initiate Popup view **/
		 imagePopup.viewPopup();

		}
	});

Support using Picasso

// supprot string url for image 
initiatePopupWithPicasso(imageUrl);

// supprot Uri for image 
initiatePopupWithPicasso(imageUri);

// supprot File for image 
initiatePopupWithPicasso(imageFile);

Support using Glide

// supprot string url for image 
initiatePopupWithGlide(imageUrl);

Credits

Stack Overflow

Contribute

Let's make this grow. Contributions are always welcome!

License

The MIT License

2017 - 2019

Comments
  • PopUpWindow Dimension -Not working

    PopUpWindow Dimension -Not working

    I noticed that the default popupwindow size always retain the default size even if the windows dimension were set . imagePopup.setWindowWidth(xxx); imagePopup.setWindowHeight(xxx);

    Line 127 popupWindow = new PopupWindow(layout, (int)(width.8),(int)(height.6), true);**

    opened by TSG9876 5
  • Picasso issue

    Picasso issue

    When using imagePopup.initiatePopupWithPicasso(fileUrl) I am receiving this fatal exception:

    java.lang.NoSuchMethodError: No static method with(Landroid/content/Context;)Lcom/squareup/picasso/Picasso; in class Lcom/squareup/picasso/Picasso; or its super classes (declaration of 'com.squareup.picasso.Picasso' appears in /data/app/com.removed.removed-m5CwqzHTFNXBaULIcLeNRQ==/split_lib_dependencies_apk.apk!classes2.dex) at com.ceylonlabs.imageviewpopup.ImagePopup.initiatePopupWithPicasso(ImagePopup.java:143) at com.removed.removed.fragments.LiveFragment$setImage$1.onClick(LiveFragment.kt:366)

    I am using 'com.squareup.picasso:picasso:2.71828'

    The library is working fine when I use imagePopup.initiatePopup(addMediaButton.drawable)

    opened by brendanosborne 4
  • Not working

    Not working

    Not working with the following code, which is being called when clicking a "clickable textview". I am not using any ImageView to get the drawable rather I am getting the drawable directly from image file, which is present in the resource.

    ImagePopup  imagePopup = new ImagePopup(SettingsActivity.this);
    imagePopup.initiatePopup(ResourcesCompat.getDrawable(getResources(),R.drawable.iris_setup_width_height_vals, null));
    
    opened by kafan1986 3
  • Make function to auto fit the screen

    Make function to auto fit the screen

    think the lib need to add function to auto fit whole screen and it take boolean to check if make it or not

    this code will get the width and height for the screen

    DisplayMetrics displayMetrics = new DisplayMetrics(); ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); int height = displayMetrics.heightPixels; int width = displayMetrics.widthPixels;

    i'm busy nowadays if i got free and you didn't make it yet i hope i will make it or it is already exist and i don't know

    please mark this issue as enhancement i don't know how , i think it can made by the author only

    enhancement 
    opened by Abdelsattar 3
  • update lib to supprot downloading image from url

    update lib to supprot downloading image from url

    i just face a case that the image that i will press is the different i want to show and it have different quality so i tried to add support this to the lib

    it is first time to create pull request and work on lib i hope it works well

    wait for feedback and approve

    opened by Abdelsattar 2
  • java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.view.WindowManager$LayoutParams

    java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.view.WindowManager$LayoutParams

    casting error at at com.ceylonlabs.imageviewpopup.ImagePopup.initiatePopup(ImagePopup.java:156)

    /** Background dim part **/ WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); WindowManager.LayoutParams layoutParams = (WindowManager.LayoutParams) layout.getLayoutParams(); layoutParams.flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND; layoutParams.dimAmount = 0.3f; windowManager.updateViewLayout(layout, layoutParams);

        }catch (Exception e){
            e.printStackTrace();
    

    }

    opened by TSG9876 2
  • java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Activity

    java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Activity

    when the main activity that shows the popup in a AppCompatActivity, there's the following ex:

    java.lang.ClassCastException: android.app.ContextImpl cannot be cast to android.app.Activity at com.ceylonlabs.imageviewpopup.ImagePopup.viewPopup(ImagePopup.java:228)

    opened by fcaza 1
  • What is the unit of window size.

    What is the unit of window size.

    I try to set the window size as the full screen. But it doesn't work, it seems the half of the screen.Here's the code. final ImagePopup imagePopup = new ImagePopup(getActivity()); imagePopup.setWindowWidth(Resources.getSystem().getDisplayMetrics().widthPixels); imagePopup.setWindowHeight(Resources.getSystem().getDisplayMetrics().heightPixels); imagePopup.setBackgroundColor(Color.BLACK); imagePopup.setHideCloseIcon(true); imagePopup.setImageOnClickClose(true); imagePopup.initiatePopup(imageView.getDrawable());

    opened by HarrrrryLi 1
  • I update it with new support for different image loaders and handle the image loading

    I update it with new support for different image loaders and handle the image loading

    i made some new functions to be used by glide and picasso and also these will use internet to download the images so i changed the logic to be initiated and then on click it will pop up to wait that the image already here

    opened by Abdelsattar 1
  • Update ImagePopup.java to allow for OnTouchListener

    Update ImagePopup.java to allow for OnTouchListener

    Made the 'layout' field non-final (seems like it doesn't need to be), and created a public setter method for its OnTouchListener. This should allow the user to create the ImagePopup and then set a working ontouchlistener to it.

    opened by africantearoa 1
  • Unable to include in build

    Unable to include in build

    Getting this error Error:Could not find com.github.chathuralakmal:AndroidImagePopup:1.0.6. Required by: project :app <a href="searchInBuildFiles">Search in build.gradle files</a>

    opened by wahibhaq 1
  • can't pass the grade build

    can't pass the grade build

    Environment JDK 8

    Execution failed for task ':app:checkDebugDuplicateClasses'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
       > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
         Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.6.0-runtime (androidx.core:core:1.6.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
    
    opened by George199809 0
  • How to get image from image View

    How to get image from image View

    I m setting image from gallery to image View and i m using this library to popup the image which set in image view but while clicking the image in popup it showing fully blank

    so what to do to show the image..????

    your reply will be more useful for me

    my code : final ImagePopup imagePopup = new ImagePopup(this); imagePopup.setWindowHeight(800); // Optional imagePopup.setWindowWidth(800); // Optional imagePopup.setBackgroundColor(Color.WHITE); // Optional //imagePopup.setFullScreen(true); // Optional imagePopup.setHideCloseIcon(true); // Optional imagePopup.setImageOnClickClose(true); // Optional

        imagePopup.initiatePopup(img.getDrawable());
    

    img.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //openGallery(); imagePopup.viewPopup(); show

    opened by mustafamn 6
  • Popup with Glide error On Click

    Popup with Glide error On Click

    How to resolve this error ? I'm using Glide when I click the Image it Show error

    java.lang.NoSuchMethodError: No virtual method into(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/Target; in class Lcom/bumptech/glide/RequestBuilder; or its super classes (declaration of 'com.bumptech.glide.RequestBuilder' appears in

    opened by shiroze 1
  • Support swipes to multiple images

    Support swipes to multiple images

    • this will be a new feature not an issue needed to support show the images in the pop up and when swipe right or left get the next and the pervious one and for sure it will function like popUp(ArrayList <> images) ##
    opened by Abdelsattar 0
Releases(1.2.2)
Owner
Chathura Lakmal
Mobile Software Engineer 
Chathura Lakmal
This is an Image slider with swipes, Here we used Volley to Image load URL's from JSON! Here we make it very easy way to load images from Internet and We customized the description font style(OpenSans).

ImageSliderWithSwipes This is an Image slider with swipes, Here we used Volley to load URL's from JSON! Here we make it very easy way to load images f

Prabhakar Thota 44 May 31, 2021
A simple image cropping library for Android.

SimpleCropView The SimpleCropView is an image cropping library for Android. It simplifies your code for cropping image and provides an easily customiz

Issei Aoki 2.5k Dec 28, 2022
🎨 Modern image loading library for Android. Simple by design, powerful under the hood.

Simple Image Loader Modern image loading library for Android. Simple by design, powerful under the hood. Kotlin: Simple Image Loader is Kotlin-native

Igor Solkin 8 Nov 21, 2022
🐶 Simple app which shows random dog image from Dog API

?? Doggy App ?? ?? Simple app which shows random dog image from Dog API with Retrofit2 and Glide ?? ❤️ Retrofit @GET Request YouTube Tutorial! (Stevdz

Yağmur Erdoğan 10 Nov 1, 2022
An android image compression library.

Compressor Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller

Zetra 6.7k Dec 31, 2022
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Dali is an image blur library for Android. It contains several modules for static blurring, live blurring and animations.

Dali Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live

Patrick Favre-Bulle 1k Dec 1, 2022
An image resizing library for Android

Resizer Inspired by zetbaitsu's Compressor, Resizer is a lightweight and easy-to-use Android library for image scaling. It allows you to resize an ima

Kakit Ho 426 Dec 22, 2022
Image loading library for Android

Image Loader Image loader library for Android. Deprecated. See Glide. Features Image transformations Automatic memory and storage caching Ability to l

Yuriy Budiyev 19 May 28, 2022
Image Cropping Library for Android, optimised for Camera / Gallery.

Image Cropping Library for Android, optimised for Camera / Gallery.

CanHub 812 Dec 30, 2022
An image loading library for android.

Bilder Download Add following to your project's build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' } } }

Kshitij Sharma 4 Jan 1, 2022
An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

Daichi Furiya 257 Jan 2, 2023
Image Cropping Library for Android

Image Cropping Library for Android

Lyrebird Studio 1.1k Dec 30, 2022
A small customizable library useful to handle an gallery image pick action built-in your app. :sunrise_over_mountains::stars:

Louvre A small customizable image picker. Useful to handle an gallery image pick action built-in your app. *Images from Google Image Search Installati

André Mion 640 Nov 19, 2022
Library to save image locally and shows options to open and share !

Image Save and Share Library to save image locally and shows options to open and share ! Download Demo APK from HERE Kindly use the following links to

Prabhakar Thota 27 Apr 18, 2022
RoundedImageView-Library 0.9 0.0 Java To set single or multiple corners on Image Views.

RoundedImageView-Library Rounded ImageView Android Library, to set single or multiple corners on imageview. Screenshot Usage Step 1. Add the JitPack r

Dushyant Mainwal 15 Sep 2, 2020
A library for image manipulation with power of renderScript which is faster than other ordinary solutions.

Pixl is a library for image manipulation with power of renderScript which is faster than other ordinary solutions, currently it includes three basic scripts, brightness, contrast, saturation.

Jibran Iqbal 20 Jan 23, 2022
Image cropping library written with Jetpack Compose with other Composables such as ImageWithConstraints scales Bitmap

Image cropping library written with Jetpack Compose with other Composables such as ImageWithConstraints scales Bitmap it displays and returns position and bounds of Bitmap and ImageWithThumbnail to display thumbnail of the image on selected corner.

Smart Tool Factory 9 Jul 27, 2022
Phimp.me Android Phimp.me is an Android image editor app

Phimp.me Android Phimp.me is an Android image editor app that aims to replace proprietary photographing and image apps on smart phones. It offers feat

FOSSASIA 2.6k Jan 6, 2023