修复:

首页或者搜索结果页面进入密码直播间要输两次密码
主播名称缩写错误
This commit is contained in:
18401019693 2022-08-23 14:45:22 +08:00
parent 25e3e86230
commit 80b5127832
5 changed files with 38 additions and 28 deletions

View File

@ -298,6 +298,7 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveUid = mLiveBean.getUid();
mStream = mLiveBean.getStream();
mAncherName = liveBean.getUserNiceName();
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
//加载当前页面数据
View rootView = manager.getRootView();

View File

@ -5,7 +5,6 @@ import android.os.Parcelable;
import android.text.TextUtils;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.gson.annotations.SerializedName;
import com.yunbao.common.bean.WeekListBean;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
@ -203,6 +202,7 @@ public class LiveBean implements Parcelable {
@JSONField(name = "user_nicename")
public String getUserNiceName() {
return userNiceName;
}
@ -328,6 +328,7 @@ public class LiveBean implements Parcelable {
public String getIslive() {
return islive;
}
public void setIslive(String islive) {
this.islive = islive;
}

View File

@ -31,6 +31,8 @@ public class LiveRoomCheckLivePresenter {
private LiveBean mLiveBean;
private ActionListener mActionListener;
private int mLiveSdk;
//搜索页面不提示密码
public static boolean isSearch = false;
public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) {
mContext = context;
@ -46,7 +48,6 @@ public class LiveRoomCheckLivePresenter {
}
private HttpCallback mCheckLiveCallback = new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
@ -101,6 +102,7 @@ public class LiveRoomCheckLivePresenter {
* 前往密码房间
*/
private void forwardPwdRoom() {
if (!isSearch) {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
@ -117,6 +119,11 @@ public class LiveRoomCheckLivePresenter {
}
}
});
}else {
enterLiveRoom();
isSearch = false;
}
}
/**

View File

@ -45,7 +45,6 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil;
@ -84,6 +83,7 @@ import com.yunbao.live.custom.TopGradual;
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveUserDialogFragment;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveDanmuPresenter;
@ -1016,7 +1016,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
*/
public void setName(String name) {
if (mName != null) {
mNameText = name;
if (name.length() > 4) {
name = name.substring(0, 4) + "...";
}
mName.setText(name);
EventBus.getDefault().post("name_true");
}

View File

@ -18,6 +18,7 @@ import androidx.fragment.app.FragmentTransaction;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.event.CloseEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.SearchHistoryRecordManager;
import com.yunbao.common.utils.Bus;
@ -27,7 +28,6 @@ import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.main.R;
import com.yunbao.common.event.CloseEvent;
import com.yunbao.main.event.JumpUserHomeEvent;
import com.yunbao.main.fragment.SearchRecommendFragment;
import com.yunbao.main.fragment.SearchResultsFragment;
@ -175,16 +175,13 @@ public class SearchActivity extends AbsActivity {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
@Override
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
if (liveBean == null) {
LiveRoomCheckLivePresenter.isSearch = true;
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
if (liveBean1 == null) {
return;
}
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk);
}
});
mCheckLivePresenter.checkLive(liveBean);