B4A Library Velocimeter - dials and meters

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Jun 10, 2015.

Similar threads

B4A Library PanoramaImageView
B4A Tutorial [java] Custom View with Designer Support (Java library)
B4A Library SnakeView
B4A Library CircleProgressMaster
B4A Library LEDView
B4A Library CircularProgress
  1. DonManfred

    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

    [​IMG]

    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) :)
    [​IMG]
     

    Attached Files:

    Last edited: Jun 11, 2015
  2. MarcoRome

    MarcoRome Expert Licensed User

    Great job man.
    In the past time i have already made some donations for your fantastic library
    and in this month will repeat.
    Make a big and beautiful work.
    Good really good
    Thank you DonManfred
     
    Peter Simpson and DonManfred like this.
  3. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    This is excellent @DonManfred.
    Lately I've been playing about with ODB2 and the serial library. I could use this library to display the speed that I'm travelling at, revs, engine temperature, boost pressure etc...
     
    MarcoRome likes this.
  4. DonManfred

    DonManfred Expert Licensed User

    Updated Library to 1.0.1
    It was not possible to set the "Units". This is fixed. See first post
     
    lemonisdead and MarcoRome like this.
  5. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    DonManfred likes this.
  6. qsrtech

    qsrtech Active Member Licensed User

    Teach me how to use your library as an icon/image in the status bar for my speedometer app ;)
     
  7. DonManfred

    DonManfred Expert Licensed User

    Jou can use this view wherever you can place a view. You can not use it as image as it is not an image.
    Maybe i understand the question wrong...
     
  8. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Take a screenshot of it (via the IDE) and then import it into for eg Paint or GIMP. Crop it and then save it. Then you can use it as an icon in your status bar.
     
    DonManfred likes this.
  9. DonManfred

    DonManfred Expert Licensed User

  10. qsrtech

    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.
     
  11. DonManfred

    DonManfred Expert 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)
     
  12. qsrtech

    qsrtech Active Member Licensed User

    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.
     
  13. DonManfred

    DonManfred Expert Licensed User

    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
     
  14. Alberto Michelis

    Alberto Michelis Active 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: Jul 30, 2015
    abarnett likes this.
  15. abarnett

    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 **
     
  16. DonManfred

    DonManfred Expert 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?
     
  17. abarnett

    abarnett Member Licensed User

    I am compiling your example at the moment. I extracted the whole zip as is.
     
  18. DonManfred

    DonManfred Expert Licensed User

    What Android Version does your device have?
    Seems like the lib is missing its fontfile
     
  19. abarnett

    abarnett Member Licensed User

    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
     
  20. DonManfred

    DonManfred Expert Licensed User

    under files folder or under files/fonts/?
     
Loading...