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

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

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

Animation.getTransformation介绍

暂无

代码示例

代码示例来源:origin: nanchen2251/RxJava2Examples

mAnimation.restrictDuration(100);
Transformation transformation = new Transformation();
mAnimation.getTransformation((long) (percent * 100), transformation);
BehaviorAnimation animation = new BehaviorAnimation(transformation);
child.startAnimation(animation);

代码示例来源:origin: robolectric/robolectric

@Override
 public void run() {
  // Abort if start time has been messed with, as this simulation is only designed to handle
  // standard situations.
  if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) &&
    animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ?
      SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) &&
      // We can't handle infinitely repeating animations in the current scheduling model,
      // so abort after one iteration.
      !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) {
   // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME
   startTime = animation.getStartTime();
   elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS;
   ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
  } else {
   animationRunner = null;
  }
 }
}

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

currentAnimation.getTransformation(AnimationUtils.currentAnimationTimeMillis(), transformation);
transformation.getMatrix().getValues(matrix);
float y = matrix[Matrix.MTRANS_Y];

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

public void onAnimationEnd(Animation animation)
{
  animation.setAnimationListener(null);
  Transformation t= new Transformation();
  animation.getTransformation(animation.getDuration(), t);
  animation.setAnimationListener(this);
}

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

boolean needBlock = false;
public void onAnimationEnd(Animation animation)
{
  if ( needBlock ) return;

  needBlock = true;
  Transformation t= new Transformation();
  animation.getTransformation(animation.getDuration(), t);
}

代码示例来源:origin: qiubiteme/android_api_demos

@Override
  public void draw(Canvas canvas) {
    Drawable dr = getProxy();
    if (dr != null) {
      int sc = canvas.save();
      Animation anim = mAnimation;
      if (anim != null) {
        anim.getTransformation(
                  AnimationUtils.currentAnimationTimeMillis(),
                  mTransformation);
        canvas.concat(mTransformation.getMatrix());
      }
      dr.draw(canvas);
      canvas.restoreToCount(sc);
    }
  }
}

代码示例来源:origin: THEONE10211024/ApiDemos

@Override
  public void draw(Canvas canvas) {
    Drawable dr = getProxy();
    if (dr != null) {
      int sc = canvas.save();
      Animation anim = mAnimation;
      if (anim != null) {
        anim.getTransformation(
                  AnimationUtils.currentAnimationTimeMillis(),
                  mTransformation);
        canvas.concat(mTransformation.getMatrix());
      }
      dr.draw(canvas);
      canvas.restoreToCount(sc);
    }
  }
}

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

public void onAnimationEnd(Animation animation)
{
  if ( animation.hasEnded() )
    return;

  Transformation t= new Transformation();
  animation.getTransformation(animation.getDuration(), t);
}

代码示例来源:origin: nanchen2251/WaveSideBar

mAnimation.restrictDuration(100);
Transformation transformation = new Transformation();
mAnimation.getTransformation((long) (percent * 100), transformation);
BehaviorAnimation animation = new BehaviorAnimation(transformation);
child.startAnimation(animation);

代码示例来源:origin: nanchen2251/CoordinatorAppBarDemo

mAnimation.restrictDuration(100);
Transformation transformation = new Transformation();
mAnimation.getTransformation((long) (percent * 100), transformation);
BehaviorAnimation animation = new BehaviorAnimation(transformation);
child.startAnimation(animation);

代码示例来源:origin: org.robolectric/shadows-framework

@Override
 public void run() {
  // Abort if start time has been messed with, as this simulation is only designed to handle
  // standard situations.
  if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) &&
    animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ?
      SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) &&
      // We can't handle infinitely repeating animations in the current scheduling model,
      // so abort after one iteration.
      !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) {
   // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME
   startTime = animation.getStartTime();
   elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS;
   ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
  } else {
   animationRunner = null;
  }
 }
}

代码示例来源:origin: org.robolectric/shadows-core-v23

@Override
 public void run() {
  // Abort if start time has been messed with, as this simulation is only designed to handle
  // standard situations.
  if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) &&
    animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ?
      SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) &&
      // We can't handle infinitely repeating animations in the current scheduling model,
      // so abort after one iteration.
      !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) {
   // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME
   startTime = animation.getStartTime();
   elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS;
   ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
  } else {
   animationRunner = null;
  }
 }
}

代码示例来源:origin: org.robolectric/framework

@Override
 public void run() {
  // Abort if start time has been messed with, as this simulation is only designed to handle
  // standard situations.
  if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) &&
    animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ?
      SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) &&
      // We can't handle infinitely repeating animations in the current scheduling model,
      // so abort after one iteration.
      !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) {
   // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME
   startTime = animation.getStartTime();
   elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS;
   ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
  } else {
   animationRunner = null;
  }
 }
}

代码示例来源:origin: org.robolectric/shadows-core

@Override
 public void run() {
  // Abort if start time has been messed with, as this simulation is only designed to handle
  // standard situations.
  if ((animation.getStartTime() == startTime && animation.getStartOffset() == startOffset) &&
    animation.getTransformation(startTime == Animation.START_ON_FIRST_FRAME ?
      SystemClock.uptimeMillis() : (startTime + startOffset + elapsedTime), new Transformation()) &&
      // We can't handle infinitely repeating animations in the current scheduling model,
      // so abort after one iteration.
      !(animation.getRepeatCount() == Animation.INFINITE && elapsedTime >= animation.getDuration())) {
   // Update startTime if it had a value of Animation.START_ON_FIRST_FRAME
   startTime = animation.getStartTime();
   elapsedTime += ShadowChoreographer.getFrameInterval() / TimeUtils.NANOS_PER_MS;
   ShadowChoreographer.getInstance().postCallback(Choreographer.CALLBACK_ANIMATION, this, null);
  } else {
   animationRunner = null;
  }
 }
}

相关文章

微信公众号

最新文章

更多