public class CacheManager {
private static volatile CacheManager instance;
private OnMainActivityListener mainActivityListener;
public List<BaseInfoBean> inInterDataList = new ArrayList<>();
public List<BaseInfoBean> baseInfoBeansLists = new ArrayList<>();
private int chatScreenHeight;//chatActivity的可视布局高度,用于软键盘的全屏与缩放功能计算
public boolean smsStatus;
public static CacheManager getInstance(){
if(instance == null){
synchronized (CacheManager.class) {
if(instance == null){
instance = new CacheManager();
}
}
}
return instance;
}
public OnMainActivityListener getMainActivityListener() {
return mainActivityListener;
}
public void setMainActivityListener(OnMainActivityListener mainActivityListener) {
this.mainActivityListener = mainActivityListener;
}
public void clear(){
this.mainActivityListener = null;
instance = null;
}
public int getChatScreenHeight() {
return chatScreenHeight;
}
public void setChatScreenHeight(int chatScreenHeight) {
this.chatScreenHeight = chatScreenHeight;
}
public void setBaseBeaanListTest(List<BaseInfoBean> baseInfoBeansList) {
this.baseInfoBeansLists = baseInfoBeansList;
for (int i= 0;i< baseInfoBeansList.size();i++) {
if (baseInfoBeansList.get(i).getServerFlag() != 0) {
this.inInterDataList.add(baseInfoBeansLists.get(i));
}
}
}
public void setSmsStatus(boolean smsStatus) {
this.smsStatus = smsStatus;
}
private int rtcSecLevelSend=0;//发起请求,由输入框,聊天对象等级更新;
public int getRtcSecLevelReceive() {
int rtcSecLevelReceive=0;
try{
rtcSecLevelReceive = Integer.parseInt(VIMVideoClient.videoState.getMultiExtend().get("securityLevel"));
}catch (Exception e){
VideoLog.d("VideoRequestHandler"," getRtcSecLevelReceive e "+ e.toString());
}
VideoLog.d("VideoRequestHandler"," getRtcSecLevelReceive "+ rtcSecLevelReceive);
return rtcSecLevelReceive;
}
public void setRtcSecLevelReceive(int rtcSecLevelReceive) {
VideoLog.d("VideoRequestHandler"," setRtcSecLevelReceive "+ rtcSecLevelReceive);
VIMVideoClient.videoState.getMultiExtend().put("securityLevel",rtcSecLevelReceive+"");
}
public int getRtcSecLevelSend() {
return rtcSecLevelSend;
}
public void setRtcSecLevelSend(int rtcSecLevelSend) {
this.rtcSecLevelSend = rtcSecLevelSend;
}
}
网友评论