Holder

open class Holder(source)

Holder class for managing multiple SeslRecoilAnimator instances.

This class provides a convenient way to create, reuse, and manage recoil animations for different views. It helps optimize resource usage by reusing animators when possible.

Usage example:

Holder recoilHolder = new Holder(context);
view.setOnTouchListener((v, event) -> {
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            recoilHolder.setPress(v);
            break;
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL:
            recoilHolder.setRelease();
            break;
    }
    return false; // Or true if the event is consumed
});

Constructors

Link copied to clipboard
constructor(@NonNull context: Context)

Functions

Link copied to clipboard
Removes all ValueAnimator.AnimatorUpdateListener objects from all SeslRecoilAnimator instances managed by this holder.
Link copied to clipboard
open fun setPress(@NonNull view: View)
Initiates the press animation on the specified view.
Link copied to clipboard
open fun setRelease()
Initiates the release animation for all active recoil animators.