B4A Library [Class] Vertical, Horizontal and Circle Seekbars

miquelr

Member
Licensed User
Longtime User
tag property

Awesome class and thanks for share it, but it not have the 'tag' property, that is very usefull to passing values when some instances of the object is used in diferents parts of the program.
Do you plans to introduce the tag property in the future?
 

miquelr

Member
Licensed User
Longtime User
oops..
For a moment i forgot that vseek is a classe, not a lib.
I have included a tag for my convenience.
Thanks..
 

derez

Expert
Licensed User
Longtime User
Custom View

B4a ver. 2.71 let us use the designer for custom view.
The seekbars were updated (ver 6 in the first post) to work both ways.

Use the "text" property to define the max value of the bar. If you want to define the view by code, use "initialize", then "CodeCreateView" . In the example, Vbarcv is defined by code and Hbarcv by the designer as customview.
 

derez

Expert
Licensed User
Longtime User
Can you upload your project ? there may be many reasons...
 

derez

Expert
Licensed User
Longtime User
you didn't define the seekbar in the designer.
Look at my example file and see the definition of Sbar in the designer (and this has nothing to do with the Vseekbar or Hseekbar classess).
 

sonra

Member
Licensed User
Longtime User
A new try

Hi
I attach the new version. I don't know why the was problem in previous I stiil don't see the seekbar as in sww it whwn irun your class ( to my knowledge I used the same parameters as you in the designer ) please let me know what is wrong
I run my example on ASUS tf700 in both cases ( your class and my example )
but the seekbar has another control view
regards Doron

View attachment SeekBarSimple.zip
 

derez

Expert
Licensed User
Longtime User
The program you attached is ok and runs fine on the emulator, the bar is visible and moves.
 

derez

Expert
Licensed User
Longtime User
This looks like the "ICS like seekbar" class. Are you sure you run the same program as you attached before ?
 

sonra

Member
Licensed User
Longtime User
found the probem with SeekBar

Hi
I finally found the problem it is in the AndroidManifest.xml file
in one line
the good one is

<uses-sdk a"]ndroid:minSdkVersion="4">

and for some reason when I start a project the line is

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>

and for this reason I get the seekbar in emulator or device like shown in pic attach to me previous post
Does anyone why i got the file like this and how to prevent it ?
regards Doron
 

derez

Expert
Licensed User
Longtime User
Doron
It is not an answer to your post, it is an announcement of a new version of this class.
 

Locutus

Member
Licensed User
Longtime User
First of all thanks for such a useful class. I have successfully used it in my program however, when trying to position it using designer scripts I am unable to do so.

Is there a way to reposition the view after the program has loaded? Either programatically or via designer scripts would be fine.
I tried programatically but it just leaves a white area where the view originally was.
 

derez

Expert
Licensed User
Longtime User
Please give more details/code.
The example is doing it with the designer, check.
Re-positioning of the view, when defined by the designer, requires access to the base panel of the custom view (that is the white area), I don't know how to do it.
To re-position the bar when defined by code, use bar.asview.setlayout(...
 
Last edited:

derez

Expert
Licensed User
Longtime User
Is there a way to reposition the view after the program has loaded
There is a way, requiring the following changes:
B4X:
Private Sub DesignerCreateView(base As Panel, Lbl As Label, Props As Map) 'ignore
mybase = base ' mybase is a global panel
mybase.Left = Lbl.Left
mybase.Top = Lbl.top
mybase.Width = Lbl.Width
mybase.Height = Lbl.Height
Hbase.Initialize("")
base.AddView(Hbase,0, 0, Lbl.Width, Lbl.Height)

H = Lbl.Height
W = Lbl.Width
MaxV = Lbl.text
ContinueCreation
End Sub

B4X:
Public Sub SetLayout(Left As Int,Top As Int,Width As Int,Height As Int)
mybase.SetLayout(Left,Top,Width,Height)
Hbase.SetLayout(0, 0, Width,Height)
H = Height
W = Width
ContinueCreation
End Sub

The base panel (MyBase) exists only in the designer created view, so it will probably cause an error when used on code created view like this bar.SetLayout instead of bar.AsView.SetLayout.

I will not add it to the published version.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…