夺宝精灵:1.赠送精灵 2.UI切图调整
@@ -2,15 +2,12 @@ package com.mango.moshen.treasurefairy
|
|||||||
|
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.mango.moshen.base.BaseViewModel
|
|
||||||
import com.mango.core.bean.response.ListResult
|
import com.mango.core.bean.response.ListResult
|
||||||
import com.mango.core.gift.bean.SimpleUserInfo
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
import com.mango.core.home.bean.HomeRoomInfo
|
|
||||||
import com.mango.core.home.model.HomeModel
|
|
||||||
import com.mango.core.room.wishlist.WishListModel
|
|
||||||
import com.mango.core.treasurefairy.*
|
import com.mango.core.treasurefairy.*
|
||||||
import com.mango.core.utils.net.ServerException
|
import com.mango.core.utils.net.ServerException
|
||||||
import com.mango.core.utils.toast
|
import com.mango.core.utils.toast
|
||||||
|
import com.mango.moshen.base.BaseViewModel
|
||||||
import com.mango.moshen.base.Event
|
import com.mango.moshen.base.Event
|
||||||
|
|
||||||
class FairyViewModel : BaseViewModel() {
|
class FairyViewModel : BaseViewModel() {
|
||||||
@@ -48,8 +45,8 @@ class FairyViewModel : BaseViewModel() {
|
|||||||
private val _sendFairyLiveData = MutableLiveData<Boolean>()
|
private val _sendFairyLiveData = MutableLiveData<Boolean>()
|
||||||
val sendFairyLiveData: LiveData<Boolean> = _sendFairyLiveData
|
val sendFairyLiveData: LiveData<Boolean> = _sendFairyLiveData
|
||||||
|
|
||||||
private val _askForFairyLiveData = MutableLiveData<Boolean>()
|
private val _sendFairyRecordLiveData = MutableLiveData<ListResult<SendFairyInfo>>()
|
||||||
val askForFairyLiveData: LiveData<Boolean> = _askForFairyLiveData
|
val sendFairyRecordLiveData: LiveData<ListResult<SendFairyInfo>> = _sendFairyRecordLiveData
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -160,14 +157,14 @@ class FairyViewModel : BaseViewModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getFriendsList() {
|
fun getFriendsList(nick: String? = null) {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
_friendsListLiveData.value = null
|
_friendsListLiveData.value = null
|
||||||
it.message.toast()
|
it.message.toast()
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
_friendsListLiveData.value = TreasureFairyModel.getFriendsList()
|
_friendsListLiveData.value = TreasureFairyModel.getFriendsList(nick)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -176,12 +173,12 @@ class FairyViewModel : BaseViewModel() {
|
|||||||
fun askForFairy(elfId: Long, targetUid: Long) {
|
fun askForFairy(elfId: Long, targetUid: Long) {
|
||||||
safeLaunch(
|
safeLaunch(
|
||||||
onError = {
|
onError = {
|
||||||
_askForFairyLiveData.value = false
|
_sendFairyLiveData.value = false
|
||||||
it.message.toast()
|
it.message.toast()
|
||||||
},
|
},
|
||||||
block = {
|
block = {
|
||||||
TreasureFairyModel.askForFairy(elfId, targetUid)
|
TreasureFairyModel.askForFairy(elfId, targetUid)
|
||||||
_askForFairyLiveData.value = true
|
_sendFairyLiveData.value = true
|
||||||
"已向好友发送索要信息".toast()
|
"已向好友发送索要信息".toast()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -201,4 +198,19 @@ class FairyViewModel : BaseViewModel() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getSendFairyList(
|
||||||
|
page: Int,
|
||||||
|
pageSize: Int
|
||||||
|
) {
|
||||||
|
safeLaunch(
|
||||||
|
onError = {
|
||||||
|
_sendFairyRecordLiveData.value = ListResult.failed(page)
|
||||||
|
},
|
||||||
|
block = {
|
||||||
|
val result = TreasureFairyModel.getSendFairyList(page, pageSize)
|
||||||
|
_sendFairyRecordLiveData.value = ListResult.success(result, page)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -46,6 +46,10 @@ class ForestFairyDialog : BaseDialog<TreasureFairyDialogForestBinding>() {
|
|||||||
MyFairyDialog.newInstance().show(context)
|
MyFairyDialog.newInstance().show(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.ivFairyTest.setOnClickListener {
|
||||||
|
TestFairyDialog.newInstance().show(context)
|
||||||
|
}
|
||||||
|
|
||||||
binding.ivPrevious.setOnClickListener {
|
binding.ivPrevious.setOnClickListener {
|
||||||
currentType--
|
currentType--
|
||||||
switchType()
|
switchType()
|
||||||
|
@@ -5,6 +5,7 @@ import android.os.Bundle
|
|||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import androidx.core.view.updateLayoutParams
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
@@ -13,6 +14,7 @@ import com.mango.moshen.R
|
|||||||
import com.mango.moshen.base.BaseDialog
|
import com.mango.moshen.base.BaseDialog
|
||||||
import com.mango.moshen.databinding.TreasureFairyDialogForestPrizeBinding
|
import com.mango.moshen.databinding.TreasureFairyDialogForestPrizeBinding
|
||||||
import com.mango.moshen.ui.utils.RVDelegate
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||||
|
|
||||||
class ForestPrizeDialog : BaseDialog<TreasureFairyDialogForestPrizeBinding>() {
|
class ForestPrizeDialog : BaseDialog<TreasureFairyDialogForestPrizeBinding>() {
|
||||||
|
|
||||||
@@ -53,11 +55,11 @@ class ForestPrizeDialog : BaseDialog<TreasureFairyDialogForestPrizeBinding>() {
|
|||||||
prizeInfoList.filter { if (isFairy) (it.propType != 1) else (it.propType == 1) }
|
prizeInfoList.filter { if (isFairy) (it.propType != 1) else (it.propType == 1) }
|
||||||
val isShowDateSingle = showPrizeInfoList.size == 1
|
val isShowDateSingle = showPrizeInfoList.size == 1
|
||||||
if (!isShowDateSingle) {
|
if (!isShowDateSingle) {
|
||||||
|
binding.viewBg.updateLayoutParams {
|
||||||
|
width = ScreenUtil.dip2px(318f)
|
||||||
|
height = ScreenUtil.dip2px(383f)
|
||||||
|
}
|
||||||
binding.viewBg.setBackgroundResource(R.drawable.treasure_fairy_bg_forest_prize)
|
binding.viewBg.setBackgroundResource(R.drawable.treasure_fairy_bg_forest_prize)
|
||||||
val layoutParams = binding.viewBg.layoutParams as ConstraintLayout.LayoutParams
|
|
||||||
layoutParams.dimensionRatio = "636:766"
|
|
||||||
layoutParams.matchConstraintPercentWidth = 0.85f
|
|
||||||
binding.viewBg.layoutParams = layoutParams
|
|
||||||
}
|
}
|
||||||
prizeAdapter = ForestPrizeAdapter(isShowDateSingle)
|
prizeAdapter = ForestPrizeAdapter(isShowDateSingle)
|
||||||
rvDelegate = RVDelegate.Builder<PrizeInfo>()
|
rvDelegate = RVDelegate.Builder<PrizeInfo>()
|
||||||
|
@@ -15,6 +15,7 @@ import androidx.core.content.ContextCompat
|
|||||||
import androidx.core.graphics.toColorInt
|
import androidx.core.graphics.toColorInt
|
||||||
import com.mango.core.UriProvider
|
import com.mango.core.UriProvider
|
||||||
import com.mango.core.treasurefairy.PrizeInfo
|
import com.mango.core.treasurefairy.PrizeInfo
|
||||||
|
import com.mango.core.utils.LogUtils
|
||||||
import com.mango.moshen.R
|
import com.mango.moshen.R
|
||||||
import com.mango.moshen.base.BaseViewBindingActivity
|
import com.mango.moshen.base.BaseViewBindingActivity
|
||||||
import com.mango.moshen.common.widget.dialog.DialogManager
|
import com.mango.moshen.common.widget.dialog.DialogManager
|
||||||
@@ -62,6 +63,7 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
|||||||
ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(this)
|
ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(this)
|
||||||
)
|
)
|
||||||
window.setGravity(Gravity.BOTTOM)
|
window.setGravity(Gravity.BOTTOM)
|
||||||
|
binding.fairyItem0.isSelected = true
|
||||||
looperHintPrize()
|
looperHintPrize()
|
||||||
binding.tvKeyNum.setOnClickListener {
|
binding.tvKeyNum.setOnClickListener {
|
||||||
FairyDialogWebViewActivity.start(this, UriProvider.getFairyKey())
|
FairyDialogWebViewActivity.start(this, UriProvider.getFairyKey())
|
||||||
@@ -105,9 +107,20 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.prizeInfoListLiveData.observe(this) {
|
||||||
|
it?.forEachIndexed { index, prizeInfo ->
|
||||||
|
if (index < fairyItems.size) {
|
||||||
|
fairyItems[index].setPrizeInfo(prizeInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.resultLiveData.observe(this) { event ->
|
viewModel.resultLiveData.observe(this) { event ->
|
||||||
event?.getContentIfNotHandled()?.let {
|
event?.getContentIfNotHandled()?.let {
|
||||||
targetIndex = viewModel.prizeInfoListLiveData.value?.indexOf(it[0]) ?: -2
|
targetIndex = viewModel.prizeInfoListLiveData.value
|
||||||
|
?.indexOfFirst { prize ->
|
||||||
|
it[0].itemIndex == prize.itemIndex
|
||||||
|
} ?: -2
|
||||||
if (targetIndex == -2) {
|
if (targetIndex == -2) {
|
||||||
viewModel.initPrizeInfoList()
|
viewModel.initPrizeInfoList()
|
||||||
}
|
}
|
||||||
@@ -118,12 +131,6 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.prizeInfoListLiveData.observe(this) {
|
|
||||||
it?.forEachIndexed { index, prizeInfo ->
|
|
||||||
fairyItems[index].setPrizeInfo(prizeInfo)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.drawInfoLiveData.observe(this) {
|
viewModel.drawInfoLiveData.observe(this) {
|
||||||
it?.let {
|
it?.let {
|
||||||
binding.tvKeyNum.text = it.drawTicketNum.toString()
|
binding.tvKeyNum.text = it.drawTicketNum.toString()
|
||||||
|
@@ -2,6 +2,7 @@ package com.mango.moshen.treasurefairy
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.widget.FrameLayout
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import androidx.annotation.Nullable
|
import androidx.annotation.Nullable
|
||||||
import com.mango.core.treasurefairy.PrizeInfo
|
import com.mango.core.treasurefairy.PrizeInfo
|
||||||
@@ -16,7 +17,7 @@ class HomeItemView @JvmOverloads constructor(
|
|||||||
context: Context,
|
context: Context,
|
||||||
@Nullable attrs: AttributeSet? = null,
|
@Nullable attrs: AttributeSet? = null,
|
||||||
defStyleAttr: Int = 0
|
defStyleAttr: Int = 0
|
||||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
private val binding: TreasureFairyItemHomeBinding
|
private val binding: TreasureFairyItemHomeBinding
|
||||||
|
|
||||||
|
@@ -35,6 +35,9 @@ class MyFairyDialog : BaseDialog<TreasureFairyDialogMyFairyBinding>() {
|
|||||||
binding.ivBack.setOnClickListener {
|
binding.ivBack.setOnClickListener {
|
||||||
dismissAllowingStateLoss()
|
dismissAllowingStateLoss()
|
||||||
}
|
}
|
||||||
|
binding.ivRecord.setOnClickListener {
|
||||||
|
MyFairyRecordDialog.newInstance().show(context)
|
||||||
|
}
|
||||||
binding.rg.setOnCheckedChangeListener { _, checkedId ->
|
binding.rg.setOnCheckedChangeListener { _, checkedId ->
|
||||||
when (checkedId) {
|
when (checkedId) {
|
||||||
R.id.rb_base -> binding.viewPager.currentItem = 0
|
R.id.rb_base -> binding.viewPager.currentItem = 0
|
||||||
|
@@ -4,19 +4,25 @@ import android.widget.ImageView
|
|||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
import com.chad.library.adapter.base.BaseViewHolder
|
import com.chad.library.adapter.base.BaseViewHolder
|
||||||
import com.mango.core.treasurefairy.FairyInfo
|
import com.mango.core.treasurefairy.FairyInfo
|
||||||
|
import com.mango.core.treasurefairy.SendFairyInfo
|
||||||
import com.mango.moshen.R
|
import com.mango.moshen.R
|
||||||
import com.mango.moshen.ui.utils.load
|
import com.mango.moshen.ui.utils.load
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MyFairyRecordAdapter :
|
class MyFairyRecordAdapter :
|
||||||
BaseQuickAdapter<FairyInfo, BaseViewHolder>(R.layout.treasure_fairy_item_my_fairy_record) {
|
BaseQuickAdapter<SendFairyInfo, BaseViewHolder>(R.layout.treasure_fairy_item_my_fairy_record) {
|
||||||
|
|
||||||
private val format = SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒", Locale.CHINA)
|
private val format = SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒", Locale.CHINA)
|
||||||
|
|
||||||
override fun convert(helper: BaseViewHolder, item: FairyInfo) {
|
override fun convert(helper: BaseViewHolder, item: SendFairyInfo) {
|
||||||
helper.getView<ImageView>(R.id.iv_prize_icon).load(item.elfPicUrl)
|
helper.getView<ImageView>(R.id.iv_fairy_icon).load(item.elfPicUrl)
|
||||||
helper.setText(R.id.tv_prize_name, item.elfName)
|
helper.setText(R.id.tv_record_time, format.format(item.createTime))
|
||||||
|
val isSend = item.type == 2
|
||||||
|
helper.setText(
|
||||||
|
R.id.tv_content,
|
||||||
|
"${if (isSend) "你" else ""}赠送${if (isSend) "" else "了你"}一张“${item.elfName}”精灵卡"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -7,6 +7,7 @@ import android.view.WindowManager
|
|||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.mango.core.treasurefairy.FairyInfo
|
import com.mango.core.treasurefairy.FairyInfo
|
||||||
|
import com.mango.core.treasurefairy.SendFairyInfo
|
||||||
import com.mango.moshen.base.BaseDialog
|
import com.mango.moshen.base.BaseDialog
|
||||||
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyRecordBinding
|
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyRecordBinding
|
||||||
import com.mango.moshen.ui.utils.RVDelegate
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
@@ -25,19 +26,34 @@ class MyFairyRecordDialog : BaseDialog<TreasureFairyDialogMyFairyRecordBinding>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var rvDelegate: RVDelegate<FairyInfo>
|
private var page = 1
|
||||||
|
private val pageSize = 20
|
||||||
|
private lateinit var rvDelegate: RVDelegate<SendFairyInfo>
|
||||||
private lateinit var recordAdapter: MyFairyRecordAdapter
|
private lateinit var recordAdapter: MyFairyRecordAdapter
|
||||||
private val viewModel: FairyViewModel by activityViewModels()
|
private val viewModel: FairyViewModel by activityViewModels()
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
override fun init() {
|
override fun init() {
|
||||||
viewModel.getMyFairyInfo()
|
|
||||||
recordAdapter = MyFairyRecordAdapter()
|
recordAdapter = MyFairyRecordAdapter()
|
||||||
rvDelegate = RVDelegate.Builder<FairyInfo>()
|
rvDelegate = RVDelegate.Builder<SendFairyInfo>()
|
||||||
.setAdapter(recordAdapter)
|
.setAdapter(recordAdapter)
|
||||||
.setRecyclerView(binding.recyclerView)
|
.setRecyclerView(binding.recyclerView)
|
||||||
.setLayoutManager(LinearLayoutManager(context))
|
.setLayoutManager(LinearLayoutManager(context))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
viewModel.sendFairyRecordLiveData.observe(viewLifecycleOwner) {
|
||||||
|
rvDelegate.loadData(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
recordAdapter.setOnLoadMoreListener({ loadData(false) }, binding.recyclerView)
|
||||||
|
|
||||||
|
loadData(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun loadData(isRefresh: Boolean) {
|
||||||
|
page = if (isRefresh) 1 else (page + 1)
|
||||||
|
viewModel.getSendFairyList(page, pageSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import androidx.core.widget.doAfterTextChanged
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.mango.core.gift.bean.SimpleUserInfo
|
import com.mango.core.gift.bean.SimpleUserInfo
|
||||||
@@ -18,7 +19,7 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
|||||||
override var gravity = Gravity.BOTTOM
|
override var gravity = Gravity.BOTTOM
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun newInstance(fairyInfo: FairyInfo,isSend:Boolean): MyFairySearchFriendsDialog {
|
fun newInstance(fairyInfo: FairyInfo, isSend: Boolean): MyFairySearchFriendsDialog {
|
||||||
val args = Bundle()
|
val args = Bundle()
|
||||||
args.putSerializable("fairyInfo", fairyInfo)
|
args.putSerializable("fairyInfo", fairyInfo)
|
||||||
args.putBoolean("isSend", isSend)
|
args.putBoolean("isSend", isSend)
|
||||||
@@ -34,6 +35,7 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
|||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
binding.ivBack.setOnClickListener { dismissAllowingStateLoss() }
|
||||||
friendsAdapter = MyFairyFriendsAdapter()
|
friendsAdapter = MyFairyFriendsAdapter()
|
||||||
rvDelegate = RVDelegate.Builder<SimpleUserInfo>()
|
rvDelegate = RVDelegate.Builder<SimpleUserInfo>()
|
||||||
.setAdapter(friendsAdapter)
|
.setAdapter(friendsAdapter)
|
||||||
@@ -49,6 +51,10 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
|||||||
viewModel.friendsListLiveData.observe(viewLifecycleOwner) {
|
viewModel.friendsListLiveData.observe(viewLifecycleOwner) {
|
||||||
rvDelegate.setNewData(it)
|
rvDelegate.setNewData(it)
|
||||||
}
|
}
|
||||||
|
binding.editSearch.doAfterTextChanged {
|
||||||
|
viewModel.getFriendsList(it?.toString())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -62,6 +62,10 @@ class MyFairySendDialog : BaseDialog<TreasureFairyDialogMyFairySendBinding>() {
|
|||||||
viewModel.askForFairy(fairyInfo.elfId, userInfo.uid)
|
viewModel.askForFairy(fairyInfo.elfId, userInfo.uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.sendFairyLiveData.observe(viewLifecycleOwner) {
|
||||||
|
if (it == true) dismissAllowingStateLoss()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -0,0 +1,64 @@
|
|||||||
|
package com.mango.moshen.treasurefairy
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.WindowManager
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import androidx.viewpager.widget.ViewPager
|
||||||
|
import com.mango.core.room.game.GameInfo
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.avroom.adapter.RoomVPAdapter
|
||||||
|
import com.mango.moshen.base.BaseDialog
|
||||||
|
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyBinding
|
||||||
|
import com.mango.moshen.databinding.TreasureFairyDialogTestFairyBinding
|
||||||
|
import com.mango.moshen.home.adapter.FragmentViewPagerAdapter
|
||||||
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
|
|
||||||
|
class TestFairyDialog : BaseDialog<TreasureFairyDialogTestFairyBinding>() {
|
||||||
|
|
||||||
|
override var width = WindowManager.LayoutParams.MATCH_PARENT
|
||||||
|
override var gravity = Gravity.BOTTOM
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(): TestFairyDialog {
|
||||||
|
val args = Bundle()
|
||||||
|
val fragment = TestFairyDialog()
|
||||||
|
fragment.arguments = args
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val viewModel: FairyViewModel by activityViewModels()
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
override fun init() {
|
||||||
|
binding.ivBack.setOnClickListener {
|
||||||
|
dismissAllowingStateLoss()
|
||||||
|
}
|
||||||
|
binding.rg.setOnCheckedChangeListener { _, checkedId ->
|
||||||
|
when (checkedId) {
|
||||||
|
R.id.rb_epic -> binding.viewPager.currentItem = 0
|
||||||
|
R.id.rb_legend -> binding.viewPager.currentItem = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.viewPager.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
||||||
|
override fun onPageSelected(position: Int) {
|
||||||
|
when (position) {
|
||||||
|
0 -> binding.rg.check(R.id.rb_epic)
|
||||||
|
1 -> binding.rg.check(R.id.rb_legend)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
binding.viewPager.adapter = RoomVPAdapter(
|
||||||
|
childFragmentManager,
|
||||||
|
listOf(
|
||||||
|
TestFairyFragment.newInstance(MyFairyItemView.EPIC),
|
||||||
|
TestFairyFragment.newInstance(MyFairyItemView.LEGEND)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
viewModel.getMyFairyInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
package com.mango.moshen.treasurefairy
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.Gravity
|
||||||
|
import android.view.WindowManager
|
||||||
|
import androidx.fragment.app.activityViewModels
|
||||||
|
import com.mango.core.room.game.GameInfo
|
||||||
|
import com.mango.core.treasurefairy.FairyInfo
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.base.BaseDialog
|
||||||
|
import com.mango.moshen.base.BaseFragment
|
||||||
|
import com.mango.moshen.base.BaseViewBindingFragment
|
||||||
|
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyBinding
|
||||||
|
import com.mango.moshen.databinding.TreasureFairyFragmentMyFairyBinding
|
||||||
|
import com.mango.moshen.databinding.TreasureFairyFragmentTestFairyBinding
|
||||||
|
import com.mango.moshen.ui.utils.RVDelegate
|
||||||
|
|
||||||
|
class TestFairyFragment : BaseViewBindingFragment<TreasureFairyFragmentTestFairyBinding>() {
|
||||||
|
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(fairyType: Int): TestFairyFragment {
|
||||||
|
val args = Bundle()
|
||||||
|
args.putInt("fairyType", fairyType)
|
||||||
|
val fragment = TestFairyFragment()
|
||||||
|
fragment.arguments = args
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val fairyType by lazy { requireArguments().getInt("fairyType", MyFairyItemView.BASE) }
|
||||||
|
private val viewModel: FairyViewModel by activityViewModels()
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
override fun init() {
|
||||||
|
|
||||||
|
viewModel.myFairyInfoLiveData.observe(viewLifecycleOwner) {
|
||||||
|
it?.let {
|
||||||
|
val fairyInfos = when (fairyType) {
|
||||||
|
MyFairyItemView.EPIC -> {
|
||||||
|
it.middleElves
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
it.highElves
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -6,6 +6,7 @@ import android.view.View;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.mango.core.auth.AuthModel;
|
||||||
import com.mango.core.gift.bean.SimpleUserInfo;
|
import com.mango.core.gift.bean.SimpleUserInfo;
|
||||||
import com.mango.core.im.custom.bean.CustomAttachment;
|
import com.mango.core.im.custom.bean.CustomAttachment;
|
||||||
import com.mango.core.im.custom.bean.FairySendAttachment;
|
import com.mango.core.im.custom.bean.FairySendAttachment;
|
||||||
@@ -32,6 +33,7 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
|||||||
private TextView tvContent;
|
private TextView tvContent;
|
||||||
private ImageView ivFairyIcon;
|
private ImageView ivFairyIcon;
|
||||||
private View flIconBg;
|
private View flIconBg;
|
||||||
|
private View tvView;
|
||||||
|
|
||||||
public MsgViewHolderFairy(BaseMultiItemFetchLoadAdapter adapter) {
|
public MsgViewHolderFairy(BaseMultiItemFetchLoadAdapter adapter) {
|
||||||
super(adapter);
|
super(adapter);
|
||||||
@@ -47,6 +49,7 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
|||||||
tvContent = findViewById(R.id.tv_content);
|
tvContent = findViewById(R.id.tv_content);
|
||||||
ivFairyIcon = findViewById(R.id.iv_fairy_icon);
|
ivFairyIcon = findViewById(R.id.iv_fairy_icon);
|
||||||
flIconBg = findViewById(R.id.fl_icon_bg);
|
flIconBg = findViewById(R.id.fl_icon_bg);
|
||||||
|
tvView = findViewById(R.id.tv_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -60,20 +63,28 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
|||||||
} else {
|
} else {
|
||||||
flIconBg.setBackgroundResource(R.drawable.shape_f5f4fa_8dp_round);
|
flIconBg.setBackgroundResource(R.drawable.shape_f5f4fa_8dp_round);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isAskFor = attachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_FAIRY_ASK_FOR;
|
||||||
|
|
||||||
|
if (isAskFor && attachment.getUid() != AuthModel.get().getCurrentUid()) {
|
||||||
|
tvView.setVisibility(View.VISIBLE);
|
||||||
contentContainer.setOnClickListener(this);
|
contentContainer.setOnClickListener(this);
|
||||||
|
} else {
|
||||||
|
tvView.setVisibility(View.GONE);
|
||||||
|
contentContainer.setOnClickListener(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
FairySendAttachment attachment = (FairySendAttachment) message.getAttachment();
|
FairySendAttachment attachment = (FairySendAttachment) message.getAttachment();
|
||||||
boolean isSend = attachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_FAIRY_SEND;
|
SimpleUserInfo userInfo = new SimpleUserInfo(attachment.getNick(), attachment.getUid(), 0, "", "");
|
||||||
SimpleUserInfo userInfo = new SimpleUserInfo(attachment.getTargetNick(), attachment.getTargetUid(), 0, "", "");
|
|
||||||
FairyInfo fairyInfo = new FairyInfo(attachment.getElfId(), 1, 1, attachment.getElfName(), attachment.getElfPicUrl());
|
FairyInfo fairyInfo = new FairyInfo(attachment.getElfId(), 1, 1, attachment.getElfName(), attachment.getElfPicUrl());
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("userInfo", userInfo);
|
bundle.putSerializable("userInfo", userInfo);
|
||||||
bundle.putSerializable("fairyInfo", fairyInfo);
|
bundle.putSerializable("fairyInfo", fairyInfo);
|
||||||
bundle.putBoolean("isSend", isSend);
|
bundle.putBoolean("isSend", true);
|
||||||
MyFairySendDialog.Companion.newInstance(bundle, userInfo).show(context);
|
MyFairySendDialog.Companion.newInstance(bundle, userInfo).show(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_test_fairy.png
Normal file
After Width: | Height: | Size: 410 KiB |
After Width: | Height: | Size: 179 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 177 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 855 B |
After Width: | Height: | Size: 22 KiB |
@@ -2,6 +2,9 @@
|
|||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item android:drawable="@drawable/treasure_fairy_bg_item_select" android:state_selected="true" />
|
<item android:drawable="@drawable/treasure_fairy_bg_item_select" android:state_selected="true" />
|
||||||
<item android:drawable="@drawable/treasure_fairy_bg_item_unselect" />
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/transparent" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
</selector>
|
</selector>
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/treasure_fairy_ic_test_fairy_epic_select" android:state_checked="true" />
|
||||||
|
<item android:drawable="@drawable/treasure_fairy_ic_test_fairy_epic_unselect" />
|
||||||
|
|
||||||
|
</selector>
|
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="@drawable/treasure_fairy_ic_test_fairy_legend_select" android:state_checked="true" />
|
||||||
|
<item android:drawable="@drawable/treasure_fairy_ic_test_fairy_legend_unselect" />
|
||||||
|
|
||||||
|
</selector>
|
9
app/src/main/res/drawable/shape_3aeac7_to_fffebb.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?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:endColor="#3AEAC7"
|
||||||
|
android:startColor="#FFFEBB" />
|
||||||
|
<corners android:radius="30dp" />
|
||||||
|
</shape>
|
@@ -40,6 +40,7 @@
|
|||||||
tools:text="对方赠送了你一张“小火龙”精灵卡" />
|
tools:text="对方赠送了你一张“小火龙”精灵卡" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
@@ -40,21 +40,21 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_my_fairy"
|
android:id="@+id/iv_my_fairy"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="45dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_adventure"
|
app:layout_constraintBottom_toBottomOf="@id/iv_record"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_record" />
|
app:layout_constraintEnd_toStartOf="@id/iv_fairy_test" />
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_fairy_adventure"
|
android:id="@+id/iv_fairy_test"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:src="@drawable/treasure_fairy_bg_forest_adventure"
|
android:src="@drawable/treasure_fairy_bg_forest_test"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_store"
|
app:layout_constraintBottom_toBottomOf="@id/iv_record"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_record" />
|
app:layout_constraintEnd_toStartOf="@id/iv_fairy_store" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_fairy_store"
|
android:id="@+id/iv_fairy_store"
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
android:id="@+id/iv_record"
|
android:id="@+id/iv_record"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_forest_record"
|
android:src="@drawable/treasure_fairy_ic_forest_record"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:src="@drawable/default_cover" />
|
android:src="@drawable/treasure_fairy_ic_forest_base" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_key_num_base"
|
android:id="@+id/tv_key_num_base"
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:src="@drawable/default_cover" />
|
android:src="@drawable/treasure_fairy_ic_forest_epic" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_key_num_epic"
|
android:id="@+id/tv_key_num_epic"
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:src="@drawable/default_cover" />
|
android:src="@drawable/treasure_fairy_ic_forest_legend" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_key_num_legend"
|
android:id="@+id/tv_key_num_legend"
|
||||||
|
@@ -8,16 +8,14 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view_bg"
|
android:id="@+id/view_bg"
|
||||||
android:layout_width="0dp"
|
android:layout_width="281dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="285dp"
|
||||||
android:background="@drawable/treasure_fairy_bg_forest_prize_single"
|
android:background="@drawable/treasure_fairy_bg_forest_prize_single"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintDimensionRatio="562:570"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.6"
|
app:layout_constraintVertical_bias="0.6" />
|
||||||
app:layout_constraintWidth_percent="0.75" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
@@ -28,6 +26,7 @@
|
|||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
android:includeFontPadding="false"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
||||||
@@ -37,9 +36,11 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:layout_marginBottom="18dp"
|
android:layout_marginBottom="5dp"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:scrollbars="none"
|
||||||
app:layout_constraintBottom_toTopOf="@id/tv_close"
|
app:layout_constraintBottom_toTopOf="@id/tv_close"
|
||||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
app:layout_constraintStart_toStartOf="@id/view_bg"
|
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||||
@@ -47,8 +48,8 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_close"
|
android:id="@+id/tv_close"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="104dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="32dp"
|
||||||
android:layout_marginBottom="42dp"
|
android:layout_marginBottom="42dp"
|
||||||
android:background="@drawable/treasure_fairy_bg_forest_prize_close"
|
android:background="@drawable/treasure_fairy_bg_forest_prize_close"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_key_num"
|
android:id="@+id/tv_key_num"
|
||||||
android:layout_width="80dp"
|
android:layout_width="83dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:background="@drawable/treasure_fairy_bg_key_number"
|
android:background="@drawable/treasure_fairy_bg_key_number"
|
||||||
@@ -46,26 +46,26 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_fairy_treasure"
|
android:id="@+id/iv_fairy_treasure"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="46dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_fairy_treasure"
|
android:src="@drawable/treasure_fairy_ic_fairy_treasure"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_my_fairy"
|
app:layout_constraintBottom_toBottomOf="@id/iv_more"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_more" />
|
app:layout_constraintEnd_toStartOf="@id/iv_my_fairy" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_my_fairy"
|
android:id="@+id/iv_my_fairy"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="46dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="4dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
||||||
app:layout_constraintEnd_toStartOf="@id/iv_more"
|
app:layout_constraintBottom_toBottomOf="@id/iv_more"
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_more" />
|
app:layout_constraintEnd_toStartOf="@id/iv_more" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_more"
|
android:id="@+id/iv_more"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="42dp"
|
android:layout_height="42dp"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_more"
|
android:src="@drawable/treasure_fairy_ic_more"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -222,27 +222,47 @@
|
|||||||
app:layout_constraintStart_toEndOf="@id/tv_current_lucky_value_text"
|
app:layout_constraintStart_toEndOf="@id/tv_current_lucky_value_text"
|
||||||
tools:text="2365" />
|
tools:text="2365" />
|
||||||
|
|
||||||
<ImageView
|
<View
|
||||||
android:id="@+id/iv_lucky_stone"
|
android:id="@+id/view_lucky_stone_default"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="120dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="125dp"
|
||||||
android:background="@drawable/treasure_fairy_ic_lucky_stone_default"
|
android:background="@drawable/treasure_fairy_ic_lucky_stone_default"
|
||||||
app:layout_constraintBottom_toTopOf="@id/tv_short_lucky_value"
|
app:layout_constraintBottom_toTopOf="@id/tv_short_lucky_value"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/view_bg_lucky_value" />
|
app:layout_constraintTop_toBottomOf="@id/view_bg_lucky_value" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_lucky_stone_empty"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="108dp"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_lucky_stone_empty"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_lucky_stone_default" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_lucky_stone"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="108dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_lucky_stone_default"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_lucky_stone_default"
|
||||||
|
tools:src="@drawable/treasure_fairy_ic_lucky_stone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_short_lucky_value"
|
android:id="@+id/tv_short_lucky_value"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:text="达到 12300 后下次夺宝,额外获赠精灵球"
|
|
||||||
android:textColor="#ff59fdff"
|
android:textColor="#ff59fdff"
|
||||||
android:textSize="10sp"
|
android:textSize="10sp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/fairy_item_9"
|
app:layout_constraintBottom_toTopOf="@id/fairy_item_9"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:text="达到 12300 后下次夺宝,额外获赠精灵球" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view_prize_click"
|
android:id="@+id/view_prize_click"
|
||||||
|
@@ -48,8 +48,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_record"
|
android:id="@+id/iv_record"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="50dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="42dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:src="@drawable/treasure_fairy_ic_my_fairy_record"
|
android:src="@drawable/treasure_fairy_ic_my_fairy_record"
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
android:layout_marginTop="50dp"
|
android:layout_marginTop="50dp"
|
||||||
android:layout_marginEnd="50dp"
|
android:layout_marginEnd="50dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="我的精灵记录"
|
android:text="收赠精灵记录"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
113
app/src/main/res/layout/treasure_fairy_dialog_test_fairy.xml
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?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:id="@+id/root_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_home"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="750:1160"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="42dp"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_back"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_title"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_test_fairy_title"
|
||||||
|
app:layout_constraintDimensionRatio="306:156"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg"
|
||||||
|
app:layout_constraintWidth_percent="0.408" />
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg_rg"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="17dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_my_fairy_rg"
|
||||||
|
app:layout_constraintDimensionRatio="690:82"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_title"
|
||||||
|
app:layout_constraintWidth_percent="0.92" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/rg"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg_rg"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg_rg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg_rg"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg_rg">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_epic"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/selector_bg_fairy_test_epic"
|
||||||
|
android:button="@null"
|
||||||
|
android:checked="true" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/rb_legend"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/selector_bg_fairy_test_legend"
|
||||||
|
android:button="@null" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/view_pager"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/rg" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_test_fairy_record"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:lineSpacingExtra="-5dp"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
|
android:text="试炼记录"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rg" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
103
app/src/main/res/layout/treasure_fairy_fragment_test_fairy.xml
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<?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="match_parent">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg_top"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_test_fairy"
|
||||||
|
app:layout_constraintDimensionRatio="750:585"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg_anim"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="25dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_test_fairy_anim"
|
||||||
|
app:layout_constraintDimensionRatio="684:490"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg_top"
|
||||||
|
app:layout_constraintWidth_percent="0.91" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_begin"
|
||||||
|
android:layout_width="142dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:src="@drawable/treasure_fairy_bg_test_fairy_begin"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg_top"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tips"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="点击投入试炼史诗精灵"
|
||||||
|
android:textColor="@color/color_59fdff"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/view_bg_bottom"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg_bottom" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_reset"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:drawableStart="@drawable/treasure_fairy_ic_test_fairy_refresh"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="重新投入"
|
||||||
|
android:textColor="@color/color_ffe8aa"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tv_tips"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tv_tips" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_one_key_add"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:background="@drawable/shape_3aeac7_to_fffebb"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="一键投入"
|
||||||
|
android:textColor="#ff1f5764"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tv_tips"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/tv_reset"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tv_tips" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg_bottom"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="34dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_test_fairy_bottom"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="750:293"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13dp"
|
||||||
|
android:layout_marginTop="26dp"
|
||||||
|
android:layout_marginEnd="13dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg_bottom" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
@@ -4,9 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="5dp"
|
android:gravity="center_horizontal"
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.mango.moshen.common.widget.CircleImageView
|
<com.mango.moshen.common.widget.CircleImageView
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@drawable/selector_bg_fairy_home_item"
|
android:background="@drawable/treasure_fairy_bg_item_unselect"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="2dp">
|
android:paddingTop="2dp">
|
||||||
@@ -29,4 +33,12 @@
|
|||||||
android:textColor="#FFE8AA"
|
android:textColor="#FFE8AA"
|
||||||
android:textSize="12dp" />
|
android:textSize="12dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_cover"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/selector_bg_fairy_home_item" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
@@ -35,13 +35,14 @@
|
|||||||
app:riv_corner_radius="4dp" />
|
app:riv_corner_radius="4dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
tools:text="在猛犸森林获得一张“小火龙”精灵卡"
|
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp"
|
||||||
|
tools:text="在猛犸森林获得一张“小火龙”精灵卡" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
43
app/src/main/res/layout/treasure_fairy_item_test_fairy.xml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_test_fairy_item_select"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_fairy_icon"
|
||||||
|
android:layout_width="52dp"
|
||||||
|
android:layout_height="52dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/default_cover" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_fairy_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="精灵球"
|
||||||
|
android:textColor="#1F5764"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_fairy_num"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="1/5"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@@ -607,4 +607,6 @@
|
|||||||
<color name="color_161958">#161958</color>
|
<color name="color_161958">#161958</color>
|
||||||
<color name="color_babbcd">#BABBCD</color>
|
<color name="color_babbcd">#BABBCD</color>
|
||||||
<color name="color_1f5764">#1f5764</color>
|
<color name="color_1f5764">#1f5764</color>
|
||||||
|
<color name="color_59fdff">#59fdff</color>
|
||||||
|
<color name="color_ffe8aa">#ffe8aa</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
|
|
||||||
public class FairySendAttachment extends CustomAttachment {
|
public class FairySendAttachment extends CustomAttachment {
|
||||||
private long uid;
|
private long uid;
|
||||||
|
private String nick;
|
||||||
private long targetUid;
|
private long targetUid;
|
||||||
private String targetNick;
|
private String targetNick;
|
||||||
private long elfId;
|
private long elfId;
|
||||||
@@ -22,11 +23,12 @@ public class FairySendAttachment extends CustomAttachment {
|
|||||||
@Override
|
@Override
|
||||||
protected void parseData(JSONObject jsonObject) {
|
protected void parseData(JSONObject jsonObject) {
|
||||||
uid = jsonObject.getLongValue("uid");
|
uid = jsonObject.getLongValue("uid");
|
||||||
uid = jsonObject.getLongValue("targetUid");
|
targetUid = jsonObject.getLongValue("targetUid");
|
||||||
uid = jsonObject.getLongValue("elfId");
|
elfId = jsonObject.getLongValue("elfId");
|
||||||
elfPicUrl = jsonObject.getString("elfPicUrl");
|
elfPicUrl = jsonObject.getString("elfPicUrl");
|
||||||
msgContent = jsonObject.getString("msgContent");
|
msgContent = jsonObject.getString("msgContent");
|
||||||
targetNick = jsonObject.getString("targetNick");
|
targetNick = jsonObject.getString("targetNick");
|
||||||
|
nick = jsonObject.getString("nick");
|
||||||
elfName = jsonObject.getString("elfName");
|
elfName = jsonObject.getString("elfName");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +88,14 @@ public class FairySendAttachment extends CustomAttachment {
|
|||||||
this.elfName = elfName;
|
this.elfName = elfName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNick() {
|
||||||
|
return nick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNick(String nick) {
|
||||||
|
this.nick = nick;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JSONObject packData() {
|
protected JSONObject packData() {
|
||||||
return null;
|
return null;
|
||||||
|
@@ -11,20 +11,6 @@ data class PrizeInfo(
|
|||||||
val rewardUnit: String = "",
|
val rewardUnit: String = "",
|
||||||
val drawTime: Long = 0,
|
val drawTime: Long = 0,
|
||||||
val poolLevel: Int = 0,
|
val poolLevel: Int = 0,
|
||||||
val propType: Int? = null
|
val propType: Int? = null,
|
||||||
) {
|
val itemIndex:Int = 0,
|
||||||
override fun equals(other: Any?): Boolean {
|
)
|
||||||
if (this === other) return true
|
|
||||||
if (javaClass != other?.javaClass) return false
|
|
||||||
|
|
||||||
other as PrizeInfo
|
|
||||||
|
|
||||||
if (rewardId != other.rewardId) return false
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
|
||||||
return rewardId
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,13 @@
|
|||||||
|
package com.mango.core.treasurefairy
|
||||||
|
|
||||||
|
data class SendFairyInfo(
|
||||||
|
val createTime: Long = 0,
|
||||||
|
val elfId: Long = 0,
|
||||||
|
val elfName: String = "",
|
||||||
|
val elfPicUrl: String = "",
|
||||||
|
val recordId: Int = 0,
|
||||||
|
val targetAvatar: String = "",
|
||||||
|
val targetNick: String = "",
|
||||||
|
val targetUid: Long = 0,
|
||||||
|
val type: Int = 0
|
||||||
|
)
|
@@ -46,8 +46,8 @@ object TreasureFairyModel {
|
|||||||
api.getMyFairyInfo()
|
api.getMyFairyInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getFriendsList(): List<SimpleUserInfo>? = launchRequest {
|
suspend fun getFriendsList(nick: String?): List<SimpleUserInfo>? = launchRequest {
|
||||||
api.getFriendsList()
|
api.getFriendsList(nick)
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun askForFairy(elfId: Long, targetUid: Long): String? = launchRequest {
|
suspend fun askForFairy(elfId: Long, targetUid: Long): String? = launchRequest {
|
||||||
@@ -58,6 +58,13 @@ object TreasureFairyModel {
|
|||||||
api.sendFairy(elfId, targetUid)
|
api.sendFairy(elfId, targetUid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun getSendFairyList(
|
||||||
|
page: Int,
|
||||||
|
pageSize: Int
|
||||||
|
): List<SendFairyInfo>? = launchRequest {
|
||||||
|
api.getSendFairyList(page, pageSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private interface Api {
|
private interface Api {
|
||||||
|
|
||||||
@@ -135,7 +142,7 @@ object TreasureFairyModel {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@GET("fans/friend/list")
|
@GET("fans/friend/list")
|
||||||
suspend fun getFriendsList(): ServiceResult<List<SimpleUserInfo>>
|
suspend fun getFriendsList(@Query("nick") nick: String?): ServiceResult<List<SimpleUserInfo>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 精灵-索要
|
* 精灵-索要
|
||||||
@@ -159,6 +166,16 @@ object TreasureFairyModel {
|
|||||||
@Field("targetUid") targetUid: Long
|
@Field("targetUid") targetUid: Long
|
||||||
): ServiceResult<String>
|
): ServiceResult<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 精灵-赠予/获赠记录
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@GET("act/seize-treasure/elf/record")
|
||||||
|
suspend fun getSendFairyList(
|
||||||
|
@Query("page") page: Int,
|
||||||
|
@Query("pageSize") pageSize: Int
|
||||||
|
): ServiceResult<List<SendFairyInfo>>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|