Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.bilthon:Android-Speedometer:'
}
dependencies {
implementation("com.github.bilthon:Android-Speedometer:")
}
<dependency>
<groupId>com.github.bilthon</groupId>
<artifactId>Android-Speedometer</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.bilthon" % "Android-Speedometer" % ""
:dependencies [[com.github.bilthon/Android-Speedometer ""]]
Android custom view that displays a simple Speedometer.
The setup of the custom view should be as simple as placing this snippet in your xml layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res/com.luminiasoft.labs.views"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.luminiasoft.labs.views.Speedometer
android:id="@+id/Speedometer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:currentSpeed="100"
custom:maxSpeed="300" />
</RelativeLayout>
Of course, don't forget to include the /values/attrs.xml
file in your project for this to work.
Nelson R. Perez - bilthon@gmail.com