当前位置: 首页>>代码示例>>Java>>正文


Java ValueAnimator.getAnimatedFraction方法代码示例

本文整理汇总了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();
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:20,代码来源:DimensionUpdateListener.java

示例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();
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:19,代码来源:PieLayout.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:ChartViewportAnimatorV14.java

示例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;
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:13,代码来源:PieSysInfo.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ElectricFanLoadingRenderer.java

示例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));
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:15,代码来源:FlingAnimation.java

示例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]);
}
 
开发者ID:vpaliyX,项目名称:Material-Motion,代码行数:11,代码来源:BaseFragment.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-plugins-android,代码行数:15,代码来源:DefaultClusterRenderer.java

示例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;
}
 
开发者ID:thunderpunch,项目名称:SphereLayout,代码行数:10,代码来源:SLTouchListener.java

示例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);
}
 
开发者ID:huashengzzz,项目名称:SmartChart,代码行数:8,代码来源:PieChartRotationAnimatorV14.java

示例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);
}
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:15,代码来源:DefaultClusterRenderer.java

示例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);
    }
}
 
开发者ID:sujithkanna,项目名称:SmileyRating,代码行数:14,代码来源:SmileRating.java

示例13: onAnimationUpdate

import android.animation.ValueAnimator; //导入方法依赖的package包/类
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
    mOpenAnimationProgress = valueAnimator.getAnimatedFraction();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:5,代码来源:PopupItemView.java

示例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();
}
 
开发者ID:ABTSoftware,项目名称:SciChart.Android.Examples,代码行数:6,代码来源:AnimatingLineChartFragment.java


注:本文中的android.animation.ValueAnimator.getAnimatedFraction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。