├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── markdown-exported-files.xml ├── markdown-navigator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── Screenshot ├── 1.png ├── 10.png ├── 11.png ├── 12.png ├── 13.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── 9squares-AlBoardman.json │ ├── EmptyState.json │ ├── HamburgerArrow.json │ ├── litepal.xml │ ├── lottiefiles.com - ATM.json │ ├── lottiefiles.com - Animated Graph.json │ ├── lottiefiles.com - Beating Heart.json │ ├── lottiefiles.com - Camera.json │ ├── lottiefiles.com - Countdown.json │ ├── lottiefiles.com - Emoji Shock.json │ ├── lottiefiles.com - Emoji Tongue.json │ ├── lottiefiles.com - Emoji Wink.json │ ├── lottiefiles.com - Favorite Star.json │ └── lottiefiles.com - Gears.json │ ├── ic_launcher-web.png │ ├── java │ └── sbingo │ │ └── likecloudmusic │ │ ├── bean │ │ ├── PlayList.java │ │ ├── ResultBean.java │ │ └── Song.java │ │ ├── common │ │ ├── Constants.java │ │ └── MyApplication.java │ │ ├── contract │ │ ├── BaseContract.java │ │ └── DiskMusicContract.java │ │ ├── db │ │ └── LitePalHelper.java │ │ ├── di │ │ ├── component │ │ │ ├── ActivityComponent.java │ │ │ ├── ApplicationComponent.java │ │ │ ├── FragmentComponent.java │ │ │ └── ServiceComponent.java │ │ ├── module │ │ │ ├── ActivityModule.java │ │ │ ├── ApplicationModule.java │ │ │ ├── FragmentModule.java │ │ │ └── ServiceModule.java │ │ └── scope │ │ │ ├── ContextLife.java │ │ │ ├── PerActivity.java │ │ │ ├── PerApp.java │ │ │ ├── PerFragment.java │ │ │ └── PerService.java │ │ ├── event │ │ ├── DiskMusicChangeEvent.java │ │ ├── PausePlayingEvent.java │ │ ├── PlayingMusicUpdateEvent.java │ │ ├── PlaylistCreatedEvent.java │ │ ├── PlaylistDeletedEvent.java │ │ ├── RxBus.java │ │ └── StartPlayingEvent.java │ │ ├── network │ │ ├── HttpManager.java │ │ ├── RxHttpObserver.java │ │ └── RxHttpResult.java │ │ ├── player │ │ ├── PlayMode.java │ │ └── PlayService.java │ │ ├── presenter │ │ ├── DiskMusicPresenter.java │ │ └── RxPresenter.java │ │ ├── ui │ │ ├── activity │ │ │ ├── BaseActivity.java │ │ │ ├── LoadingActivity.java │ │ │ ├── MainActivity.java │ │ │ └── ScanMusicActivity.java │ │ ├── adapter │ │ │ ├── PageAdapter │ │ │ │ ├── LocalPagerAdapter.java │ │ │ │ └── MainPagerAdapter.java │ │ │ └── RvAdapter │ │ │ │ ├── BaseRvAdapter.java │ │ │ │ └── DiskMusicAdapter.java │ │ └── fragment │ │ │ ├── BaseFragment.java │ │ │ ├── LocalMusic │ │ │ ├── DiskMusicFragment.java │ │ │ └── LocalMusicFragment.java │ │ │ ├── NetMusic │ │ │ ├── NetMusicFragment.java │ │ │ ├── PlaylistFragment.java │ │ │ ├── RadioFragment.java │ │ │ ├── RankingFragment.java │ │ │ └── RecommendFragment.java │ │ │ └── Social │ │ │ ├── FriendsFragment.java │ │ │ ├── NearbyFragment.java │ │ │ ├── NewStateFragment.java │ │ │ └── SocialFragment.java │ │ ├── utils │ │ ├── DeviceUtils.java │ │ ├── FileUtils.java │ │ ├── InputUtils.java │ │ ├── NavigationUtils.java │ │ ├── NetUtils.java │ │ ├── NumberUtils.java │ │ ├── PreferenceUtils.java │ │ ├── RegExpUtil.java │ │ ├── RemindUtils.java │ │ ├── RxUtils.java │ │ ├── ScreenUtils.java │ │ └── TimeUtils.java │ │ └── widget │ │ ├── LocalMenuItem.java │ │ └── OutPlayerController.java │ └── res │ ├── anim │ ├── loading_fade_out.xml │ └── main_finish.xml │ ├── drawable-xhdpi │ ├── avatar.png │ ├── box.png │ ├── car.png │ ├── clock.png │ ├── clock_45.png │ ├── close_48.png │ ├── clothes.png │ ├── cloud.png │ ├── cry.png │ ├── diamond.png │ ├── download_45.png │ ├── envelop.png │ ├── lamp.png │ ├── list.png │ ├── loading.jpg │ ├── lyric_48.png │ ├── mic.png │ ├── mobile_45.png │ ├── more_40.png │ ├── more_white_48.png │ ├── music_disk_45.png │ ├── mv_45.png │ ├── mv_64.png │ ├── next.png │ ├── notification_last_32.png │ ├── notification_love_32.png │ ├── notification_love_checked_32.png │ ├── notification_lyric_32.png │ ├── notification_lyric_checked_32.png │ ├── notification_next_32.png │ ├── notification_pause_64.png │ ├── notification_play_64.png │ ├── pause.png │ ├── pic_error_150.png │ ├── pic_error_45.png │ ├── pic_loading_150.png │ ├── pic_loading_45.png │ ├── play.png │ ├── right_arrow_40.png │ ├── scan.png │ ├── scan_local_40.png │ ├── search.png │ ├── shop.png │ ├── singer_45.png │ ├── sort_35.png │ ├── speaker.png │ ├── timing.png │ ├── white_logo_50.png │ ├── yes_10.png │ ├── yes_20.png │ ├── yes_30.png │ └── yes_40.png │ ├── drawable │ ├── ic_music.xml │ ├── ic_music_selected.xml │ ├── ic_people.xml │ ├── ic_people_selected.xml │ ├── ic_symbol.xml │ ├── ic_symbol_selected.xml │ ├── local_music_selector.xml │ ├── message.xml │ ├── net_music_selector.xml │ ├── progress_bar.xml │ ├── side_nav_bar.xml │ ├── social_selector.xml │ ├── stroke_grey.xml │ └── stroke_white.xml │ ├── layout │ ├── activity_loading.xml │ ├── activity_main.xml │ ├── disk_music_layout.xml │ ├── disk_other_item.xml │ ├── disk_song_item.xml │ ├── local_layout.xml │ ├── local_menu_item.xml │ ├── local_music_layout.xml │ ├── main_layout.xml │ ├── main_radio_group.xml │ ├── menu_night_switch.xml │ ├── menu_text.xml │ ├── nav_bottom.xml │ ├── nav_header.xml │ ├── net_music_layout.xml │ ├── notification_view.xml │ ├── notification_view_small.xml │ ├── out_player_controller.xml │ ├── social_layout.xml │ └── timing_stop_bottom.xml │ ├── menu │ ├── activity_main_drawer.xml │ ├── main.xml │ └── scan_menu.xml │ ├── mipmap-xhdpi │ ├── logo.png │ └── white_logo_90.png │ ├── values-night │ └── colors.xml │ ├── values-v21 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── drawables.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gif └── LikeCloudMusic.gif ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mylibrary ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── sbingo │ │ └── com │ │ └── mylibrary │ │ ├── CustomSnackbar.java │ │ └── CustomToast.java │ └── res │ ├── drawable │ └── custom_toast_bg.xml │ ├── layout │ └── default_custom_toast.xml │ └── values │ ├── colors.xml │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/markdown-exported-files.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 32 | 33 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 1.8 51 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### LikeCloudMusic 云音 2 | 仿网易云音乐 v3.7.5,Material Design 风格,基于 MVP,使用 RxBus 作为事件总线通信库 3 | 4 | LikeCloudMusic 中的 Like 有两层意思 5 | 6 | 1.喜欢,正因为喜欢网易云音乐这款 APP,才有了该项目。 7 | 8 | 2.像、类似,表明该项目是对云音乐的仿造。 9 | 10 | 本项目仅用于技术学习交流,不得用于其他用途。 11 | 12 | ### 效果图 13 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/gif/LikeCloudMusic.gif) 14 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/2.png) 15 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/4.png) 16 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/6.png) 17 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/7.png) 18 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/9.png) 19 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/12.png) 20 | ![这里写图片描述](https://github.com/Sbingo/LikeCloudMusic/blob/master/Screenshot/13.png) 21 | ### 目前功能 22 | 23 | 扫描本地歌曲 24 | 25 | 存储歌曲及歌单 26 | 27 | 后台播放歌曲 28 | 29 | 底部播放控制器(暂停、开始、切歌、当前播放进度等) 30 | 31 | 两个界面的控制器状态同步 32 | 33 | 通知栏播放控制 34 | 35 | 记忆播放歌曲及进度 36 | 37 | 夜间模式 38 | 39 | …… 40 | ### TODO 41 | 42 | 通知栏底色可选 43 | 44 | 夜间模式图标更改 45 | 46 | 播放列表展示及选歌 47 | 48 | 定时停止播放 49 | 50 | 音乐闹钟 51 | 52 | 本地音乐其他分类 53 | 54 | 播放界面 UI 及逻辑 55 | 56 | 歌词滚动显示 57 | 58 | server 端 59 | 60 | …… 61 | ### 主要用到的开源库 62 | 63 | Butterknife 64 | 65 | RxJava 66 | 67 | RxAndroid 68 | 69 | Okhttp3 70 | 71 | Retrofit2 72 | 73 | Dagger2 74 | 75 | Glide 76 | 77 | LitePal 78 | 79 | ### 公众号 80 | ![as彬哥六六六](https://s2.ax1x.com/2019/03/26/AapwMq.jpg) 81 | 82 | License 83 | --------------- 84 | ``` 85 | Copyright (c) 2016 Sbingo 86 | 87 | Licensed under the Apache License, Version 2.0 (the "License"); 88 | you may not use this file except in compliance with the License. 89 | You may obtain a copy of the License at 90 | 91 | http://www.apache.org/licenses/LICENSE-2.0 92 | 93 | Unless required by applicable law or agreed to in writing, software 94 | distributed under the License is distributed on an "AS IS" BASIS, 95 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 96 | See the License for the specific language governing permissions and 97 | limitations under the License. 98 | ``` 99 | -------------------------------------------------------------------------------- /Screenshot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/1.png -------------------------------------------------------------------------------- /Screenshot/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/10.png -------------------------------------------------------------------------------- /Screenshot/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/11.png -------------------------------------------------------------------------------- /Screenshot/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/12.png -------------------------------------------------------------------------------- /Screenshot/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/13.png -------------------------------------------------------------------------------- /Screenshot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/2.png -------------------------------------------------------------------------------- /Screenshot/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/3.png -------------------------------------------------------------------------------- /Screenshot/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/4.png -------------------------------------------------------------------------------- /Screenshot/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/5.png -------------------------------------------------------------------------------- /Screenshot/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/6.png -------------------------------------------------------------------------------- /Screenshot/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/7.png -------------------------------------------------------------------------------- /Screenshot/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/8.png -------------------------------------------------------------------------------- /Screenshot/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/Screenshot/9.png -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'com.neenbedankt.android-apt' 3 | 4 | android { 5 | compileSdkVersion 25 6 | buildToolsVersion "24.0.3" 7 | defaultConfig { 8 | applicationId "sbingo.likecloudmusic" 9 | minSdkVersion 16 10 | targetSdkVersion 25 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | compile 'com.jakewharton:butterknife:8.4.0' 25 | apt 'com.jakewharton:butterknife-compiler:8.4.0' 26 | compile 'com.android.support:support-v4:25.0.1' 27 | compile 'io.reactivex:rxandroid:1.2.1' 28 | compile 'io.reactivex:rxjava:1.1.6' 29 | compile 'com.squareup.retrofit2:retrofit:2.1.0' 30 | compile 'com.squareup.retrofit2:converter-gson:2.0.2' 31 | compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2' 32 | compile 'com.squareup.okhttp3:okhttp:3.4.1' 33 | compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' 34 | compile 'com.github.bumptech.glide:glide:3.6.1' 35 | compile 'com.orhanobut:logger:1.15' 36 | compile 'com.github.chrisbanes:PhotoView:1.2.6' 37 | compile 'com.readystatesoftware.systembartint:systembartint:1.0.3' 38 | compile 'com.google.dagger:dagger:2.4' 39 | apt 'com.google.dagger:dagger-compiler:2.4' 40 | compile 'org.litepal.android:core:1.4.1' 41 | compile 'com.airbnb.android:lottie:2.0.0-beta4' 42 | compile project(':mylibrary') 43 | } 44 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\AS-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/assets/litepal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 22 | 23 | 24 | 34 | 35 | 36 | 37 | 38 | 39 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/bean/ResultBean.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.bean; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/12 8 | */ 9 | 10 | public class ResultBean implements Serializable{ 11 | 12 | private String status; 13 | 14 | private String code; 15 | 16 | private String message; 17 | 18 | private T data; 19 | 20 | public String getStatus() { 21 | return status; 22 | } 23 | 24 | public void setStatus(String status) { 25 | this.status = status; 26 | } 27 | 28 | public String getCode() { 29 | return code; 30 | } 31 | 32 | public void setCode(String code) { 33 | this.code = code; 34 | } 35 | 36 | public String getMessage() { 37 | return message; 38 | } 39 | 40 | public void setMessage(String message) { 41 | this.message = message; 42 | } 43 | 44 | public T getData() { 45 | return data; 46 | } 47 | 48 | public void setData(T data) { 49 | this.data = data; 50 | } 51 | 52 | public boolean isSuccess() { 53 | return getCode().equals("0"); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/bean/Song.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.bean; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import org.litepal.annotation.Column; 7 | import org.litepal.crud.DataSupport; 8 | 9 | /** 10 | * Author: Sbingo 11 | * Date: 2016/12/15 12 | */ 13 | 14 | public class Song extends DataSupport implements Parcelable { 15 | 16 | private int id; 17 | 18 | private String title; 19 | 20 | private String displayName; 21 | 22 | private String artist; 23 | 24 | private String album; 25 | 26 | private String path; 27 | 28 | private int duration; 29 | 30 | private int size; 31 | 32 | private boolean favorite; 33 | 34 | private boolean isPlaying; 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | 44 | public String getTitle() { 45 | return title; 46 | } 47 | 48 | public void setTitle(String title) { 49 | this.title = title; 50 | } 51 | 52 | public String getDisplayName() { 53 | return displayName; 54 | } 55 | 56 | public void setDisplayName(String displayName) { 57 | this.displayName = displayName; 58 | } 59 | 60 | public String getArtist() { 61 | return artist; 62 | } 63 | 64 | public void setArtist(String artist) { 65 | this.artist = artist; 66 | } 67 | 68 | public String getAlbum() { 69 | return album; 70 | } 71 | 72 | public void setAlbum(String album) { 73 | this.album = album; 74 | } 75 | 76 | public String getPath() { 77 | return path; 78 | } 79 | 80 | public void setPath(String path) { 81 | this.path = path; 82 | } 83 | 84 | public int getDuration() { 85 | return duration; 86 | } 87 | 88 | public void setDuration(int duration) { 89 | this.duration = duration; 90 | } 91 | 92 | public int getSize() { 93 | return size; 94 | } 95 | 96 | public void setSize(int size) { 97 | this.size = size; 98 | } 99 | 100 | public boolean isFavorite() { 101 | return favorite; 102 | } 103 | 104 | public void setFavorite(boolean favorite) { 105 | this.favorite = favorite; 106 | } 107 | 108 | public boolean isPlaying() { 109 | return isPlaying; 110 | } 111 | 112 | public void setPlaying(boolean playing) { 113 | isPlaying = playing; 114 | } 115 | 116 | public static Creator getCREATOR() { 117 | return CREATOR; 118 | } 119 | 120 | public Song() { 121 | } 122 | 123 | public Song(Parcel in) { 124 | readFromParcel(in); 125 | } 126 | 127 | @Override 128 | public void writeToParcel(Parcel dest, int flags) { 129 | dest.writeInt(this.id); 130 | dest.writeString(this.title); 131 | dest.writeString(this.displayName); 132 | dest.writeString(this.artist); 133 | dest.writeString(this.album); 134 | dest.writeString(this.path); 135 | dest.writeInt(this.duration); 136 | dest.writeInt(this.size); 137 | dest.writeInt(this.favorite ? 1 : 0); 138 | dest.writeInt(this.isPlaying ? 1 : 0); 139 | } 140 | 141 | public void readFromParcel(Parcel in) { 142 | this.id = in.readInt(); 143 | this.title = in.readString(); 144 | this.displayName = in.readString(); 145 | this.artist = in.readString(); 146 | this.album = in.readString(); 147 | this.path = in.readString(); 148 | this.duration = in.readInt(); 149 | this.size = in.readInt(); 150 | this.favorite = in.readInt() == 1; 151 | this.isPlaying = in.readInt() == 1; 152 | } 153 | 154 | @Override 155 | public int describeContents() { 156 | return 0; 157 | } 158 | 159 | public static final Creator CREATOR = new Creator() { 160 | @Override 161 | public Song createFromParcel(Parcel in) { 162 | return new Song(in); 163 | } 164 | 165 | @Override 166 | public Song[] newArray(int size) { 167 | return new Song[size]; 168 | } 169 | }; 170 | } 171 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/common/Constants.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.common; 2 | 3 | 4 | /** 5 | * Author: Sbingo 6 | * Date: 2016/12/11 7 | */ 8 | 9 | public class Constants { 10 | 11 | public static final String PREFERENCE_NAME = "likecloudmusic"; 12 | 13 | public static final String LOCAL_TYPE = "local_type"; 14 | 15 | //是否已经扫描过本地音乐 16 | public static final String IS_SCANNED = "is_scanned"; 17 | //无播放列表则不显示控制器 18 | public static final String HAS_PLAYLIST = "has_playlist"; 19 | //播放服务是否在运行中 20 | public static final String PLAY_SERVICE_RUNNING = "Play_Service_Running"; 21 | //退出时保存的播放序号 22 | public static final String PLAYING_INDEX = "playing_index"; 23 | //退出时保存的播放进度 24 | public static final String PLAYING_PROGRESS = "playing_progress"; 25 | //夜间模式 26 | public static final String IS_NIGHT = "is_night"; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/common/MyApplication.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.common; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.orhanobut.logger.LogLevel; 7 | import com.orhanobut.logger.Logger; 8 | 9 | import org.litepal.LitePal; 10 | 11 | import sbingo.likecloudmusic.db.LitePalHelper; 12 | import sbingo.likecloudmusic.di.component.ApplicationComponent; 13 | import sbingo.likecloudmusic.di.component.DaggerApplicationComponent; 14 | import sbingo.likecloudmusic.di.module.ApplicationModule; 15 | 16 | /** 17 | * Author: Sbingo 18 | * Date: 2016/12/11 19 | */ 20 | 21 | public class MyApplication extends Application { 22 | 23 | public static long mLastClickTime = 0; 24 | 25 | private static Context appContext; 26 | 27 | private ApplicationComponent mApplicationComponent; 28 | 29 | 30 | @Override 31 | public void onCreate() { 32 | super.onCreate(); 33 | appContext = this; 34 | LitePal.initialize(this); 35 | LitePalHelper.initDB(); 36 | initLogger(); 37 | initApplicationComponent(); 38 | } 39 | 40 | public static Context getAppContext() { 41 | return appContext; 42 | } 43 | 44 | public ApplicationComponent getApplicationComponent() { 45 | return mApplicationComponent; 46 | } 47 | 48 | private void initLogger() { 49 | LogLevel lever = LogLevel.FULL; 50 | Logger.init("MyLogger") // default PRETTYLOGGER or use just init() 51 | .methodCount(3) // default 2 52 | .logLevel(lever); // default LogLevel.FULL 53 | } 54 | 55 | private void initApplicationComponent() { 56 | mApplicationComponent = DaggerApplicationComponent.builder() 57 | .applicationModule(new ApplicationModule(this)) 58 | .build(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/contract/BaseContract.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.contract; 2 | 3 | /** 4 | * Author: Sbingo 5 | * Date: 2017/5/3 6 | */ 7 | 8 | public interface BaseContract { 9 | 10 | interface BasePresenter { 11 | void attachView(T view); 12 | 13 | void detachView(); 14 | } 15 | 16 | interface BaseView { 17 | void onError(String err); 18 | 19 | void onCompleted(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/contract/DiskMusicContract.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.contract; 2 | 3 | import android.database.Cursor; 4 | import android.support.v4.app.LoaderManager; 5 | 6 | import java.util.List; 7 | 8 | import sbingo.likecloudmusic.bean.PlayList; 9 | import sbingo.likecloudmusic.bean.Song; 10 | 11 | /** 12 | * Author: Sbingo 13 | * Date: 2017/5/3 14 | */ 15 | 16 | public interface DiskMusicContract { 17 | 18 | interface Presenter extends BaseContract.BasePresenter { 19 | 20 | Song cursorToSong(Cursor cursor); 21 | 22 | void loadSongFromDB(); 23 | 24 | void createPlaylist(PlayList playlist, int index); 25 | 26 | } 27 | 28 | interface View extends BaseContract.BaseView { 29 | 30 | void onMusicLoaded(List songs); 31 | 32 | void showEmptyView(); 33 | 34 | void hideEmptyView(); 35 | 36 | LoaderManager getLoaderManager(); 37 | 38 | void onPlaylistDeleted(PlayList playlist); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/component/ActivityComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.component; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | 22 | import dagger.Component; 23 | import sbingo.likecloudmusic.di.module.ActivityModule; 24 | import sbingo.likecloudmusic.di.scope.ContextLife; 25 | import sbingo.likecloudmusic.di.scope.PerActivity; 26 | 27 | /** 28 | * Author: Sbingo 29 | * Date: 2016/12/19 30 | */ 31 | @PerActivity 32 | @Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class) 33 | public interface ActivityComponent { 34 | 35 | @ContextLife("Activity") 36 | Context getActivityContext(); 37 | 38 | @ContextLife("Application") 39 | Context getApplicationContext(); 40 | 41 | Activity getActivity(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/component/ApplicationComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.component; 18 | 19 | import android.content.Context; 20 | 21 | 22 | import dagger.Component; 23 | import sbingo.likecloudmusic.di.module.ApplicationModule; 24 | import sbingo.likecloudmusic.di.scope.ContextLife; 25 | import sbingo.likecloudmusic.di.scope.PerApp; 26 | 27 | /** 28 | * Author: Sbingo 29 | * Date: 2016/12/19 30 | */ 31 | @PerApp 32 | @Component(modules = ApplicationModule.class) 33 | public interface ApplicationComponent { 34 | @ContextLife("Application") 35 | Context getApplication(); 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/component/FragmentComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.component; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | 22 | 23 | import dagger.Component; 24 | import sbingo.likecloudmusic.di.module.FragmentModule; 25 | import sbingo.likecloudmusic.di.scope.ContextLife; 26 | import sbingo.likecloudmusic.di.scope.PerFragment; 27 | import sbingo.likecloudmusic.ui.fragment.LocalMusic.DiskMusicFragment; 28 | 29 | /** 30 | * Author: Sbingo 31 | * Date: 2016/12/19 32 | */ 33 | @PerFragment 34 | @Component(dependencies = ApplicationComponent.class, modules = FragmentModule.class) 35 | public interface FragmentComponent { 36 | @ContextLife("Activity") 37 | Context getActivityContext(); 38 | 39 | @ContextLife("Application") 40 | Context getApplicationContext(); 41 | 42 | Activity getActivity(); 43 | 44 | void inject(DiskMusicFragment diskMusicFragment); 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/component/ServiceComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.component; 18 | 19 | import android.content.Context; 20 | 21 | 22 | import dagger.Component; 23 | import sbingo.likecloudmusic.di.module.ServiceModule; 24 | import sbingo.likecloudmusic.di.scope.ContextLife; 25 | import sbingo.likecloudmusic.di.scope.PerService; 26 | 27 | /** 28 | * Author: Sbingo 29 | * Date: 2016/12/19 30 | */ 31 | @PerService 32 | @Component(dependencies = ApplicationComponent.class, modules = ServiceModule.class) 33 | public interface ServiceComponent { 34 | @ContextLife("Service") 35 | Context getServiceContext(); 36 | 37 | @ContextLife("Application") 38 | Context getApplicationContext(); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/module/ActivityModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.module; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | 22 | 23 | import dagger.Module; 24 | import dagger.Provides; 25 | import sbingo.likecloudmusic.di.scope.ContextLife; 26 | import sbingo.likecloudmusic.di.scope.PerActivity; 27 | 28 | /** 29 | * Author: Sbingo 30 | * Date: 2016/12/19 31 | */ 32 | @Module 33 | public class ActivityModule { 34 | private Activity mActivity; 35 | 36 | public ActivityModule(Activity activity) { 37 | mActivity = activity; 38 | } 39 | 40 | @Provides 41 | @PerActivity 42 | @ContextLife("Activity") 43 | public Context ProvideActivityContext() { 44 | return mActivity; 45 | } 46 | 47 | @Provides 48 | @PerActivity 49 | public Activity ProvideActivity() { 50 | return mActivity; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/module/ApplicationModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.module; 18 | 19 | import android.content.Context; 20 | 21 | 22 | import dagger.Module; 23 | import dagger.Provides; 24 | import sbingo.likecloudmusic.common.MyApplication; 25 | import sbingo.likecloudmusic.di.scope.ContextLife; 26 | import sbingo.likecloudmusic.di.scope.PerApp; 27 | 28 | /** 29 | * Author: Sbingo 30 | * Date: 2016/12/19 31 | */ 32 | 33 | @Module 34 | public class ApplicationModule { 35 | private MyApplication mApplication; 36 | 37 | public ApplicationModule(MyApplication application) { 38 | mApplication = application; 39 | } 40 | 41 | @Provides 42 | @PerApp 43 | @ContextLife("Application") 44 | public Context provideApplicationContext() { 45 | return mApplication.getApplicationContext(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/module/FragmentModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.module; 18 | 19 | import android.app.Activity; 20 | import android.content.Context; 21 | import android.support.v4.app.Fragment; 22 | 23 | 24 | import dagger.Module; 25 | import dagger.Provides; 26 | import sbingo.likecloudmusic.di.scope.ContextLife; 27 | import sbingo.likecloudmusic.di.scope.PerFragment; 28 | 29 | /** 30 | * Author: Sbingo 31 | * Date: 2016/12/19 32 | */ 33 | @Module 34 | public class FragmentModule { 35 | private Fragment mFragment; 36 | 37 | public FragmentModule(Fragment fragment) { 38 | mFragment = fragment; 39 | } 40 | 41 | @Provides 42 | @PerFragment 43 | @ContextLife("Activity") 44 | public Context provideActivityContext() { 45 | return mFragment.getActivity(); 46 | } 47 | 48 | @Provides 49 | @PerFragment 50 | public Activity provideActivity() { 51 | return mFragment.getActivity(); 52 | } 53 | 54 | @Provides 55 | @PerFragment 56 | public Fragment provideFragment() { 57 | return mFragment; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/module/ServiceModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.module; 18 | 19 | import android.app.Service; 20 | import android.content.Context; 21 | 22 | 23 | import dagger.Module; 24 | import dagger.Provides; 25 | import sbingo.likecloudmusic.di.scope.ContextLife; 26 | import sbingo.likecloudmusic.di.scope.PerService; 27 | 28 | /** 29 | * Author: Sbingo 30 | * Date: 2016/12/19 31 | */ 32 | @Module 33 | public class ServiceModule { 34 | private Service mService; 35 | 36 | public ServiceModule(Service service) { 37 | mService = service; 38 | } 39 | 40 | @Provides 41 | @PerService 42 | @ContextLife("Service") 43 | public Context ProvideServiceContext() { 44 | return mService; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/scope/ContextLife.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.scope; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | import javax.inject.Qualifier; 24 | 25 | /** 26 | * Author: Sbingo 27 | * Date: 2016/12/19 28 | */ 29 | @Qualifier 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface ContextLife { 33 | String value() default "Application"; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/scope/PerActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.scope; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | import javax.inject.Scope; 24 | 25 | /** 26 | * Author: Sbingo 27 | * Date: 2016/12/19 28 | */ 29 | @Scope 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface PerActivity { 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/scope/PerApp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.scope; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | import javax.inject.Scope; 24 | 25 | /** 26 | * Author: Sbingo 27 | * Date: 2016/12/19 28 | */ 29 | @Scope 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface PerApp { 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/scope/PerFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.scope; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | import javax.inject.Scope; 24 | 25 | /** 26 | * Author: Sbingo 27 | * Date: 2016/12/19 28 | */ 29 | @Scope 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface PerFragment { 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/di/scope/PerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 咖枯 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | package sbingo.likecloudmusic.di.scope; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | 23 | import javax.inject.Scope; 24 | 25 | /** 26 | * Author: Sbingo 27 | * Date: 2016/12/19 28 | */ 29 | @Scope 30 | @Documented 31 | @Retention(RetentionPolicy.RUNTIME) 32 | public @interface PerService { 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/DiskMusicChangeEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | import java.util.List; 4 | 5 | import sbingo.likecloudmusic.bean.Song; 6 | 7 | /** 8 | * Author: Sbingo 9 | * Date: 2016/12/19 10 | */ 11 | 12 | public class DiskMusicChangeEvent { 13 | 14 | private int count; 15 | 16 | private List songs; 17 | 18 | public int getCount() { 19 | return count; 20 | } 21 | 22 | public List getSongs() { 23 | return songs; 24 | } 25 | 26 | public void setSongs(List songs) { 27 | this.songs = songs; 28 | } 29 | 30 | public void setCount(int count) { 31 | this.count = count; 32 | } 33 | 34 | public DiskMusicChangeEvent(List songs) { 35 | this.songs = songs; 36 | count = songs.size(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/PausePlayingEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | /** 4 | * Author: Sbingo 5 | * Date: 2016/12/27 6 | */ 7 | 8 | public class PausePlayingEvent { 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/PlayingMusicUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | import sbingo.likecloudmusic.bean.Song; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/26 8 | */ 9 | 10 | public class PlayingMusicUpdateEvent { 11 | 12 | private Song song; 13 | private int index; 14 | 15 | public Song getSong() { 16 | return song; 17 | } 18 | 19 | public void setSong(Song song) { 20 | this.song = song; 21 | } 22 | 23 | public int getIndex() { 24 | return index; 25 | } 26 | 27 | public void setIndex(int index) { 28 | this.index = index; 29 | } 30 | 31 | public PlayingMusicUpdateEvent(Song song, int index) { 32 | this.song = song; 33 | this.index = index; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/PlaylistCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | import sbingo.likecloudmusic.bean.PlayList; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/20 8 | */ 9 | 10 | public class PlaylistCreatedEvent { 11 | 12 | private PlayList playlist; 13 | private int index; 14 | 15 | public PlayList getPlaylist() { 16 | return playlist; 17 | } 18 | 19 | public void setPlaylist(PlayList playlist) { 20 | this.playlist = playlist; 21 | } 22 | 23 | public int getIndex() { 24 | return index; 25 | } 26 | 27 | public void setIndex(int index) { 28 | this.index = index; 29 | } 30 | 31 | public PlaylistCreatedEvent(PlayList playlist, int index) { 32 | this.playlist = playlist; 33 | this.index = index; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/PlaylistDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | /** 4 | * Author: Sbingo 5 | * Date: 2016/12/20 6 | */ 7 | 8 | public class PlaylistDeletedEvent { 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/RxBus.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | import rx.Observable; 4 | import rx.subjects.PublishSubject; 5 | import rx.subjects.SerializedSubject; 6 | import rx.subjects.Subject; 7 | 8 | /** 9 | * Author: Sbingo 10 | * Date: 2016/12/12 11 | */ 12 | 13 | public class RxBus { 14 | private static volatile RxBus mRxBus; 15 | // 主题 16 | private final Subject mBus; 17 | 18 | // PublishSubject只会把在订阅发生的时间点之后来自原始Observable的数据发射给观察者 19 | public RxBus() { 20 | mBus = new SerializedSubject<>(PublishSubject.create()); 21 | } 22 | 23 | // 单例RxBus 24 | public static RxBus getInstance() { 25 | if (mRxBus == null) { 26 | synchronized (RxBus.class) { 27 | if (mRxBus == null) { 28 | mRxBus = new RxBus(); 29 | } 30 | } 31 | } 32 | return mRxBus; 33 | } 34 | 35 | // 提供了一个新的事件 36 | public void post(Object o) { 37 | mBus.onNext(o); 38 | } 39 | 40 | // 根据传递的 eventType 类型返回特定类型(eventType)的 被观察者 41 | public Observable toObservable(Class eventType) { 42 | return mBus.ofType(eventType); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/event/StartPlayingEvent.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.event; 2 | 3 | /** 4 | * Author: Sbingo 5 | * Date: 2016/12/27 6 | */ 7 | 8 | public class StartPlayingEvent { 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/network/HttpManager.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.network; 2 | 3 | import com.orhanobut.logger.Logger; 4 | 5 | import java.io.IOException; 6 | import java.util.Locale; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | import okhttp3.Interceptor; 10 | import okhttp3.OkHttpClient; 11 | import okhttp3.Request; 12 | import okhttp3.Response; 13 | import okhttp3.ResponseBody; 14 | import retrofit2.Retrofit; 15 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 16 | import retrofit2.converter.gson.GsonConverterFactory; 17 | import sbingo.likecloudmusic.utils.NetUtils; 18 | 19 | /** 20 | * Author: Sbingo 21 | * Date: 2016/12/12 22 | */ 23 | 24 | public enum HttpManager { 25 | Instance; 26 | private final String TAG = "OkHttp"; 27 | 28 | private static final String baseUrl = ""; 29 | 30 | private static volatile OkHttpClient mOkHttpClient; 31 | 32 | 33 | HttpManager() { 34 | Retrofit retrofit = new Retrofit.Builder() 35 | .baseUrl(baseUrl) 36 | .client(getOkHttpClient()) 37 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 38 | .addConverterFactory(GsonConverterFactory.create()) 39 | .build(); 40 | } 41 | 42 | private OkHttpClient getOkHttpClient() { 43 | if (mOkHttpClient == null) { 44 | synchronized (HttpManager.class) { 45 | if (mOkHttpClient == null) { 46 | mOkHttpClient = new OkHttpClient.Builder() 47 | .connectTimeout(10, TimeUnit.SECONDS) 48 | .readTimeout(10, TimeUnit.SECONDS) 49 | .writeTimeout(10, TimeUnit.SECONDS) 50 | .addInterceptor(mNetInterceptor) 51 | .addInterceptor(mLoggingInterceptor) 52 | .build(); 53 | } 54 | } 55 | } 56 | return mOkHttpClient; 57 | } 58 | 59 | private final Interceptor mLoggingInterceptor = new Interceptor() { 60 | @Override 61 | public Response intercept(Chain chain) throws IOException { 62 | Response response = null; 63 | String bodyString = null; 64 | try { 65 | Request request = chain.request(); 66 | long t1 = System.nanoTime(); 67 | Logger.t(TAG).d(String.format("request -->:%s", request.url().toString())); 68 | response = chain.proceed(request); 69 | bodyString = response.body().string(); 70 | if (response.code() == 200) { 71 | long t2 = System.nanoTime(); 72 | Logger.t(TAG).d(String.format(Locale.getDefault(), "response <-- %s in %.1fms", 73 | response.request().url(), (t2 - t1) / 1e6d)); 74 | Logger.t(TAG).json(bodyString); 75 | } else { 76 | Logger.t(TAG).d(String.format("http响应不成功,响应码为:%s", response.code())); 77 | throw new RuntimeException("服务器响应不成功(′⌒`)"); 78 | } 79 | } catch (IOException e) { 80 | throw new RuntimeException("服务器好像挂了(′⌒`)"); 81 | } 82 | return response.newBuilder() 83 | .body(ResponseBody.create(response.body().contentType(), bodyString)) 84 | .build(); 85 | } 86 | }; 87 | 88 | private final Interceptor mNetInterceptor = new Interceptor() { 89 | @Override 90 | public Response intercept(Chain chain) throws IOException { 91 | NetUtils.isNetworkConnected(); 92 | return chain.proceed(chain.request()); 93 | } 94 | }; 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/network/RxHttpObserver.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.network; 2 | 3 | 4 | import rx.Observer; 5 | import sbingo.likecloudmusic.utils.RemindUtils; 6 | 7 | /** 8 | * Author: Sbingo 9 | * Date: 2016/12/12 10 | */ 11 | 12 | public abstract class RxHttpObserver implements Observer { 13 | 14 | 15 | @Override 16 | public void onError(Throwable e) { 17 | RemindUtils.showToast(e.getMessage()); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/network/RxHttpResult.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.network; 2 | 3 | import rx.Observable; 4 | import rx.Subscriber; 5 | import rx.functions.Func1; 6 | import sbingo.likecloudmusic.bean.ResultBean; 7 | 8 | /** 9 | * Author: Sbingo 10 | * Date: 2016/12/12 11 | */ 12 | 13 | public class RxHttpResult implements Func1, Observable> { 14 | @Override 15 | public Observable call(final ResultBean resultBean) { 16 | return Observable.create(new Observable.OnSubscribe() { 17 | @Override 18 | public void call(Subscriber subscriber) { 19 | if (resultBean.isSuccess()) { 20 | //注意:data为null时只调用onCompleted(). 21 | if (resultBean.getData() != null) { 22 | subscriber.onNext(resultBean.getData()); 23 | } 24 | subscriber.onCompleted(); 25 | } else { 26 | subscriber.onError(new RuntimeException(resultBean.getMessage())); 27 | } 28 | } 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/player/PlayMode.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.player; 2 | 3 | /** 4 | * Author: Sbingo 5 | * Date: 2016/12/20 6 | */ 7 | 8 | public enum PlayMode { 9 | SINGLE, 10 | LOOP, 11 | LIST, 12 | SHUFFLE; 13 | 14 | public static PlayMode getDefault() { 15 | return LOOP; 16 | } 17 | 18 | public static PlayMode switchNextMode(PlayMode current) { 19 | if (current == null) return getDefault(); 20 | 21 | switch (current) { 22 | case LOOP: 23 | return LIST; 24 | case LIST: 25 | return SHUFFLE; 26 | case SHUFFLE: 27 | return SINGLE; 28 | case SINGLE: 29 | return LOOP; 30 | } 31 | return getDefault(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/presenter/RxPresenter.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.presenter; 2 | 3 | import rx.Subscription; 4 | import rx.subscriptions.CompositeSubscription; 5 | import sbingo.likecloudmusic.contract.BaseContract; 6 | 7 | /** 8 | * Author: Sbingo 9 | * Date: 2017/5/3 10 | */ 11 | 12 | public class RxPresenter implements BaseContract.BasePresenter { 13 | 14 | protected T mView; 15 | private CompositeSubscription mCompositeSubscription; 16 | 17 | @Override 18 | public void attachView(T view) { 19 | this.mView = view; 20 | } 21 | 22 | @Override 23 | public void detachView() { 24 | this.mView = null; 25 | unSubscribe(); 26 | } 27 | 28 | private void unSubscribe() { 29 | if (mCompositeSubscription != null) { 30 | mCompositeSubscription.unsubscribe(); 31 | } 32 | } 33 | 34 | protected void addSubscribe(Subscription subscription) { 35 | if (mCompositeSubscription == null) { 36 | mCompositeSubscription = new CompositeSubscription(); 37 | } 38 | mCompositeSubscription.add(subscription); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/activity/LoadingActivity.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.activity; 2 | 3 | import android.animation.Animator; 4 | import android.os.Bundle; 5 | import android.view.animation.Animation; 6 | import android.view.animation.AnimationUtils; 7 | import android.widget.TextView; 8 | 9 | import com.airbnb.lottie.LottieAnimationView; 10 | 11 | import butterknife.BindView; 12 | import sbingo.likecloudmusic.R; 13 | 14 | /** 15 | * Author: Sbingo 16 | * Date: 2016/12/11 17 | */ 18 | 19 | public class LoadingActivity extends BaseActivity { 20 | 21 | 22 | @BindView(R.id.loading_text) 23 | TextView loadingText; 24 | @BindView(R.id.lottie_view) 25 | LottieAnimationView lottieView; 26 | 27 | @Override 28 | public int getLayoutId() { 29 | return R.layout.activity_loading; 30 | } 31 | 32 | @Override 33 | public void initInjector() { 34 | 35 | } 36 | 37 | @Override 38 | public void initViews() { 39 | } 40 | 41 | @Override 42 | public void customToolbar() { 43 | 44 | } 45 | 46 | @Override 47 | protected boolean hasToolbar() { 48 | return false; 49 | } 50 | 51 | @Override 52 | protected void onCreate(Bundle savedInstanceState) { 53 | super.onCreate(savedInstanceState); 54 | // loadingText.postDelayed(loadingOut, 1000); 55 | lottieView.addAnimatorListener(new Animator.AnimatorListener() { 56 | @Override 57 | public void onAnimationStart(Animator animation) { 58 | 59 | } 60 | 61 | @Override 62 | public void onAnimationEnd(Animator animation) { 63 | loadingText.post(toMainActivity); 64 | } 65 | 66 | @Override 67 | public void onAnimationCancel(Animator animation) { 68 | 69 | } 70 | 71 | @Override 72 | public void onAnimationRepeat(Animator animation) { 73 | 74 | } 75 | }); 76 | } 77 | 78 | Runnable loadingOut = new Runnable() { 79 | @Override 80 | public void run() { 81 | Animation animation = AnimationUtils.loadAnimation(LoadingActivity.this, R.anim.loading_fade_out); 82 | loadingText.startAnimation(animation); 83 | loadingText.postDelayed(toMainActivity, 1500); 84 | } 85 | }; 86 | Runnable toMainActivity = new Runnable() { 87 | @Override 88 | public void run() { 89 | openActivity(MainActivity.class); 90 | finish(); 91 | } 92 | }; 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/adapter/PageAdapter/LocalPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.adapter.PageAdapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import java.util.List; 8 | 9 | import sbingo.likecloudmusic.R; 10 | import sbingo.likecloudmusic.common.MyApplication; 11 | import sbingo.likecloudmusic.ui.fragment.LocalMusic.DiskMusicFragment; 12 | 13 | /** 14 | * Author: Sbingo 15 | * Date: 2016/12/15 16 | */ 17 | 18 | public class LocalPagerAdapter extends FragmentPagerAdapter { 19 | 20 | private String[] titles; 21 | private List fragments; 22 | 23 | public LocalPagerAdapter(FragmentManager fm, List fragments) { 24 | super(fm); 25 | titles = MyApplication.getAppContext().getResources().getStringArray(R.array.local); 26 | this.fragments = fragments; 27 | } 28 | 29 | @Override 30 | public Fragment getItem(int position) { 31 | return fragments.get(position); 32 | } 33 | 34 | @Override 35 | public int getCount() { 36 | return fragments.size(); 37 | } 38 | 39 | @Override 40 | public CharSequence getPageTitle(int position) { 41 | return titles[position]; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/adapter/PageAdapter/MainPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.adapter.PageAdapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import sbingo.likecloudmusic.utils.NavigationUtils; 8 | 9 | /** 10 | * Author: Sbingo 11 | * Date: 2016/12/14 12 | */ 13 | 14 | public class MainPagerAdapter extends FragmentPagerAdapter { 15 | 16 | public MainPagerAdapter(FragmentManager fm) { 17 | super(fm); 18 | } 19 | 20 | @Override 21 | public Fragment getItem(int position) { 22 | return NavigationUtils.mainFragments[position]; 23 | } 24 | 25 | @Override 26 | public int getCount() { 27 | return NavigationUtils.mainFragments.length; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/NetMusic/NetMusicFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.NetMusic; 2 | 3 | import sbingo.likecloudmusic.R; 4 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 5 | 6 | /** 7 | * Author: Sbingo 8 | * Date: 2016/12/14 9 | */ 10 | 11 | public class NetMusicFragment extends BaseFragment { 12 | 13 | private static NetMusicFragment netMusicFragment; 14 | 15 | public static NetMusicFragment getInstance() { 16 | if (null == netMusicFragment) { 17 | synchronized (NetMusicFragment.class){ 18 | if (null == netMusicFragment) { 19 | netMusicFragment = new NetMusicFragment(); 20 | } 21 | } 22 | } 23 | return netMusicFragment; 24 | } 25 | 26 | @Override 27 | protected int getLayoutId() { 28 | return R.layout.net_music_layout; 29 | } 30 | 31 | @Override 32 | protected void initInjector() { 33 | 34 | } 35 | 36 | @Override 37 | protected void initViews() { 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/NetMusic/PlaylistFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.NetMusic; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class PlaylistFragment extends BaseFragment { 11 | 12 | private static PlaylistFragment playlistFragment; 13 | 14 | public static PlaylistFragment getInstance() { 15 | if (null == playlistFragment) { 16 | synchronized (PlaylistFragment.class){ 17 | if (null == playlistFragment) { 18 | playlistFragment = new PlaylistFragment(); 19 | } 20 | } 21 | } 22 | return playlistFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/NetMusic/RadioFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.NetMusic; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class RadioFragment extends BaseFragment { 11 | 12 | private static RadioFragment radioFragment; 13 | 14 | public static RadioFragment getInstance() { 15 | if (null == radioFragment) { 16 | synchronized (RadioFragment.class){ 17 | if (null == radioFragment) { 18 | radioFragment = new RadioFragment(); 19 | } 20 | } 21 | } 22 | return radioFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/NetMusic/RankingFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.NetMusic; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class RankingFragment extends BaseFragment { 11 | 12 | private static RankingFragment rankingFragment; 13 | 14 | public static RankingFragment getInstance() { 15 | if (null == rankingFragment) { 16 | synchronized (RankingFragment.class){ 17 | if (null == rankingFragment) { 18 | rankingFragment = new RankingFragment(); 19 | } 20 | } 21 | } 22 | return rankingFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/NetMusic/RecommendFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.NetMusic; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class RecommendFragment extends BaseFragment { 11 | 12 | private static RecommendFragment recommendFragment; 13 | 14 | public static RecommendFragment getInstance() { 15 | if (null == recommendFragment) { 16 | synchronized (RecommendFragment.class){ 17 | if (null == recommendFragment) { 18 | recommendFragment = new RecommendFragment(); 19 | } 20 | } 21 | } 22 | return recommendFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/Social/FriendsFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.Social; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class FriendsFragment extends BaseFragment { 11 | 12 | private static FriendsFragment friendsFragment; 13 | 14 | public static FriendsFragment getInstance() { 15 | if (null == friendsFragment) { 16 | synchronized (FriendsFragment.class){ 17 | if (null == friendsFragment) { 18 | friendsFragment = new FriendsFragment(); 19 | } 20 | } 21 | } 22 | return friendsFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/Social/NearbyFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.Social; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class NearbyFragment extends BaseFragment { 11 | 12 | private static NearbyFragment nearbyFragment; 13 | 14 | public static NearbyFragment getInstance() { 15 | if (null == nearbyFragment) { 16 | synchronized (NearbyFragment.class){ 17 | if (null == nearbyFragment) { 18 | nearbyFragment = new NearbyFragment(); 19 | } 20 | } 21 | } 22 | return nearbyFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/Social/NewStateFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.Social; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/14 8 | */ 9 | 10 | public class NewStateFragment extends BaseFragment { 11 | 12 | private static NewStateFragment newStateFragment; 13 | 14 | public static NewStateFragment getInstance() { 15 | if (null == newStateFragment) { 16 | synchronized (NewStateFragment.class){ 17 | if (null == newStateFragment) { 18 | newStateFragment = new NewStateFragment(); 19 | } 20 | } 21 | } 22 | return newStateFragment; 23 | } 24 | 25 | @Override 26 | protected int getLayoutId() { 27 | return 0; 28 | } 29 | 30 | @Override 31 | protected void initInjector() { 32 | 33 | } 34 | 35 | @Override 36 | protected void initViews() { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/ui/fragment/Social/SocialFragment.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.ui.fragment.Social; 2 | 3 | import sbingo.likecloudmusic.R; 4 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 5 | 6 | /** 7 | * Author: Sbingo 8 | * Date: 2016/12/14 9 | */ 10 | 11 | public class SocialFragment extends BaseFragment { 12 | 13 | private static SocialFragment socialFragment; 14 | 15 | public static SocialFragment getInstance() { 16 | if (null == socialFragment) { 17 | synchronized (SocialFragment.class) { 18 | if (null == socialFragment) { 19 | socialFragment = new SocialFragment(); 20 | } 21 | } 22 | } 23 | return socialFragment; 24 | } 25 | 26 | @Override 27 | protected int getLayoutId() { 28 | return R.layout.social_layout; 29 | } 30 | 31 | @Override 32 | protected void initInjector() { 33 | 34 | } 35 | 36 | @Override 37 | protected void initViews() { 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/DeviceUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | import android.telephony.TelephonyManager; 7 | 8 | import sbingo.likecloudmusic.common.MyApplication; 9 | 10 | /** 11 | * Author: Sbingo 12 | * Date: 2016/12/12 13 | */ 14 | 15 | public class DeviceUtils { 16 | 17 | private static PackageInfo packageInfo; 18 | 19 | private static PackageInfo getPackageInfo() { 20 | if (packageInfo == null) { 21 | try { 22 | packageInfo = MyApplication.getAppContext().getPackageManager().getPackageInfo(MyApplication.getAppContext().getPackageName(), 0); 23 | } catch (PackageManager.NameNotFoundException e) { 24 | e.printStackTrace(); 25 | } 26 | } 27 | return packageInfo; 28 | } 29 | 30 | /** 31 | * 获取版本号 32 | * 33 | * @return 34 | */ 35 | public static String getAppVersion() { 36 | return getPackageInfo().versionName; 37 | } 38 | 39 | public static String getAppName() { 40 | return getPackageInfo().packageName; 41 | } 42 | 43 | public static String getImei() { 44 | String imei = ((TelephonyManager) MyApplication.getAppContext().getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); 45 | return imei; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.database.Cursor; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.media.MediaMetadataRetriever; 7 | import android.provider.MediaStore; 8 | 9 | import java.io.File; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | 13 | import sbingo.likecloudmusic.bean.Song; 14 | import sbingo.likecloudmusic.common.MyApplication; 15 | 16 | /** 17 | * Author: Sbingo 18 | * Date: 2016/12/18 19 | */ 20 | 21 | public class FileUtils { 22 | 23 | public static Song fileToMusic(File file) { 24 | if (file.length() == 0) return null; 25 | 26 | MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever(); 27 | metadataRetriever.setDataSource(file.getAbsolutePath()); 28 | 29 | String title = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE); 30 | String displayName = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE); 31 | String artist = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST); 32 | String album = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM); 33 | int duration = Integer.parseInt(metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)); 34 | 35 | if (duration == 0) return null; 36 | 37 | Song song = new Song(); 38 | song.setTitle(title); 39 | song.setDisplayName(displayName); 40 | song.setArtist(artist); 41 | song.setPath(file.getAbsolutePath()); 42 | song.setAlbum(album); 43 | song.setDuration(duration); 44 | song.setSize((int) file.length()); 45 | return song; 46 | } 47 | 48 | public static List loadDiskMusic() { 49 | List songs = new ArrayList<>(); 50 | Cursor cursor = MyApplication.getAppContext().getContentResolver() 51 | .query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, null, null, MediaStore.Audio.Media.DEFAULT_SORT_ORDER); 52 | while (cursor.moveToNext()) { 53 | if (cursor.getInt(cursor.getColumnIndex(MediaStore.Audio.Media.IS_MUSIC)) != 0) { 54 | Song song = new Song(); 55 | song.setTitle(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE))); 56 | String displayName = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME)); 57 | if (displayName.endsWith(".mp3")) { 58 | displayName = displayName.substring(0, displayName.length() - 4); 59 | } 60 | song.setDisplayName(displayName); 61 | song.setArtist(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST))); 62 | song.setAlbum(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM))); 63 | song.setPath(cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA))); 64 | song.setDuration(cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DURATION))); 65 | song.setSize(cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.SIZE))); 66 | songs.add(song); 67 | } 68 | } 69 | cursor.close(); 70 | return songs; 71 | } 72 | 73 | public static Bitmap parseThumbToBitmap(Song song) { 74 | MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever(); 75 | metadataRetriever.setDataSource(new File(song.getPath()).getAbsolutePath()); 76 | byte[] thumbData = metadataRetriever.getEmbeddedPicture(); 77 | if (thumbData != null) { 78 | return BitmapFactory.decodeByteArray(thumbData, 0, thumbData.length); 79 | } 80 | return null; 81 | } 82 | 83 | public static byte[] parseThumbToByte(Song song) { 84 | MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever(); 85 | metadataRetriever.setDataSource(new File(song.getPath()).getAbsolutePath()); 86 | return metadataRetriever.getEmbeddedPicture(); 87 | } 88 | 89 | public static boolean isFileExists(String path) { 90 | File file = new File(path); 91 | if (file.exists()) { 92 | return true; 93 | } 94 | return false; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/InputUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.SystemClock; 6 | import android.view.inputmethod.InputMethodManager; 7 | 8 | import sbingo.likecloudmusic.common.MyApplication; 9 | 10 | /** 11 | * Author: Sbingo 12 | * Date: 2016/12/12 13 | */ 14 | 15 | public class InputUtils { 16 | 17 | /** 18 | * 是否点击过快,防手抖 19 | * 20 | * @return 21 | */ 22 | public static boolean isClickTooFast() { 23 | if (SystemClock.elapsedRealtime() - MyApplication.mLastClickTime < 500) { 24 | return true; 25 | } 26 | MyApplication.mLastClickTime = SystemClock.elapsedRealtime(); 27 | return false; 28 | } 29 | 30 | /** 31 | * 判断是否为汉字 32 | * 33 | * @param c 34 | * @return 35 | */ 36 | public static boolean isChinese(char c) { 37 | Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); 38 | 39 | return ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS 40 | || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION 41 | || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS 42 | || ub == Character.UnicodeBlock.NUMBER_FORMS; 43 | } 44 | 45 | /** 46 | * 检查文字格式 47 | * 只能是中文、英文字母、数字 48 | * 49 | * @param name 50 | * @return 51 | */ 52 | public static boolean isTextFormatCorrect(String name) { 53 | boolean res = true; 54 | char[] cTemp = name.toCharArray(); 55 | for (int i = 0; i < name.length(); i++) { 56 | if (!isChinese(cTemp[i]) && !(cTemp[i] >= 32 && cTemp[i] <= 126)) { 57 | res = false; 58 | break; 59 | } 60 | } 61 | return res; 62 | } 63 | 64 | /** 65 | * 显示或隐藏键盘 66 | */ 67 | public static void switchSoftInput() { 68 | InputMethodManager imm = (InputMethodManager) MyApplication.getAppContext().getSystemService(Context.INPUT_METHOD_SERVICE); 69 | imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); 70 | } 71 | 72 | 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/NavigationUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import sbingo.likecloudmusic.ui.fragment.BaseFragment; 4 | import sbingo.likecloudmusic.ui.fragment.LocalMusic.DiskMusicFragment; 5 | import sbingo.likecloudmusic.ui.fragment.LocalMusic.LocalMusicFragment; 6 | import sbingo.likecloudmusic.ui.fragment.NetMusic.NetMusicFragment; 7 | import sbingo.likecloudmusic.ui.fragment.NetMusic.PlaylistFragment; 8 | import sbingo.likecloudmusic.ui.fragment.NetMusic.RadioFragment; 9 | import sbingo.likecloudmusic.ui.fragment.NetMusic.RankingFragment; 10 | import sbingo.likecloudmusic.ui.fragment.NetMusic.RecommendFragment; 11 | import sbingo.likecloudmusic.ui.fragment.Social.FriendsFragment; 12 | import sbingo.likecloudmusic.ui.fragment.Social.NearbyFragment; 13 | import sbingo.likecloudmusic.ui.fragment.Social.NewStateFragment; 14 | import sbingo.likecloudmusic.ui.fragment.Social.SocialFragment; 15 | 16 | /** 17 | * Author: Sbingo 18 | * Date: 2016/12/12 19 | */ 20 | 21 | public class NavigationUtils { 22 | 23 | public static BaseFragment[] mainFragments = {NetMusicFragment.getInstance(), LocalMusicFragment.getInstance(), SocialFragment.getInstance()}; 24 | 25 | public static BaseFragment[] netMusicFragments = {RecommendFragment.getInstance(), PlaylistFragment.getInstance(), RadioFragment.getInstance(), RankingFragment.getInstance()}; 26 | 27 | public static BaseFragment[] socialFragments = {NewStateFragment.getInstance(), NearbyFragment.getInstance(), FriendsFragment.getInstance()}; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/NetUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | 7 | import sbingo.likecloudmusic.common.MyApplication; 8 | 9 | /** 10 | * Author: Sbingo 11 | * Date: 2016/12/12 12 | */ 13 | 14 | public class NetUtils { 15 | 16 | public static void isNetworkConnected() { 17 | ConnectivityManager connectivityManager = 18 | (ConnectivityManager) MyApplication.getAppContext().getSystemService(Context.CONNECTIVITY_SERVICE); 19 | NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); 20 | if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) { 21 | throw new RuntimeException("连接失败,请检查您的网络连接!"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/NumberUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import java.text.DecimalFormat; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/12 8 | */ 9 | 10 | public class NumberUtils { 11 | 12 | public static String decimalFormat(float f) { 13 | DecimalFormat myformat = new DecimalFormat(); 14 | myformat.applyPattern("0.00"); 15 | return myformat.format(f); 16 | } 17 | 18 | public static String noDecimal(float f) { 19 | DecimalFormat myformat = new DecimalFormat(); 20 | myformat.applyPattern("0"); 21 | return myformat.format(f); 22 | } 23 | 24 | /** 25 | * 去除末尾的0或小数点 26 | * 27 | * @param a 28 | * @return 29 | */ 30 | public static String noZeroDecimal(String a) { 31 | if (!a.contains(".")) { 32 | return a; 33 | } else { 34 | StringBuffer out = new StringBuffer(a); 35 | int point = out.indexOf("."); 36 | for (int i = out.length() - 1; i >= point; i--) { 37 | if (out.charAt(i) == '0' || out.charAt(i) == '.') { 38 | out.deleteCharAt(i); 39 | continue; 40 | } 41 | break; 42 | } 43 | return out.toString(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/PreferenceUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | import sbingo.likecloudmusic.common.Constants; 7 | 8 | /** 9 | * Author: Sbingo 10 | * Date: 2016/12/12 11 | */ 12 | 13 | public class PreferenceUtils { 14 | 15 | public static final String PREFERENCE_NAME = Constants.PREFERENCE_NAME; 16 | 17 | public static boolean putString(Context context, String key, String value) { 18 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 19 | SharedPreferences.Editor editor = sp.edit(); 20 | editor.putString(key, value); 21 | return editor.commit(); 22 | } 23 | 24 | public static String getString(Context context, String key) { 25 | return getString(context, key, null); 26 | } 27 | 28 | public static String getString(Context context, String key, String defaultValue) { 29 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 30 | return sp.getString(key, defaultValue); 31 | } 32 | 33 | public static boolean putInt(Context context, String key, int value) { 34 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 35 | SharedPreferences.Editor editor = sp.edit(); 36 | editor.putInt(key, value); 37 | return editor.commit(); 38 | } 39 | 40 | public static int getInt(Context context, String key) { 41 | return getInt(context, key, -1); 42 | } 43 | 44 | public static int getInt(Context context, String key, int defaultValue) { 45 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 46 | return sp.getInt(key, defaultValue); 47 | } 48 | public static boolean putLong(Context context, String key, long value) { 49 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 50 | SharedPreferences.Editor editor = sp.edit(); 51 | editor.putLong(key, value); 52 | return editor.commit(); 53 | } 54 | 55 | public static long getLong(Context context, String key) { 56 | return getLong(context, key, -1); 57 | } 58 | 59 | public static long getLong(Context context, String key, long defaultValue) { 60 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 61 | return sp.getLong(key, defaultValue); 62 | } 63 | 64 | public static boolean putFloat(Context context, String key, float value) { 65 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 66 | SharedPreferences.Editor editor = sp.edit(); 67 | editor.putFloat(key, value); 68 | return editor.commit(); 69 | } 70 | 71 | public static float getFloat(Context context, String key) { 72 | return getFloat(context, key, -1); 73 | } 74 | 75 | public static float getFloat(Context context, String key, float defaultValue) { 76 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 77 | return sp.getFloat(key, defaultValue); 78 | } 79 | 80 | public static boolean putBoolean(Context context, String key, boolean value) { 81 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 82 | SharedPreferences.Editor editor = sp.edit(); 83 | editor.putBoolean(key, value); 84 | return editor.commit(); 85 | } 86 | 87 | public static boolean getBoolean(Context context, String key) { 88 | return getBoolean(context, key, false); 89 | } 90 | 91 | public static boolean getBoolean(Context context, String key, boolean defaultValue) { 92 | SharedPreferences sp = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); 93 | return sp.getBoolean(key, defaultValue); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/RegExpUtil.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import java.util.regex.Matcher; 4 | import java.util.regex.Pattern; 5 | 6 | /** 7 | * Author: Sbingo 8 | * Date: 2016/12/12 9 | */ 10 | 11 | public class RegExpUtil { 12 | 13 | /** 14 | * 验证是否是手机号码 15 | * @param str 16 | * @return 17 | */ 18 | public static boolean isMobile(String str) { 19 | //Pattern pattern = Pattern.compile("^((13[0-9])|(15[0-9])|(18[0-9])|(17[0-9])|(14[0-9]))\\d{8}$"); 20 | Pattern pattern = Pattern.compile("^[1][34578][0-9]\\d{8}$"); 21 | Matcher matcher = pattern.matcher(str); 22 | return matcher.matches(); 23 | } 24 | 25 | /** 26 | * 小数,最多两位小数,如:10.2, 0.25, 20 27 | * @param str 28 | */ 29 | public static boolean isDecimalTwo(String str){ 30 | return str.matches("^[1-9]\\d*(\\.\\d{0,2})?|0\\.(0[1-9]?|[1-9]\\d?)?$"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/RemindUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.graphics.Color; 4 | import android.support.design.widget.Snackbar; 5 | import android.view.View; 6 | 7 | import sbingo.com.mylibrary.CustomSnackbar; 8 | import sbingo.com.mylibrary.CustomToast; 9 | import sbingo.likecloudmusic.common.MyApplication; 10 | 11 | /** 12 | * Author: Sbingo 13 | * Date: 2016/12/12 14 | */ 15 | 16 | public class RemindUtils { 17 | 18 | private static Snackbar snackbar; 19 | 20 | public static void showToast(String msg) { 21 | new CustomToast(MyApplication.getAppContext()).makeText(msg).show(); 22 | } 23 | 24 | public static void showCustomToast(String msg, int layoutId, int textId, @CustomToast.Duration int duration) { 25 | new CustomToast(MyApplication.getAppContext()) 26 | .setLayoutResource(layoutId) 27 | .setToastId(textId) 28 | .makeText(msg) 29 | .setDuration(duration) 30 | .show(); 31 | } 32 | 33 | public static Snackbar makeSnackbar(View v, final String msg, String action, Snackbar.Callback callback) { 34 | return snackbar = Snackbar.make(v, msg, Snackbar.LENGTH_LONG) 35 | .setAction(action, new View.OnClickListener() { 36 | @Override 37 | public void onClick(View v) { 38 | snackbar.dismiss(); 39 | } 40 | }) 41 | .setActionTextColor(Color.RED) 42 | .setCallback(callback); 43 | } 44 | 45 | public static void showCustomSnackbar(View v, final String msg, String action, int backgroudColor, int messageColor, int layoutId, Snackbar.Callback callback) { 46 | CustomSnackbar.getInstance(makeSnackbar(v, msg, action, callback)) 47 | .setBackgroundColor(backgroudColor) 48 | .setMessageColor(messageColor) 49 | .addView(layoutId, 0) 50 | .show(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/RxUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import rx.Subscription; 4 | 5 | /** 6 | * Author: Sbingo 7 | * Date: 2016/12/12 8 | */ 9 | 10 | public class RxUtils { 11 | 12 | public static void unSubscribe(Subscription subscription) { 13 | if (subscription != null && !subscription.isUnsubscribed()) { 14 | subscription.unsubscribe(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | 7 | import sbingo.likecloudmusic.common.MyApplication; 8 | 9 | /** 10 | * Author: Sbingo 11 | * Date: 2016/12/12 12 | */ 13 | 14 | public class ScreenUtils { 15 | 16 | private static DisplayMetrics getDisplayMetrics(Context context) { 17 | DisplayMetrics dm = new DisplayMetrics(); 18 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm); 19 | return dm; 20 | } 21 | 22 | public static int getScreenWidth(Context context) { 23 | return getDisplayMetrics(context).widthPixels; 24 | } 25 | 26 | public static int getScreenHeight(Context context) { 27 | return getDisplayMetrics(context).heightPixels; 28 | } 29 | 30 | public static float getDensity(Context context) { 31 | return getDisplayMetrics(context).density; 32 | } 33 | 34 | public static int dp2px(Context context,float dp) { 35 | return (int) (dp * getDensity(context) + 0.5f); 36 | } 37 | 38 | public static int px2dp(Context context,float px) { 39 | return (int) (px / getDensity(context) + 0.5f); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/utils/TimeUtils.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.utils; 2 | 3 | import android.net.ParseException; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | import java.util.GregorianCalendar; 9 | import java.util.Locale; 10 | 11 | /** 12 | * Author: Sbingo 13 | * Date: 2016/12/12 14 | */ 15 | 16 | public class TimeUtils { 17 | 18 | public static final SimpleDateFormat DETAIL_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 19 | public static final SimpleDateFormat SIMPLE_FORMAT_DATE = new SimpleDateFormat("yyyy-MM-dd"); 20 | public static final SimpleDateFormat CHINA_FORMAT_DATE = new SimpleDateFormat("yyyy年MM月dd日", Locale.CHINA); 21 | 22 | public static String dateToSimpleString(Date date) { 23 | return SIMPLE_FORMAT_DATE.format(date); 24 | } 25 | 26 | public static String dateToDetailString(Date date) { 27 | return DETAIL_DATE_FORMAT.format(date); 28 | } 29 | 30 | public static Date stringToDate(String dateStr) throws java.text.ParseException { 31 | SimpleDateFormat format = null; 32 | if (isChineseDateType(dateStr)) { 33 | format = CHINA_FORMAT_DATE; 34 | } else if (isDateType(dateStr)) { 35 | format = SIMPLE_FORMAT_DATE; 36 | } else { 37 | format = DETAIL_DATE_FORMAT; 38 | } 39 | try { 40 | return format.parse(dateStr); 41 | } catch (ParseException e) { 42 | return null; 43 | } 44 | } 45 | 46 | /** 47 | * 判断是否今天 48 | * 49 | * @param date 50 | * @return 51 | */ 52 | public static boolean isToday(Date date) { 53 | Calendar calendar = new GregorianCalendar(); 54 | calendar.setTime(date); 55 | Date today = new Date(); 56 | return dateToSimpleString(date).equals(dateToSimpleString(today)) ? true : false; 57 | } 58 | 59 | /** 60 | * 获取明天 61 | * 62 | * @return 63 | */ 64 | public static String getTomorrow() { 65 | Calendar calendar = Calendar.getInstance(); 66 | calendar.setTime(new Date()); 67 | calendar.add(Calendar.DATE, 1); 68 | return dateToSimpleString(calendar.getTime()); 69 | } 70 | 71 | 72 | /** 73 | * 是否符合日期格式yyyy-MM-dd 74 | * 75 | * @param sDate 76 | * @return 77 | */ 78 | public static boolean isDateType(String sDate) { 79 | return sDate.matches("\\d{2,4}-\\d{1,2}-\\d{1,2}"); 80 | } 81 | 82 | public static boolean isChineseDateType(String date) { 83 | return date.matches("\\d{2,4}年\\d{1,2}月\\d{1,2}日"); 84 | } 85 | 86 | /** 87 | * @param leftTime 88 | * @return 时分秒01:25:58 or 时分12:26 89 | */ 90 | public static String getLeftTime(long leftTime) { 91 | final long HOUR = 3600 * 1000; 92 | final long MIN = 60 * 1000; 93 | final long SEC = 1000; 94 | int hour, min, sec; 95 | if (leftTime / HOUR >= 1) { //小时差大于1小时 96 | hour = (int) (leftTime / HOUR); 97 | if (leftTime % HOUR / MIN >= 1) { //分差大于1分钟 98 | min = (int) (leftTime % HOUR / MIN); 99 | } else { 100 | min = 0; 101 | } 102 | sec = (int) (leftTime % HOUR % MIN / SEC); 103 | } else { 104 | hour = 0; 105 | if (leftTime % HOUR / MIN >= 1) { //分差大于1分钟 106 | min = (int) (leftTime % HOUR / MIN); 107 | } else { 108 | min = 0; 109 | } 110 | sec = (int) (leftTime % HOUR % MIN / SEC); 111 | } 112 | String h = hour + ""; 113 | String m = min + ""; 114 | String s = sec + ""; 115 | if (h.length() != 2) { 116 | h = "0" + h; 117 | } 118 | if (m.length() != 2) { 119 | m = "0" + m; 120 | } 121 | if (s.length() != 2) { 122 | s = "0" + s; 123 | } 124 | if (hour > 0) { 125 | return h + ":" + m + ":" + s; 126 | } else { 127 | return m + ":" + s; 128 | } 129 | } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/widget/LocalMenuItem.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.widget; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.drawable.Drawable; 6 | import android.support.v4.content.ContextCompat; 7 | import android.util.AttributeSet; 8 | import android.view.LayoutInflater; 9 | import android.widget.FrameLayout; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | 13 | import com.bumptech.glide.Glide; 14 | 15 | import butterknife.BindView; 16 | import butterknife.ButterKnife; 17 | import sbingo.likecloudmusic.R; 18 | 19 | /** 20 | * Author: Sbingo 21 | * Date: 2016/12/14 22 | */ 23 | 24 | public class LocalMenuItem extends FrameLayout { 25 | 26 | @BindView(R.id.icon) 27 | ImageView icon; 28 | @BindView(R.id.title) 29 | TextView title; 30 | @BindView(R.id.count) 31 | TextView count; 32 | @BindView(R.id.speaker) 33 | ImageView speaker; 34 | private Context mContext; 35 | 36 | Drawable mIcon; 37 | String mTitle; 38 | 39 | public LocalMenuItem(Context context) { 40 | this(context, null); 41 | } 42 | 43 | public LocalMenuItem(Context context, AttributeSet attrs) { 44 | this(context, attrs, 0); 45 | } 46 | 47 | public LocalMenuItem(Context context, AttributeSet attrs, int defStyleAttr) { 48 | super(context, attrs, defStyleAttr); 49 | mContext = context; 50 | init(attrs); 51 | } 52 | 53 | void init(AttributeSet attrs) { 54 | ButterKnife.bind(LayoutInflater.from(mContext).inflate(R.layout.local_menu_item, this)); 55 | TypedArray ta = mContext.obtainStyledAttributes(attrs, R.styleable.LocalMenuItem); 56 | mIcon = ta.getDrawable(R.styleable.LocalMenuItem_icon); 57 | mTitle = ta.getString(R.styleable.LocalMenuItem_title); 58 | ta.recycle(); 59 | icon.setImageDrawable(mIcon); 60 | title.setText(mTitle); 61 | } 62 | 63 | public void showSpeaker() { 64 | speaker.setVisibility(VISIBLE); 65 | } 66 | 67 | public void hideSpeaker() { 68 | speaker.setVisibility(GONE); 69 | } 70 | 71 | public void setCount(int s) { 72 | count.setText("(" + String.valueOf(s) + ")"); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/sbingo/likecloudmusic/widget/OutPlayerController.java: -------------------------------------------------------------------------------- 1 | package sbingo.likecloudmusic.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.util.AttributeSet; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.widget.FrameLayout; 9 | import android.widget.ImageView; 10 | import android.widget.LinearLayout; 11 | import android.widget.ProgressBar; 12 | import android.widget.TextView; 13 | 14 | import com.bumptech.glide.Glide; 15 | 16 | import butterknife.BindView; 17 | import butterknife.ButterKnife; 18 | import butterknife.OnClick; 19 | import sbingo.likecloudmusic.R; 20 | 21 | /** 22 | * Author: Sbingo 23 | * Date: 2016/12/14 24 | */ 25 | 26 | public class OutPlayerController extends FrameLayout { 27 | 28 | @BindView(R.id.thumb) 29 | ImageView thumb; 30 | @BindView(R.id.next) 31 | ImageView next; 32 | @BindView(R.id.play) 33 | ImageView play; 34 | @BindView(R.id.play_list) 35 | ImageView playList; 36 | @BindView(R.id.play_progress) 37 | ProgressBar playProgress; 38 | @BindView(R.id.controller) 39 | LinearLayout controller; 40 | @BindView(R.id.song_name) 41 | TextView songName; 42 | @BindView(R.id.singer) 43 | TextView singer; 44 | 45 | private OutPlayerControllerListener listener; 46 | private Context mContext; 47 | private boolean isPlaying; 48 | 49 | public OutPlayerController(Context context) { 50 | this(context, null); 51 | } 52 | 53 | public OutPlayerController(Context context, AttributeSet attrs) { 54 | this(context, attrs, 0); 55 | } 56 | 57 | public OutPlayerController(Context context, AttributeSet attrs, int defStyleAttr) { 58 | super(context, attrs, defStyleAttr); 59 | mContext = context; 60 | init(); 61 | } 62 | 63 | void init() { 64 | ButterKnife.bind(LayoutInflater.from(mContext).inflate(R.layout.out_player_controller, this)); 65 | } 66 | 67 | @OnClick({R.id.next, R.id.play, R.id.play_list, R.id.controller}) 68 | public void onClick(View view) { 69 | if (listener == null) { 70 | return; 71 | } 72 | switch (view.getId()) { 73 | case R.id.next: 74 | setPlaying(true); 75 | listener.next(); 76 | break; 77 | case R.id.play: 78 | isPlaying = isPlaying ? false : true; 79 | Glide.with(mContext).load(isPlaying ? R.drawable.pause : R.drawable.play).placeholder(R.drawable.pic_loading_45).into(play); 80 | listener.play(); 81 | break; 82 | case R.id.play_list: 83 | listener.playList(); 84 | break; 85 | case R.id.controller: 86 | listener.controller(); 87 | break; 88 | } 89 | } 90 | 91 | public interface OutPlayerControllerListener { 92 | void play(); 93 | 94 | void next(); 95 | 96 | void playList(); 97 | 98 | void controller(); 99 | } 100 | 101 | public void setPlayerListener(OutPlayerControllerListener listener) { 102 | this.listener = listener; 103 | } 104 | 105 | public boolean isPlaying() { 106 | return isPlaying; 107 | } 108 | 109 | public void setPlaying(boolean playing) { 110 | isPlaying = playing; 111 | Glide.with(mContext).load(isPlaying ? R.drawable.pause : R.drawable.play).placeholder(R.drawable.pic_loading_45).into(play); 112 | } 113 | 114 | public void setThumb(byte[] data) { 115 | Glide.with(mContext).load(data).placeholder(R.drawable.pic_loading_45).error(R.drawable.pic_error_45).into(thumb); 116 | } 117 | 118 | public void setSongName(String s) { 119 | songName.setText(s); 120 | } 121 | 122 | public void setSinger(String s) { 123 | singer.setText(s); 124 | } 125 | 126 | public void setPlayProgress(int progress) { 127 | playProgress.setProgress(progress); 128 | } 129 | 130 | public int getPlayProgress() { 131 | return playProgress.getProgress(); 132 | } 133 | 134 | public int getProgressMax() { 135 | return playProgress.getMax(); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/res/anim/loading_fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/main_finish.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/avatar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/box.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clock_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/clock_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/close_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/close_48.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/clothes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/clothes.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/cloud.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/cry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/cry.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/diamond.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/download_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/download_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/envelop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/envelop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/lamp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/lamp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/list.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/loading.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/lyric_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/lyric_48.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/mic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mobile_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/mobile_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/more_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/more_40.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/more_white_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/more_white_48.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/music_disk_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/music_disk_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mv_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/mv_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/mv_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/mv_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/next.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_last_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_last_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_love_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_love_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_love_checked_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_love_checked_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_lyric_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_lyric_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_lyric_checked_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_lyric_checked_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_next_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_next_32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_pause_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_pause_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/notification_play_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/notification_play_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_error_150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/pic_error_150.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_error_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/pic_error_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_loading_150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/pic_loading_150.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/pic_loading_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/pic_loading_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/right_arrow_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/right_arrow_40.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/scan.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/scan_local_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/scan_local_40.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/shop.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/singer_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/singer_45.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/sort_35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/sort_35.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/speaker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/speaker.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/timing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/timing.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/white_logo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/white_logo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/yes_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/yes_10.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/yes_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/yes_20.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/yes_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/yes_30.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/yes_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/drawable-xhdpi/yes_40.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_music.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_music_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_people.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_people_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_symbol.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_symbol_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/local_music_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/message.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/net_music_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/progress_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_nav_bar.xml: -------------------------------------------------------------------------------- 1 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/social_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/stroke_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/stroke_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | 24 | 32 | 33 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/disk_music_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 21 | 22 | 31 | 32 | 39 | 40 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/disk_other_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 22 | 23 | 28 | 29 | 39 | 40 | 41 | 42 | 48 | 54 | 55 | 62 | 63 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/res/layout/disk_song_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 23 | 24 | 29 | 30 | 32 | 33 | 43 | 44 | 49 | 50 | 51 | 61 | 62 | 63 | 64 | 71 | 72 | 73 | 77 | -------------------------------------------------------------------------------- /app/src/main/res/layout/local_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 40 | 41 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/local_menu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 20 | 21 | 31 | 32 | 42 | 43 | 53 | 54 | 60 | 61 | -------------------------------------------------------------------------------- /app/src/main/res/layout/local_music_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 | 41 | 42 | 48 | 49 | 53 | 54 | 59 | 60 | 68 | 69 | 75 | 76 | 77 | 78 | 84 | 85 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 26 | 27 | 28 | 29 | 34 | 40 | 41 | 47 | 48 | 49 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_radio_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/menu_night_switch.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/menu_text.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_bottom.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | 17 | 22 | 23 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 18 | 19 | 22 | 23 | 27 | 28 | 34 | 35 | 43 | 44 | 45 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/net_music_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notification_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 24 | 25 | 38 | 39 | 52 | 53 | 62 | 63 | 69 | 70 | 76 | 77 | 83 | 84 | 90 | 91 | 97 | 98 | -------------------------------------------------------------------------------- /app/src/main/res/layout/notification_view_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 22 | 31 | 32 | 42 | 43 | 44 | 50 | 51 | 57 | 58 | 64 | 65 | 71 | 72 | 79 | 80 | 87 | -------------------------------------------------------------------------------- /app/src/main/res/layout/out_player_controller.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 24 | 25 | 32 | 33 | 40 | 41 | 48 | 49 | 57 | 58 | 65 | 66 | 74 | 75 | 76 | 77 | 78 | 86 | -------------------------------------------------------------------------------- /app/src/main/res/layout/social_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/timing_stop_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 17 | 18 | 22 | 23 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/activity_main_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 10 | 14 | 19 | 23 | 24 | 25 | 26 | 30 | 31 | 36 | 37 | 42 | 43 | 48 | 49 | 53 | 54 | 58 | 59 | 63 | 64 | 68 | 69 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/scan_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/mipmap-xhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/white_logo_90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/app/src/main/res/mipmap-xhdpi/white_logo_90.png -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FF000000 5 | #FFCE3D3E 6 | 7 | @color/black 8 | #17181A 9 | #151618 10 | @color/alpha_60_white 11 | @color/alpha_80_white 12 | @color/white 13 | #00000000 14 | @color/alpha_50_white 15 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #CE3D3E 4 | #CE3D3E 5 | #CE3D3E 6 | 7 | #F2F4F5 8 | #FEFEFE 9 | #E6E8E9 10 | #999999 11 | #707070 12 | @color/black 13 | #00000000 14 | @color/alpha_25_black 15 | 16 | #0DFFFFFF 17 | #1AFFFFFF 18 | #26FFFFFF 19 | #33FFFFFF 20 | #40FFFFFF 21 | #4DFFFFFF 22 | #59FFFFFF 23 | #66FFFFFF 24 | #73FFFFFF 25 | #80FFFFFF 26 | #8CFFFFFF 27 | #99FFFFFF 28 | #A6FFFFFF 29 | #B3FFFFFF 30 | #BFFFFFFF 31 | #CCFFFFFF 32 | #D9FFFFFF 33 | #E6FFFFFF 34 | #F2FFFFFF 35 | #FFFFFFFF 36 | 37 | #0D000000 38 | #1A000000 39 | #26000000 40 | #33000000 41 | #40000000 42 | #4D000000 43 | #59000000 44 | #66000000 45 | #73000000 46 | #80000000 47 | #8C000000 48 | #99000000 49 | #A6000000 50 | #B3000000 51 | #BF000000 52 | #CC000000 53 | #D9000000 54 | #E6000000 55 | #F2000000 56 | #FF000000 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 160dp 4 | 0.5dp 5 | 51dp 6 | 0dp 7 | 1dp 8 | 5dp 9 | 10dp 10 | 15dp 11 | 16dp 12 | 18dp 13 | 20dp 14 | 22dp 15 | 25dp 16 | 32dp 17 | 45dp 18 | 50dp 19 | 55dp 20 | 60dp 21 | 70dp 22 | 72dp 23 | 100dp 24 | 25 | 10sp 26 | 12sp 27 | 14sp 28 | 16sp 29 | 18sp 30 | 20sp 31 | 25sp 32 | 30sp 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/values/drawables.xml: -------------------------------------------------------------------------------- 1 | 2 | @android:drawable/ic_menu_camera 3 | @android:drawable/ic_menu_gallery 4 | @android:drawable/ic_menu_slideshow 5 | @android:drawable/ic_menu_manage 6 | @android:drawable/ic_menu_share 7 | @android:drawable/ic_menu_send 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 云音 3 | 4 | Open navigation drawer 5 | Close navigation drawer 6 | 7 | Search 8 | 9 | 陈奕迅 10 | 红玫瑰 11 | 2016跨世界粤语精选 12 | 13 | 14 | 云上的声音\n用心倾听\n…… 15 | 16 | 我的消息 17 | 会员中心 18 | 积分商城 19 | 在线听歌免流量 20 | 听歌识曲 21 | 主题换肤 22 | 夜间模式 23 | 定时停止播放 24 | 扫一扫 25 | 我的音乐云盒 26 | 音乐闹钟 27 | 驾驶模式 28 | 占位行 29 | 30 | 设置 31 | 退出应用 32 | 33 | 34 | 本地音乐 35 | 最近播放 36 | 下载管理 37 | 我的歌手 38 | 我的MV 39 | 40 | 41 | 42 | 单曲 43 | 歌手 44 | 专辑 45 | 文件夹 46 | 47 | 48 | 49 | 50 | 单曲 51 | 电台节目 52 | MV 53 | 下载中 54 | 55 | 56 | 57 | 扫描本地音乐 58 | 选择排序方式 59 | 获取封面歌词 60 | 升级音质 61 | 62 | 创建的歌单 (%1$d) 63 | 64 | %1$d首 65 | 66 | %1$s - %2$s 67 | 68 | 暂无本地音乐 69 | 一键扫描 70 | 歌曲文件【%1$s】不存在 71 | 72 | 73 | 【%1$s】权限被拒绝,%2$s 74 | 75 | 76 | 77 | 不开启 78 | 10分钟后 79 | 20分钟后 80 | 30分钟后 81 | 45分钟后 82 | 60分钟后 83 | 自定义 84 | 85 | 86 | 计时结束后播完当前歌曲再停止 87 | 88 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 21 | 22 | 25 | 26 | 34 | 35 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | maven { url "https://jitpack.io" } 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /gif/LikeCloudMusic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/gif/LikeCloudMusic.gif -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binaryshao/LikeCloudMusic/cdeb705c3c035d85fb924703241176b59adcfde8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /mylibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mylibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "24.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:25.0.1' 24 | compile 'com.android.support:design:25.0.1' 25 | } 26 | -------------------------------------------------------------------------------- /mylibrary/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\AS-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /mylibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mylibrary/src/main/java/sbingo/com/mylibrary/CustomSnackbar.java: -------------------------------------------------------------------------------- 1 | package sbingo.com.mylibrary; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.annotation.ColorInt; 5 | import android.support.annotation.DrawableRes; 6 | import android.support.annotation.NonNull; 7 | import android.support.design.widget.Snackbar; 8 | import android.view.Gravity; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.widget.LinearLayout; 12 | import android.widget.TextView; 13 | 14 | /** 15 | * Author: Sbingo 16 | * Date: 2016/8/19 17 | * Use this class to custom a {@link Snackbar}, such as it's background, message color,etc. 18 | * Before use the {@link CustomSnackbar}, a standard Snackbar is required. 19 | * Just as Snackbar, you can use method chaining to create and show a Snackbar in one statement. 20 | */ 21 | public class CustomSnackbar { 22 | 23 | private static Snackbar snackbar; 24 | private static CustomSnackbar customSnackbar; 25 | 26 | /** 27 | * get the instance of {@link CustomSnackbar}. 28 | * 29 | * @param snackbar a snackbar have been created, it is required. 30 | * @return 31 | */ 32 | public static CustomSnackbar getInstance(@NonNull Snackbar snackbar) { 33 | if (null == customSnackbar) { 34 | synchronized (CustomSnackbar.class) { 35 | if (null == customSnackbar) { 36 | customSnackbar = new CustomSnackbar(); 37 | } 38 | } 39 | } 40 | CustomSnackbar.snackbar = snackbar; 41 | return customSnackbar; 42 | } 43 | 44 | /** 45 | * set the {@link CustomSnackbar}'s background color 46 | * 47 | * @param color the color used as the background 48 | * @return 49 | */ 50 | public CustomSnackbar setBackgroundColor(@ColorInt int color) { 51 | getBackground().setBackgroundColor(color); 52 | return this; 53 | } 54 | 55 | /** 56 | * set the {@link CustomSnackbar}'s background 57 | * 58 | * @param drawable the drawable used as the background 59 | * @return 60 | */ 61 | public CustomSnackbar setBackground(@DrawableRes Drawable drawable) { 62 | getBackground().setBackground(drawable); 63 | return this; 64 | } 65 | 66 | /** 67 | * set the message's color 68 | * 69 | * @param color the color to be set 70 | * @return 71 | */ 72 | public CustomSnackbar setMessageColor(@ColorInt int color) { 73 | ((TextView) (getBackground().findViewById(R.id.snackbar_text))).setTextColor(color); 74 | return this; 75 | } 76 | 77 | /** 78 | * add a view to the {@link CustomSnackbar}. 79 | * Notice: This method is not recommended, especially the layout is complicated. 80 | * 81 | * @param layoutId the resource id of the layout. 82 | * @param index the position at which to add the new view or -1 to add last 83 | * @return 84 | */ 85 | public CustomSnackbar addView(int layoutId, int index) { 86 | Snackbar.SnackbarLayout snackbarLayout = (Snackbar.SnackbarLayout) getBackground(); 87 | View addView = LayoutInflater.from(getBackground().getContext()).inflate(layoutId, null); 88 | LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 89 | p.gravity = Gravity.CENTER_VERTICAL; 90 | snackbarLayout.addView(addView, index, p); 91 | return this; 92 | } 93 | 94 | /** 95 | * show the {@link CustomSnackbar}. 96 | */ 97 | public void show() { 98 | snackbar.show(); 99 | } 100 | 101 | private View getBackground() { 102 | return snackbar.getView(); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /mylibrary/src/main/java/sbingo/com/mylibrary/CustomToast.java: -------------------------------------------------------------------------------- 1 | package sbingo.com.mylibrary; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.IdRes; 5 | import android.support.annotation.IntDef; 6 | import android.support.annotation.LayoutRes; 7 | import android.support.annotation.StringRes; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import java.lang.annotation.Retention; 14 | import java.lang.annotation.RetentionPolicy; 15 | 16 | /** 17 | * Author: Sbingo 18 | * Date: 2016/9/10 19 | */ 20 | public class CustomToast { 21 | 22 | private static Toast customToast; 23 | private int duration = Toast.LENGTH_SHORT; 24 | private Context context; 25 | @LayoutRes 26 | private int layoutResource = R.layout.default_custom_toast; 27 | @IdRes 28 | private int toastId = R.id.toast; 29 | 30 | public CustomToast(Context context) { 31 | if (null != customToast) { 32 | customToast.cancel(); 33 | } 34 | customToast = new Toast(context); 35 | this.context = context; 36 | } 37 | 38 | public CustomToast makeText(@StringRes int resId) { 39 | return makeText(context.getResources().getText(resId)); 40 | } 41 | 42 | public CustomToast makeText(CharSequence text) { 43 | View layout = LayoutInflater.from(context).inflate(layoutResource, null); 44 | TextView content = null; 45 | if (toastId != 0) { 46 | content = (TextView) layout.findViewById(toastId); 47 | } else { 48 | throw new RuntimeException("toastId must have been set"); 49 | } 50 | content.setText(text); 51 | customToast.setView(layout); 52 | customToast.setDuration(duration); 53 | return this; 54 | } 55 | 56 | public void show() { 57 | customToast.show(); 58 | } 59 | 60 | /** 61 | * use your own layout 62 | * Notice:{@code setToastId(toastId)} must be called after call this. 63 | * @param layoutResource the layout resource id 64 | * @return 65 | */ 66 | public CustomToast setLayoutResource(int layoutResource) { 67 | this.layoutResource = layoutResource; 68 | toastId = 0; 69 | return this; 70 | } 71 | 72 | /** 73 | * set the toast id 74 | * should only be called after call the {@code setLayoutResource(layoutResource}. 75 | * @param toastId usually the TextView's id of toast 76 | * @return 77 | */ 78 | public CustomToast setToastId(int toastId) { 79 | this.toastId = toastId; 80 | return this; 81 | } 82 | 83 | /** 84 | * Set how long to show the view for. 85 | * @param duration 86 | * @return 87 | */ 88 | public CustomToast setDuration(@Duration int duration) { 89 | this.duration = duration; 90 | return this; 91 | } 92 | 93 | @IntDef({Toast.LENGTH_SHORT, Toast.LENGTH_LONG}) 94 | @Retention(RetentionPolicy.SOURCE) 95 | public @interface Duration { 96 | 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /mylibrary/src/main/res/drawable/custom_toast_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mylibrary/src/main/res/layout/default_custom_toast.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | -------------------------------------------------------------------------------- /mylibrary/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #64000000 4 | -------------------------------------------------------------------------------- /mylibrary/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | My Library 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':mylibrary' 2 | --------------------------------------------------------------------------------