'Based in the B4x CustomView Booklet chapter 4.2 of Klaus
Public Sub AddToParent(Parent As Activity, Left As Int, Top As Int, Width As Int, Height As Int)
mBase.Initialize("mBase") '*** ERROR: Unknown member: initialize
Parent.AddView(mBase, Left, Top, Width, Height)
End Sub
'don't change the digits
Public Sub setDigits(d As Int)
mdigits = d
End Sub
Public Sub getDigits As Int
Return mdigits
End Sub
The example to B4A is attached.
Thanks in advance for any tip to implement this options in this class.
The correct way to add custom views is with the designer. You can create a layout with a single counter and load it multiple times.
About the digits, you will either need to learn the code and modify it to support updating the digits or create several layouts with different number of digits.
Hello, do you think it would be possible to modify that kind of animated counter class with negative values range ,
for example like : from -100 to +100 ?
or should i create a completely new class for a such need ?