From 2c41e9418d2ca75e913dd16041d717232381fdfe Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 27 Mar 2024 16:09:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20[=E6=89=93=E6=8B=9B=E5=91=BC=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=87=BA=E7=8E=B0=E6=97=B6=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BC=9A=E9=97=AA=E4=B8=80=E4=B8=8B=E5=B0=B1=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=B6=88=E5=A4=B1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/shayu/phonelive/AppContext.java | 10 ++++++++++ .../java/com/yunbao/common/bean/MessageSayHiBean.java | 10 ++++++++++ .../com/yunbao/common/bean/MessageUserInfoBean.java | 2 +- .../yunbao/common/dialog/MessageSayHiNotifyDialog.java | 3 +-- .../yunbao/common/utils/MessageSayHiNotifyManager.java | 9 +++++---- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index c1f1fe212..604211141 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -63,6 +63,8 @@ import com.yunbao.live.utils.LiveImDeletUtil; import com.yunbao.live.views.PortraitLiveManager; import com.yunbao.live.views.RecommendLiveRoomProvider; 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.MainHomeCommunityActivity; import com.yunbao.main.activity.MsgSettActivity; @@ -131,6 +133,14 @@ public class AppContext extends CommonAppContext { MessageSayHiNotifyManager.getInstance().stop(); return; } + if (activity instanceof LoginActivity) { + MessageSayHiNotifyManager.getInstance().stop(); + return; + } + if (activity instanceof EntryActivity) { + MessageSayHiNotifyManager.getInstance().stop(); + return; + } MessageSayHiNotifyManager.getInstance().reload(); } diff --git a/common/src/main/java/com/yunbao/common/bean/MessageSayHiBean.java b/common/src/main/java/com/yunbao/common/bean/MessageSayHiBean.java index 73a6360d7..4baea89cd 100644 --- a/common/src/main/java/com/yunbao/common/bean/MessageSayHiBean.java +++ b/common/src/main/java/com/yunbao/common/bean/MessageSayHiBean.java @@ -43,4 +43,14 @@ public class MessageSayHiBean extends BaseModel{ public void setStatus(int status) { this.status = status; } + + @Override + public String toString() { + return "MessageSayHiBean{" + + "user=" + user + + ", model='" + model + '\'' + + ", nextTime=" + nextTime + + ", status=" + status + + '}'; + } } diff --git a/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java b/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java index 5bc50c48d..1aaa44d9f 100644 --- a/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java +++ b/common/src/main/java/com/yunbao/common/bean/MessageUserInfoBean.java @@ -14,7 +14,7 @@ public class MessageUserInfoBean extends BaseModel{ @SerializedName("msg") String sayHiMsg; - int id; + int id=-1; int status; //0 需要跳转到 编辑资料页面 String extras; diff --git a/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java b/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java index d5f8adf05..dd88f561d 100644 --- a/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java +++ b/common/src/main/java/com/yunbao/common/dialog/MessageSayHiNotifyDialog.java @@ -60,8 +60,7 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow { @Override public void buildDialog(XPopup.Builder builder) { - builder.isClickThrough(true); - builder.isTouchThrough(true); + } @Override diff --git a/common/src/main/java/com/yunbao/common/utils/MessageSayHiNotifyManager.java b/common/src/main/java/com/yunbao/common/utils/MessageSayHiNotifyManager.java index 8dd826091..484ad1480 100644 --- a/common/src/main/java/com/yunbao/common/utils/MessageSayHiNotifyManager.java +++ b/common/src/main/java/com/yunbao/common/utils/MessageSayHiNotifyManager.java @@ -47,7 +47,7 @@ public class MessageSayHiNotifyManager { .getMessageSayHiStartTimer(new HttpCallback() { @Override public void onSuccess(MessageSayHiStartBean data) { - if(data.getStatus()==0){ + if (data.getStatus() == 0) { Log.i(TAG, "onSuccess: 初始化定时器,定时器关:" + data.toString()); return; } @@ -77,10 +77,10 @@ public class MessageSayHiNotifyManager { @Override public void onSuccess(MessageSayHiBean data) { if (data.getStatus() == -1) { - Log.i(TAG, "onSuccess: 定时器为关,不再轮训"); + Log.i(TAG, "onSuccess: 定时器为关,不再轮训 " + data); return; } - if(data.getStatus()==0){ + if (data.getStatus() == 0) { timer = new Timer(); timer.schedule(createTask(), data.getNextTime() * 1000L); return; @@ -91,6 +91,7 @@ public class MessageSayHiNotifyManager { @Override public void onError(String error) { + Log.e(TAG, "onError: "+error ); } @@ -112,7 +113,7 @@ public class MessageSayHiNotifyManager { return; } isShowDialog = true; - Log.i(TAG, "showDialog: 打开本轮打招呼弹框"); + Log.i(TAG, "showDialog: 打开本轮打招呼弹框 " + bean); lastActivity = AppManager.getInstance().getLastActivity().getClass().getSimpleName(); new MessageSayHiNotifyDialog(AppManager.getInstance().getLastActivity(), bean.getUser()).setOnDismissListener((userId, position) -> {