Nov 18, 2010
I'm trying to create a game lobby for a project, and I'd like the game's status text to be a different color: red for an "[IN PROGRESS]" game and green for a game that's "[Waiting for x players]". The ListView will be populated with data, and each ListView item will have a game ID and then immediately to the right of that the game's status.
View 1 Replies
Right now I'm essentially using the Hello ListView code to create my ListView.
Then, I have a refresh button that obtains data from our database. It will get two Strings, one for the ID of the game, and the other for the status of the game. If the game status is 0, then it's still waiting for players. If the game status is 1, then the game has started. So, I create a gameItem to add to the gameList:
This is where I'm stuck. I don't really understand how I can alter the specific TextView when I create the gameItem or when I add that to the gameList. There isn't a way I can see of accessing the TextView's properties. I see how the text of the view is set (through the mapping of the strings to "line1" and "line2", but I don't know how to change any of the properties.