1.游戏模式去掉头饰 2.游戏中去掉升级弹窗
This commit is contained in:
@@ -112,6 +112,7 @@ import com.yizhuan.erban.ui.widget.MainTabLayout;
|
||||
import com.yizhuan.erban.ui.widget.RecallDialog;
|
||||
import com.yizhuan.erban.utils.CleanLeakUtils;
|
||||
import com.yizhuan.erban.utils.PushMessageHandler;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.UriProvider;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -211,12 +212,11 @@ import static com.yizhuan.xchat_android_core.channel_page.model.ChannelPageModel
|
||||
public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
implements MainTabLayout.OnTabClickListener, IMainView, View.OnClickListener {
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
|
||||
private static final String EXTRA_APP_QUIT = "APP_QUIT";
|
||||
public static final String MSG_TAB = "msgTab";
|
||||
public static final String GAME_TAB = "gameTab";
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
private static final String EXTRA_APP_QUIT = "APP_QUIT";
|
||||
private final SparseArray<Fragment> fragmentArray = new SparseArray<>();
|
||||
private DragLayout avatarLayout;
|
||||
private TextView tvName;//最小化窗口名称
|
||||
private TextView tvId;//最小化窗口ID
|
||||
@@ -224,10 +224,8 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
private LinearLayout llDragInfo;
|
||||
private LivingIconView userLivingView;
|
||||
private View viewClose;
|
||||
|
||||
private MainTabLayout mMainTabLayout;
|
||||
private int mCurrentMainPosition = MainTabLayout.MAIN_TAB_POS_HOME;
|
||||
|
||||
/**
|
||||
* 房间最小化动画,换成属性动画,原先的补间动画影响了activity的生命周期
|
||||
*/
|
||||
@@ -239,7 +237,34 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
private HomeViewModel homeViewModel;
|
||||
@Nullable
|
||||
private Fragment tempFragment = null;
|
||||
private final SparseArray<Fragment> fragmentArray = new SparseArray<>();
|
||||
private ContactEventListener listener1 = new ContactEventListener() {
|
||||
@Override
|
||||
public void onItemClick(Context context, String account) {
|
||||
NimP2PMessageActivity.start(context, account);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemLongClick(Context context, String account) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAvatarClick(Context context, String account) {
|
||||
UserInfoActivity.Companion.start(MainActivity.this, Long.parseLong(account));
|
||||
}
|
||||
};
|
||||
private SessionEventListener listener = new SessionEventListener() {
|
||||
@Override
|
||||
public void onAvatarClicked(Context context, IMMessage message) {
|
||||
if (message == null) return;
|
||||
UserInfoActivity.Companion.start(MainActivity.this, Long.parseLong(message.getFromAccount()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAvatarLongClicked(Context context, IMMessage message) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
{
|
||||
fragmentArray.put(MainTabLayout.MAIN_TAB_POS_HOME, new HomeFragment());
|
||||
@@ -435,37 +460,6 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
NimUIKit.setContactEventListener(listener1);
|
||||
}
|
||||
|
||||
private ContactEventListener listener1 = new ContactEventListener() {
|
||||
@Override
|
||||
public void onItemClick(Context context, String account) {
|
||||
NimP2PMessageActivity.start(context, account);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemLongClick(Context context, String account) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAvatarClick(Context context, String account) {
|
||||
UserInfoActivity.Companion.start(MainActivity.this, Long.parseLong(account));
|
||||
}
|
||||
};
|
||||
|
||||
private SessionEventListener listener = new SessionEventListener() {
|
||||
@Override
|
||||
public void onAvatarClicked(Context context, IMMessage message) {
|
||||
if (message == null) return;
|
||||
UserInfoActivity.Companion.start(MainActivity.this, Long.parseLong(message.getFromAccount()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAvatarLongClicked(Context context, IMMessage message) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -721,11 +715,13 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onReceiveLevelUpActivity(LevelUpEvent event) {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying()) return;
|
||||
LevelUpDialog.start(this, event.getLevelName(), true);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onReceiveCharmLevelUpActivity(CharmLevelUpEvent event) {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying()) return;
|
||||
LevelUpDialog.start(this, event.getLevelName(), false);
|
||||
}
|
||||
|
||||
|
@@ -56,6 +56,7 @@ import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.CustomImageSpan;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
import com.yizhuan.erban.home.adapter.FragmentViewPagerAdapter;
|
||||
import com.yizhuan.erban.ui.login.AddUserInfoActivity;
|
||||
import com.yizhuan.erban.ui.patriarch.help.LimitEnterRoomHelper;
|
||||
import com.yizhuan.erban.ui.pay.ChargeActivity;
|
||||
import com.yizhuan.erban.ui.user.UserInfoActivity;
|
||||
@@ -68,6 +69,7 @@ import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelThreeDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.AllServiceGiftLevelTwoDialog;
|
||||
import com.yizhuan.erban.ui.widget.dialog.MonsterDialog;
|
||||
import com.yizhuan.erban.ui.widget.marqueeview.Utils;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -1138,6 +1140,10 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
* @param body 信息实体
|
||||
*/
|
||||
protected void onReceivedGiftBroadcastMessage(String body) {
|
||||
|
||||
if (UserUtils.getUserInfo() == null ||
|
||||
AvRoomDataManager.get().isSelfGamePlaying())
|
||||
return;
|
||||
BaseProtocol baseProtocol;
|
||||
try {
|
||||
baseProtocol = JSON.parseObject(body, BaseProtocol.class);
|
||||
|
@@ -89,6 +89,7 @@ import com.yizhuan.xchat_android_core.manager.IMNetEaseManager
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel
|
||||
import com.yizhuan.xchat_android_core.mentoring_relationship.event.MentoringStopCountingEvent
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
@@ -233,6 +234,8 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
//游戏模式暂时不需要这个
|
||||
PlayerModel.get().stop()
|
||||
//如果不需要开麦,并且还没有权限的情况下,重置状态为需要去打开麦克风
|
||||
if (!AvRoomDataManager.get().mIsNeedOpenMic && !isHavingMicPermissions) {
|
||||
AvRoomDataManager.get().mIsNeedOpenMic = true
|
||||
@@ -671,12 +674,12 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
gameDelegate.onDestroy()
|
||||
super.onDestroyView()
|
||||
releaseView()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
gameDelegate.onDestroy()
|
||||
mDisposable?.dispose()
|
||||
mDisposable = null
|
||||
EventBus.getDefault().unregister(this)
|
||||
@@ -1036,7 +1039,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
override fun onSendMsgSuccess(msg: String?) {
|
||||
inputEdit.setText("")
|
||||
msg?.let {
|
||||
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().currentUid)) {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying) {
|
||||
gameDelegate.hitTheMark(msg)
|
||||
}
|
||||
}
|
||||
|
@@ -231,13 +231,13 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
gameMainBinding.tvCurrGame.setOnClickListener(v -> {
|
||||
if (gameMainBinding.rvGame.getVisibility() == View.VISIBLE) {
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
} else {
|
||||
if (AvRoomDataManager.get().isGamePlaying()) {
|
||||
SingleToastUtil.showToast("游戏中不可以切换游戏或玩法!");
|
||||
} else {
|
||||
gameMainBinding.rvGame.setVisibility(View.VISIBLE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -257,6 +257,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
mgId = JavaUtil.str2long(gameInfo.getMgId());
|
||||
}
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
gameMainBinding.ivChangeGameArrow.setImageResource(R.drawable.ic_room_arrow_type_below);
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
getBaseActivity(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
@@ -265,6 +266,8 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -388,6 +391,11 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
.replace(R.id.container, roomFragment)
|
||||
.commitAllowingStateLoss();
|
||||
|
||||
if (AvRoomDataManager.get().isRoomOwner() && currentRoomInfo.getIsPermitRoom() != 1) {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameMainBinding.llChangeGame.setVisibility(View.GONE);
|
||||
}
|
||||
gameMainBinding.setRoomInfo(currentRoomInfo);
|
||||
updateHasAnimationEffect();
|
||||
roomTitle.setText(RegexUtil.getPrintableString(currentRoomInfo.getTitle()));
|
||||
@@ -539,7 +547,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
ButtonItem buttonItem1 = new ButtonItem("退出房间", new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
getDialogManager().showOkCancelDialog("游戏中退出房间默认逃跑,确定进行此操作?", false,
|
||||
() -> ((AVRoomActivity) getActivity()).toBack());
|
||||
return;
|
||||
@@ -578,7 +586,7 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
ButtonItem buttonItem2 = new ButtonItem("最小化房间", new ButtonItem.OnClickListener() {
|
||||
@Override
|
||||
public void onClick() {
|
||||
if (AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
if (AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
getDialogManager().showOkCancelDialog("游戏中最小化房间默认逃跑,确定进行此操作?", false,
|
||||
() -> ((AVRoomActivity) getActivity()).toBack());
|
||||
return;
|
||||
|
@@ -191,6 +191,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
* @param keyWord
|
||||
*/
|
||||
private fun notifySelfTextHit(keyWord: String?, msg: String) {
|
||||
LogUtils.d("notifySelfTextHit")
|
||||
try {
|
||||
//状态名称
|
||||
val state: String = SudMGPAPPState.APP_COMMON_SELF_TEXT_HIT
|
||||
@@ -638,6 +639,8 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
notifySelfInState(false)
|
||||
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
|
||||
iSudFSTAPP?.destroyMG()
|
||||
}
|
||||
|
||||
|
@@ -182,7 +182,7 @@ public class GiftEffectView extends RelativeLayout implements SVGACallback {
|
||||
|
||||
private void drawSvgaEffect(String url) throws MalformedURLException {
|
||||
if (!AvRoomDataManager.get().mIsNeedGiftEffect ||
|
||||
AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
return;
|
||||
}
|
||||
SVGAParser.Companion.shareParser().decodeFromURL(new URL(url), new SVGAParser.ParseCompletion() {
|
||||
|
@@ -168,7 +168,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
|
||||
private void drawMagicAnimation(List<MagicReceivedInfo> magicReceivedInfos) {
|
||||
if (!AvRoomDataManager.get().mIsNeedGiftEffect ||
|
||||
AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
int totalCoin = 0;
|
||||
|
||||
if (AvRoomDataManager.get().mIsNeedGiftEffect &&
|
||||
!AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
!AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
SVGAImageView imageView = playLuckyBagAnim(svgaUrl);
|
||||
handler.postDelayed(() -> {
|
||||
removeView(imageView);
|
||||
@@ -601,7 +601,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
|
||||
private void drawMagicView(Point senderPoint, Point receivePoint, MagicReceivedInfo magicReceivedInfo) {
|
||||
if (!AvRoomDataManager.get().mIsNeedGiftEffect ||
|
||||
AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -671,7 +671,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
|
||||
|
||||
private void drawGiftView(Point senderPoint, Point receivePoint, GiftReceiveInfo giftReceiveInfo) {
|
||||
if (!AvRoomDataManager.get().mIsNeedGiftEffect ||
|
||||
AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
return;
|
||||
}
|
||||
if (giftReceiveInfo == null) {
|
||||
|
@@ -674,7 +674,7 @@ public class RoomEffectView extends FrameLayout {
|
||||
&& userInfo.getCarInfo().isUsing()
|
||||
&& userInfo.getCarInfo().getStatus() == CarInfo.STATUS_USER_CAN_USE) {
|
||||
if (AvRoomDataManager.get().mIsNeedGiftEffect &&
|
||||
!AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
!AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
mCarEffectList.add(userInfo.getCarInfo().getEffect());
|
||||
}
|
||||
// 非贵族人员,进来后要播放座驾动画
|
||||
@@ -704,7 +704,7 @@ public class RoomEffectView extends FrameLayout {
|
||||
} else {
|
||||
if (TextUtils.isEmpty(effect)) return;
|
||||
if (AvRoomDataManager.get().mIsNeedGiftEffect &&
|
||||
!AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
!AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
mCarEffectList.add(effect);
|
||||
}
|
||||
if (!binding.roomCarSvga.isAnimating() && !isSvgaPlaying) {
|
||||
@@ -722,7 +722,7 @@ public class RoomEffectView extends FrameLayout {
|
||||
private void playCarSvagEnterRoom(String effect) {
|
||||
if (TextUtils.isEmpty(effect)) return;
|
||||
if (!AvRoomDataManager.get().mIsNeedGiftEffect ||
|
||||
AvRoomDataManager.get().isGamePlaying(AuthModel.get().getCurrentUid())) {
|
||||
AvRoomDataManager.get().isSelfGamePlaying()) {
|
||||
return;
|
||||
}
|
||||
isSvgaPlaying = true;
|
||||
|
@@ -119,12 +119,23 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
implements IDataStatus, ConnectiveChangedReceiver.ConnectiveChangedListener,
|
||||
DialogManagerInterface {
|
||||
|
||||
private DialogManager mDialogManager;
|
||||
/**
|
||||
* --------------------------------------------------
|
||||
* -------------------------数据状态状态相关-------------
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
|
||||
protected static final String STATUS_TAG = "STATUS_TAG";
|
||||
private final RxPermissions rxPermissions = new RxPermissions(this);
|
||||
protected TitleBar mTitleBar;
|
||||
protected DefaultToolBar mToolBar;
|
||||
protected CompositeDisposable mCompositeDisposable;
|
||||
private BroadcastObserver broadcastObserver;
|
||||
protected Context context;
|
||||
protected volatile GrabApprenticesNoticeDialog dialog;
|
||||
private DialogManager mDialogManager;
|
||||
private BroadcastObserver broadcastObserver;
|
||||
private OpenNobleGlobalNoticeDialog mNoticeDialog;
|
||||
private boolean isShowingChargeDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -242,7 +253,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置沉浸式状态栏
|
||||
*/
|
||||
@@ -454,6 +464,13 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络连接变化
|
||||
*/
|
||||
/**
|
||||
* 网络连接变化
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param fragmentName Fragment.class.getName()
|
||||
*/
|
||||
@@ -469,7 +486,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
protected void updateBottomBar(boolean isShow) {
|
||||
|
||||
}
|
||||
@@ -515,12 +531,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
//GlideApp.with(this).pauseRequests();
|
||||
}
|
||||
|
||||
/**
|
||||
* 网络连接变化
|
||||
*/
|
||||
/**
|
||||
* 网络连接变化
|
||||
*/
|
||||
/**
|
||||
* wifi 转 2G/3G/4G
|
||||
*/
|
||||
@@ -566,15 +576,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
return UIUtils.checkActivityValid(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* --------------------------------------------------
|
||||
* -------------------------数据状态状态相关-------------
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
|
||||
protected static final String STATUS_TAG = "STATUS_TAG";
|
||||
|
||||
@Override
|
||||
public View.OnClickListener getLoadListener() {
|
||||
return new View.OnClickListener() {
|
||||
@@ -616,7 +617,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
showReload(0, bgColor);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showReload() {
|
||||
showReload(0, 0);
|
||||
@@ -863,9 +863,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
SingleToastUtil.showToast(toast);
|
||||
}
|
||||
|
||||
|
||||
private final RxPermissions rxPermissions = new RxPermissions(this);
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void checkPermission(PermissionActivity.CheckPermListener listener, int resString, String... mPerms) {
|
||||
/**
|
||||
@@ -950,7 +947,9 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
break;
|
||||
case CUSTOM_MSG_RED_PACKAGE:
|
||||
if (baseProtocol.getSecond() == CUSTOM_MSG_SUB_RED_PACKAGE_RECEIVE_ALL_DIAMOND) {
|
||||
if (this instanceof AddUserInfoActivity || UserUtils.getUserInfo() == null)
|
||||
if (this instanceof AddUserInfoActivity ||
|
||||
UserUtils.getUserInfo() == null ||
|
||||
AvRoomDataManager.get().isSelfGamePlaying())
|
||||
return;
|
||||
RedPackageNotifyInfo notifyInfo = new Gson().fromJson(String.valueOf(baseProtocol.getData()), RedPackageNotifyInfo.class);
|
||||
RoomInfo roomInfo = AvRoomDataManager.get().mCurrentRoomInfo;
|
||||
@@ -965,43 +964,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
private OpenNobleGlobalNoticeDialog mNoticeDialog;
|
||||
|
||||
private static class BroadcastObserver implements Observer<BroadcastMessage> {
|
||||
private final WeakReference<BaseActivity> mReference;
|
||||
|
||||
BroadcastObserver(BaseActivity baseMvpActivity) {
|
||||
mReference = new WeakReference<>(baseMvpActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(BroadcastMessage broadcastMessage) {
|
||||
if (broadcastMessage != null) {
|
||||
String contentStr = broadcastMessage.getContent();
|
||||
Logger.i("全局广播:" + contentStr);
|
||||
if (TextUtils.isEmpty(contentStr)) return;
|
||||
BaseActivity baseMvpActivity = mReference.get();
|
||||
if (baseMvpActivity == null) return;
|
||||
if (baseMvpActivity.isValid()) {
|
||||
JSONObject jsonObject;
|
||||
try {
|
||||
jsonObject = JSON.parseObject(contentStr);
|
||||
} catch (Exception e) {
|
||||
jsonObject = null;
|
||||
}
|
||||
if (jsonObject == null) return;
|
||||
if (jsonObject.containsKey("body")) {
|
||||
String body = jsonObject.getString("body");
|
||||
if (TextUtils.isEmpty(body)) return;
|
||||
baseMvpActivity.onReceivedNimBroadcastMessage(body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected volatile GrabApprenticesNoticeDialog dialog;
|
||||
|
||||
public void onGrabApprenticesEvent(GrabApprenticesEvent event) {
|
||||
if (!isTopActivity()) return;
|
||||
if (dialog != null && dialog.isAdded()) {
|
||||
@@ -1060,8 +1022,6 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean isShowingChargeDialog;
|
||||
|
||||
private void onNeedCharge() {
|
||||
if (isShowingChargeDialog) {
|
||||
return;
|
||||
@@ -1133,4 +1093,37 @@ public abstract class BaseActivity extends RxAppCompatActivity
|
||||
}, context);
|
||||
}
|
||||
|
||||
private static class BroadcastObserver implements Observer<BroadcastMessage> {
|
||||
private final WeakReference<BaseActivity> mReference;
|
||||
|
||||
BroadcastObserver(BaseActivity baseMvpActivity) {
|
||||
mReference = new WeakReference<>(baseMvpActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(BroadcastMessage broadcastMessage) {
|
||||
if (broadcastMessage != null) {
|
||||
String contentStr = broadcastMessage.getContent();
|
||||
Logger.i("全局广播:" + contentStr);
|
||||
if (TextUtils.isEmpty(contentStr)) return;
|
||||
BaseActivity baseMvpActivity = mReference.get();
|
||||
if (baseMvpActivity == null) return;
|
||||
if (baseMvpActivity.isValid()) {
|
||||
JSONObject jsonObject;
|
||||
try {
|
||||
jsonObject = JSON.parseObject(contentStr);
|
||||
} catch (Exception e) {
|
||||
jsonObject = null;
|
||||
}
|
||||
if (jsonObject == null) return;
|
||||
if (jsonObject.containsKey("body")) {
|
||||
String body = jsonObject.getString("body");
|
||||
if (TextUtils.isEmpty(body)) return;
|
||||
baseMvpActivity.onReceivedNimBroadcastMessage(body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB |
@@ -158,6 +158,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@@ -167,12 +168,13 @@
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="true"
|
||||
android:textColor="@color/white"
|
||||
tools:text="飞到敌人"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_change_game_arrow"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_height="10dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_room_arrow_type_below" />
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
android:layout_height="match_parent"
|
||||
app:riv_corner_radius="@dimen/dp_12"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_erban_grid_empty" />
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
|
||||
</com.yizhuan.erban.ui.widget.SquareLayout>
|
||||
|
@@ -52,30 +52,6 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="2dp"
|
||||
android:src="@drawable/icon_room_dating_vip"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="2dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cap"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="1.5dp"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_game_status"
|
||||
android:layout_width="40dp"
|
||||
|
@@ -53,13 +53,6 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head_wear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mute_image"
|
||||
android:layout_width="5dp"
|
||||
|
@@ -641,6 +641,13 @@ public final class AvRoomDataManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正在游戏中
|
||||
*/
|
||||
public boolean isSelfGamePlaying() {
|
||||
return isGamePlaying(AvRoomDataManager.get().getMicPosition(AuthModel.get().getCurrentUid()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正在游戏中
|
||||
*/
|
||||
|
Reference in New Issue
Block a user