B4A Library AnimatedCheckbox V1.0.1

This is a wrapper for this github project.

AnimatedCheckbox
Version:
1
  • AnimatedCheckBox
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • BringToFront
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • isChecked As Boolean
    Properties:
    • Background As Drawable
    • Checked As Boolean [write only]
    • CircleColor As Int [write only]
    • Color As Int [write only]
    • CorrectColor As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Tag As Object
    • Top As Int
    • UnCheckColor As Int [write only]
    • Visible As Boolean
    • Width As Int

If you want to donate for my work building the class you can do it here:
 

Attachments

  • libAnimatedCheckbox.zip
    9.7 KB · Views: 479
  • AnimatedcheckboxEx.zip
    7.8 KB · Views: 515
  • libAnimatedCheckboxV1.0.1.zip
    11 KB · Views: 533
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Can you put the event _click on this library?
I´ve tried to set one but if so the animation does not start anymore.
BUT i´ve aded a "onCheckedChange"
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
    chk1.CircleColor = Colors.Blue
    chk1.CorrectColor = Colors.Green
    chk1.UnCheckColor = Colors.Yellow
    chk1.Checked = True
    chk1.Tag = "1"
    chk2.Tag = "2"
End Sub
Sub chk_onCheckedChanged(isChecked As Boolean)
    Log("chk_onCheckedChange()")   
    If Sender Is AnimatedCheckBox Then
        Dim chk As AnimatedCheckBox = Sender
        Log($"${chk.Tag} is now ${isChecked}"$)
    End If
End Sub

Please find updated lib and example files in post #1
 

JDS

Active Member
Licensed User
Longtime User
Hi DonManfred,

Create lib. I've tried to include it in my project however I get a strange error.
The example works but when I try to bind it in to my own project I get the following error (the program doesn't even compile).

B4X:
B4A Versie: 7.80
Controleren code.    (0.26s)
Compileren code.    (0.37s)
Compileren weergaven code.    (0.05s)
Bibliotheken organiseren.    (0.00s)
Generating R file.    (0.06s)
Compileren gegenereerde Java code.    Error
B4A line: 36
If Sender Is AnimatedCheckBox Then
javac 1.8.0_152
src\lmmobile\jds\android\lm_testmodule.java:443: error: cannot find symbol
if (anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA) instanceof com.github.TouchCheckBox) { 
                                                                                      ^
  symbol:   class github
  location: class com

Any thoughts?
 

DonManfred

Expert
Licensed User
Longtime User
It is one of my first libraries... Few years old.
Additionally i lost the lost last year with my HDD crash.
I dont think that i cn saw anything about as i´m not able to verify it with the library source.
You can try it this way
B4X:
Sub chk_onCheckedChanged(isChecked As Boolean)
    Log("chk_onCheckedChange()")   
    Dim chk As AnimatedCheckBox = Sender
    Log($"${chk.Tag} is now ${isChecked}"$)
End Sub
If this does not work either then you need to find another checkbox library.
 

JDS

Active Member
Licensed User
Longtime User
Too bad. Error persists

B4X:
B4A Versie: 7.80
Controleren code.    (0.30s)
Compileren code.    (0.60s)
Compileren weergaven code.    (0.06s)
Bibliotheken organiseren.    (0.00s)
Generating R file.    (0.06s)
Compileren gegenereerde Java code.    Error
B4A line: 699
Dim chk As AnimatedCheckBox = Sender
javac 1.8.0_152
src\lmmobile\jds\android\lm_tebezorgen.java:888: error: cannot find symbol
_chk.setObject((com.github.TouchCheckBox)(anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA)));Debug.locals.put("chk", _chk);
                   ^
  symbol:   class github
  location: class com
 
Top