Cover Chart:
Brief introduction
- The Wave music is an open source Android online music player.
- Play local music and online music
- Online music charts, such as hot songs, new songs, etc.
- Gao Music's vinyl album cover
- Lyrics Show, automatically search lyrics
- Night mode
- Timed shutdown
Update description
v 1.0
I release
Todo
Online music can be downloaded and added to my music list
Online music Automatic Caching
Edit Music Information
Project Disclosure API
Online music: Baidu Music
Weather data: German map
Open Source Technology
Okhttp-utils
Android-universal-image-loader
Critical code
Black Gum album cover drawing process
@Override protected void OnDraw (Canvas Canvas) {//1. Draw the top dotted line mtopline.setbounds (0, GetTop (), getwidth (), GetTop () + M
Toplineheight);
Mtopline.draw (canvas); 2. Draw the black vinyl record outside the translucent border mcoverborder.setbounds (Mdiscpoint.x-mcoverborderwidth, Mdiscpoint.y-mcoverborderwidth, MDis Cpoint.x + mdiscbitmap.getwidth () + mcoverborderwidth, Mdiscpoint.y + mdiscbitmap.getheight () + MCoverBorderWidt
h);
Mcoverborder.draw (canvas); 3. Draw black glue//Set rotation center and rotation angle, setrotate and pretranslate order is important mdiscmatrix.setrotate (Mdiscrotation, Mdisccenterpoint.x,
MDISCCENTERPOINT.Y);
Set Picture start coordinates mdiscmatrix.pretranslate (mdiscpoint.x, MDISCPOINT.Y);
Canvas.drawbitmap (Mdiscbitmap, Mdiscmatrix, NULL);
4. Draw cover Mcovermatrix.setrotate (Mdiscrotation, Mcovercenterpoint.x, MCOVERCENTERPOINT.Y);
Mcovermatrix.pretranslate (Mcoverpoint.x, MCOVERPOINT.Y);
Canvas.drawbitmap (Mcoverbitmap, Mcovermatrix, NULL); 5. Draw the pointer mneedlematrix.setrotate (mneedlerotation, Mneedlecenterpoint.x, MneedlecenteRPOINT.Y);
Mneedlematrix.pretranslate (Mneedlepoint.x, MNEEDLEPOINT.Y);
Canvas.drawbitmap (Mneedlebitmap, Mneedlematrix, NULL);
}
Lyrics drawing Process
@Override protected void OnDraw (Canvas Canvas) {Super.ondraw (Canvas);
Center y coordinate Float centery = getheight ()/2 + MTEXTSIZE/2 + manimoffset;
No lyrics file if (!HASLRC ()) {Float CenterX = (getwidth ()-mcurrentpaint.measuretext (label))/2;
Canvas.drawtext (Label, CenterX, CenterY, Mcurrentpaint);
Return
///Draw Current line String currstr = Mlrctexts.get (mcurrentline);
float Currx = (getwidth ()-Mcurrentpaint.measuretext (CURRSTR))/2;
Canvas.drawtext (Currstr, Currx, CenterY, Mcurrentpaint);
Draws the for (int i = mCurrentLine-1 i >= 0; i--) {String upstr = mlrctexts.get (i) above the current line;
float UpX = (getwidth ()-Mnormalpaint.measuretext (UPSTR))/2;
float upy = centery-(mtextsize + mdividerheight) * (mcurrentline-i);
Out of screen stop drawing if (Upy-mtextsize < 0) {break;
} canvas.drawtext (Upstr, UpX, Upy, Mnormalpaint); //To draw the for (int i = mcurrentline + 1; i < mlrctimes.size (); i++) {String downstr = MLRCTexts.get (i);
float Downx = (getwidth ()-Mnormalpaint.measuretext (DOWNSTR))/2;
Float DownY = centery + (mtextsize + mdividerheight) * (I-mcurrentline);
Out of screen stop drawing if (DownY > GetHeight ()) {break;
} canvas.drawtext (Downstr, Downx, DownY, Mnormalpaint);
}
}
Above is the Android open source online music player data collation, follow-up continue to supplement the relevant information, thank you for the support of this site!