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

x33g5p2x  于2022-01-31 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(163)

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

ViewPropertyAnimator.alpha介绍

暂无

代码示例

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

@Override
public ViewPropertyAnimator alpha(float value) {
  android.view.ViewPropertyAnimator n = mNative.get();
  if (n != null) {
    n.alpha(value);
  }
  return this;
}

代码示例来源:origin: scwang90/SmartRefreshLayout

private void addAnimate(SmartViewHolder holder, int postion) {
  if (mOpenAnimationEnable && mLastPosition < postion) {
    holder.itemView.setAlpha(0);
    holder.itemView.animate().alpha(1).start();
    mLastPosition = postion;
  }
}

代码示例来源:origin: alexvasilkov/GestureViews

@Override
  public void onError() {
    holder.progress.animate().alpha(0f);
  }
});

代码示例来源:origin: seven332/EhViewer

private void showProgress(boolean animation) {
  if (null != mProgress && View.VISIBLE != mProgress.getVisibility()) {
    if (animation) {
      mProgress.setAlpha(0.0f);
      mProgress.setVisibility(View.VISIBLE);
      mProgress.animate().alpha(1.0f).setDuration(500).start();
    } else {
      mProgress.setAlpha(1.0f);
      mProgress.setVisibility(View.VISIBLE);
    }
  }
}

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
public void onReleased(@NonNull final RefreshLayout layout, int height, int maxDragHeight) {
  final View imageView = mImageView;
  final View dropView = mWaterDropView;
  mProgressDrawable.start();
  imageView.setVisibility(GONE);
  mWaterDropView.createAnimator().start();//开始回弹
  dropView.animate().setDuration(150).alpha(0).setListener(new AnimatorListenerAdapter() {
    public void onAnimationEnd(Animator animation) {
      dropView.setVisibility(GONE);
      dropView.setAlpha(1);
    }
  });
}

代码示例来源:origin: janishar/PlaceHolderView

protected static <V extends View>void itemAnimFadeAsc(V view, float alphaInitial, float alphaFinal, float factor, int duration){
    view.setAlpha(alphaInitial);
    view.animate()
        .alpha(alphaFinal)
        .setInterpolator(new AccelerateInterpolator(factor))
        .setDuration(duration)
        .start();
  }
}

代码示例来源:origin: ankidroid/Anki-Android

private void showViewWithAnimation(final View view) {
  view.setAlpha(0.0f);
  view.setVisibility(View.VISIBLE);
  view.animate().alpha(TRANSPARENCY).setDuration(ANIMATION_DURATION).setListener(null);
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimation(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0.6f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(600L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

代码示例来源:origin: Yalantis/uCrop

@Override
public void onLoadComplete() {
  mUCropView.animate().alpha(1).setDuration(300).setInterpolator(new AccelerateInterpolator());
  mBlockingView.setClickable(false);
  mShowLoader = false;
  supportInvalidateOptionsMenu();
}

代码示例来源:origin: Yalantis/uCrop

@Override
public void onLoadComplete() {
  mUCropView.animate().alpha(1).setDuration(300).setInterpolator(new AccelerateInterpolator());
  mBlockingView.setClickable(false);
  callback.loadingProgress(false);
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(50L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

代码示例来源:origin: xinghongfei/LookLook

@Override
protected void onResume() {
  super.onResume();
  mRelativeLayout.animate()
      .alpha(1f)
      .setDuration(1000L)
      .setInterpolator(new AccelerateInterpolator())
      .start();
}

代码示例来源:origin: scwang90/SmartRefreshLayout

@Override
  public boolean onTwoLevel(@NonNull RefreshLayout refreshLayout) {
    Toast.makeText(getContext(),"触发二楼事件",Toast.LENGTH_SHORT).show();
    root.findViewById(R.id.secondfloor_content).animate().alpha(1).setDuration(2000);
    refreshLayout.getLayout().postDelayed(new Runnable() {
      @Override
      public void run() {
        header.finishTwoLevel();
        root.findViewById(R.id.secondfloor_content).animate().alpha(0).setDuration(1000);
      }
    },5000);
    return true;//true 将会展开二楼状态 false 关闭刷新
  }
});

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0.3f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(500L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

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

protected void hideOrShowToolbar() {
  toolbar.animate()
      .alpha(mIsToolBarHidden ? 1.0f : 0.0f)
      .setInterpolator(new DecelerateInterpolator(2))
      .start();
  mIsToolBarHidden = !mIsToolBarHidden;
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimation(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(500L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}
private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {

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

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

代码示例来源:origin: frogermcs/InstaMaterial

private void animateUserProfileHeader() {
      vUserProfileRoot.setTranslationY(-vUserProfileRoot.getHeight());
      ivUserProfilePhoto.setTranslationY(-ivUserProfilePhoto.getHeight());
      vUserDetails.setTranslationY(-vUserDetails.getHeight());
      vUserStats.setAlpha(0);

      vUserProfileRoot.animate().translationY(0).setDuration(300).setInterpolator(INTERPOLATOR);
      ivUserProfilePhoto.animate().translationY(0).setDuration(300).setStartDelay(100).setInterpolator(INTERPOLATOR);
      vUserDetails.animate().translationY(0).setDuration(300).setStartDelay(200).setInterpolator(INTERPOLATOR);
      vUserStats.animate().alpha(1).setDuration(200).setStartDelay(400).setInterpolator(INTERPOLATOR).start();
  }
}

代码示例来源:origin: nickbutcher/plaid

private void animateToolbar() {
  // this is gross but toolbar doesn't expose it's children to animate them :(
  View t = toolbar.getChildAt(0);
  if (t != null && t instanceof TextView) {
    TextView title = (TextView) t;
    // fade in and space out the title.  Animating the letterSpacing performs horribly so
    // fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
    title.setAlpha(0f);
    title.setScaleX(0.8f);
    title.animate()
        .alpha(1f)
        .scaleX(1f)
        .setStartDelay(300)
        .setDuration(900)
        .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
  }
}

代码示例来源:origin: nickbutcher/plaid

private void showFab() {
  fab.setAlpha(0f);
  fab.setScaleX(0f);
  fab.setScaleY(0f);
  fab.setTranslationY(fab.getHeight() / 2);
  fab.animate()
      .alpha(1f)
      .scaleX(1f)
      .scaleY(1f)
      .translationY(0f)
      .setDuration(300L)
      .setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
      .start();
}

相关文章