fix [打招呼的弹窗出现时,只会闪一下就自动消失]

This commit is contained in:
zlzw 2024-03-27 16:09:33 +08:00
parent e256b61238
commit 2c41e9418d
5 changed files with 27 additions and 7 deletions

View File

@ -63,6 +63,8 @@ import com.yunbao.live.utils.LiveImDeletUtil;
import com.yunbao.live.views.PortraitLiveManager; import com.yunbao.live.views.PortraitLiveManager;
import com.yunbao.live.views.RecommendLiveRoomProvider; import com.yunbao.live.views.RecommendLiveRoomProvider;
import com.yunbao.main.activity.CompleteUserInfoActivity; import com.yunbao.main.activity.CompleteUserInfoActivity;
import com.yunbao.main.activity.EntryActivity;
import com.yunbao.main.activity.LoginActivity;
import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.MainHomeCommunityActivity; import com.yunbao.main.activity.MainHomeCommunityActivity;
import com.yunbao.main.activity.MsgSettActivity; import com.yunbao.main.activity.MsgSettActivity;
@ -131,6 +133,14 @@ public class AppContext extends CommonAppContext {
MessageSayHiNotifyManager.getInstance().stop(); MessageSayHiNotifyManager.getInstance().stop();
return; return;
} }
if (activity instanceof LoginActivity) {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
if (activity instanceof EntryActivity) {
MessageSayHiNotifyManager.getInstance().stop();
return;
}
MessageSayHiNotifyManager.getInstance().reload(); MessageSayHiNotifyManager.getInstance().reload();
} }

View File

@ -43,4 +43,14 @@ public class MessageSayHiBean extends BaseModel{
public void setStatus(int status) { public void setStatus(int status) {
this.status = status; this.status = status;
} }
@Override
public String toString() {
return "MessageSayHiBean{" +
"user=" + user +
", model='" + model + '\'' +
", nextTime=" + nextTime +
", status=" + status +
'}';
}
} }

View File

@ -14,7 +14,7 @@ public class MessageUserInfoBean extends BaseModel{
@SerializedName("msg") @SerializedName("msg")
String sayHiMsg; String sayHiMsg;
int id; int id=-1;
int status; //0 需要跳转到 编辑资料页面 int status; //0 需要跳转到 编辑资料页面
String extras; String extras;

View File

@ -60,8 +60,7 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
@Override @Override
public void buildDialog(XPopup.Builder builder) { public void buildDialog(XPopup.Builder builder) {
builder.isClickThrough(true);
builder.isTouchThrough(true);
} }
@Override @Override

View File

@ -47,7 +47,7 @@ public class MessageSayHiNotifyManager {
.getMessageSayHiStartTimer(new HttpCallback<MessageSayHiStartBean>() { .getMessageSayHiStartTimer(new HttpCallback<MessageSayHiStartBean>() {
@Override @Override
public void onSuccess(MessageSayHiStartBean data) { public void onSuccess(MessageSayHiStartBean data) {
if(data.getStatus()==0){ if (data.getStatus() == 0) {
Log.i(TAG, "onSuccess: 初始化定时器,定时器关:" + data.toString()); Log.i(TAG, "onSuccess: 初始化定时器,定时器关:" + data.toString());
return; return;
} }
@ -77,10 +77,10 @@ public class MessageSayHiNotifyManager {
@Override @Override
public void onSuccess(MessageSayHiBean data) { public void onSuccess(MessageSayHiBean data) {
if (data.getStatus() == -1) { if (data.getStatus() == -1) {
Log.i(TAG, "onSuccess: 定时器为关,不再轮训"); Log.i(TAG, "onSuccess: 定时器为关,不再轮训 " + data);
return; return;
} }
if(data.getStatus()==0){ if (data.getStatus() == 0) {
timer = new Timer(); timer = new Timer();
timer.schedule(createTask(), data.getNextTime() * 1000L); timer.schedule(createTask(), data.getNextTime() * 1000L);
return; return;
@ -91,6 +91,7 @@ public class MessageSayHiNotifyManager {
@Override @Override
public void onError(String error) { public void onError(String error) {
Log.e(TAG, "onError: "+error );
} }
@ -112,7 +113,7 @@ public class MessageSayHiNotifyManager {
return; return;
} }
isShowDialog = true; isShowDialog = true;
Log.i(TAG, "showDialog: 打开本轮打招呼弹框"); Log.i(TAG, "showDialog: 打开本轮打招呼弹框 " + bean);
lastActivity = AppManager.getInstance().getLastActivity().getClass().getSimpleName(); lastActivity = AppManager.getInstance().getLastActivity().getClass().getSimpleName();
new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean.getUser()).setOnDismissListener((userId, position) -> new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean.getUser()).setOnDismissListener((userId, position) ->
{ {