|
|
|
@ -1,36 +1,114 @@
|
|
|
|
|
package com.example.musicplayer.contract;
|
|
|
|
|
|
|
|
|
|
// 导入所需的包和类
|
|
|
|
|
import com.example.musicplayer.base.presenter.IPresenter;
|
|
|
|
|
import com.example.musicplayer.base.view.BaseView;
|
|
|
|
|
import com.example.musicplayer.entiy.Album;
|
|
|
|
|
import com.example.musicplayer.entiy.SearchSong;
|
|
|
|
|
import com.example.musicplayer.entiy.Song;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by 残渊 on 2018/11/21.
|
|
|
|
|
* 定义了搜索内容模块的契约类,包含视图(View)和 presenter 之间的接口。
|
|
|
|
|
* <p>
|
|
|
|
|
* author : 残渊
|
|
|
|
|
* time : 2018/11/21
|
|
|
|
|
* desc : 规定了搜索内容模块中视图和 presenter 需要实现的方法。
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public interface ISearchContentContract {
|
|
|
|
|
/**
|
|
|
|
|
* 定义了视图(View)需要实现的方法。
|
|
|
|
|
*/
|
|
|
|
|
interface View extends BaseView {
|
|
|
|
|
void setSongsList(ArrayList<SearchSong.DataBean.SongBean.ListBean> songListBeans); //显示歌曲列表
|
|
|
|
|
void searchMoreSuccess(ArrayList<SearchSong.DataBean.SongBean.ListBean> songListBeans); //搜索更多内容成功
|
|
|
|
|
void searchMoreError(); //搜索更多内容失败
|
|
|
|
|
void searchMore();//搜索更多
|
|
|
|
|
void showSearcherMoreNetworkError();//下拉刷新网络错误
|
|
|
|
|
|
|
|
|
|
void searchAlbumSuccess(List<Album.DataBean.AlbumBean.ListBean> albumList); //获取专辑成功
|
|
|
|
|
void searchAlbumMoreSuccess(List<Album.DataBean.AlbumBean.ListBean> songListBeans); //搜索更多内容成功
|
|
|
|
|
void searchAlbumError(); //获取专辑失败
|
|
|
|
|
void getSongUrlSuccess(Song song,String url);//成功获取歌曲url
|
|
|
|
|
/**
|
|
|
|
|
* 显示搜索结果的歌曲列表。
|
|
|
|
|
* @param songListBeans 歌曲列表数据。
|
|
|
|
|
*/
|
|
|
|
|
void setSongsList(ArrayList<SearchSong.DataBean.SongBean.ListBean> songListBeans);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 搜索更多内容成功。
|
|
|
|
|
* @param songListBeans 搜索到的歌曲列表数据。
|
|
|
|
|
*/
|
|
|
|
|
void searchMoreSuccess(ArrayList<SearchSong.DataBean.SongBean.ListBean> songListBeans);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 搜索更多内容失败。
|
|
|
|
|
*/
|
|
|
|
|
void searchMoreError();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 执行搜索更多的操作。
|
|
|
|
|
*/
|
|
|
|
|
void searchMore();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下拉刷新时网络错误。
|
|
|
|
|
*/
|
|
|
|
|
void showSearcherMoreNetworkError();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取专辑成功。
|
|
|
|
|
* @param albumList 专辑列表数据。
|
|
|
|
|
*/
|
|
|
|
|
void searchAlbumSuccess(List<Album.DataBean.AlbumBean.ListBean> albumList);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 搜索更多专辑内容成功。
|
|
|
|
|
* @param songListBeans 搜索到的专辑列表数据。
|
|
|
|
|
*/
|
|
|
|
|
void searchAlbumMoreSuccess(List<Album.DataBean.AlbumBean.ListBean> songListBeans);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取专辑失败。
|
|
|
|
|
*/
|
|
|
|
|
void searchAlbumError();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 成功获取歌曲的播放URL。
|
|
|
|
|
* @param song 歌曲对象。
|
|
|
|
|
* @param url 歌曲播放URL。
|
|
|
|
|
*/
|
|
|
|
|
void getSongUrlSuccess(Song song, String url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 定义了 presenter 需要实现的方法。
|
|
|
|
|
*/
|
|
|
|
|
interface Presenter extends IPresenter<View> {
|
|
|
|
|
void search(String seek,int offset); //搜索
|
|
|
|
|
void searchMore(String seek,int offset); //搜索更多
|
|
|
|
|
void searchAlbum(String seek,int offset); //搜索专辑
|
|
|
|
|
void searchAlbumMore(String seek,int offset);//搜索更多专辑
|
|
|
|
|
void getSongUrl(Song song);//得到歌曲的播放url
|
|
|
|
|
/**
|
|
|
|
|
* 执行搜索操作。
|
|
|
|
|
* @param seek 搜索关键词。
|
|
|
|
|
* @param offset 搜索偏移量。
|
|
|
|
|
*/
|
|
|
|
|
void search(String seek, int offset);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 执行搜索更多的操作。
|
|
|
|
|
* @param seek 搜索关键词。
|
|
|
|
|
* @param offset 搜索偏移量。
|
|
|
|
|
*/
|
|
|
|
|
void searchMore(String seek, int offset);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 执行搜索专辑的操作。
|
|
|
|
|
* @param seek 搜索关键词。
|
|
|
|
|
* @param offset 搜索偏移量。
|
|
|
|
|
*/
|
|
|
|
|
void searchAlbum(String seek, int offset);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 执行搜索更多专辑的操作。
|
|
|
|
|
* @param seek 搜索关键词。
|
|
|
|
|
* @param offset 搜索偏移量。
|
|
|
|
|
*/
|
|
|
|
|
void searchAlbumMore(String seek, int offset);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取歌曲的播放URL。
|
|
|
|
|
* @param song 歌曲对象。
|
|
|
|
|
*/
|
|
|
|
|
void getSongUrl(Song song);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|