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

女生的网名这么多〃 提交于 2019-12-21 20:27:56

问题


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.



来源:https://stackoverflow.com/questions/23004624/is-it-is-possible-to-make-android-app-launcher-icon-animated-when-i-click-on-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!