B4A Library Clocks library

Offset for Clocks

Quick'n sweet question, Andrew, could the Clocks Lib be modified so as to accept a time offset? Currently Clocks reads system time. If it could be offset, say, with zone times (in units of TicksPerHour), then, for instance, a world time clock could be implemented in no time. Please sleep it over.
 
How to set background image? I tried but not work.

Aclock.SetBackgroundImage(LoadBitmap(File.DirAssets, "clock1.png"))
 
My bad, I got "Aclock.Color = Colors.Black" also so that it doesn't work, sorry Agraham :D
Is there a way to change color of the clock hands?
 
stopper

Hi

I am using the stopper (Chrono) from the example
but when I issue Chrono.Stop, the display is stopping, but when I resume it again Chrono.Start, the display is jumping to the future
meaning if I stopped it on 00:10 waited 10 sec, and start it again, it will continue from 00:20 and not 00:10
what is the problem?
and how can I reset the counter again? (start from 0)

thanks
Shay
 
Chron Countdown

Could someone please help with a chrono coundown timer.I have been trying this for some hours .
 
Hello Andrew,
Just a quick note to thank you very much, indeed, for the clocks library you created.
I am using the analog clock frequently for applications in full screen mode.
Cheers
Robert
 
Analog Clock Scale

Hello Andrew,

Is there a maximum value for clock width/height?

Code: Copy
Panel1.Initialize("")
Activity.AddView(Panel1,10dip,10dip,Activity.Width-20dip,Activity.Width-20dip)
Clock.Initialize("")
Panel1.AddView(Clock,0,0,Panel1.Width,Panel1.Height)

won't draw the analog clock larger than Panel1.Width / 2.
 
There is no limit to the size of the actual view as you can see if you colour the background. However there does seem to be a limit to the size of the dial that seem to maximise at a size of 240 pixels. It looks like the view can scale the dial down for a smaller view but does not scale it up.
 
Thanks a lot for your quick response. 240 pixels...that ties it.
No problem whatsoever, the clock is a great gadget for multi-purpose use.
 
Is it possible to hide the "small blocks for the hours"? And also to replace the stock pointer with own graphics?
 
I wish to display the Hour in the Chronometer and try the following code.

Code: Copy
Sub Activity_Create(FirstTime As Boolean)
  ...
  Chrono.Initialize("Chrono")
  Activity.AddView(Chrono, 20dip, 60dip, 200dip, 60dip)
  Chrono.Color = Colors.RGB(255,102,0)
  Chrono.TextSize = 40dip
  Chrono.TextColor = Colors.RGB(250,235,215)
  Chrono.Gravity = Gravity.CENTER
  Chrono.Format = "H:MM:SS"
  ...
End Sub

Before the Chrono Start, it displays 00:00. After the Chrono Start, it displays H:MM:SS as attached images.

It works fine if we remove the line Chrono.Format = "H:MM:SS".

Please helps. Thanks.
 

Attachments

  • chrono-format-01.png
    chrono-format-01.png
    2.9 KB · Views: 813
  • chrono-format-02.png
    chrono-format-02.png
    3.7 KB · Views: 813
Thanks.

Have further tested and it can show in the format of H:MM:SS when the time elapsed for more than an hour. There is no need to set the format.
 

Attachments

  • chrono-format-03.png
    chrono-format-03.png
    3.6 KB · Views: 735
Miliseconds?

Maybe I'm missing something but I can't figure out how to get 1/10th of seconds in the chrono. :sign0104:

Is this not possible? I'd prefer to only have MM:SS.X where X is 1/10th fractions of the second value.

Hopefully i'm just missing something here...
 
Back
Top