问题

I want a square progressbar like in above images, which should change color at certain condition.
Exactly like zynga poker.
lets take total duration is 6 seconds.
2sec-green
2sec-yellow
2sec-red
As this
回答1:
You can use canvas for making a custom view like this. For more info: http://developer.android.com/reference/android/graphics/Canvas.html
Example Android canvas draw rectangle
Logic You need to draw 4 lines, then start erasing them using timer. After each line is erased completely, change color of other lines, and so on.
来源:https://stackoverflow.com/questions/24218153/how-to-make-a-square-progress-bar-with-changing-color-in-certain-time-interval