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

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

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

Animation.setFillAfter介绍

暂无

代码示例

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

public void scaleView(View v, float startScale, float endScale) {
  Animation anim = new ScaleAnimation(
      1f, 1f, // Start and end values for the X axis scaling
      startScale, endScale, // Start and end values for the Y axis scaling
      Animation.RELATIVE_TO_SELF, 0f, // Pivot point of X scaling
      Animation.RELATIVE_TO_SELF, 1f); // Pivot point of Y scaling
  anim.setFillAfter(true); // Needed to keep the result of the animation
  v.startAnimation(anim);
}

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

Animation animation = new TranslateAnimation(0, 500,0, 0);
animation.setDuration(1000);
animation.setFillAfter(true);
myImage.startAnimation(animation);
myImage.setVisibility(0);

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

private void initView() {
  ivArrow = (ImageView) findViewById(R.id.ivSelArrow);
  ivArrow.setScaleType(ImageView.ScaleType.MATRIX);   //required
  tvTitle = (TextView) findViewById(R.id.tvSelTitle);
  setOnClickListener(this);
  operatingAnim1.setInterpolator(lin1);
  operatingAnim1.setFillAfter(true);
  operatingAnim2.setInterpolator(lin2);
  operatingAnim2.setFillAfter(true);
}

代码示例来源:origin: dinuscxj/RecyclerRefreshLayout

private void initAnimation() {
  mRotateAnimation = new RotateAnimation(0, -180, Animation.RELATIVE_TO_SELF, 0.5f,
      Animation.RELATIVE_TO_SELF, 0.5f);
  mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
  mRotateAnimation.setDuration(ANIMATION_DURATION);
  mRotateAnimation.setFillAfter(true);
  mResetRotateAnimation = new RotateAnimation(-180, 0, Animation.RELATIVE_TO_SELF, 0.5f,
      Animation.RELATIVE_TO_SELF, 0.5f);
  mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
  mResetRotateAnimation.setDuration(ANIMATION_DURATION);
  mResetRotateAnimation.setFillAfter(true);
}

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

private void initView(Context context) {
  // 初始情况,设置下拉刷新view高度为0
  LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
      LayoutParams.MATCH_PARENT, 0);
  mContainer = (LinearLayout) LayoutInflater.from(context).inflate(
      R.layout.xlistview_header, null);
  addView(mContainer, lp);
  setGravity(Gravity.BOTTOM);
  mArrowImageView = findViewById(R.id.xlistview_header_arrow);
  mHintTextView = (TextView)findViewById(R.id.xlistview_header_hint_textview);
  mProgressBar = findViewById(R.id.xlistview_header_progressbar);
  
  mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateUpAnim.setFillAfter(true);
  mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateDownAnim.setFillAfter(true);
}

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

private void initView(Context context) {
  // 初始情况,设置下拉刷新view高度为0
  LayoutParams lp = new LayoutParams(
      LayoutParams.FILL_PARENT, 0);
  mContainer = (LinearLayout) LayoutInflater.from(context).inflate(
      R.layout.smoothlistview_header, null);
  addView(mContainer, lp);
  setGravity(Gravity.BOTTOM);
  mArrowImageView = (ImageView)findViewById(R.id.smoothlistview_header_arrow);
  mHintTextView = (TextView)findViewById(R.id.smoothlistview_header_hint_textview);
  mProgressBar = (ProgressBar)findViewById(R.id.smoothlistview_header_progressbar);
  
  mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateUpAnim.setFillAfter(true);
  mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateDownAnim.setFillAfter(true);
}

代码示例来源:origin: jdsjlzx/LRecyclerView

private void initView() {
  // 初始情况,设置下拉刷新view高度为0
  LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
  lp.setMargins(0, 0, 0, 0);
  this.setLayoutParams(lp);
  this.setPadding(0, 0, 0, 0);
  mContainer = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.layout_recyclerview_refresh_header, null);
  addView(mContainer, new LayoutParams(LayoutParams.MATCH_PARENT, 0));
  setGravity(Gravity.BOTTOM);
  mArrowImageView = (ImageView)findViewById(R.id.listview_header_arrow);
  mStatusTextView = (TextView)findViewById(R.id.refresh_status_textview);
  //init the progress view
  mProgressBar = (SimpleViewSwitcher)findViewById(R.id.listview_header_progressbar);
  mProgressBar.setView(initIndicatorView(ProgressStyle.BallSpinFadeLoader));
  mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateUpAnim.setFillAfter(true);
  mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  mRotateDownAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateDownAnim.setFillAfter(true);
  mHeaderTimeView = (TextView)findViewById(R.id.last_refresh_time);
  measure(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  mMeasuredHeight = getMeasuredHeight();
  hintColor = android.R.color.darker_gray;
}

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

Animation animation1 =new RotateAnimation(0f,-360f, Animation.RELATIVE_TO_SELF,
    0.5f,Animation.RELATIVE_TO_SELF,0.5f);
animation.setFillAfter(true);
animation.setDuration(2000);
animation.setRepeatCount(ValueAnimator.INFINITE);
animation.setRepeatMode(ValueAnimator.INFINITE);
animation1.setFillAfter(true);
animation1.setDuration(2000);
animation1.setRepeatCount(ValueAnimator.INFINITE);

代码示例来源:origin: Manabu-GT/ExpandableTextView

