Search code examples
androidandroid-layoutonclicklistenerontouchlistenerzooming

Android. Touch listener get mixed between two views


I have a really weird issue. I have a complex linear layout containing 3 children.The first left child is a list (a lot like the list detail pattern of android(two pans)) the second child is a separator view (just a simple view as a line separator) and the third is a Big Image view (https://github.com/Piasy/BigImageViewer)

The problem is when trying to zoom on the right side the recycler view items get clicked

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="5">

<LinearLayout
    android:id="@+id/total_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    >
    <RelativeLayout
        android:id="@+id/menu_container"
        android:layout_width="180dp"
        android:layout_height="match_parent"

        >


        <include
            android:id="@+id/list"
            layout="@layout/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"

            />

        <ProgressBar
            android:id="@+id/devices_new_progress_bar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:visibility="gone" />

    </RelativeLayout>


    <View
        android:id="@+id/line_seperator"
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:background="@color/grey"

        ></View>

    <RelativeLayout
        android:id="@+id/image_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >


        <com.github.piasy.biv.view.BigImageView
            android:id="@+id/layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="5dp"
            app:customSsivId="@+id/mSSIV"

            app:initScaleType="centerInside"

            app:optimizeDisplay="true">

            <ImageSSIV
                android:id="@+id/mSSIV"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </com.github.piasy.biv.view.BigImageView>

        <ProgressBar
            android:id="@+id/image_progress_bar"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_centerInParent="true"
            android:visibility="gone" />


    </RelativeLayout>



</LinearLayout>


Solution

  • For whoever if facing this

    My main issue was that I was using a Chinese tablet Huawei and whenever you plug it in the pc it goes crazy all the touches are mixed.