Skip to content

Interact your app's interface elements with different effects!

License

Notifications You must be signed in to change notification settings

agilie/InterfaceInteraction

Repository files navigation

InterfaceInteraction

Made by Agilie GitHub license

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

Shake

Example

How does it work?

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()

Usage

Gradle

Add dependency in your build.gradle file:

compile 'com.agilie:interface-interaction:1.0'

Maven

Add rependency in your .pom file:

<dependency>
  <groupId>com.agilie</groupId>
  <artifactId>interface-interaction</artifactId>
  <version>1.0</version>
  <type>pom</type>
</dependency>

Requirements

AGMobileGift works on Android API 19+

Troubleshooting

Problems? Check the Issues block to find the solution or create an new issue that we will fix asap.

Author

This library is open-sourced by Agilie Team [email protected]

Contributors

Contact us

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!

License

The MIT License (MIT) Copyright © 2017 Agilie Team