Share My Creation A Not-So-Simple Clock - Android Widget

Attachments

  • WiLWidget.zip
    10.2 KB · Views: 223

kimstudio

Active Member
Licensed User
Longtime User
Thanks WiL, very helpful for building a widget with a nice digital number transformation effect. I modified the layout to fit my screen. It seems there are some artifacts there.
I also found my emulator Nox player (7.0) doesn't support widgets...

Screenshot_20210423_194056.jpg
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Hi.

1. Nice. I don't use the emulators at all, but I do know that not all devices support Widgets.

2. By artifacts, do you mean the diagonal lines? They are parking spots for the unused hands of the mini-clocks.

3. On my device I colored them light-blue to match the background closer. You can color them darker for your screen.

4. As noted in #2, I fixed a minor bug. 3 lines, look for "lastSeconds"

5. The relevant section of code for the diagonals(the color goes from white to more transparent - I didn't want them to disappear altogether):

B4X:
If sevenThirty < .05 Then
    Dim angle As Float = 30 * (pos - 3)
    Dim newX As Float = clock.centerX + clock.radius * CosD(angle)
    Dim newY As Float = clock.centerY + clock.radius * SinD(angle)
    cv.DrawLine(clock.centerX, clock.centerY, newX, newY, Colors.ARGB(35, 200, 200, 220), 1dip) '<== light blue that gets diluted each animation step
End If

You might just want to experiment with the transparency parameter: say 45 instead of 35.
 
Last edited:
Top