Influenced with PhysicsLayout project, we've implemented an interesting animation. 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.
Another option is to apply shake animation for your UI elements.
These animations can be easily used during the development of any application as an event activated after a specified user action.
Gravity:
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:
gravityController.start()
gravityController.stop()
Shake:
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 = InterfaceInteractorImpl().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
shaker.shakeMyActivity()
shaker.shakeMyView()
shaker.stopAnimation()
Add dependency in your build.gradle
file:
compile 'com.agilie:interface-interaction:1.0'
Add rependency in your .pom
file:
<dependency>
<groupId>com.agilie</groupId>
<artifactId>interface-interaction</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
AGMobileGift works on Android API 19+
Problems? Check the Issues block to find the solution or create an new issue that we will fix asap.
This library is open-sourced by Agilie Team [email protected]
If you have any questions, suggestions or just need a help with web or mobile development, please email us at
[email protected]
You can ask us anything from basic to complex questions.
We will continue publishing new open-source projects. Stay with us, more updates will follow!
The MIT License (MIT) Copyright © 2017 Agilie Team