小遊戲修改
This commit is contained in:
@@ -64,11 +64,13 @@ import com.yunbao.common.dialog.YoursystemisolderDialog;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.GiftWallIlluminateEvent;
|
||||
import com.yunbao.common.event.HideShowEvent;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.event.LiveErrorEvent;
|
||||
import com.yunbao.common.event.LiveOpenSudRoomEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.NewRoleCustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.ShowHideEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -95,6 +97,7 @@ import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.CustomDrawerPopupView;
|
||||
import com.yunbao.common.views.HintCustomPopup;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.VerticalViewPager;
|
||||
import com.yunbao.live.R;
|
||||
@@ -562,22 +565,59 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
MobclickAgent.onEvent(mContext, "live_room_close", "退出直播间");
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
try {
|
||||
manager.onBackPressed();
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else {
|
||||
manager.onRemove(true);
|
||||
if (manager != null && manager.getsudGameMin()) {
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new HintCustomPopup(mContext,
|
||||
mContext.getString(com.yunbao.common.R.string.dialog_tip),
|
||||
mContext.getString(com.yunbao.common.R.string.the_live_room))
|
||||
.setLiveOpenOk(mContext.getString(com.yunbao.common.R.string.confirm))
|
||||
.setLiveOpenCancel(mContext.getString(com.yunbao.common.R.string.cancel))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
MobclickAgent.onEvent(mContext, "live_room_close", "退出直播间");
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
try {
|
||||
manager.onBackPressed();
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else {
|
||||
manager.onRemove(true);
|
||||
|
||||
}
|
||||
Bus.get().post(new HideShowEvent().setClose(true));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
MobclickAgent.onEvent(mContext, "live_room_close", "退出直播间");
|
||||
OpenAdManager.getInstance().dismiss();
|
||||
try {
|
||||
manager.onBackPressed();
|
||||
if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_REQUEST) {
|
||||
manager.micIngTypeOne(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else if (MicStatusManager.getInstance().getMicStatus() == MicStatusManager.MIC_TYPE_OPEN) {
|
||||
manager.micIngTypeTwo(mLiveBean, mLiveType, mLiveTypeVal);
|
||||
} else {
|
||||
manager.onRemove(true);
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void end() {
|
||||
@@ -737,33 +777,38 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
|
||||
LiveBean liveBean = e.getLiveBean();
|
||||
if (TextUtils.equals(mLiveUid, liveBean.getUid())) {
|
||||
ToastUtil.show(mContext.getString(R.string.current_live_room));
|
||||
} else {
|
||||
if (e.isLiveEnd()) {
|
||||
manager.removeLiveEnd();
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (liveBean != null) {
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
||||
manager.onRemove(false);
|
||||
mLiveType = e.getLiveType();
|
||||
mLiveTypeVal = e.getLiveTypeVal();
|
||||
mLiveBean = liveBean;
|
||||
mLiveUid = liveBean.getUid();
|
||||
mStream = liveBean.getStream();
|
||||
mAncherName = liveBean.getUserNiceName();
|
||||
mAncherIcon = liveBean.getAvatar();
|
||||
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||
if (manager!=null&&manager.getsudGameMin()){
|
||||
ToastUtil.show(WordUtil.isNewZh()?"小遊戲進行中,無法切換直播間":"Game in progress, unable to switch to live room");
|
||||
}else {
|
||||
LiveBean liveBean = e.getLiveBean();
|
||||
if (TextUtils.equals(mLiveUid, liveBean.getUid())) {
|
||||
ToastUtil.show(mContext.getString(R.string.current_live_room));
|
||||
} else {
|
||||
if (e.isLiveEnd()) {
|
||||
manager.removeLiveEnd();
|
||||
}
|
||||
if (LiveRoomViewHolder.mHandler != null) {
|
||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
if (liveBean != null) {
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);
|
||||
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
|
||||
manager.onRemove(false);
|
||||
mLiveType = e.getLiveType();
|
||||
mLiveTypeVal = e.getLiveTypeVal();
|
||||
mLiveBean = liveBean;
|
||||
mLiveUid = liveBean.getUid();
|
||||
mStream = liveBean.getStream();
|
||||
mAncherName = liveBean.getUserNiceName();
|
||||
mAncherIcon = liveBean.getAvatar();
|
||||
manager.onAdd(liveBean, mLiveType, mLiveTypeVal, mLiveSDK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1124,7 +1169,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
break;
|
||||
case GUARD:
|
||||
if (event.getObject() == null) {
|
||||
openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity); } else {
|
||||
openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity);
|
||||
} else {
|
||||
openNewBuyGuardWindow(true);
|
||||
}
|
||||
break;
|
||||
@@ -1593,7 +1639,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1647,6 +1693,19 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onShowHideEvent(ShowHideEvent event) {
|
||||
if (manager != null) {
|
||||
manager.onShowHideEvent();
|
||||
verticalViewPager.setEnableScroll(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onHideShow(HideShowEvent event) {
|
||||
verticalViewPager.setEnableScroll(true);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveOpenSudRoomEvent(LiveOpenSudRoomEvent liveOpenSudRoomEvent) {
|
||||
if (manager != null) {
|
||||
@@ -1734,7 +1793,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getRedPoint()) {
|
||||
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.AnchorInfoEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.common.event.HideShowEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.API;
|
||||
@@ -666,6 +667,19 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
return R.layout.view_live_room;
|
||||
}
|
||||
|
||||
private View sudGameMin;
|
||||
|
||||
public void onShowHideEvent() {
|
||||
sudGameMin = findViewById(R.id.sud_game_min);
|
||||
sudGameMin.setVisibility(View.VISIBLE);
|
||||
ViewClicksAntiShake.clicksAntiShake(sudGameMin, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new HideShowEvent().setClose(false));
|
||||
sudGameMin.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一秒钟的时间
|
||||
@@ -3050,7 +3064,29 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
MobclickAgent.onEvent(mContext, "live_room_noble", "贵族按钮");
|
||||
((LiveActivity) mContext).openUserMoreListWindow(1, false, true, mContext instanceof LiveRyAnchorActivity);
|
||||
} else if (i == R.id.btn_close) {
|
||||
// if (sudGameMin!=null&&sudGameMin.getVisibility()==View.VISIBLE) {
|
||||
// new XPopup.Builder(mContext)
|
||||
// .asCustom(new HintCustomPopup(mContext,
|
||||
// mContext.getString(com.yunbao.common.R.string.dialog_tip),
|
||||
// mContext.getString(com.yunbao.common.R.string.the_live_room))
|
||||
// .setLiveOpenOk( mContext.getString(com.yunbao.common.R.string.confirm))
|
||||
// .setLiveOpenCancel( mContext.getString(com.yunbao.common.R.string.cancel))
|
||||
// .setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
// @Override
|
||||
// public void onSure() {
|
||||
// close();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onCancel() {
|
||||
//
|
||||
//
|
||||
// }
|
||||
// })).show();
|
||||
// } else {
|
||||
close();
|
||||
// }
|
||||
|
||||
//小屏
|
||||
} else if (i == R.id.btn_noble) {
|
||||
((LiveActivity) mContext).openLuckGiftTip();
|
||||
@@ -3067,6 +3103,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
public boolean getsudGameMin() {
|
||||
return sudGameMin != null && sudGameMin.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 私信的切换动画
|
||||
*
|
||||
|
||||
@@ -216,6 +216,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
this.createSudRoomModel = createSudRoomModel;
|
||||
}
|
||||
|
||||
public void onShowHideEvent() {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.onShowHideEvent();
|
||||
}
|
||||
}
|
||||
|
||||
public PortraitLiveManager(Activity context, Intent intent) {
|
||||
this.mContext = context;
|
||||
this.mIntent = intent;
|
||||
@@ -1630,6 +1636,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getsudGameMin() {
|
||||
return mLiveRoomViewHolder != null && mLiveRoomViewHolder.getsudGameMin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHourRank(LiveChatBean bean, JSONObject ranks) {
|
||||
if (mLiveRoomViewHolder != null && !TextUtils.isEmpty(liveID) && ranks != null) {
|
||||
|
||||
@@ -1059,11 +1059,11 @@
|
||||
android:id="@+id/iv_look"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="24dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:layout_marginRight="12dp"
|
||||
android:background="@drawable/bg_all_server_icon"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/live_onlookers"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
@@ -2239,6 +2239,33 @@
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sud_game_min"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@mipmap/background_sud_game_float"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:src="@mipmap/icon_sud_game_min" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="@string/sud_in_game"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.ms.banner.Banner
|
||||
android:id="@+id/top_banner2"
|
||||
android:layout_width="52dp"
|
||||
@@ -2455,7 +2482,6 @@
|
||||
android:id="@+id/sud_text_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="21dp"
|
||||
android:layout_marginEnd="21dp"
|
||||
@@ -2467,5 +2493,6 @@
|
||||
android:paddingBottom="8dp"
|
||||
android:text="主播創建了【游戲名】房間,快來與主播同玩~"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
Reference in New Issue
Block a user