Как можно реализовать ImageView
c возможностью касаниями масштабировать изображения?(так же как в обычных фото галереях?)
2 ответа
Есть отличная библиотека https://github.com/jsibbold/zoomage. После подключение зависимости, добавляете как обычный ImageView в ваш XML. В ней картинку можно увеличить пальцами.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.MyPictureFragment">
<com.jsibbold.zoomage.ZoomageView
android:id="@+id/container_for_picture"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:zoomage_animateOnReset="true"
app:zoomage_autoCenter="true"
app:zoomage_autoResetMode="UNDER"
app:zoomage_maxScale="8"
app:zoomage_minScale="0.6"
app:zoomage_restrictBounds="false"
app:zoomage_translatable="true"
app:zoomage_zoomable="true" />