Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PhilJay/ValueBar
A beautiful Android custom View that works similar to a range or seekbar. With animations.
https://github.com/PhilJay/ValueBar
Last synced: 3 months ago
JSON representation
A beautiful Android custom View that works similar to a range or seekbar. With animations.
- Host: GitHub
- URL: https://github.com/PhilJay/ValueBar
- Owner: PhilJay
- License: apache-2.0
- Created: 2014-10-22T20:43:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-03T13:14:47.000Z (over 9 years ago)
- Last Synced: 2024-07-01T09:40:00.228Z (4 months ago)
- Language: Java
- Size: 2.47 MB
- Stars: 148
- Watchers: 12
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ValueBar
========A beautiful Android custom View that works similar to a range or seekbar. Selection by gesture. With animations. **Supporting API level 11+.**
![alt tag](https://raw.github.com/PhilJay/ValueBar/master/screenshots/adgraphic.jpg)
Demo
=======
For a short demonstration, please download the [**demo application**](https://play.google.com/store/apps/details?id=com.philjay.valuebarexample) from the Google PlayStore. The corresponding code for the demo application can be found in the `ValueBarExample` folder.Usage
========For using `ValueBar`, there are various possibilities:
**1. Gradle dependency**
- Add the following to your `build.gradle`:
```gradle
repositories {
maven { url "https://jitpack.io" }
}dependencies {
compile 'com.github.PhilJay:ValueBar:v1.0.2'
}
```**2. Maven**
- Add the following to your `pom.xml`:
```xmljitpack.io
https://jitpack.iocom.github.PhilJay
ValueBar
v1.0.2```
**3. jar file**
- download the **latest .jar file** from the [**release-section**](https://github.com/PhilJay/ValueBar/releases) and copy it into the `libs` folder of your Android application project.**4. clone repo**
- clone this repository and add the library folder to your Android application projectCreate a `ValueBar` in .xml:
```xml
```
or in code, and then add it to a layout:
```java
ValueBar bar = new ValueBar(Context);
```Apply styling, and display values:
```java
bar.setMinMax(0, 1000);
bar.setInterval(1f); // interval in which can be selected
bar.setDrawBorder(false);
bar.setValueTextSize(14f);
bar.setMinMaxTextSize(14f);
bar.setValueTextTypeface(...);
bar.setMinMaxTextTypeface(...);
bar.setOverlayColor(...);
// create your custom color formatter by using the BarColorFormatter interface
bar.setColorFormatter(new RedToGreenFormatter());
// add your custom text formatter by using the ValueTextFormatter interface
bar.setValueTextFormatter(...);
bar.setValue(800f); // display a value
// or animate from a specific value to a specific value
bar.animate(from, to, animationDuration);
bar.setValueBarSelectionListener(...); // add a listener for callbacks when touching```
Donations
======If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, **feel free to donate**. Your donation is highly appreciated.
PayPal
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EGBENAC5XBCKS)