Android O feature spotlight: Get quick access to an app's widgets by long-pressing the icon
Android O feature spotlight: Night Light gets a slider to control how intense you want it to be
Android O feature spotlight: More natural movement with physics-based animations
Android O feature spotlight: Developer Preview 2 adds a Bluetooth AVRCP version selector
Android O feature spotlight: Google explains the new actionable battery menu
- View All 56 Articles In This Series
Animations in apps can often be jerky or unrealistic, but in Android O Google plans to give developers tools to make animations buttery smooth and natural with the power of physics. It should also be much simpler to make animations with this system.
The flick animation
Right now, the Animator class is used to create animations, but they tend to look static and jerky. For a complex movement, you have to define one animation, cancel it, and define a new one each time you change direction. It can end up looking disjointed and mechanical.
The spring animation
By contrast, the new physics-based animations are driven by an API. Changes in direction are defined by simulated force, which the developer describes with new classes like SpringForce and FlingAnimation. With FlingAnimation, developers can input values for friction, velocity, and range. When using SpringForce, the dev feeds in things like start velocity, stiffness, and dampening.
Left: Old, Right: New physics-based
The GIFs above show the stark difference when you use the new physics-based tools compared to the old Animator class. The physics-based animation has realistic momentum, and the old version loses all its momentum and changes direction in an unnatural way.