android.view.animation.Transformation.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(79)

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

Transformation.<init>介绍

暂无

代码示例

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

Transformation transformation = new Transformation() {

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

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

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

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

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

private Transformation transformation = new Transformation();

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

transformation = new Transformation();
matrix = m;
valid = true;

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

private Animation mAnimation;
private Transformation mTransformation = new Transformation();

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

Transformation blurTransformation = new Transformation() {
     @Override
     public Bitmap transform(Bitmap source) {
       Bitmap blurred = Blur.fastblur(MainActivity.this, source, 10);
       source.recycle();
       return blurred;
     }
     @Override
     public String key() {
       return "blur()";
     }
   };

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

Transformation transformation = new Transformation() {
@Override 
public Bitmap transform(Bitmap source) {

      int targetWidth = width;
      double aspectRatio = (double) source.getHeight() / (double) source.getWidth();
      int targetHeight = (int) (targetWidth  * aspectRatio);

      Bitmap result = Bitmap.createScaledBitmap(source, targetWidth, targetHeight, false);

      if (result != source) {
        // Same bitmap is returned if sizes are the same
        source.recycle();
      }

      return result;

    }

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

private Transformation blur = new Transformation() {
  @Override
  public Bitmap transform(Bitmap source) {
    Bitmap blurred = BitmapUtils.createBlurredBitmap(source);
    source.recycle();
    return blurred;
  }

  @Override
  public String key() {
    return "blurred";   //this will be added to the key that Picasso uses for caching
  }
};
//key: <uri>\nblurred
void loadAndBlur(Uri uri, ImageView mPhoto) {
    picasso.load(uri).transform(blur).into(mPhoto);
}
//key: <uri>
void load(Uri uri, ImageView mPhoto) {
    picasso.load(uri).into(mPhoto);
}

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

@Override
public void onAnimationEnd(Animation animation) {
      Transformation t = new Transformation();
      final float interpolatedTime = animation.getInterpolator().getInterpolation(animation.getDuration());
      Class params[] = {Float.TYPE, Transformation.class};
      try {

        Method m = mAnimationYouWantToGetFinalTransformationFrom.getClass().getDeclaredMethod("applyTransformation", params);
        m.setAccessible(true);
        m.invoke(mAnimationYouWantToGetFinalTransformationFrom, interpolatedTime, t);

        // update object to this final transformation matrix
        // For Example: mObjectMatrix = t.getMatrix();

        // run your next animation
      }  // Necessary Catch blocks

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

Transformation transform = new Transformation();
AlphaAnimation anim = new AlphaAnimation(0f, 1f);
anim.setDuration(1000);
anim.start();

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

Transformation outTransformation = new Transformation();
myAnimation.getTransformation(currentTime, outTransformation);
Matrix transformationMatrix = outTransformation.getMatrix();
float[] matrixValues = new float[9];
transformationMatrix.getValues(matrixValues);
float transX = matrixValues[Matrix.MTRANS_X];
float transY = matrixValues[Matrix.MTRANS_Y];

代码示例来源: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: com.github.japgolly.android.test/robolectric

/**
 * Non-Android accessor.  Use to simulate end of animation.
 */
public void invokeEnd() {
  if (listener != null) {
    listener.onAnimationEnd(realAnimation);
  }
  new ShadowAnimationBridge(realAnimation).applyTransformation(1.0f, new Transformation());
}

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

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

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

代码示例来源: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;
  }
 }
}

相关文章