com.nineoldandroids.view.ViewPropertyAnimator.alpha()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(92)

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

ViewPropertyAnimator.alpha介绍

[英]This method will cause the View's alpha property to be animated to the specified value. Animations already running on the property will be canceled.
[中]此方法将使视图的alpha属性设置为指定值的动画。已在该属性上运行的动画将被取消。

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public void run() {
  if (fadingOut) {
   animate(fadee).alpha(0).setDuration(PERIOD);
   fadee.setText(R.string.fading_out);
  }
  else {
   animate(fadee).alpha(1).setDuration(PERIOD);
   fadee.setText(R.string.coming_back);
  }

  fadingOut=!fadingOut;

  fadee.postDelayed(this, PERIOD);
 }
}

代码示例来源:origin: Zomato/AndroidPhotoFilters

private void setAnimation(View viewToAnimate, int position) {
  {
    ViewHelper.setAlpha(viewToAnimate, .0f);
    com.nineoldandroids.view.ViewPropertyAnimator.animate(viewToAnimate).alpha(1).setDuration(250).start();
    lastPosition = position;
  }
}

代码示例来源:origin: code-mc/loadtoast

private void slideUp(int startDelay){
    mReAttached = false;

    ViewPropertyAnimator.animate(mView).setStartDelay(startDelay).alpha(0f)
        .translationY(-mView.getHeight() + mTranslationY)
        .setInterpolator(new AccelerateInterpolator())
        .setDuration(300)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            if(!mReAttached){
              cleanup();
            }
          }
        })
        .start();

    mVisible = false;
  }
}

代码示例来源:origin: code-mc/loadtoast

private void showInternal(){
  mView.show();
  ViewHelper.setTranslationX(mView, (mParentView.getWidth() - mView.getWidth()) / 2);
  ViewHelper.setAlpha(mView, 0f);
  ViewHelper.setTranslationY(mView, -mView.getHeight() + mTranslationY);
  //mView.setVisibility(View.VISIBLE);
  ViewPropertyAnimator.animate(mView).alpha(1f).translationY(25 + mTranslationY)
      .setInterpolator(new DecelerateInterpolator())
      .setListener(null)
      .setDuration(300).setStartDelay(0).start();
  mVisible = true;
}

代码示例来源:origin: domoticz/domoticz-android

public void dismissCard(final View downView, final int position) {
  float viewWidth = downView.getMeasuredWidth();
  ++mDismissAnimationRefCount;
  animate(downView)
      .translationX(viewWidth)
      .alpha(0)
      .setDuration(mAnimationTime)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          performDismiss(downView, position);
        }
      });
}

代码示例来源:origin: grzegorznittner/chanu

/**
 * Slide out a view to the right or left of the list. After the animation has finished, the
 * view will be dismissed by calling {@link #performDismiss(android.view.View, android.view.View, int)}.
 *
 * @param view The view, that should be slided out.
 * @param childView The whole view of the list item.
 * @param position The item position of the item.
 * @param toRightSide Whether it should slide out to the right side.
 */
private void slideOutView(final View view, final View childView, final int position, boolean toRightSide) {
  // Only start new animation, if this view isn't already animated (too fast swiping bug)
  synchronized(mAnimationLock) {
    if(mAnimatedViews.contains(view)) {
      return;
    }
    ++mDismissAnimationRefCount;
    mAnimatedViews.add(view);
  }
  ViewPropertyAnimator.animate(view)
      .translationX(toRightSide ? mViewWidth : -mViewWidth)
      .alpha(0)
      .setDuration(mAnimationTime)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          performDismiss(view, childView, position);
        }
      });
}

代码示例来源:origin: devinhu/androidone

.alpha(alpha)
.setDuration(animationTime)
.setListener(new AnimatorListenerAdapter() {

代码示例来源:origin: livroandroid/5ed

public void onClickAnimar(View view) {
    animate(img).xBy(200).yBy(200).rotation(180).alpha(0.5F).setDuration(2000);
  }
}

代码示例来源:origin: SMSTicket/sms-ticket

animate(mDownView)
  .translationX(dismissRight ? mViewWidth : -mViewWidth)
  .alpha(0)
  .setDuration(mAnimationTime)
  .setListener(new AnimatorListenerAdapter() {
  .alpha(1)
  .setDuration(mAnimationTime)
  .setListener(null);

代码示例来源:origin: domoticz/domoticz-android

.alpha(1)
    .setDuration(mAnimationTime)
    .setListener(null);
animate(mDownView)
    .translationX(dismissRight ? mViewWidth : -mViewWidth)
    .alpha(0)
    .setDuration(mAnimationTime)
    .setListener(new AnimatorListenerAdapter() {
    .alpha(1)
    .setDuration(mAnimationTime)
    .setListener(null);

代码示例来源:origin: grzegorznittner/chanu

.alpha(1)
.setDuration(mAnimationTime)
.setListener(null);

相关文章