Is it is possible to make android app launcher ico

2019-04-11 22:50发布

问题:

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.

回答1:

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 isShortcutInfoCompatclass available. find more here.



回答2:

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.