修复添加多个歌曲到队列不提示

This commit is contained in:
Yutousama 2022-05-27 14:23:38 +08:00
parent e2285ec1c5
commit 51f1b9494e

View File

@ -48,13 +48,14 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
public interface OnClickAction {
void onClick(Intent intent, View view);
}
protected OnClickAction clickAction;
public void setOnClickAction(OnClickAction onClickAction) {
this.clickAction = onClickAction;
}
List<MusicData> list = new ArrayList<>();
Context context;
MediaBrowserHelper browserHelper;
@ -411,11 +412,10 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
.setTitle("添加文件夹到队列")
.setMessage("将文件夹中所有歌曲添加到队列?")
.setPositiveButton("添加", new DialogInterface.OnClickListener() {
KProgressHUD hud;
@Override
public void onClick(DialogInterface dialog, int which) {
hud = AppTools.showLoading(itemView.getContext());
AppTools.showHud(itemView.getContext());
JSONObject json = new JSONObject();
json.put("path", data.getFile());
json.put("type", true);
@ -425,14 +425,15 @@ public class MusicLibsAdapter extends RecyclerView.Adapter<MusicLibsAdapter.View
List<MusicData> list = (List<MusicData>) data;
for (MusicData musicData : list) {
MusicContainer.getInstance().addTmpList(musicData);
hud.dismiss();
}
AppTools.hideHud();
AppTools.toast(list.size()+"首歌已添加到队列中");
}
@Override
public void httpError(Exception e) {
AppTools.toast("添加失败:" + e.getMessage());
}
});
}