facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.31k stars 698 forks source link

listen animation state #98

Closed mengxn closed 3 years ago

mengxn commented 4 years ago

I want to do something when the shimmer animation end, but I don't find any way to make it come true. So I rewrite the source code. in ShimmerFrameLayout

public void startShimmer(Animator.AnimatorListener listener) {
    mShimmerDrawable.startShimmer(listener);
}

in ShimmerDrawable

  public void startShimmer(Animator.AnimatorListener listener) {
    if (mValueAnimator != null && !isShimmerStarted() && getCallback() != null) {
      if (listener != null) {
        mValueAnimator.addListener(listener);
      }
      mValueAnimator.start();
    }
  }

Could I make a PR?

xiphirx commented 3 years ago

Closing since the PR is open and stale.