Function “animateTo ()“ of Can be animatedIs a suspend function and must be called from within the coroutine scope. Therefore, to simplify this, both “Moving“When”StopIs marked as a suspend function.
The remaining functions are used to return new offsets, new rotations, and alpha values when moving the container.
All properties are specified with default values at the beginning of the class.
“MovingThe function is called on a shake-by-shake basis. Therefore, for each shake, we generate new offsets, rotations, and alphas and animate the properties with these values.
“StopThe function is called to animate all properties to their initial state and then stop.
The remaining functions are used to generate random values.