新增房间内首充弹窗
@@ -244,7 +244,7 @@ dependencies {
|
||||
|
||||
//支付密码输入框
|
||||
api 'com.jungly:gridPasswordView:0.3'
|
||||
api 'com.google.android:flexbox:1.1.0'
|
||||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
|
||||
compileOnly "org.projectlombok:lombok:${Lombok}"
|
||||
annotationProcessor "org.projectlombok:lombok:${Lombok}"
|
||||
|
@@ -1248,6 +1248,10 @@
|
||||
android:theme="@style/dialog_web_view_activity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
<activity
|
||||
android:name=".avroom.firstcharge.FirstChargeDialog"
|
||||
android:theme="@style/dialogactivity" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -0,0 +1,143 @@
|
||||
package com.yizhuan.erban.avroom.firstcharge
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.DialogFirstChargeBinding
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_first_charge)
|
||||
class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>() {
|
||||
|
||||
private var goodsList: List<FirstChargeGoods>? = null
|
||||
|
||||
private var currGoods: FirstChargeGoods? = null
|
||||
private lateinit var rewardAdapter: RewardAdapter
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, FirstChargeDialog::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
EventBus.getDefault().register(this)
|
||||
binding.rbPlanA.setOnClickListener {
|
||||
reset()
|
||||
binding.rbPlanA.isChecked = true
|
||||
binding.rbPlanA.textSize = 22f
|
||||
updateCurrGoods(goodsList?.getOrNull(0))
|
||||
}
|
||||
binding.rbPlanB.setOnClickListener {
|
||||
reset()
|
||||
binding.rbPlanB.isChecked = true
|
||||
binding.rbPlanB.textSize = 22f
|
||||
updateCurrGoods(goodsList?.getOrNull(1))
|
||||
}
|
||||
binding.rbPlanC.setOnClickListener {
|
||||
reset()
|
||||
binding.rbPlanC.isChecked = true
|
||||
binding.rbPlanC.textSize = 22f
|
||||
updateCurrGoods(goodsList?.getOrNull(2))
|
||||
}
|
||||
binding.ivCharge.setOnClickListener {
|
||||
currGoods?.let {
|
||||
SelectPayTypeDialog.newInstance(it.chargeProdId, "¥${it.chargeMoney}")
|
||||
.show(this)
|
||||
} ?: run {
|
||||
"请选择充值产品!".toast()
|
||||
}
|
||||
}
|
||||
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter().also { rewardAdapter = it })
|
||||
.setLayoutManager(FlexboxLayoutManager(context).apply {
|
||||
alignItems = AlignItems.STRETCH
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
})
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
|
||||
PayModel.get().firstChargeList
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
initData(it)
|
||||
}, {
|
||||
it.printStackTrace()
|
||||
SingleToastUtil.showToast(it.message)
|
||||
finish()
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initData(goodsList: List<FirstChargeGoods>) {
|
||||
this.goodsList = goodsList
|
||||
binding.rbPlanA.isChecked = true
|
||||
updateCurrGoods(goodsList.getOrNull(0))
|
||||
when (goodsList.size) {
|
||||
1 -> {
|
||||
binding.rbPlanB.visibility = View.GONE
|
||||
binding.rbPlanC.visibility = View.GONE
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
}
|
||||
2 -> {
|
||||
binding.rbPlanC.visibility = View.GONE
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
binding.rbPlanB.text = "${goodsList[1].chargeMoney}元"
|
||||
}
|
||||
3 -> {
|
||||
binding.rbPlanA.text = "${goodsList[0].chargeMoney}元"
|
||||
binding.rbPlanB.text = "${goodsList[1].chargeMoney}元"
|
||||
binding.rbPlanC.text = "${goodsList[2].chargeMoney}元"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCurrGoods(firstChargeGoods: FirstChargeGoods?) {
|
||||
firstChargeGoods?.let {
|
||||
currGoods = it
|
||||
binding.tvTitle.text = it.chargeProdTitle
|
||||
rewardAdapter.setNewData(it.firstChargeRewardList)
|
||||
}
|
||||
}
|
||||
|
||||
private fun reset() {
|
||||
binding.rbPlanA.isChecked = false
|
||||
binding.rbPlanB.isChecked = false
|
||||
binding.rbPlanC.isChecked = false
|
||||
binding.rbPlanA.textSize = 18f
|
||||
binding.rbPlanB.textSize = 18f
|
||||
binding.rbPlanC.textSize = 18f
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onFirstRechargeEvent(event: FirstChargeEvent?) {
|
||||
finish()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.yizhuan.erban.avroom.firstcharge
|
||||
|
||||
import android.content.Context
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogFirstChargePrizeBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
import com.yizhuan.erban.ui.utils.RVDelegate
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
|
||||
@ActLayoutRes(R.layout.dialog_first_charge_prize)
|
||||
class FirstChargePrizeDialog(
|
||||
context: Context,
|
||||
val title: String?,
|
||||
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||
) : BaseBindingDialog<DialogFirstChargePrizeBinding>(context) {
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
override fun init() {
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter())
|
||||
.setLayoutManager(FlexboxLayoutManager(context).apply {
|
||||
alignItems = AlignItems.STRETCH
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
})
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.build()
|
||||
binding.ivKnow.setOnClickListener {
|
||||
closeDialog()
|
||||
}
|
||||
|
||||
binding.tvDesc.text = title
|
||||
rvDelegate.setNewData(firstChargeRewardList)
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package com.yizhuan.erban.avroom.firstcharge;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils;
|
||||
|
||||
public class RewardAdapter extends BaseQuickAdapter<FirstChargeReward, BaseViewHolder> {
|
||||
public RewardAdapter() {
|
||||
super(R.layout.item_first_charge_reward);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, FirstChargeReward item) {
|
||||
LogUtils.d(item.toString());
|
||||
ImageLoadUtils.loadRectImage(
|
||||
mContext,
|
||||
item.getShowPir(),
|
||||
helper.getView(R.id.iv_pic),
|
||||
R.drawable.default_cover,
|
||||
ScreenUtil.dip2px(8));
|
||||
helper.setText(R.id.tv_name, item.getShowText())
|
||||
.setText(R.id.tv_time, item.getShowTime())
|
||||
.setGone(R.id.tv_time, !TextUtils.isEmptyText(item.getShowTime()));
|
||||
}
|
||||
}
|
@@ -0,0 +1,119 @@
|
||||
package com.yizhuan.erban.avroom.firstcharge
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogSelectPayTypeBinding
|
||||
import com.yizhuan.erban.ui.pay.ChargeActivity
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.pay.PaymentActivity
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo
|
||||
import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil
|
||||
|
||||
/**
|
||||
* 充值方式选择弹窗
|
||||
*/
|
||||
@ActLayoutRes(R.layout.dialog_select_pay_type)
|
||||
class SelectPayTypeDialog : BaseDialog<DialogSelectPayTypeBinding>() {
|
||||
|
||||
private val chargeProdId by lazy { requireArguments().getString("chargeProdId", "") }
|
||||
private val descText by lazy { requireArguments().getString("descText", "") }
|
||||
private var removeView: View? = null
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun newInstance(chargeProdId: String, descText: String): SelectPayTypeDialog {
|
||||
return SelectPayTypeDialog().apply {
|
||||
arguments = Bundle().apply {
|
||||
putString("chargeProdId", chargeProdId)
|
||||
putString("descText", descText)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var payChannel = ""
|
||||
|
||||
override fun onStart() {
|
||||
width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
gravity = Gravity.BOTTOM
|
||||
super.onStart()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
PayModel.get().walletInfo
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe({
|
||||
setWalletData(it)
|
||||
}, {
|
||||
SingleToastUtil.showToast(it.message)
|
||||
it.printStackTrace()
|
||||
})
|
||||
binding.tvDesc.text = descText
|
||||
|
||||
binding.tvConfirm.setOnClickListener {
|
||||
if (payChannel.isEmpty()) {
|
||||
SingleToastUtil.showToast("数据初始化中,请稍后~")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if (binding.rbAlipay.isChecked) {
|
||||
PaymentActivity.start(requireActivity(), Constants.CHARGE_ALIPAY, chargeProdId)
|
||||
} else {
|
||||
PaymentActivity.start(requireActivity(), Constants.CHARGE_WX, chargeProdId)
|
||||
}
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
|
||||
binding.tvMore.setOnClickListener {
|
||||
removeView?.let {
|
||||
binding.rg.addView(it)
|
||||
binding.tvMore.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivClose.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* defaultPay 1:默认支付宝,2:默认微信
|
||||
*/
|
||||
private fun setWalletData(walletInfo: WalletInfo) {
|
||||
binding.rg.visibility = View.VISIBLE
|
||||
when (walletInfo.defaultPay) {
|
||||
ChargeActivity.ALI_PAY_CLOSE -> {
|
||||
payChannel = Constants.CHARGE_ALIPAY
|
||||
removeView = binding.rbAlipay
|
||||
binding.rg.removeView(binding.rbAlipay)
|
||||
binding.rbWechat.isChecked = true
|
||||
binding.tvMore.visibility = View.VISIBLE
|
||||
}
|
||||
ChargeActivity.WX_PAY_CLOSE -> {
|
||||
payChannel = Constants.CHARGE_WX
|
||||
removeView = binding.rbWechat
|
||||
binding.rg.removeView(binding.rbWechat)
|
||||
binding.rbAlipay.isChecked = true
|
||||
binding.tvMore.visibility = View.VISIBLE
|
||||
}
|
||||
ChargeActivity.WX_PAY_OPEN -> {
|
||||
payChannel = Constants.CHARGE_WX
|
||||
binding.rbWechat.isChecked = true
|
||||
binding.rg.removeView(binding.rbAlipay)
|
||||
binding.rg.addView(binding.rbAlipay)
|
||||
}
|
||||
else -> {
|
||||
payChannel = Constants.CHARGE_ALIPAY
|
||||
binding.rbAlipay.isChecked = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -34,6 +34,8 @@ import com.yizhuan.erban.avroom.anotherroompk.RoomPkFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkForceFinishDialog;
|
||||
import com.yizhuan.erban.avroom.anotherroompk.RoomPkReceivedDialog;
|
||||
import com.yizhuan.erban.avroom.dialog.DatingVipRuleDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargePrizeDialog;
|
||||
import com.yizhuan.erban.ui.webview.DatingRuleWebViewActivity;
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView;
|
||||
@@ -139,6 +141,8 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.im.game.ImGameInfo;
|
||||
import com.yizhuan.xchat_android_core.im.game.ImGameMode;
|
||||
import com.yizhuan.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.initial.bean.InitInfo;
|
||||
import com.yizhuan.xchat_android_core.magic.bean.MagicInfo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
@@ -152,6 +156,7 @@ import com.yizhuan.xchat_android_core.mentoring_relationship.event.MentoringStop
|
||||
import com.yizhuan.xchat_android_core.mentoring_relationship.model.MentoringRelationshipModel;
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.music.model.PlayerModel;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.redpackage.RedPackageModel;
|
||||
import com.yizhuan.xchat_android_core.room.activitytimer.ActivityTimerEvent;
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent;
|
||||
@@ -507,6 +512,13 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
checkMiniWorld();
|
||||
otherInitView();
|
||||
getMvpPresenter().loadMessageHistory();
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(userInfo -> {
|
||||
if (userInfo.isFirstCharge()) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void handGameEvent(GameEvent gameEvent) {
|
||||
@@ -1544,6 +1556,9 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
case R.id.tv_room_introduction:
|
||||
showRoomIntroduction(AvRoomDataManager.get().isRoomOwner() || AvRoomDataManager.get().isRoomAdmin());
|
||||
break;
|
||||
case R.id.iv_first_charge_enter:
|
||||
FirstChargeDialog.start(mContext);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
@@ -2759,6 +2774,12 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_MP_ROOM_GIFT_CLICK, "礼物面板按钮");
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFirstRechargeEvent(FirstChargeEvent event) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.GONE);
|
||||
new FirstChargePrizeDialog(requireContext(), event.getChargeProdTitle(), event.getFirstChargeRewardList()).openDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 底部按钮点击处理
|
||||
*/
|
||||
|
@@ -3,6 +3,7 @@ package com.yizhuan.erban.avroom.widget;
|
||||
import android.animation.Keyframe;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.PropertyValuesHolder;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
@@ -31,12 +32,15 @@ import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMMessageManager;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
import com.yizhuan.xchat_android_core.room.pk.model.PkModel;
|
||||
import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
import com.yizhuan.xchat_android_core.utils.SharedPreferenceUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.StringExtensionKt;
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
@@ -95,6 +99,7 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
init();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void init() {
|
||||
inflate(getContext(), R.layout.layout_bottom_view, this);
|
||||
openMic = findViewById(R.id.icon_room_open_mic);
|
||||
@@ -136,6 +141,14 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
llSendMsg.setVisibility(GONE);
|
||||
}
|
||||
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(RxHelper.bindContext(getContext()))
|
||||
.subscribe(userInfo -> {
|
||||
if (userInfo.isFirstCharge()) {
|
||||
sendGift.setImageResource(R.drawable.icon_room_send_gift_first_charge);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,6 +197,11 @@ public class BottomView extends RelativeLayout implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFirstRechargeEvent(FirstChargeEvent event) {
|
||||
sendGift.setImageResource(R.drawable.icon_room_send_gift);
|
||||
}
|
||||
|
||||
public void setRoomMessageUnread(int count) {
|
||||
iconRoomMsg.setImageResource(count > 0 ? R.drawable.ic_room_message_income : R.drawable.ic_room_message);
|
||||
}
|
||||
|
@@ -90,10 +90,10 @@ public class ChargeActivity extends BaseActivity {
|
||||
|
||||
private volatile String payChannel = Constants.CHARGE_WX;
|
||||
|
||||
private static final int ALI_PAY_CLOSE = 1;
|
||||
private static final int WX_PAY_CLOSE = 2;
|
||||
private static final int ALI_PAY_OPEN = 3;
|
||||
private static final int WX_PAY_OPEN = 4;
|
||||
public static final int ALI_PAY_CLOSE = 1;
|
||||
public static final int WX_PAY_CLOSE = 2;
|
||||
public static final int ALI_PAY_OPEN = 3;
|
||||
public static final int WX_PAY_OPEN = 4;
|
||||
|
||||
private boolean mIsFromH5;
|
||||
|
||||
|
@@ -44,6 +44,7 @@ import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.trello.rxlifecycle3.components.support.RxAppCompatActivity;
|
||||
import com.yizhuan.erban.BR;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.common.widget.CircleImageView;
|
||||
import com.yizhuan.erban.common.widget.dialog.DialogManager;
|
||||
@@ -80,6 +81,7 @@ import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstRechargeEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.event.UpdateWalletInfoEvent;
|
||||
import com.yizhuan.xchat_android_core.radish.RadishModel;
|
||||
@@ -474,6 +476,15 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
};
|
||||
RadishWalletManager.get().getLdRadishNumber().observeForever(radishObserver);
|
||||
RadishModel.get().updateRadishWallet().subscribe();
|
||||
if (isInRoom) {
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(RxHelper.bindContext(context))
|
||||
.subscribe(userInfo -> {
|
||||
if (userInfo.isFirstCharge()) {
|
||||
ivFirstRecharge.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1180,9 +1191,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
break;
|
||||
|
||||
case R.id.iv_first_recharge:
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_GIFT_ONEYUAN_ENTRANCE,
|
||||
"礼物面板_一元首充-区分-" + GIFT_DIALOG_FROM);
|
||||
ChargeActivity.start(context);
|
||||
FirstChargeDialog.start(context);
|
||||
break;
|
||||
|
||||
case R.id.tv_lucky_bag_intro:
|
||||
@@ -1360,6 +1369,13 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onFirstRechargeEvent(FirstChargeEvent event) {
|
||||
if (ivFirstRecharge != null) {
|
||||
ivFirstRecharge.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onWalletInfoUpdate(UpdateWalletInfoEvent event) {
|
||||
goldWalletInfo = PayModel.get().getCurrentWalletInfo();
|
||||
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:color="#FFFFDB49" android:state_checked="true" />
|
||||
<item android:color="#FFFFDB49" android:state_selected="true" />
|
||||
<item android:color="@color/white" />
|
||||
|
||||
</selector>
|
BIN
app/src/main/res/drawable-xhdpi/bg_first_charge.png
Normal file
After Width: | Height: | Size: 188 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_first_charge_charge_btn.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_first_charge_prize.png
Normal file
After Width: | Height: | Size: 124 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_first_charge_prize_ok.png
Normal file
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 6.1 KiB |
16
app/src/main/res/drawable/bg_first_charge_list.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#FF5D31B3"
|
||||
android:endColor="#ff5226ab"
|
||||
android:startColor="#ff5226ab"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="0dp"
|
||||
android:topRightRadius="0dp" />
|
||||
</shape>
|
18
app/src/main/res/drawable/bg_first_charge_prize_list.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#FF5D31B3"
|
||||
android:endColor="#ff5226ab"
|
||||
android:startColor="#ff5226ab"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:bottomLeftRadius="15dp"
|
||||
android:bottomRightRadius="15dp"
|
||||
android:topLeftRadius="15dp"
|
||||
android:topRightRadius="15dp" />
|
||||
</shape>
|
10
app/src/main/res/drawable/bg_first_charge_reward_item.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FF2D0884" />
|
||||
<corners
|
||||
android:bottomLeftRadius="4dp"
|
||||
android:bottomRightRadius="4dp"
|
||||
android:topLeftRadius="4dp"
|
||||
android:topRightRadius="4dp" />
|
||||
</shape>
|
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FF5226AB" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<size android:height="5dp" />
|
||||
<solid android:color="@color/transparent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:gravity="bottom">
|
||||
<shape android:shape="rectangle">
|
||||
<size android:height="30dp" />
|
||||
<solid android:color="#FF6B3AC5" />
|
||||
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
@@ -82,15 +82,6 @@
|
||||
android:src="@drawable/icon_open_noble"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_recharge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/icon_oneyuan_gift"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_lucky_bag_intro"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -262,6 +253,18 @@
|
||||
android:textColor="@color/color_FACB4D"
|
||||
android:textSize="@dimen/sp_13" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_recharge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/tv_recharge"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_first_charge_gift_dialog_enter"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_text_gold"
|
||||
android:layout_width="wrap_content"
|
||||
|
106
app/src/main/res/layout/dialog_first_charge.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="290dp"
|
||||
android:layout_height="439dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="21.5dp"
|
||||
android:background="@drawable/bg_first_charge"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="130dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rb_plan_a"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_first_charge_selector_rb_plan_a"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="@color/color_selector_c06100_false_white"
|
||||
android:textSize="22sp"
|
||||
tools:text="1元" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rb_plan_b"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_first_charge_selector_rb_plan_a"
|
||||
android:button="@null"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="@color/color_selector_c06100_false_white"
|
||||
android:textSize="18sp"
|
||||
tools:text="6元" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rb_plan_c"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_first_charge_selector_rb_plan_a"
|
||||
android:button="@null"
|
||||
android:gravity="center_horizontal|bottom"
|
||||
android:includeFontPadding="false"
|
||||
android:paddingBottom="5dp"
|
||||
android:textColor="@color/color_selector_c06100_false_white"
|
||||
android:textSize="18sp"
|
||||
tools:text="188元" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="232dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_first_charge_list">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="#FFFFDB49"
|
||||
android:textSize="13sp"
|
||||
tools:text="充A元额外送abC元礼包" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_charge"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_first_charge_charge_btn" />
|
||||
|
||||
</FrameLayout>
|
||||
|
69
app/src/main/res/layout/dialog_first_charge_prize.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="290dp"
|
||||
android:layout_height="375dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="21.5dp"
|
||||
android:background="@drawable/bg_first_charge_prize"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="232dp"
|
||||
android:layout_marginTop="70dp"
|
||||
android:background="@drawable/bg_first_charge_prize_list">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="13dp"
|
||||
android:text="充A元额外送abC元礼包"
|
||||
android:textColor="#FFFFDB49"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="22dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:text="装扮类物品可进入“我的一我的装扮”使用哦"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_know"
|
||||
android:layout_width="185dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/bg_first_charge_prize_ok" />
|
||||
|
||||
</FrameLayout>
|
||||
</layout>
|
||||
|
117
app/src/main/res/layout/dialog_select_pay_type.xml
Normal file
@@ -0,0 +1,117 @@
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_white_top_10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_pwd_close" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="支付"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="¥60"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="28sp" />
|
||||
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="30dp"
|
||||
android:paddingEnd="30dp"
|
||||
android:visibility="invisible">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_alipay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/transparent"
|
||||
android:button="@null"
|
||||
android:drawableStart="@drawable/ic_ali_charge"
|
||||
android:drawableEnd="@drawable/selector_check_box_pic_check"
|
||||
android:drawablePadding="10dp"
|
||||
android:text="支付宝"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_wechat"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/transparent"
|
||||
android:button="@null"
|
||||
android:drawableStart="@drawable/ic_wechat_charge"
|
||||
android:drawableEnd="@drawable/selector_check_box_pic_check"
|
||||
android:drawablePadding="10dp"
|
||||
android:text="微信支付"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:drawableEnd="@drawable/ic_charge_arrow"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:text="展开更多支付方式"
|
||||
android:textColor="@color/color_666666"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="225dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:background="@drawable/bg_common_confirm"
|
||||
android:gravity="center"
|
||||
android:text="确认支付"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
66
app/src/main/res/layout/item_first_charge_reward.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="73dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/bg_first_charge_reward_item"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pic"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/view_bg"
|
||||
tools:src="@drawable/default_cover" />
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:text="14天"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:corner="4dp"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/view_bg"
|
||||
app:left_bottom_corner="true"
|
||||
app:left_top_corner="false"
|
||||
app:right_bottom_corner="false"
|
||||
app:right_top_corner="true"
|
||||
app:shaderEnable="true"
|
||||
app:shaderEndColor="#FE581E"
|
||||
app:shaderMode="leftToRight"
|
||||
app:shaderStartColor="#FFB556" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:text="玫瑰玫瑰"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_bg" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
After Width: | Height: | Size: 3.9 KiB |
@@ -289,6 +289,19 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_charge_enter"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_treasure_box"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_first_charge_enter"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="首充红包" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="65dp"
|
||||
|
After Width: | Height: | Size: 44 KiB |
@@ -393,6 +393,10 @@ public class CustomAttachment implements MsgAttachment {
|
||||
public static final int CUSTOM_MSG_CHAT_HINT = 75;
|
||||
public static final int CUSTOM_MSG_SUB_CHAT_HINT = 751;
|
||||
|
||||
//首充礼包
|
||||
public static final int CUSTOM_MSG_FIRST_CHARGE = 76;
|
||||
public static final int CUSTOM_MSG_SUB_FIRST_CHARGE_PRIZE = 761;
|
||||
|
||||
//跨房PK
|
||||
public static final int CUSTOM_MSG_ROOM_PK = 83;
|
||||
public static final int CUSTOM_MSG_SUB_ROOM_PK_INVITE = 831;
|
||||
|
@@ -34,10 +34,13 @@ import com.yizhuan.xchat_android_core.miniworld.event.MWChatTopicEvent;
|
||||
import com.yizhuan.xchat_android_core.miniworld.event.MWGroupChatMemberEvent;
|
||||
import com.yizhuan.xchat_android_core.patriarch.bean.LimitNotice;
|
||||
import com.yizhuan.xchat_android_core.patriarch.event.ImPushMsgPmLimitTimeEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods;
|
||||
import com.yizhuan.xchat_android_core.pay.event.ChargeCustomNotificationEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstRechargeEvent;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_core.user.UserModel;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -283,6 +286,19 @@ public class IMSystemMsgManager {
|
||||
case CustomAttachment.CUSTOM_MSG_MATCH_TICKET:
|
||||
// TODO:获取赛事门票弹窗
|
||||
break;
|
||||
|
||||
case CustomAttachment.CUSTOM_MSG_FIRST_CHARGE:
|
||||
//首充成功
|
||||
if (subType == CustomAttachment.CUSTOM_MSG_SUB_FIRST_CHARGE_PRIZE) {
|
||||
if (UserModel.get().getCacheLoginUserInfo() != null) {
|
||||
UserModel.get().getCacheLoginUserInfo().setFirstCharge(false);
|
||||
}
|
||||
FirstChargeGoods firstChargeGoods = data.toJavaObject(FirstChargeGoods.class);
|
||||
FirstChargeEvent event = new FirstChargeEvent();
|
||||
event.setChargeProdTitle(firstChargeGoods.getChargeProdTitle());
|
||||
event.setFirstChargeRewardList(firstChargeGoods.getFirstChargeRewardList());
|
||||
EventBus.getDefault().post(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ import com.yizhuan.xchat_android_core.base.IModel;
|
||||
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
|
||||
import com.yizhuan.xchat_android_core.bean.response.result.ChargeListResult;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.ChargeBean;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WxPayType;
|
||||
import com.yizhuan.xchat_android_library.coremanager.IBaseCore;
|
||||
@@ -98,4 +99,5 @@ public interface IPayModel extends IModel {
|
||||
|
||||
Single<String> giveGold(long toUid, String goldNum,String password);
|
||||
|
||||
Single<List<FirstChargeGoods>> getFirstChargeList();
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import com.yizhuan.xchat_android_core.bean.response.result.WalletInfoResult;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.ChargeBean;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeGoods;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WxPayType;
|
||||
import com.yizhuan.xchat_android_core.pay.event.ChargeCustomNotificationEvent;
|
||||
@@ -423,6 +424,18 @@ public class PayModel extends BaseModel implements IPayModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首充产品列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<List<FirstChargeGoods>> getFirstChargeList(){
|
||||
return api.getFirstChargeList()
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchAndExce());
|
||||
}
|
||||
|
||||
public interface Api {
|
||||
|
||||
/**
|
||||
@@ -575,6 +588,14 @@ public class PayModel extends BaseModel implements IPayModel {
|
||||
Single<ServiceResult<String>> giveGold(@Field("toUid") long toUid,
|
||||
@Field("goldNum") String goldNum,
|
||||
@Field("password") String password);
|
||||
|
||||
/**
|
||||
* 获取首充产品列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET("/first/charge/list")
|
||||
Single<ServiceResult<List<FirstChargeGoods>>> getFirstChargeList();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package com.yizhuan.xchat_android_core.pay.bean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FirstChargeGoods {
|
||||
public FirstChargeGoods() {
|
||||
}
|
||||
private String chargeMoney;
|
||||
private String chargeProdDesc;
|
||||
private String chargeProdId;
|
||||
private String chargeProdTitle;
|
||||
private ArrayList<FirstChargeReward> firstChargeRewardList;
|
||||
private String giveMoney;
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
package com.yizhuan.xchat_android_core.pay.bean;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FirstChargeReward implements Parcelable {
|
||||
|
||||
public FirstChargeReward() {
|
||||
}
|
||||
|
||||
private String showPir;
|
||||
private String showText;
|
||||
private String showTime;
|
||||
|
||||
protected FirstChargeReward(Parcel in) {
|
||||
showPir = in.readString();
|
||||
showText = in.readString();
|
||||
showTime = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(showPir);
|
||||
dest.writeString(showText);
|
||||
dest.writeString(showTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<FirstChargeReward> CREATOR = new Creator<FirstChargeReward>() {
|
||||
@Override
|
||||
public FirstChargeReward createFromParcel(Parcel in) {
|
||||
return new FirstChargeReward(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FirstChargeReward[] newArray(int size) {
|
||||
return new FirstChargeReward[size];
|
||||
}
|
||||
};
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
package com.yizhuan.xchat_android_core.pay.event;
|
||||
|
||||
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FirstChargeEvent {
|
||||
private String chargeProdTitle;
|
||||
private ArrayList<FirstChargeReward> firstChargeRewardList;
|
||||
}
|
@@ -195,6 +195,10 @@ public class UserInfo implements Serializable {
|
||||
@Setter
|
||||
private String prefillInviteCode;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean isFirstCharge;
|
||||
|
||||
public Location getUserExpand() {
|
||||
return userExpand;
|
||||
}
|
||||
|