feat:删除房间banner(把刚刚注释代码的也删了)
This commit is contained in:
@@ -464,65 +464,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
}
|
||||
|
||||
fun initRoomAct(
|
||||
rollPagerView: RollPagerView,
|
||||
dialogInfo: List<BannerInfo>,
|
||||
bottomDp: Float = 0f
|
||||
) {
|
||||
if (!ListUtils.isListEmpty(dialogInfo)) {
|
||||
rollPagerView.visibility = View.VISIBLE
|
||||
// 只有一個圖標,隱藏底部指示器
|
||||
val show = dialogInfo.size > 1
|
||||
rollPagerView.setHintView(object : ColorPointHintView(
|
||||
mContext, Color.WHITE, ContextCompat.getColor(
|
||||
mContext,
|
||||
R.color.color_66FFFFFF
|
||||
)
|
||||
) {
|
||||
override fun makeFocusDrawable(): Drawable? {
|
||||
val dotFocus = GradientDrawable()
|
||||
dotFocus.setColor(Color.WHITE)
|
||||
dotFocus.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotFocus.setSize(
|
||||
Util.dip2px(context, 9f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (show) dotFocus else null
|
||||
}
|
||||
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(ContextCompat.getColor(mContext, R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
dotNormal.setSize(
|
||||
Util.dip2px(context, 4f), Util.dip2px(
|
||||
context, 4f
|
||||
)
|
||||
)
|
||||
return if (show) dotNormal else null
|
||||
}
|
||||
})
|
||||
val bannerAdapter = RoomActAdapter(mContext, dialogInfo)
|
||||
rollPagerView.adapter = bannerAdapter
|
||||
rollPagerView.setPlayDelay(3000)
|
||||
//設置透明度
|
||||
rollPagerView.setAnimationDurtion(500)
|
||||
bannerAdapter.notifyDataSetChanged()
|
||||
|
||||
// 模擬指示器在viewpager底部效果
|
||||
val viewPager = rollPagerView.viewPager
|
||||
viewPager.offscreenPageLimit = dialogInfo.size
|
||||
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
|
||||
layoutParams.setMargins(0, 0, 0, UIUtil.dip2px(mContext, bottomDp.toDouble()))
|
||||
viewPager.layoutParams = layoutParams
|
||||
}
|
||||
}
|
||||
|
||||
private fun releaseView() {
|
||||
roomFreeGiftDialog?.dismiss()
|
||||
messageView.release()
|
||||
|
@@ -78,7 +78,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
//游戏模式暂时不需要这个
|
||||
PlayerModel.get().stop()
|
||||
gameBinding.roomInfo = AvRoomDataManager.get().mCurrentRoomInfo
|
||||
mvpPresenter?.getBannerList()
|
||||
gameBinding.tvShowMiniMic.setOnClickListener { showMiniMic() }
|
||||
gameBinding.ivShowMic.setOnClickListener { showMic() }
|
||||
}
|
||||
@@ -150,10 +149,6 @@ class GameRoomFragment : BaseRoomFragment<IGameRoomView?, GameRoomPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFinishAvRoomEvent(event: FinishAvRoomEvent) {
|
||||
gameDelegate.exitGame()
|
||||
|
@@ -8,7 +8,6 @@ import android.view.View;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.trello.rxlifecycle3.android.FragmentEvent;
|
||||
import com.chwl.app.R;
|
||||
import com.chwl.app.avroom.activity.AVRoomActivity;
|
||||
@@ -32,9 +31,7 @@ import com.chwl.app.avroom.widget.PKBoardView;
|
||||
import com.chwl.app.base.BaseMvpActivity;
|
||||
import com.chwl.app.common.widget.dialog.DialogManager;
|
||||
import com.chwl.app.databinding.FragmentAvRoomGameBinding;
|
||||
import com.chwl.app.treasure_box.widget.GoldBoxHelper;
|
||||
import com.chwl.app.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.chwl.app.ui.webview.DialogWebViewActivity;
|
||||
import com.chwl.app.utils.UserUtils;
|
||||
import com.chwl.core.Constants;
|
||||
import com.chwl.core.UriProvider;
|
||||
@@ -67,7 +64,6 @@ import com.chwl.library.utils.ResUtil;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.chwl.library.utils.TimeUtils;
|
||||
import com.chwl.library.utils.UIUtils;
|
||||
import com.chwl.library.utils.config.BasicConfig;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -151,17 +147,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
updateQueuingMicBtn();
|
||||
updatePkScoreBoard();
|
||||
initRoomPkOrder(AvRoomDataManager.get().showPkBeginTime, AvRoomDataManager.get().pkBeginTime);
|
||||
getMvpPresenter().getBannerList();
|
||||
// if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
// UserModel.get().getCurrentUserInfo()
|
||||
// .compose(bindToLifecycle())
|
||||
// .subscribe(userInfo -> {
|
||||
// if (userInfo.isFirstCharge()) {
|
||||
// gameBinding.ivFirstChargeEnter.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -966,12 +951,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
return pkMicQueueDialog != null && pkMicQueueDialog.isShowing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowBanner(List<BannerInfo> bannerInfos) {
|
||||
initRoomAct(gameBinding.activityImg, bannerInfos, 11f);
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFirstRechargeEvent(FirstChargeEvent event) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.GONE);
|
||||
|
@@ -25,14 +25,11 @@ import com.chwl.app.databinding.FragmentSingleRoomBinding
|
||||
import com.chwl.app.fansteam.FansTeamJoinActivity
|
||||
import com.chwl.app.fansteam.FansTeamJoinedActivity
|
||||
import com.chwl.app.fansteam.FansTeamViewModel
|
||||
import com.chwl.app.treasure_box.widget.GoldBoxHelper
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity
|
||||
import com.chwl.app.ui.webview.DialogWebViewActivity
|
||||
import com.chwl.core.UriProvider
|
||||
import com.chwl.core.auth.AuthModel
|
||||
import com.chwl.core.fansteam.FansTeamInitInfo
|
||||
import com.chwl.core.home.bean.BannerInfo
|
||||
import com.chwl.core.im.custom.bean.FansTeamMsgAttachment
|
||||
import com.chwl.core.im.custom.bean.RequestUpmicAttachment
|
||||
import com.chwl.core.im.custom.bean.RoomPKAttachment
|
||||
@@ -83,24 +80,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
@SuppressLint("CheckResult")
|
||||
override fun initiate() {
|
||||
super.initiate()
|
||||
mvpPresenter?.getBannerList()
|
||||
initSpeedyMessage(gameBinding.flSpeedyMessage)
|
||||
// GoldBoxHelper.isHideBox().subscribe(
|
||||
// {
|
||||
// if (it == false) {
|
||||
// gameBinding.ivTreasureBox.visibility = View.VISIBLE
|
||||
// gameBinding.ivTreasureBox.load(
|
||||
// GoldBoxHelper.getBoxIcon(),
|
||||
// defaultRes = R.drawable.icon_room_treasure_box
|
||||
// )
|
||||
// } else {
|
||||
// gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
// }
|
||||
// }
|
||||
// ) {
|
||||
// gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
// }
|
||||
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
|
||||
fansTeamViewModel.fansTeamInitInfoLiveData.observe(viewLifecycleOwner) {
|
||||
@@ -108,12 +88,6 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
updateFansTeamInfo(it)
|
||||
}
|
||||
}
|
||||
// gameBinding.tvHourRank.setOnClickListener {
|
||||
// DialogWebViewActivity.start(
|
||||
// mContext,
|
||||
// UriProvider.getSingleRoomHourRankUrl(AvRoomDataManager.get().roomUid)
|
||||
// )
|
||||
// }
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@@ -248,10 +222,6 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos, 10f)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent) {
|
||||
gameBinding.ivFirstChargeEnter.visibility = View.GONE
|
||||
|
@@ -1,15 +1,7 @@
|
||||
package com.chwl.app.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.chwl.app.avroom.view.IGameRoomView;
|
||||
import com.chwl.app.treasure_box.widget.GoldBoxHelper;
|
||||
import com.chwl.app.utils.UserUtils;
|
||||
import com.chwl.core.home.bean.BannerInfo;
|
||||
import com.chwl.core.room.model.AvRoomModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -19,39 +11,4 @@ import java.util.List;
|
||||
* @date 2017/12/8
|
||||
*/
|
||||
public class GameRoomPresenter extends BaseRoomPresenter<IGameRoomView> {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
AvRoomModel.get().getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
if (bannerInfos == null) bannerInfos = new ArrayList<>();
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
// if(GoldBoxHelper.isShowFairy()){
|
||||
// BannerInfo bannerInfo = new BannerInfo();
|
||||
// bannerInfo.setFairy(true);
|
||||
// bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
// }
|
||||
List<BannerInfo> finalBannerInfos = bannerInfos;
|
||||
getMvpView().onShowBanner(finalBannerInfos);
|
||||
// GoldBoxHelper.isHideBox()
|
||||
// .subscribe(isHide -> {
|
||||
// if (!isHide) {
|
||||
// BannerInfo bannerInfo = new BannerInfo();
|
||||
// bannerInfo.setBox(true);
|
||||
// int index = 0;
|
||||
// if (firstCharge) index++;
|
||||
// if (GoldBoxHelper.isShowFairy()) index++;
|
||||
// finalBannerInfos.add(index, bannerInfo);
|
||||
// }
|
||||
// getMvpView().onShowBanner(finalBannerInfos);
|
||||
// }, throwable -> getMvpView().onShowBanner(finalBannerInfos));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -297,50 +297,4 @@ public class HomePartyPresenter extends BaseRoomPresenter<IHomePartyView> {
|
||||
.subscribe(s -> SingleToastUtil.showToast(ResUtil.getString(R.string.avroom_presenter_homepartypresenter_01))
|
||||
, e -> SingleToastUtil.showToast(e.getMessage()));
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(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);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
// 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(GoldBoxHelper.isShowFairy()){
|
||||
// BannerInfo bannerInfo = new BannerInfo();
|
||||
// bannerInfo.setFairy(true);
|
||||
// bannerInfos.add(0, bannerInfo);
|
||||
// }
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,7 @@
|
||||
package com.chwl.app.avroom.presenter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import com.chwl.app.avroom.view.ISingleRoomView;
|
||||
import com.chwl.app.treasure_box.widget.GoldBoxHelper;
|
||||
import com.chwl.app.utils.UserUtils;
|
||||
import com.chwl.core.home.bean.BannerInfo;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
@@ -15,50 +11,4 @@ import com.chwl.core.home.bean.BannerInfo;
|
||||
*/
|
||||
public class SingleRoomPresenter extends BaseRoomPresenter<ISingleRoomView> {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(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);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
// 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(GoldBoxHelper.isShowFairy()){
|
||||
// BannerInfo bannerInfo = new BannerInfo();
|
||||
// bannerInfo.setFairy(true);
|
||||
// bannerInfos.add(0, bannerInfo);
|
||||
// }
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -12,6 +12,6 @@ import java.util.List;
|
||||
*/
|
||||
public interface IGameRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
// void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
||||
|
@@ -21,5 +21,4 @@ public interface IHomePartyView extends IBaseRoomView {
|
||||
*/
|
||||
void onGiftValueChangeMic(int micPosition, String uId, boolean isInviteUpMic, RoomInfo roomInfo);
|
||||
|
||||
void onShowBanner(List<BannerInfo> bannerInfos);
|
||||
}
|
||||
|
@@ -1,8 +1,5 @@
|
||||
package com.chwl.app.avroom.view;
|
||||
|
||||
import com.chwl.core.home.bean.BannerInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p> 轰趴房View层 </p>
|
||||
@@ -12,6 +9,4 @@ import java.util.List;
|
||||
*/
|
||||
public interface ISingleRoomView extends IBaseRoomView {
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
||||
|
@@ -157,16 +157,6 @@
|
||||
app:shaderMode="rightToLeft"
|
||||
app:shaderStartColor="#FA4771" />
|
||||
|
||||
<com.chwl.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_below="@id/micro_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_charge_enter"
|
||||
android:layout_width="65dp"
|
||||
|
@@ -92,21 +92,11 @@
|
||||
android:layout_marginEnd="90dp"
|
||||
android:layout_marginBottom="@dimen/dp_10" />
|
||||
|
||||
<com.chwl.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<com.chwl.app.avroom.redpackage.RedPackageWidget
|
||||
android:id="@+id/red_package_widget"
|
||||
android:layout_width="58dp"
|
||||
android:layout_height="58dp"
|
||||
android:layout_above="@id/activity_img"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="8.5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
|
@@ -210,19 +210,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_micro" />
|
||||
|
||||
|
||||
<com.chwl.app.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_below="@id/barrier_micro"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_micro"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/input_layout"
|
||||
android:layout_width="0dp"
|
||||
|
Reference in New Issue
Block a user