B4A Library [B4X] [Custom View] lmElapsedTime (and countdown)

This custom view is cross-platform, works for B4A, B4J and should work also for B4I.

UPDATE: V. 2.00 09/15/2025

Added: ActAsCountDown. As the property name suggests, you can now use it as both a countdown timer and an elapsed time counter.
gif.gif


It is a time counter or "elapsed time" (v. 2 - also countdown timer).

You can:
decide whether to display the milliseconds / hours numbers or not;
change the colors;
border and corners;
pause and resume.

java_WvxSa9drwi.gif



UPDATE: V. 1.10
Added two properties and two methods to start counting with an initial value (methods) or to set the initial value (properties).
You should thank @Sagenut for these new features.

PROPERTIES:
  • ActOnClick (*)
  • BGColor - Background color
  • BorderColor
  • BorderWidth
  • ElapsedTime
  • ElapsedTimeString
  • CounterByString V. 1.10
  • CounterByLong V. 1.10
  • CornerRadius
  • FontSize
  • LabelFont
  • Paused
  • ShowMilliseconds
  • ShowHours

METHODS:
  • StartCounter
  • StartCounterFromString V. 1.10
  • CounterFromLong V. 1.10
  • StopCounter
  • PauseCounter
  • ResumeCounter

EVENTS:
  • Click
  • ElapsedTimeChanged
  • StateChanged



BTW, used for a (famous) little game created for testing (to test ChatGPT capabilities).
java_BlaSA3JwGj.png
 

Attachments

  • lmElapsedTime_200.zip
    3.9 KB · Views: 19
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I added the property: ActAsCountdown (and the functionality, of course), but I haven't posted this version yet, I'm waiting for at least 3 "Like"(s) 😁
I was about to write:

"The third "Like" didn't arrive, after @Erel and @micro's, so... catch the new version of the library, anyway" 😁

but then @Claudio Oliveira's "Like" arrived, so... get it anyway! 😄


Updated: v. 2.0.0
(Please, see the first post)
 
Top