本文整理汇总了Java中android.animation.ValueAnimator.getAnimatedFraction方法的典型用法代码示例。如果您正苦于以下问题:Java ValueAnimator.getAnimatedFraction方法的具体用法?Java ValueAnimator.getAnimatedFraction怎么用?Java ValueAnimator.getAnimatedFraction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.ValueAnimator
的用法示例。
在下文中一共展示了ValueAnimator.getAnimatedFraction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (view.getLayoutParams() != null) {
ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
TimeInterpolator interpolator = animation.getInterpolator();
float fraction = animation.getAnimatedFraction();
if (width != null) {
layoutParams.width = intEvaluator.evaluate(interpolator.getInterpolation(fraction),
width.first,
width.second);
}
if (height != null) {
layoutParams.height = intEvaluator.evaluate(interpolator.getInterpolation(fraction),
height.first,
height.second);
}
view.requestLayout();
}
}
示例2: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if (DEBUG) {
log("Animation update "
+ animation.getAnimatedFraction() + " on: "
+ Thread.currentThread().getName());
}
mBackgroundFraction = animation.getAnimatedFraction();
// propagate the animation event to all listeners
for (ValueAnimator.AnimatorUpdateListener listener : mAnimationListenerCache) {
listener.onAnimationUpdate(animation);
}
// animation updates occur on the main thread. it is save to call invalidate here.
PieLayout.this.invalidate();
}
示例3: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = animation.getAnimatedFraction();
float diffLeft = (targetViewport.left - startViewport.left) * scale;
float diffTop = (targetViewport.top - startViewport.top) * scale;
float diffRight = (targetViewport.right - startViewport.right) * scale;
float diffBottom = (targetViewport.bottom - startViewport.bottom) * scale;
newViewport.set(startViewport.left + diffLeft, startViewport.top + diffTop, startViewport.right + diffRight,
startViewport.bottom + diffBottom);
chart.setCurrentViewport(newViewport);
}
示例4: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int alpha = (int) (255 * animation.getAnimatedFraction());
mClockPaint.setAlpha(alpha);
mInfoPaint.setAlpha(alpha);
// if we are going to get displayed update data
if (alpha > 0 && mStaleData) {
updateData();
mStaleData = false;
}
}
示例5: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
PointF point = (PointF) animation.getAnimatedValue();
target.mLeafRect.set((int) point.x, (int) point.y,
(int) (point.x + mLeafDrawable.getIntrinsicWidth()), (int) (point.y + mLeafDrawable.getIntrinsicHeight()));
target.mLeafRotation = target.mMaxRotation * animation.getAnimatedFraction();
}
示例6: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float t = animation.getAnimatedFraction();
if (t > mAnimationTimeFraction) {
t = 1;
} else {
t = t / mAnimationTimeFraction;
}
final DragView dragView = (DragView) mDragLayer.getAnimatedView();
final float time = t * mDuration;
dragView.setTranslationX(time * mUX + mFrom.left + mAX * time * time / 2);
dragView.setTranslationY(time * mUY + mFrom.top + mAY * time * time / 2);
dragView.setAlpha(1f - mAlphaInterpolator.getInterpolation(t));
}
示例7: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final float value=animation.getAnimatedFraction();
// Gets the point at the fractional path length
pathMeasure.getPosTan(pathMeasure.getLength() * value, point, null);
// Sets view location to the above point
target.setTranslationX(point[0]);
target.setTranslationY(point[1]);
}
示例8: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float fraction = valueAnimator.getAnimatedFraction();
double lat = (to.getLatitude() - from.getLatitude()) * fraction + from.getLatitude();
double lngDelta = to.getLongitude() - from.getLongitude();
// Take the shortest path across the 180th meridian.
if (Math.abs(lngDelta) > 180) {
lngDelta -= Math.signum(lngDelta) * 360;
}
double lng = lngDelta * fraction + from.getLongitude();
LatLng position = new LatLng(lat, lng);
marker.setPosition(position);
}
示例9: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
final float fraction = animation.getAnimatedFraction();
final int direction = (int) (fromDirection + directionDiff * fraction);
final int rotateDegree = (int) (fromDegree + (MAX_ROTATE_DEGREE - fromDegree) * fraction);
mSphereLayout.rotate(direction, rotateDegree);
mState.direction = direction;
mState.rotateDegree = rotateDegree;
}
示例10: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float scale = animation.getAnimatedFraction();
float rotation = startRotation + (targetRotation - startRotation) * scale;
rotation = (rotation % 360 + 360) % 360;
chart.setChartRotation((int) rotation, false);
}
示例11: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float fraction = valueAnimator.getAnimatedFraction();
double lat = (to.latitude - from.latitude) * fraction + from.latitude;
double lngDelta = to.longitude - from.longitude;
// Take the shortest path across the 180th meridian.
if (Math.abs(lngDelta) > 180) {
lngDelta -= Math.signum(lngDelta) * 360;
}
double lng = lngDelta * fraction + from.longitude;
LatLng position = new LatLng(lat, lng);
marker.setPosition(position);
}
示例12: 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);
}
}
示例13: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mOpenAnimationProgress = valueAnimator.getAnimatedFraction();
}
示例14: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mLastUpdatedAnimation = animation;
mLastAnimatedFraction = animation.getAnimatedFraction();
updateAnimation(mLastUpdatedAnimation, mLastAnimatedFraction);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:ToolbarProgressBarAnimatingView.java
示例15: onAnimationUpdate
import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator animation) {
this.animatedFraction = animation.getAnimatedFraction();
invalidateElement();
}