移除HomePartyRoomFragment对HomePartyFragment的引用
This commit is contained in:
@@ -15,6 +15,7 @@ import android.widget.TextView;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||||
@@ -43,6 +44,7 @@ import com.yizhuan.xchat_android_core.gift.bean.LuckyBagGifts;
|
|||||||
import com.yizhuan.xchat_android_core.gift.bean.MultiGiftReceiveInfo;
|
import com.yizhuan.xchat_android_core.gift.bean.MultiGiftReceiveInfo;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||||
import com.yizhuan.xchat_android_core.home.event.FollowRoomEvent;
|
import com.yizhuan.xchat_android_core.home.event.FollowRoomEvent;
|
||||||
|
import com.yizhuan.xchat_android_core.home.event.ShareRoomEvent;
|
||||||
import com.yizhuan.xchat_android_core.home.model.CollectionRoomModel;
|
import com.yizhuan.xchat_android_core.home.model.CollectionRoomModel;
|
||||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomInfoAttachment;
|
import com.yizhuan.xchat_android_core.im.custom.bean.RoomInfoAttachment;
|
||||||
@@ -83,7 +85,7 @@ import io.reactivex.functions.Action;
|
|||||||
*/
|
*/
|
||||||
public class HomePartyFragment extends AbsRoomFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
public class HomePartyFragment extends AbsRoomFragment implements View.OnClickListener, ShareDialog.OnShareDialogItemClick {
|
||||||
|
|
||||||
private HomePartyRoomFragment roomFragment;
|
private Fragment roomFragment;
|
||||||
|
|
||||||
private TextView roomTitle;
|
private TextView roomTitle;
|
||||||
private TextView roomId;
|
private TextView roomId;
|
||||||
@@ -126,8 +128,10 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
roomTitle.setText("");
|
roomTitle.setText("");
|
||||||
setRoomId(0, 0);
|
setRoomId(0, 0);
|
||||||
updateOnlineNumberView(0);
|
updateOnlineNumberView(0);
|
||||||
if (roomFragment != null)
|
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||||
roomFragment.onNewIntent(intent);
|
((HomePartyRoomFragment) roomFragment).onNewIntent(intent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -158,7 +162,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void onFindViews() {
|
public void onFindViews() {
|
||||||
gameMainBinding = DataBindingUtil.bind(mView);
|
gameMainBinding = DataBindingUtil.bind(mView);
|
||||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE);
|
|
||||||
roomTitle = mView.findViewById(R.id.room_title);
|
roomTitle = mView.findViewById(R.id.room_title);
|
||||||
setupRoomTitleMarquee();
|
setupRoomTitleMarquee();
|
||||||
roomMore = mView.findViewById(R.id.room_more);
|
roomMore = mView.findViewById(R.id.room_more);
|
||||||
@@ -211,7 +214,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
@Override
|
@Override
|
||||||
public void initiate() {
|
public void initiate() {
|
||||||
roomFragment = HomePartyRoomFragment.newInstance(isRoomMin);
|
roomFragment = HomePartyRoomFragment.newInstance(isRoomMin);
|
||||||
roomFragment.setParent(this);
|
|
||||||
getChildFragmentManager().beginTransaction().replace(R.id.container, roomFragment).commitAllowingStateLoss();
|
getChildFragmentManager().beginTransaction().replace(R.id.container, roomFragment).commitAllowingStateLoss();
|
||||||
|
|
||||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||||
@@ -383,8 +385,8 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dismissSendRedPackageDialog() {
|
public void dismissSendRedPackageDialog() {
|
||||||
if (roomFragment != null) {
|
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||||
roomFragment.clearDialog();
|
((HomePartyRoomFragment) roomFragment).clearDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +424,10 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
tvFollowRoom.setBackgroundResource(AvRoomDataManager.get().isRoomFans ? R.drawable.bg_room_follow_room_collected : R.drawable.bg_room_follow_room);
|
tvFollowRoom.setBackgroundResource(AvRoomDataManager.get().isRoomFans ? R.drawable.bg_room_follow_room_collected : R.drawable.bg_room_follow_room);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onShareRoomEvent(ShareRoomEvent event) {
|
||||||
|
shareRoom();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分享房间
|
* 分享房间
|
||||||
@@ -549,8 +555,8 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShowActivity(List<BannerInfo> dialogInfos) {
|
public void onShowActivity(List<BannerInfo> dialogInfos) {
|
||||||
if (roomFragment != null && roomFragment.isAdded()) {
|
if (roomFragment instanceof HomePartyRoomFragment && roomFragment.isAdded()) {
|
||||||
roomFragment.showActivity(dialogInfos);
|
((HomePartyRoomFragment) roomFragment).showActivity(dialogInfos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,30 +633,9 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
|||||||
giftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo);
|
giftView.onReceiveMultiMagicMsg(multiMagicReceivedInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
public void showKtvBox() {
|
|
||||||
GoldBoxHelper.isHideBox().subscribe(hide -> {
|
|
||||||
if (hide != null && !hide) {
|
|
||||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.VISIBLE);
|
|
||||||
gameMainBinding.ivKtvTreasureBox.setOnClickListener(v -> {
|
|
||||||
if (roomFragment != null) {
|
|
||||||
roomFragment.onClickBox();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}, throwable -> gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hideKtvBox() {
|
|
||||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dismissGiftDialog() {
|
public void dismissGiftDialog() {
|
||||||
if (roomFragment != null) {
|
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||||
roomFragment.dismissGiftDialog();
|
((HomePartyRoomFragment) roomFragment).dismissGiftDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,6 +122,7 @@ import com.yizhuan.xchat_android_core.gift.GiftModel;
|
|||||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
|
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo;
|
||||||
import com.yizhuan.xchat_android_core.gift.bean.GiftMultiReceiverInfo;
|
import com.yizhuan.xchat_android_core.gift.bean.GiftMultiReceiverInfo;
|
||||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||||
|
import com.yizhuan.xchat_android_core.home.event.ShareRoomEvent;
|
||||||
import com.yizhuan.xchat_android_core.im.custom.bean.JoinMiniWorldAttachment;
|
import com.yizhuan.xchat_android_core.im.custom.bean.JoinMiniWorldAttachment;
|
||||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment;
|
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment;
|
||||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2;
|
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2;
|
||||||
@@ -213,7 +214,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
|
|
||||||
public static final int SHOW_JOIN_MINI_WORLD_TIME = 2 * 60 * 1000;
|
public static final int SHOW_JOIN_MINI_WORLD_TIME = 2 * 60 * 1000;
|
||||||
private static final int MINI_WORLD_REQUEST_CODE = 101;
|
private static final int MINI_WORLD_REQUEST_CODE = 101;
|
||||||
HomePartyFragment parentFragment;
|
|
||||||
private long myUid;
|
private long myUid;
|
||||||
private UserInfo roomOwnner;
|
private UserInfo roomOwnner;
|
||||||
private MessageView messageView;
|
private MessageView messageView;
|
||||||
@@ -299,10 +299,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParent(HomePartyFragment homePartyFragment) {
|
|
||||||
this.parentFragment = homePartyFragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRootLayoutId() {
|
public int getRootLayoutId() {
|
||||||
return R.layout.fragment_av_room_game;
|
return R.layout.fragment_av_room_game;
|
||||||
@@ -1878,9 +1874,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
@Override
|
@Override
|
||||||
public void onShareRoom(PKMicQueueDialog micQueueDialog) {
|
public void onShareRoom(PKMicQueueDialog micQueueDialog) {
|
||||||
micQueueDialog.dismiss();
|
micQueueDialog.dismiss();
|
||||||
if (parentFragment != null) {
|
EventBus.getDefault().post(new ShareRoomEvent());
|
||||||
parentFragment.shareRoom();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -2022,7 +2016,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
|
|
||||||
setActViewVisibility(View.INVISIBLE);
|
setActViewVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
// gameBinding.activityImg.setVisibility(View.GONE);
|
|
||||||
if (musicPlayerView != null) {
|
if (musicPlayerView != null) {
|
||||||
musicPlayerView.setVisibility(View.GONE);
|
musicPlayerView.setVisibility(View.GONE);
|
||||||
int state = PlayerModel.get().getState();
|
int state = PlayerModel.get().getState();
|
||||||
@@ -2031,10 +2024,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
setDragonView();
|
setDragonView();
|
||||||
//显示ktv的宝箱
|
|
||||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
|
||||||
((HomePartyFragment) getParentFragment()).showKtvBox();
|
|
||||||
}
|
|
||||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2054,10 +2043,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||||
stvKtvSong.setVisibility(View.GONE);
|
stvKtvSong.setVisibility(View.GONE);
|
||||||
setToMiniWorldVisible(true);
|
setToMiniWorldVisible(true);
|
||||||
|
|
||||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
|
||||||
((HomePartyFragment) getParentFragment()).hideKtvBox();
|
|
||||||
}
|
|
||||||
if (!isGameMode && !isKtvMode) {
|
if (!isGameMode && !isKtvMode) {
|
||||||
changeModelShowView();
|
changeModelShowView();
|
||||||
}
|
}
|
||||||
@@ -2095,10 +2080,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
|
||||||
((HomePartyFragment) getParentFragment()).hideKtvBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
setActViewVisibility(View.VISIBLE);
|
setActViewVisibility(View.VISIBLE);
|
||||||
if (AvRoomDataManager.get().isOnMic(myUid)) {
|
if (AvRoomDataManager.get().isOnMic(myUid)) {
|
||||||
if (musicPlayerView == null) {
|
if (musicPlayerView == null) {
|
||||||
@@ -2671,7 +2652,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
micQueueDialog.setActionListener(new MicQueueDialog.OnActionListener() {
|
micQueueDialog.setActionListener(new MicQueueDialog.OnActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onShareRoom(MicQueueDialog micQueueDialog) {
|
public void onShareRoom(MicQueueDialog micQueueDialog) {
|
||||||
parentFragment.shareRoom();
|
EventBus.getDefault().post(new ShareRoomEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1162,7 +1162,6 @@ public class MessageView extends FrameLayout {
|
|||||||
.append(" " + nick + " ", new OriginalDrawStatusClickSpan() {
|
.append(" " + nick + " ", new OriginalDrawStatusClickSpan() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(@NonNull View widget) {
|
public void onClick(@NonNull View widget) {
|
||||||
SingleToastUtil.showToast("加入");
|
|
||||||
new UserInfoDialog(mContext, userInfo.getUid()).show();
|
new UserInfoDialog(mContext, userInfo.getUid()).show();
|
||||||
}
|
}
|
||||||
}, new ForegroundColorSpan(roomTipNickColor))
|
}, new ForegroundColorSpan(roomTipNickColor))
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
android:layout_alignBottom="@+id/ll_room_info"
|
android:layout_alignBottom="@+id/ll_room_info"
|
||||||
android:layout_marginStart="@dimen/dp_5"
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
android:layout_marginTop="30dp"
|
android:layout_marginTop="30dp"
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/arrow_left_white" />
|
android:src="@drawable/arrow_left_white" />
|
||||||
@@ -118,8 +117,8 @@
|
|||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_follow_room"
|
android:id="@+id/tv_follow_room"
|
||||||
@@ -137,7 +136,6 @@
|
|||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/room_more"
|
android:id="@+id/room_more"
|
||||||
android:layout_width="42dp"
|
android:layout_width="42dp"
|
||||||
@@ -174,17 +172,6 @@
|
|||||||
android:layout_below="@+id/ll_room_info"
|
android:layout_below="@+id/ll_room_info"
|
||||||
android:layout_marginTop="4dp" />
|
android:layout_marginTop="4dp" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_ktv_treasure_box"
|
|
||||||
android:layout_width="42dp"
|
|
||||||
android:layout_height="42dp"
|
|
||||||
android:layout_alignTop="@id/room_more"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginTop="38dp"
|
|
||||||
android:layout_marginEnd="@dimen/dp_13"
|
|
||||||
android:src="@drawable/icon_room_treasure_box"
|
|
||||||
tools:contentDescription="ktv开宝箱" />
|
|
||||||
|
|
||||||
<ViewStub
|
<ViewStub
|
||||||
android:id="@+id/vs_gift_view"
|
android:id="@+id/vs_gift_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.home.event;
|
||||||
|
|
||||||
|
public class ShareRoomEvent {
|
||||||
|
}
|
Reference in New Issue
Block a user