Android Custom View 102 (Part 9)

A RatingBar Example

Guowei Lv

1 minute read

There is nothing new here, just another exercise.

Two things to be careful with:

  1. Try to call validate() as fewer times as possible, it is expensive.
  2. If you want to handle the touch events in this manner, remember to return true from onTouchEvent(). Otherwise, only the first event will be triggered(most likely DOWN in this case) and not the succeeding ones (like the MOVES).

Source Code

comments powered by Disqus