调整关注逻辑

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) { if (manager != null) {
manager.onResume(); manager.onResume();
} }
if (manager != null && !StringUtil.isEmpty(is_fans)) {
if (is_fans.equals("-2")) {
manager.setAttention(0);
is_fans = "2";
}
}
GiftCacheUtil.getInstance().restart(); 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.ActivityResultCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; 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.MicStatusManager;
import com.yunbao.common.utils.ProcessImageUtil; import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; 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.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
@ -261,7 +265,7 @@ public class MyWebViewActivity extends AbsActivity {
} }
if (!"".endsWith(Constants.mStream)) { if (!"".endsWith(Constants.mStream)) {
finish(); finish();
if(MicStatusManager.getInstance().isMic(liveUid)){ if (MicStatusManager.getInstance().isMic(liveUid)) {
MicStatusManager.getInstance().showDownMicDialog(mContext); MicStatusManager.getInstance().showDownMicDialog(mContext);
return; return;
} }
@ -355,7 +359,7 @@ public class MyWebViewActivity extends AbsActivity {
intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI); intent.setData(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
} }
intent.setType("image/*"); 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) @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@ -585,9 +589,15 @@ public class MyWebViewActivity extends AbsActivity {
} else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) { } else if (TextUtils.equals(event.getMethod(), "androidCommunityShare")) {
JSONObject json = JSONObject.parseObject(event.getData()); JSONObject json = JSONObject.parseObject(event.getData());
new SharePopDialog(mContext) new SharePopDialog(mContext)
.setShareLink(CommonAppConfig.HOST+json.getString("link")) .setShareLink(CommonAppConfig.HOST + json.getString("link"))
.setAnchorAvatar(json.getString("avatar")) .setAnchorAvatar(json.getString("avatar"))
.showDialog(); .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();
}
} }
} }
} }