CS 491 Lecture 12 – Continuous rendering and gestures
Before class
A
Before next class:
- Watch http://youtu.be/spSomawdgTg.
- Skim http://developer.android.com/reference/android/view/SurfaceView.html.
B
Before next class:
- Watch http://youtu.be/T_Z9lNQVaNg.
- Browse http://developer.android.com/reference/android/gesture/package-summary.html.
In class
Write a continuous renderer that draws a number word like “one”, “two”, “three”, and so on, which gets bigger and bigger and bigger over time. If the user draws the corresponding gesture—a 1, 2, 3, …—generate and draw a new word. If the scale gets too big before the gesture is entered, penalize the user in some fashion. Perhaps the users get three chances.
Use a GestureOverlayView and SurfaceView in a FrameLayout.
Avoid race conditions! If you your UI thread and drawing thread access the same data, lock away that access in a block synchronized on the holder.