jsibbold / zoomage

A simple pinch-to-zoom ImageView library for Android
http://jsibbold.github.io/zoomage
Apache License 2.0
316 stars 77 forks source link

How to restrict bounds while zooming and panning with 2 fingers. #108

Open romaan-khan opened 3 years ago

romaan-khan commented 3 years ago

I want to zoom in and pan at the same time without going leaving the bounds. How can I achieve this ??

Choongkyu commented 3 years ago

are you talking about how this happens sometimes? If so, I'd like to know how to avoid this as well. For more reference, my zoomage tag is as follows:

    <com.jsibbold.zoomage.ZoomageView
            android:id="@+id/zoom_view"
            android:layout_width="match_parent"
            android:layout_height="350dp"
            android:backgroundTint="@color/colorPrimary"
            app:zoomage_restrictBounds="true"
            app:zoomage_animateOnReset="true"
            app:zoomage_autoResetMode="UNDER"
            app:zoomage_autoCenter="true"
            app:zoomage_zoomable="true"
            app:zoomage_minScale="1"
            app:zoomage_maxScale="8"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
            android:layout_marginBottom="8dp" app:layout_constraintTop_toTopOf="parent"
/>

https://user-images.githubusercontent.com/1592194/115809351-c92a0080-a3a0-11eb-823d-ea5ad617ea48.mp4