animation.setFillAfter(true);
animation.setAnimationListener(new Animation.AnimationListener() {
  @Override

代码示例来源:origin: huburt-Hu/NewbieGuide

enterAnimation.setFillAfter(true);
exitAnimation.setFillAfter(true);

代码示例来源:origin: tianshaojie/AndroidFine

public FlipLoadingLayout(Context context, final Mode mode, final Orientation scrollDirection, TypedArray attrs) {
  super(context, mode, scrollDirection, attrs);
  final int rotateAngle = mode == Mode.PULL_FROM_START ? -180 : 180;
  mRotateAnimation = new RotateAnimation(0, rotateAngle, Animation.RELATIVE_TO_SELF, 0.5f,
      Animation.RELATIVE_TO_SELF, 0.5f);
  mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
  mRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
  mRotateAnimation.setFillAfter(true);
  mResetRotateAnimation = new RotateAnimation(rotateAngle, 0, Animation.RELATIVE_TO_SELF, 0.5f,
      Animation.RELATIVE_TO_SELF, 0.5f);
  mResetRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
  mResetRotateAnimation.setDuration(FLIP_ANIMATION_DURATION);
  mResetRotateAnimation.setFillAfter(true);
}

代码示例来源:origin: tianshaojie/AndroidFine

@Override
  public void run() {
    if(firstTimeUse) {
      Animation fadeOut = AnimationUtils.loadAnimation(SplashActivity.this, R.anim.fadeout);
      fadeOut.setFillAfter(true);
      findViewById(R.id.guideImage).startAnimation(fadeOut);
      initGuideGallery();
    } else {
      UIHelper.showHome(SplashActivity.this);
    }
  }
}, 2000);

代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher

@Override
public final void onFling(final float distance, final long duration) {
  if (getDragHandler() != null) {
    flingAnimation = new FlingAnimation(distance);
    flingAnimation.setFillAfter(true);
    flingAnimation.setAnimationListener(createFlingAnimationListener());
    flingAnimation.setDuration(duration);
    flingAnimation.setInterpolator(new DecelerateInterpolator());
    getTabSwitcher().startAnimation(flingAnimation);
    logger.logVerbose(getClass(),
        "Started fling animation using a distance of " + distance +
            " pixels and a duration of " + duration + " milliseconds");
  }
}

代码示例来源:origin: huxq17/XRefreshView

private void initView(Context context) {
  mContent = (ViewGroup) LayoutInflater.from(context).inflate(
      R.layout.xrefreshview_header, this);
  mArrowImageView = (ImageView) findViewById(R.id.xrefreshview_header_arrow);
  mOkImageView = (ImageView) findViewById(R.id.xrefreshview_header_ok);
  mHintTextView = (TextView) findViewById(R.id.xrefreshview_header_hint_textview);
  mHeaderTimeTextView = (TextView) findViewById(R.id.xrefreshview_header_time);
  mProgressBar = (ProgressBar) findViewById(R.id.xrefreshview_header_progressbar);
  mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateUpAnim.setFillAfter(true);
  mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateDownAnim.setDuration(0);
  mRotateDownAnim.setFillAfter(true);
}

代码示例来源:origin: tianshaojie/AndroidFine

mRotateAnimation.setInterpolator(interpolator);
mRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mRotateAnimation.setFillAfter(true);
mResetRotateAnimation.setInterpolator(interpolator);
mResetRotateAnimation.setDuration(DEFAULT_ROTATION_ANIMATION_DURATION);
mResetRotateAnimation.setFillAfter(true);

代码示例来源:origin: huxq17/XRefreshView

private void initView(Context context) {
  mContent = (RelativeLayout) LayoutInflater.from(context).inflate(
      R.layout.headerview, null);
  addView(mContent);
  setGravity(Gravity.BOTTOM);
  mHeaderLayout = (RelativeLayout) findViewById(R.id.xrefreshview_header);
  mArrowImageView = (ImageView) findViewById(R.id.xrefreshview_header_arrow);
  mOkImageView = (ImageView) findViewById(R.id.xrefreshview_header_ok);
  mHintTextView = (TextView) findViewById(R.id.xrefreshview_header_hint_textview);
  mHeaderTimeTextView = (TextView) findViewById(R.id.xrefreshview_header_time);
  mProgressBar = (ProgressBar) findViewById(R.id.xrefreshview_header_progressbar);
  mRotateUpAnim = new RotateAnimation(0.0f, -180.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateUpAnim.setDuration(ROTATE_ANIM_DURATION);
  mRotateUpAnim.setFillAfter(true);
  mRotateDownAnim = new RotateAnimation(-180.0f, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateDownAnim.setDuration(0);
  mRotateDownAnim.setFillAfter(true);
}

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

mGalleryAlphaOut.setFillAfter(true);
mGalleryAlphaOut.setDuration(dur);
mGalleryAlphaOut.setAnimationListener(mFadeOutAnimationListener);
mGalleryAlphaIn = AnimationUtils.loadAnimation(getContext(), android.R.anim.fade_in);
mGalleryAlphaIn.setFillAfter(true);
mGalleryAlphaIn.setDuration(dur);
mGalleryAlphaIn.setAnimationListener(mFadeInAnimationListener);

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

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

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

private void RunAnimations(MotionEvent event) {
   lastX = event.getX();
   lastY = event.getY();
   Animation b = new TranslateAnimation(Animation.ABSOLUTE,lastX,Animation.ABSOLUTE,event.getX(),Animation.ABSOLUTE,lastY-57,Animation.ABSOLUTE,event.getY()-57);             
   rl.startAnimation(b);  
   b.setFillAfter(true);
 }

相关文章

微信公众号

最新文章

更多