0

I'm not even sure if it is called animation but I couldn't find it anywhere.

In my application, I want to give a star to the users once they finish some activity.

I want to make some animation that will look like this:

https://dribbble.com/shots/2795344-Jump-jump

How can I do something like this on android?

I see different applications in my device that have cool animations and cant figure out how it is done.

Of course, it doesn't have to be that star but anything that will give the same feeling.

Thank you

Ben
  • 1,737
  • 2
  • 30
  • 61
  • 1
    One way would be to create a Lottie animation and use the [lottie android library](https://github.com/airbnb/lottie-android) to show it. – Michael Krause Jun 04 '21 at 22:05
  • 1
    An easy solution is using GIFs. check https://stackoverflow.com/questions/6533942/adding-gif-image-in-an-imageview-in-android – FelipeCruzV10 Jun 04 '21 at 22:05

2 Answers2

1

You can use Lottie to have sucn an amazing animation ,with just few lines of code. For example have a look here -> https://lottiefiles.com/search?q=star&category=animations

Let me make you understand how to get started with it....

(1) Add dependency for Lottie

 implementation 'com.airbnb.android:lottie:$lottieVersion'

(2) Add lottie view in layout

(3) Download animation and use it...

Reference Blog

Feel free to ask if something is unclear.

Kamal Nayan
  • 1,635
  • 1
  • 5
  • 19
  • Wish I knew it earlier. Will try it right now. Thank you. Is there a way to make the animation appear and disappear after X time as well? Also, Is there anything needed with regard to proguard? couldn't find anything with it. – Ben Jun 04 '21 at 22:37
  • Always welcome . Yes you have animation listener... You can use that and as far as I know .. nothing to do with progaurd. – Kamal Nayan Jun 04 '21 at 23:22
  • Could you please upvote this answer...? If you find this useful. – Kamal Nayan Jun 04 '21 at 23:23
0

You can achieve this by using the Motion Layout

For more information you can check the official Motion Layout documentation

GSepetadelis
  • 272
  • 9
  • 24