winsontan520/Android-WScratchView — pull request #10 by gilbert1991 (2014-11-15 02:53:18+00:00)
Title: [New] Add Click Listener and Automatically Scratch All Features

Hi Winson,

Thank you in advanced. I am currently using the WScratchView for my Android Application. I find some functions missing to my need:

1. I need the view to be scratched automatically, when the scratched are reach the threshold and the user's finger detached from the screen. This could be useful that the user does not need to scratch all the area manually if the background is clear exposed enough. So I add some codes in the onDraw() to "clear the view", and in the call back I add onDetach() to monitor the finger detach event;

2. When the view has been "scratched all", I need the background to be clickable to trigger another event. Since the onTouchEvent() happens before the onClick(), I add some code in "ACTION_UP" to performClick().

These two functions work properly in my side, so I would like to contribute to this library. Let me know if there is any problems. Thank you.

Regards,
Gilbert