Android Open Source - andQuery Circle Animation






From Project

Back to project page andQuery.

License

The source code is released under:

MIT License

If you think the Android project andQuery listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.codingg.andquery.Animation;
/*from   w w w .j av a2s.com*/
import android.graphics.Point;

/**
 * Created by sanjav on 1/24/15.
 */
public class CircleAnimation extends TrajectoryAnimation {
    float radius = 5;
    float angle = 0;

    public CircleAnimation(Point startPoint, float radius, float speed, float refinement) {
        super(startPoint, speed, refinement);
        this.radius = radius;
    }
    @Override
    public float getX(float currX, float currY) {
        double x = startPoint.x + (radius * Math.cos(Math.toRadians(angle)));
        angle += speed;
        if (angle == 360) angle = 0;

        return (float) x;
    }

    @Override
    public float getY(float currX, float currY) {
        double y = startPoint.y + (radius * Math.sin(Math.toRadians(angle)));
        return (float) y;
    }

    @Override
    public void onTerminate() {

    }
}




Java Source Code List

com.codingg.andquery.ApplicationTest.java
com.codingg.andquery.Animation.Animation.java
com.codingg.andquery.Animation.CircleAnimation.java
com.codingg.andquery.Animation.GameLoop.java
com.codingg.andquery.Animation.MoveAnimation.java
com.codingg.andquery.Animation.SpiralAnimation.java
com.codingg.andquery.Animation.TrajectoryAnimation.java
com.codingg.andquery.Animation.xView.xImageView.java