进房逻辑优化,优化进房体验
This commit is contained in:
@@ -124,6 +124,7 @@ import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
|||||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||||
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
import com.yizhuan.xchat_android_core.utils.StringUtils;
|
||||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||||
|
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||||
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
import com.yizhuan.xchat_android_library.utils.JavaUtil;
|
||||||
import com.yizhuan.xchat_android_library.utils.UIUtils;
|
import com.yizhuan.xchat_android_library.utils.UIUtils;
|
||||||
|
|
||||||
@@ -632,6 +633,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
}
|
}
|
||||||
getMvpPresenter().judgeIsLimitEnter();
|
getMvpPresenter().judgeIsLimitEnter();
|
||||||
}
|
}
|
||||||
|
if (giftId != 0) {
|
||||||
|
RxBus.get().post(new ShowGiftDialogEvent().setGiftId(giftId));
|
||||||
|
giftId = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showLiveFinishView(long uid) {
|
private void showLiveFinishView(long uid) {
|
||||||
@@ -1024,10 +1029,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
DemoCache.saveNewUserChargeGift(1);
|
DemoCache.saveNewUserChargeGift(1);
|
||||||
}
|
}
|
||||||
dismissLoadingDialog();
|
dismissLoadingDialog();
|
||||||
if (giftId != 0) {
|
|
||||||
EventBus.getDefault().post(new ShowGiftDialogEvent().setGiftId(giftId));
|
|
||||||
giftId = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1062,16 +1063,11 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dismissLoadingDialog() {
|
public void dismissLoadingDialog() {
|
||||||
if (mLoadingDialog != null && mLoadingDialog.isShowing()) {
|
getDialogManager().dismissDialog();
|
||||||
mLoadingDialog.dismiss();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showLoadingDialog() {
|
public void showLoadingDialog() {
|
||||||
if (mLoadingDialog == null) {
|
getDialogManager().showProgressDialog(this, false);
|
||||||
mLoadingDialog = new LoadingDialog(AVRoomActivity.this);
|
|
||||||
}
|
|
||||||
mLoadingDialog.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dismissDialog() {
|
private void dismissDialog() {
|
||||||
@@ -1099,7 +1095,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
public void onRoomTaskTipsEvent(RoomTaskTipsEvent event) {
|
public void onRoomTaskTipsEvent(RoomTaskTipsEvent event) {
|
||||||
if (TextUtils.isEmpty(event.getTaskCompleteMsg()) || TextUtils.isEmpty(event.getTaskUrl()))
|
if (TextUtils.isEmpty(event.getTaskCompleteMsg()) || TextUtils.isEmpty(event.getTaskUrl()))
|
||||||
return;
|
return;
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_TASK_TOAST_SHOW,"任务完成toast曝光");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_TASK_TOAST_SHOW, "任务完成toast曝光");
|
||||||
if (llTaskTips == null) {
|
if (llTaskTips == null) {
|
||||||
llTaskTips = (LinearLayout) vsTaskTips.inflate();
|
llTaskTips = (LinearLayout) vsTaskTips.inflate();
|
||||||
}
|
}
|
||||||
@@ -1108,7 +1104,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
|||||||
TextView tvMsg = llTaskTips.findViewById(R.id.tv_tips_text);
|
TextView tvMsg = llTaskTips.findViewById(R.id.tv_tips_text);
|
||||||
tvMsg.setText(event.getTaskCompleteMsg());
|
tvMsg.setText(event.getTaskCompleteMsg());
|
||||||
llTaskTips.setOnClickListener(v -> {
|
llTaskTips.setOnClickListener(v -> {
|
||||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_TASK_TOAST_CLICK,"任务完成toast点击(跳转活动页");
|
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_TASK_TOAST_CLICK, "任务完成toast点击(跳转活动页");
|
||||||
llTaskTips.setVisibility(View.GONE);
|
llTaskTips.setVisibility(View.GONE);
|
||||||
CommonWebViewActivity.start(this, event.getTaskUrl());
|
CommonWebViewActivity.start(this, event.getTaskUrl());
|
||||||
});
|
});
|
||||||
|
@@ -272,6 +272,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
|||||||
|
|
||||||
public void setRoomBg(RoomInfo roomInfo) {
|
public void setRoomBg(RoomInfo roomInfo) {
|
||||||
if (svgaRoomBg == null) return;
|
if (svgaRoomBg == null) return;
|
||||||
|
updateView(roomInfo);
|
||||||
AVRoomActivity.setBackBg(mContext, roomInfo, svgaRoomBg, bgPicture);
|
AVRoomActivity.setBackBg(mContext, roomInfo, svgaRoomBg, bgPicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +281,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
updateView();
|
updateView(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||||
IMNetEaseManager.get().getChatRoomEventObservable()
|
IMNetEaseManager.get().getChatRoomEventObservable()
|
||||||
.compose(bindToLifecycle())
|
.compose(bindToLifecycle())
|
||||||
.subscribe(roomEvent -> {
|
.subscribe(roomEvent -> {
|
||||||
@@ -293,7 +294,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
addTipMsg();
|
addTipMsg();
|
||||||
case RoomEvent.ROOM_INFO_UPDATE:
|
case RoomEvent.ROOM_INFO_UPDATE:
|
||||||
updateView();
|
updateView(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||||
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo);
|
setRoomBg(AvRoomDataManager.get().mCurrentRoomInfo);
|
||||||
break;
|
break;
|
||||||
case RoomEvent.RECEIVE_NORMALE_GIFT:
|
case RoomEvent.RECEIVE_NORMALE_GIFT:
|
||||||
@@ -381,8 +382,7 @@ public class HomePartyFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
public void updateView() {
|
public void updateView(RoomInfo currentRoomInfo) {
|
||||||
RoomInfo currentRoomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
|
||||||
if (currentRoomInfo != null) {
|
if (currentRoomInfo != null) {
|
||||||
|
|
||||||
Fragment tempFragment = roomFragment;
|
Fragment tempFragment = roomFragment;
|
||||||
|
@@ -153,6 +153,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
|||||||
, fromUid)
|
, fromUid)
|
||||||
.subscribe((stringServiceResult) -> EventBus.getDefault().post(new AudioPartyOpenEvent()));
|
.subscribe((stringServiceResult) -> EventBus.getDefault().post(new AudioPartyOpenEvent()));
|
||||||
mAvRoomModel.loadMessageHistory(AvRoomDataManager.get().clearScreenTime);
|
mAvRoomModel.loadMessageHistory(AvRoomDataManager.get().clearScreenTime);
|
||||||
|
IMNetEaseManager.get().joinAvRoom();
|
||||||
}, this::dealEnterRoomError);
|
}, this::dealEnterRoomError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/color_FFFFFF"
|
android:textColor="@color/color_FFFFFF"
|
||||||
android:textSize="9dp"
|
android:textSize="9dp"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
tools:text="红队" />
|
tools:text="红队" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@@ -143,7 +143,7 @@
|
|||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_room_mute_micro"
|
android:src="@drawable/icon_room_mute_micro"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_kick_guard"
|
android:src="@drawable/ic_kick_guard"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@@ -172,7 +172,7 @@
|
|||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_room_mute_micro"
|
android:src="@drawable/icon_room_mute_micro"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
android:layout_marginBottom="13dp"
|
android:layout_marginBottom="13dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_kick_guard"
|
android:src="@drawable/ic_kick_guard"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@@ -110,7 +110,7 @@
|
|||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_room_mute_micro"
|
android:src="@drawable/icon_room_mute_micro"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_kick_guard"
|
android:src="@drawable/ic_kick_guard"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@@ -59,7 +59,7 @@
|
|||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_room_mute_micro"
|
android:src="@drawable/icon_room_mute_micro"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@@ -61,7 +61,7 @@
|
|||||||
android:layout_marginBottom="@dimen/dp_4"
|
android:layout_marginBottom="@dimen/dp_4"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/icon_room_mute_micro"
|
android:src="@drawable/icon_room_mute_micro"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
android:layout_marginBottom="3dp"
|
android:layout_marginBottom="3dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/ic_kick_guard"
|
android:src="@drawable/ic_kick_guard"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
android:layout_gravity="start|bottom"
|
android:layout_gravity="start|bottom"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
@@ -102,10 +102,12 @@
|
|||||||
android:layout_width="66dp"
|
android:layout_width="66dp"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/svga_head_wear"
|
app:layout_constraintBottom_toBottomOf="@id/svga_head_wear"
|
||||||
app:layout_constraintEnd_toEndOf="@id/avatar"
|
app:layout_constraintEnd_toEndOf="@id/avatar"
|
||||||
app:layout_constraintStart_toStartOf="@id/avatar"
|
app:layout_constraintStart_toStartOf="@id/avatar"
|
||||||
tools:src="@drawable/single_room_pk_ic_result_win" />
|
tools:src="@drawable/single_room_pk_ic_result_win"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/mute_image"
|
android:id="@+id/mute_image"
|
||||||
|
@@ -62,7 +62,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:src="@drawable/ic_charm_level_max"
|
|
||||||
android:textSize="9dp" />
|
android:textSize="9dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
@@ -39,7 +39,7 @@ public class RtcEngineHandler extends Handler {
|
|||||||
if (rtcEngineManager == null) return;
|
if (rtcEngineManager == null) return;
|
||||||
if (msg.what == notifyJoinAvRoom) {
|
if (msg.what == notifyJoinAvRoom) {
|
||||||
if (!rtcEngineManager.inRoom) {
|
if (!rtcEngineManager.inRoom) {
|
||||||
IMNetEaseManager.get().joinAvRoom();
|
//IMNetEaseManager.get().joinAvRoom();
|
||||||
}
|
}
|
||||||
rtcEngineManager.inRoom = true;
|
rtcEngineManager.inRoom = true;
|
||||||
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
||||||
|
@@ -40,7 +40,7 @@ public class TRtcEngineHandler extends Handler {
|
|||||||
if (rtcEngineManager == null) return;
|
if (rtcEngineManager == null) return;
|
||||||
if (msg.what == notifyJoinAvRoom) {
|
if (msg.what == notifyJoinAvRoom) {
|
||||||
if (!rtcEngineManager.inRoom) {
|
if (!rtcEngineManager.inRoom) {
|
||||||
IMNetEaseManager.get().joinAvRoom();
|
//IMNetEaseManager.get().joinAvRoom();
|
||||||
}
|
}
|
||||||
rtcEngineManager.inRoom = true;
|
rtcEngineManager.inRoom = true;
|
||||||
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
if (rtcEngineManager.needRecord && rtcEngineManager.mRtcEngine != null) {
|
||||||
|
@@ -83,7 +83,7 @@ public class ZegoEngineManager extends BaseEngine {
|
|||||||
if (isMusicPlaying) {
|
if (isMusicPlaying) {
|
||||||
startAudioMixing(PlayerModel.get().getCurrent().getLocalUri(), false, 1);
|
startAudioMixing(PlayerModel.get().getCurrent().getLocalUri(), false, 1);
|
||||||
}
|
}
|
||||||
IMNetEaseManager.get().joinAvRoom();
|
//IMNetEaseManager.get().joinAvRoom();
|
||||||
} else {
|
} else {
|
||||||
// 登录失败
|
// 登录失败
|
||||||
LogUtils.e("Zego onLoginCompletion: code: " + code);
|
LogUtils.e("Zego onLoginCompletion: code: " + code);
|
||||||
|
Reference in New Issue
Block a user