B4A Class [B4X] [XUI] AS ButtonSlider V1.0

First, i spend a lot of time in creating views, some views i need by my self, but some views not and to create a high quality view cost a lot of time. If you want to support me, then you can do it here by Paypal. :)

another week and a new AS View :p with B4X it is too easy to create custom views!
Tested on B4J and B4A, on B4A it has a bug if you slide too fast, i will fix it soon.
2 Years ago I dreamed of such a view like this, but I failed to create it. But now after 1h of work, i do it.:)

Screenshot_20190320-224218__01.jpg
ezgif.com-resize.gif


AS ButtonSlider
Author: Alexander Stolte
Version: 1.01

  • ASButtonSlider
    • Events:
      • DropSlider (LeftTop As Boolean)
      • LeftTopClick
      • ReachedLeftTop
      • ReachedRightBottom
      • RightBottomClick
    • Functions:
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • getButtonOrientation As String
      • getBUTTONORIENTATION_HORIZONTAL As String
      • getBUTTONORIENTATION_VERTICAL As String
      • getLeftTopColor As Int
      • getLeftTopPnl As B4XView
        Gets the LeftTop Panel to add a label for Text
      • getRightBottomColor As Int
      • getRightBottomPnl As B4XView
        Gets the RightBottom Panel to add a label for Text
      • getSliderButtonColor As Int
      • getSliderButtonPnl As B4XView
        Gets the SliderButton Panel to add a label for Text
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • setButtonOrientation (Orientation As String) As String
      • setLeftTopColor (Color As Int) As String
      • setRightBottomColor (Color As Int) As String
      • setSliderButtonColor (Color As Int) As String
    • Properties:
      • ButtonOrientation As String
      • BUTTONORIENTATION_HORIZONTAL As String [read only]
      • BUTTONORIENTATION_VERTICAL As String [read only]
      • LeftTopColor As Int
      • LeftTopPnl As B4XView [read only]
        Gets the LeftTop Panel to add a label for Text
      • RightBottomColor As Int
      • RightBottomPnl As B4XView [read only]
        Gets the RightBottom Panel to add a label for Text
      • SliderButtonColor As Int
      • SliderButtonPnl As B4XView [read only]
        Gets the SliderButton Panel to add a label for Text
In the attachment are 2 examples. (B4A and B4J)
If you have bugs or new features, then write a comment ;)

If you like my work, then spend me a coffe or two :)

Change log:
  • V1.00
    • Release
  • V1.01
    • Over Dragging from the slider is now impossible
Have Fun :)
 

Attachments

  • AS Button Slider B4J Example.zip
    2.6 KB · Views: 480
  • AS Button Slider B4A Example.zip
    4 KB · Views: 551
  • ASButtonSlider.b4xlib
    2.8 KB · Views: 501
Last edited:

asales

Expert
Licensed User
Longtime User
Is possible to use this lib to create a "slide to answer" like this?
1697208589720.png

Thanks!
 

Alexander Stolte

Expert
Licensed User
Longtime User
Is possible to use this lib to create a "slide to answer" like this?
Not with this lib.
I had written a library for such a purpose 2 years ago, but never saw any further need.
But it is realy buggy on B4A.
Works better with B4I.
AS SlideToActionButton.gif

Feel free to adjust it for your needs.
 

Attachments

  • AS SlideToActionButton.zip
    10.7 KB · Views: 59
  • ASSlideToActionButton.bas
    8.3 KB · Views: 46
Top