diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index 5d4e9ea17..2b3ef2ea1 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -587,4 +587,9 @@ public class JavascriptInterfaceUtils { } }); } + @JavascriptInterface + public void androidCancelAnchorAttention(){ + Bus.get().post(new JavascriptInterfaceEvent() + .setMethod("androidCancelAnchorAttention")); + } } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 9569d4951..49ec75468 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -752,6 +752,12 @@ public class LiveAudienceActivity extends LiveActivity { if (manager != null) { manager.onResume(); } + if (manager != null && !StringUtil.isEmpty(is_fans)) { + if (is_fans.equals("-2")) { + manager.setAttention(0); + is_fans = "2"; + } + } GiftCacheUtil.getInstance().restart(); } diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java index ca66ccb2f..7e32216aa 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java @@ -42,6 +42,7 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.ActivityResultCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.ImageResultCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; @@ -50,8 +51,11 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.ProcessImageUtil; import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; +import com.yunbao.live.activity.LiveAudienceActivity; +import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; @@ -261,7 +265,7 @@ public class MyWebViewActivity extends AbsActivity { } if (!"".endsWith(Constants.mStream)) { finish(); - if(MicStatusManager.getInstance().isMic(liveUid)){ + if (MicStatusManager.getInstance().isMic(liveUid)) { MicStatusManager.getInstance().showDownMicDialog(mContext); return; } @@ -355,7 +359,7 @@ public class MyWebViewActivity extends AbsActivity { intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); } intent.setType("image/*"); - startActivityForResult(Intent.createChooser(intent,mContext.getString(R.string.choose_flie)), CHOOSE); + startActivityForResult(Intent.createChooser(intent, mContext.getString(R.string.choose_flie)), CHOOSE); } @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @@ -585,9 +589,15 @@ public class MyWebViewActivity extends AbsActivity { } else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) { JSONObject json = JSONObject.parseObject(event.getData()); new SharePopDialog(mContext) - .setShareLink(CommonAppConfig.HOST+json.getString("link")) + .setShareLink(CommonAppConfig.HOST + json.getString("link")) .setAnchorAvatar(json.getString("avatar")) .showDialog(); + } else if (TextUtils.equals(event.getMethod(), "androidCancelAnchorAttention")) { + if (!StringUtil.isEmpty(LiveAudienceActivity.is_fans)) { + LiveAudienceActivity.is_fans = "-2"; + LiveRoomViewHolder.setFansNum( LiveAudienceActivity.fansNum - 1); + IMLoginManager.get(mContext).upDataUserInfo(); + } } } }