Simplify interaction with GIF images









Agilie Team would like to offer you our new lightweight open-source library called AGMobileGiftInterface. This library simplifies interaction with GIF images and can be easily integrated into your project.

When can you use AGMobileGift? Use our library if you need to show a GIF image after performing a certain pre-specified action. AGMobileGiftInterface can also be helpful for creating animated greetings, designing splash screens or loading, upgrading and supplementing online games as well as in other similar cases. Our library helps you achieve the desired result in an easy way with as little lines of code as possible.

How does it work?


After an animated picture has been played, the controller managing it closes. And if you want to add a new image, just put it into the project and provide the GIF path as parameter and call method show.

val giftInterfaceImpl = AGMobileGiftInterfaceImpl(), R.drawable.lady_bug)


First, create an instance of GravityControllerImpl. Pass context instance and root ViewGroup as constructor parameters:

val gravityController = GravityControllerImpl(this, rootLayout)

To initiate gravity animation of all subviews (except ViewGroup instances) and then return back these UI elements simply call appropriate methods:



Choose what you want to shake: all activity or only view. Then you need to build your ShakeBuilder, call the method shake where the parameter is yours view and in the end call the method build.

val shaker = AGMobileGiftInterfaceImpl().shake(this).build()

In order to start animation you need to call the method shakeMyActivity or shakeMyView. To complete the animation call the method stopAnimation


Our example of using AGMobileGift

We’ve used this library when working on Easter greeting program. Quite simple, it has 3 GIF images in its reserve (Ladybird, Rabbit, Fox) but can also be supplemented with new ones. We made example to congratulate the use on the day of Easter.

Influenced with PhysicsLayout project, we have recently supplemented our library with the new interesting animation. In its updated version, our library captures any interface (screen or view) and throws its UI elements over under the influence of gravity, so that one can move them from side to side obliquely. Gravity depends on device’s accelerometer data. Call stop() method to return all the UI elements to their original location.

This animation can be easily used during the development of any application as an event activated after a specified user action.



Add dependency in your build.gradle file:

compile 'com.agilie.agmobilegift:AGMobileGiftInterface:0.1.1'


Add rependency in your .pom file:



AGMobileGift works on Android API 19+


More details:


Related Post