Hi all - I am attempting to resize a label in Activity_Create through a loop with a timer and am up a creak without a paddle but with lots of noobness.... for some reason I cannot get the timer to work. Has anyone tried something similar? The overall idea is to create the feel that the label is appearing out of nothing.
My code is below.
My code is below.
B4X:
Sub Process_Globals
Dim Timer1 As Timer
Dim ButtonWidth As Int
End Sub
Sub Globals
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("FiveWhyMain")
Dim UnitWidth As Int
Dim GapWidth As Int
UnitWidth = GetDeviceLayoutValues.Width / 6
GapWidth = UnitWidth / 6
'Scale up buttons
Timer1.Initialize("Timer1",1000)
Timer1.Enabled = False
Timer1.Interval = 1000
Do While ButtonWidth < UnitWidth
Timer1.Enabled = True
Timer1_Tick
Timer1.Enabled = False
Loop
If ButtonWidth < UnitWidth Then
Return
End If
End Sub
Sub Timer1_Tick
ButtonWidth = ButtonWidth + 1
Label1.Width = ButtonWidth
End Sub