本文整理匯總了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();
}
}