Slider - Customizable Simple Slider

This extension provides a flexible way to create and customize sliders in Android applications, allowing you to control their appearance and behavior through simple methods.


Values and parameters for each function:

component_method (6)

  1. InitializeSeekBar(HVArrangement arrangement, String sliderID)
    • Initializes a SeekBar within a specified arrangement and associates it with a unique identifier (sliderID).
    • Sets up labels to display the initial and current values.
    • Adds the SeekBar and labels to the specified arrangement.

component_method (14)

  1. SetStartValueLabel(String sliderID, String text, int color, float size, boolean visible)
    • Sets the properties of the label that displays the initial value of the SeekBar.
    • Allows adjusting the text (text), color (color), size (size), and visibility (visible) of the label.

component_method (7)

  1. SetCurrentValueLabel(String sliderID, int color, float size, boolean visible)
    • Sets the properties of the label that displays the current value of the SeekBar.
    • Allows adjusting the color (color), size (size), and visibility (visible) of the label.

component_method (9)

  1. SetSliderRange(String sliderID, double min, double max, double inc)
    • Sets the range and increment of the SeekBar.
    • Allows defining the minimum value (min), maximum value (max), and increment (inc) of the SeekBar.

component_method (3)

  1. GetCurrentSliderValue(String sliderID)
    • Gets the current value of the SeekBar identified by sliderID.

component_method (5)

  1. GetMinValue(String sliderID)
    • Gets the minimum value of the SeekBar identified by sliderID.

component_method (4)

  1. GetMaxValue(String sliderID)
    • Gets the maximum value of the SeekBar identified by sliderID.

component_method (8)

  1. SetSliderLeftColor(String sliderID, int color)
    • Sets the color of the left side of the SeekBar.
    • Allows defining the color (color) of the left side.

component_method (11)

  1. SetSliderRightColor(String sliderID, int color)
    • Sets the color of the right side of the SeekBar.
    • Allows defining the color (color) of the right side.

component_method (12)

  1. SetSliderThumbColor(String sliderID, int color)
    • Sets the color of the SeekBar thumb.
    • Allows defining the color (color) of the thumb.

  1. SetSliderThumbPosition(String sliderID, double value)
    • Sets the position of the SeekBar thumb based on a decimal value.
    • Allows defining the thumb position (value).

component_event (5)

  1. SliderValueChanged(String sliderID, double value)
    • Event triggered when the SeekBar value changes.
    • Notifies the SeekBar identifier (sliderID) and the value (value).

component_event (4)

  1. SliderStopTracking(String sliderID, double value)
    • Event triggered when the SeekBar stops being tracked.
    • Notifies the SeekBar identifier (sliderID) and the value (value).

component_event (2)

  1. SliderMaxValueSet(String sliderID, double maxValue)
    • Event triggered when the maximum value of the SeekBar is set.
    • Notifies the SeekBar identifier (sliderID) and the maximum value (maxValue).

component_event (3)

  1. SliderMinValueSet(String sliderID, double minValue)
    • Event triggered when the minimum value of the SeekBar is set.
    • Notifies the SeekBar identifier (sliderID) and the minimum value (minValue).

Example video:

aia project:

SliderTest.aia (2.9 MB)

Extension:

JoeDevSlider.aix (16.6 KB)


Credits for the extensions used to make the demo:

  • I used 'TaifunPlayer' to play the music and get the duration and other functions.
  • I used 'TFormat' to get the duration in minutes and seconds of the slider value.

Thanks.
4 Likes

Nice extension, but only integer values ​​can be used as minValue and maxValue. And unlike the Slider component, there is apparently no fixed number of values ​​(100) distributed over an interval.

1 Like

this one with wrong block photo.

1 Like

It's true, I hadn't looked at that, thanks Anke.

The block is resolved, thanks KevinKun.

Nice extension, but at certain values ​​this slider shakes and the displayed value changes continuously.

Yes, thank you very much for the observation, I am making some corrections, I hope to update the extension in a few hours.

Updated extension

Several blocks have changed, now it is simpler but useful, since there are several functions and events that the slider integrated in ai2 does not have.

2 Likes

Can you provide the source code? What IDE did you use to create this extension?

I did it in niotron

hi can i have link of Tformet. i tried to find it everywhere...

TFormat. Search...

Just as Anke said, it is the first thing that appears when searching for TFormat

1 Like