Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
Created August 6, 2010 16:16
Show Gist options
  • Select an option

  • Save shaobin0604/511557 to your computer and use it in GitHub Desktop.

Select an option

Save shaobin0604/511557 to your computer and use it in GitHub Desktop.
public class LyricView extends View {
private Lyric mLyric;
private Sentence mSentence;
public void update(long time) {
mSentence = mLyric.getSentence(time);
invalidate();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Log.d(TAG, "in onDraw");
if (mLyricLoaded) {
drawFocusedLine(canvas);
drawOtherLines(canvas);
} else {
drawErrorMessage(canvas);
}
}
private void drawFocusedLine(Canvas canvas) {...}
private void drawOtherLines(Canvas canvas) {...}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment