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

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

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

Transformation.setAlpha介绍

暂无

代码示例

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

@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    View view = mView.get();
    if (view != null) {
      t.setAlpha(mAlpha);
      transformMatrix(t.getMatrix(), view);
    }
  }
}

代码示例来源:origin: com.nineoldandroids/library

@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    View view = mView.get();
    if (view != null) {
      t.setAlpha(mAlpha);
      transformMatrix(t.getMatrix(), view);
    }
  }
}

代码示例来源:origin: kakajika/FragmentAnimations

t.setAlpha(mAlpha);

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

protected void applyTransformation(float interpolatedTime, Transformation t) {
  final float alpha = mFromAlpha;
  t.setAlpha(alpha + ((mToAlpha - alpha) * interpolatedTime));

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

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

代码示例来源:origin: leeowenowen/beauty-of-math

@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    View view = mView.get();
    if (view != null) {
      t.setAlpha(mAlpha);
      transformMatrix(t.getMatrix(), view);
    }
  }
}

代码示例来源:origin: Android500/AwesomeDrawer

@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    View view = mView.get();
    if (view != null) {
      t.setAlpha(mAlpha);
      transformMatrix(t.getMatrix(), view);
    }
  }
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  View view = mView.get();
  if (view != null) {
    t.setAlpha(mAlpha);
    transformMatrix(t.getMatrix(), view);
  }
}

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  View view = mView.get();
  if (view != null) {
    t.setAlpha(mAlpha);
    transformMatrix(t.getMatrix(), view);
  }
}

代码示例来源:origin: qq8585083/DragIcon

@Override
  protected void applyTransformation(float interpolatedTime, Transformation t) {
    View view = mView.get();
    if (view != null) {
      t.setAlpha(mAlpha);
      transformMatrix(t.getMatrix(), view);
    }
  }
}

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

/**
* Signal to this animation that a layout pass has caused the View on which this animation is
* running to have its "top" coordinate changed.
*
* @param change
* the difference in pixels
*/
public void changeYOffset(int change) {
  fromY -= change;
  toY -= change;
}

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
  float reverseTime = 1f - interpolatedTime;

  float dy = (interpolatedTime * toY) + (reverseTime * fromY);
  float alpha = (interpolatedTime * toAlpha) + (reverseTime * fromAlpha);

  if (alpha > 1f) {
    alpha = 1f;
  }
  else if (alpha < 0f) {
    alpha = 0f;
  }

  t.setAlpha(alpha);
  t.getMatrix().setTranslate(0f, dy);
}

代码示例来源:origin: ksvc/KSYMediaPlayer_Android

@Override
  protected void applyTransformation(float factor, Transformation transformation) {
    Matrix matrix = transformation.getMatrix();
    mPm.getMatrix(mDistance * factor, matrix, PathMeasure.POSITION_MATRIX_FLAG);
    mView.setRotation(mRotation * factor);
    float scale = 1F;
    if (3000.0F * factor < 200.0F) {
      scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    } else if (3000.0F * factor < 300.0F) {
      scale = scale(factor, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);
    }
    mView.setScaleX(scale);
    mView.setScaleY(scale);
    transformation.setAlpha(1.0F - factor);
  }
}

代码示例来源:origin: zhaoyang21cn/iLiveSDK_Android_Suixinbo

@Override
  protected void applyTransformation(float factor, Transformation transformation) {
    Matrix matrix = transformation.getMatrix();
    mPm.getMatrix(mDistance * factor, matrix, PathMeasure.POSITION_MATRIX_FLAG);
    mView.setRotation(mRotation * factor);
    float scale = 1F;
    if (3000.0F * factor < 200.0F) {
      scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    } else if (3000.0F * factor < 300.0F) {
      scale = scale(factor, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);
    }
    mView.setScaleX(scale);
    mView.setScaleY(scale);
    transformation.setAlpha(1.0F - factor);
  }
}

代码示例来源:origin: qiushi123/love

@Override
  protected void applyTransformation(float factor, Transformation transformation) {
    Matrix matrix = transformation.getMatrix();
    mPm.getMatrix(mDistance * factor, matrix, PathMeasure.POSITION_MATRIX_FLAG);
    mView.setRotation(mRotation * factor);
    float scale = 1F;
    if (3000.0F * factor < 200.0F) {
      scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    } else if (3000.0F * factor < 300.0F) {
      scale = scale(factor, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);
    }
    mView.setScaleX(scale);
    mView.setScaleY(scale);
    transformation.setAlpha(1.0F - factor);
  }
}

代码示例来源:origin: rongcloud/demo-app-imlib-live-chatroom-android

@Override
  protected void applyTransformation(float factor, Transformation transformation) {
    Matrix matrix = transformation.getMatrix();
    mPm.getMatrix(mDistance * factor, matrix, PathMeasure.POSITION_MATRIX_FLAG);
    mView.setRotation(mRotation * factor);
    float scale = 1F;
    if (3000.0F * factor < 200.0F) {
      scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    } else if (3000.0F * factor < 300.0F) {
      scale = scale(factor, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);
    }
    mView.setScaleX(scale);
    mView.setScaleY(scale);
    transformation.setAlpha(1.0F - factor);
  }
}

代码示例来源:origin: yuerLoveCoding/MyShowHonorSimple

@Override
  protected void applyTransformation(float factor, Transformation transformation) {
    Matrix matrix = transformation.getMatrix();
    mPm.getMatrix(mDistance * factor, matrix, PathMeasure.POSITION_MATRIX_FLAG);
    mView.setRotation(mRotation * factor);
    float scale = 1F;
    //scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    if (3000.0F * factor < 200.0F) {
      scale = scale(factor, 0.0D, 0.06666667014360428D, 0.20000000298023224D, 1.100000023841858D);
    } else if (3000.0F * factor < 300.0F) {
      scale = scale(factor, 0.06666667014360428D, 0.10000000149011612D, 1.100000023841858D, 1.0D);
    }
    mView.setScaleX(scale);
    mView.setScaleY(scale);
    transformation.setAlpha(1.0F - factor);
  }
}

代码示例来源:origin: PopFisher/AndroidRotateAnim

t.setAlpha(fAlphaRate + (1.0f-fAlphaRate)* interpolatedTime );
else
  t.setAlpha(1.0f - fAlphaRate* interpolatedTime );

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

t.setAlpha(alphaAmount);

相关文章