修复添加多个歌曲到队列不提示
This commit is contained in:
parent
e2285ec1c5
commit
51f1b9494e
@ -45,14 +45,15 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
public static final int LIBS_MODEL_PLAY_LIST = 4;
|
public static final int LIBS_MODEL_PLAY_LIST = 4;
|
||||||
public static final int LIBS_MODEL_PLAY_Collection = 5;
|
public static final int LIBS_MODEL_PLAY_Collection = 5;
|
||||||
|
|
||||||
public interface OnClickAction{
|
public interface OnClickAction {
|
||||||
void onClick(Intent intent,View view);
|
void onClick(Intent intent, View view);
|
||||||
}
|
|
||||||
protected OnClickAction clickAction;
|
|
||||||
public void setOnClickAction(OnClickAction onClickAction) {
|
|
||||||
this.clickAction=onClickAction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected OnClickAction clickAction;
|
||||||
|
|
||||||
|
public void setOnClickAction(OnClickAction onClickAction) {
|
||||||
|
this.clickAction = onClickAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<MusicData> list = new ArrayList<>();
|
List<MusicData> list = new ArrayList<>();
|
||||||
@ -141,7 +142,7 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setModel(int model) {
|
public void setModel(int model) {
|
||||||
this.model=model;
|
this.model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ViewHolderCollection extends ViewHolder {
|
public class ViewHolderCollection extends ViewHolder {
|
||||||
@ -298,9 +299,9 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
Intent intent = new Intent(itemView.getContext(), AlbumsActivity.class);
|
Intent intent = new Intent(itemView.getContext(), AlbumsActivity.class);
|
||||||
intent.putExtra("model", 2);
|
intent.putExtra("model", 2);
|
||||||
intent.putExtra("fid", data.getId());
|
intent.putExtra("fid", data.getId());
|
||||||
intent.putExtra("image",data.getImg(AppData.imageWidth, AppData.imageHigh));
|
intent.putExtra("image", data.getImg(AppData.imageWidth, AppData.imageHigh));
|
||||||
if(clickAction!=null){
|
if (clickAction != null) {
|
||||||
clickAction.onClick(intent,icon);
|
clickAction.onClick(intent, icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,10 +311,10 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
Intent intent = new Intent(itemView.getContext(), AlbumsActivity.class);
|
Intent intent = new Intent(itemView.getContext(), AlbumsActivity.class);
|
||||||
intent.putExtra("model", 0);
|
intent.putExtra("model", 0);
|
||||||
intent.putExtra("album", data.getAlbum());
|
intent.putExtra("album", data.getAlbum());
|
||||||
intent.putExtra("image",data.getImg(AppData.imageWidth, AppData.imageHigh));
|
intent.putExtra("image", data.getImg(AppData.imageWidth, AppData.imageHigh));
|
||||||
intent.putExtra("color",AppTools.getImageColor(data.getImg(AppData.minImageWidth,AppData.minImageHigh)));
|
intent.putExtra("color", AppTools.getImageColor(data.getImg(AppData.minImageWidth, AppData.minImageHigh)));
|
||||||
if(clickAction!=null){
|
if (clickAction != null) {
|
||||||
clickAction.onClick(intent,icon);
|
clickAction.onClick(intent, icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,8 +367,8 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
icon.setOnClickListener(new View.OnClickListener() {
|
icon.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (data.getImg(AppData.minImageWidth,AppData.minImageHigh) != null) {
|
if (data.getImg(AppData.minImageWidth, AppData.minImageHigh) != null) {
|
||||||
Glide.with(MyApplication.application).load(data.getImg(AppData.minImageWidth,AppData.minImageHigh))
|
Glide.with(MyApplication.application).load(data.getImg(AppData.minImageWidth, AppData.minImageHigh))
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(25, 3)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(25, 3)))
|
||||||
.into(icon);
|
.into(icon);
|
||||||
icon.setTag("img");
|
icon.setTag("img");
|
||||||
@ -411,11 +412,10 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
.setTitle("添加文件夹到队列")
|
.setTitle("添加文件夹到队列")
|
||||||
.setMessage("将文件夹中所有歌曲添加到队列?")
|
.setMessage("将文件夹中所有歌曲添加到队列?")
|
||||||
.setPositiveButton("添加", new DialogInterface.OnClickListener() {
|
.setPositiveButton("添加", new DialogInterface.OnClickListener() {
|
||||||
KProgressHUD hud;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
hud = AppTools.showLoading(itemView.getContext());
|
AppTools.showHud(itemView.getContext());
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("path", data.getFile());
|
json.put("path", data.getFile());
|
||||||
json.put("type", true);
|
json.put("type", true);
|
||||||
@ -425,14 +425,15 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
List<MusicData> list = (List<MusicData>) data;
|
List<MusicData> list = (List<MusicData>) data;
|
||||||
for (MusicData musicData : list) {
|
for (MusicData musicData : list) {
|
||||||
MusicContainer.getInstance().addTmpList(musicData);
|
MusicContainer.getInstance().addTmpList(musicData);
|
||||||
hud.dismiss();
|
|
||||||
}
|
}
|
||||||
|
AppTools.hideHud();
|
||||||
|
AppTools.toast(list.size()+"首歌已添加到队列中");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void httpError(Exception e) {
|
public void httpError(Exception e) {
|
||||||
|
AppTools.toast("添加失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -448,7 +449,7 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
|
|||||||
|
|
||||||
|
|
||||||
protected void showImage(MusicData musicData, ViewHolder holder) {
|
protected void showImage(MusicData musicData, ViewHolder holder) {
|
||||||
musicData.getImg(AppData.minImageWidth,AppData.minImageHigh, new NetworkInterface() {
|
musicData.getImg(AppData.minImageWidth, AppData.minImageHigh, new NetworkInterface() {
|
||||||
@Override
|
@Override
|
||||||
public void httpGetData(Object data, int state) {
|
public void httpGetData(Object data, int state) {
|
||||||
Glide.with(MyApplication.application).load((Bitmap) data)
|
Glide.with(MyApplication.application).load((Bitmap) data)
|
||||||
|
Loading…
Reference in New Issue
Block a user