當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。