Skip to content

canerkaseler/jetpack-compose-lottie-animation

Repository files navigation

lottie_jetpack_compose copy

Lottie Animation and Jetpack Compose

This repository targets to show Lottie animation usage in Jetpack Compose UI for android development.

This repository has a Medium Article.

Description

The repository has two main parts. Part-A is using Lottie Animation in Jetpack Compose. Part-B is Managing Lottie Animation according to a business logic.

A) Using Lottie animation in Jetpack Compose:

  1. Add Lottie Animation and Dependencies into Android project
  2. Show Lottie Animation in Compose
  3. Show Specific Range of Lottie Animation in Compose

B) Managing Lottie animation in Compose:

  1. Stop Lottie Animation and show Success step in Compose
  2. Restart Lottie Animation in Compose
  3. Stop Lottie Animation and show Failure step in Compose

To continue reading about above parts, please check the Medium Article.

Results

1. Play full animation:

1_full_animation

2. Play just loading and success parts of the animation:

2_loading_success_infinite

3. Play loading and success parts of the animation for one time:

3_loading_success_one_time

4. Restart animation after loading and success parts:

4_loading_success_restart

5. Play loading, success, error parts of the animation:

5_end_sucess_error

Author

All social media and contact info is @canerkaseler

Buy Me A Coffee

License

Copyright [2023] [Caner Kaşeler]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.