Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On zoom problem with BottomSheetBehavior #314

Closed
JorisBodin opened this issue Jan 25, 2021 · 2 comments
Closed

On zoom problem with BottomSheetBehavior #314

JorisBodin opened this issue Jan 25, 2021 · 2 comments

Comments

@JorisBodin
Copy link

JorisBodin commented Jan 25, 2021

Hello,

If zoom with my TouchImageView, the "onTouch" get all event and disable my BottomSheetBehavior in CoordinatorLayout :(

<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
    android:background="@color/previewBackground">

    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/viewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
  
    <FileInfoActionsView
        android:id="@+id/bottomSheetFileInfos"
        style="?attr/bottomSheetStyle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/bottom_sheet_behavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

And the PreviewFragment:

<RelativeLayout 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:id="@+id/previewLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.filelist.preview.PreviewFragment">

    <com.ortiz.touchview.TouchImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        tools:src="@drawable/ic_images" />

</RelativeLayout>
device-2021-01-25-181758.mp4

Is there a solution for this case? Thank you in advance :)

@hannesa2
Copy link
Collaborator

Without running example, I can't debug issue.
I recommend to have a look on override fun onTouch(v: View, event: MotionEvent): Boolean {
maybe changing somewhere the boolean result may help

@JorisBodin
Copy link
Author

I found the problem.
I use viewpage2 and for zoom, move the photo and slider, I followed your example here: https://github.com/MikeOrtiz/TouchImageView/blob/master/app/src/main/java/info/touchimage/demo/custom/AdapterImages.kt
But it is incompatible with BottomSheetBehavior

The exemple is here: https://github.com/JorisBodin/TouchImageView/tree/bug-viewpager2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants