Skip to content

kimtaesu/Lottie

Repository files navigation

Lottie for Android


Lottie란?

프로젝트를 진행하면서 종종 발생하는 케이스를 예를 들어 이야기해보겠습니다. 디자이너는 종종 앱에 엄청난 효과의 애니메이션을 넣고 싶어 하죠. 그러면 개발자는 OutofMemory등 메모리 이슈나 애니메이션 개발의 어려움을 말하면서 안된다고 거절하곤 합니다. 하지만 개발자가 아무리 잘 설명해도 둘 사이의 간극은 좁혀지지 않습니다.

Facebook Keyframes v.s. airbnb Lottie

Note: 초당 24프레임 이상이 필요하며 화면 전체의 크기 애니메이션을 초당 24장으로 2초 분량을 만든다면 장당 750 * 1334 * 4로 계산해서 4Mb 메모리가 필요하므로 가용 메모리 총량은 192Mb, 약 200Mb가 필요하게 됩니다. 일반적인 저사양 안드로이드 기기에서는 OOM이 발생하게 되겠죠.

History

Facebook Keyframes v.s. airbnb Lottie

Usage

build.gradle

dependencies {  
  compile 'com.airbnb.android:lottie:2.1.0'
}

activity_main.xml

<com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animation_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:lottie_fileName="hello-world.json"
        app:lottie_loop="true"
        app:lottie_autoPlay="true" />

NOTE Android API 14 (ICS) 부터 사용해야 합니다. 또 일부 단말에서 OutOfMemory가 발생할 수 있습니다.

참고

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published