SeslRecoilAnimator

@RequiresApi(api = 29)
open class SeslRecoilAnimator(source)

Provides a recoil animation effect for views, typically used for press and release interactions. This class manages the animation of a target view, scaling it down on press and back to its original size on release.

It supports scaling the entire view or only its children if the target view is a ViewGroup. The animation uses predefined interpolators and durations for press and release states.

A Holder class is provided to manage multiple SeslRecoilAnimator instances, allowing for efficient reuse of animators.

Note: This class requires API level 29 or higher.

Constructors

Link copied to clipboard
constructor(@NonNull view: View, @NonNull context: Context)
Constructs a new SeslRecoilAnimator.

Types

Link copied to clipboard
open class Holder
Holder class for managing multiple SeslRecoilAnimator instances.

Functions

Link copied to clipboard
open fun isActive(): Boolean
Checks if the recoil animation is currently active.
Link copied to clipboard
open fun setPress()
Starts the press animation.
Link copied to clipboard
open fun setRelease()
Starts the release animation.
Link copied to clipboard
open fun setScaleOnlyChildren(enable: Boolean)
Sets whether to scale only the children of the target view.