Skip to content

wooooooak/DonutGaugeView

Repository files navigation

DonutGaugeView

Donut Gauge View with animation for Android

donutView_gif

Install

Gradle

  1. Add the JitPack repository to your project level build.gradle file
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency to your app level build.gradle file
dependencies {
    implementation 'com.github.wooooooak:DonutGaugeView:$version'
}

The latest version is 1.0.9. Checkout here

Usage

Basic Usage

<wooooooak.com.library.DonutGaugeView
    android:id="@+id/donutGaugeView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:dg_start_value="70"
    app:dg_end_value="100"
    />

dg_end_value is required because of Circle ratio calculation.

Use initValue() to redraw DonutGuageView

donutGuageView.run {
    topText = "new top"
    bottomText = "200"
    initValue(20f, 200f)
}

Use updateValue() to update existing value

donutGuageView.updateValue(100f)

In this method, End value that you set before is kept. Only the current value will change.

Attribute name definition

image

more)

dg_complete_circle_color: front_circle_color when ration is 100%

dg_anim_duration: animation duration. 1000 = 1s

Contribution

All Pull Request and Issues are welcome!

License

Copyright 2019 wooooooak (Yongjun LEE)

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 at

   http://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.

About

Android Donut Gauge View Library (with Kotlin)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages