Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TheFinestArtist/MovingButton
Android button which moves in eight direction.
https://github.com/TheFinestArtist/MovingButton
Last synced: 2 months ago
JSON representation
Android button which moves in eight direction.
- Host: GitHub
- URL: https://github.com/TheFinestArtist/MovingButton
- Owner: TheFinestArtist
- License: mit
- Created: 2015-02-13T20:27:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-03T21:00:25.000Z (over 6 years ago)
- Last Synced: 2024-07-31T18:16:30.641Z (5 months ago)
- Language: Java
- Homepage:
- Size: 23.7 MB
- Stars: 131
- Watchers: 7
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- -awesome-android-ui - MovingButton
- awesome-android-ui - MovingButton
- awesome-android-ui - MovingButton
README
# Moving Button
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MovingButton-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1537)
[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)
[![API](https://img.shields.io/badge/API-3%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=3)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)
[![Join the chat at https://gitter.im/TheFinestArtist/MovingButton](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TheFinestArtist/MovingButton?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)Android button which moves in eight direction.
## Preview
![Preview](https://github.com/thefinestartist/movingbutton/blob/master/art/preview.gif)
## Sample Demo
You can download demo movie file here : [demo.mov](https://github.com/thefinestartist/movingbutton/raw/master/art/demo.mov)
It's also on Youtube:
## Sample Project
You can download the latest sample APK from this repo here: [sample-release.apk](https://github.com/thefinestartist/movingbutton/raw/master/sample/sample-release.apk)
It's also on Google Play:
Having the sample project installed is a good way to be notified of new releases.
## Gradle Dependency (jcenter)
Easily reference the library in your Android projects using this dependency in your module's `build.gradle` file:
```Gradle
dependencies {
compile 'com.thefinestartist:movingbutton:1.0.0'
}
```## Requirements
It supports Android API 3+.
It uses [nineoldandroid](http://nineoldandroids.com/) for view animation.
## Attrubutes
```xml
```
## Layout Examples
```xml
```
## Setter & Getter
```java
// Move Direction
movingButton.getMoveDirection();
movingButton.setMoveDirection(MoveDirection.ALL);// Movement (in Pixel dimension)
movingButton.getMovement();
movingButton.setMovement(10);
movingButton.getMovementLeft();
movingButton.setMovementLeft(10);
movingButton.getMovementRight();
movingButton.setMovementRight(10);
movingButton.getMovementTop();
movingButton.setMovementTop(10);
movingButton.getMovementBottom();
movingButton.setMovementBottom(10);// Offset (in Pixel dimension)
movingButton.getOffSetInner();
movingButton.setOffSetInner(10);
movingButton.getOffSetOuter();
movingButton.setOffSetOuter(10);// Vibration
movingButton.getVibrationDuration();
movingButton.setVibrationDuration(20);// Volume
movingButton.getEventVolume();
movingButton.setEventVolume(50);// Current Position
movingButton.getCurrentPosition();
```## Listener
```java
public interface OnPositionChangedListener {
// returns MotionEvent action and changed button position
void onPositionChanged(int action, ButtonPosition position);
}movingButton.setOnPositionChangedListener(new MovingButton.OnPositionChangedListener() {
@Override
public void onPositionChanged(int action, ButtonPosition position) {
//your code here
}
});
```## License
```
The MIT License (MIT)Copyright (c) 2015 TheFinestArtist
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```