移除HomePartyRoomFragment对HomePartyFragment的引用
This commit is contained in:
@@ -15,6 +15,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatImageView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
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.home.bean.BannerInfo;
|
||||
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.im.custom.bean.CustomAttachment;
|
||||
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 {
|
||||
|
||||
private HomePartyRoomFragment roomFragment;
|
||||
private Fragment roomFragment;
|
||||
|
||||
private TextView roomTitle;
|
||||
private TextView roomId;
|
||||
@@ -126,8 +128,10 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
roomTitle.setText("");
|
||||
setRoomId(0, 0);
|
||||
updateOnlineNumberView(0);
|
||||
if (roomFragment != null)
|
||||
roomFragment.onNewIntent(intent);
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((HomePartyRoomFragment) roomFragment).onNewIntent(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,7 +162,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
@Override
|
||||
public void onFindViews() {
|
||||
gameMainBinding = DataBindingUtil.bind(mView);
|
||||
gameMainBinding.ivKtvTreasureBox.setVisibility(View.GONE);
|
||||
roomTitle = mView.findViewById(R.id.room_title);
|
||||
setupRoomTitleMarquee();
|
||||
roomMore = mView.findViewById(R.id.room_more);
|
||||
@@ -211,7 +214,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
@Override
|
||||
public void initiate() {
|
||||
roomFragment = HomePartyRoomFragment.newInstance(isRoomMin);
|
||||
roomFragment.setParent(this);
|
||||
getChildFragmentManager().beginTransaction().replace(R.id.container, roomFragment).commitAllowingStateLoss();
|
||||
|
||||
if (!AvRoomDataManager.get().haveSelfChange && AvRoomDataManager.get().mCurrentRoomInfo != null) {
|
||||
@@ -383,8 +385,8 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
}
|
||||
|
||||
public void dismissSendRedPackageDialog() {
|
||||
if (roomFragment != null) {
|
||||
roomFragment.clearDialog();
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((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);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onShareRoomEvent(ShareRoomEvent event) {
|
||||
shareRoom();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享房间
|
||||
@@ -549,8 +555,8 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
|
||||
@Override
|
||||
public void onShowActivity(List<BannerInfo> dialogInfos) {
|
||||
if (roomFragment != null && roomFragment.isAdded()) {
|
||||
roomFragment.showActivity(dialogInfos);
|
||||
if (roomFragment instanceof HomePartyRoomFragment && roomFragment.isAdded()) {
|
||||
((HomePartyRoomFragment) roomFragment).showActivity(dialogInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,30 +633,9 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
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() {
|
||||
if (roomFragment != null) {
|
||||
roomFragment.dismissGiftDialog();
|
||||
if (roomFragment instanceof HomePartyRoomFragment) {
|
||||
((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.GiftMultiReceiverInfo;
|
||||
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.RoomFollowOwnerAttachment;
|
||||
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;
|
||||
private static final int MINI_WORLD_REQUEST_CODE = 101;
|
||||
HomePartyFragment parentFragment;
|
||||
private long myUid;
|
||||
private UserInfo roomOwnner;
|
||||
private MessageView messageView;
|
||||
@@ -299,10 +299,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
}
|
||||
|
||||
public void setParent(HomePartyFragment homePartyFragment) {
|
||||
this.parentFragment = homePartyFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
return R.layout.fragment_av_room_game;
|
||||
@@ -1878,9 +1874,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
@Override
|
||||
public void onShareRoom(PKMicQueueDialog micQueueDialog) {
|
||||
micQueueDialog.dismiss();
|
||||
if (parentFragment != null) {
|
||||
parentFragment.shareRoom();
|
||||
}
|
||||
EventBus.getDefault().post(new ShareRoomEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2022,7 +2016,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
|
||||
setActViewVisibility(View.INVISIBLE);
|
||||
|
||||
// gameBinding.activityImg.setVisibility(View.GONE);
|
||||
if (musicPlayerView != null) {
|
||||
musicPlayerView.setVisibility(View.GONE);
|
||||
int state = PlayerModel.get().getState();
|
||||
@@ -2031,10 +2024,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
}
|
||||
}
|
||||
setDragonView();
|
||||
//显示ktv的宝箱
|
||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
||||
((HomePartyFragment) getParentFragment()).showKtvBox();
|
||||
}
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -2054,10 +2043,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
gameBinding.contributeList.setVisibility(View.VISIBLE);
|
||||
stvKtvSong.setVisibility(View.GONE);
|
||||
setToMiniWorldVisible(true);
|
||||
|
||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
||||
((HomePartyFragment) getParentFragment()).hideKtvBox();
|
||||
}
|
||||
if (!isGameMode && !isKtvMode) {
|
||||
changeModelShowView();
|
||||
}
|
||||
@@ -2095,10 +2080,6 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
});
|
||||
|
||||
if (getParentFragment() != null && getParentFragment() instanceof HomePartyFragment) {
|
||||
((HomePartyFragment) getParentFragment()).hideKtvBox();
|
||||
}
|
||||
|
||||
setActViewVisibility(View.VISIBLE);
|
||||
if (AvRoomDataManager.get().isOnMic(myUid)) {
|
||||
if (musicPlayerView == null) {
|
||||
@@ -2671,7 +2652,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
micQueueDialog.setActionListener(new MicQueueDialog.OnActionListener() {
|
||||
@Override
|
||||
public void onShareRoom(MicQueueDialog micQueueDialog) {
|
||||
parentFragment.shareRoom();
|
||||
EventBus.getDefault().post(new ShareRoomEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1162,7 +1162,6 @@ public class MessageView extends FrameLayout {
|
||||
.append(" " + nick + " ", new OriginalDrawStatusClickSpan() {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
SingleToastUtil.showToast("加入");
|
||||
new UserInfoDialog(mContext, userInfo.getUid()).show();
|
||||
}
|
||||
}, new ForegroundColorSpan(roomTipNickColor))
|
||||
|
@@ -29,7 +29,6 @@
|
||||
android:layout_alignBottom="@+id/ll_room_info"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:padding="10dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/arrow_left_white" />
|
||||
@@ -118,8 +117,8 @@
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_follow_room"
|
||||
@@ -137,7 +136,6 @@
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/room_more"
|
||||
android:layout_width="42dp"
|
||||
@@ -174,17 +172,6 @@
|
||||
android:layout_below="@+id/ll_room_info"
|
||||
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
|
||||
android:id="@+id/vs_gift_view"
|
||||
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