Hello
im trying to animate my button from a point A to another point B. Between the point A and B the button should animate in the orbit of a bezier curve with a maximum point C (x,y)
Here is my code so far :
im trying to animate my button from a point A to another point B. Between the point A and B the button should animate in the orbit of a bezier curve with a maximum point C (x,y)
Here is my code so far :
public class CurvedAnimation extends Animation {
private Point start;
private Point end;
private Point middle;
private final float mFromXValue;
private final float mToXValue;
private final float mYValue;
private final int mFromXType;
private final int mToXType;
private final int mYType;
private final int mStartingY;
/**
* A translation along an arc defined by three points and a Bezier Curve
*
* @param duration - the time in ms it will take for the translation to complete
* @param fromXType - One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT.
* @param fromXValue - Change in X coordinate to apply at the start of the animation
* @param toXType - One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT.
* @param toXValue - Change in X coordinate to apply at the end of the animation
* @param yType - One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT.
* @param yValue - Change in Y coordinate to apply at the middle of the animation (the radius of the arc)
*/
public CurvedAnimation(long duration, int fromXType, float fromXValue,
int toXType, float toXValue, int yType, float yValue,int StartingY){
setDuration(duration);
mFromXValue = fromXValue;
mToXValue = toXValue;
mYValue = yValue;
mFromXType = fromXType;
mToXType = toXType;
mYType = yType;
mStartingY=StartingY;
}
/** Calculate the position on a quadratic bezier curve given three points
* and the percentage of time passed.
* from B