With this, I can only alternate flash about 1 second,
Without the "sleep(0)" it will not show at all.
FlashTimer.Initialize("FlashTimer",1000)
...
Sub Flashtimer_tick
LabelFlash.BringToFront
Log("Flash On")
Sleep(0)
LabelFlash.SendToBack
Log("Flash Off")
End Sub
Sorry, I guess I didn't properly explain,
I need to control how long the text is visible, Not how fast it flashes.
Example: Label.visible for 1 millisecond (.001) to 1 second (1).
Sorry, I guess I didn't properly explain,
I need to control how long the text is visible, Not how fast it flashes.
Example: Label.visible for 1 millisecond (.001) to 1 second (1).
If you use the Flashtimer_tick code that Brandsum posted & set your FlashTimer interval to whatever you want, it will flash on/off for that duration. The other option would be:
B4X:
flashLabel(500) 'show label for 500ms
Private Sub flashLabel(duration as Int)
LabelFlash.Visible = True
Log("Flash On")
Sleep(duration)
LabelFlash.Visible = False
Log("Flash Off")
End Sub
- Colin.
I did try it, all the way down to FlashLabel(1) = 1 millisecond.
Should I be able to see a text being flashed at me for (1 millisecond) ???
I need to flash the text fast enough , NOT to be able to see.
Maybe, if there's a way to flash the text less then 1 millisecond?
I did try it, all the way down to FlashLabel(1) = 1 millisecond.
Should I be able to see a text being flashed at me for (1 millisecond) ???
I need to flash the text fast enough , NOT to be able to see.
Maybe, if there's a way to flash the text less then 1 millisecond?
Yes - I tried it down to 1ms & could still see it. I guess the time that it takes to make the label visible & then invisible again is more than that. Maybe a stupid question, but why do you want to flash the label if the objective is for someone not to see it? Why not just make it invisible?
There is no such thing in Android like showing an UI-Element for 1 Millisecond. And also not for less then 1ms.
You should expect your Device is doing something other. Or your activity can be paused.
I suspect it's a limitation of the hardware not being able to process the requests fast enough. In theory, if you had an Android "super device" capable of drawing the screen at 1000+ frames per second it could be done.