Created
May 30, 2013 03:01
-
-
Save moltak/5675486 to your computer and use it in GitHub Desktop.
DrawerLayout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.moltak.usingdrawerwithsherlockandscrollview; | |
import android.content.Context; | |
import android.support.v4.widget.DrawerLayout; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.view.MotionEvent; | |
public class MODrawerLayout extends DrawerLayout { | |
public final static int DRAWER_POSITION = Gravity.RIGHT; | |
public MODrawerLayout(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent ev) { | |
if(isDrawerOpen(DRAWER_POSITION)) { | |
return super.onTouchEvent(ev); | |
} | |
return false; | |
} | |
@Override | |
public boolean onInterceptHoverEvent(MotionEvent event) { | |
if(isDrawerOpen(DRAWER_POSITION)) { | |
return super.onInterceptHoverEvent(event); | |
} | |
return false; | |
} | |
@Override | |
public boolean onInterceptTouchEvent(MotionEvent ev) { | |
if(isDrawerOpen(DRAWER_POSITION)) { | |
return super.onInterceptTouchEvent(ev); | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment