趣味活动

This commit is contained in:
18401019693
2022-11-10 16:41:27 +08:00
parent e2f8e52583
commit 752fae680c
8 changed files with 231 additions and 65 deletions

View File

@@ -85,6 +85,7 @@ import com.yunbao.live.dialog.LiveGameDialogFragment;
import com.yunbao.live.dialog.LiveGiftDialogFragment;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveMicUserDialogFragment;
import com.yunbao.live.dialog.LiveTotalDialog;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
import com.yunbao.live.dialog.SignDialogFragment;
import com.yunbao.live.event.LinkMicTxAccEvent;
@@ -692,91 +693,138 @@ public class LiveAudienceActivity extends LiveActivity {
Bundle bundle = new Bundle();
Log.i("SocketRyClient", "onOpenDrawer: " + event.getType() + " " + event);
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
CustomDrawerPopupView customDrawerPopupView = new CustomDrawerPopupView(mContext).setList(list);
customDrawerPopupView.setCallBack(new CustomDrawerPopupView.CustomDrawerPopupCallBack() {
@Override
public void goToLive(AnchorRecommendItemModel model) {
//获取直播间状态
LiveHttpUtil.getLiveInfo(model.getUid(), liveInfo);
customDrawerPopupView.dismiss();
}
@Override
public void informationTransfer(CustomDrawerPopupEvent event) {
//跳转贵族
if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.noble))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.NOBLE));
//跳转守护
} else if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.guard_guard))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.GUARD));
//跳转粉丝团
} else if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.fan_club))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.FAN_CLUB));
}
}
});
switch (event.getType()) {
case SIDEBAR:
case BOTTOM_COLLECTION:
new XPopup.Builder(mContext)
.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Right)//右边
.hasStatusBarShadow(true) //启用状态栏阴影
.setPopupCallback(new XPopupCallback() {
@Override
public void onCreated(BasePopupView popupView) {
if (event.isActivity()) {
LiveTotalDialog liveTotalDialog = new LiveTotalDialog();
liveTotalDialog.setAnchorBean(mLiveBean);
Bundle liveBundle = new Bundle();
liveBundle.putBoolean("isActivity", event.isActivity());
liveTotalDialog.setArguments(liveBundle);
liveTotalDialog.show(getSupportFragmentManager(), "LiveTotalDialog");
} else {
int userIndex = -1;
for (int i = 0; i < list.size(); i++) {
if (TextUtils.equals(list.get(i).getUid(), PortraitLiveManager.liveID)) {
userIndex = i;
}
}
if (userIndex != -1) {
list.remove(userIndex);
}
CustomDrawerPopupView customDrawerPopupView = new CustomDrawerPopupView(mContext).setList(list).setLiveId(mLiveBean.getUid());
customDrawerPopupView.setCallBack(new CustomDrawerPopupView.CustomDrawerPopupCallBack() {
@Override
public void funGamesID(int zfunGamesID) {
if (zfunGamesID != 0) {
LiveGameDialogFragment fragment = new LiveGameDialogFragment();
fragment.setActivityId(zfunGamesID);
fragment.setRoomId(mLiveUid);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment");
} else {
}
}
@Override
public void beforeShow(BasePopupView popupView) {
@Override
public void goToLive(AnchorRecommendItemModel model) {
//获取直播间状态
LiveHttpUtil.getLiveInfo(model.getUid(), liveInfo);
customDrawerPopupView.dismiss();
}
@Override
public void informationTransfer(CustomDrawerPopupEvent event) {
//跳转贵族
if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.noble))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.NOBLE));
//跳转守护
} else if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.guard_guard))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.GUARD));
//跳转粉丝团
} else if (TextUtils.equals(event.getRightsInterests(), getString(com.yunbao.common.R.string.fan_club))) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.FAN_CLUB));
}
}
@Override
public void onShow(BasePopupView popupView) {
@Override
public void showerHtml(String htmlUrl, boolean screen) {
if (!screen) {
ZhuangBanActivity.forward(mContext, htmlUrl, false);
} else {
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl);
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
}
});
new XPopup.Builder(mContext)
.hasShadowBg(false)
.isDestroyOnDismiss(true)
.isLightStatusBar(false)
.popupPosition(PopupPosition.Right)//右边
.hasStatusBarShadow(true) //启用状态栏阴影
.setPopupCallback(new XPopupCallback() {
@Override
public void onCreated(BasePopupView popupView) {
@Override
public void onDismiss(BasePopupView popupView) {
getDrawer();
}
}
@Override
public void beforeDismiss(BasePopupView popupView) {
@Override
public void beforeShow(BasePopupView popupView) {
}
}
@Override
public boolean onBackPressed(BasePopupView popupView) {
return false;
}
@Override
public void onShow(BasePopupView popupView) {
@Override
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
}
}
@Override
public void onDismiss(BasePopupView popupView) {
getDrawer();
}
@Override
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
@Override
public void beforeDismiss(BasePopupView popupView) {
}
}
@Override
public void onClickOutside(BasePopupView popupView) {
@Override
public boolean onBackPressed(BasePopupView popupView) {
return false;
}
@Override
public void onKeyBoardStateChanged(BasePopupView popupView, int height) {
}
@Override
public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) {
}
@Override
public void onClickOutside(BasePopupView popupView) {
}
})
.asCustom(customDrawerPopupView)
.show();
}
}
})
.asCustom(customDrawerPopupView)
.show();
break;
case GIFT_POPUP:
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
return;
}
@@ -1102,7 +1150,6 @@ public class LiveAudienceActivity extends LiveActivity {
slideInfoModels.clear();
List<AnchorRecommendItemModel> models = anchorRecommendModel.getList();
models.add(0, new AnchorRecommendItemModel());
list.addAll(models);
slideInfoModels = anchorRecommendModel.getSlide();
}