Example usage for android.graphics.drawable AnimatedVectorDrawable registerAnimationCallback

List of usage examples for android.graphics.drawable AnimatedVectorDrawable registerAnimationCallback

Introduction

In this page you can find the example usage for android.graphics.drawable AnimatedVectorDrawable registerAnimationCallback.

Prototype

@Override
    public void registerAnimationCallback(@NonNull AnimationCallback callback) 

Source Link

Usage

From source file:net.simno.klingar.ui.adapter.PlayingViewHolder.java

@Override
void bindModel(@NonNull Track track) {
    super.bindModel(track);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        AnimatedVectorDrawable avd = (AnimatedVectorDrawable) ContextCompat.getDrawable(itemView.getContext(),
                R.drawable.equalizer);//  www .  jav  a 2 s . c  o  m
        avd.registerAnimationCallback(new Animatable2.AnimationCallback() {
            @Override
            public void onAnimationEnd(Drawable drawable) {
                avd.start();
            }
        });
        avd.start();
        title.setCompoundDrawablesWithIntrinsicBounds(avd, null, null, null);
    }
}