Refine search
ImageView img = (ImageView)findViewById(R.id.spinning_wheel_image); img.setImageResource(R.drawable.my_blinking_drawable); AnimationDrawable frameAnimation = (AnimationDrawable) img.getDrawable(); frameAnimation.start();
private void hideSearchAnim() { mLoadingView.setVisibility(View.GONE); mAnimationDrawable.stop(); }
@Override public void onRefresh() { ivSpeed.setVisibility(VISIBLE); ivSpeed.startAnimation(mTwinkleAnim); if (!mAnimDrawable.isRunning()){ mAnimDrawable.start(); } }
AnimationDrawable animation = new AnimationDrawable(); animation.addFrame(getResources().getDrawable(R.drawable.image1), 100); animation.addFrame(getResources().getDrawable(R.drawable.image2), 500); animation.addFrame(getResources().getDrawable(R.drawable.image3), 300); animation.setOneShot(false); ImageView imageAnim = (ImageView) findViewById(R.id.img); imageAnim.setBackgroundDrawable(animation); // start the animation! animation.start()
AnimationDrawable countdownAnimation = (AnimationDrawable) mStartButton.getBackground(); countdownAnimation.setCallback(new AnimationDrawableCallback(countdownAnimation, mStartButton) { @Override public void onAnimationComplete() { // TODO Do something. } }); countdownAnimation.start();
@Override protected void setImageDrawableInto(Drawable drawable, View view) { ((ImageView) view).setImageDrawable(drawable); if (drawable instanceof AnimationDrawable) { ((AnimationDrawable)drawable).start(); } }
@Override public void changeToReleaseRefresh() { mHeaderStatusTv.setText(mReleaseRefreshText); mHeaderChrysanthemumIv.setVisibility(View.INVISIBLE); mHeaderChrysanthemumAd.stop(); mHeaderArrowIv.setVisibility(View.VISIBLE); mHeaderArrowIv.startAnimation(mUpAnim); }
private void showSearchAnim() { mLoadingView.setVisibility(View.VISIBLE); mAnimationDrawable.start(); }
ImageView DotAnimImage = (ImageView) findViewById(R.id.imageView1); DotAnimImage.setImageResource(R.drawable.dots_animation); AnimationDrawable dotsAnimation = (AnimationDrawable) DotAnimImage.getDrawable(); if (dotsAnimation.isRunning()) { dotsAnimation.stop(); } dotsAnimation.start();
loadigIcon.setVisibility(View.GONE); loadigIcon.setBackgroundResource(R.anim.loading_animation); loadingViewAnim = (AnimationDrawable) loadigIcon.getBackground(); loadigText.setVisibility(View.GONE); loadigIcon.setVisibility(View.GONE); loadingViewAnim.stop(); loadigText.setVisibility(View.VISIBLE); loadigIcon.setVisibility(View.VISIBLE); loadingViewAnim.start();
public void stopPlayVoiceAnimation() { if (voiceAnimation != null && voiceAnimation.isRunning()) { voiceAnimation.stop(); voiceIconView.setImageResource(R.drawable.ease_chatto_voice_playing); } isPlaying = false; playUrl = null; }
@Override public void onPreDrag(View rootView) { animationLoading.stop(); if (animationLoading != null && animationLoading.getNumberOfFrames() > 0) footer_img.setImageDrawable(animationLoading.getFrame(0)); }
@Override public void onReset() { mAnimDrawable.stop(); ivSpeed.clearAnimation(); ivSpeed.setVisibility(GONE); } }
public final void reset() { if (null != mHeaderText) { mHeaderText.setText(mPullLabel); } mHeaderImage.setVisibility(View.VISIBLE); if (mUseIntrinsicAnimation) { ((AnimationDrawable) mHeaderImage.getDrawable()).stop(); } else { // Now call the callback resetImpl(); } if (null != mSubHeaderText) { if (TextUtils.isEmpty(mSubHeaderText.getText())) { mSubHeaderText.setVisibility(View.GONE); } else { mSubHeaderText.setVisibility(View.VISIBLE); } } }
private AnimationDrawable getAnimationDrawable(boolean fromXml) { if (fromXml) { //mPuppet.setImageDrawable(getResources().getDrawable(R.drawable.run)); AnimationDrawable animationDrawable = (AnimationDrawable) mPuppet.getDrawable(); //animationDrawable.setOneShot(false); return animationDrawable; } else { AnimationDrawable animationDrawable = new AnimationDrawable(); for (int i = 1; i < 8; i++) { int id = getResources().getIdentifier("run" + i, "drawable", getPackageName()); Drawable drawable = getDrawable(id); if (null != drawable) { animationDrawable.addFrame(drawable, 100); } } mPuppet.setImageDrawable(animationDrawable); return animationDrawable; } } }
@Override public void changeToRefreshing() { mHeaderStatusTv.setText(mRefreshingText); // 必须把动画清空才能隐藏成功 mHeaderArrowIv.clearAnimation(); mHeaderArrowIv.setVisibility(View.INVISIBLE); mHeaderChrysanthemumIv.setVisibility(View.VISIBLE); mHeaderChrysanthemumAd.start(); }
private void initView() { animation = (AnimationDrawable) bindingView.imageview.getDrawable(); if (!animation.isRunning()) { animation.start(); } }
@Override public void showHasMore() { if (!mFragment.getHeaderAdapter().containsFooterView(mLoadingView)) { ((AnimationDrawable) mLoadingView.getDrawable()).start(); mFragment.getHeaderAdapter().addFooterView(mLoadingView); } }
@Test public void stopPlaceholderAnimationOnError() { Picasso picasso = mock(Picasso.class); AnimationDrawable placeholder = mock(AnimationDrawable.class); ImageView target = mockImageViewTarget(); when(target.getDrawable()).thenReturn(placeholder); ImageViewAction request = new ImageViewAction(picasso, target, null, null, 0, false, null); request.error(new RuntimeException()); verify(placeholder).stop(); } }