Android Question Flashing colour for text

nicholas.jj.taylor

Member
Licensed User
Longtime User
Back in the days of the BBC (the computer, not the broadcasting corporation :p), we had colours that would blink or flash.

I have a project where this feature would come in handy, and would like to know a standard way for either making a text field automatically toggle between visible or invisible, or the EditText's text colour to flash between two colours e.g 0xFFFF0000 and 0xFF880000

How should I achieve these two effects?
 

DonManfred

Expert
Licensed User
Longtime User
You can use a simple timer and a global variable for that.
 
Upvote 0

nicholas.jj.taylor

Member
Licensed User
Longtime User
Brilliant, thanks Manfred.

I didn't want to go off and play with timers if there was already a function to do it for me e.g.

B4X:
Dim IntColour1 As Int = 0xFFFF0000
Dim IntColour2 As Int = 0xFF880000
Dim IntBlinkIntervalInTicks As Int = 500

EditText.TextColour = Colours.Blink(IntColour1, IntColour2, IntBlinkIntervalInTicks)
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
Thank you for your reply. I didn´t know that there already is this .Blink(...) avaiable.
No, this Blink function does not exist.
Usually, in the Android world (and I would say in most modern apps), it's a symbol/icon that blinks, not the text beside.
If you don't want to use a timer, you can use an endless animation that changes the transparency of the TextView.
 
Upvote 0

nicholas.jj.taylor

Member
Licensed User
Longtime User
Unfortunately, I do not have the room for an additional icon.

I haven't used the animation feature yet, and do not know how to do so.

Do I need to enable any additional libraries? Is there a tutorial or thread that you know of to help get me started?
 
Upvote 0
Top