修复:
首页或者搜索结果页面进入密码直播间要输两次密码 主播名称缩写错误
This commit is contained in:
parent
25e3e86230
commit
80b5127832
@ -298,6 +298,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
|||||||
mLiveUid = mLiveBean.getUid();
|
mLiveUid = mLiveBean.getUid();
|
||||||
mStream = mLiveBean.getStream();
|
mStream = mLiveBean.getStream();
|
||||||
mAncherName = liveBean.getUserNiceName();
|
mAncherName = liveBean.getUserNiceName();
|
||||||
|
|
||||||
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
|
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
|
||||||
//加载当前页面数据
|
//加载当前页面数据
|
||||||
View rootView = manager.getRootView();
|
View rootView = manager.getRootView();
|
||||||
|
@ -5,7 +5,6 @@ import android.os.Parcelable;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
import com.yunbao.common.bean.WeekListBean;
|
import com.yunbao.common.bean.WeekListBean;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
@ -203,6 +202,7 @@ public class LiveBean implements Parcelable {
|
|||||||
|
|
||||||
@JSONField(name = "user_nicename")
|
@JSONField(name = "user_nicename")
|
||||||
public String getUserNiceName() {
|
public String getUserNiceName() {
|
||||||
|
|
||||||
return userNiceName;
|
return userNiceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +328,7 @@ public class LiveBean implements Parcelable {
|
|||||||
public String getIslive() {
|
public String getIslive() {
|
||||||
return islive;
|
return islive;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIslive(String islive) {
|
public void setIslive(String islive) {
|
||||||
this.islive = islive;
|
this.islive = islive;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,8 @@ public class LiveRoomCheckLivePresenter {
|
|||||||
private LiveBean mLiveBean;
|
private LiveBean mLiveBean;
|
||||||
private ActionListener mActionListener;
|
private ActionListener mActionListener;
|
||||||
private int mLiveSdk;
|
private int mLiveSdk;
|
||||||
|
//搜索页面不提示密码
|
||||||
|
public static boolean isSearch = false;
|
||||||
|
|
||||||
public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) {
|
public LiveRoomCheckLivePresenter(Context context, ActionListener actionListener) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@ -46,7 +48,6 @@ public class LiveRoomCheckLivePresenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private HttpCallback mCheckLiveCallback = new HttpCallback() {
|
private HttpCallback mCheckLiveCallback = new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@ -101,22 +102,28 @@ public class LiveRoomCheckLivePresenter {
|
|||||||
* 前往密码房间
|
* 前往密码房间
|
||||||
*/
|
*/
|
||||||
private void forwardPwdRoom() {
|
private void forwardPwdRoom() {
|
||||||
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback() {
|
if (!isSearch) {
|
||||||
@Override
|
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback() {
|
||||||
public void onConfirmClick(Dialog dialog, String content) {
|
@Override
|
||||||
if (TextUtils.isEmpty(content)) {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
ToastUtil.show(WordUtil.getString(R.string.live_input_password));
|
if (TextUtils.isEmpty(content)) {
|
||||||
return;
|
ToastUtil.show(WordUtil.getString(R.string.live_input_password));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String password = MD5Util.getMD5(content);
|
||||||
|
if (mLiveTypeMsg.equalsIgnoreCase(password)) {
|
||||||
|
dialog.dismiss();
|
||||||
|
enterLiveRoom();
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(WordUtil.getString(R.string.live_password_error));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String password = MD5Util.getMD5(content);
|
});
|
||||||
if (mLiveTypeMsg.equalsIgnoreCase(password)) {
|
}else {
|
||||||
dialog.dismiss();
|
enterLiveRoom();
|
||||||
enterLiveRoom();
|
isSearch = false;
|
||||||
} else {
|
}
|
||||||
ToastUtil.show(WordUtil.getString(R.string.live_password_error));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,6 @@ import com.yunbao.common.CommonAppConfig;
|
|||||||
import com.yunbao.common.Constants;
|
import com.yunbao.common.Constants;
|
||||||
import com.yunbao.common.bean.LevelBean;
|
import com.yunbao.common.bean.LevelBean;
|
||||||
import com.yunbao.common.bean.UserBean;
|
import com.yunbao.common.bean.UserBean;
|
||||||
import com.yunbao.live.event.LiveAudienceEvent;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
import com.yunbao.common.http.CommonHttpConsts;
|
import com.yunbao.common.http.CommonHttpConsts;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
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.LiveFansMedalDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
||||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveDanmuPresenter;
|
import com.yunbao.live.presenter.LiveDanmuPresenter;
|
||||||
@ -1016,7 +1016,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
if (mName != null) {
|
if (mName != null) {
|
||||||
|
|
||||||
mNameText = name;
|
mNameText = name;
|
||||||
|
if (name.length() > 4) {
|
||||||
|
name = name.substring(0, 4) + "...";
|
||||||
|
}
|
||||||
mName.setText(name);
|
mName.setText(name);
|
||||||
EventBus.getDefault().post("name_true");
|
EventBus.getDefault().post("name_true");
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.event.CloseEvent;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.manager.SearchHistoryRecordManager;
|
import com.yunbao.common.manager.SearchHistoryRecordManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
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.http.LiveHttpUtil;
|
||||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.common.event.CloseEvent;
|
|
||||||
import com.yunbao.main.event.JumpUserHomeEvent;
|
import com.yunbao.main.event.JumpUserHomeEvent;
|
||||||
import com.yunbao.main.fragment.SearchRecommendFragment;
|
import com.yunbao.main.fragment.SearchRecommendFragment;
|
||||||
import com.yunbao.main.fragment.SearchResultsFragment;
|
import com.yunbao.main.fragment.SearchResultsFragment;
|
||||||
@ -175,16 +175,13 @@ public class SearchActivity extends AbsActivity {
|
|||||||
if (code == 0 && info.length > 0) {
|
if (code == 0 && info.length > 0) {
|
||||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||||
|
|
||||||
|
LiveRoomCheckLivePresenter.isSearch = true;
|
||||||
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> {
|
||||||
@Override
|
if (liveBean1 == null) {
|
||||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
return;
|
||||||
if (liveBean == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mCheckLivePresenter.checkLive(liveBean);
|
mCheckLivePresenter.checkLive(liveBean);
|
||||||
|
Loading…
Reference in New Issue
Block a user