B4A Library [B4X] [XUI] AS Color Slider Advanced - a Snapchat like color picker

Hey,
i spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal. :)

Features
  • cross-platform compatible
  • set your own color palette as image
  • slim and clean
  • nice transition animation
  • easy to use
B4j: jXUI,JavaObject,jBitmapCreator
B4a: XUi,Reflection,BitmapCreator
B4i: iXUI,iBitmapCreator
Screenshot_20200526-140320.jpg
Screenshot_20200526-140247.jpg
ezgif.com-resize.gif
ezgif.com-resize (3).gif


ASColorSliderAdvanced
Author: Alexander Stolte
Version: 1.00

  • ASColorSliderAdvanced
    • Events:
      • ColorChanged (color As Int)
    • Fields:
      • bc As b4j.example.bitmapcreator
    • Functions:
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • getAnimationDuration As Int
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • setAnimationDuration (duration As Int) As String
      • setColorPaletteBitmap (palette As B4XBitmap) As String
    • Properties:
      • AnimationDuration As Int
      • ColorPaletteBitmap
Changelog
  • 1.00
    • Release
  • 1.01
    • add BaseView property
    • better handling if you swipe fast
    • touch area is now as wide as the circle
Have Fun :)
 

Attachments

  • B4A Example.zip
    3.5 KB · Views: 523
  • B4I Example.zip
    2.8 KB · Views: 458
  • B4J Example.zip
    2.6 KB · Views: 468
  • ASColorSliderAdvanced.b4xlib
    2.6 KB · Views: 546
Last edited:

Phayao

Active Member
Licensed User
Longtime User
Great work - as usual !

One suggestion from my side as amateur: it would be great if there would be a function "setColor" so that the slider can be set to a specific color by the program . For example a user selects a color for drawing and wants to change it a bit later, so the slider would start at the color of the selected object.
Does that make any sense ?

Greetings,
Chris
 

Alexander Stolte

Expert
Licensed User
Longtime User
then the user can set the slider to this color? or is it about being able to set a specific color at the beginning? But if this color does not exist in your palette, then he will not be able to return to this color.
 

adriano.freitas

Active Member
Good Job!
Two suggestions:

1) that you can choose between horizontal and vertical position
2) Adding Alpha, for example, it is currently not possible to choose grayscale or pale color tones.
 

Alexander Stolte

Expert
Licensed User
Longtime User
2) Adding Alpha, for example, it is currently not possible to choose grayscale or pale color tones.
you can add whatever you want to the palette, it just has to be an image. But I think that is not possible to pack an alpha value in a picture. Paint apps surely have their own slider with a value for that.
 

adriano.freitas

Active Member
Thank you very much for the answer, however, in my case, I really need the alpha, so I'll have to look for another solution.
 
Top