本文整理汇总了Java中android.animation.ValueAnimator.getAnimatedValue方法的典型用法代码示例。如果您正苦于以下问题:Java ValueAnimator.getAnimatedValue方法的具体用法?Java ValueAnimator.getAnimatedValue怎么用?Java ValueAnimator.getAnimatedValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.ValueAnimator
的用法示例。
在下文中一共展示了ValueAnimator.getAnimatedValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
View currentTabView = mTabsContainer.getChildAt(this.mCurrentTab);
IndicatorPoint p = (IndicatorPoint) animation.getAnimatedValue();
mIndicatorRect.left = (int) p.left;
mIndicatorRect.right = (int) p.right;
if (mIndicatorWidth < 0) { //indicatorWidth小于0时,原jpardogo's PagerSlidingTabStrip
} else {//indicatorWidth大于0时,圆角矩形以及三角形
float indicatorLeft = p.left + (currentTabView.getWidth() - mIndicatorWidth) / 2;
mIndicatorRect.left = (int) indicatorLeft;
mIndicatorRect.right = (int) (mIndicatorRect.left + mIndicatorWidth);
}
invalidate();
}
示例2: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
//获取动画进度
float value = (Float) animation.getAnimatedValue();
//根据动画进度计算矩阵中间插值
for (int i = 0; i < 9; i++) {
mResult[i] = mStart[i] + (mEnd[i] - mStart[i]) * value;
}
//设置矩阵并重绘
mOuterMatrix.setValues(mResult);
dispatchOuterMatrixChanged();
invalidate();
}
示例3: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
final float value = (float) valueAnimator.getAnimatedValue();
SpannableStringBuilder builder = new SpannableStringBuilder(text);
for (int i = 0; i < text.length(); i++) {
builder.setSpan(new ForegroundColorSpan(Color.argb(clamp(value + alphas[i]), red, green, blue)), i, i + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
setText(builder);
}
示例4: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
IndicatorPoint p = (IndicatorPoint) animation.getAnimatedValue();
mIndicatorRect.left = (int) p.left;
mIndicatorRect.right = (int) p.right;
invalidate();
}
示例5: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(final ValueAnimator valueAnimator) {
// If the user is changing the slider, cancel the animation.
if (mIsTracking) {
valueAnimator.cancel();
return;
}
final int animatedIntValue = (int) valueAnimator.getAnimatedValue();
setProgress(animatedIntValue);
}
示例6: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (mSmileyNotSelectedPreviously) {
mMainSmileyTransformaFraction = animation.getAnimatedFraction();
if (NONE == mSelectedSmile) {
mMainSmileyTransformaFraction = 1f - mMainSmileyTransformaFraction;
}
invalidate();
} else {
float anim = (float) animation.getAnimatedValue();
moveSmile(anim);
}
}
示例7: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float update = (float) (animation.getAnimatedValue());
float incr = 360 / maxProgress;
float value = (update / incr);
progressUpdate = update;
progressText = ((int) value) + "";
invalidate();
}
示例8: startValueAnimator
import android.animation.ValueAnimator; //导入方法依赖的package包/类
protected ValueAnimator startValueAnimator(ValueAnimator valueAnimator, float targetValue) {
float originValue = targetValue;
if (valueAnimator != null) {
valueAnimator.cancel();
originValue = (float) valueAnimator.getAnimatedValue();
}
valueAnimator = ValueAnimator.ofFloat(originValue, targetValue);
valueAnimator.setDuration(200);
valueAnimator.start();
return valueAnimator;
}
示例9: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
iconYPosition = (int) animation.getAnimatedValue();
}
示例10: onAnimatorUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
protected void onAnimatorUpdate(ValueAnimator animator) {
degree = (float) animator.getAnimatedValue();
postInvalidate();
}
示例11: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mAnimateValue = (int) animation.getAnimatedValue();
invalidate();
}
示例12: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
iconXPosition = ((int) animation.getAnimatedValue()) - iconMargin + margin;
}
示例13: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mIndeterminateSweepAngle = (float) animation.getAnimatedValue();
}
示例14: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float zoom = (Float) animation.getAnimatedValue();
pdfView.zoomCenteredTo(zoom, new PointF(pdfView.getWidth() / 2, pdfView.getHeight() / 2));
}
示例15: updateAnimationFor
import android.animation.ValueAnimator; //导入方法依赖的package包/类
private void updateAnimationFor(ValueAnimator animation, TextView v) {
if (isAttachedToHierarchy(v)) {
shift = (int) animation.getAnimatedValue();
v.invalidate();
}
}