Coder Social home page Coder Social logo

agilie / interfaceinteraction Goto Github PK

View Code? Open in Web Editor NEW
57.0 10.0 6.0 348 KB

Interact your app's interface elements with different effects!

Home Page: https://agilie.com

License: MIT License

Java 8.69% Kotlin 91.31%
kotlin kotlin-android accelerometer gravity physics animation shake interface

interfaceinteraction's Introduction

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

interfaceinteraction's People

Contributors

akotsuba avatar romankapshuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interfaceinteraction's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.