com.nineoldandroids.animation.ObjectAnimator.setCurrentPlayTime()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(116)

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

ObjectAnimator.setCurrentPlayTime介绍

暂无

代码示例

代码示例来源:origin: iballan/TimelyView

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
  if(objectAnimator != null) objectAnimator.setCurrentPlayTime(progress);
}
@Override

代码示例来源:origin: xuehuayous/PullToRefresh-Demo

@Override
public void onPull(float scaleOfLayout) {
  scaleOfLayout = scaleOfLayout > 1.0f ? 1.0f : scaleOfLayout;
  if (mGoodsImage.getVisibility() != View.VISIBLE) {
    mGoodsImage.setVisibility(View.VISIBLE);
  }
  //透明度动画
  ObjectAnimator animAlphaP = ObjectAnimator.ofFloat(mPersonImage, "alpha", -1, 1).setDuration(300);
  animAlphaP.setCurrentPlayTime((long) (scaleOfLayout * 300));
  ObjectAnimator animAlphaG = ObjectAnimator.ofFloat(mGoodsImage, "alpha", -1, 1).setDuration(300);
  animAlphaG.setCurrentPlayTime((long) (scaleOfLayout * 300));
  //缩放动画
  ViewHelper.setPivotX(mPersonImage, 0);  // 设置中心点
  ViewHelper.setPivotY(mPersonImage, 0);
  ObjectAnimator animPX = ObjectAnimator.ofFloat(mPersonImage, "scaleX", 0, 1).setDuration(300);
  animPX.setCurrentPlayTime((long) (scaleOfLayout * 300));
  ObjectAnimator animPY = ObjectAnimator.ofFloat(mPersonImage, "scaleY", 0, 1).setDuration(300);
  animPY.setCurrentPlayTime((long) (scaleOfLayout * 300));
  ViewHelper.setPivotX(mGoodsImage, mGoodsImage.getMeasuredWidth());
  ObjectAnimator animGX = ObjectAnimator.ofFloat(mGoodsImage, "scaleX", 0, 1).setDuration(300);
  animGX.setCurrentPlayTime((long) (scaleOfLayout * 300));
  ObjectAnimator animGY = ObjectAnimator.ofFloat(mGoodsImage, "scaleY", 0, 1).setDuration(300);
  animGY.setCurrentPlayTime((long) (scaleOfLayout * 300));
}

代码示例来源:origin: AndroidHensen/YaNi

animeAlphaP.setCurrentPlayTime((long) (i * 300));
ObjectAnimator animeAlphaG = ObjectAnimator.ofFloat(mImgGoods, "alpha", -1, 1).setDuration(300);
animeAlphaG.setCurrentPlayTime((long) (i * 300));
animePX.setCurrentPlayTime((long) (i * 300));
ObjectAnimator animePY = ObjectAnimator.ofFloat(mImgPerson, "scaleY", 0, 1).setDuration(300);
animePY.setCurrentPlayTime((long) (i * 300));
animeGX.setCurrentPlayTime((long) (j * 300 * 1.25));
ObjectAnimator animeGY = ObjectAnimator.ofFloat(mImgGoods, "scaleY", 0, 1).setDuration(300);
animeGY.setCurrentPlayTime((long) (j * 300 * 1.25));

代码示例来源:origin: xuehuayous/PullToRefresh-Demo

@Override
public void onPull(float scaleOfLayout) {
  if(scaleOfLayout < 0.7f) scaleOfLayout = 0.7f;
  if(scaleOfLayout > 1.0f) scaleOfLayout = 1.0f;
  //旋转动画
  ViewHelper.setPivotX(mPointerImage, mPointerImage.getMeasuredWidth()/2);  // 设置中心点
  ViewHelper.setPivotY(mPointerImage, mPointerImage.getMeasuredHeight()/2);
  ObjectAnimator animPY = ObjectAnimator.ofFloat(mPointerImage, "rotation", 0, 250).setDuration(300);
  animPY.setCurrentPlayTime((long) (scaleOfLayout * 1000 - 700));
}

相关文章