Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Created April 2, 2015 22:36
Show Gist options
  • Save AKiniyalocts/6807b13faf0c5595bc60 to your computer and use it in GitHub Desktop.
Save AKiniyalocts/6807b13faf0c5595bc60 to your computer and use it in GitHub Desktop.
Subclass of DrawerLayout to catch the crash on zoom when using PhotoView as a child
package com.your.package;
import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
public class HackyDrawerLayout extends DrawerLayout {
public HackyDrawerLayout(Context context) {
super(context);
}
public HackyDrawerLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public HackyDrawerLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (Throwable t) {
t.printStackTrace();
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment