| | |
| | | view.setOnTouchListener(new View.OnTouchListener() {
|
| | | @Override
|
| | | public boolean onTouch(View view, MotionEvent motionEvent) {
|
| | | View popLayout = view.findViewById(R.id.pop_single_ll);
|
| | | int top = popLayout.getTop();
|
| | | int bottom = popLayout.getBottom();
|
| | | int left = popLayout.getLeft();
|
| | | int right = popLayout.getRight();
|
| | | int y = (int) motionEvent.getY();
|
| | | int x = (int) motionEvent.getX();
|
| | | if (motionEvent.getAction() == MotionEvent.ACTION_UP){
|
| | | if (y<top || y> bottom){
|
| | | dismiss();
|
| | | }
|
| | | if (x < left || x > right){
|
| | | dismiss();
|
| | | }
|
| | |
|
| | | View popLayout = view.findViewById(R.id.pop_single_ll);
|
| | | int top = popLayout.getTop();
|
| | | int bottom = popLayout.getBottom();
|
| | | int left = popLayout.getLeft();
|
| | | int right = popLayout.getRight();
|
| | | int y = (int) motionEvent.getY();
|
| | | int x = (int) motionEvent.getX();
|
| | | if (motionEvent.getAction() == MotionEvent.ACTION_UP){
|
| | | if (y<top || y> bottom){
|
| | | dismiss();
|
| | | }
|
| | | return true;
|
| | | if (x < left || x > right){
|
| | | dismiss();
|
| | | }
|
| | |
|
| | | }
|
| | | return true;
|
| | | }
|
| | | });
|
| | |
|