夺宝精灵:1.赠送精灵 2.UI切图调整
@@ -2,15 +2,12 @@ package com.mango.moshen.treasurefairy
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.mango.moshen.base.BaseViewModel
|
||||
import com.mango.core.bean.response.ListResult
|
||||
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.utils.net.ServerException
|
||||
import com.mango.core.utils.toast
|
||||
import com.mango.moshen.base.BaseViewModel
|
||||
import com.mango.moshen.base.Event
|
||||
|
||||
class FairyViewModel : BaseViewModel() {
|
||||
@@ -48,8 +45,8 @@ class FairyViewModel : BaseViewModel() {
|
||||
private val _sendFairyLiveData = MutableLiveData<Boolean>()
|
||||
val sendFairyLiveData: LiveData<Boolean> = _sendFairyLiveData
|
||||
|
||||
private val _askForFairyLiveData = MutableLiveData<Boolean>()
|
||||
val askForFairyLiveData: LiveData<Boolean> = _askForFairyLiveData
|
||||
private val _sendFairyRecordLiveData = MutableLiveData<ListResult<SendFairyInfo>>()
|
||||
val sendFairyRecordLiveData: LiveData<ListResult<SendFairyInfo>> = _sendFairyRecordLiveData
|
||||
|
||||
|
||||
init {
|
||||
@@ -160,14 +157,14 @@ class FairyViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun getFriendsList() {
|
||||
fun getFriendsList(nick: String? = null) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_friendsListLiveData.value = null
|
||||
it.message.toast()
|
||||
},
|
||||
block = {
|
||||
_friendsListLiveData.value = TreasureFairyModel.getFriendsList()
|
||||
_friendsListLiveData.value = TreasureFairyModel.getFriendsList(nick)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -176,12 +173,12 @@ class FairyViewModel : BaseViewModel() {
|
||||
fun askForFairy(elfId: Long, targetUid: Long) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_askForFairyLiveData.value = false
|
||||
_sendFairyLiveData.value = false
|
||||
it.message.toast()
|
||||
},
|
||||
block = {
|
||||
TreasureFairyModel.askForFairy(elfId, targetUid)
|
||||
_askForFairyLiveData.value = true
|
||||
_sendFairyLiveData.value = true
|
||||
"已向好友发送索要信息".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)
|
||||
}
|
||||
|
||||
binding.ivFairyTest.setOnClickListener {
|
||||
TestFairyDialog.newInstance().show(context)
|
||||
}
|
||||
|
||||
binding.ivPrevious.setOnClickListener {
|
||||
currentType--
|
||||
switchType()
|
||||
|
@@ -5,6 +5,7 @@ import android.os.Bundle
|
||||
import android.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@@ -13,6 +14,7 @@ import com.mango.moshen.R
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.TreasureFairyDialogForestPrizeBinding
|
||||
import com.mango.moshen.ui.utils.RVDelegate
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
|
||||
class ForestPrizeDialog : BaseDialog<TreasureFairyDialogForestPrizeBinding>() {
|
||||
|
||||
@@ -53,11 +55,11 @@ class ForestPrizeDialog : BaseDialog<TreasureFairyDialogForestPrizeBinding>() {
|
||||
prizeInfoList.filter { if (isFairy) (it.propType != 1) else (it.propType == 1) }
|
||||
val isShowDateSingle = showPrizeInfoList.size == 1
|
||||
if (!isShowDateSingle) {
|
||||
binding.viewBg.updateLayoutParams {
|
||||
width = ScreenUtil.dip2px(318f)
|
||||
height = ScreenUtil.dip2px(383f)
|
||||
}
|
||||
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)
|
||||
rvDelegate = RVDelegate.Builder<PrizeInfo>()
|
||||
|
@@ -15,6 +15,7 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.mango.core.UriProvider
|
||||
import com.mango.core.treasurefairy.PrizeInfo
|
||||
import com.mango.core.utils.LogUtils
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.base.BaseViewBindingActivity
|
||||
import com.mango.moshen.common.widget.dialog.DialogManager
|
||||
@@ -62,6 +63,7 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(this)
|
||||
)
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
binding.fairyItem0.isSelected = true
|
||||
looperHintPrize()
|
||||
binding.tvKeyNum.setOnClickListener {
|
||||
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 ->
|
||||
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) {
|
||||
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) {
|
||||
it?.let {
|
||||
binding.tvKeyNum.text = it.drawTicketNum.toString()
|
||||
|
@@ -2,6 +2,7 @@ package com.mango.moshen.treasurefairy
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.Nullable
|
||||
import com.mango.core.treasurefairy.PrizeInfo
|
||||
@@ -16,7 +17,7 @@ class HomeItemView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
@Nullable attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private val binding: TreasureFairyItemHomeBinding
|
||||
|
||||
|
@@ -35,6 +35,9 @@ class MyFairyDialog : BaseDialog<TreasureFairyDialogMyFairyBinding>() {
|
||||
binding.ivBack.setOnClickListener {
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
binding.ivRecord.setOnClickListener {
|
||||
MyFairyRecordDialog.newInstance().show(context)
|
||||
}
|
||||
binding.rg.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
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.BaseViewHolder
|
||||
import com.mango.core.treasurefairy.FairyInfo
|
||||
import com.mango.core.treasurefairy.SendFairyInfo
|
||||
import com.mango.moshen.R
|
||||
import com.mango.moshen.ui.utils.load
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
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)
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: FairyInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_prize_icon).load(item.elfPicUrl)
|
||||
helper.setText(R.id.tv_prize_name, item.elfName)
|
||||
override fun convert(helper: BaseViewHolder, item: SendFairyInfo) {
|
||||
helper.getView<ImageView>(R.id.iv_fairy_icon).load(item.elfPicUrl)
|
||||
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.recyclerview.widget.LinearLayoutManager
|
||||
import com.mango.core.treasurefairy.FairyInfo
|
||||
import com.mango.core.treasurefairy.SendFairyInfo
|
||||
import com.mango.moshen.base.BaseDialog
|
||||
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyRecordBinding
|
||||
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 val viewModel: FairyViewModel by activityViewModels()
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
viewModel.getMyFairyInfo()
|
||||
|
||||
recordAdapter = MyFairyRecordAdapter()
|
||||
rvDelegate = RVDelegate.Builder<FairyInfo>()
|
||||
rvDelegate = RVDelegate.Builder<SendFairyInfo>()
|
||||
.setAdapter(recordAdapter)
|
||||
.setRecyclerView(binding.recyclerView)
|
||||
.setLayoutManager(LinearLayoutManager(context))
|
||||
.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.view.Gravity
|
||||
import android.view.WindowManager
|
||||
import androidx.core.widget.doAfterTextChanged
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mango.core.gift.bean.SimpleUserInfo
|
||||
@@ -18,7 +19,7 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
||||
override var gravity = Gravity.BOTTOM
|
||||
|
||||
companion object {
|
||||
fun newInstance(fairyInfo: FairyInfo,isSend:Boolean): MyFairySearchFriendsDialog {
|
||||
fun newInstance(fairyInfo: FairyInfo, isSend: Boolean): MyFairySearchFriendsDialog {
|
||||
val args = Bundle()
|
||||
args.putSerializable("fairyInfo", fairyInfo)
|
||||
args.putBoolean("isSend", isSend)
|
||||
@@ -34,6 +35,7 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
binding.ivBack.setOnClickListener { dismissAllowingStateLoss() }
|
||||
friendsAdapter = MyFairyFriendsAdapter()
|
||||
rvDelegate = RVDelegate.Builder<SimpleUserInfo>()
|
||||
.setAdapter(friendsAdapter)
|
||||
@@ -49,6 +51,10 @@ class MyFairySearchFriendsDialog : BaseDialog<TreasureFairyDialogMyFairySearchFr
|
||||
viewModel.friendsListLiveData.observe(viewLifecycleOwner) {
|
||||
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.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.TextView;
|
||||
|
||||
import com.mango.core.auth.AuthModel;
|
||||
import com.mango.core.gift.bean.SimpleUserInfo;
|
||||
import com.mango.core.im.custom.bean.CustomAttachment;
|
||||
import com.mango.core.im.custom.bean.FairySendAttachment;
|
||||
@@ -32,6 +33,7 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
||||
private TextView tvContent;
|
||||
private ImageView ivFairyIcon;
|
||||
private View flIconBg;
|
||||
private View tvView;
|
||||
|
||||
public MsgViewHolderFairy(BaseMultiItemFetchLoadAdapter adapter) {
|
||||
super(adapter);
|
||||
@@ -47,6 +49,7 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
||||
tvContent = findViewById(R.id.tv_content);
|
||||
ivFairyIcon = findViewById(R.id.iv_fairy_icon);
|
||||
flIconBg = findViewById(R.id.fl_icon_bg);
|
||||
tvView = findViewById(R.id.tv_view);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,20 +63,28 @@ public class MsgViewHolderFairy extends MsgViewHolderBase implements View.OnClic
|
||||
} else {
|
||||
flIconBg.setBackgroundResource(R.drawable.shape_f5f4fa_8dp_round);
|
||||
}
|
||||
contentContainer.setOnClickListener(this);
|
||||
|
||||
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);
|
||||
} else {
|
||||
tvView.setVisibility(View.GONE);
|
||||
contentContainer.setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
FairySendAttachment attachment = (FairySendAttachment) message.getAttachment();
|
||||
boolean isSend = attachment.getSecond() == CustomAttachment.CUSTOM_MSG_SUB_FAIRY_SEND;
|
||||
SimpleUserInfo userInfo = new SimpleUserInfo(attachment.getTargetNick(), attachment.getTargetUid(), 0, "", "");
|
||||
SimpleUserInfo userInfo = new SimpleUserInfo(attachment.getNick(), attachment.getUid(), 0, "", "");
|
||||
FairyInfo fairyInfo = new FairyInfo(attachment.getElfId(), 1, 1, attachment.getElfName(), attachment.getElfPicUrl());
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable("userInfo", userInfo);
|
||||
bundle.putSerializable("fairyInfo", fairyInfo);
|
||||
bundle.putBoolean("isSend", isSend);
|
||||
bundle.putBoolean("isSend", true);
|
||||
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">
|
||||
|
||||
<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>
|
||||
|
@@ -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="对方赠送了你一张“小火龙”精灵卡" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
|
@@ -40,21 +40,21 @@
|
||||
<ImageView
|
||||
android:id="@+id/iv_my_fairy"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_adventure"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_record" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_record"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_test" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_fairy_adventure"
|
||||
android:id="@+id/iv_fairy_test"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/treasure_fairy_bg_forest_adventure"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_store"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_record" />
|
||||
android:src="@drawable/treasure_fairy_bg_forest_test"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_record"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_fairy_store" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_fairy_store"
|
||||
@@ -69,7 +69,7 @@
|
||||
android:id="@+id/iv_record"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/treasure_fairy_ic_forest_record"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -248,7 +248,7 @@
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
android:src="@drawable/treasure_fairy_ic_forest_base" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_key_num_base"
|
||||
@@ -263,7 +263,7 @@
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
android:src="@drawable/treasure_fairy_ic_forest_epic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_key_num_epic"
|
||||
@@ -278,7 +278,7 @@
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@drawable/default_cover" />
|
||||
android:src="@drawable/treasure_fairy_ic_forest_legend" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_key_num_legend"
|
||||
|
@@ -8,16 +8,14 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_width="281dp"
|
||||
android:layout_height="285dp"
|
||||
android:background="@drawable/treasure_fairy_bg_forest_prize_single"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="562:570"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.6"
|
||||
app:layout_constraintWidth_percent="0.75" />
|
||||
app:layout_constraintVertical_bias="0.6" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
@@ -28,6 +26,7 @@
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/view_bg" />
|
||||
@@ -37,9 +36,11 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginTop="15dp"
|
||||
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_constraintEnd_toEndOf="@id/view_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_bg"
|
||||
@@ -47,8 +48,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginBottom="42dp"
|
||||
android:background="@drawable/treasure_fairy_bg_forest_prize_close"
|
||||
android:gravity="center"
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_key_num"
|
||||
android:layout_width="80dp"
|
||||
android:layout_width="83dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:background="@drawable/treasure_fairy_bg_key_number"
|
||||
@@ -46,26 +46,26 @@
|
||||
<ImageView
|
||||
android:id="@+id/iv_fairy_treasure"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/treasure_fairy_ic_fairy_treasure"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_my_fairy"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_more" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_more"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_my_fairy" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_my_fairy"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/treasure_fairy_ic_my_fairy"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_more"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_more" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_more"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_more" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/treasure_fairy_ic_more"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -222,27 +222,47 @@
|
||||
app:layout_constraintStart_toEndOf="@id/tv_current_lucky_value_text"
|
||||
tools:text="2365" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lucky_stone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<View
|
||||
android:id="@+id/view_lucky_stone_default"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="125dp"
|
||||
android:background="@drawable/treasure_fairy_ic_lucky_stone_default"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_short_lucky_value"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
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
|
||||
android:id="@+id/tv_short_lucky_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="达到 12300 后下次夺宝,额外获赠精灵球"
|
||||
android:textColor="#ff59fdff"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/fairy_item_9"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="达到 12300 后下次夺宝,额外获赠精灵球" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_prize_click"
|
||||
|
@@ -48,8 +48,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_record"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/treasure_fairy_ic_my_fairy_record"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:gravity="center"
|
||||
android:text="我的精灵记录"
|
||||
android:text="收赠精灵记录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mango.moshen.common.widget.CircleImageView
|
||||
|
@@ -1,32 +1,44 @@
|
||||
<?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:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/selector_bg_fairy_home_item"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="2dp">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_prize_icon"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_prize_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:ellipsize="end"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/treasure_fairy_bg_item_unselect"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="精灵球"
|
||||
android:textColor="#FFE8AA"
|
||||
android:textSize="12dp" />
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:id="@+id/iv_prize_icon"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/default_cover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_prize_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="精灵球"
|
||||
android:textColor="#FFE8AA"
|
||||
android:textSize="12dp" />
|
||||
|
||||
</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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
tools:text="在猛犸森林获得一张“小火龙”精灵卡"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
tools:text="在猛犸森林获得一张“小火龙”精灵卡" />
|
||||
|
||||
</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_babbcd">#BABBCD</color>
|
||||
<color name="color_1f5764">#1f5764</color>
|
||||
<color name="color_59fdff">#59fdff</color>
|
||||
<color name="color_ffe8aa">#ffe8aa</color>
|
||||
</resources>
|
||||
|
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class FairySendAttachment extends CustomAttachment {
|
||||
private long uid;
|
||||
private String nick;
|
||||
private long targetUid;
|
||||
private String targetNick;
|
||||
private long elfId;
|
||||
@@ -22,11 +23,12 @@ public class FairySendAttachment extends CustomAttachment {
|
||||
@Override
|
||||
protected void parseData(JSONObject jsonObject) {
|
||||
uid = jsonObject.getLongValue("uid");
|
||||
uid = jsonObject.getLongValue("targetUid");
|
||||
uid = jsonObject.getLongValue("elfId");
|
||||
targetUid = jsonObject.getLongValue("targetUid");
|
||||
elfId = jsonObject.getLongValue("elfId");
|
||||
elfPicUrl = jsonObject.getString("elfPicUrl");
|
||||
msgContent = jsonObject.getString("msgContent");
|
||||
targetNick = jsonObject.getString("targetNick");
|
||||
nick = jsonObject.getString("nick");
|
||||
elfName = jsonObject.getString("elfName");
|
||||
}
|
||||
|
||||
@@ -86,6 +88,14 @@ public class FairySendAttachment extends CustomAttachment {
|
||||
this.elfName = elfName;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JSONObject packData() {
|
||||
return null;
|
||||
|
@@ -11,20 +11,6 @@ data class PrizeInfo(
|
||||
val rewardUnit: String = "",
|
||||
val drawTime: Long = 0,
|
||||
val poolLevel: Int = 0,
|
||||
val propType: Int? = null
|
||||
) {
|
||||
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
|
||||
}
|
||||
}
|
||||
val propType: Int? = null,
|
||||
val itemIndex:Int = 0,
|
||||
)
|
@@ -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()
|
||||
}
|
||||
|
||||
suspend fun getFriendsList(): List<SimpleUserInfo>? = launchRequest {
|
||||
api.getFriendsList()
|
||||
suspend fun getFriendsList(nick: String?): List<SimpleUserInfo>? = launchRequest {
|
||||
api.getFriendsList(nick)
|
||||
}
|
||||
|
||||
suspend fun askForFairy(elfId: Long, targetUid: Long): String? = launchRequest {
|
||||
@@ -58,6 +58,13 @@ object TreasureFairyModel {
|
||||
api.sendFairy(elfId, targetUid)
|
||||
}
|
||||
|
||||
suspend fun getSendFairyList(
|
||||
page: Int,
|
||||
pageSize: Int
|
||||
): List<SendFairyInfo>? = launchRequest {
|
||||
api.getSendFairyList(page, pageSize)
|
||||
}
|
||||
|
||||
|
||||
private interface Api {
|
||||
|
||||
@@ -135,7 +142,7 @@ object TreasureFairyModel {
|
||||
*
|
||||
*/
|
||||
@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
|
||||
): ServiceResult<String>
|
||||
|
||||
/**
|
||||
* 精灵-赠予/获赠记录
|
||||
*
|
||||
*/
|
||||
@GET("act/seize-treasure/elf/record")
|
||||
suspend fun getSendFairyList(
|
||||
@Query("page") page: Int,
|
||||
@Query("pageSize") pageSize: Int
|
||||
): ServiceResult<List<SendFairyInfo>>
|
||||
|
||||
}
|
||||
|
||||
}
|