Code example for MotionEvent

Methods: getAction

0
    } 
 
    @Override 
    public boolean onTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        if (action == MotionEvent.ACTION_DOWN) {
            final ClipData clip = mClipping;
            if (clip != null) {
                final Bitmap icon = clip.getIcon();
                DragShadowBuilder shadow;
                if (icon != null) {
                    shadow = new DragShadowBuilder(this) {
                        public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) {
                            shadowSize.set(icon.getWidth(), icon.getHeight());
                            shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2);
                        } 
                        public void onDrawShadow(Canvas canvas) {
                            canvas.drawBitmap(icon, 0, 0, new Paint());
                        } 
                    }; 
                } else {