调整关注逻辑

This commit is contained in:
zlzw 2023-08-17 17:17:06 +08:00
parent 68140c8a3a
commit c594364574
3 changed files with 24 additions and 3 deletions

View File

@ -587,4 +587,9 @@ public class JavascriptInterfaceUtils {
}
});
}
@JavascriptInterface
public void androidCancelAnchorAttention(){
Bus.get().post(new JavascriptInterfaceEvent()
.setMethod("androidCancelAnchorAttention"));
}
}

View File

@ -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();
}

View File

@ -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;
@ -588,6 +592,12 @@ public class MyWebViewActivity extends AbsActivity {
.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();
}
}
}
}