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

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

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

Transformation.clear介绍

暂无

代码示例

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

throw new RuntimeException(detailMessage);
transformation.clear();
animation = a;
if (a != null) {

代码示例来源:origin: BCsl/TwoWayGallery

@Override
protected boolean getChildStaticTransformation(View child, Transformation t) {
  t.clear();
  t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha);
  return true;
}

代码示例来源:origin: wuzhendev/android-wgallery

@Override
protected boolean getChildStaticTransformation(View child, Transformation t) {
  t.clear();
  t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha);
  return true;
}

代码示例来源:origin: souliss/soulissapp

@Override
protected boolean getChildStaticTransformation(View child, Transformation t) {
  t.clear();
  t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha);
  return true;
}

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

protected boolean getChildStaticTransformation(View child, Transformation t) {
  t.clear();
  t.setTransformationType(Transformation.TYPE_MATRIX);
  final Matrix matrix = t.getMatrix();
  float childCenterPos = child.getLeft() + (child.getWidth() / 2f);
  float center = getWidth() / 2;
  float diff = Math.abs(center - childCenterPos);
  float scale = diff / getWidth();

  matrix.setScale(1 - (scale), 1 - (scale));

  return true;
}

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

protected boolean getChildStaticTransformation(View child, Transformation t) {
       child.invalidate(); // add this line
       final int childCenter = getCenterOfView(child);
       final int childWidth = child.getWidth();
       int rotationAngle = 0;
       t.clear();
       t.setTransformationType(Transformation.TYPE_MATRIX);
       if (childCenter == mCoveflowCenter) {
           transformImageBitmap((ImageView) child, t, 0); 
       } else {
           rotationAngle = (int) (((float) (mCoveflowCenter - childCenter) / childWidth) * mMaxRotationAngle);
           if (Math.abs(rotationAngle) > mMaxRotationAngle) {
               rotationAngle = (rotationAngle < 0) ? -mMaxRotationAngle
                       : mMaxRotationAngle;
           }   
           transformImageBitmap((ImageView) child, t, rotationAngle);
       }   
       return true;
   }

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

@Override
 protected boolean getChildStaticTransformation(View child, Transformation t) {
   Matrix matrix = t.getMatrix();
     int centerX = (child.getWidth() / 2);
     int centerY = (child.getHeight() / 2);
   t.clear();
   t.setTransformationType(Transformation.TYPE_MATRIX);
   mCamera.save();
   if (child == getChildAt(0)) {
     mCamera.translate(pixels to the right,pixels to the bottom,
         to the z axis);
     mCamera.getMatrix(matrix);
     mCamera.restore();
     matrix.preTranslate(-centerX, -centerY);
     matrix.postTranslate(centerX, centerY);
   } 
   return true;
 }

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

protected boolean getChildStaticTransformation
  (View child, Transformation transformation) {

  transformation.clear();
  transformation.setTransformationType(Transformation.TYPE_MATRIX);

  // Center of the item
  float centerX = (float)child.getWidth()/2, centerY = (float)child.getHeight()/2;

  // Save camera
  mCamera.save();

  // Translate the item to it's coordinates
  final Matrix matrix = transformation.getMatrix();
  mCamera.translate(((CarouselImageView)child).getX(), 
        ((CarouselImageView)child).getY(), 
        ((CarouselImageView)child).getZ());

  // Align the item
  mCamera.getMatrix(matrix);
  matrix.preTranslate(-centerX, -centerY);
  matrix.postTranslate(centerX, centerY);

  // Restore camera
  mCamera.restore();      

  return true;
}

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

protected boolean getChildStaticTransformation(final View child, final Transformation t)
  t.clear();
  t.setTransformationType(Transformation.TYPE_MATRIX);
  final Matrix m = t.getMatrix();

代码示例来源:origin: BCsl/TwoWayGallery

float distance = Math.abs(childCenter - coverFlowCenter);
boolean bottomOfCenter = childCenter - coverFlowCenter >= 0 ? true : false;
t.clear();
mVerticalMatrix = t.getMatrix();
float w = childWidth;
boolean rightOfCenter = childCenter - coverFlowCenter >= 0 ? true : false;
t.clear();
mHorizontalMatrix = t.getMatrix();

代码示例来源:origin: xingkongus/superXingPostCard

t.clear();
t.setTransformationType(Transformation.TYPE_BOTH);

代码示例来源:origin: iamvaliyev/MultiTabMenu

t.clear();
t.setTransformationType(Transformation.TYPE_BOTH);

代码示例来源:origin: Janseon/CardMenuView

private boolean applyTransformation() {
  mTransformation.clear();
  mTransformation.setTransformationType(Transformation.TYPE_MATRIX);
  final Matrix matrix = mTransformation.getMatrix();
  final int layoutHeight = getHeight();
  final int currY = getScrollY();
  final float effectsAmount = currY / (float) layoutHeight;
  if (effectsAmount == 0f) {
    return false;
  }
  float degrees = maxRotation * effectsAmount;
  final Camera camera = mCamera;
  camera.save();
  camera.rotateX(degrees);
  camera.getMatrix(matrix);
  camera.restore();
  final float centerX = getWidth() / 2;
  matrix.preTranslate(-centerX, 0);
  matrix.postTranslate(centerX, 0);
  return true;
}

代码示例来源:origin: dalong982242260/CarrouselView

protected boolean getChildStaticTransformation(View child, Transformation transformation) {
  transformation.clear();
  transformation.setTransformationType(Transformation.TYPE_MATRIX);

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

final boolean isFirstOrLast = position == 0 || (position == getAdapter().getCount() - 1);
if (overscrollEffect.isOverScrolling() && isFirstOrLast) {
  t.clear();
  t.setTransformationType(Transformation.TYPE_MATRIX);

相关文章