B4A Library CountDownTimerView V2.0

This is a wrapper for this Github project.

V2 is a rewrite of the library using the new CustomProperties provided by B4A 5.8

CountDownTimerView
Version:
2
  • CountDownTimerView
    Events:
    • onFinish ( As )
    • onTick (msToFinish As Int)
    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)
    • startCountDown
    • stopCountDown
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Hours As Long [read only]
    • Left As Int
    • MilliSeconds As Long [read only]
    • PrefixText As CharSequence
    • Seconds As Long [read only]
    • SuffixText As CharSequence
    • Tag As Object
    • Time As Long [write only]
    • Top As Int
    • Visible As Boolean
    • Width As Int

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

Attachments

  • libCountDownTimerView.zip
    6.7 KB · Views: 680
  • libCountDownTimerViewV2.0.0.zip
    12.9 KB · Views: 744
  • CountDownTimerEx.zip
    8.7 KB · Views: 744
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hi, nice countdown timer.
You need to fix the timer events in the example.

Sub tmr1_onTick(msToFinish As Int)
Log($"tmr1_onTick(${msToFinish})"$)

End Sub
Sub tmr1_onFinish()
Log($"tmr1_onTick()"$)



End Sub

Oh, I can't seem to position that tmr label. :( I had it horizontally centered and it was left justified...
 

maurizio barbera

Member
Licensed User
Longtime User
hello, I have followed the example attached zip file but the event does not run OnTick and onFinish but view in log

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (starter) Start **
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd1_onfinish()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
lib:Raising.. cd2_ontick()
** Activity (main) Pause, UserClosed = false **
lib:Raising.. cd2_onfinish()
 

DonManfred

Expert
Licensed User
Longtime User
the event does not run OnTick and onFinish
I´ve rewritten the wrapper using the new B4A custom properties in 5.8

See updated libfiles and new example in Post #1
 

maurizio barbera

Member
Licensed User
Longtime User
I'm sorry, I was trying the new release 2:00 .. I noticed some changes in the designer properties are not reflected on the run ... type: horizontal / vertical alignment or border color and border colors / backcolor / textcolor ... it is normal some properties of the designers are not modifiable by the runtime? than those written in the first post --- thanks maurizio
 
Last edited:

GMan

Well-Known Member
Licensed User
Longtime User
Hoi DonManfred,

does it also still work in 5.5 `?
Asking BEFORE i invest time
 
Top