android.view.animation.Animation.setFillEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(124)

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

Animation.setFillEnabled介绍

暂无

代码示例

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

ta.setFillEnabled(true);
ta.setFillAfter(true);

代码示例来源:origin: Tencent/RapidView

public void run(AnimationObject object, Object animation, String value){
    ((Animation)animation).setFillEnabled(RapidStringUtils.stringToBoolean(value));
  }
}

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

private Animation fadeInAnimation() {
  Animation animation = new AlphaAnimation(0f, 1.0f);
  animation.setDuration(1000); // in milliseconds, change to whatever you want
  animation.setFillEnabled(true);
  animation.setFillAfter(true);
  return animation;
}

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

private Animation fadeAnimation(boolean fadeIn) {

 Animation animation = null;
 if(fadeIn)
  animation = new AlphaAnimation(0f, 1.0f);
 else
  animation = new AlphaAnimation(1.0f, 0f);
 animation.setDuration(1000); 
 animation.setFillEnabled(true);
 animation.setFillAfter(true);
 return animation;

}

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

private Animation fadeInAnimation() {
  Animation animation = new AlphaAnimation(0f, 1.0f);
  animation.setDuration(1000); // in milliseconds
  animation.setFillEnabled(true);
  animation.setFillAfter(true);
  return animation;
}

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

public class TestActivity extends Activity {
public final String TAG="TestActivity";
boolean toTop=false;
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main); 
  Button b=(Button)findViewById(R.id.button);
  b.setOnClickListener(new OnClickListener() {

    public void onClick(View v) {
      int modifierY;
      if(toTop) modifierY=-100; 
      else modifierY=100;
      Animation translateAnimation=new TranslateAnimation(0, 0, 0, modifierY);
      translateAnimation.setDuration(1000);
      translateAnimation.setFillEnabled(true);
      MyAnimationListener listener=new MyAnimationListener(v, modifierY,TestActivity.this);
      translateAnimation.setAnimationListener(listener);

      v.startAnimation(translateAnimation);
      toTop=!toTop;
    }
  });
}

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

Animation fadeIn = new AlphaAnimation(0, 1);
 fadeIn.setInterpolator(new DecelerateInterpolator()); // add this
 fadeIn.setDuration(fadeInDuration);
 fadeIn.setFillEnabled(true); // to apply setFillBefore and setFillAfter
 fadeIn.setFillBefore(true); // it means that at start of animation you set alpha="0"
 fadeIn.setFillAfter(false);
 iv.setAnimation(fadeIn);
 iv.startAnimation(fadeIn);

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

slide.setFillEnabled(true);
img.startAnimation(slide);

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

Animation rotateAnim = new RotateAnimation(0, 360, Animation.ABSOLUTE, Animation.ABSOLUTE, Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF);
   rotateAnim.setDuration(5000);
   rotateAnim.setRepeatCount(1);
   rotateAnim.setInterpolator(new AccelerateInterpolator());
   rotateAnim.setRepeatMode(Animation.REVERSE);
   rotateAnim.setFillEnabled(true);
   rotateAnim.setFillAfter(true);

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

@Override
  public void onClick(View arg0) {
    // TODO Auto-generated method stub
     Animation an = new RotateAnimation(angle*(-1), getRotateAngle(), 0, 25);
      an.setDuration(1000);               // duration in ms
      an.setRepeatCount(0);                // -1 = infinite repeated
      an.setRepeatMode(Animation.REVERSE); // reverses each repeat
      an.setFillAfter(true);
      an.setFillEnabled(true);
      tvView.startAnimation(an);
  }
});

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

animation.setFillEnabled(false);

代码示例来源:origin: jakebonk/BoardView

anim.setFillAfter(true); // Needed to keep the result of the animation
anim.setFillBefore(false);
anim.setFillEnabled(true);
anim.setDuration(ANIM_TIME);
v.startAnimation(anim);

代码示例来源:origin: hiteshsahu/ECommerce-App-Android

public LabelView(Context context, AttributeSet attrs, int defStyle) {
  super(context, attrs, defStyle);
  init();
  _animation.setFillBefore(true);
  _animation.setFillAfter(true);
  _animation.setFillEnabled(true);
}

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

R.anim.center_to_top_center);
translateAnim.setFillAfter(true);
translateAnim.setFillEnabled(true);
translateAnim.setFillBefore(false);
translateAnim.setAnimationListener(new Animation.AnimationListener() {

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

a.setFillAfter(false);
a.setFillBefore(false);
a.setFillEnabled(true);
set.addAnimation(a);
a.setFillAfter(false);
a.setFillBefore(false);
a.setFillEnabled(true);
set.addAnimation(a);

代码示例来源:origin: Scalified/viewmover

/**
 * Creates the moving animation
 * <p>
 * Configures the moving animation based on moving params
 *
 * @param params params, which is used to configure the moving animation
 * @return moving animation
 */
private Animation createAnimation(MovingParams params) {
  Animation animation = new TranslateAnimation(0, params.getXAxisDelta(), 0, params.getYAxisDelta());
  animation.setFillEnabled(true);
  animation.setFillBefore(false);
  animation.setDuration(params.getAnimationDuration());
  Interpolator interpolator = params.getAnimationInterpolator();
  if (interpolator != null) {
    animation.setInterpolator(interpolator);
  }
  animation.setAnimationListener(new MoveAnimationListener(params));
  return animation;
}

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

mAnimation.setFillEnabled(true);
mContent.startAnimation(mAnimation);

代码示例来源:origin: flipkart-incubator/proteus

anim.setFillEnabled(fillEnabled);

相关文章