|
@@ -16,6 +16,7 @@ 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;
|
|
import com.rong.io.live.bean.User;
|
|
import com.rong.io.live.bean.User;
|
|
|
|
+import com.rong.io.live.config.LiveConfig;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -29,7 +30,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|
* Author by pq, Date on 2022/6/13.
|
|
* Author by pq, Date on 2022/6/13.
|
|
* 直播间申请连麦列表页面
|
|
* 直播间申请连麦列表页面
|
|
*/
|
|
*/
|
|
-public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayoutBinding> {
|
|
|
|
|
|
+public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayoutBinding> implements View.OnClickListener {
|
|
RecyclerView recyclerView;
|
|
RecyclerView recyclerView;
|
|
|
|
|
|
private LiveMicManagerDialog.OnEventListener mEventListener;
|
|
private LiveMicManagerDialog.OnEventListener mEventListener;
|
|
@@ -52,7 +53,9 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
protected void initData() {
|
|
protected void initData() {
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|
|
- mAdapter = new Adapter(R.layout.item_live_mic_manager_layout,mList);
|
|
|
|
|
|
+ mViewBinding.tvEnableMic.setOnClickListener(this);
|
|
|
|
+ mViewBinding.tvRefuseAll.setOnClickListener(this);
|
|
|
|
+ mAdapter = new Adapter(R.layout.item_live_mic_manager_layout, mList);
|
|
recyclerView.setAdapter(mAdapter);
|
|
recyclerView.setAdapter(mAdapter);
|
|
mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
@Override
|
|
@Override
|
|
@@ -67,6 +70,7 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
int id = view.getId();
|
|
int id = view.getId();
|
|
if (id == R.id.tv_refuse_all) {
|
|
if (id == R.id.tv_refuse_all) {
|
|
@@ -79,6 +83,21 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
|
|
|
|
if (id == R.id.tv_enable_mic) {
|
|
if (id == R.id.tv_enable_mic) {
|
|
//禁止连麦
|
|
//禁止连麦
|
|
|
|
+ if (LiveConfig.MODE_LIVE_IS_ENABLE_MIC == 0) {
|
|
|
|
+ //当前允许连麦,触发禁止连麦
|
|
|
|
+ if (mEventListener != null) {
|
|
|
|
+ LiveConfig.MODE_LIVE_IS_ENABLE_MIC = 1;
|
|
|
|
+ mViewBinding.tvEnableMic.setText("开启连麦");
|
|
|
|
+ mEventListener.onSwitchMicMode(true);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //当前禁止连麦,触发允许连麦
|
|
|
|
+ if (mEventListener != null) {
|
|
|
|
+ LiveConfig.MODE_LIVE_IS_ENABLE_MIC = 0;
|
|
|
|
+ mViewBinding.tvEnableMic.setText("禁止连麦");
|
|
|
|
+ mEventListener.onSwitchMicMode(false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -111,7 +130,7 @@ public class LiveApplyMicFragment extends BaseFragment<FragmentLiveApplyMicLayou
|
|
@Override
|
|
@Override
|
|
protected void convert(@NonNull BaseViewHolder helper, User user) {
|
|
protected void convert(@NonNull BaseViewHolder helper, User user) {
|
|
//创建人头像
|
|
//创建人头像
|
|
- ImageView iv_avatar =helper.getView(R.id.iv_avatar);
|
|
|
|
|
|
+ ImageView iv_avatar = helper.getView(R.id.iv_avatar);
|
|
Glide.with(getContext()).load(user.getPortraitUrl()).placeholder(R.drawable.icon_teacher_default_head).error(R.drawable.icon_teacher_default_head).into(iv_avatar);
|
|
Glide.with(getContext()).load(user.getPortraitUrl()).placeholder(R.drawable.icon_teacher_default_head).error(R.drawable.icon_teacher_default_head).into(iv_avatar);
|
|
//名称
|
|
//名称
|
|
helper.setText(R.id.tv_name, user.getUserName());
|
|
helper.setText(R.id.tv_name, user.getUserName());
|