首充获取奖品弹窗UI适配
This commit is contained in:
@@ -106,19 +106,25 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
|
||||
binding.ivHelp.setOnClickListener { showHelpPopup() }
|
||||
binding.tvCharge.setOnClickListener {
|
||||
val channel = AppMetaDataUtil.getChannelID()
|
||||
if(position == -1){
|
||||
if (position == -1) {
|
||||
ResUtil.getString(R.string.avroom_firstcharge_firstchargedialog_01).toast()
|
||||
}else if (channel.equals("google")) {
|
||||
} else if (channel.equals("google")) {
|
||||
goodsList?.get(position)?.let { charge ->
|
||||
buyProduct(charge.skuDetails)
|
||||
}
|
||||
} else {
|
||||
CommonWebViewActivity.start(context, UriProvider.getOfficialPay(6, DeviceConfig.getDeviceId(context)))
|
||||
CommonWebViewActivity.start(
|
||||
context,
|
||||
UriProvider.getOfficialPay(6, DeviceConfig.getDeviceId(context))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter().also { rewardAdapter = it })
|
||||
.setAdapter(
|
||||
RewardAdapter((ScreenUtil.screenWidth * 0.66f / 3f).toInt())
|
||||
.also { rewardAdapter = it }
|
||||
)
|
||||
.setLayoutManager(FlexboxLayoutManager(context).apply {
|
||||
alignItems = AlignItems.STRETCH
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
|
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import com.google.android.flexbox.AlignItems
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
import com.google.android.flexbox.JustifyContent
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogFirstChargePrizeBinding
|
||||
import com.yizhuan.erban.treasure_box.widget.dialog.BaseBindingDialog
|
||||
@@ -15,14 +16,14 @@ import com.yizhuan.xchat_android_library.annatation.ActLayoutRes
|
||||
class FirstChargePrizeDialog(
|
||||
context: Context,
|
||||
val title: String?,
|
||||
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||
private val firstChargeRewardList: List<FirstChargeReward>?
|
||||
) : BaseBindingDialog<DialogFirstChargePrizeBinding>(context) {
|
||||
|
||||
private lateinit var rvDelegate: RVDelegate<FirstChargeReward>
|
||||
|
||||
override fun init() {
|
||||
rvDelegate = RVDelegate.Builder<FirstChargeReward>()
|
||||
.setAdapter(RewardAdapter())
|
||||
.setAdapter(RewardAdapter(ScreenUtil.dip2px(248f) / 3))
|
||||
.setLayoutManager(FlexboxLayoutManager(context).apply {
|
||||
alignItems = AlignItems.STRETCH
|
||||
justifyContent = JustifyContent.SPACE_EVENLY
|
||||
|
@@ -10,11 +10,11 @@ import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.pay.bean.FirstChargeReward
|
||||
import com.yizhuan.xchat_android_core.utils.TextUtils
|
||||
|
||||
class RewardAdapter :
|
||||
class RewardAdapter(private val itemWidth: Int) :
|
||||
BaseQuickAdapter<FirstChargeReward, BaseViewHolder>(R.layout.item_first_charge_reward) {
|
||||
override fun convert(helper: BaseViewHolder, item: FirstChargeReward) {
|
||||
helper.itemView.updateLayoutParams<RecyclerView.LayoutParams> {
|
||||
width = (ScreenUtil.screenWidth * 0.66f / 3f).toInt()
|
||||
width = itemWidth
|
||||
}
|
||||
ImageLoadUtils.loadImage(
|
||||
mContext,
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -38,8 +39,11 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
tools:listitem="@layout/item_first_charge_reward"
|
||||
tools:itemCount="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp" />
|
||||
android:layout_marginTop="15dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
Reference in New Issue
Block a user