natario1 / ZoomLayout

2D zoom and pan behavior for View hierarchies, images, video streams, and much more, written in Kotlin for Android.
https://natario1.github.io/ZoomLayout
Apache License 2.0
1.05k stars 147 forks source link

overScrollHorizontal ignored ? #230

Open boldijar opened 1 year ago

boldijar commented 1 year ago

How do I?

 <com.otaliastudios.zoom.ZoomLayout
        android:id="@+id/zoom"
        app:overScrollHorizontal="false"
        app:overScrollVertical="false"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/black">

        <org.videolan.libvlc.util.VLCVideoLayout
            android:id="@+id/view_vlc_layout"
            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:layout_constraintTop_toTopOf="parent" />

    </com.otaliastudios.zoom.ZoomLayout>

As you can see here I’ve added

app:overScrollHorizontal="false"
        app:overScrollVertical=“false"

I’m trying to never let the content overscroll, and it works vertically, but doesn’t work horizontally. (I’m in landscape orientation)

Notice here the black bars left, where I can move the child view. It should stop before showing the black bars.

image

When I’m using portrait orientation the vertical overscroll property is ignored and I can scroll a lot

image

Version used

implementation 'com.github.tbouron.shakedetector:library:1.0.0@aar’
markusressel commented 1 year ago

Does the overScrollHorizontal work in portrait? Is this limited to the landscape orientation not working as expected?

EDIT: Sorry I didn't read correctly. Yeah seems like there is a bug with screen rotation which mixes up vertical and horizontal limits, and maybe even a second one not applying the vertical one correctly.

Sadly the time investment from our side on this project is currently very limited, however, if you can find a fix and open a PR yourself we can review and merge it.