android - Disable DrawerLayout's scrim touch gesture -
i need disable touch gesture on scrim (the red highlighted part). want dismiss drawer swipe.
the issue when drawer layout open , need select element listview below red highlighted part, what's happend drawer closed , @ point can select element listview.
i need select element listview directly, when drawer opened
you have create custom drawer
public class customdrawer extends drawerlayout { public customdrawer(context context) { super(context); } public customdrawer(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); } public customdrawer(context context, attributeset attrs) { super(context, attrs); } @override public boolean onintercepttouchevent(motionevent event) { if(isdraweropen(gravity.start)){ if(event.getx() > getchildat(1).getwidth()){ return false; } } return super.onintercepttouchevent(event); } }
note : getchildat(1)
should child whom have given gravity "start" , width determines width of opening drawer.
i hope should solve problem
Comments
Post a Comment