Learn how to build animation in android, used rocket animation as example (Android)
These app show animations can calculate the nearest neighbor coordinate using euclidian distance equation, given some coordinate in ArrayList then system will calculate distance each coordinate with current location. in this project there is 4 main class:
- Coordinates (Object Class for coordinates with its attributes: place, latitude, longitude)
- Distances (Object Class for distances with its attributes: name, distances)
- DummyActivity (tha main activity)
- DummyCoordinates (contain some main method to calculate distance, calculate nearest distance, add market, etc)
you need to import ValueAnimator to make this rocket animation
import android.animation.ValueAnimator;
then you make class that extend BaseAnimationActivity, it will generate Override method onAnimationUpadte, put that method inside ValueAnimator.addUpdateListener example:
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
mRocket.setTranslationY(value);
}
});
- IDE - Android Studio 2.1.3
- Operating System - Ubuntu
- Artem Kholodnyi
- Marchellin Antonia
- the animation list
* the rocket first state