Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lottieアニメーションをカスタマイズしてみた

Tiphaine
January 31, 2025

 Lottieアニメーションをカスタマイズしてみた

Shibuya.apk #51 - 31/01/2025
https://shibuya-apk.connpass.com/event/342351/

Mobile Dev Japanで話した内容の英語版:
https://speakerdeck.com/tahia910/customize-your-lottie-animations

アニメーションが動かないため、分かりにくいところはグーグルスライドでご確認ください:
https://docs.google.com/presentation/d/1PUkRMoOuc_7bWjBmGXFNVYZnBGeYHrq2C6oQABfxxsA/

Tiphaine

January 31, 2025
Tweet

More Decks by Tiphaine

Other Decks in Programming

Transcript

  1. 14

  2. 23 val context = LocalContext.current val customView = remember {

    LottieAnimationView(context) } AndroidView({ customView }) { view -> with(view) { setAnimation(R.raw.thanks) // これの結果をprintしたい view.resolveKeyPath(KeyPath("**")) } }
  3. 25

  4. 26

  5. 27

  6. 31 val dynamicProperties = rememberLottieDynamicProperties( rememberLottieDynamicProperty(...), ... ) Step 4:

    rememberLottieDynamicPropert ies の中に DynamicPropertyをwrapする
  7. 32 LottieAnimation( composition = composition, iterations = LottieConstants.IterateForever, dynamicProperties =

    dynamicProperties, ) Step 5: LottieAnimation 引数として DynamicPropertiesを渡す