1_ Create lyrics Display class Lyricshow
1_ Create lyrics Display class Lyricshow: Text Size, antialiasing, center alignment
public class Lyricshow extends TextView {private arraylist<lyric> lyrics; /** * Brush * */private Paint currentpaint; Private Paint Nocurrentpaint; Callback this method when instantiating in a layout file public lyricshow (context context, AttributeSet Attrs) {Super (context, attrs); TODO auto-generated Constructor stub Initview (); } @Override protected void onsizechanged (int w, int h, int oldw, int oldh) {//TODO auto-generated method stub Super.onsizechanged (W, H, OLDW, OLDH); width = w; Height = h; } private void Initview () {currentpaint = new Paint (); Set anti-aliasing Currentpaint.setantialias (true); Set color Currentpaint.setcolor (Color.green); Sets the text size currentpaint.settextsize (16); Set the alignment currentpaint.settextalign (Paint.Align.CENTER); Nocurrentpaint = new Paint (); Set anti-aliasing Nocurrentpaint.setantialias (true); Set color Nocurrentpaint.setcolor (Color.White); Sets the text size nocurrentpaint.settextsize (16); Set the alignment Nocurrentpaint.settextalign (Paint.Align.CENTER); } @Override protected void OnDraw (canvas canvas) {//Super.ondraw (canvas); Canvas.drawtext ("No lyrics found", Width/2, HEIGHT/2, Currentpaint); }}
2_ the lyrics-the current sentence-the previous sentence-the following sentence
Mobile video 12--Display lyrics