Android Question [B4X] [XUI] AS AnimatedCounter not returning to zero

Revisable5987

Member
Licensed User
I have been the ASAnimatedCounter by @Alexander Stolte as it suits my needs perfectly.

One problem I've recently noticed is if I use 'ASAnimatedCounter.Value = 0' the counter will show multiple digits if the previous number was more than 1 digit.
Annotation 2020-06-25 233245.png

Annotation 2020-06-25 233303.png

Annotation 2020-06-25 233318.png


Making the following change in the class seems to have helped.
Hopefully it's the correct solution and of some help.

Original:
Public Sub getValue(v As Int)
'
'CODE REMOVED FOR CLARITY
'
'
If  Not(v = 0) Then
        digitsize = v
        If digitsize.Length > ImageViews.Size Then
        
            AddNew

            else if digitsize.Length < ImageViews.Size Then
        
                RemoveNew

        End If
    
    End If
'
'
'CODE REMOVED FOR CLARITY
'
End Sub

Modified:
Public Sub setValue(v As Int)
'
'CODE REMOVED FOR CLARITY
'
'
If  Not(v = 0) Then
        digitsize = v
        If digitsize.Length > ImageViews.Size Then
        
            AddNew

            else if digitsize.Length < ImageViews.Size Then
        
                RemoveNew

        End If
    Else
        If ImageViews.Size > 1 Then
            RemoveNew
        End If
    End If
'
'
'CODE REMOVED FOR CLARITY
'
End sub


P.S Thanks for a great library :D
 
Top