Donut Gauge View with animation for Android
- Add the JitPack repository to your project level build.gradle file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- 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
<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.
donutGuageView.run {
topText = "new top"
bottomText = "200"
initValue(20f, 200f)
}
donutGuageView.updateValue(100f)
In this method, End value
that you set before is kept. Only the current value will change.
dg_complete_circle_color
: front_circle_color when ration is 100%
dg_anim_duration
: animation duration. 1000 = 1s
All Pull Request and Issues are welcome!
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.