Java Code Examples for com.github.mikephil.charting.animation.Easing#EasingOption

The following examples show how to use com.github.mikephil.charting.animation.Easing#EasingOption . 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: PieRadarChartBase.java    From android-kline with Apache License 2.0 6 votes vote down vote up
/**
 * Applys a spin animation to the Chart.
 *
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
Example 2
Source File: PieRadarChartBase.java    From NetKnight with Apache License 2.0 6 votes vote down vote up
/**
 * Applys a spin animation to the Chart.
 * 
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
Example 3
Source File: PieRadarChartBase.java    From iMoney with Apache License 2.0 6 votes vote down vote up
/**
 * Applys a spin animation to the Chart.
 * 
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
Example 4
Source File: PieRadarChartBase.java    From Ticket-Analysis with MIT License 6 votes vote down vote up
/**
 * Applys a spin animation to the Chart.
 *
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
Example 5
Source File: PieRadarChartBase.java    From Stayfit with Apache License 2.0 6 votes vote down vote up
/**
 * Applys a spin animation to the Chart.
 * 
 * @param durationmillis
 * @param fromangle
 * @param toangle
 */
@SuppressLint("NewApi")
public void spin(int durationmillis, float fromangle, float toangle, Easing.EasingOption easing) {

    if (android.os.Build.VERSION.SDK_INT < 11)
        return;

    setRotationAngle(fromangle);

    ObjectAnimator spinAnimator = ObjectAnimator.ofFloat(this, "rotationAngle", fromangle,
            toangle);
    spinAnimator.setDuration(durationmillis);
    spinAnimator.setInterpolator(Easing.getEasingFunctionFromOption(easing));

    spinAnimator.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            postInvalidate();
        }
    });
    spinAnimator.start();
}
 
Example 6
Source File: Chart.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing a predefined easing option
 */
public void animateX(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateX(durationMillis, easing);
}
 
Example 7
Source File: Chart.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the y-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateY(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateY(durationMillis, easing);
}
 
Example 8
Source File: Chart.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateX(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateX(durationMillis, easing);
}
 
Example 9
Source File: Chart.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
 * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX         a predefined easing option
 * @param easingY         a predefined easing option
 */
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
                      Easing.EasingOption easingY) {
    mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
 
Example 10
Source File: Chart.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the y-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateY(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateY(durationMillis, easing);
}
 
Example 11
Source File: Chart.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateX(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateX(durationMillis, easing);
}
 
Example 12
Source File: Chart.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
 * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX         a predefined easing option
 * @param easingY         a predefined easing option
 */
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
                      Easing.EasingOption easingY) {
    mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
 
Example 13
Source File: Chart.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the y-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing a predefined easing option
 */
public void animateY(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateY(durationMillis, easing);
}
 
Example 14
Source File: Chart.java    From iMoney with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
 * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX a predefined easing option
 * @param easingY a predefined easing option
 */
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
        Easing.EasingOption easingY) {
    mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
 
Example 15
Source File: Chart.java    From android-kline with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the y-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateY(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateY(durationMillis, easing);
}
 
Example 16
Source File: Chart.java    From android-kline with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateX(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateX(durationMillis, easing);
}
 
Example 17
Source File: Chart.java    From android-kline with Apache License 2.0 2 votes vote down vote up
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
 * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX         a predefined easing option
 * @param easingY         a predefined easing option
 */
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
                      Easing.EasingOption easingY) {
    mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}
 
Example 18
Source File: Chart.java    From Ticket-Analysis with MIT License 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the y-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateY(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateY(durationMillis, easing);
}
 
Example 19
Source File: Chart.java    From Ticket-Analysis with MIT License 2 votes vote down vote up
/**
 * Animates the rendering of the chart on the x-axis with the specified
 * animation time. If animate(...) is called, no further calling of
 * invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR
 * API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillis
 * @param easing         a predefined easing option
 */
public void animateX(int durationMillis, Easing.EasingOption easing) {
    mAnimator.animateX(durationMillis, easing);
}
 
Example 20
Source File: Chart.java    From Ticket-Analysis with MIT License 2 votes vote down vote up
/**
 * Animates the drawing / rendering of the chart on both x- and y-axis with
 * the specified animation time. If animate(...) is called, no further
 * calling of invalidate() is necessary to refresh the chart. ANIMATIONS
 * ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.
 *
 * @param durationMillisX
 * @param durationMillisY
 * @param easingX         a predefined easing option
 * @param easingY         a predefined easing option
 */
public void animateXY(int durationMillisX, int durationMillisY, Easing.EasingOption easingX,
                      Easing.EasingOption easingY) {
    mAnimator.animateXY(durationMillisX, durationMillisY, easingX, easingY);
}