B4A Library [Class] Vertical, Horizontal and Circle Seekbars

Two things that are missing in the core Seekbar -
1. Vertical Seekbar
2. Control of the colors.

the Attached Vertical seekbar class has both. I added a horizontal seekbar class to be compatible with the vertical.

The two classes are independent.

In the photo you can see the core seekbar as well for comparison.

Edit: Version 2 - correction of mistake + addition of caret size method.
Edit: Version 3 - improvement of looks - the caret is shown completely at the edges.
Edit: Version 4 - uses the Double Gradient Drawable class [Class] Double Gradient Drawable and the number of views and complexity is reduced meanungfully.
Edit: Version 5 - without the gradient class.
Edit: version 6 - works as a custom view in the designer (b4a ver. 2.71). 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.
Edit: Ver. 6.1 - ver 6 worked nicely until I tried it on a different size device... Now it works. The example includes "size" class to adapt.

Edit: Ver 7 includes a CircleSeek Class. Like the Vertical and Horizontal bars, it can be defined as custom view in the designer or by code. If defined by designer put MaxValue as Text and True as Tag if you want to have the knob. If defined by code, call CodeCreateView right after initialization.
The picture shows one circle with colors set and the lower is with default colors and knob.
Important: you must call setValue at least once for the view to be displayed.

Edit: Ver 7.1 adds another display option - with long arrow as the knob (see photo). Selection done between 3 options to put as Tag in the custom view :- 0 -no knob, 1 - short knob, 2-long knob , or in CodeCreateView call as WithKnob.

Edit: Version 7.2 - circlebar allows for small value changes although the display is with no fractions (changing some values to double).
Edit: Version 7.3 - circlebar looks fine on high resolution devices (I didn't notice but it was bad before...), by increasing the lines density.
Edit: Ver 8.0 now has min value and max value. Also additional class named CicrleScale is added to the group, with vintage kind of display - hand and scale. There is also a possibility to add a shadow to the hand (like in the lower object) using my shadow class which is attaced as well.
 

Attachments

  • Circle7.1.png
    Circle7.1.png
    100.1 KB · Views: 2,554
  • circlscale.png
    circlscale.png
    48.5 KB · Views: 1,705
  • Seekbars_8.zip
    14 KB · Views: 1,362
  • circleScale.zip
    18.5 KB · Views: 839
Last edited:

tdocs2

Well-Known Member
Licensed User
Thank you for sharing. Excellent work on the seek bars!

Best regards.

Sandy
 

JTmartins

Active Member
Licensed User
I would like to be able to handle values from negative to positive...a range like -10 to + 10.

any help ?
 

merlin2049er

Well-Known Member
Licensed User
Got the vertical sliders in my app. Just having difficulty positioning them (on a tablet). They look fine on a phone.
 

derez

Expert
Licensed User
Ver 7.3 - circlebar looks fine on high resolution devices (I didn't notice but it was bad before...), by increasing the lines density.
 

derez

Expert
Licensed User
Ver 8.0 now has min value and max value. Also additional class named CicrleScale is added to the group, with vintage kind of display - hand and scale. There is also a possibility to add a shadow to the hand (like in the lower object) using my shadow class which is attaced as well.
 

freetoair

Member
Licensed User
why do I get this error during compile:

Compiling generated Java code. Error
B4A line: 13
Private Activity As Activity
javac 1.8.0_60
src\derez\circleseek\hseekbar.java:79: error: cannot find symbol
_activity = new anywheresoftware.b4a.objects.ActivityWrapper();
^
symbol: variable _activity
location: class hseekbar
1 error
 

derez

Expert
Licensed User
I'm not at home, touring amazing Japan. I'll be able to check only in one more week.
 

freetoair

Member
Licensed User
We get that message when I try to compile demo program that was downloaded from the post #1. But it's alright, i'am now rewrote only part of the H-bar, probably was some typo.

regards!
 
Top