android - How to avoid gesture overlap when using DrawerLayout? -


i have layout, can dragged right side of screen.

@bind(r.id.left_drawer_layout) drawerlayout drawerlayout;   @onclick(r.id.left_drawer)     void onleftdrawer() {         if (drawerlayout.isdraweropen(gravitycompat.start)) {             closeleftdrawer();         } else {             drawerlayout.opendrawer(gravitycompat.start);         }     } 

inside drawer have webview displays content huge in size, compared webview borders. that's why need scroll in direction:

up down left right 

the 2 last gestures overwriten drawerlayout while levels upper webview.

how can overwrite behavoir of webview can draggable(scrollable) in direction , not affect drawerlayout?

the solution pretty simple: lock drawerlayout while touching our webview:

 webview.setontouchlistener(new ontouchlistener() {         @override         public boolean ontouch(view v, motionevent event) {             if (event.getaction() == motionevent.action_down) {                 ((mainactivity) getactivity()).getdrawerlayout()                         .setdrawerlockmode(drawerlayout.lock_mode_locked_open);             } else if (event.getaction() == motionevent.action_up) {                 ((mainactivity) getactivity()).getdrawerlayout()                         .setdrawerlockmode(drawerlayout.lock_mode_unlocked);             }              return false;         }     }); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -