[Modify]个播房ui调整

This commit is contained in:
15876
2023-03-03 20:44:09 +08:00
parent fc659bae31
commit 38413ded19
4 changed files with 83 additions and 77 deletions

View File

@@ -38,7 +38,6 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
import com.yizhuan.xchat_android_core.manager.RoomEvent
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
import com.yizhuan.xchat_android_core.user.UserModel
import com.yizhuan.xchat_android_core.user.bean.UserInfo
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter
import org.greenrobot.eventbus.Subscribe
@@ -85,11 +84,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
super.initiate()
mvpPresenter?.getBannerList()
initSpeedyMessage(gameBinding.flSpeedyMessage)
UserModel.get().currentUserInfo
.compose(bindToLifecycle())
.subscribe { userInfo ->
gameBinding.ivFirstChargeEnter.isVisible = userInfo.isFirstCharge
}
// UserModel.get().currentUserInfo
// .compose(bindToLifecycle())
// .subscribe { userInfo ->
// gameBinding.ivFirstChargeEnter.isVisible = userInfo.isFirstCharge
// }
GoldBoxHelper.isHideBox().subscribe(
{
if (it == false) {

View File

@@ -3,7 +3,9 @@ package com.yizhuan.erban.avroom.presenter;
import android.annotation.SuppressLint;
import com.yizhuan.erban.avroom.view.ISingleRoomView;
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
import com.yizhuan.erban.utils.UserUtils;
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
/**
* <p> </p>
@@ -18,7 +20,38 @@ public class SingleRoomPresenter extends BaseRoomPresenter<ISingleRoomView> {
mAvRoomModel.getRoomBanner()
.compose(bindToLifecycle())
.subscribe(bannerInfos -> {
getMvpView().onShowBanner(bannerInfos);
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
if (GoldBoxHelper.needIntegrateBoxEntrance()) {
if (firstCharge) {
BannerInfo bannerInfo = new BannerInfo();
bannerInfo.setFirstCharge(true);
bannerInfos.add(0, bannerInfo);
}
if (GoldBoxHelper.isShowRadish()) {
BannerInfo bannerInfo = new BannerInfo();
bannerInfo.setRadish(true);
bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
}
GoldBoxHelper.isHideBox()
.subscribe(isHide -> {
if (!isHide) {
BannerInfo bannerInfo = new BannerInfo();
bannerInfo.setBox(true);
int index = 0;
if (firstCharge) index++;
if (GoldBoxHelper.isShowRadish()) index++;
bannerInfos.add(index, bannerInfo);
}
getMvpView().onShowBanner(bannerInfos);
}, throwable -> getMvpView().onShowBanner(bannerInfos));
} else {
if (firstCharge) {
BannerInfo bannerInfo = new BannerInfo();
bannerInfo.setFirstCharge(true);
bannerInfos.add(0, bannerInfo);
}
getMvpView().onShowBanner(bannerInfos);
}
});
}

View File

@@ -392,7 +392,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/tv_hour_rank"
android:layout_marginTop="5dp"
android:layout_marginTop="@dimen/dp_8"
android:layout="@layout/avroom_music_player_layout" />
<com.yizhuan.erban.vip.VipBroadcastView

View File

@@ -41,57 +41,12 @@
app:barrierDirection="bottom"
app:constraint_referenced_ids="view_pk_board,micro_view" />
<LinearLayout
android:id="@+id/contribute_list"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginTop="85dp"
android:background="@drawable/bg_contribute_entrance_single_room"
android:gravity="center_vertical"
android:onClick="@{click}"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_rank_0"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/default_avatar" />
<ImageView
android:id="@+id/iv_rank_1"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/default_avatar" />
<ImageView
android:id="@+id/iv_rank_2"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/default_avatar" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:text="@string/layout_fragment_single_room_01"
android:textColor="@color/white"
android:textSize="12dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginStart="5dp"
android:scaleType="center"
android:src="@drawable/arrow_right_white" />
</LinearLayout>
<FrameLayout
android:id="@+id/fl_fans_team"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/contribute_list">
@@ -142,20 +97,50 @@
</FrameLayout>
<TextView
android:id="@+id/tv_hour_rank"
android:layout_width="76dp"
android:layout_height="22dp"
android:layout_marginTop="6dp"
android:id="@+id/contribute_list"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:background="@drawable/bg_single_room_rank_entrance"
android:drawableStart="@drawable/ic_single_room_rank"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:text="@string/layout_fragment_single_room_04"
android:drawablePadding="@dimen/dp_2"
android:gravity="center"
android:onClick="@{click}"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_4"
android:layout_marginTop="85dp"
android:text="@string/room_contribute_list"
android:textColor="@color/white"
android:textSize="12dp"
android:textSize="@dimen/sp_10"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/contribute_list" />
app:drawableStartCompat="@drawable/ic_sing_room_contribute_list" />
<TextView
android:id="@+id/tv_hour_rank"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:background="@drawable/bg_single_room_rank_entrance"
android:drawablePadding="@dimen/dp_2"
android:gravity="center"
android:paddingStart="@dimen/dp_8"
android:paddingEnd="@dimen/dp_4"
android:text="@string/room_list_hour"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:layout_marginTop="@dimen/dp_8"
app:drawableStartCompat="@drawable/ic_single_room_rank"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/contribute_list" />
<ViewStub
android:id="@+id/vs_music_player"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/dp_8"
android:layout="@layout/avroom_music_player_layout"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_hour_rank" />
<FrameLayout
android:id="@+id/fl_speedy_message"
@@ -304,17 +289,6 @@
</RelativeLayout>
<ViewStub
android:id="@+id/vs_music_player"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="125dp"
android:layout="@layout/avroom_music_player_layout"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.yizhuan.erban.vip.VipBroadcastView
android:id="@+id/vip_broadcast_view"
android:layout_width="0dp"