X
X
XiNull2019-02-09 06:19:51
Android
XiNull, 2019-02-09 06:19:51

NavigationView overrides OnGestureRegisterListener, how to solve the problem?

Hello.
There is a LinearLayout, it is like a certain strip on the screen. There is a listener (OnGestureRegisterListener implements View.OnTouchListener
...
public abstract void onSwipeTop(View view);
public abstract void onClick(View view);
public abstract boolean onLongClick(View view);
...
) that catches swipes and clicks on the LinearLayout .
The problem is that when I add a NavigationView then it somehow overlays the LinearLayout i.e. everything is visible, but clicks are not listened, NavigationView interrupts them.

<LinearLayout
        android:id="@+id/linearlayout1"
        android:layout_width="0dp"
        android:layout_height="250dp"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

    </LinearLayout>

    <android.support.v4.widget.DrawerLayout
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:layout_constraintBottom_toTopOf="@+id/linearlayout1"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <android.support.design.widget.NavigationView
            android:id="@+id/nav_view"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:fitsSystemWindows="true" />

    </android.support.v4.widget.DrawerLayout>

How can this problem be solved?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question