B4A Library Before and after image slider


Active Member
Licensed User
This wrapper is based this github : https://github.com/developer--/before_after_slider
Because this written by Kotlin, so you must add this jar to your project:
Here is code:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub
#AdditionalJar: kotlin-stdlib-1.3.0.jar

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private B4ABeforeAfterSlider1 As B4ABeforeAfterSlider
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Dim bd1 As BitmapDrawable
    bd1.Initialize(LoadBitmap(File.DirAssets, "1.jpg"))
    bd1.Gravity = Gravity.FILL
    Dim bd2 As BitmapDrawable
    bd2.Initialize(LoadBitmap(File.DirAssets, "2.jpg"))
    bd2.Gravity = Gravity.FILL
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
I used it for my colorize black and white photos app to convert black and white photo to color by deepai API , this view help users can compare two 2 photos before and after converting, you can try it here to see how it works, and can rate 5 stars to help me too if you like ^_^