-
Notifications
You must be signed in to change notification settings - Fork 451
Position 3D Animation
Weiping Huang edited this page Apr 5, 2017
·
5 revisions
WoWoPosition3DAnimation changes x, y and z values of a view by method setX
, setY
and setZ
. But please notice that setZ
is available from Lollipop. So WoWoPosition3DAnimation is unable to change z value of a view below Lollipop. WoWoPosition3DAnimation is similar to WoWoPositionAnimation, so there is no example in the demo.
viewAnimation.add(WoWoPosition3DAnimation.builder().page(0)
.fromX(view.getX()).toX(0)
.fromY(view.getY()).toY(0)
.fromZ(view.getZ()).toZ(0)
.ease(ease).build());
As mentioned in WoWoPositionAnimation, we should add WoWoPosition3DAnimation in onWindowFocusChanged
method. Otherwise the value of view.getX()
maybe zero.
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
addAnimations();
}
private void addAnimations() {
// Prevent duplicate adding
if (animationAdded) return;
animationAdded = true;
// Add animations
}
WoWoPosition3DAnimation extends XYZPageAnimation and PageAnimation. Check more implementation details in its superclasses.
Basic Animations
- Position Animation
- Position 3D Animation
- Translation Animation
- Translation 3D Animation
- Scale Animation
- Alpha Animation
- Rotation Animation
- Elevation Animation
TextView Animations
Color Animations
- Background Color Animation
- Shape Color Animation
- State-List Color Animation
- Layer-List Color Animation
Interface Expansibility