Hi all,
I've wrote and used this minimalistic slider library in many of my projects, so because I've updated it for a long time and added all custom functionalities I wanted, now I've decided to release it as library.
Attached there is a library .jar and .xml, (copy these to your Addictional Libraries folder) and 2 demo projects to test it, the first is a base project that show the slider horizzontally and vertically, the second test optional animations with interpolators.
This library was completely developed on B4A and because it is a relatively simple class (simpler than others I wrote) I've decided to release the full source code as most of libraries I've developed. This is the first of a long series of libraries I will release that I've developed in last 10 years with B4X, almost all my B4A libraries have a desktop B4J counterpart, some others I only developed for a specific platform.
You can find the library source code inline in the demo 1, if you like, you can make modifications and recompile it to a library (depends on AnimationPlus library). This and other free libraries will soon be available next on my github repository here https://github.com/maxmeli123
I've developed the same library for B4J and I will release it next days.
Features:
- Fully OpenSource library, .jar and .xml provided, demo projects to test it provided, full B4A library source code provided here and on github.
- Fully resizable sliders by settting the layout in the constructor line that create it, eg. you can use small sliders or put a full screen single slider with a big bar
- Minimalistic control, only show a colored bar with borders, a Tag label that is a slider/progress name and can be used to identify any slider and a value label that show the current value
- Any slider/progress have it's parameters that can be customized separately from others
- Full multi touch, any istance of it has separate touch events, this mean that you can move five sliders the same time with five fingers (even more using two hands) and track the moved/released sliders by index in the event callback sub.
- Acts as minimal (generic non customized) slider, it has a label to show the slider name and a label that show it's value
- Acts as minimal (generic non customized) progress bar, it has a label to show the progress bar name and a label that show it's value. Touch control can be disabled
- Bar color and borders can be customized
- Click on labels it set a value 0 or MaxValue
- Fully customizable, the class returns the slider panel and both labels, so they can be customized at runtime, eg you can change labels background color or make it transparent and other things
- Support horizzontal and vertical orientations, it is auto detected by library depending on controls size. If Width > Height then it is horizontal, otherwise vertical
- Support custom max value, it can be set to an integer number, eg from 0 to 100, from 0 to 5000, from 0 to 100000 etc.
- Moved event will be raised when value changed
- Release event will be raised when finger move up
- Support animations with interpolators provided internally by a good @Informatix AnimationPlus library. Note that for B4J I've developed the jAnimationPlus library that is a desktop counterpart and I will release it next on this Forum
- One line of code can create a slider/progress
- One line of code can create a block of sliders/progress (you can access any single slider by index and by tag)
- Touch event can be enabled/disabled when control is created and after creation multiple times trasforming a slider to a progress bar or viceversa
- Events return UserChanged property that specifies if value was changed by user (touch) or by code at runtime
- Main visiblily and/or (indipendent) labels visiblility can be set by code
As I said I've used it on many of my projects and sometime I customized it for a specific project.
I've used it to do some sophysticated things like control a drone and a RC car machine controlled by ESP8266/ESP32 over WiFi from my phone, control some domotics like lights intensity, thermostat temperature etc. I've used it to remotely control my 3D printer over internet and move 5 sliders (at same time) of my motorized midi mixer (I'm musician) and other things.
Changelog
I've wrote and used this minimalistic slider library in many of my projects, so because I've updated it for a long time and added all custom functionalities I wanted, now I've decided to release it as library.
Attached there is a library .jar and .xml, (copy these to your Addictional Libraries folder) and 2 demo projects to test it, the first is a base project that show the slider horizzontally and vertically, the second test optional animations with interpolators.
This library was completely developed on B4A and because it is a relatively simple class (simpler than others I wrote) I've decided to release the full source code as most of libraries I've developed. This is the first of a long series of libraries I will release that I've developed in last 10 years with B4X, almost all my B4A libraries have a desktop B4J counterpart, some others I only developed for a specific platform.
You can find the library source code inline in the demo 1, if you like, you can make modifications and recompile it to a library (depends on AnimationPlus library). This and other free libraries will soon be available next on my github repository here https://github.com/maxmeli123
I've developed the same library for B4J and I will release it next days.
Features:
- Fully OpenSource library, .jar and .xml provided, demo projects to test it provided, full B4A library source code provided here and on github.
- Fully resizable sliders by settting the layout in the constructor line that create it, eg. you can use small sliders or put a full screen single slider with a big bar
- Minimalistic control, only show a colored bar with borders, a Tag label that is a slider/progress name and can be used to identify any slider and a value label that show the current value
- Any slider/progress have it's parameters that can be customized separately from others
- Full multi touch, any istance of it has separate touch events, this mean that you can move five sliders the same time with five fingers (even more using two hands) and track the moved/released sliders by index in the event callback sub.
- Acts as minimal (generic non customized) slider, it has a label to show the slider name and a label that show it's value
- Acts as minimal (generic non customized) progress bar, it has a label to show the progress bar name and a label that show it's value. Touch control can be disabled
- Bar color and borders can be customized
- Click on labels it set a value 0 or MaxValue
- Fully customizable, the class returns the slider panel and both labels, so they can be customized at runtime, eg you can change labels background color or make it transparent and other things
- Support horizzontal and vertical orientations, it is auto detected by library depending on controls size. If Width > Height then it is horizontal, otherwise vertical
- Support custom max value, it can be set to an integer number, eg from 0 to 100, from 0 to 5000, from 0 to 100000 etc.
- Moved event will be raised when value changed
- Release event will be raised when finger move up
- Support animations with interpolators provided internally by a good @Informatix AnimationPlus library. Note that for B4J I've developed the jAnimationPlus library that is a desktop counterpart and I will release it next on this Forum
- One line of code can create a slider/progress
- One line of code can create a block of sliders/progress (you can access any single slider by index and by tag)
- Touch event can be enabled/disabled when control is created and after creation multiple times trasforming a slider to a progress bar or viceversa
- Events return UserChanged property that specifies if value was changed by user (touch) or by code at runtime
- Main visiblily and/or (indipendent) labels visiblility can be set by code
As I said I've used it on many of my projects and sometime I customized it for a specific project.
I've used it to do some sophysticated things like control a drone and a RC car machine controlled by ESP8266/ESP32 over WiFi from my phone, control some domotics like lights intensity, thermostat temperature etc. I've used it to remotely control my 3D printer over internet and move 5 sliders (at same time) of my motorized midi mixer (I'm musician) and other things.
Changelog
- 1.15 First release. Works well but there are touch conflicts when placed on top of AHViewPager due to touch event conflicts on horizontal sliders
- 1.16 - Fixed touch conflict issue on horizontal sliders when placed on top of AHViewPager. The library now internally disable/enable paging when required, no user intervention, just put this after AHViewPager initialization:
B4X:
CustomMinimalSlider1.UseViewPager(Pager) ' Pager is an initialized instance of AHViewPager. With slider blocks you can iterate by index in a for loop to set it. Note that this only required for horizontal sliders, for verticals you can set it but it do nothing.
B4X:CMS1.FireEventMove(False) ' We can disable _Move event, and then reenable it multiple times if needed. (By default True) CMS1.FireEventRelease(False) ' We can disable _Release event, and then reenable it multiple times if needed. (By default True)
Attachments
Last edited: