Android Question [Solved] B4AFluidSlider modify steps of values

Discussion in 'Android Questions' started by Frank.G, Jun 16, 2019.

  1. Frank.G

    Frank.G Member Licensed User

    Hi Community,

    I just bought B4A today and already wrote my first program.
    In that program i am using B4AFluidSlider to select values between 25 and 500.
    Basically I would need the values to change in steps of 25, as selecting the detailed value one by one stepwidth is very hard to do. I always end up going up and down between the value I like to have.

    I then changed the slider values from 1 to 20 and multiply the resulting value with 25. That works but now the bubble doesnt show me the actual value wanted but the value between 1 and 20.

    My question now is how can I optain this?
    Either coarse stepping of values or a custom indication in the bubble.
    The search didn't brought anything up so I am asking here.

    Kind regards
    Frank

    Edit: typo
     
    Last edited: Jun 16, 2019
  2. moster67

    moster67 Expert Licensed User

    Last edited: Jun 16, 2019
    DonManfred and Peter Simpson like this.
  3. Frank.G

    Frank.G Member Licensed User

    Thx all for the feedback.

    @moster67
    I see. Thats a possibility

    For now I used your wrapped version.
    I will switch over to the other version and try to add a step property

    Greez
    Frank
     
  4. Frank.G

    Frank.G Member Licensed User

    So, without going to much in the Moduldetails (after the second day using this software) as suggested, I created a kind of snap-to-grid sub.

    Code:
    Sub B4AFluidSlider1_OnPositionChanged (value As Int)
      
    End Sub

    Sub B4AFluidSlider1_OnEndTracking
        
    Dim p As String = B4AFluidSlider1.GetValue / 25
        B4AFluidSlider1.SetValue(
    NumberFormat(p,1,0) * 25)
        
    If EditText1.Text <> "" Then
            refresh
        
    End If
    End Sub
    When releasing the slider it "snaps" to the next nearest 25 step.
    The refresh sub updates my B4ATable when the selection is done.

    Greetz
    Frank
     
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