Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Implementation

Setting Preferences

  • The preferences screen was implemented using the Android spinner widget for the drop-down menus.
  • The app uses the phone's persistent storage for saving preferences across usages of the app.

Betting Activity

  • The betting screen was implemented by drawing textstext, numbers and figures images on an Android canvas. The content of textstext, values of numbers, and the position of figures images are decided by user’s actions, which are detected by tracking the position and behavior of the user’s finger.
  • The whole screen is divided into different rectangular areas (I call them boxes) that represent different alternatives options in each category (location, price, cuisine) as well as the three piles of chips (5, 10 and 25). Each box keeps record of the number of each type of chips currently inside the box. The numbers (chips left, total points for a category) are updated based on the record of chips in each box.
  • OnTouch An event listener is used to capture user’s actions. When the user taps the screen, the app checks if the position is inside any box and changes the value of a status variable to record the starting box of current the action. If the starting box has chips, when the user moves his finger, there is going to be a chip following his/her finger. At the same time, each box recalculates the number of chips in it or the total points of chips left to decide the updated number of chips to show in the box. When the user’s finger leaves the screen, the position is checked and we decide based on the position whether or not it’s a effective action to put the action results in the chip in moving to a new location( box). Then all the numbers and status are updated and redrawn.
  • To make the app more playable and enable all the direct manipulations that a user can expect. The , the betting screen enables users to “drag” chips instead of just clicking the chip and clicking one destination. Also, it enables users to move chips freely, including moving from chip piles to betting table, moving within the betting table, and removing from the betting table.
  • To make clearer feedback of clearly indicate wrong actions, vibration is added when the user fails to put a chip in an effective a correct place.
  • Making it The betting screen is made more realistic by making a chip pile empty when the chips left is smaller than the face value of a pile.The betting screen was implemented by drawing texts, numbers and figures on an Android canvas. The content of texts, values of numbers and the position of figures are decided by user’s actions, which are detected by tracking the position and behavior of user’s fingernot displaying chip piles of denominations greater than what the user has available for betting.

Spinner

  • The spinner is implemented using Android's drawing APIs to draw wedges of a circle on a canvas, and draw text on top. The backend keeps track of the amount of rotation applied so far, and drawing is done relative to that amount of rotation. The spin animation is achieved by increasing or decreasing the degree rotation at timed intervals, and redrawing the wheel. A swipe gesture is detected by dividing the screen into quadrants and waiting for a finger-swipe that starts and ends in adjacent quadrants.
  • The victor is determined by precomputing the final wheel spin once the user starts spinning the wheel, and computing which wedge is under the pointer drawn on the screen when the wheel is in its final location. The winner is predetermined so that a user can't game the system by trying to stop the wheel in a particular position.

...