I'm a Native Android Developer who loves building Android apps using Kotlin programming language, using Coroutines to handle threads and love to follow the rules of clean-architecture.
📫 You can reach me on LinkedIn.
Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
License: Apache License 2.0
I'm a Native Android Developer who loves building Android apps using Kotlin programming language, using Coroutines to handle threads and love to follow the rules of clean-architecture.
📫 You can reach me on LinkedIn.
I sugest to add the feature maxSpeedColor
Hi, great work with the speedometers!
I have a question/request!
Example: Given the following: minSpeed=0, maxSpeed=20000, lowSpeedPercent=50, mediumSpeedPercent=35, can we have the low zone between the values 0 and 1000, the medium zone between 1000 and 2000 and the high zone between 2000 and 20000?
Also, is it possible to assign labels to the ticks? For example, instead of showing 1000m, I would like to show 1km!
Thanks in advance!
I have implemented this speed view in my project, but it started to move automatically from left to right, but I want to change position of indicator between 180 to 360. Can you please tell me how to achieve this.
Is it possible to show a percentage rather than the unit value?
My speedometer runs from -25 to 0. I don't want to show -25.. I want to show 0 - 100%
Is this possible?
Hello, I am using your SpeedView on my Android application and it is working very nicely. Great work. However, I would like to use your SpeedView on my IOS app also. Do you have this library written in Swift or objective C? Thanks.
Hello,
i add DeluxeSpeedView to layout but it shows render errors:
java.lang.NoSuchFieldError: Speedometer_sv_speedometerMode
at com.github.anastr.speedviewlib.base.Speedometer.initAttributeSet(Speedometer.java:87)
at com.github.anastr.speedviewlib.base.Speedometer.(Speedometer.java:58)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:45)
at com.github.anastr.speedviewlib.DeluxeSpeedView.(DeluxeSpeedView.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:475)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:262)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:220)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:861)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:197)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:902)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:854)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
However, when i run app it can shows DeluxeSpeedView:
Please help me render without error.
Thanks!
Hello, how can I set criteria value speed for green, yellow and red area? I think set max 50 as green, 100 will be yellow... in deluxeSpeedView
Many thanks
After my upgrade from 1.1.3 to 1.1.4 I get all these errors. If i go back to 1.1.3 they go away.
Error:(38) No resource identifier found for attribute 'imageSpeedometer' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'startDegree' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'endDegree' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'speedometerMode' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'indicator' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'speedTextColor' in package 'com.bedgear.pillowid'
Error:(38) No resource identifier found for attribute 'indicatorColor' in package 'com.bedgear.pillowid'
Here is the layout.
<com.github.anastr.speedviewlib.ImageSpeedometer
android:id="@+id/tempatureView"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:paddingLeft="@dimen/pad_20dp"
android:paddingRight="@dimen/pad_20dp"
android:layout_gravity="center_horizontal"
app:imageSpeedometer="@drawable/tempature_meter"
app:startDegree="180"
app:endDegree="360"
app:speedometerMode="TOP"
android:layout_marginTop="62dp"
android:layout_below="@+id/tvTitle"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/pad_50dp"
app:indicator="NormalSmallIndicator"
app:speedTextColor="@android:color/transparent"
app:indicatorColor="@android:color/white" />
please if you have any Speedometer you need to add to the Library, give me images in the new issue.
it must be possible to drawn
idea @anastr :
hi,
could a thermometer (as a special case of a progressive gauge) be added to this nice and helpful library?
an example image would be as simple as this one:
https://www.iso.org/obp/graphics/grs/5bf03c3e-2a63-4483-9699-79f846aa1176_200.png
Hi!
I want to use the Imageview with the image that you put in the wiki:
And this is xml code that i use:
<com.github.anastr.speedviewlib.ImageSpeedometer
android:id="@+id/imageSpeedometer"
android:layout_width="300dp"
android:layout_height="wrap_content"
app:sv_image="@drawable/imagespeedometer"
app:sv_speedTextColor="@android:color/transparent"
app:sv_unitTextColor="@android:color/transparent"
/>
And then I use this code in the activity:
ImageSpeedometer imageSpeedometer = (ImageSpeedometer) findViewById(R.id.imageSpeedometer);
imageSpeedometer.speedTo(60);
But when I execute the app the speed doesnt change to 60.
Do you know why happen?
Thanks for all the work!!!!
1 - I've got a error: cannot find symbol method setTicks(int,int...)
2 - Can I put a unit in two lines ? one for value other for description ?
Can you help ?
how can i remove pointer color, i tried making it transparent but now its appearing as some kind of light,
I dont any pointer color. is there any way to do it??
On DeluxeSpeedView the value setting over .speetTo() didnt work, I used it in a SensorEvent (onSensorChanged) and it didnt work :(. On the Simple SpeedView it did work well.
Changing the color of the wheel programmatically isn't working.
I'm calling speedometer.setLowSpeedColor(R.color.instinct3);
on a button press and the color of the wheel isn't changing.
Can you add it that the guage text is comma separated?
Do you have any listeners that tell you when it's done going to the number you tell it to go to? If not I'd like to suggest it for the next enhancement so I know when it's done moving to the speed I want it to go to.
I'm starting to use the AwesomeSpeedometer.
I'm having problems with updating the pointer. I created a random number and when I give the command as speedometer.speedTo (rand), the pointer does not move.
I set speedTextSize to 0 and it hid the number, but I'm not able to hide the unit being shown. Is there a way? Thanks.
As you see p leter gets cut off and don't know how to fix this
this is xml code that i use
<com.github.anastr.speedviewlib.TubeSpeedometer
android:id="@+id/speedView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
app:sv_withEffects3D="false"
app:sv_speedometerColor="#000077"
/>
hi,
if im using custom speedometer image and custom needle image,
which size of images i supposed to put in the drawable folder to support multiple screens,
another question , there is a support to move the needle in linear way , not just in circular way from the center?
Thanks,
tal
Hi,
i try to add SpeedView to my app, and i set speed value by speedMeter.speedTo(mySpeed, 1000)
when my speed decrease to 0, and remain at 0 then speed value display not fixed at 0, it jumps randomly between 0 and 3. How to fix this?
Hi,
thanks for the nice work with the SpeedView
why the gauge keeps trembling after setting the speed to zero? since its not receiving speedTo calls anymore.
I even call stop() and clearAnimation() after speedTo(0.0f)
thanks in advance
We need font type option for displaying digits in Digital fonts
Plead add speedTo method accept double and float value too
Hi! Is it possible to set stroke of tubeSpeedometer?
Can I change current label "0.0 km/h" with my own label.
My next suggestion would be a custom image indicator.
Can you override the images?
In Awesome Speedometer tick mark numbers are shown.
Similarly how to set tick mark numbers based on the setMin and setMax values if I want to use other speedometers.
I have runtime exception on android 4.0.4 (Sony ericsson xperia neo v (MT11I)).
Reproduced in sample project with one simple activity.
Layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.tridetch.speedviewexample.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.github.anastr.speedviewlib.SpeedView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</android.support.constraint.ConstraintLayout>
Stack trace
08-24 13:10:18.527 11630-11630/com.example.tridetch.speedviewexample E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tridetch.speedviewexample/com.example.tridetch.speedviewexample.MainActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class com.github.anastr.speedviewlib.SpeedView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class com.github.anastr.speedviewlib.SpeedView
at android.view.LayoutInflater.createView(LayoutInflater.java:606)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.tridetch.speedviewexample.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:586)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.tridetch.speedviewexample.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.StackOverflowError
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1225)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePadding(Gauge.java:295)
at com.github.anastr.speedviewlib.base.Gauge.setPaddingRelative(Gauge.java:1226)
at android.view.View.setPadding(View.java:11973)
at com.github.anastr.speedviewlib.base.Gauge.updatePa
Can the units be changed? Does the API allow me to change the units? I would like to use the gauge to display units other than speed.
Hello,
I am working on Pointer-speedometer. I want to progress min -30 to max 30. How can i achieve this?
Hi
Can we add labels at each and every tick points.? like 0 30 60 90..etc
value i pass to speedTo() method is 0 but on speedometer dial it increase and decrease automatically. i use the AwesomeSpeedometer. plz tell me what is wrong.
@anastr
Excuse me,I see this sentence
Do you think it can be done
如题。
This is my xml
<com.github.anastr.speedviewlib.SpeedView
android:id="@+id/speedView"
android:layout_width="200dp"
android:layout_height="wrap_content"
app:sv_tickNumber="10"
app:sv_cutPadding="0dp"
app:sv_markColor="@android:color/transparent"/>
and this is my java code
speedView.setLowSpeedColor(R.color.colorBlue);
speedView.setMediumSpeedColor(R.color.colorGray);
speedView.setHighSpeedColor(R.color.colorGreen);
<color name="colorGray">#EDEDED</color>
<color name="colorGreen">#00aa00</color>
<color name="colorBlue">#0000aa</color>
hi
how can after speed changes ,the animation of speed is stopped ?
thanks in advance .
i found it
"sv_trembleDegree= 0.0"
Dear all.
Now I would like to add SpeedView into Scrollview, but it's not possible.
Can everyone help me.
Thanks All.
I am using PointerSpeedometer. In this speedometer, set maximum value 100 and for testing i used your function speedTo(80). But after reaching 80 speedometer not stop. Which function used for stop?
Hi!
First of all, i have to give you a lot of thanks for this work :-) . But i have one problem with DeluxeSpeedView, when I add to the xml the code of DeluxeSpeedView:
<com.github.anastr.speedviewlib.DeluxeSpeedView android:id="@+id/deluxeSpeedView" android:layout_width="300dp" android:layout_height="wrap_content" />
And I don't see the deluxeView, do u know why happen this?
This only happen with this SpeedView
How to add battery kind of an image?
Based on the percentage value it would fill the battery with color.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.