Over the last two days I've started back working on the interface for allowing a user to enter in lines on their ticket to be checked against the latest results. So far the functionality exists where a row of EditText boxes are dynamically added to a linear layout along with a button which reads "Add Line". When the user clicks the button, it runs through each of the text boxes first making sure that the input is valid, then checking that the input is not a replication of an entry in one of the previous text boxes. After checking for each of these conditions on each edit box, if they meet the criteria they are appended to an array in a specific format that can be used to check against the results in the results class. A text view is updated with this line to show that the user has entered a line in for checking. If a user wants to add another line to be checked, the new line will also be checked against the existing lines in the text view.
I've started using the Toast class for displaying messages when a user tries to input data that is doesn't meet the described conditions (i.e. numbers) which actually reminds me of something I had forgotten. I currently don't have something to ensure that numbers entered are above 0 and below what ever the highest number that can be picked for each game is. I'll get back on that tomorrow.
Other updates include the addition of a Stats class which is used for storing information about winnings. The functionality for parsing the winnings table from the accessible results has also been added. The winnings table displays information about the number of winners of each winning combination of numbers, the number of Irish jack pot winners, and how much each winning combination has won. In the Stats class it keeps a linked list of Stat objects which stores a row of the winnings table. I'm thinking it might be a better idea to store it in a HashMap instead, because then if I pass a Stats object through the lotto checker activity I can get specific Stat objects using based on how many numbers the user has matched as a key. This should make displaying how much the user has won quite a great deal easier.
No comments:
Post a Comment