Android Question Create Animated Counter in runtime

asales

Expert
Licensed User
Longtime User
I'm trying to modify this class:
https://www.b4x.com/android/forum/threads/b4x-xui-animated-counter.90505/
to create the AnimatedCounter programmatically and set the number os digits in runtime, but I have problems in this codes:
B4X:
'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.
 

Attachments

  • AnimatedCounterB4A.zip
    17.7 KB · Views: 191

ALBRECHT

Active Member
Licensed User
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 ?

Regards
Michel
 
Upvote 0

ALBRECHT

Active Member
Licensed User
Why please : the title is
Create Animated Counter in runtime
and there is no mention to create a new thread
i try to understand ?
 
Upvote 0
Top