Java Code Examples for android.animation.ValueAnimator#getAnimatedValue()

The following examples show how to use android.animation.ValueAnimator#getAnimatedValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnimProcessor.java    From TwinklingRefreshLayout with Apache License 2.0 6 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    int height = (int) animation.getAnimatedValue();
    if (cp.isOverScrollBottomShow()) {
        if (cp.getFooter().getVisibility() != VISIBLE) {
            cp.getFooter().setVisibility(VISIBLE);
        }
    } else {
        if (cp.getFooter().getVisibility() != GONE) {
            cp.getFooter().setVisibility(GONE);
        }
    }
    if (scrollBottomLocked && cp.isEnableKeepIView()) {
        transFooter(height);
    } else {
        cp.getFooter().getLayoutParams().height = height;
        cp.getFooter().requestLayout();
        cp.getFooter().setTranslationY(0);
        cp.onPullUpReleasing(height);
    }

    cp.getTargetView().setTranslationY(-height);
}
 
Example 2
Source File: IRecyclerView.java    From youqu_master with Apache License 2.0 6 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    final int height = (Integer) animation.getAnimatedValue();
    setRefreshHeaderContainerHeight(height);
    switch (mStatus) {
        case STATUS_SWIPING_TO_REFRESH: {
            mRefreshTrigger.onMove(false, true, height);
        }
        break;

        case STATUS_RELEASE_TO_REFRESH: {
            mRefreshTrigger.onMove(false, true, height);
        }
        break;

        case STATUS_REFRESHING: {
            mRefreshTrigger.onMove(true, true, height);
        }
        break;
    }

}
 
Example 3
Source File: LineFadeIndicator.java    From Dachshund-Tab-Layout with MIT License 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
    int startAlpha = 255 - (int) valueAnimator.getAnimatedValue();
    startColor = Color.argb(startAlpha, Color.red(originColor), Color.green(originColor), Color.blue(originColor) );

    int endAlpha = (int) valueAnimator.getAnimatedValue();
    endColor = Color.argb(endAlpha, Color.red(originColor), Color.green(originColor), Color.blue(originColor) );

    dachshundTabLayout.invalidate();
}
 
Example 4
Source File: BatteryProgressView.java    From BatteryProgressView with Apache License 2.0 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    float update = (float) (animation.getAnimatedValue());
    float incr=360/maxProgress;
    float value=(update/incr);
   // Log.e("update",value+"");
    progressUpdate=update;
    progressText=((int)value)+"";
    invalidate();
}
 
Example 5
Source File: ElectricFanLoadingRenderer.java    From DevUtils with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example 6
Source File: EyebrowsTranslateAnimator.java    From Eyebrows with MIT License 5 votes vote down vote up
@Override
protected UpdateEyebrowsListener createUpdateListener() {
    return new UpdateEyebrowsListener<EyebrowsShape>(){

        @Override
        public void onUpdate(EyebrowsShape eyebrowsShape, ValueAnimator animator) {
            float value = (float) animator.getAnimatedValue();
            if (direction.equals(Direction.LEFT_TO_RIGHT) || direction.equals(Direction.RIGHT_TO_LEFT)) {
                eyebrowsShape.setX(value);
            } else {
                eyebrowsShape.setY(value);
            }
        }
    };
}
 
Example 7
Source File: FlyoutMenuView.java    From FlyoutMenus with MIT License 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
	if (animation == menuAnimator) {
		menuOpenTransition = (float) animation.getAnimatedValue();
	} else if (animation == selectionAnimator) {
		selectionTransition = (float) animation.getAnimatedValue();
	}
	invalidate();
	if (menuOverlayView != null) {
		menuOverlayView.invalidate();
	}
}
 
Example 8
Source File: SlideAnimation.java    From Android-Image-Slider with Apache License 2.0 5 votes vote down vote up
private void onAnimateUpdated(@NonNull ValueAnimator animation) {
    int coordinate = (int) animation.getAnimatedValue(ANIMATION_COORDINATE);
    value.setCoordinate(coordinate);

    if (listener != null) {
        listener.onValueUpdated(value);
    }
}
 
Example 9
Source File: RefreshContentHorizontal.java    From SmartRefreshHorizontal with Apache License 2.0 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    int value = (int) animation.getAnimatedValue();
    try {
        if (mScrollableView instanceof AbsListView) {
            scrollListBy((AbsListView) mScrollableView, value - mLastSpinner);
        } else {
            mScrollableView.scrollBy(value - mLastSpinner, 0);
        }
    } catch (Throwable ignored) {
        //根据用户反馈,此处可能会有BUG
    }
    mLastSpinner = value;
}
 
Example 10
Source File: PinchImageView.java    From UGank with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 11
Source File: ViewAnimationUtils.java    From MHViewer with Apache License 2.0 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    Object value = animation.getAnimatedValue();
    if (value instanceof Float) {
        mReveal.setReveal(mCenterX, mCenterY, (Float) value);
    }
}
 
Example 12
Source File: PinchImageView.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@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();
}
 
Example 13
Source File: MTransition.java    From MTransition with Apache License 2.0 5 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    Log.e("lifecycle", "onAnimationUpdate : " + animation.getAnimatedValue());
    float progress = (float) animation.getAnimatedValue();
    mLastProgress = progress;
    long playTime = (long) (progress * getDuration());
    mFromPage.onTransitProgress(playTime, progress);
    mToPage.onTransitProgress(playTime, progress);
    if (mListener != null) {
        mListener.onTransitProgress(MTransition.this, mReversing, progress);
    }
}
 
Example 14
Source File: h.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void onAnimationUpdate(ValueAnimator valueanimator)
{
    CharSequence charsequence = (CharSequence)valueanimator.getAnimatedValue("Text");
    a.setText(charsequence);
}
 
Example 15
Source File: ProgressPieChart.java    From OXChart with Apache License 2.0 4 votes vote down vote up
/**动画值变化之后计算数据*/
@Override
protected void evaluatorData(ValueAnimator animation) {
    animPro = (float)animation.getAnimatedValue();
}
 
Example 16
Source File: AnimationManager.java    From AndroidPdfViewer with Apache License 2.0 4 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    float zoom = (Float) animation.getAnimatedValue();
    pdfView.zoomCenteredTo(zoom, new PointF(centerX, centerY));
}
 
Example 17
Source File: DashboardView.java    From OXChart with Apache License 2.0 4 votes vote down vote up
/**动画值变化之后计算数据*/
@Override
protected void evaluatorData(ValueAnimator animation) {
    animPro = (float)animation.getAnimatedValue()*progress;
}
 
Example 18
Source File: WebProgress.java    From ByWebView with Apache License 2.0 4 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    float t = (float) animation.getAnimatedValue();
    WebProgress.this.mCurrentProgress = t;
    WebProgress.this.invalidate();
}
 
Example 19
Source File: TalkingIndicatorView.java    From Plumble with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onAnimationUpdate(ValueAnimator animation) {
    mArcOffset = (float) animation.getAnimatedValue();
    invalidate();
}
 
Example 20
Source File: IconReleasePainter.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
@Override public void onAnimationUpdate(ValueAnimator animation) {
  iconXPosition = ((int) animation.getAnimatedValue()) - iconMargin + margin;
}