Animating a horizontal bar vertically down the screen every minute
I'm trying to build a public transport app and based on a departure station and arrival station the ap开发者_高级运维p will display all possible connections departing immediately and for the next hour or so.
On the screen there will be a red horizontal line that will scroll down the screen every minute or so like an actual clock to give the user a visual cue as to which connection is available and which ones have already left. I have looked into TranslateAnimation which allows me to move my horizontal bar down the screen but I'm not sure how to control it so that it continually moves down the screen every minute. I've thought about combining my animation with the AlarmManager but that seems like overkill for what I am trying to do.
Does anybody know of a better way to accomplish this?
Thank you in advance.
You can use simple timers which I posted here: Various ways to handle timing in Android
A simple post delayed method can call itself every minute.
精彩评论