Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handoff animation for Android developers?

I'm a designer and interested in different ways I can handoff animation to Android developers and the best ways to do that depending on a particular case.

1. JSON

I know Lottie works best for animating micro interactions and creating animated illustration, like those on onboarding pages. For a designer it's easy to provide JSON file since it can be generated with Bodymovin plugin in AfterEffects. Developer just gets the file and uses it as is, no more additional efforts for him.

2. Java or Kotlin

UI elements that require complex interaction are usually build with code, like BubblePicker since it has changeable content in those bubbles and different conditions how it can be interacted with. Since design tools don't generate production-ready code designers export video recording from tools like Principle, generate clickable prototypes in ProtoPie or other tools. Designers try different ways to show the idea of animation but in this case all the work is left for a developer.

3. XML

Don't know when developers use this type and if designers can provide it using export from some design tools.

What are other technologies developers use to create animations?

What type of files, prototypes designers should provide for the developer considering different cases?

like image 301
Peter Avatar asked Feb 10 '19 20:02

Peter


Video Answer


1 Answers

Android animation API is really diverse, meaning there are lots of ways a developer may choose to deliver an animation. I dare to say this should never be conditioned by the nature or limitations of the provided resources. Let's understand by resources anything that's not actual code: bitmap images, audio files, and even text. Knowing the file types or formats the developer can or wants to use involves communication and you can expect them not to be always the same.

Always provide a video of the animation, unless it can be described with a single word.

The most common animations in android are:

  1. Drawable animations. This type of animation usually happens inside a pre-defined area on the screen and is achieved by loading a series of images, one after the other. Here a common filetype would be PNG images, one for each step of the animation. Probably the same amount of different sprites you used for the video, never as many as 24/s! Keep in mind that to support different screen sizes and densities, different size/densities will have to be provided for each series. If the image is simple Vector Graphics would simplify the job for both the coder and the designer, regular SVGs are supported. One can also animate on the paths of the vector images, even morph between several of these, as long as the paths are compatible for morphing, which according to the documentation they must have the same number of commands and the same number of parameters for each command....this takes more understanding of the intrinsics of the vector file definitions, if you can see the image by reading the SVG code, go for it!

  2. Another major group comprises the animation (by acting on properties like color, position, size, etx) of the application UI elements. This type may or may not involve image resources, and are usually applied to components of pre-defined types. E.g.: all buttons should have a ripple effect starting where the pointer clicks. Android has pre-defined effects with particular names (flip, zoom), it could be useful to know this vocabulary.

  3. Finally, layout changes are animations that happen when you reorder things around to better convey information or hint the user towards actions. Similar to these are the Transitions, which happen when switching screens but can also be used to create animations that move images around, altering their positions and properties. They are really simple to implement and may require resource files of the same type as mentioned in 1

For reference, check the following which has some code but also illustrative examples: https://developer.android.com/training/animation/overview

To know how to support different screen sizes, check: https://developer.android.com/training/multiscreen/screensizes

To know more regarding SVG support in the Android platform: https://developer.android.com/studio/write/vector-asset-studio

like image 116
Eddie Lopez Avatar answered Oct 23 '22 16:10

Eddie Lopez