Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interact with Lottie animation elements

Tags:

android

lottie

Using the Lottie Android library, is it possibly to let the user interact with elements of the animation that is being played?

Like, have a button in the animation (not a native button) and react to clicks on it?

like image 389
fweigl Avatar asked Jun 22 '26 19:06

fweigl


1 Answers

The json file is interpreted and outputs SVGs to the DOM. These can be assigned an eventhandler like any other element.

From Bodymovin:

name your layers in starting with a "." or a "#" and they will get exported with the name as a class or an id respectively.

like image 173
Jorgs Avatar answered Jun 24 '26 22:06

Jorgs