Zoom ImageView on Android as Instagram

How can I increase ImageView, for example Instagram. I mean resizing the image, not increasing the image inside Imageview.

There are many samples for scaling an image inside Imageview, but I need something like scaling images on Instagram

Any code or hint? Thank.

+4
source share
3 answers

I would recommend these two libraries:

Photoview

ImageViewZoom

For PhotoView, you just need to create attacherand “attach” it to yours ImageView.

Some code

// After getting your imageImage view, attach it like the following
PhotoViewAttacher yourAttacher = new PhotoViewAttacher(yourImageView);

With this code you can increase / decrease / decrease / by yourImageView. See the links above for more details.

+6
+1

thank

I added this to my gradle.build

 compile 'it.sephiroth.android.library.imagezoom:imagezoom:2.2.5'

and then using this view

  <it.sephiroth.android.library.imagezoom.ImageViewTouch
    android:id="@+id/mp3Image"
    android:adjustViewBounds="true"
    android:layout_width="346dp"
    android:layout_height="356dp"
    android:scaleType="fitCenter" />

and the code below, zoom came to my application

   myImage = (ImageViewTouch) findViewById(R.id.mp3Image);
    myImage.setDisplayType(ImageViewTouchBase.DisplayType.FIT_IF_BIGGER);
0
source

Source: https://habr.com/ru/post/1667501/


All Articles