|
@@ -12,6 +12,7 @@ import com.chad.library.adapter.base.listener.OnItemChildClickListener;
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
|
import com.cooleshow.base.ui.fragment.BaseFragment;
|
|
import com.cooleshow.base.ui.fragment.BaseFragment;
|
|
import com.cooleshow.base.utils.LogUtils;
|
|
import com.cooleshow.base.utils.LogUtils;
|
|
|
|
+import com.cooleshow.base.widgets.dialog.CommonConfirmDialog;
|
|
import com.cooleshow.teacher.R;
|
|
import com.cooleshow.teacher.R;
|
|
import com.cooleshow.teacher.databinding.FragmentLiveApplyMicLayoutBinding;
|
|
import com.cooleshow.teacher.databinding.FragmentLiveApplyMicLayoutBinding;
|
|
import com.cooleshow.teacher.widgets.dialog.LiveMicManagerDialog;
|
|
import com.cooleshow.teacher.widgets.dialog.LiveMicManagerDialog;
|
|
@@ -37,6 +38,7 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
|
|
|
|
private ArrayList<User> mList = new ArrayList<>();
|
|
private ArrayList<User> mList = new ArrayList<>();
|
|
private Adapter mAdapter;
|
|
private Adapter mAdapter;
|
|
|
|
+ private CommonConfirmDialog mConfirmDialog;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -75,9 +77,17 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
int id = view.getId();
|
|
int id = view.getId();
|
|
if (id == R.id.tv_refuse_all) {
|
|
if (id == R.id.tv_refuse_all) {
|
|
//全部拒绝
|
|
//全部拒绝
|
|
- if (mEventListener != null) {
|
|
|
|
- mEventListener.onRefuseAllMicApply();
|
|
|
|
- }
|
|
|
|
|
|
+ showCommonTipDialog("确认后所有连麦中学员都将下麦", "确认", new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ if (mEventListener != null) {
|
|
|
|
+ if (mConfirmDialog != null) {
|
|
|
|
+ mConfirmDialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ mEventListener.onRefuseAllMicApply();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -85,11 +95,19 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
//禁止连麦
|
|
//禁止连麦
|
|
if (LiveConfig.MODE_LIVE_IS_ENABLE_MIC == 0) {
|
|
if (LiveConfig.MODE_LIVE_IS_ENABLE_MIC == 0) {
|
|
//当前允许连麦,触发禁止连麦
|
|
//当前允许连麦,触发禁止连麦
|
|
- if (mEventListener != null) {
|
|
|
|
- LiveConfig.MODE_LIVE_IS_ENABLE_MIC = 1;
|
|
|
|
- mViewBinding.tvEnableMic.setText("开启连麦");
|
|
|
|
- mEventListener.onSwitchMicMode(true);
|
|
|
|
- }
|
|
|
|
|
|
+ showCommonTipDialog("是否确认禁止学员连麦?", "确认", new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ if (mConfirmDialog != null) {
|
|
|
|
+ mConfirmDialog.dismiss();
|
|
|
|
+ }
|
|
|
|
+ if (mEventListener != null) {
|
|
|
|
+ LiveConfig.MODE_LIVE_IS_ENABLE_MIC = 1;
|
|
|
|
+ mViewBinding.tvEnableMic.setText("开启连麦");
|
|
|
|
+ mEventListener.onSwitchMicMode(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
//当前禁止连麦,触发允许连麦
|
|
//当前禁止连麦,触发允许连麦
|
|
if (mEventListener != null) {
|
|
if (mEventListener != null) {
|
|
@@ -139,4 +157,16 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void showCommonTipDialog(String content, String confirmText, View.OnClickListener listener) {
|
|
|
|
+ if (mConfirmDialog == null) {
|
|
|
|
+ mConfirmDialog = new CommonConfirmDialog(getContext());
|
|
|
|
+ }
|
|
|
|
+ if (!mConfirmDialog.isShowing()) {
|
|
|
|
+ mConfirmDialog.show();
|
|
|
|
+ }
|
|
|
|
+ mConfirmDialog.setContent(content);
|
|
|
|
+ mConfirmDialog.setConfirmText(confirmText);
|
|
|
|
+ mConfirmDialog.setOnConfirmClickListener(listener);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|