Search code examples
androidimageviewzoomingfullscreenpicasso

on touch of image, image view to fullscreen and zoom should work


I'm loading Image from server to imageview. I'm using Picasso to load the image from server to imageview.

On touch of that image, i want it to appear fullscreen and even zoom/tap should work.

I don't know what to do for this, Please help me with suggestions or some examples.

I found few examples, but there was more than 1000 lines code, I couldn't find it helpful and I didn't understand what to do with it.

Thanks. this is my code.

image = (ImageView) findViewById(R.id.image);
image.setOnClickListener(this);

Picasso.with(this).load("http://Imageurl").into(image);

@Override
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.image:

            //what to do here ?

             break;  
   } 
}

Solution

  • There are some simple steps you should follow.

    1. Create one full-screen Activitywith ImageView only.

    2. You need to implement library for Pinch to Zoom In/Zoom Out Images. Through which you can zoom In/Out your Imageview.

    3. By Clicking on Imageview Start that Activity and Finish on onBackPress()

    There are some of the examples of library you can use.

    https://github.com/martinwithaar/PinchToZoom

    https://github.com/jsibbold/zoomage