Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anastr/SpeedView
Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
https://github.com/anastr/SpeedView
android animation gauge java kotlin library speedometer speedview view
Last synced: about 2 months ago
JSON representation
Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
- Host: GitHub
- URL: https://github.com/anastr/SpeedView
- Owner: anastr
- License: apache-2.0
- Created: 2016-08-17T12:14:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-07T15:33:46.000Z (11 months ago)
- Last Synced: 2024-10-21T09:13:16.259Z (about 2 months ago)
- Topics: android, animation, gauge, java, kotlin, library, speedometer, speedview, view
- Language: Kotlin
- Homepage:
- Size: 12.3 MB
- Stars: 1,288
- Watchers: 50
- Forks: 324
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-kotlin - SpeedView - Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap: (Libraries)
README
# SpeedView
Dynamic Speedometer, Gauge for Android. **amazing**, **powerful**, and _multi shape_ :zap: , you can change (colors, bar width, shape, text, font ...everything !!), this Library has also made to build **games** with `accelerate` and `decelerate`,
[see project on GitHub](https://github.com/anastr/SpeedView/).Library Size just ~ 48 KB.
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SpeedView-green.svg?style=true)](https://android-arsenal.com/details/1/4169)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.anastr/speedviewlib?color=cyan)](https://mvnrepository.com/artifact/com.github.anastr/speedviewlib/latest)
[![API](https://img.shields.io/badge/API-+11-red.svg?style=flat)](#)
[![Twitter](https://img.shields.io/badge/[email protected]?style=flat)](http://twitter.com/AnasAltairDent)Download demo on Google Play:\
**Speedometers...**
**Gauges...**
# Donations
This project needs you! If you would like to support this project, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated. Thank you!
[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=VQ9DDY2KSQLJW)
# Compose Multiplatform
> SpeedView is now available in Jetpack Compose! Check [Speedometer](https://github.com/anastr/Speedometer/) repo for more info.
# Download
Starting from version `1.5.4` this library uploaded to `mavenCentral`, the old versions was on `jcenter`. To work with this library you need `Kotlin` version `1.5.20` or above.
First add kotlin to your project, in `build.gradle` **project level**:
```gradle
buildscript {
ext.kotlin_version = '1.5.31'
dependencies {
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
...
allprojects {
repositories {
...
mavenCentral()
}
}
```Then add this line to `build.gradle` **app module level**:
```gradle
apply plugin: 'kotlin-android'
...
dependencies {
implementation 'com.github.anastr:speedviewlib:1.6.1'
}```
For **maven**
```maven
com.github.anastr
speedviewlib
1.6.1
pom```
**[Get Starting](https://github.com/anastr/SpeedView/wiki/0.-Get-Started)** with _SpeedView Library_.
# Simple Usage
Choose one of Speedometers, gauges and add it to your `Layout.xml`, here we use **SpeedView**.
```xml```
For all speedometers and gauges, this simple method to smoothly change the speed:
```kotlin
SpeedView speedometer = findViewById(R.id.speedView)// move to 50 Km/s
speedometer.speedTo(50)
```By default, speed change duration between last speed and new one is `2000 ms`.
You can pass your duration by this method :
```kotlin
// move to 50 Km/s with Duration = 4 sec
speedometer.speedTo(50, 4000)
```Automatically, indicator moves around current speed to add some reality to speedometer because of [Tremble](https://github.com/anastr/SpeedView/wiki/0.-Get-Started#tremble), you can stop it by `app:sv_withTremble="false"`attribute or call this in your code:
```kotlin
speedometer.withTremble = false
```**For more control**, see the most important methods at [Get Started - Wiki](https://github.com/anastr/SpeedView/wiki/0.-Get-Started) for **All Speedometers & Gauges**.
And also you can see **Advanced Usage** in [Usage - Wiki](https://github.com/anastr/SpeedView/wiki/Usage).More advanced features:
- Work with [Indicators - Wiki](https://github.com/anastr/SpeedView/wiki/Indicators).
- Work With [Notes - Wiki](https://github.com/anastr/SpeedView/wiki/Notes).
## All Speedometers, Gauges :
Name
Screenshot
XML Layout
< com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.DeluxeSpeedView
android:id="@+id/deluxeSpeedView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.AwesomeSpeedometer
android:id="@+id/awesomeSpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.RaySpeedometer
android:id="@+id/raySpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.PointerSpeedometer
android:id="@+id/pointerSpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.TubeSpeedometer
android:id="@+id/tubeSpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.ImageSpeedometer
android:id="@+id/imageSpeedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sv_image="@drawable/your_image" />
< com.github.anastr.speedviewlib.ProgressiveGauge
android:id="@+id/gauge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
< com.github.anastr.speedviewlib.ImageLinearGauge
android:id="@+id/gauge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:sv_image="@drawable/fire" />
## TODO
* Build start animation.
* Add fuel gauge component.
* Build new custom speedometer.Your `pull request` is always welcome, please review the **[rules of contribution](https://github.com/anastr/SpeedView/blob/master/CONTRIBUTING.md)** to make a useful change.
# LICENSE
```Copyright 2016 Anas Altair
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.```