删除幸运礼物顶部提示栏
This commit is contained in:
@@ -159,11 +159,8 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
private EasyPopup easyPopup;
|
||||
private TextView giftNumberText;
|
||||
private ImageView giftNumberOptions;
|
||||
private View flLuckyDesc;
|
||||
private RecyclerView rvLuckyMsg;
|
||||
private ImageView ivOpenNoble;
|
||||
private View ivFirstRecharge;
|
||||
private TextView tvLuckyBagIntro;
|
||||
private TextView tvGiftValue;
|
||||
private EditText etSendMessage;
|
||||
private Button sendGiftButton;
|
||||
@@ -392,8 +389,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
ivDrawGiftRemoveLast = root.findViewById(R.id.iv_draw_gift_remove_last);
|
||||
ivDrawGiftRemoveAll = root.findViewById(R.id.iv_draw_gift_remove_all);
|
||||
ivDrawGiftClose = root.findViewById(R.id.iv_draw_gift_close);
|
||||
flLuckyDesc = findViewById(R.id.fl_lucky_desc);
|
||||
rvLuckyMsg = findViewById(R.id.rv_lucky_msg);
|
||||
ivDrawGiftClose.setOnClickListener(this);
|
||||
ivDrawGiftRemoveLast.setOnClickListener(this);
|
||||
ivDrawGiftRemoveAll.setOnClickListener(this);
|
||||
@@ -461,12 +456,10 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
sendContainer = root.findViewById(R.id.send_container);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
ivFirstRecharge = root.findViewById(R.id.iv_first_recharge);
|
||||
tvLuckyBagIntro = findViewById(R.id.tv_lucky_bag_intro);
|
||||
tvGiftValue = root.findViewById(R.id.tv_gift_value);
|
||||
mStarWeekBanner = findViewById(R.id.star_week_list);
|
||||
|
||||
ivFirstRecharge.setOnClickListener(this);
|
||||
tvLuckyBagIntro.setOnClickListener(this);
|
||||
if (giftId == 0) {
|
||||
// 更新所有礼物
|
||||
giftIndicator.setPosition(GiftIndicator.TYPE_NORMAL);
|
||||
@@ -676,7 +669,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
updateNumber(1);
|
||||
}
|
||||
}
|
||||
updateLuckyBagIntro();
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = false;
|
||||
updateDrawGift();
|
||||
@@ -689,59 +681,9 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
});
|
||||
}
|
||||
|
||||
private void updateLuckyBagIntro() {
|
||||
if (currentGiftInfo == null ||
|
||||
(TextUtils.isEmpty(currentGiftInfo.getGiftExplainUrl()) && currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY)) {
|
||||
tvLuckyBagIntro.setVisibility(View.GONE);
|
||||
} else {
|
||||
tvLuckyBagIntro.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (luckyMsgDisposable != null) luckyMsgDisposable.dispose();
|
||||
if (currentGiftInfo == null || currentGiftInfo.getGiftType() != GiftType.GIFT_TYPE_LUCKY) {
|
||||
flLuckyDesc.setVisibility(View.GONE);
|
||||
} else {
|
||||
flLuckyDesc.setVisibility(View.VISIBLE);
|
||||
if (luckyMsgAdapter == null) {
|
||||
luckyMsgAdapter = new BaseQuickAdapter<>(R.layout.item_lucky_gift_msg) {
|
||||
@Override
|
||||
protected void convert(@NonNull BaseViewHolder helper, LuckyBagNoticeInfo noticeInfo) {
|
||||
TextView tvName = helper.getView(R.id.tv_name);
|
||||
TextView tvLucky = helper.getView(R.id.tv_luck);
|
||||
TextView tvLuckyName = helper.getView(R.id.tv_luck_name);
|
||||
String nickName = RegexUtil.getPrintableString(noticeInfo.getNick());
|
||||
tvName.setText(nickName);
|
||||
tvLucky.setText(noticeInfo.getLuckyBagName());
|
||||
tvLuckyName.setText(noticeInfo.getGiftName());
|
||||
}
|
||||
};
|
||||
rvLuckyMsg.setAdapter(luckyMsgAdapter);
|
||||
rvLuckyMsg.setLayoutManager(new ScollLinearLayoutManager(context, ScollLinearLayoutManager.HORIZONTAL, false));
|
||||
rvLuckyMsg.setOnTouchListener((v, event) -> true);
|
||||
}
|
||||
|
||||
|
||||
luckyMsgDisposable = GiftModel.get().getLuckyGiftMsgList()
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.doOnSuccess(luckyBagNoticeInfos -> luckyMsgAdapter.setNewData(luckyBagNoticeInfos))
|
||||
.toObservable()
|
||||
.flatMap(luckyBagNoticeInfos -> Observable.intervalRange(0, Integer.MAX_VALUE, 0, 5, TimeUnit.SECONDS))
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
int index = aLong.intValue() % luckyMsgAdapter.getItemCount();
|
||||
if (index == 0) {
|
||||
rvLuckyMsg.scrollToPosition(index);
|
||||
} else {
|
||||
rvLuckyMsg.smoothScrollToPosition(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWeekStarDesc() {
|
||||
|
||||
if (giftIndicator.getCurrrentType() == GiftIndicator.TYPE_WEEK) {
|
||||
flLuckyDesc.setVisibility(View.GONE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
mStarWeekBanner.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
@@ -941,7 +883,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
layoutLoadFiled.setVisibility(View.GONE);
|
||||
layoutEmpty.setVisibility(View.GONE);
|
||||
etSendMessage.setVisibility(View.GONE);
|
||||
tvLuckyBagIntro.setVisibility(View.GONE);
|
||||
tvGiftValue.setVisibility(View.GONE);
|
||||
ivOpenNoble.setVisibility(View.GONE);
|
||||
llStarWeek.setVisibility(View.GONE);
|
||||
@@ -1023,7 +964,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
lastSelectedItem = item;
|
||||
currentGiftInfo = item.data;
|
||||
setGoldOrRadishText(lastSelectedItem);
|
||||
updateLuckyBagIntro();
|
||||
updateWeekStarDesc();
|
||||
isShowDrawGiftModel = true;
|
||||
updateDrawGift();
|
||||
@@ -1358,16 +1298,6 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
case R.id.iv_first_recharge:
|
||||
FirstChargeDialog.start(context);
|
||||
break;
|
||||
|
||||
case R.id.tv_lucky_bag_intro:
|
||||
if (currentGiftInfo == null) break;
|
||||
if (currentGiftInfo.getGiftType() == GiftType.GIFT_TYPE_LUCKY) {
|
||||
DialogWebViewActivity.start(context, UriProvider.getLuckyGiftRule(currentGiftInfo.getGiftId()), true);
|
||||
} else {
|
||||
DialogWebViewActivity.start(context, currentGiftInfo.getGiftExplainUrl(), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.tv_reload:
|
||||
reloadData(true);
|
||||
break;
|
||||
|
@@ -6,44 +6,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/fl_lucky_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_gift_dialog_lucky_desc"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_dialog_bottom_gift"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_lucky_msg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_toStartOf="@+id/tv_lucky_bag_intro"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_lucky_gift_msg" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_lucky_bag_intro"
|
||||
android:text="@string/play_desc"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_EB547C"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/star_week_list"
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user