B4A Library [B4X] [XUI] AS StepSeekBar - StepSlider

I took the original B4XSeekBar code from @Erel and modified it to create a new view.

I spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal or with a coffee. :)

IMG_2275.jpg
RPReplay_Final1637668244.gif

Add steps example:
For i = 0 To 4 -1
    ASStepSeekBar1.AddStep(xui.Color_White,"Item " & (i))
    ASStepSeekBar2.AddStep(xui.Color_White,"Item " & (i))
Next
ASStepSeekBar
Author: Alexander Stolte
Version: 1.00

  • ASStepSeekBar
    • Events:
      • TouchStateChanged (Pressed As Boolean)
      • ValueChanged (Index As Int, Value As Object)
    • Fields:
      • Interval As Int
      • mBase As B4XView
      • Radius1 As Int
      • Radius2 As Int
      • ReachedLineColor As Int
      • ReachedLineSize As Int
      • Tag As Object
      • ThumbColor As Int
      • UnreachedLineColor As Int
      • UnreachedLineSize As Int
    • Functions:
      • AddStep (Color As Int, Value As Object) As String
      • Class_Globals As String
      • CreateASStepSeekBar_Step (Value As Object, Color As Int) As ASStepSeekBar_Step
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • getSize As Int
        Gets the count of steps
      • GetStepValue (Index As Int) As Object
        Get a value from a step
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • setStepIndex (Index As Int) As String
      • Update As String
        Redraws the control
    • Properties:
      • StepIndex
  • ASStepSeekBar_Step
    • Fields:
      • Color As Int
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Value As Object
    • Functions:
      • Initialize
        Initializes the fields to their default value.
Changelog
  • 1.00
    • Release
  • 1.01
    • minor adjustments
    • Base_Resize is public now
  • 1.02
    • Add get StepIndex
  • 1.03
    • Add Clear - Clear all steps
    • Hitbox improved - you can now simply tap on the line and the item that is closer to it will be selected
  • 1.04
    • BugFix
  • 1.05
    • BugFixes on the vertical seekbar
    • Add AddStep2 with ReachedColor and UnreachedColor parameter
Have Fun :)
 

Attachments

  • AS StepSeekBar Example.zip
    10.7 KB · Views: 442
  • ASStepSeekBar.b4xlib
    2.7 KB · Views: 52
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.01
    • minor adjustments
    • Base_Resize is public now
Base_Resize is public
You should call it in B4A after modifying B4XSeekBar.mBase size (it is called automatically in B4i, B4J).
B4X:
ASStepSeekBar2.mBase.Width = 250dip
ASStepSeekBar2.Base_Resize(ASStepSeekBar2.mBase.Width, ASStepSeekBar2.mBase.Height)
 
Top