Fixes multi touch issue

This commit is contained in:
Bennet Brunsen
2016-05-19 12:03:41 +02:00
parent 4aa46db498
commit 580c2d4fda
2 changed files with 32 additions and 2 deletions
@@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.DrawerLayout
<com.sap.sailing.racecommittee.app.ui.layouts.CustomDrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -28,5 +28,5 @@
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start" />
</android.support.v4.widget.DrawerLayout>
</com.sap.sailing.racecommittee.app.ui.layouts.CustomDrawerLayout>
</RelativeLayout>
@@ -0,0 +1,30 @@
package com.sap.sailing.racecommittee.app.ui.layouts;
import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
public class CustomDrawerLayout extends DrawerLayout {
public CustomDrawerLayout(Context context) {
super(context);
}
public CustomDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (ArrayIndexOutOfBoundsException e) {
// Fix for multitouch issue see: https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=3659
return false;
}
}
}