Fling implementation on android canvas

Viewed 1067

I have the usual gesture detector for detecting fling , It is an instance attribute of a SurfaceView

GestureDetector flingDetector = new GestureDetector(getContext(),new SimpleOnGestureListener() {

        @Override
        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                    // Fling implementation
            return true;
        }
});

I am drawing a lot of complex stuff on a canvas and I have a translate(dx,dy) method that I use with onScroll.

So my question is how do I implement the fling using the translate method ?

There seem to be a lot of questions on detecting fling , my question is on implementing it .

1 Answers
Related