Android Question B4XSeekBar Stroke Height

LucaMs

Expert
Licensed User
Longtime User
Trying to make you forgive me for that my wrong answer...

B4X:
Public Sub SetSeekBarHeight(Bar As B4XSeekBar, Height As Int, ChangeBaseHeightToo As Boolean, ChangeBaseWidthToo As Boolean)
   Dim Ratio As Float = Bar.mBase.Width / Bar.mBase.Height
 
   Bar.Size1 = Height * .9
   Bar.Size2 = Height
   Bar.Radius1 = Height * 1.1
 
   If ChangeBaseHeightToo Then
       Bar.mBase.Height = Height * 3
   End If
   If ChangeBaseWidthToo Then
       Bar.mBase.Width = Bar.mBase.Height * Ratio
   End If

   Bar.Update
End Sub

The above code has two problems:

1) I don't know how to change the corner radius (mBase)
2) B4J - if after changing the size of mBase in that way you change the size of the form, the B4XSeekBar looks... at least bad! (mBase reset to its original size).

If "no one" ;) finds a solution, delete the two "If" blocks and the two Boolean parameters.


[B4J]
P.S. Changing mBase size cannot be enough, the other components should be then resized too; I tried also setting Base_Resize as public method but without success.
 
Last edited:
Upvote 0
Top