android.widget.ImageView.setAnimation()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(207)

本文整理了Java中android.widget.ImageView.setAnimation()方法的一些代码示例,展示了ImageView.setAnimation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setAnimation()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setAnimation

ImageView.setAnimation介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

// Locate view
 ImageView diskView = (ImageView) findViewById(R.id.imageView3);
 // Create an animation instance
 Animation an = new RotateAnimation(0.0f, 360.0f, pivotX, pivotY);
 // Set the animation's parameters
 an.setDuration(10000);               // duration in ms
 an.setRepeatCount(0);                // -1 = infinite repeated
 an.setRepeatMode(Animation.REVERSE); // reverses each repeat
 an.setFillAfter(true);               // keep rotation after animation
 // Aply animation to image view
 diskView.setAnimation(an);

代码示例来源:origin: stackoverflow.com

RotateAnimation anim = new RotateAnimation(0f, 350f, 15f, 15f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);

// Start animating the image
final ImageView splash = (ImageView) findViewById(R.id.splash);
splash.startAnimation(anim);

// Later.. stop the animation
splash.setAnimation(null);

代码示例来源:origin: stackoverflow.com

animation.addAnimation(fadeOut);
animation.setRepeatCount(1);
imageView.setAnimation(animation);

代码示例来源:origin: androidquery/androidquery

iv.startAnimation(anim);
}else{
  iv.setAnimation(null);

代码示例来源:origin: jaydenxiao2016/AndroidFire

animation1.setRepeatCount(ValueAnimator.INFINITE);
animation1.setRepeatMode(ValueAnimator.INFINITE);
ivBatMan.setAnimation(animation);
ivSuperMan.setAnimation(animation1);

代码示例来源:origin: thoughtbot/expandable-recycler-view

private void animateCollapse() {
  RotateAnimation rotate =
    new RotateAnimation(180, 360, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
  rotate.setDuration(300);
  rotate.setFillAfter(true);
  arrow.setAnimation(rotate);
 }
}

代码示例来源:origin: thoughtbot/expandable-recycler-view

private void animateExpand() {
 RotateAnimation rotate =
   new RotateAnimation(360, 180, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
 rotate.setDuration(300);
 rotate.setFillAfter(true);
 arrow.setAnimation(rotate);
}

代码示例来源:origin: stackoverflow.com

animation.addAnimation(fadeOut);
animation.setRepeatCount(1);
imageView.setAnimation(animation);

代码示例来源:origin: stackoverflow.com

ImageView imageView = (imageView)findViewById(R.id.yourImageViewId);

Animation zoomin = AnimationUtils.loadAnimation(this, R.anim.zoomin);
Animation zoomout = AnimationUtils.loadAnimation(this, R.anim.zoomout);
imageView.setAnimation(zoomin);
imageView.setAnimation(zoomout);

代码示例来源:origin: stackoverflow.com

public void onShakeImage() {    
  Animation shake;
  shake = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.shake);

  ImageView image;
  image = (ImageView) findViewById(R.id.image_view);

  image.setAnimation(shake);
}

代码示例来源:origin: chaychan/TouTiao

bottomImageView.setAnimation(mRotateAnimation);

代码示例来源:origin: zhouruikevin/ImageLoadPK

@Override
  public boolean onResourceReady(GlideBitmapDrawable resource, String model, Target<GlideBitmapDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
    dissProgress();
    Log.d(TAG, "onResourceReady: " + isFromMemoryCache);
    if (isFromMemoryCache) {
      mIvShow.setAnimation(AnimationUtils.loadAnimation(mContext, R.anim.scale));
    }
    return false;
  }
};

代码示例来源:origin: Rachel-Ding/Android-Tiny-Projects

@Override
public void onAnimationEnd(Animation animation) {
  if (imageView1.getVisibility() == View.VISIBLE) {
    imageView1.setAnimation(null);
    showImage2();
    imageView2.startAnimation(sa2);
  } else {
    imageView2.setAnimation(null);
    showImage1();
    imageView1.startAnimation(sa2);
  }
}

代码示例来源:origin: SpikeKing/wcl-circle-reveal-demo

private void initViews() {
  new Handler(Looper.getMainLooper()).post(() -> {
    Animation animation = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
    animation.setDuration(300);
    mTvContainer.setVisibility(View.VISIBLE);
    mIvClose.setVisibility(View.VISIBLE);
    mTvContainer.startAnimation(animation);
    mIvClose.setAnimation(animation);
  });
}

代码示例来源:origin: madreain/AndroidDream

private void startRateAnimation() {
  if (animation == null) {
    //设置一个匀速的旋转动画
    animation = new RotateAnimation(0, 25199, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(50000);
    animation.setFillAfter(true);
    LinearInterpolator lin = new LinearInterpolator();
    animation.setInterpolator(lin);
    img_rotate.setAnimation(animation);
  }
}

代码示例来源:origin: xiaolongonly/Ticket-Analysis

public void onLoadMoreStart() {
  init = false;
  if (loadMoreType != 1) {
    loadMoreType = 1;
    showFooter(true);
    mFooterView.setVisibility(View.VISIBLE);
    tvLoadMore.setVisibility(View.VISIBLE);
    rotateImage.setVisibility(View.VISIBLE);
    rotateImage.setAnimation(animation);
    tvLoadMore.setText(tvLoadMore.getContext().getString(R.string.load_more_ing));
  }
}

代码示例来源:origin: OceanLabs/Android-Print-SDK

/*****************************************************
 *
 * Sets the checked state.
 *
 * @return The new state.
 *
 *****************************************************/
public State setChecked( boolean isChecked )
 {
 mCheckImageView.setAnimation( null );
 return ( setState( testChecked( isChecked ) ) );
 }

代码示例来源:origin: stackoverflow.com

ImageView diskView = (ImageView) findViewById(R.id.imageView3);
 // Create an animation instance
 Animation an = new RotateAnimation(0.0f, 360.0f, pivotX, pivotY);
 // Set the animation's parameters
 an.setDuration(10000);               // duration in ms
 an.setRepeatCount(0);                // -1 = infinite repeated
 an.setRepeatMode(Animation.REVERSE); // reverses each repeat
 an.setFillAfter(true);               // keep rotation after animation
 // Apply animation to image view
 diskView.setAnimation(an);

代码示例来源:origin: stackoverflow.com

`RotateAnimation anim = new RotateAnimation(0f, 350f, 15f, 15f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);
// Start animating the image
final ImageView splash = (ImageView) findViewById(R.id.splash);
splash.startAnimation(anim);
// Later.. stop the animation
splash.setAnimation(null);`

代码示例来源:origin: stackoverflow.com

ImageView image= (ImageView)findViewById(R.id.imageView);
 // Create 45d animaion
 Animation an = new RotateAnimation(0.0f, 45f, image.getPivotX(), image.getPivotY());
 // Set the animation's parameters
 an.setDuration(1);               
 an.setRepeatCount(0);                
 an.setRepeatMode(Animation.REVERSE); 
 an.setFillAfter(true);               
 // Aplly animation to image
 image.setAnimation(an);

相关文章

ImageView类方法