Bonny music
Since Baidu has closed the ONLINE music API interface, the online music function of this APP is invalid. So far, no alternative has been found. It is not a bug, please do not be surprised.
series
- Android open source online music player – Pawnee Music
- Android open source music Player player basic functions
- Android open source music player high imitation cloud music vinyl records
- Android open source music player automatic scroll lyrics
- Android Open source Music Player online music list automatically loading more
preface
Graduation design to do the project, after the defense, to share out.
- Project address: github.com/wangchenyan…
- Please refer to the following questions
- If you like, welcome Star!
Introduction to the
Pawnee Music is an open source Android online music player.
- Play local and online music
- Online music charts, such as hot songs charts, new songs charts, etc
- High imitation cloud music vinyl album cover
- Lyrics display, automatic search lyrics
- Edit song information
- Night mode
- Timing closure
Updated instructions
V 1.3.0
- New lyrics support drag up and down
- Added support for split screen mode
- Added support for filtering local songs by size and duration
- Newly downloaded song files automatically add album cover
- Added edit song information
- Added systems above 5.0 support interworking system media center, lock screen display playback information
- Fix known bugs
V 1.2.3
- Added notification bar play control
- Fixed an issue where meizu phone could not scan music
- Fix known bugs
V 1.2.0
- Fixed an issue where online music would not load
- Fixed ANR issue when playing Internet songs on weak network
- Fixed an issue where daily startup images could not be updated
- Downloads of online songs now display album artwork
- Fix known bugs
V 1.1.0
- Support for Android 6.0 runtime permissions
- Fix known bugs
V 1.0.0
- First Release
Download address
V1.3.1
Github.com/wangchenyan…
TODO
- Online music can be added to my music list without downloading
- Automatic online music caching
- Edit music information
project
Public API
- Online music: Baidu Music
- Weather data: Amap
Open source technology
- okhttp-utils
- Glide
The key code
Vinyl album cover painting process
@Override protected void onDraw(Canvas canvas) { // 1. Draw the top dashed line mtopline.setbounds (0, 0, getWidth(), mTopLineHeight); mTopLine.draw(canvas); // 2. Draw mCoverBorderWidth bounds (mdiscPoint. x - mCoverBorderWidth, mDiscPoint.y - mCoverBorderWidth, mDiscPoint.x + mDiscBitmap.getWidth() + mCoverBorderWidth, mDiscPoint.y + mDiscBitmap.getHeight() + mCoverBorderWidth); mCoverBorder.draw(canvas); // set the rotation center and rotation Angle, SetRotate and preTranslate order are important. Mdiscmatrix.setrotate (mDiscRotation, mDiscCenterPoint. Mdiscmatrix.pretranslate (mDiscPoint. X, mDiscPoint. Y); canvas.drawBitmap(mDiscBitmap, mDiscMatrix, null); 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. mNeedleMatrix.preTranslate(mNeedlePoint.x, mNeedlePoint.y); canvas.drawBitmap(mNeedleBitmap, mNeedleMatrix, null); }Copy the code
Lyric drawing process
@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); 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; } String currStr = mlrcProduction.get (mCurrentLine); float currX = (getWidth() - mCurrentPaint.measureText(currStr)) / 2; canvas.drawText(currStr, currX, centerY, mCurrentPaint); For (int I = mCurrentLine - 1; i >= 0; i--) { String upStr = mLrcTexts.get(i); float upX = (getWidth() - mNormalPaint.measureText(upStr)) / 2; float upY = centerY - (mTextSize + mDividerHeight) * (mCurrentLine - i); If (upy-mtextSize < 0) {break; } canvas.drawText(upStr, upX, upY, mNormalPaint); } 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); If (downY > getHeight()) {break; } canvas.drawText(downStr, downX, downY, mNormalPaint); }}Copy the code
screenshots
About the author
The Denver nuggets: juejin. Cn/user / 231302… Weibo: weibo.com/wangchenyan…
License
Copyright 2016 wangchenyan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copy the code
A Brief Book on Transferring self 2016