https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
d

Djuro

03/25/2024, 5:42 PM
Hi guys, hope you are all doing well. What arw you using for lottie animations in compose multiplatform. I stumbled upon a couple of libraries, compottie and kottie? Which one would you recommend? Did you have issues with any of these?
👀 1
a

Andrew Watson

03/25/2024, 7:13 PM
I actually just went through the process of trying both of these libraries out! Some pros & cons to each: Compottie • Uses Lottie on Android and Skottie on iOS • Both platforms support alpha transparency behind anim • Can end up with incompatible animations (I did, but eventually got it working) Kottie • Uses Lottie both iOS and Android • Alpha transparency behind anims only works with Android • Seems to wider animation compatibility TL;DR - if you don't need alpha transparency behind your anim use Kottie. Otherwise take your chances with Compottie. It's what I'm using right now and it's good
👍 2
d

Djuro

03/25/2024, 7:15 PM
By alpha transparency you mean the see-through effect?
a

Andrew Watson

03/25/2024, 7:15 PM
yeah
Like being able to "see through" your anmiation
d

Djuro

03/25/2024, 7:15 PM
Aha okay, dont need that at all honestly :D
a

Andrew Watson

03/25/2024, 7:16 PM
FWIW on iOS it also uses a UIKitView
That may or may not matter; not quite sure what skottie does, but I do know lottie has done a lot for perf improvements lately
d

Djuro

03/25/2024, 7:18 PM
I'm using compose multiplatform anyways, so it shouldnt really matter :D
Thank you andrww
a

Andrew Watson

03/25/2024, 7:18 PM
👍
d

Djuro

03/26/2024, 12:36 PM
@Andrew Watson Could you please tell me what do you use for managing your lottie file resoures, do you use compose multiplatform resources or something like that?
a

Andrew Watson

03/26/2024, 7:08 PM
Kottie takes care of things for you, so long as the json is in the files directory. In compottie you have load the file and get the string yourself. I personally just hard-coded the animations as strings in my build
d

Djuro

03/27/2024, 8:23 AM
I am doing it like that atm, but I think that approach is pretty bad tbh
better have it somewhere in assets
2 Views