Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ivAdd.setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(View view, MotionEvent motionEvent) {
- switch (motionEvent.getAction()) {
- case MotionEvent.ACTION_DOWN:
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
- ivAdd.setElevation(0);
- break;
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_CANCEL:
- case MotionEvent.ACTION_OUTSIDE:
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT)
- ivAdd.setElevation(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics()));
- }
- return false;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement