交友房
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.xscm.moduleutil.widget;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.View;
|
||||
@@ -9,17 +8,15 @@ import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
@@ -466,40 +463,6 @@ public class WheatLayoutSingManager {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量刷新多个麦位状态
|
||||
*/
|
||||
public void refreshWheatData(List<RoomPitBean> newPitList, List<Integer> changedPits) {
|
||||
// 检查容器状态
|
||||
if (container == null || !isContainerValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.pitList = newPitList;
|
||||
// 注意:原代码中此方法体为空,如果需要实现请取消注释下面的代码
|
||||
// for (int pitNumber : changedPits) {
|
||||
// updateSingleWheat(pitNumber);
|
||||
// }
|
||||
}
|
||||
|
||||
public void updateSingleOnlineWheat(UserOnlineStatusBean bean) {
|
||||
// 检查容器状态
|
||||
if (container == null || !isContainerValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pitList == null || pitList.isEmpty()) return;
|
||||
|
||||
for (RoomPitBean pitBean : pitList) {
|
||||
int pitNumber = Integer.parseInt(pitBean.getPit_number());
|
||||
RoomSingSongWheatView wheatView = findWheatViewByPitNumber(pitNumber);
|
||||
if (wheatView != null) {
|
||||
wheatView.setOnlineStatus(); // 刷新数据
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加容器状态检查方法
|
||||
private boolean isContainerValid() {
|
||||
try {
|
||||
@@ -513,30 +476,13 @@ public class WheatLayoutSingManager {
|
||||
// 添加资源清理方法
|
||||
public void release() {
|
||||
try {
|
||||
|
||||
if (multiWheatViews!=null){
|
||||
for (RoomSingSongWheatView wheatView : multiWheatViews) {
|
||||
wheatView.releaseResources();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (container != null) {
|
||||
// 清理所有子视图的资源
|
||||
// for (int i = 0; i < container.getChildCount(); i++) {
|
||||
// View child = container.getChildAt(i);
|
||||
// if (child instanceof LinearLayout) {
|
||||
// LinearLayout linearLayout = (LinearLayout) child;
|
||||
// for (int j = 0; j < linearLayout.getChildCount(); j++) {
|
||||
// View view = linearLayout.getChildAt(j);
|
||||
// if (view instanceof RoomSingSongWheatView) {
|
||||
// ((RoomSingSongWheatView) view).releaseResources();
|
||||
// }
|
||||
// }
|
||||
// } else if (child instanceof RoomSingSongWheatView) {
|
||||
// ((RoomSingSongWheatView) child).releaseResources();
|
||||
// }
|
||||
// }
|
||||
container.removeAllViews();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user