B4A Library StartPointSeekBar

Discussion in 'Additional libraries, classes and official updates' started by Johan Schoeman, Aug 29, 2015.

Similar threads

B4A Library IPCamView
B4A Library ChatMessageView
B4A Tutorial [java] Custom View with Designer Support (Java library)
B4A Library ColorSeekBar
B4A Library PanoramaImageView
B4A Library msEmoji V1.0.0
  1. Johan Schoeman

    Johan Schoeman Expert Licensed User

    It wraps this Github project. Library files are in the /files folder of the attached B4A project. Copy them to your additional library folder. Java source code is in attached src.zip. A value_changed event is raised in B4A when you adjust/slide the seekbar. The actual/present value of the seekbar can then be obtained with a call to a library method (eg myval = spsb3.CurrentThumbValue). The range can be set from 0 to whatever value or from a negative minimum value to a positive maximum value.

    1.png

    ...and when you touch the slider...

    2.png

    The library as it stands at present:

    startpointseekbar
    Author:
    Johan Schoeman
    Version: 1
    • StartPointSeekBar
      Fields:
      • ba As BA
      Methods:
      • 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)
      Properties:
      • Background As Drawable
      • Color As Int [write only]
      • CurrentThumbValue As Double [read only]
      • Enabled As Boolean
      • Height As Int
      • Left As Int
      • MinValue As Double [write only]
      • Tag As Object
      • TheBackgroundColor As Int [write only]
      • TheRangeColor As Int [write only]
      • ThumbValue As Double [write only]
      • Top As Int
      • Visible As Boolean
      • Width As Int
      • maxValue As Double [write only]
     

    Attached Files:

    Last edited: Aug 29, 2015
  2. DonManfred

    DonManfred Expert Licensed User

    Nice one. Thanx for sharing :)
     
    Johan Schoeman likes this.
  3. ArminKH

    ArminKH Well-Known Member

    thank u
     
  4. Inman

    Inman Well-Known Member Licensed User

    Nice library.

    Any reason for not mentioning your libraries in the library updates thread?
     
  5. DonManfred

    DonManfred Expert Licensed User

    Johan is just too lazy ;-)
     
    Last edited: Mar 17, 2016
    Johan Schoeman likes this.
  6. Johan Schoeman

    Johan Schoeman Expert Licensed User

  7. Inman

    Inman Well-Known Member Licensed User

    DonManfred likes this.
  8. Johan Schoeman

    Johan Schoeman Expert Licensed User

    See post #5.....:)
     
    Inman and DonManfred like this.
  9. PABLO2013

    PABLO2013 Active Member Licensed User

    regards
    I wonder what could be causing the error, I want to use StartPointSeekBar in CheckList demo, tks

    ........................................................
    Sub CreateItem(h, i As Int) As Panel
    Dim pnl As Panel, lbl As Label, chk As CheckBox, edt As EditText,sb As StartPointSeekBar
    pnl.Initialize("")

    ...

    sb.Initialize("sb") 'View #1
    sb.TheBackgroundColor = Colors.DarkGray
    sb.TheRangeColor = 0xFF33B5E5
    sb.MinValue = 0
    sb.maxValue = 120
    sb.ThumbValue = 60
    ...
    End Sub
    ........................................................
     

    Attached Files:

  10. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Seems to me as if you are missing some files in the /Objects/res/xxx folder(s) of your B4A project. Look inside the folders of the original project and make sure they are in the folders of your new project. Also make sure they are set to READ ONLY.
     
    DonManfred likes this.
  11. PABLO2013

    PABLO2013 Active Member Licensed User

    tks Johan
     
  12. PABLO2013

    PABLO2013 Active Member Licensed User

    regards I would like to know how you configure this to have a scale without zero,
    for example: -5 -4 -3 -2 (1) 2 3 4 5
    center=1

    i put it , but the center is =0
    sb.MinValue = -5
    sb.maxValue = 5
    sb.ThumbValue = 1
    tks
     
    Last edited: Mar 14, 2016
  13. Johan Schoeman

    Johan Schoeman Expert Licensed User

    The library does not make provision for adding discrete points. It only works with a range. If you minimum value is a negative value and your maximum value is a positive value then zero will form part of the range.
     
  14. PABLO2013

    PABLO2013 Active Member Licensed User

    Thank you, could mask values...

    myval = spsb1.CurrentThumbValue

    ej: if myval=0 the myval=1 .......
     
  15. Johan Schoeman

    Johan Schoeman Expert Licensed User

    I have seen a different project that I will wrap that should allow you to do what it is that you require. Give me time until this weekend to sort it out. But it will be 100% discrete values. Nothing inbetween.
     
  16. PABLO2013

    PABLO2013 Active Member Licensed User

    thank you very much
     
  17. PABLO2013

    PABLO2013 Active Member Licensed User

    greetings ,
    Have problems with the library in CheckList , and fellow put me :
    https://www.b4x.com/android/forum/threads/class-checklist.18853/page-6#post-410254
    "A view is expected by the function but the sender object is not. Please see this problem with the library author because I have no idea of what is a "StartPointSeekBar"."


    It would be much trouble to add another button control
    .........value1 ............value2
    ----------o----------------o------------ StartPointSeekBar


    Thank you
     
  18. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Not sure what the solution is here as far as the "CheckList" is concerned. Have never used CheckList.

    It would be much trouble to add another button control
    The original project that I have wrapped does not make provision for this.
     
  19. RaymondHung

    RaymondHung Member Licensed User

    Hi Johan,

    I want to know how can I change the outlook of the 2 files - seek_thumb_normal.png and seek_thumb_pressed.png

    Thanks
     
  20. Johan Schoeman

    Johan Schoeman Expert Licensed User

    You will have to edit them with something like GIMP. The code does not make provision for changing them programmatically.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice