dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' compile 'com.squareup.okhttp3:okhttp:3.9.0' compile 'com.google.code.gson:gson:2.8.2' compile 'com.android.support:recyclerview-v7:26.1.0'
}
以上是项目所用的依赖
xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > android:id="@+id/swipe" android:layout_width="match_parent" android:layout_height="match_parent"> android:id="@+id/songList" android:layout_margin="16dp" android:layout_width="match_parent" android:layout_height="match_parent"> android:id="@+id/progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:visibility="gone" />
以上是主布局的控件
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > android:id="@+id/songName" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center_vertical" android:background="#00ff00" />
以上是item的控件
package com.example.mvp.view.IView; public interface IBaseView { }package com.example.mvp.view.IView; import com.example.mvp.model.bean.TestBean; public interface IMainView extends IBaseView { void onSuccess(TestBean testBean,boolean needClear); }以上便是view层的package com.example.mvp.model.bean; import java.util.List; /** * Created by hp on 2017/12/2. */ public class TestBean { /** * song_list : [{"artist_id":"762","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-12-08","album_no":"6","lrclink":"http://qukufile2.qianqian.com/data2/lrc/76d726767c64ac792a5d28b5b2c31c58/289056407/289056407.lrc","copy_type":"1","hot":"85485","all_artist_ting_uid":"1376,239558276","resource_type":"0","is_new":"0","rank_change":"0","rank":"1","all_artist_id":"762,261800939","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"flac,320,256,128,64","file_duration":197,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-寰球 ","res_encryption_flag":"0","song_id":"261704948","title":"怒放","ting_uid":"1376","author":"龙梅子,葛荟婕","album_id":"277577094","album_title":"红颜知己","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"龙梅子,葛荟婕","pic_radio":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000"},{"artist_id":"3699","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2015-11-18","album_no":"0","lrclink":"http://qukufile2.qianqian.com/data2/lrc/84ec23be78b018f205c39c226d7d41cd/270916100/270916100.lrc","copy_type":"1","hot":"273347","all_artist_ting_uid":"617453,72167","resource_type":"0","is_new":"0","rank_change":"0","rank":"2","all_artist_id":"3699,58516","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":287,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"北京百慕文化发展有限公司","res_encryption_flag":"0","song_id":"258475780","title":"你不来我不老 (对唱版)","ting_uid":"617453","author":"高安,西单女孩","album_id":"258475887","album_title":"你不来我不老 (对唱版)","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"高安,西单女孩","pic_radio":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/9d0c3a1f16f6c3b93d940c28465c342c/270909404/270909404.jpg"},{"artist_id":"57297","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2015-12-03","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/200072fb8d1328edc7fbff7fd1f296ef/263504359/263504359.lrc","copy_type":"1","hot":"198113","all_artist_ting_uid":"245815,106521670","resource_type":"0","is_new":"0","rank_change":"0","rank":"3","all_artist_id":"57297,109713449","style":"流行","del_status":"0","relate_status":"1","toneid":"0","all_rate":"64,128,256,320","file_duration":198,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"","info":"","has_filmtv":"0","si_proxycompany":"深圳凤凰涅盘文化传媒有限公司","res_encryption_flag":"0","song_id":"259727051","title":"亲爱的别想我","ting_uid":"245815","author":"祁隆,苏月","album_id":"259727050","album_title":"亲爱的别想我","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"祁隆,苏月","pic_radio":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_1000,h_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/259726434/259726434.jpg@s_1,w_1000,h_1000"},{"artist_id":"762","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-04-27","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/23132f075b8aa0446c9d7f8aedabe29d/265180519/265180519.lrc","copy_type":"1","hot":"102316","all_artist_ting_uid":"1376,88029082","resource_type":"0","is_new":"0","rank_change":"0","rank":"4","all_artist_id":"762,55359","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":211,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"通力时代(北京)文化有限公司","res_encryption_flag":"0","song_id":"265046969","title":"寂寞的人伤心的歌","ting_uid":"1376","author":"龙梅子,杨海彪","album_id":"265047175","album_title":"情歌继续唱Ⅱ","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"龙梅子,杨海彪","pic_radio":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg"},{"artist_id":"762","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-12-08","album_no":"15","lrclink":"http://qukufile2.qianqian.com/data2/lrc/3f88a40e5abdf66bf1996fcba9ff3264/289180979/289180979.lrc","copy_type":"1","hot":"34690","all_artist_ting_uid":"1376,1799","resource_type":"0","is_new":"0","rank_change":"0","rank":"5","all_artist_id":"762,3238","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":220,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-寰球 ","res_encryption_flag":"0","song_id":"262288851","title":"群畅赚赚赚","ting_uid":"1376","author":"龙梅子,老猫","album_id":"277577094","album_title":"红颜知己","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"龙梅子,老猫","pic_radio":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000"},{"artist_id":"1842","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-04-27","album_no":"12","lrclink":"http://qukufile2.qianqian.com/data2/lrc/4acdedbeb0ef96211de4abe8fad42dd3/265180694/265180694.lrc","copy_type":"1","hot":"71921","all_artist_ting_uid":"1629,1376","resource_type":"0","is_new":"0","rank_change":"0","rank":"6","all_artist_id":"1842,762","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":213,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"通力时代(北京)文化有限公司","res_encryption_flag":"0","song_id":"265047172","title":"想你啦","ting_uid":"1629","author":"冷漠,龙梅子","album_id":"265047175","album_title":"情歌继续唱Ⅱ","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"冷漠,龙梅子","pic_radio":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/265046939/265046939.jpg"},{"artist_id":"1842","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2014-09-15","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/e3d8bc5574879b958a8f975d8d35d5fb/263644292/263644292.lrc","copy_type":"1","hot":"364589","all_artist_ting_uid":"1629,1883523","resource_type":"0","is_new":"0","rank_change":"0","rank":"7","all_artist_id":"1842,13766171","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":258,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-寰球 ","res_encryption_flag":"0","song_id":"123339030","title":"你是我今生的依靠","ting_uid":"1629","author":"冷漠,杨小曼","album_id":"123339029","album_title":"你是我今生的依靠","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":1,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"冷漠,杨小曼","pic_radio":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/bebd5eb5e0103b09f7edfafd4940d974/123339029/123339029.jpg"},{"artist_id":"84841771","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-04-01","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/c0b78ef3b2597135b8a0af110a72fb03/264786582/264786582.lrc","copy_type":"1","hot":"40358","all_artist_ting_uid":"92458641,245815","resource_type":"0","is_new":"0","rank_change":"0","rank":"8","all_artist_id":"84841771,57297","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":203,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-祁隆","res_encryption_flag":"0","song_id":"264163035","title":"爱着你宠着你","ting_uid":"92458641","author":"彭丽嘉,祁隆","album_id":"264162959","album_title":"爱着你宠着你","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"彭丽嘉,祁隆","pic_radio":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/264162909/264162909.jpg@s_0,w_1000"},{"artist_id":"762","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2016-12-08","album_no":"12","lrclink":"http://qukufile2.qianqian.com/data2/lrc/8cadaa149bad87d2898004717b26029b/289065768/289065768.lrc","copy_type":"1","hot":"11537","all_artist_ting_uid":"1376,232955213","resource_type":"0","is_new":"0","rank_change":"0","rank":"9","all_artist_id":"762,247141961","style":"","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":228,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-寰球","res_encryption_flag":"0","song_id":"247168360","title":"别拿我的感情当游戏","ting_uid":"1376","author":"龙梅子,杜青","album_id":"277577094","album_title":"红颜知己","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"龙梅子,杜青","pic_radio":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000"},{"artist_id":"2021740","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2015-01-14","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/033b05417a350fb1add2cf73032f2997/540639102/540639102.lrc","copy_type":"1","hot":"90132","all_artist_ting_uid":"247684,2737","resource_type":"0","is_new":"0","rank_change":"0","rank":"10","all_artist_id":"2021740,5078","style":"","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":241,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"安徽汉马文化传媒有限公司","res_encryption_flag":"0","song_id":"130259272","title":"亲爱的 你在哪里","ting_uid":"247684","author":"龙飞,门丽","album_id":"130259271","album_title":"亲爱的 你在哪里","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"龙飞,门丽","pic_radio":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_500,h_500","pic_huge":"","album_500_500":"http://qukufile2.qianqian.com/data2/pic/05887d71d4301b51760d130ff830a95f/130259271/130259271.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":""},{"artist_id":"57297","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2015-05-07","album_no":"21","lrclink":"http://qukufile2.qianqian.com/data2/lrc/a3c26f5e55f098dc565ebe262a5bfbdf/568261403/568261403.lrc","copy_type":"1","hot":"59062","all_artist_ting_uid":"245815,10820554","resource_type":"0","is_new":"0","rank_change":"0","rank":"11","all_artist_id":"57297,14958092","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":196,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-祁隆","res_encryption_flag":"0","song_id":"241666238","title":"爱你一生","ting_uid":"245815","author":"祁隆,乐凡","album_id":"241648759","album_title":"隆行天下","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"祁隆,乐凡","pic_radio":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/241647917/241647917.jpg"},{"artist_id":"2","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2016-04-15","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/5752aafbcc11dacfdf314089396165a8/264731394/264731394.lrc","copy_type":"1","hot":"15088","all_artist_ting_uid":"1026,5691","resource_type":"0","is_new":"0","rank_change":"0","rank":"12","all_artist_id":"2,144","style":"影视原声","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":295,"has_mv_mobile":0,"versions":"影视原声","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"电视剧《那年青春我们正好》片尾曲","has_filmtv":"0","si_proxycompany":"北京少城时代文化传播公司","res_encryption_flag":"0","song_id":"264731393","title":"只是没有如果","ting_uid":"1026","author":"张靓颖,王铮亮","album_id":"264731395","album_title":"只是没有如果","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"张靓颖,王铮亮","pic_radio":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg","album_500_500":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/676183f92b474b87f680b5ee7a9fa4b4/264731395/264731395.jpg"},{"artist_id":"3699","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_90","country":"内地","area":"0","publishtime":"2014-09-30","album_no":"1","lrclink":"http://qukufile2.qianqian.com/data2/lrc/123538518/123538518.lrc","copy_type":"1","hot":"73532","all_artist_ting_uid":"617453,708909","resource_type":"0","is_new":"0","rank_change":"0","rank":"13","all_artist_id":"3699,50469","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"24,64,128,192,256,320,flac","file_duration":251,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"安徽汉马文化传媒有限公司","res_encryption_flag":"0","song_id":"123539943","title":"梦醉荷塘","ting_uid":"617453","author":"高安,云菲菲","album_id":"123539942","album_title":"梦醉荷塘","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":1,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"高安,云菲菲","pic_radio":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_500","pic_huge":"","album_500_500":"http://qukufile2.qianqian.com/data2/pic/123538481/123538481.jpg@s_0,w_500","album_800_800":"","album_1000_1000":""},{"artist_id":"113","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2015-07-17","album_no":"3","lrclink":"http://qukufile2.qianqian.com/data2/lrc/246327677/246327677.lrc","copy_type":"1","hot":"15988","all_artist_ting_uid":"200428,57838561","resource_type":"0","is_new":"0","rank_change":"0","rank":"14","all_artist_id":"113,43848326","style":"","del_status":"0","relate_status":"0","toneid":"0","all_rate":"64,128,256,320,flac","file_duration":223,"has_mv_mobile":0,"versions":"影视原声","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"电视剧《花千骨》片尾曲","has_filmtv":"0","si_proxycompany":"华宇世博音乐文化(北京)有限公司-普通代理 ","res_encryption_flag":"0","song_id":"242375802","title":"不可说","ting_uid":"200428","author":"霍建华,赵丽颖","album_id":"242375820","album_title":"花千骨 电视原声带","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":1,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"霍建华,赵丽颖","pic_radio":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_1000,h_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/e7e21cf66583ac2392c82852c5dee7e1/556073432/556073432.jpg@s_1,w_1000,h_1000"},{"artist_id":"57297","language":"国语","pic_big":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_150,h_150","pic_small":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_90,h_90","country":"内地","area":"0","publishtime":"2014-08-14","album_no":"2","lrclink":"http://qukufile2.qianqian.com/data2/lrc/246646529/246646529.lrc","copy_type":"1","hot":"41597","all_artist_ting_uid":"245815,152922482","resource_type":"0","is_new":"0","rank_change":"1","rank":"15","all_artist_id":"57297,121002201","style":"流行","del_status":"0","relate_status":"0","toneid":"0","all_rate":"24,31,64,128,192,256,320,flac","file_duration":363,"has_mv_mobile":0,"versions":"","bitrate_fee":"{\"0\":\"0|0\",\"1\":\"0|0\"}","biaoshi":"lossless","info":"","has_filmtv":"0","si_proxycompany":"北京隆娱文化传媒有限公司","res_encryption_flag":"0","song_id":"122236128","title":"啦啦爱 (DJ版)","ting_uid":"245815","author":"祁隆,孟小笛","album_id":"122236126","album_title":"啦啦爱","is_first_publish":0,"havehigh":2,"charge":0,"has_mv":0,"learn":0,"song_source":"web","piao_id":"0","korean_bb_song":"0","resource_type_ext":"0","mv_provider":"0000000000","artist_name":"祁隆,孟小笛","pic_radio":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_300,h_300","pic_s500":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_500,h_500","pic_premium":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_500,h_500","pic_huge":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_1000,h_1000","album_500_500":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_500,h_500","album_800_800":"","album_1000_1000":"http://qukufile2.qianqian.com/data2/pic/122233615/122233615.jpg@s_1,w_1000,h_1000"}] * billboard : {"billboard_type":"23","billboard_no":"1873","update_date":"2017-12-27","billboard_songnum":"104","havemore":1,"name":"情歌对唱榜","comment":"实时展现百度音乐最热门对唱歌曲排行","pic_s192":"http://d.hiphotos.baidu.com/ting/pic/item/37d12f2eb9389b5083b760348635e5dde7116e08.jpg","pic_s640":"http://b.hiphotos.baidu.com/ting/pic/item/5bafa40f4bfbfbed8289cb8a7af0f736aec31f76.jpg","pic_s444":"http://c.hiphotos.baidu.com/ting/pic/item/f7246b600c33874400bd477a530fd9f9d72aa0b8.jpg","pic_s260":"http://a.hiphotos.baidu.com/ting/pic/item/4610b912c8fcc3cea8b9a1359045d688d43f20be.jpg","pic_s210":"http://business.cdn.qianqian.com/qianqian/pic/bos_client_df3de3c8b3074ca0b9d6ca6a702f3226.jpg","web_url":"http://music.baidu.com/top/lovesong"} * error_code : 22000 */ private BillboardBean billboard; private int error_code; private Listsong_list; public BillboardBean getBillboard() { return billboard; } public void setBillboard(BillboardBean billboard) { this.billboard = billboard; } public int getError_code() { return error_code; } public void setError_code(int error_code) { this.error_code = error_code; } public List getSong_list() { return song_list; } public void setSong_list(List song_list) { this.song_list = song_list; } public static class BillboardBean { /** * billboard_type : 23 * billboard_no : 1873 * update_date : 2017-12-27 * billboard_songnum : 104 * havemore : 1 * name : 情歌对唱榜 * comment : 实时展现百度音乐最热门对唱歌曲排行 * pic_s192 : http://d.hiphotos.baidu.com/ting/pic/item/37d12f2eb9389b5083b760348635e5dde7116e08.jpg * pic_s640 : http://b.hiphotos.baidu.com/ting/pic/item/5bafa40f4bfbfbed8289cb8a7af0f736aec31f76.jpg * pic_s444 : http://c.hiphotos.baidu.com/ting/pic/item/f7246b600c33874400bd477a530fd9f9d72aa0b8.jpg * pic_s260 : http://a.hiphotos.baidu.com/ting/pic/item/4610b912c8fcc3cea8b9a1359045d688d43f20be.jpg * pic_s210 : http://business.cdn.qianqian.com/qianqian/pic/bos_client_df3de3c8b3074ca0b9d6ca6a702f3226.jpg * web_url : http://music.baidu.com/top/lovesong */ private String billboard_type; private String billboard_no; private String update_date; private String billboard_songnum; private int havemore; private String name; private String comment; private String pic_s192; private String pic_s640; private String pic_s444; private String pic_s260; private String pic_s210; private String web_url; public String getBillboard_type() { return billboard_type; } public void setBillboard_type(String billboard_type) { this.billboard_type = billboard_type; } public String getBillboard_no() { return billboard_no; } public void setBillboard_no(String billboard_no) { this.billboard_no = billboard_no; } public String getUpdate_date() { return update_date; } public void setUpdate_date(String update_date) { this.update_date = update_date; } public String getBillboard_songnum() { return billboard_songnum; } public void setBillboard_songnum(String billboard_songnum) { this.billboard_songnum = billboard_songnum; } public int getHavemore() { return havemore; } public void setHavemore(int havemore) { this.havemore = havemore; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public String getPic_s192() { return pic_s192; } public void setPic_s192(String pic_s192) { this.pic_s192 = pic_s192; } public String getPic_s640() { return pic_s640; } public void setPic_s640(String pic_s640) { this.pic_s640 = pic_s640; } public String getPic_s444() { return pic_s444; } public void setPic_s444(String pic_s444) { this.pic_s444 = pic_s444; } public String getPic_s260() { return pic_s260; } public void setPic_s260(String pic_s260) { this.pic_s260 = pic_s260; } public String getPic_s210() { return pic_s210; } public void setPic_s210(String pic_s210) { this.pic_s210 = pic_s210; } public String getWeb_url() { return web_url; } public void setWeb_url(String web_url) { this.web_url = web_url; } } public static class SongListBean { /** * artist_id : 762 * language : 国语 * pic_big : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_150 * pic_small : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_90 * country : 内地 * area : 0 * publishtime : 2016-12-08 * album_no : 6 * lrclink : http://qukufile2.qianqian.com/data2/lrc/76d726767c64ac792a5d28b5b2c31c58/289056407/289056407.lrc * copy_type : 1 * hot : 85485 * all_artist_ting_uid : 1376,239558276 * resource_type : 0 * is_new : 0 * rank_change : 0 * rank : 1 * all_artist_id : 762,261800939 * style : 流行 * del_status : 0 * relate_status : 0 * toneid : 0 * all_rate : flac,320,256,128,64 * file_duration : 197 * has_mv_mobile : 0 * versions : * bitrate_fee : {"0":"0|0","1":"0|0"} * biaoshi : lossless * info : * has_filmtv : 0 * si_proxycompany : 华宇世博音乐文化(北京)有限公司-寰球 * res_encryption_flag : 0 * song_id : 261704948 * title : 怒放 * ting_uid : 1376 * author : 龙梅子,葛荟婕 * album_id : 277577094 * album_title : 红颜知己 * is_first_publish : 0 * havehigh : 2 * charge : 0 * has_mv : 0 * learn : 0 * song_source : web * piao_id : 0 * korean_bb_song : 0 * resource_type_ext : 0 * mv_provider : 0000000000 * artist_name : 龙梅子,葛荟婕 * pic_radio : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_300 * pic_s500 : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500 * pic_premium : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500 * pic_huge : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000 * album_500_500 : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_500 * album_800_800 : * album_1000_1000 : http://qukufile2.qianqian.com/data2/pic/ed3ae0650dd659abd665dea49489d112/289041118/289041118.jpg@s_0,w_1000 */ private String artist_id; private String language; private String pic_big; private String pic_small; private String country; private String area; private String publishtime; private String album_no; private String lrclink; private String copy_type; private String hot; private String all_artist_ting_uid; private String resource_type; private String is_new; private String rank_change; private String rank; private String all_artist_id; private String style; private String del_status; private String relate_status; private String toneid; private String all_rate; private int file_duration; private int has_mv_mobile; private String versions; private String bitrate_fee; private String biaoshi; private String info; private String has_filmtv; private String si_proxycompany; private String res_encryption_flag; private String song_id; private String title; private String ting_uid; private String author; private String album_id; private String album_title; private int is_first_publish; private int havehigh; private int charge; private int has_mv; private int learn; private String song_source; private String piao_id; private String korean_bb_song; private String resource_type_ext; private String mv_provider; private String artist_name; private String pic_radio; private String pic_s500; private String pic_premium; private String pic_huge; private String album_500_500; private String album_800_800; private String album_1000_1000; public String getArtist_id() { return artist_id; } public void setArtist_id(String artist_id) { this.artist_id = artist_id; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public String getPic_big() { return pic_big; } public void setPic_big(String pic_big) { this.pic_big = pic_big; } public String getPic_small() { return pic_small; } public void setPic_small(String pic_small) { this.pic_small = pic_small; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getArea() { return area; } public void setArea(String area) { this.area = area; } public String getPublishtime() { return publishtime; } public void setPublishtime(String publishtime) { this.publishtime = publishtime; } public String getAlbum_no() { return album_no; } public void setAlbum_no(String album_no) { this.album_no = album_no; } public String getLrclink() { return lrclink; } public void setLrclink(String lrclink) { this.lrclink = lrclink; } public String getCopy_type() { return copy_type; } public void setCopy_type(String copy_type) { this.copy_type = copy_type; } public String getHot() { return hot; } public void setHot(String hot) { this.hot = hot; } public String getAll_artist_ting_uid() { return all_artist_ting_uid; } public void setAll_artist_ting_uid(String all_artist_ting_uid) { this.all_artist_ting_uid = all_artist_ting_uid; } public String getResource_type() { return resource_type; } public void setResource_type(String resource_type) { this.resource_type = resource_type; } public String getIs_new() { return is_new; } public void setIs_new(String is_new) { this.is_new = is_new; } public String getRank_change() { return rank_change; } public void setRank_change(String rank_change) { this.rank_change = rank_change; } public String getRank() { return rank; } public void setRank(String rank) { this.rank = rank; } public String getAll_artist_id() { return all_artist_id; } public void setAll_artist_id(String all_artist_id) { this.all_artist_id = all_artist_id; } public String getStyle() { return style; } public void setStyle(String style) { this.style = style; } public String getDel_status() { return del_status; } public void setDel_status(String del_status) { this.del_status = del_status; } public String getRelate_status() { return relate_status; } public void setRelate_status(String relate_status) { this.relate_status = relate_status; } public String getToneid() { return toneid; } public void setToneid(String toneid) { this.toneid = toneid; } public String getAll_rate() { return all_rate; } public void setAll_rate(String all_rate) { this.all_rate = all_rate; } public int getFile_duration() { return file_duration; } public void setFile_duration(int file_duration) { this.file_duration = file_duration; } public int getHas_mv_mobile() { return has_mv_mobile; } public void setHas_mv_mobile(int has_mv_mobile) { this.has_mv_mobile = has_mv_mobile; } public String getVersions() { return versions; } public void setVersions(String versions) { this.versions = versions; } public String getBitrate_fee() { return bitrate_fee; } public void setBitrate_fee(String bitrate_fee) { this.bitrate_fee = bitrate_fee; } public String getBiaoshi() { return biaoshi; } public void setBiaoshi(String biaoshi) { this.biaoshi = biaoshi; } public String getInfo() { return info; } public void setInfo(String info) { this.info = info; } public String getHas_filmtv() { return has_filmtv; } public void setHas_filmtv(String has_filmtv) { this.has_filmtv = has_filmtv; } public String getSi_proxycompany() { return si_proxycompany; } public void setSi_proxycompany(String si_proxycompany) { this.si_proxycompany = si_proxycompany; } public String getRes_encryption_flag() { return res_encryption_flag; } public void setRes_encryption_flag(String res_encryption_flag) { this.res_encryption_flag = res_encryption_flag; } public String getSong_id() { return song_id; } public void setSong_id(String song_id) { this.song_id = song_id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getTing_uid() { return ting_uid; } public void setTing_uid(String ting_uid) { this.ting_uid = ting_uid; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getAlbum_id() { return album_id; } public void setAlbum_id(String album_id) { this.album_id = album_id; } public String getAlbum_title() { return album_title; } public void setAlbum_title(String album_title) { this.album_title = album_title; } public int getIs_first_publish() { return is_first_publish; } public void setIs_first_publish(int is_first_publish) { this.is_first_publish = is_first_publish; } public int getHavehigh() { return havehigh; } public void setHavehigh(int havehigh) { this.havehigh = havehigh; } public int getCharge() { return charge; } public void setCharge(int charge) { this.charge = charge; } public int getHas_mv() { return has_mv; } public void setHas_mv(int has_mv) { this.has_mv = has_mv; } public int getLearn() { return learn; } public void setLearn(int learn) { this.learn = learn; } public String getSong_source() { return song_source; } public void setSong_source(String song_source) { this.song_source = song_source; } public String getPiao_id() { return piao_id; } public void setPiao_id(String piao_id) { this.piao_id = piao_id; } public String getKorean_bb_song() { return korean_bb_song; } public void setKorean_bb_song(String korean_bb_song) { this.korean_bb_song = korean_bb_song; } public String getResource_type_ext() { return resource_type_ext; } public void setResource_type_ext(String resource_type_ext) { this.resource_type_ext = resource_type_ext; } public String getMv_provider() { return mv_provider; } public void setMv_provider(String mv_provider) { this.mv_provider = mv_provider; } public String getArtist_name() { return artist_name; } public void setArtist_name(String artist_name) { this.artist_name = artist_name; } public String getPic_radio() { return pic_radio; } public void setPic_radio(String pic_radio) { this.pic_radio = pic_radio; } public String getPic_s500() { return pic_s500; } public void setPic_s500(String pic_s500) { this.pic_s500 = pic_s500; } public String getPic_premium() { return pic_premium; } public void setPic_premium(String pic_premium) { this.pic_premium = pic_premium; } public String getPic_huge() { return pic_huge; } public void setPic_huge(String pic_huge) { this.pic_huge = pic_huge; } public String getAlbum_500_500() { return album_500_500; } public void setAlbum_500_500(String album_500_500) { this.album_500_500 = album_500_500; } public String getAlbum_800_800() { return album_800_800; } public void setAlbum_800_800(String album_800_800) { this.album_800_800 = album_800_800; } public String getAlbum_1000_1000() { return album_1000_1000; } public void setAlbum_1000_1000(String album_1000_1000) { this.album_1000_1000 = album_1000_1000; } } }
以上是bean包的数据package com.example.mvp.model.http; import android.os.Build; import java.io.IOException; import okhttp3.Interceptor; import okhttp3.Request; import okhttp3.Response; public class HttpInterceptor implements Interceptor { private static final String UA = "User-Agent"; @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request() .newBuilder() .addHeader(UA, makeUA()) .build(); return chain.proceed(request); } private String makeUA() { return Build.BRAND + "/" + Build.MODEL + "/" + Build.VERSION.RELEASE; } }以上便是网络拦截器package com.example.mvp.model.http; import android.annotation.SuppressLint; import android.os.Handler; import android.os.Message; import com.example.mvp.model.bean.TestBean; import com.google.gson.Gson; import java.io.IOException; import okhttp3.Call; import okhttp3.Callback; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; /** * Created by caojun on 2017/12/26. */ public class HttpUtils { private static final String BASE_URL = "http://tingapi.ting.baidu.com/v1/restserver/ting"; private static final String METHOD_GET_MUSIC_LIST = "?method=baidu.ting.billboard.billList&format=json"; private static HttpUtilsCallback mHttpUtilsCallback =null; @SuppressLint("HandlerLeak") Handler handler=new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); TestBean obj= (TestBean) msg.obj; mHttpUtilsCallback.callbackOK(obj); } }; public void loadData(HttpUtilsCallback httpUtilsCallback, String type, int size, int offset, final ClasstestBean) { mHttpUtilsCallback = httpUtilsCallback; String url = BASE_URL+METHOD_GET_MUSIC_LIST +"&type="+type+"&size="+size+"&offset="+offset; Request request = new Request.Builder() .url(url) .build(); OkHttpClient okHttpClient = new OkHttpClient.Builder().addInterceptor(new HttpInterceptor()).build(); okHttpClient.newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { mHttpUtilsCallback.callbackErr(e.getMessage()); } @Override public void onResponse(Call call, Response response) throws IOException { String string = response.body().string(); Gson gson = new Gson(); TestBean testBean2 = gson.fromJson(string,testBean); // httpUtilsCallback.callbackOK(testBean); Message message = handler.obtainMessage(); message.obj = testBean2; handler.sendMessage(message); //回调数据 } }); } public interface HttpUtilsCallback { void callbackOK(TestBean testBean); void callbackErr(String errMessage); } } 以上是自己的http类package com.example.mvp.presenter; public class BasePresenter { }package com.example.mvp.presenter; import com.example.mvp.model.bean.TestBean; import com.example.mvp.model.http.HttpUtils; import com.example.mvp.view.IView.IMainView; public class MainPresenter extends BasePresenter implements HttpUtils.HttpUtilsCallback{ private IMainView iBaseView; private boolean needClear = false; private int page; private int pageSize = 15; private HttpUtils httpUtils; public MainPresenter() { httpUtils = new HttpUtils(); } public void loadDataFromServer() { httpUtils.loadData(this,"23",15,0,TestBean.class); } public void attachView(IMainView view) { //IMainView view = MainActivity this.iBaseView = view; } public void dettachView() { iBaseView = null; } @Override public void callbackOK(TestBean testBean) { //做逻辑判断 回调数据 iBaseView.onSuccess(testBean,needClear); needClear = false; } @Override public void callbackErr(String errMessage) { } public void refreshData() { needClear = true; page = 0; httpUtils.loadData(this,"23",pageSize,page*pageSize,TestBean.class); } public void loadMore() { page++; httpUtils.loadData(this,"23",pageSize,page*pageSize,TestBean.class); } }以上是persenter类package com.example.mvp.view.activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; public abstract class BaseActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(setContentViewId()); Log.e("myMessage","BaseActivity onCreate"); initView(); initData(); Log.e("myMessage","BaseActivity onCreate over"); } abstract void initView(); abstract void initData(); abstract int setContentViewId(); }以上是BestActivity类package com.example.mvp.view.activity; import android.os.Bundle; import android.os.Handler; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; import com.example.mvp.R; import com.example.mvp.model.bean.TestBean; import com.example.mvp.presenter.MainPresenter; import com.example.mvp.view.IView.IMainView; import com.example.mvp.view.adapter.SongListAdapter; import com.example.mvp.view.customview.SongItemDeliver; public class MainActivity extends BaseActivity implements IMainView, SwipeRefreshLayout.OnRefreshListener { private MainPresenter mainPresenter; private RecyclerView recyclerView; private SongListAdapter songListAdapter; private SwipeRefreshLayout swipeRefreshLayout; private LinearLayoutManager linearLayoutManager; private boolean isLoading = false; private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } protected void initData() { songListAdapter = new SongListAdapter(this); recyclerView.setAdapter(songListAdapter); mainPresenter = new MainPresenter(); //MainActivity == this mainPresenter.attachView(this); mainPresenter.loadDataFromServer(); } @Override int setContentViewId() { return R.layout.activity_main; } protected void initView() { progressBar = findViewById(R.id.progress); recyclerView = findViewById(R.id.songList); linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); recyclerView.setLayoutManager(linearLayoutManager); recyclerView.addItemDecoration(new SongItemDeliver()); swipeRefreshLayout = findViewById(R.id.swipe); swipeRefreshLayout.setEnabled(true); swipeRefreshLayout.setOnRefreshListener(this); recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); int visibleItemCount = recyclerView.getChildCount(); int totalItemCount = linearLayoutManager.getItemCount(); int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition(); if (visibleItemCount + firstVisibleItemPosition == totalItemCount) { Log.e("myMessage","loadMore"); if (!isLoading) { progressBar.setVisibility(View.VISIBLE); mainPresenter.loadMore(); isLoading = true; } } } }); } @Override public void onSuccess(TestBean testBean,boolean needClear) { Toast.makeText(this,"over",Toast.LENGTH_SHORT).show(); isLoading = false; if(needClear) { swipeRefreshLayout.setRefreshing(false); } else { new Handler().postDelayed(new Runnable() { @Override public void run() { progressBar.setVisibility(View.GONE); } },3000); } songListAdapter.setListData(testBean.getSong_list(),needClear); songListAdapter.notifyDataSetChanged(); } @Override protected void onDestroy() { super.onDestroy(); if (mainPresenter != null) { mainPresenter.dettachView(); } } @Override public void onRefresh() { mainPresenter.refreshData(); Log.e("myMessage","onRefresh"); } @Override public void onPointerCaptureChanged(boolean hasCapture) { } }这便是主界面package com.example.mvp.view.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.example.mvp.R; import com.example.mvp.model.bean.TestBean; import java.util.ArrayList; import java.util.List; public class SongListAdapter extends RecyclerView.Adapter { private Context mContext; public SongListAdapter(Context context) { this.mContext = context; } private ArrayListlistBeans = new ArrayList<>(); public void setListData(List song_list,boolean needClear) { if (song_list!=null) { if (needClear) { listBeans.clear(); } listBeans.addAll(song_list); Log.e("myMessage","size = "+listBeans.size()); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View inflate = LayoutInflater.from(mContext).inflate(R.layout.item_song_list, parent,false); return new SongListHolder(inflate); } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { SongListHolder songListHolder = (SongListHolder) holder; songListHolder.songName.setText(listBeans.get(position).getTitle()); } public class SongListHolder extends RecyclerView.ViewHolder { TextView songName; public SongListHolder(View itemView) { super(itemView); songName = itemView.findViewById(R.id.songName); } } @Override public int getItemCount() { return listBeans.size(); } } 以上是适配器代码package com.example.mvp.view.customview; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; public class SongItemDeliver extends RecyclerView.ItemDecoration { private final Paint paint; public SongItemDeliver() { paint = new Paint(); paint.setColor(Color.RED); paint.setTextSize(50); paint.setStrokeWidth(10); } @Override public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { super.onDraw(c, parent, state); } @Override public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { super.onDrawOver(c, parent, state); drawLine(c, parent); Rect rect = new Rect(0,100,500,600); // c.drawRect(rect,paint); } @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { super.getItemOffsets(outRect, view, parent, state); } private void drawLine(Canvas c, RecyclerView recyclerView) { for (int i = 0; i < recyclerView.getChildCount(); i++) { View childAt = recyclerView.getChildAt(i); if (childAt != null) { int left = childAt.getLeft(); int right = childAt.getRight(); int height = childAt.getBottom(); Log.e("myMessage", "left = " + left + " right " + right + "height = " + height); c.drawLine(left, height, right, height, paint); } } } }这是便是分割线的代码