开房逻辑优化
This commit is contained in:
@@ -3,15 +3,10 @@ package com.yizhuan.erban.home.activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -23,36 +18,27 @@ import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.yizhuan.erban.avroom.ktv.KtvMusicManager;
|
||||
import com.yizhuan.erban.base.BaseMvpActivity;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.home.adapter.HomeConcernsAdapter;
|
||||
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.yizhuan.erban.home.fragment.HomeTabMapFragment;
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
||||
import com.yizhuan.erban.home.presenter.MainFragmentPresenter;
|
||||
import com.yizhuan.erban.home.view.IMainFragmentView;
|
||||
import com.yizhuan.erban.service.DaemonService;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.OnPageSelectedListener;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.VerticalDecoration;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TagListInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AudioEngineManager;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||
|
||||
@@ -62,10 +48,6 @@ import java.util.List;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_FORCE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_GUIDE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_NONE;
|
||||
|
||||
@CreatePresenter(MainFragmentPresenter.class)
|
||||
public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, MainFragmentPresenter> implements IMainFragmentView, MainMagicIndicatorAdapter.OnItemSelectListener {
|
||||
|
||||
@@ -78,6 +60,11 @@ public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, Mai
|
||||
private HomeConcernsAdapter mFollowRoomsAdapter;
|
||||
private List<Fragment> mFragments;
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, HomeMoreRoomActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -88,12 +75,6 @@ public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, Mai
|
||||
initRoomConcern();
|
||||
}
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent intent = new Intent(context, HomeMoreRoomActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
private void initRoomTitleTab() {
|
||||
getMvpPresenter().getHomeTag();
|
||||
}
|
||||
@@ -105,7 +86,7 @@ public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, Mai
|
||||
mFollowRoomsAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_DBRUK_CLICK, "点击顶部我的房间/关注进入房间");
|
||||
if (position == 0) {
|
||||
openRoom();
|
||||
OpenRoomHelper.openRoom(this);
|
||||
return;
|
||||
}
|
||||
HomeConcernsInfo homeConcernsInfo = mFollowRoomsAdapter.getItem(position);
|
||||
@@ -135,22 +116,7 @@ public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, Mai
|
||||
|
||||
@Override
|
||||
public void requestOpenRoomResult(int openRoomFailType, Object... arg) {
|
||||
getDialogManager().dismissDialog();
|
||||
if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_SUCCESS) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(HomeMoreRoomActivity.this, roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_TYPE_IN_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
getDialogManager().showProgressDialog(HomeMoreRoomActivity.this, "请稍后...");
|
||||
getMvpPresenter().requestExitRoom(roomInfo.getType());
|
||||
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL) {
|
||||
String error = (String) arg[0];
|
||||
toast(error);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(HomeMoreRoomActivity.this, roomInfo.getUid());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -260,131 +226,6 @@ public class HomeMoreRoomActivity extends BaseMvpActivity<IMainFragmentView, Mai
|
||||
|
||||
}
|
||||
|
||||
private void openRoom() {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo != null && !userInfo.isCertified()) {
|
||||
switch (CertificationModel.get().getCertificationType()) {
|
||||
default:
|
||||
case CER_TYPE_NONE:
|
||||
// do nothing
|
||||
openCreateRoomTypeDialog();
|
||||
break;
|
||||
|
||||
case CER_TYPE_FORCE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(HomeMoreRoomActivity.this,
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case CER_TYPE_GUIDE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(HomeMoreRoomActivity.this,
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void openCreateRoomTypeDialog() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
}
|
||||
|
||||
private void getRoomInfo(int roomType) {
|
||||
AvRoomModel.get().requestRoomInfoFromService(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
new CallBack<RoomInfo>() {
|
||||
@Override
|
||||
public void onSuccess(RoomInfo data) {
|
||||
if (data.getType() != 0
|
||||
&& data.getType() != roomType
|
||||
&& data.isValid()) {
|
||||
String message = roomType == RoomInfo.ROOMTYPE_CP ? "创建陪伴房,将关闭当前房间并解散房间内的用户"
|
||||
: "创建普通房,将关闭当前房间并解散房间内的用户";
|
||||
getDialogManager().showOkCancelDialog(
|
||||
message,
|
||||
"确认",
|
||||
"取消",
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(0, roomType);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void changeRoomState(long worldId, int roomType) {
|
||||
if (worldId == 0) {
|
||||
openRoom(roomType);
|
||||
} else {
|
||||
getMvpPresenter().roomWorldModeClose(AuthModel.get().getCurrentUid());
|
||||
}
|
||||
}
|
||||
|
||||
private void openRoom(int roomType) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
if (roomInfo.getUid() == AuthModel.get().getCurrentUid()
|
||||
&& roomInfo.getType() == roomType) {
|
||||
AVRoomActivity.start(HomeMoreRoomActivity.this, roomInfo.getUid());
|
||||
} else {
|
||||
getDialogManager().showProgressDialog(HomeMoreRoomActivity.this, getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestExitRoom(roomType);
|
||||
}
|
||||
} else {
|
||||
getDialogManager().showProgressDialog(HomeMoreRoomActivity.this, getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestOpenRoom(roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private SpannableStringBuilder getCertificationTips() {
|
||||
String tips = getString(R.string.tips_need_to_certification);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(HomeMoreRoomActivity.this, R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean needSteepStateBar() {
|
||||
return true;
|
||||
|
@@ -8,9 +8,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
@@ -20,7 +17,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -32,18 +28,17 @@ import com.coorchice.library.utils.LogUtils;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.scwang.smartrefresh.layout.internal.ProgressDrawable;
|
||||
import com.yizhuan.erban.MainActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.avroom.adapter.RoomContributeListAdapter;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.databinding.FragmentGameHomeBinding;
|
||||
import com.yizhuan.erban.home.activity.HomeMoreRoomActivity;
|
||||
import com.yizhuan.erban.home.adapter.BannerAdapter;
|
||||
import com.yizhuan.erban.home.adapter.HomeAddFriendsAdapter;
|
||||
import com.yizhuan.erban.home.adapter.HomeConcernsAdapter;
|
||||
import com.yizhuan.erban.home.adapter.MainMagicIndicatorAdapter;
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
||||
import com.yizhuan.erban.home.presenter.MainFragmentPresenter;
|
||||
import com.yizhuan.erban.home.view.IMainFragmentView;
|
||||
import com.yizhuan.erban.radish.signin.SignInActivity;
|
||||
@@ -58,7 +53,6 @@ import com.yizhuan.erban.ui.widget.rollviewpager.Util;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomePlayInfo;
|
||||
@@ -67,10 +61,8 @@ import com.yizhuan.xchat_android_core.home.bean.TagListInfo;
|
||||
import com.yizhuan.xchat_android_core.home.event.RefreshHomeDataEvent;
|
||||
import com.yizhuan.xchat_android_core.home.model.GameHomeModel;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
@@ -80,7 +72,6 @@ import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SizeUtils;
|
||||
@@ -100,10 +91,6 @@ import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_FORCE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_GUIDE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_NONE;
|
||||
|
||||
/**
|
||||
* 音游首页
|
||||
*/
|
||||
@@ -111,25 +98,6 @@ import static com.yizhuan.xchat_android_core.certification.CertificationModel.CE
|
||||
public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentPresenter>
|
||||
implements IMainFragmentView, View.OnClickListener, MainMagicIndicatorAdapter.OnItemSelectListener, MainMagicIndicatorAdapter.OnBottomItemSelectListener {
|
||||
public static final String TAG = "GameHomeFragment";
|
||||
private FragmentGameHomeBinding mBinding;
|
||||
|
||||
@NonNull
|
||||
private final List<Fragment> mFragments = new ArrayList<>();
|
||||
private List<Fragment> mFragmentsBottom;
|
||||
private Handler uiHandler;
|
||||
|
||||
private boolean needAutoScroll = true;
|
||||
|
||||
private HomeAddFriendsAdapter addFriendsAdapter;
|
||||
|
||||
private BannerAdapter bannerAdapter;
|
||||
|
||||
@Nullable
|
||||
private Disposable addFriendsDisposable;
|
||||
|
||||
private boolean isLoaded;
|
||||
|
||||
|
||||
/**
|
||||
* 动态
|
||||
*/
|
||||
@@ -138,12 +106,23 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
* 聊天交友
|
||||
*/
|
||||
public static final int TAB_TYPE_PLAY = 1;
|
||||
|
||||
/**
|
||||
* 首页Banner
|
||||
*/
|
||||
private static final String BANNER_TYPE = "1";
|
||||
|
||||
@NonNull
|
||||
private final List<Fragment> mFragments = new ArrayList<>();
|
||||
@NonNull
|
||||
private final List<CharSequence> mTabInfoList = new ArrayList<>();
|
||||
private FragmentGameHomeBinding mBinding;
|
||||
private List<Fragment> mFragmentsBottom;
|
||||
private Handler uiHandler;
|
||||
private boolean needAutoScroll = true;
|
||||
private HomeAddFriendsAdapter addFriendsAdapter;
|
||||
private BannerAdapter bannerAdapter;
|
||||
@Nullable
|
||||
private Disposable addFriendsDisposable;
|
||||
private boolean isLoaded;
|
||||
private HomeConcernsAdapter mFollowRoomsAdapter;
|
||||
|
||||
@Override
|
||||
@@ -163,7 +142,7 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_open_room:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_click, "创建房间按钮");
|
||||
openRoom();
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
break;
|
||||
|
||||
case R.id.tv_search_room:
|
||||
@@ -315,159 +294,9 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
scrollToView();
|
||||
}
|
||||
|
||||
private void openRoom() {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo != null && !userInfo.isCertified()) {
|
||||
switch (CertificationModel.get().getCertificationType()) {
|
||||
default:
|
||||
case CER_TYPE_NONE:
|
||||
// do nothing
|
||||
openCreateRoomTypeDialog();
|
||||
break;
|
||||
|
||||
case CER_TYPE_FORCE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case CER_TYPE_GUIDE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void openCreateRoomTypeDialog() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private SpannableStringBuilder getCertificationTips() {
|
||||
String tips = getString(R.string.tips_need_to_certification);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void getRoomInfo(int roomType) {
|
||||
AvRoomModel.get().requestRoomInfoFromService(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
new CallBack<RoomInfo>() {
|
||||
@Override
|
||||
public void onSuccess(RoomInfo data) {
|
||||
if (data.getType() != 0
|
||||
&& data.getType() != roomType
|
||||
&& data.isValid()) {
|
||||
String message = roomType == RoomInfo.ROOMTYPE_CP ? "创建陪伴房,将关闭当前房间并解散房间内的用户"
|
||||
: "创建普通房,将关闭当前房间并解散房间内的用户";
|
||||
getDialogManager().showOkCancelDialog(
|
||||
message,
|
||||
"确认",
|
||||
"取消",
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(0, roomType);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private int mRoomType;
|
||||
|
||||
private void changeRoomState(long worldId, int roomType) {
|
||||
mRoomType = roomType;
|
||||
if (worldId == 0) {
|
||||
openRoom(roomType);
|
||||
|
||||
} else {
|
||||
getMvpPresenter().roomWorldModeClose(AuthModel.get().getCurrentUid());
|
||||
}
|
||||
}
|
||||
|
||||
private void openRoom(int roomType) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
if (roomInfo.getUid() == AuthModel.get().getCurrentUid()
|
||||
&& roomInfo.getType() == roomType) {
|
||||
AVRoomActivity.start(mContext, roomInfo.getUid());
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestExitRoom(roomType);
|
||||
}
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestOpenRoom(roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestOpenRoomResult(int openRoomFailType, Object... arg) {
|
||||
getBaseActivity().getDialogManager().dismissDialog();
|
||||
if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_SUCCESS) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_TYPE_IN_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), "请稍后...");
|
||||
getMvpPresenter().requestExitRoom(roomInfo.getType());
|
||||
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL) {
|
||||
String error = (String) arg[0];
|
||||
getBaseActivity().toast(error);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_PM_LIMIT_TIME) {
|
||||
if (getActivity() != null && getActivity() instanceof MainActivity) {
|
||||
if (arg != null && arg.length > 0 && arg[0] instanceof String) {
|
||||
((MainActivity) getActivity()).handleOpenRoomWhenPmLimit((String) arg[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -507,7 +336,7 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_DBRUK_CLICK, "点击顶部我的房间/关注进入房间");
|
||||
if (position == 0) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_HOME_INTO_MY_ROOM_CLICK, "首页_进入我的房间");
|
||||
openRoom();
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
return;
|
||||
}
|
||||
HomeConcernsInfo homeConcernsInfo = mFollowRoomsAdapter.getItem(position);
|
||||
@@ -572,7 +401,6 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onGetFirstPageBannerFailed(String message) {
|
||||
toast(message);
|
||||
@@ -580,7 +408,7 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
|
||||
@Override
|
||||
public void roomWorldModeCloseSuccess() {
|
||||
openRoom(mRoomType);
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -593,9 +421,6 @@ public class HomeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
setBanner(bannerInfos);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private final List<CharSequence> mTabInfoList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onGetHomeTagSuccess(List<HomeTagInfo> info) {
|
||||
boolean changed = false;
|
||||
|
@@ -1,58 +1,38 @@
|
||||
package com.yizhuan.erban.home.fragment;
|
||||
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.home.adapter.FragmentViewPagerAdapter;
|
||||
import com.yizhuan.erban.home.adapter.TopMagicIndicatorAdapter;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo;
|
||||
import com.yizhuan.erban.home.dialog.CreateRoomDialog;
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
||||
import com.yizhuan.erban.home.presenter.MainFragmentPresenter;
|
||||
import com.yizhuan.erban.home.view.IMainFragmentTabBg;
|
||||
import com.yizhuan.erban.home.view.IMainFragmentView;
|
||||
import com.yizhuan.erban.ui.search.SearchActivity;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.MagicIndicator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ViewPagerHelper;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.ext.MainCommonNavigatorAdapter;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TagListInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_FORCE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_GUIDE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_NONE;
|
||||
|
||||
/**
|
||||
* <p>首页 fragment </p>
|
||||
*
|
||||
@@ -77,6 +57,8 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
|
||||
private LinearLayout llHomeTitle;
|
||||
private boolean mIsBannerTop = true;
|
||||
// 有可能出现miHomeIndicator未初始就调用handleGuide的情况
|
||||
private boolean showGuide = false;
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
@@ -93,6 +75,7 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
llHomeTitle = mView.findViewById(R.id.ll_home_title);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetListener() {
|
||||
ivSearchRoom.setOnClickListener(this);
|
||||
@@ -104,140 +87,8 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
int id = v.getId();
|
||||
if (id == ivSearchRoom.getId()) {
|
||||
SearchActivity.start(getActivity());
|
||||
// startActivity(new Intent(getActivity(), TestActivity.class));
|
||||
}else if (id == ivOpenRoom.getId()){
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo != null && !userInfo.isCertified()) {
|
||||
switch (CertificationModel.get().getCertificationType()) {
|
||||
default:
|
||||
case CER_TYPE_NONE:
|
||||
// do nothing
|
||||
openCreateRoomTypeDialog();
|
||||
break;
|
||||
|
||||
case CER_TYPE_FORCE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case CER_TYPE_GUIDE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
openCreateRoomTypeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private SpannableStringBuilder getCertificationTips() {
|
||||
String tips = getString(R.string.tips_need_to_certification);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void openCreateRoomTypeDialog() {
|
||||
new CreateRoomDialog(getActivity(), new CreateRoomDialog.OpenRoomListener() {
|
||||
@Override
|
||||
public void onNormalRoom() {
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCpRoom() {
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_CP);
|
||||
}
|
||||
}).openDialog();
|
||||
}
|
||||
|
||||
private void getRoomInfo(int roomType) {
|
||||
AvRoomModel.get().requestRoomInfoFromService(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
new CallBack<RoomInfo>() {
|
||||
@Override
|
||||
public void onSuccess(RoomInfo data) {
|
||||
if (data.getType() != 0
|
||||
&& data.getType() != roomType
|
||||
&& data.isValid()) {
|
||||
String message = roomType == RoomInfo.ROOMTYPE_CP ? "创建陪伴房,将关闭当前房间并解散房间内的用户"
|
||||
: "创建普通房,将关闭当前房间并解散房间内的用户";
|
||||
getDialogManager().showOkCancelDialog(
|
||||
message,
|
||||
"确认",
|
||||
"取消",
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(0, roomType);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int mRoomType;
|
||||
private void changeRoomState(long worldId, int roomType) {
|
||||
mRoomType = roomType;
|
||||
if (worldId == 0) {
|
||||
openRoom(roomType);
|
||||
|
||||
} else {
|
||||
getMvpPresenter().roomWorldModeClose(AuthModel.get().getCurrentUid());
|
||||
}
|
||||
}
|
||||
private void openRoom(int roomType) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
if (roomInfo.getUid() == AuthModel.get().getCurrentUid()
|
||||
&& roomInfo.getType() == roomType) {
|
||||
AVRoomActivity.start(mContext, roomInfo.getUid());
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestExitRoom(roomType);
|
||||
}
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestOpenRoom(roomType);
|
||||
} else if (id == ivOpenRoom.getId()) {
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,33 +96,13 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
public void initiate() {
|
||||
//初始化延迟到获取到审核结果后
|
||||
if (!"baidutg".equals(AppMetaDataUtil.getChannelID())) {
|
||||
// showByMarketCheckingStatus();
|
||||
getMvpPresenter().tagList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void requestOpenRoomResult(int openRoomFailType, Object... arg) {
|
||||
getBaseActivity().getDialogManager().dismissDialog();
|
||||
if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_SUCCESS){
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_TYPE_IN_ROOM){
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), "请稍后...");
|
||||
getMvpPresenter().requestExitRoom(roomInfo.getType());
|
||||
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL){
|
||||
String error = (String) arg[0];
|
||||
getBaseActivity().toast(error);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM){
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_PM_LIMIT_TIME) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void initTabIndicator(List<String> mTabInfoList) {
|
||||
@@ -291,13 +122,13 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
* 审核包,隐藏,重新刷新
|
||||
*/
|
||||
@Override
|
||||
public void showByMarketCheckingStatus(List<TagListInfo> tagListInfoList){
|
||||
public void showByMarketCheckingStatus(List<TagListInfo> tagListInfoList) {
|
||||
//审核包隐藏搜索
|
||||
if (MarketVerifyModel.get().isMarketChecking()){
|
||||
if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
ivSearchRoom.setVisibility(View.INVISIBLE);
|
||||
ivSearchRoom.setEnabled(false);
|
||||
|
||||
}else {
|
||||
} else {
|
||||
ivSearchRoom.setVisibility(View.VISIBLE);
|
||||
ivSearchRoom.setEnabled(true);
|
||||
}
|
||||
@@ -372,8 +203,6 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
}
|
||||
}
|
||||
|
||||
// 有可能出现miHomeIndicator未初始就调用handleGuide的情况
|
||||
private boolean showGuide = false;
|
||||
/**
|
||||
* 处理引导
|
||||
*/
|
||||
@@ -421,7 +250,7 @@ public class MainFragment extends BaseMvpFragment<IMainFragmentView, MainFragmen
|
||||
|
||||
@Override
|
||||
public void roomWorldModeCloseSuccess() {
|
||||
openRoom(mRoomType);
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,32 +1,28 @@
|
||||
package com.yizhuan.erban.home.fragment;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_HADEXPIRE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.idlefish.flutterboost.FlutterBoost;
|
||||
import com.yizhuan.erban.MainActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.UIHelper;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.base.BaseMvpFragment;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.base.BaseFragment;
|
||||
import com.yizhuan.erban.databinding.FragmentMeBinding;
|
||||
import com.yizhuan.erban.decoration.view.MyDecorationActivity;
|
||||
import com.yizhuan.erban.flutter.RouterConstants;
|
||||
import com.yizhuan.erban.flutter.event.ShowInviteEvent;
|
||||
import com.yizhuan.erban.home.activity.CollectionRoomActivity;
|
||||
import com.yizhuan.erban.home.presenter.MainFragmentPresenter;
|
||||
import com.yizhuan.erban.home.view.IMainFragmentView;
|
||||
import com.yizhuan.erban.home.helper.OpenRoomHelper;
|
||||
import com.yizhuan.erban.module_hall.HallDataManager;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleClanActivity;
|
||||
import com.yizhuan.erban.module_hall.hall.activity.ModuleHallActivity;
|
||||
@@ -36,35 +32,21 @@ import com.yizhuan.erban.ui.relation.AttentionListActivity;
|
||||
import com.yizhuan.erban.ui.relation.FansListActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.ObservableScrollView;
|
||||
import com.yizhuan.erban.ui.widget.higuide.TuTuGuideHelper;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.decoration.headwear.bean.HeadWearInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeConcernsInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.TagListInfo;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RelationShipEvent;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
import com.yizhuan.xchat_android_core.market_verify.event.MarketVerifyUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleInfo;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleProtocol;
|
||||
import com.yizhuan.xchat_android_core.noble.NobleUtil;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.user.event.LoginUserInfoUpdateEvent;
|
||||
import com.yizhuan.xchat_android_core.utils.StarUtils;
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBusHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -72,23 +54,14 @@ import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_FORCE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_GUIDE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_NONE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_HADEXPIRE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_OPENNOBLE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MESS_SUB_RENEWNOBLE;
|
||||
|
||||
/**
|
||||
* @description: 我的 界面
|
||||
* @author: hewenhao
|
||||
* @date: 2018/9/4 16:53
|
||||
*/
|
||||
@CreatePresenter(MainFragmentPresenter.class)
|
||||
public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentPresenter> implements View.OnClickListener, IMainFragmentView {
|
||||
public class MeFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
public static final String TAG = "MeFragment";
|
||||
|
||||
@@ -141,8 +114,6 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
IMNetEaseManager.get().getRelationShipEventObservable().subscribe(e -> onGetRelationShipEvent(e))
|
||||
);
|
||||
|
||||
onMarketVerifyUpdateEvent(null);
|
||||
|
||||
//模厅
|
||||
HallDataManager.get().registerHallExist(this, hallExist -> {
|
||||
if (HallDataManager.get().isClanElder()) {
|
||||
@@ -291,7 +262,7 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
|
||||
case R.id.ll_my_room:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ME_INTO_MY_ROOM_CLICK, "我页_进入我的房间");
|
||||
openRoom();
|
||||
OpenRoomHelper.openRoom(getBaseActivity());
|
||||
break;
|
||||
case R.id.ll_collect_room:
|
||||
CollectionRoomActivity.start(mContext);
|
||||
@@ -359,229 +330,4 @@ public class MeFragment extends BaseMvpFragment<IMainFragmentView, MainFragmentP
|
||||
}
|
||||
}
|
||||
|
||||
private void openRoom() {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo != null && !userInfo.isCertified()) {
|
||||
switch (CertificationModel.get().getCertificationType()) {
|
||||
default:
|
||||
case CER_TYPE_NONE:
|
||||
// do nothing
|
||||
openNormalRoom();
|
||||
break;
|
||||
|
||||
case CER_TYPE_FORCE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case CER_TYPE_GUIDE:
|
||||
getDialogManager().showTipsDialog(getCertificationTips(),
|
||||
getString(R.string.go_to_certification),
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
openNormalRoom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(getContext(),
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
openNormalRoom();
|
||||
}
|
||||
}
|
||||
|
||||
private void openRoom(int roomType) {
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null) {
|
||||
if (roomInfo.getUid() == AuthModel.get().getCurrentUid()
|
||||
&& roomInfo.getType() == roomType) {
|
||||
AVRoomActivity.start(mContext, roomInfo.getUid());
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestExitRoom(roomType);
|
||||
}
|
||||
} else {
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), getBaseActivity().getString(R.string.waiting_text));
|
||||
getMvpPresenter().requestOpenRoom(roomType);
|
||||
}
|
||||
}
|
||||
|
||||
//创建普通房间
|
||||
private void openNormalRoom() {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
getRoomInfo(RoomInfo.ROOMTYPE_HOME_PARTY);
|
||||
}
|
||||
|
||||
private void getRoomInfo(int roomType) {
|
||||
AvRoomModel.get().requestRoomInfoFromService(String.valueOf(AuthModel.get().getCurrentUid()),
|
||||
new CallBack<RoomInfo>() {
|
||||
@Override
|
||||
public void onSuccess(RoomInfo data) {
|
||||
if (data.getType() != 0
|
||||
&& data.getType() != roomType
|
||||
&& data.isValid()) {
|
||||
String message = roomType == RoomInfo.ROOMTYPE_CP ? "创建陪伴房,将关闭当前房间并解散房间内的用户"
|
||||
: "创建普通房,将关闭当前房间并解散房间内的用户";
|
||||
getDialogManager().showOkCancelDialog(
|
||||
message,
|
||||
"确认",
|
||||
"取消",
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(data.getWorldId(), roomType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
// openRoom(roomType);
|
||||
changeRoomState(0, roomType);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private int mRoomType;
|
||||
|
||||
private void changeRoomState(long worldId, int roomType) {
|
||||
mRoomType = roomType;
|
||||
if (worldId == 0) {
|
||||
openRoom(roomType);
|
||||
|
||||
} else {
|
||||
getMvpPresenter().roomWorldModeClose(AuthModel.get().getCurrentUid());
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private SpannableStringBuilder getCertificationTips() {
|
||||
String tips = getString(R.string.tips_need_to_certification);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMarketVerifyUpdateEvent(MarketVerifyUpdateEvent event) {
|
||||
//审核包隐藏tab
|
||||
if (MarketVerifyModel.get().isMarketChecking()) {
|
||||
// mBinding.meItemMyFamily.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestOpenRoomResult(int openRoomFailType, Object... arg) {
|
||||
getBaseActivity().getDialogManager().dismissDialog();
|
||||
if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_SUCCESS) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_TYPE_IN_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
getBaseActivity().getDialogManager().showProgressDialog(getActivity(), "请稍后...");
|
||||
getMvpPresenter().requestExitRoom(roomInfo.getType());
|
||||
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL) {
|
||||
String error = (String) arg[0];
|
||||
getBaseActivity().toast(error);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(getActivity(), roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_PM_LIMIT_TIME) {
|
||||
if (getActivity() != null && getActivity() instanceof MainActivity) {
|
||||
if (arg != null && arg.length > 0 && arg[0] instanceof String) {
|
||||
((MainActivity) getActivity()).handleOpenRoomWhenPmLimit((String) arg[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showByMarketCheckingStatus(List<TagListInfo> tagListInfoList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFollowRoomsSuccess(List<HomeConcernsInfo> infos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFollowRoomFail() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exitRoom(RoomInfo roomInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void titleListSuccess(List<TagListInfo> tagListInfoList) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void titleListFail(String msg) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetFirstPageBannerFailed(String message) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomWorldModeCloseSuccess() {
|
||||
openRoom(mRoomType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomWorldModeCloseFail(String error) {
|
||||
toast(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetHomeBannerSuccess(List<BannerInfo> bannerInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetHomeTagSuccess(List<HomeTagInfo> tagInfos) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getRoomShortcut(String data) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,202 @@
|
||||
package com.yizhuan.erban.home.helper;
|
||||
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_FORCE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_GUIDE;
|
||||
import static com.yizhuan.xchat_android_core.certification.CertificationModel.CER_TYPE_NONE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.yizhuan.erban.MainActivity;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.home.presenter.MainFragmentPresenter;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.certification.CertificationModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.patriarch.exception.PmRoomLimitException;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo;
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
||||
|
||||
public class OpenRoomHelper {
|
||||
|
||||
public static void openRoom(BaseActivity activity) {
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (userInfo != null && !userInfo.isCertified()) {
|
||||
switch (CertificationModel.get().getCertificationType()) {
|
||||
default:
|
||||
case CER_TYPE_NONE:
|
||||
openNormalRoom(activity);
|
||||
break;
|
||||
case CER_TYPE_FORCE:
|
||||
activity.getDialogManager().showTipsDialog(getCertificationTips(activity),
|
||||
activity.getString(R.string.go_to_certification),
|
||||
new DialogManager.AbsOkDialogListener() {
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(activity,
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
case CER_TYPE_GUIDE:
|
||||
activity.getDialogManager().showTipsDialog(getCertificationTips(activity),
|
||||
activity.getString(R.string.go_to_certification),
|
||||
new DialogManager.OkCancelDialogListener() {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
openNormalRoom(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOk() {
|
||||
// 跳去实名认证页面
|
||||
CommonWebViewActivity.start(activity,
|
||||
UriProvider.getTutuRealNamePage());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
openNormalRoom(activity);
|
||||
}
|
||||
}
|
||||
|
||||
private static void openNormalRoom(BaseActivity activity) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_createroom_ordinary_click, "创建普通房");
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
if (roomInfo != null && roomInfo.getUid() == AuthModel.get().getCurrentUid()) {
|
||||
AVRoomActivity.start(activity, roomInfo.getUid());
|
||||
} else {
|
||||
activity.getDialogManager().showProgressDialog(activity, activity.getString(R.string.waiting_text));
|
||||
requestOpenRoom(activity);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static SpannableStringBuilder getCertificationTips(BaseActivity activity) {
|
||||
String tips = activity.getString(R.string.tips_need_to_certification);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(tips);
|
||||
builder.setSpan(new ForegroundColorSpan(ContextCompat.getColor(activity, R.color.appColor)),
|
||||
tips.length() - 4, tips.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启房间
|
||||
*/
|
||||
public static void requestOpenRoom(BaseActivity activity) {
|
||||
AvRoomModel.get().requestRoomInfoV2(String.valueOf(AuthModel.get().getCurrentUid()), 0)
|
||||
.compose(RxHelper.bindActivity(activity))
|
||||
.subscribe(new DontWarnObserver<RoomInfo>() {
|
||||
@Override
|
||||
public void acceptThrowable(RoomInfo roomInfo, Throwable throwable) {
|
||||
super.acceptThrowable(roomInfo, throwable);
|
||||
if (roomInfo != null) {
|
||||
if (roomInfo.isValid()) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_SUCCESS, roomInfo);
|
||||
} else {
|
||||
openRoom(activity, roomInfo);
|
||||
}
|
||||
} else {
|
||||
if (throwable instanceof PmRoomLimitException) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_FAIL_PM_LIMIT_TIME,
|
||||
throwable.getMessage());
|
||||
} else if (!TextUtils.isEmpty(throwable.getMessage())) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_FAIL,
|
||||
throwable.getMessage());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private static void openRoom(BaseActivity activity, RoomInfo roomInfo) {
|
||||
AvRoomModel.get().openRoom(
|
||||
AuthModel.get().getCurrentUid(), roomInfo.getType(), roomInfo.getTitle(), roomInfo.getRoomDesc(), roomInfo.getBackPic(), null)
|
||||
.compose(RxHelper.bindActivity(activity))
|
||||
.subscribe((roomResult, throwable) -> {
|
||||
if (throwable != null) {
|
||||
onOpenRoomFail(activity, throwable.getMessage());
|
||||
} else if (roomResult != null && roomResult.isSuccess()) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_SUCCESS, roomInfo);
|
||||
} else if (roomResult != null && !roomResult.isSuccess()) {
|
||||
if (roomResult.getCode() == 1500) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM, roomInfo);
|
||||
} else {
|
||||
onOpenRoomFail(activity, roomResult.getError());
|
||||
}
|
||||
} else {
|
||||
onOpenRoomFail(activity, "未知错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求退出房间
|
||||
*/
|
||||
public static void requestExitRoom(BaseActivity activity, RoomInfo roomInfo) {
|
||||
AvRoomModel.get().exitRoom(new CallBack<RoomInfo>() {
|
||||
@Override
|
||||
public void onSuccess(RoomInfo data) {
|
||||
openRoom(activity, roomInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_FAIL, error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private static void onOpenRoomFail(BaseActivity activity, String error) {
|
||||
requestOpenRoomResult(activity, MainFragmentPresenter.OPEN_ROOM_FAIL, error);
|
||||
}
|
||||
|
||||
public static void requestOpenRoomResult(BaseActivity activity, int openRoomFailType, Object... arg) {
|
||||
activity.getDialogManager().dismissDialog();
|
||||
if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_SUCCESS) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(activity, roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_TYPE_IN_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
activity.getDialogManager().showProgressDialog(activity, "请稍后...");
|
||||
requestExitRoom(activity, roomInfo);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL) {
|
||||
String error = (String) arg[0];
|
||||
activity.toast(error);
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_ALREADY_OPENED_ROOM) {
|
||||
RoomInfo roomInfo = (RoomInfo) arg[0];
|
||||
AVRoomActivity.start(activity, roomInfo.getUid());
|
||||
} else if (openRoomFailType == MainFragmentPresenter.OPEN_ROOM_FAIL_PM_LIMIT_TIME) {
|
||||
if (activity instanceof MainActivity) {
|
||||
if (arg != null && arg.length > 0 && arg[0] instanceof String) {
|
||||
((MainActivity) activity).handleOpenRoomWhenPmLimit((String) arg[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -43,7 +43,7 @@
|
||||
android:paddingBottom="1dp"
|
||||
android:text="直播中"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_11"
|
||||
android:textSize="@dimen/dp_10"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
Reference in New Issue
Block a user