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

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

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

ImageView.startAnimation介绍

暂无

代码示例

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

ImageView imageView = (ImageView) findViewById(R.id.imageView);
Animation fadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.your_fade_in_anim);
// Now Set your animation
imageView.startAnimation(fadeInAnimation);

代码示例来源:origin: smuyyh/BookReader

@Override
  public void onDismiss() {
    ivArrow.startAnimation(operatingAnim2);
    isOpen = false;
  }
});

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

ImageView myImageView = (ImageView) findViewById(R.id.imageView2); 
Animation myFadeInAnimation = AnimationUtils.loadAnimation(Splash.this, R.anim.tween);
myImageView.startAnimation(myFadeInAnimation);

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

ImageView imageView = (ImageView) findViewById(R.id.image);
Animation pulse = AnimationUtils.loadAnimation(this, R.anim.pulse);
imageView.startAnimation(pulse);

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

ImageView myImageView= (ImageView)findViewById(R.id.myImageView);
Animation myFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.fadein);
myImageView.startAnimation(myFadeInAnimation); //Set animation to your ImageView

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

public void refresh() {
  /* Attach a rotating ImageView to the refresh item as an ActionView */
  LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  ImageView iv = (ImageView) inflater.inflate(R.layout.refresh_action_view, null);
  Animation rotation = AnimationUtils.loadAnimation(getActivity(), R.anim.clockwise_refresh);
  rotation.setRepeatCount(Animation.INFINITE);
  iv.startAnimation(rotation);
  refreshItem.setActionView(iv);
  //TODO trigger loading
}

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

ImageView view = ... //Initialize ImageView via FindViewById or programatically

RotateAnimation anim = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

//Setup anim with desired properties
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE); //Repeat animation indefinitely
anim.setDuration(700); //Put desired duration per anim cycle here, in milliseconds

//Start animation
view.startAnimation(anim); 
//Later on, use view.setAnimation(null) to stop it.

代码示例来源:origin: smuyyh/BookReader

@Override
public void onClick(View v) {
  if (isOpen) {
    ivArrow.startAnimation(operatingAnim2);
    closePopWindow();
    isOpen = false;
  } else {
    ivArrow.startAnimation(operatingAnim1);
    openPopupWindow();
    isOpen = true;
  }
}

代码示例来源:origin: liaoinstan/SpringView

@Override
public void onLimitDes(View rootView, boolean upORdown) {
  if (!upORdown) {
    headerTitle.setText("松开刷新");
    if (headerArrow.getVisibility() == View.VISIBLE)
      headerArrow.startAnimation(mRotateUpAnim);
  } else {
    headerTitle.setText("下拉刷新");
    if (headerArrow.getVisibility() == View.VISIBLE)
      headerArrow.startAnimation(mRotateDownAnim);
  }
}

代码示例来源:origin: liaoinstan/SpringView

@Override
public void onLimitDes(View rootView, boolean upORdown) {
  if (!upORdown) {
    headerTitle.setText("松开刷新");
    if (headerArrow.getVisibility() == View.VISIBLE)
      headerArrow.startAnimation(mRotateUpAnim);
  } else {
    headerTitle.setText("下拉刷新");
    if (headerArrow.getVisibility() == View.VISIBLE)
      headerArrow.startAnimation(mRotateDownAnim);
  }
}

代码示例来源:origin: liaoinstan/SpringView

@Override
public void onLimitDes(View rootView, boolean upORdown) {
  if (upORdown) {
    footerTitle.setText("松开加载");
    if (footerArrow.getVisibility() == View.VISIBLE)
      footerArrow.startAnimation(mRotateUpAnim);
  } else {
    footerTitle.setText("上拉加载");
    if (footerArrow.getVisibility() == View.VISIBLE)
      footerArrow.startAnimation(mRotateDownAnim);
  }
}

代码示例来源:origin: Clans/FloatingActionButton

private void hideMenuButtonWithImage(boolean animate) {
  if (!isMenuButtonHidden()) {
    mMenuButton.hide(animate);
    if (animate) {
      mImageToggle.startAnimation(mImageToggleHideAnimation);
    }
    mImageToggle.setVisibility(INVISIBLE);
    mIsMenuButtonAnimationRunning = false;
  }
}

代码示例来源:origin: Clans/FloatingActionButton

private void showMenuButtonWithImage(boolean animate) {
  if (isMenuButtonHidden()) {
    mMenuButton.show(animate);
    if (animate) {
      mImageToggle.startAnimation(mImageToggleShowAnimation);
    }
    mImageToggle.setVisibility(VISIBLE);
  }
}

代码示例来源:origin: Aspsine/SwipeToLoadLayout

@Override
public void onRefresh() {
  ivSpeed.setVisibility(VISIBLE);
  ivSpeed.startAnimation(mTwinkleAnim);
  if (!mAnimDrawable.isRunning()){
    mAnimDrawable.start();
  }
}

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

ImageView img_animation = (ImageView) findViewById(R.id.img_animation);
 TranslateAnimation animation = new TranslateAnimation(0.0f, 400.0f,
     0.0f, 0.0f);          //  new TranslateAnimation(xFrom,xTo, yFrom,yTo)
 animation.setDuration(5000);  // animation duration 
 animation.setRepeatCount(5);  // animation repeat count
 animation.setRepeatMode(2);   // repeat animation (left to right, right to left )
 //animation.setFillAfter(true);      
 img_animation.startAnimation(animation);  // start animation

代码示例来源:origin: bumptech/glide

@Test
 public void testStartsAnimationOnAnimate() {
  Animation animation = mock(Animation.class);
  when(viewTransitionAnimationFactory.build(any(Context.class))).thenReturn(animation);
  viewAnimation.transition(null, adapter);
  verify(view).clearAnimation();
  verify(view).startAnimation(eq(animation));
 }
}

代码示例来源: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: sunfusheng/StickyHeaderListView

public static void rotateArrowUpAnimation(final ImageView iv) {
  if (iv == null) return;
  RotateAnimation animation = new RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  animation.setDuration(200);
  animation.setFillAfter(true);
  iv.startAnimation(animation);
}

代码示例来源:origin: sunfusheng/StickyHeaderListView

public static void rotateArrowDownAnimation(final ImageView iv) {
  if (iv == null) return;
  RotateAnimation animation = new RotateAnimation(180f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  animation.setDuration(200);
  animation.setFillAfter(true);
  iv.startAnimation(animation);
}

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

ImageView myImageView = (ImageView)findViewById(R.id.my_imageview);

AnimationSet animSet = new AnimationSet(true);
animSet.setInterpolator(new DecelerateInterpolator());
animSet.setFillAfter(true);
animSet.setFillEnabled(true);

final RotateAnimation animRotate = new RotateAnimation(0.0f, -90.0f,
  RotateAnimation.RELATIVE_TO_SELF, 0.5f, 
  RotateAnimation.RELATIVE_TO_SELF, 0.5f);

animRotate.setDuration(1500);
animRotate.setFillAfter(true);
animSet.addAnimation(animRotate);

myImageView.startAnimation(animSet);

相关文章

ImageView类方法