|
@@ -29,7 +29,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|
* Author by pq, Date on 2022/6/13.
|
|
* Author by pq, Date on 2022/6/13.
|
|
* 直播间连麦中列表页面
|
|
* 直播间连麦中列表页面
|
|
*/
|
|
*/
|
|
-public class LiveOnMicFragment extends BaseFragment<FragmentLiveOnMicLayoutBinding> {
|
|
|
|
|
|
+public class LiveOnMicFragment extends BaseFragment<FragmentLiveOnMicLayoutBinding> implements View.OnClickListener {
|
|
RecyclerView recyclerView;
|
|
RecyclerView recyclerView;
|
|
private LiveMicManagerDialog.OnEventListener mEventListener;
|
|
private LiveMicManagerDialog.OnEventListener mEventListener;
|
|
private ArrayList<User> mList = new ArrayList<>();
|
|
private ArrayList<User> mList = new ArrayList<>();
|
|
@@ -50,14 +50,15 @@ public class LiveOnMicFragment extends BaseFragment<FragmentLiveOnMicLayoutBindi
|
|
protected void initData() {
|
|
protected void initData() {
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|
|
recyclerView.setLayoutManager(linearLayoutManager);
|
|
|
|
+ mViewBinding.tvDownAllMic.setOnClickListener(this);
|
|
mAdapter = new Adapter(R.layout.item_live_mic_manager_layout, mList);
|
|
mAdapter = new Adapter(R.layout.item_live_mic_manager_layout, mList);
|
|
mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
mAdapter.setOnItemChildClickListener(new OnItemChildClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
public void onItemChildClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
|
|
int id = view.getId();
|
|
int id = view.getId();
|
|
- if(id == R.id.tv_handle){
|
|
|
|
|
|
+ if (id == R.id.tv_handle) {
|
|
//下麦操作
|
|
//下麦操作
|
|
- if(mAdapter!=null && position<mAdapter.getData().size()){
|
|
|
|
|
|
+ if (mAdapter != null && position < mAdapter.getData().size()) {
|
|
User user = mAdapter.getData().get(position);
|
|
User user = mAdapter.getData().get(position);
|
|
if (mEventListener != null) {
|
|
if (mEventListener != null) {
|
|
mEventListener.onUnderMic(user);
|
|
mEventListener.onUnderMic(user);
|
|
@@ -73,6 +74,9 @@ public class LiveOnMicFragment extends BaseFragment<FragmentLiveOnMicLayoutBindi
|
|
int id = view.getId();
|
|
int id = view.getId();
|
|
if (id == R.id.tv_down_all_mic) {
|
|
if (id == R.id.tv_down_all_mic) {
|
|
//全部下麦
|
|
//全部下麦
|
|
|
|
+ if (mEventListener != null) {
|
|
|
|
+ mEventListener.onUnderAllMic();
|
|
|
|
+ }
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|