简体   繁体   中英

Is it is possible to make android app launcher icon animated when i click on it?

I need a functionality for my app when i click on app launcher icon it should be animated.

Also I need click event of it so i can do whatever operation on that.

TRIED:

I have tried widget but i don't have an idea how exactly do that.

Please help me if you have any suggestion for this or any idea how to make this type of functionality.

I figured it out how to achieve animation on app icon like other app doing.

  1. create shortcut or of your app you will need this permission.

<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

  1. you need to create transparent activity by specifying Theme.Translucent.NoTitleBar Theme. This activity will responsible for animation that we want to achieve when user click on shortcut of app.

  2. now we can show animation over shortcut icon by computing position of shortcut. this can be done using ShortcutInfo and ShortcutManager . To give support all android version there is ShortcutInfoCompat class available. find more here .

Just a suggestion did you consider the possibility of using a "gif" image?

And trying to replace images on mouse event.

Haven't tried it though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM