java - how to Disable TouchEvent of BackGroundLayout? -
disable touchevent
, click
of backgroundlayout.
in app have problem touchevent. here have 2 image describe.
i create 1 layout tutorial purpose only, user can understan batter. layout [image1]with transparent theme , 1 button [got it].
as tutorial says (touch draw), user follow tutorial , touch anywhere draw line draw line on background layout see [image2].it draw line on touchevent
i can not understad why allow touch 1 view in background.
in short when user following tutorial not allow touch , draw line on main layout.
and don't ant disable touchevent of background view.
i checking disable child layout of layout still click , touch event of background layout. have same problem activity image 3
i put code in side top layout's touch event
@override public boolean ontouchevent(motionevent event) { return false; } @override public boolean onkeydown(int keycode, keyevent event) { // make checkbox not respond user event return false; } @override public boolean onkeymultiple(int keycode, int repeatcount, keyevent event) { // make checkbox not respond user event return false; } @override public boolean onkeypreime(int keycode, keyevent event) { // make checkbox not respond user event return false; } @override public boolean onkeyshortcut(int keycode, keyevent event) { // make checkbox not respond user event return false; } @override public boolean onkeyup(int keycode, keyevent event) { // make checkbox not respond user event return false; } @override public boolean ontrackballevent(motionevent event) { // make checkbox not respond user event return false; }
this code of background layout.
@override public void setenabled(boolean enabled) { super.setenabled(enabled); (int = 0; < getchildcount(); i++) { view child = getchildat(i); child.setenabled(enabled); } }
Comments
Post a Comment