|
@@ -50,6 +50,7 @@ public class CoursewarePreviewDialog extends Dialog implements View.OnClickListe
|
|
|
setContentView(R.layout.dialog_courseware_preview_layout);
|
|
|
mViewpager = findViewById(R.id.viewpager);
|
|
|
mTvConfirm = findViewById(R.id.tv_confirm);
|
|
|
+ findViewById(R.id.iv_close).setOnClickListener(this);
|
|
|
mTvConfirm.setOnClickListener(this);
|
|
|
mAdapter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_courseware_preview_layout) {
|
|
|
@Override
|
|
@@ -84,12 +85,16 @@ public class CoursewarePreviewDialog extends Dialog implements View.OnClickListe
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
int id = v.getId();
|
|
|
+ if (id == R.id.iv_close) {
|
|
|
+ dismiss();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (id == R.id.tv_confirm) {
|
|
|
if (mViewpager != null && selectData != null) {
|
|
|
int currentItem = mViewpager.getCurrentItem();
|
|
|
if (currentItem < mAdapter.getData().size()) {
|
|
|
String imgUrl = mAdapter.getData().get(currentItem);
|
|
|
- if(TextUtils.isEmpty(imgUrl)){
|
|
|
+ if (TextUtils.isEmpty(imgUrl)) {
|
|
|
ToastUtil.getInstance().showShort("该课件暂无乐谱哦");
|
|
|
return;
|
|
|
}
|