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.
- create shortcut or of your app you will need this permission.
<uses-permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
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.
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 isShortcutInfoCompat
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.