Search code examples
androidsamsung-mobilevibrationandroid-vibration

Android Create vibration pattern like Samsung


I'm trying to create a View with touch events to create a vibration pattern like samsung does.

enter image description here

I use CountDownTimer to start recording during 5 seconds. I want to catch ACTION_DOWN and ACTION_UP events from touch.

Are there a library to create this circle view with the timer animation? Any suggestions?


Solution

  • If you can keep track of the timer in something like milliseconds, you can log the action down and action up with the time.

    Example: Action down @ Second 1 Action up @ Second 1.5

    When you try to recreate this, you can rebuild the same way you recorded. Start a timer, and when Second = 1, vibrate. When second = 1.5, stop vibrating