feat : 幸运礼包 UI图片
@@ -0,0 +1,13 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagConfig {
|
||||
public int expireSeconds;
|
||||
public List<Integer> goldItems;
|
||||
public List<Integer> numItems;
|
||||
public List<Integer> timeItems;
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagEntity {
|
||||
public long id;
|
||||
public String avatar;
|
||||
public String nick;
|
||||
public long userId;
|
||||
public long roomUid;
|
||||
public int status;
|
||||
public String Type;
|
||||
public long endTime; // 倒计时结束时间, 表时可以开抢了, (东八区)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagGiftBody {
|
||||
|
||||
public long roomUid;
|
||||
public long uid;
|
||||
public int countDownSecond;
|
||||
public String type = "GIFT";
|
||||
public int num;
|
||||
|
||||
public List<LuckyBagGiftItemBody> giftItems;
|
||||
|
||||
public void addLuckyBagGift(LuckyBagGiftItemBody index) {
|
||||
if (giftItems == null) {
|
||||
giftItems = new ArrayList<>();
|
||||
}
|
||||
giftItems.add(index);
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagGiftItemBody {
|
||||
public int giftId;
|
||||
public int giftNum;
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagGoldBody {
|
||||
|
||||
public long roomUid;
|
||||
public long uid;
|
||||
public String type = "DIAMOND";
|
||||
public int countDownSecond;
|
||||
public int num;
|
||||
public int goldNum;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
package com.chwl.app.avroom.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RoomLuckyBagInfo {
|
||||
|
||||
public List<LuckyBagEntity> redEnvelopeListVoList;
|
||||
public LuckyBagConfig redEnvelopeV2Config;
|
||||
|
||||
}
|
@@ -4,7 +4,6 @@ import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseDialogFragment
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
@@ -12,11 +11,21 @@ import com.chwl.app.bindadapter.BaseBindingViewHolder
|
||||
import com.chwl.app.databinding.DialogRoomLuckyBagBiliBinding
|
||||
import com.chwl.app.databinding.ItemRoomLuckyBagBiliBinding
|
||||
import com.chwl.app.ui.utils.load
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.bean.RoomBgInfo
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.user.UserModel
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.toColor
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.chwl.library.widget.text.DrawableTextView
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
import com.google.gson.JsonElement
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
class RoomLuckyBagBiliDialog : BaseDialogFragment<DialogRoomLuckyBagBiliBinding>() {
|
||||
|
||||
@@ -82,4 +91,35 @@ class RoomLuckyBagBiliDialog : BaseDialogFragment<DialogRoomLuckyBagBiliBinding>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private fun getBoomInfo(roomUid: Long): Single<RoomBgInfo> {
|
||||
return api.getBoomInfo(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun postDel(id: Long): Single<String> {
|
||||
return api.postDel(AvRoomDataManager.get().roomUid, id)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
|
||||
interface Api {
|
||||
@GET("/room/background/list")
|
||||
fun getBoomInfo(@Query("roomUid") roomUid: Long): Single<ServiceResult<RoomBgInfo>>
|
||||
|
||||
@POST("/room/background/del")
|
||||
fun postDel(
|
||||
@Query("roomUid") roomUid: Long,
|
||||
@Query("id") id: Long
|
||||
): Single<ServiceResult<JsonElement>>
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -4,10 +4,12 @@ import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.avroom.bean.LuckyBagGiftBody
|
||||
import com.chwl.app.avroom.bean.LuckyBagGoldBody
|
||||
import com.chwl.app.base.BaseDialogFragment
|
||||
import com.chwl.app.bindadapter.BaseBindingAdapter
|
||||
import com.chwl.app.bindadapter.BaseBindingViewHolder
|
||||
@@ -16,21 +18,32 @@ import com.chwl.app.databinding.ItemRoomLuckyBagGiftBinding
|
||||
import com.chwl.app.databinding.ItemRoomLuckyBagGoldBinding
|
||||
import com.chwl.app.databinding.ItemRoomLuckyBagTimeBinding
|
||||
import com.chwl.app.ui.utils.loadImage
|
||||
import com.chwl.app.utils.RoomLuckyBagManager
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.GiftModel
|
||||
import com.chwl.core.gift.bean.GiftType
|
||||
import com.chwl.core.gift.bean.LuckyBagGift
|
||||
import com.chwl.core.gift.bean.LuckyBagGold
|
||||
import com.chwl.core.gift.bean.LuckyBagTime
|
||||
import com.chwl.core.gift.bean.LuckyBagNumber
|
||||
import com.chwl.core.gift.bean.LuckyBagNumber.Type
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.core.widget.layoutmanager.pagergridlayoutmanager.PagerGridLayoutManager
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.isVerify
|
||||
import com.chwl.library.common.util.postSafe
|
||||
import com.chwl.library.common.util.setMargin
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.common.util.toColor
|
||||
import com.chwl.library.common.util.toDP
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.example.lib_utils.ktx.getColor
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.example.lib_utils.ktx.setPadding2
|
||||
import com.google.gson.JsonElement
|
||||
import com.youth.banner.config.IndicatorConfig
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.POST
|
||||
|
||||
class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
|
||||
@@ -66,10 +79,14 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
view?.let {
|
||||
when (it.id) {
|
||||
R.id.up -> {
|
||||
|
||||
mGiftData?.get(position)?.count = mGiftData?.get(position)?.count?.plus(1)
|
||||
mGiftAdapter.notifyItemChanged(position)
|
||||
}
|
||||
R.id.down -> {
|
||||
|
||||
if (mGiftData?.get(position)?.count != 0) {
|
||||
mGiftData?.get(position)?.count = mGiftData?.get(position)?.count?.minus(1)
|
||||
mGiftAdapter.notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
@@ -78,12 +95,24 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
}
|
||||
binding.rvListGiftType.layoutManager = PagerGridLayoutManager(2,4,PagerGridLayoutManager.HORIZONTAL,false).apply {
|
||||
setPagerChangedListener(object : PagerGridLayoutManager.PagerChangedListener {
|
||||
override fun onPagerCountChanged(pagerCount: Int) {
|
||||
|
||||
override fun onPagerCountChanged(pagerCount: Int) {
|
||||
binding.giftIndicator.initView(IndicatorConfig().apply {
|
||||
radius = 50.toDP()
|
||||
selectedColor = R.color.color_FFEA5C.getColor()
|
||||
normalColor = R.color.black.getColor()
|
||||
selectedWidth = 5.toDP()
|
||||
normalWidth = 5.toDP()
|
||||
indicatorSpace = 3.toDP()
|
||||
gravity = IndicatorConfig.Direction.CENTER
|
||||
isAttachToBanner = false
|
||||
currentPosition = 0
|
||||
indicatorSize = pagerCount
|
||||
})
|
||||
}
|
||||
|
||||
override fun onPagerIndexSelected(prePagerIndex: Int, currentPagerIndex: Int) {
|
||||
|
||||
binding.giftIndicator.onPageSelected(currentPagerIndex)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -95,11 +124,12 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
mGiftTimeAdapter.select(position)
|
||||
}
|
||||
}
|
||||
binding.rvListGiftTime.layoutManager = LinearLayoutManager(context,RecyclerView.HORIZONTAL,false)
|
||||
binding.rvListGiftTime.layoutManager = GridLayoutManager(context,4,RecyclerView.VERTICAL,false)
|
||||
binding.rvListGiftTime.adapter = mGiftTimeAdapter
|
||||
|
||||
|
||||
|
||||
|
||||
//--金币礼包
|
||||
|
||||
mGoldAdapter = GoldAdapter()
|
||||
@@ -108,7 +138,7 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
mGoldAdapter.select(position)
|
||||
}
|
||||
}
|
||||
binding.rvListGoldType.layoutManager = LinearLayoutManager(context,RecyclerView.HORIZONTAL,false)
|
||||
binding.rvListGoldType.layoutManager = GridLayoutManager(context,4,RecyclerView.VERTICAL,false)
|
||||
binding.rvListGoldType.adapter = mGoldAdapter
|
||||
|
||||
|
||||
@@ -119,7 +149,7 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
mGoldNumAdapter.select(position)
|
||||
}
|
||||
}
|
||||
binding.rvListGoldNum.layoutManager = LinearLayoutManager(context,RecyclerView.HORIZONTAL,false)
|
||||
binding.rvListGoldNum.layoutManager = GridLayoutManager(context,4,RecyclerView.VERTICAL,false)
|
||||
binding.rvListGoldNum.adapter = mGoldNumAdapter
|
||||
|
||||
mGoldTimeAdapter = NumberItemAdapter()
|
||||
@@ -128,7 +158,7 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
mGoldTimeAdapter.select(position)
|
||||
}
|
||||
}
|
||||
binding.rvListGiftTime.layoutManager = LinearLayoutManager(context,RecyclerView.HORIZONTAL,false)
|
||||
binding.rvListGiftTime.layoutManager = GridLayoutManager(context,4,RecyclerView.VERTICAL,false)
|
||||
binding.rvListGiftTime.adapter = mGoldTimeAdapter
|
||||
|
||||
|
||||
@@ -136,9 +166,46 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
|
||||
val giftInfoList = GiftModel.get().getGiftInfoList(GiftType.GIFT_TYPE_NORMAL)
|
||||
giftInfoList.forEach {
|
||||
mGiftData.add(LuckyBagGift()).apply {
|
||||
mGiftData.add(LuckyBagGift().apply {
|
||||
giftName = it.giftName
|
||||
giftPrice = it.goldPrice
|
||||
giftPic = it.giftUrl
|
||||
})
|
||||
}
|
||||
|
||||
RoomLuckyBagManager.mLuckyBagConfig?.let { config ->
|
||||
val goldData = arrayListOf<LuckyBagGold>()
|
||||
val goldNumData = arrayListOf<LuckyBagNumber>()
|
||||
val timeData = arrayListOf<LuckyBagNumber>()
|
||||
|
||||
|
||||
config.goldItems.forEach {
|
||||
goldData.add(LuckyBagGold().apply {
|
||||
number = it
|
||||
})
|
||||
}
|
||||
|
||||
config.numItems.forEach {
|
||||
goldNumData.add(LuckyBagNumber().apply {
|
||||
type = Type.num
|
||||
number = it
|
||||
})
|
||||
}
|
||||
|
||||
config.timeItems.forEach {
|
||||
timeData.add(LuckyBagNumber().apply {
|
||||
type = Type.time
|
||||
number = it
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
mGoldAdapter.setNewData(goldData)
|
||||
mGoldNumAdapter.setNewData(goldNumData)
|
||||
|
||||
mGoldTimeAdapter.setNewData(timeData)
|
||||
mGiftTimeAdapter.setNewData(timeData)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -159,15 +226,15 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
|
||||
private fun tabChange(isGift:Boolean) {
|
||||
if (isGift) {
|
||||
binding.bgGoldBag.setBackgroundResource(R.drawable.anim_match)
|
||||
binding.bgGiftBag.setBackgroundResource(R.drawable.anim_match)
|
||||
binding.bgGiftBag.setBackgroundResource(R.drawable.ic_lucky_bag_tab_bg_left_s)
|
||||
binding.bgGoldBag.setBackgroundResource(R.drawable.ic_lucky_bag_tab_bg_right_n)
|
||||
binding.giftBagLayout.setVis(true,true)
|
||||
binding.goldBagLayout.setVis(false, true)
|
||||
mIsGift = true
|
||||
changeViewStatus()
|
||||
} else {
|
||||
binding.bgGoldBag.setBackgroundResource(R.drawable.anim_match)
|
||||
binding.bgGiftBag.setBackgroundResource(R.drawable.anim_match)
|
||||
binding.bgGiftBag.setBackgroundResource(R.drawable.ic_lucky_bag_tab_bg_left_n)
|
||||
binding.bgGoldBag.setBackgroundResource(R.drawable.ic_lucky_bag_tab_bg_right_s)
|
||||
binding.goldBagLayout.setVis(true,true)
|
||||
binding.giftBagLayout.setVis(false,true)
|
||||
mIsGift = false
|
||||
@@ -194,8 +261,8 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
binding.groupGiftSelect.setVis(true)
|
||||
binding.groupReViewGift.setVis(false)
|
||||
|
||||
binding.flListGiftTypeLayout.setMargin(top = 37)
|
||||
binding.flListGiftTypeLayout.setViewWH(height = 282)
|
||||
binding.flListGiftTypeLayout.setMargin(top = 37, bottom = 90)
|
||||
// binding.flListGiftTypeLayout.setViewWH(height = 350)
|
||||
|
||||
binding.bottomSpace.setVis(true)
|
||||
binding.userGold.setVis(true)
|
||||
@@ -212,8 +279,8 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
binding.groupReViewGift.setVis(true)
|
||||
binding.groupGiftSelect.setVis(false)
|
||||
|
||||
binding.flListGiftTypeLayout.setMargin(top = 83)
|
||||
binding.flListGiftTypeLayout.setViewWH(height = 282)
|
||||
binding.flListGiftTypeLayout.setMargin(top = 83, bottom = 100)
|
||||
// binding.flListGiftTypeLayout.setViewWH(height = 300)
|
||||
|
||||
binding.bottomSpace.setVis(false)
|
||||
binding.userGold.setVis(false)
|
||||
@@ -246,10 +313,20 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
it.gold.text = item.giftPrice.toString()
|
||||
it.etNum.setText(item.count.toString())
|
||||
it.giftCount.text = item.count.toString()
|
||||
it.etNum.setTextColor(if (item.count > 0) R.color.color_FFEA5C.getColor() else R.color.white.getColor())
|
||||
|
||||
it.etNum.doOnTextChanged { text, start, before, count ->
|
||||
item.count = text?.toString()?.toInt()?:0
|
||||
it.giftCount.text = item.count.toString()
|
||||
val num = if (text.isVerify()) text.toString().toInt() else 0
|
||||
item.count = num
|
||||
it.giftCount?.postSafe {
|
||||
it.giftCount.text = item.count.toString()
|
||||
it.etNum.setTextColor(if (item.count> 0) R.color.color_FFEA5C.getColor() else R.color.white.getColor())
|
||||
}
|
||||
|
||||
if (!text.isVerify()) {
|
||||
it.etNum.setText("0")
|
||||
it.etNum.setSelection(it.etNum.text.length)
|
||||
}
|
||||
}
|
||||
|
||||
helper.addOnClickListener(R.id.up)
|
||||
@@ -264,11 +341,12 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class NumberItemAdapter : BaseBindingAdapter<ItemRoomLuckyBagTimeBinding, LuckyBagTime>() {
|
||||
private class NumberItemAdapter : BaseBindingAdapter<ItemRoomLuckyBagTimeBinding, LuckyBagNumber>() {
|
||||
|
||||
public fun select(pos:Int) {
|
||||
data?.forEachIndexed { index, luckyBagGold ->
|
||||
@@ -279,10 +357,10 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
|
||||
override fun convert(
|
||||
helper: BaseBindingViewHolder<ItemRoomLuckyBagTimeBinding>,
|
||||
item: LuckyBagTime
|
||||
item: LuckyBagNumber
|
||||
) {
|
||||
helper?.binding?.let {
|
||||
it.number.text = item.time.toString()
|
||||
it.number.text = item.number.toString()
|
||||
|
||||
if (item.isSelect()) {
|
||||
it.number.changeGradientColor("#ff9f00".toColor(),-1,"#fff437".toColor())
|
||||
@@ -326,10 +404,35 @@ class RoomLuckyBagDialog : BaseDialogFragment<DialogRoomLuckyBagBinding>() {
|
||||
it.gold.setTextColor(R.color.color_292601.getColor())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun sentGiftBag(body: LuckyBagGiftBody?): Single<String> {
|
||||
return api.sentGiftBag(body)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun sentGoldBag(body: LuckyBagGoldBody?): Single<String> {
|
||||
return api.sentGoldBag(body)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java)
|
||||
private interface Api {
|
||||
/**
|
||||
* 发包
|
||||
*/
|
||||
@POST("/new-red-envelope")
|
||||
fun sentGiftBag(@Body body: LuckyBagGiftBody?): Single<ServiceResult<JsonElement?>?>
|
||||
@POST("/new-red-envelope")
|
||||
fun sentGoldBag(@Body body: LuckyBagGoldBody?): Single<ServiceResult<JsonElement?>?>
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -14,19 +14,29 @@ import com.chwl.app.bindadapter.BaseBindingViewHolder
|
||||
import com.chwl.app.databinding.DialogRoomLuckyBagOpenBinding
|
||||
import com.chwl.app.databinding.ItemRoomLuckyBagViewOthersBinding
|
||||
import com.chwl.app.ui.utils.loadImage
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.gift.bean.LuckyBagViewOthers
|
||||
import com.chwl.core.gift.bean.RoomBgInfo
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.common.util.ClickUtils.click
|
||||
import com.chwl.library.common.util.setViewWH
|
||||
import com.chwl.library.common.util.setVis
|
||||
import com.chwl.library.common.util.toDP
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import com.example.lib_utils.ktx.getString
|
||||
import com.google.gson.JsonElement
|
||||
import io.reactivex.Single
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Query
|
||||
|
||||
class RoomLuckyBagOpenDialog : BaseDialogFragment<DialogRoomLuckyBagOpenBinding>() {
|
||||
|
||||
|
||||
override var width = WindowManager.LayoutParams.MATCH_PARENT
|
||||
override var width = 300.toDP()
|
||||
override var height = WindowManager.LayoutParams.WRAP_CONTENT
|
||||
override var dimAmount = 0f
|
||||
override var gravity = Gravity.CENTER
|
||||
@@ -59,10 +69,11 @@ class RoomLuckyBagOpenDialog : BaseDialogFragment<DialogRoomLuckyBagOpenBinding>
|
||||
}
|
||||
|
||||
if (isGift) {
|
||||
binding.bagImg.setImageResource(R.drawable.anim_match)
|
||||
binding.bagImg.setImageResource(R.drawable.ic_lucky_bag_btn_gift_pic)
|
||||
} else {
|
||||
binding.bagImg.setImageResource(R.drawable.anim_match)
|
||||
binding.bagImg.setImageResource(R.drawable.ic_lucky_bag_btn_gold_pic)
|
||||
}
|
||||
binding.bg.setBackgroundResource(R.drawable.ic_lucky_bag_open_bg)
|
||||
}
|
||||
|
||||
private fun doOpenBag() {
|
||||
@@ -134,6 +145,7 @@ class RoomLuckyBagOpenDialog : BaseDialogFragment<DialogRoomLuckyBagOpenBinding>
|
||||
|
||||
|
||||
binding.comingHint.text = R.string._ver_24_luckBagOpen_Empty.getString()
|
||||
binding.bagImg.setImageResource(R.drawable.ic_lucky_bag_empty)
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +155,7 @@ class RoomLuckyBagOpenDialog : BaseDialogFragment<DialogRoomLuckyBagOpenBinding>
|
||||
binding.rvListViewOthers.setVis(true)
|
||||
|
||||
binding.bg.setViewWH(height = 414)
|
||||
binding.bg.setBackgroundResource(R.drawable.ic_lucky_bag_open_bili_bg)
|
||||
|
||||
}
|
||||
|
||||
@@ -182,4 +195,36 @@ class RoomLuckyBagOpenDialog : BaseDialogFragment<DialogRoomLuckyBagOpenBinding>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private fun getBoomInfo(roomUid: Long): Single<RoomBgInfo> {
|
||||
return api.getBoomInfo(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private fun postLuckyBagOpen(redEnvelopeId: Long): Single<String> {
|
||||
return api.postLuckyBagOpen(redEnvelopeId)
|
||||
.compose(RxHelper.handleIgnoreData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
|
||||
interface Api {
|
||||
@GET("/room/background/list")
|
||||
fun getBoomInfo(@Query("roomUid") roomUid: Long): Single<ServiceResult<RoomBgInfo>>
|
||||
|
||||
|
||||
@POST("/new-red-envelope/open")
|
||||
fun postLuckyBagOpen(
|
||||
@Query("redEnvelopeId") redEnvelopeId: Long
|
||||
): Single<ServiceResult<JsonElement>>
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -81,6 +81,7 @@ import com.chwl.app.ui.widget.rollviewpager.Util
|
||||
import com.chwl.app.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.chwl.app.utils.KeyBoardUtils
|
||||
import com.chwl.app.utils.RoomBoomManager
|
||||
import com.chwl.app.utils.RoomLuckyBagManager
|
||||
import com.chwl.core.Constants
|
||||
import com.chwl.core.UriProvider
|
||||
import com.chwl.core.auth.AuthModel
|
||||
@@ -1868,6 +1869,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
|
||||
private fun upDateBoomExp(){
|
||||
AvRoomModel.get().getBoomInfo(AvRoomDataManager.get().roomUid)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess {
|
||||
it.forEach { info->
|
||||
if (info.currLevel) {
|
||||
@@ -1888,12 +1890,12 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
.doOnError {
|
||||
LogUtils.d(""+it?.message)
|
||||
}
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
private fun checkBoomInfo() {
|
||||
AvRoomModel.get().getRoomBoomInfo(AvRoomDataManager.get().roomUid)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnSuccess { boomInfo: RoomBoomInfo ->
|
||||
|
||||
if (boomInfo.roomBoomSignVoList.isVerify()) {
|
||||
@@ -1920,8 +1922,18 @@ open class BaseRoomFragment<V : IBaseRoomView?, P1 : BaseRoomPresenter<V>?> :
|
||||
.doOnError {
|
||||
LogUtils.d("")
|
||||
}
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe()
|
||||
|
||||
checkLuckyBagInfo()
|
||||
}
|
||||
|
||||
private fun checkLuckyBagInfo() {
|
||||
RoomLuckyBagManager.getLuckyBagInfo {
|
||||
if (isAdded) {
|
||||
"红包信息 = $it".doLog()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public fun initFloatBtnLayout() {
|
||||
|
49
app/src/main/java/com/chwl/app/utils/RoomLuckyBagManager.kt
Normal file
@@ -0,0 +1,49 @@
|
||||
package com.chwl.app.utils
|
||||
|
||||
import com.chwl.app.avroom.bean.LuckyBagConfig
|
||||
import com.chwl.app.avroom.bean.RoomLuckyBagInfo
|
||||
import com.chwl.core.bean.response.ServiceResult
|
||||
import com.chwl.core.manager.AvRoomDataManager
|
||||
import com.chwl.core.utils.net.RxHelper
|
||||
import com.chwl.library.net.rxnet.RxNet
|
||||
import io.reactivex.Single
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Query
|
||||
|
||||
object RoomLuckyBagManager {
|
||||
|
||||
var mLuckyBagConfig : LuckyBagConfig?= null
|
||||
|
||||
public fun getLuckyBagInfo(run:(info:RoomLuckyBagInfo)->Unit) {
|
||||
val roomUid = AvRoomDataManager.get().roomUid
|
||||
if (roomUid > 0) {
|
||||
getRoomLuckyBagInfo(roomUid)
|
||||
.doOnSuccess {
|
||||
mLuckyBagConfig = it.redEnvelopeV2Config
|
||||
run(it)
|
||||
}
|
||||
.subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private fun getRoomLuckyBagInfo(roomUid: Long): Single<RoomLuckyBagInfo> {
|
||||
return api.getRoomLuckyBagInfo(roomUid)
|
||||
.compose(RxHelper.handleBeanData())
|
||||
.compose(RxHelper.handleSchedulers())
|
||||
}
|
||||
|
||||
private val api: Api = RxNet.create(Api::class.java);
|
||||
|
||||
interface Api {
|
||||
|
||||
@GET("/new-red-envelope/list")
|
||||
fun getRoomLuckyBagInfo(@Query("roomUid") roomUid: Long): Single<ServiceResult<RoomLuckyBagInfo>>
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
78
app/src/main/java/com/chwl/app/view/MyCircleIndicator.java
Normal file
@@ -0,0 +1,78 @@
|
||||
package com.chwl.app.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.chwl.library.common.util.OtherExtKt;
|
||||
import com.youth.banner.config.IndicatorConfig;
|
||||
import com.youth.banner.indicator.BaseIndicator;
|
||||
|
||||
public class MyCircleIndicator extends BaseIndicator {
|
||||
private int mNormalRadius;
|
||||
private int mSelectedRadius;
|
||||
private int maxRadius;
|
||||
|
||||
|
||||
public MyCircleIndicator(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public MyCircleIndicator(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MyCircleIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mNormalRadius = config.getNormalWidth() / 2;
|
||||
mSelectedRadius = config.getSelectedWidth() / 2;
|
||||
}
|
||||
|
||||
public void initView(IndicatorConfig configs) {
|
||||
config = configs;
|
||||
mNormalRadius = config.getNormalWidth() / 2;
|
||||
mSelectedRadius = config.getSelectedWidth() / 2;
|
||||
this.post(() -> {
|
||||
int width = config.getSelectedWidth() + (config.getNormalWidth() * (config.getIndicatorSize() - 1)) + (config.getIndicatorSpace() * ( config.getIndicatorSize() - 1));
|
||||
OtherExtKt.setViewWH(this,width,null,false);
|
||||
invalidate();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
// super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
// int count = config.getIndicatorSize();
|
||||
// if (count <= 1) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// mNormalRadius = config.getNormalWidth() / 2;
|
||||
// mSelectedRadius = config.getSelectedWidth() / 2;
|
||||
// //考虑当 选中和默认 的大小不一样的情况
|
||||
// maxRadius = Math.max(mSelectedRadius, mNormalRadius);
|
||||
// //间距*(总数-1)+选中宽度+默认宽度*(总数-1)
|
||||
// int width = (count - 1) * config.getIndicatorSpace() + config.getSelectedWidth() + config.getNormalWidth() * (count - 1);
|
||||
// setMeasuredDimension(width, Math.max(config.getNormalWidth(), config.getSelectedWidth()));
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
int count = config.getIndicatorSize();
|
||||
if (count <= 1) {
|
||||
return;
|
||||
}
|
||||
float left = 0;
|
||||
for (int i = 0; i < count; i++) {
|
||||
mPaint.setColor(config.getCurrentPosition() == i ? config.getSelectedColor() : config.getNormalColor());
|
||||
int indicatorWidth = config.getCurrentPosition() == i ? config.getSelectedWidth() : config.getNormalWidth();
|
||||
int radius = config.getCurrentPosition() == i ? mSelectedRadius : mNormalRadius;
|
||||
canvas.drawCircle(left + radius, indicatorWidth, radius, mPaint);
|
||||
left += indicatorWidth + config.getIndicatorSpace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 259 KiB |
After Width: | Height: | Size: 262 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_add.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_bg.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_bili.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_bili_back.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_bili_bg.png
Normal file
After Width: | Height: | Size: 407 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_btn_gift_pic.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_btn_gold_pic.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_confirm.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_empty.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_msg_gift_bg.png
Normal file
After Width: | Height: | Size: 259 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_msg_gold_bg.png
Normal file
After Width: | Height: | Size: 261 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_open_bg.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_open_bili_bg.png
Normal file
After Width: | Height: | Size: 142 KiB |
After Width: | Height: | Size: 323 KiB |
After Width: | Height: | Size: 328 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_rule.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_tab_bg_left_n.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_tab_bg_left_s.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_tab_bg_right_n.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_tab_bg_right_s.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_tab_center.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_title_left.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_lucky_bag_title_right.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
@@ -5,9 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/black"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/black">
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/notifyView"
|
||||
@@ -16,6 +14,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="650dp"
|
||||
android:background="@drawable/ic_lucky_bag_bg"
|
||||
android:layout_marginTop="-43dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -23,6 +22,8 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/topLayout"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:layoutDirection="ltr"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="108dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@@ -30,6 +31,7 @@
|
||||
<ImageView
|
||||
android:id="@+id/bgGiftBag"
|
||||
android:layout_width="0dp"
|
||||
android:background="@drawable/ic_lucky_bag_tab_bg_left_s"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginStart="9dp"
|
||||
app:layout_constraintEnd_toStartOf="@id/bgGoldBag"
|
||||
@@ -54,6 +56,7 @@
|
||||
android:id="@+id/bgGoldBag"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="47dp"
|
||||
android:background="@drawable/ic_lucky_bag_tab_bg_right_n"
|
||||
android:layout_marginEnd="9dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bgGiftBag"
|
||||
@@ -95,7 +98,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/giftBagLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
|
||||
@@ -104,13 +107,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layoutDirection="ltr"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_left" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -123,34 +127,80 @@
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/flListGiftTypeLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="282dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="37dp"
|
||||
android:layout_marginBottom="94dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGiftType"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<com.youth.banner.indicator.CircleIndicator
|
||||
<com.chwl.app.view.MyCircleIndicator
|
||||
android:id="@+id/giftIndicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
tools:background="@color/blue"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/flListGiftTypeLayout" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lineGiftTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layoutDirection="ltr"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/rvListGiftTime">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_lucky_bag_title_left" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="@string/_ver_24_Waiting_time"
|
||||
android:textColor="@color/color_FFEA5C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_lucky_bag_title_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGiftTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_height="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reviewTime"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -183,40 +233,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/reviewTime"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lineGiftTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
app:layout_constraintTop_toBottomOf="@+id/flListGiftTypeLayout">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:text="@string/_ver_24_Waiting_time"
|
||||
android:textColor="@color/color_FFEA5C"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGiftTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/lineGiftTime" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
@@ -242,7 +259,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/goldBagLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@id/topLayout"
|
||||
tools:visibility="gone">
|
||||
@@ -250,6 +267,7 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGoldType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="52dp"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -259,13 +277,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="47dp"
|
||||
android:layoutDirection="ltr"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rvListGoldType">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_left" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -278,13 +297,14 @@
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGoldNum"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/lineGoldNum" />
|
||||
@@ -295,13 +315,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="44dp"
|
||||
android:layoutDirection="ltr"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rvListGoldNum">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_left" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -314,13 +335,14 @@
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_room_boom_info_bg" />
|
||||
android:src="@drawable/ic_lucky_bag_title_right" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvListGoldTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginHorizontal="17dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/lineGoldTime" />
|
||||
@@ -336,6 +358,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
@@ -364,7 +387,7 @@
|
||||
app:dt_drawableLeftSrc="@drawable/ic_coin_84"
|
||||
app:dt_drawableLeftWidth="21dp"
|
||||
app:dt_drawableRightHeight="17dp"
|
||||
app:dt_drawableRightSrc="@drawable/ic_coin_84"
|
||||
app:dt_drawableRightSrc="@drawable/ic_lucky_bag_add"
|
||||
app:dt_drawableRightWidth="17dp"
|
||||
app:dt_drawableType="shape"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottomSpace"
|
||||
@@ -385,9 +408,9 @@
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginTop="9.5dp"
|
||||
android:background="@color/white"
|
||||
android:background="@drawable/ic_lucky_bag_confirm"
|
||||
android:gravity="center"
|
||||
android:text="@string/camera_roll"
|
||||
android:text="@string/_ver_24_Send_Gift_Lucky_Bag"
|
||||
android:textColor="#292601"
|
||||
android:textSize="15sp"
|
||||
app:dt_drawableType="shape"
|
||||
@@ -403,8 +426,9 @@
|
||||
android:id="@+id/btnMore"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:paddingTop="3dp"
|
||||
android:src="@drawable/ic_lucky_bag_bili"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnBill"
|
||||
app:layout_constraintTop_toBottomOf="@id/topLayout" />
|
||||
|
||||
@@ -413,6 +437,7 @@
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/ic_lucky_bag_rule"
|
||||
android:paddingTop="3dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/topLayout" />
|
||||
|
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="485dp"
|
||||
android:layout_gravity="bottom"
|
||||
tools:background="@color/black">
|
||||
android:background="@drawable/ic_lucky_bag_bili_bg">
|
||||
|
||||
|
||||
<ImageView
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="30dp"
|
||||
android:paddingHorizontal="11dp"
|
||||
android:src="@drawable/treasure_fairy_ic_back"
|
||||
android:src="@drawable/ic_lucky_bag_bili_back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="300dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
@@ -11,6 +12,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="326dp"
|
||||
android:layout_marginTop="38dp"
|
||||
android:background="@drawable/ic_lucky_bag_open_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/avatar" />
|
||||
|
||||
<com.chwl.core.widget.img.MyCircleImageView
|
||||
@@ -54,6 +56,7 @@
|
||||
android:id="@+id/bagImg"
|
||||
android:layout_width="123dp"
|
||||
android:layout_height="123dp"
|
||||
android:src="@drawable/ic_lucky_bag_btn_gift_pic"
|
||||
android:layout_marginTop="8.5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -184,8 +187,11 @@
|
||||
android:minWidth="190dp"
|
||||
android:minHeight="47dp"
|
||||
android:paddingHorizontal="85dp"
|
||||
android:background="@drawable/ic_lucky_bag_confirm"
|
||||
android:paddingVertical="17dp"
|
||||
android:text="@string/ok"
|
||||
android:textColor="#292601"
|
||||
android:textStyle="bold"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@@ -4,8 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="8dp"
|
||||
android:layout_marginBottom="7.5dp"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
tools:background="@color/red_font">
|
||||
|
||||
<ImageView
|
||||
@@ -23,7 +23,7 @@
|
||||
android:id="@+id/giftName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
@@ -36,11 +36,11 @@
|
||||
android:id="@+id/giftCount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:visibility="gone"
|
||||
android:lines="1"
|
||||
android:text="@string/loading"
|
||||
android:textColor="@color/color_FFEA5C"
|
||||
@@ -50,12 +50,12 @@
|
||||
<com.chwl.library.widget.text.DrawableTextView
|
||||
android:id="@+id/gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:lines="1"
|
||||
android:layout_marginTop="3dp"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="0000"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_FFEA5C"
|
||||
android:textSize="13sp"
|
||||
app:dt_drawableLeftHeight="16dp"
|
||||
@@ -70,7 +70,7 @@
|
||||
android:id="@+id/bgNumber"
|
||||
android:layout_width="61dp"
|
||||
android:layout_height="21dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginTop="3dp"
|
||||
app:dt_drawableType="shape"
|
||||
app:dt_radius="4dp"
|
||||
app:dt_soildColor="@color/black_transparent_20"
|
||||
|
@@ -3,10 +3,9 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="10dp"
|
||||
android:text="0"
|
||||
android:textColor="@color/color_FFEA5C"
|
||||
android:textSize="12sp"
|
||||
|
@@ -1,10 +1,9 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:background="@color/black">
|
||||
android:background="@drawable/ic_lucky_bag_msg_gift_bg">
|
||||
|
||||
|
||||
<ImageView
|
||||
|
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="@color/color_7b7b7d">
|
||||
android:background="@drawable/ic_lucky_bag_room_notify_gift_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
|
@@ -4,6 +4,6 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagGold {
|
||||
public int time;
|
||||
public int number;
|
||||
public boolean isSelect;
|
||||
}
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagNumber {
|
||||
public int type;
|
||||
public int number;
|
||||
public boolean isSelect;
|
||||
|
||||
|
||||
public @interface Type{
|
||||
int time = 1;
|
||||
int num = 2;
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
package com.chwl.core.gift.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LuckyBagTime {
|
||||
public int time;
|
||||
public boolean isSelect;
|
||||
}
|
@@ -202,6 +202,7 @@ fun Int.isVerify(list : List<Any>?) : Boolean{
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
fun Double?.toNumString(byte:Int = 2) : String {
|
||||
if (this == null) {
|
||||
return "0"
|
||||
|