Search in sources :

Example 1 with AnimatedDrawable2DebugDrawListener

use of com.facebook.fresco.animation.drawable.AnimatedDrawable2DebugDrawListener in project fresco by facebook.

the class BitmapAnimationDebugFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    // Get the animation container
    final ImageView imageView = (ImageView) view.findViewById(R.id.animation_container);
    mFrameInformationContainer = (LinearLayout) view.findViewById(R.id.frame_information);
    mAnimatedDrawable = new AnimatedDrawable2();
    mAnimatedDrawable.setDrawListener(new AnimatedDrawable2DebugDrawListener());
    view.findViewById(R.id.invalidate_button).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            imageView.invalidate();
        }
    });
    mAnimationControlsManager = new AnimationControlsManager(mAnimatedDrawable, (SeekBar) getView().findViewById(R.id.seekbar), (ToggleButton) getView().findViewById(R.id.playpause), getView().findViewById(R.id.reset));
    new BitmapAnimationCacheSelectorConfigurator((Spinner) view.findViewById(R.id.spinner), mBitmapFrameCacheChangedListener, mFrameCacheListener);
    imageView.setImageDrawable(mAnimatedDrawable);
}
Also used : AnimatedDrawable2(com.facebook.fresco.animation.drawable.AnimatedDrawable2) ToggleButton(android.widget.ToggleButton) SeekBar(android.widget.SeekBar) AnimationControlsManager(com.facebook.samples.animation2.utils.AnimationControlsManager) ImageView(android.widget.ImageView) AnimatedDrawable2DebugDrawListener(com.facebook.fresco.animation.drawable.AnimatedDrawable2DebugDrawListener) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

View (android.view.View)1 ImageView (android.widget.ImageView)1 SeekBar (android.widget.SeekBar)1 TextView (android.widget.TextView)1 ToggleButton (android.widget.ToggleButton)1 AnimatedDrawable2 (com.facebook.fresco.animation.drawable.AnimatedDrawable2)1 AnimatedDrawable2DebugDrawListener (com.facebook.fresco.animation.drawable.AnimatedDrawable2DebugDrawListener)1 AnimationControlsManager (com.facebook.samples.animation2.utils.AnimationControlsManager)1