B4A Library Velocimeter - dials and meters

Similar threads

B4A Library PDFium - Pdfview2
B4A Library IPCamView
B4A Library msEmoji V1.0.0
B4A Library CreditsRollView V1.0.0
B4A Tutorial [java] Custom View with Designer Support (Java library)
B4A Library SnakeView

DonManfred

Expert
Licensed User
This is a wrapper for this github project.

Velocimeter
Author:
Manfred Ssykor
Version: 1
  • VelocimeterView
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • isShowBottomVelocimeter As Boolean
    • update
    Properties:
    • Background As Drawable
    • BottomVelocimeterColor As Int
    • Color As Int [write only]
    • DigitalNumberBlurColor As Int
    • DigitalNumberColor As Int
    • Duration As Int
    • Enabled As Boolean
    • ExternalProgressColor As Int
    • Height As Int
    • InsideProgressColor As Int
    • InternalVelocimeterColor As Int
    • Left As Int
    • Margin As Int
    • Max As Float
    • Min As Int
    • NeeddleColor As Int
    • NeedleBlurColor As Int
    • ProgressBlurColor As Int
    • ProgressDelay As Long
    • ShowBottomVelocimeter As Boolean [write only]
    • Tag As Object
    • Top As Int
    • Units As String
    • Value As Float
    • ValueAnimated As Float [write only]
    • Visible As Boolean
    • Width As Int



This library is Donationware. You can download the library, you can test the library. But if you want to USE the library in your App you need to Donate for it.
Please click here to donate (You can donate any amount you want to donate for the library (or my work) :)
 

Attachments

Last edited:

qsrtech

Active Member
Licensed User
Teach me how to use your library as an icon/image in the status bar for my speedometer app ;)
 

qsrtech

Active Member
Licensed User
Thanks but that's not an on the fly in real time "speed". Anyway it was a double meaning question. I know it's a "view". I haven't spent a lot of time on it but unfortunately i wasn't able to successfully use an on the fly image with a notification.
 

qsrtech

Active Member
Licensed User
i think you should set the delay to 0
Maybe i need to find a way of disabling the animation (or changing the animationspeed)
Sorry, i was referring to the "taking a screenshot in the ide and use it as an icon" suggestion. I haven't actually even tried the library yet so i have no idea about the animation details.
 

DonManfred

Expert
Licensed User
"taking a screenshot in the ide and use it as an icon" suggestion
you can use the png in post #3
This png is used in the library example as app icon

This library can not deliver a drawable or bitmap which can be used on other places. A notification icon is a static bitmap
 

Alberto Michelis

Well-Known Member
Licensed User
Testing it in one app, just to see how it looks, Im getting a java error:

java.lang.RuntimeException: native typeface cannot be made

I've copied the font folder to my files folder but the error persists
 
Last edited:

abarnett

Member
Licensed User
Testing the example app, and would love to donate but I'm getting a java error:

Installing file.
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
Error occurred on line: 33 (Main)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)

Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:54)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
... 21 more
Caused by: java.lang.RuntimeException: native typeface cannot be made
at android.graphics.Typeface.<init>(Typeface.java:175)
at android.graphics.Typeface.createFromAsset(Typeface.java:149)
at com.github.glomadrian.velocimeterlibrary.painter.digital.DigitalImp.initTypeFace(DigitalImp.java:59)
at com.github.glomadrian.velocimeterlibrary.painter.digital.DigitalImp.<init>(DigitalImp.java:34)
at com.github.glomadrian.velocimeterlibrary.VelocimeterView.init(VelocimeterView.java:132)
at com.github.glomadrian.velocimeterlibrary.VelocimeterView.<init>(VelocimeterView.java:78)
at de.donmanfred.VelocimeterViewWrapper._initialize(VelocimeterViewWrapper.java:44)
... 25 more
** Activity (main) Resume **
 

DonManfred

Expert
Licensed User
Testing the example app, and would love to donate but I'm getting a java error:
You are compiling the provided example? Is the Ressources folder part of your project? does your files folder contains a fonts folder and inside it there is a digit.ttf?
Or do you create a own example?
 

abarnett

Member
Licensed User
You are compiling the provided example? Is the Ressources folder part of your project? does your files folder contains a fonts folder and inside it there is a digit.ttf?
Or do you create a own example?
I am compiling your example at the moment. I extracted the whole zip as is.
 

abarnett

Member
Licensed User
What Android Version does your device have?
Seems like the lib is missing its fontfile
The latest version of android sdk and b4a. I have just started development. The phone is running kitkat (4.4)
The digit font file is under files folder
 
Top