Mobile video 12--Display lyrics

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.