夺宝精灵:主页UI
@@ -1288,6 +1288,9 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.im.avtivity.SayHelloListActivity"
|
android:name=".ui.im.avtivity.SayHelloListActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name=".treasurefairy.TreasureFairyActivity"
|
||||||
|
android:theme="@style/treasure_box_activity" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@ import com.mango.core.user.event.LoginUserInfoUpdateEvent
|
|||||||
import com.mango.core.utils.CurrentTimeUtils
|
import com.mango.core.utils.CurrentTimeUtils
|
||||||
import com.mango.core.utils.StarUtils
|
import com.mango.core.utils.StarUtils
|
||||||
import com.mango.core.utils.toast
|
import com.mango.core.utils.toast
|
||||||
|
import com.mango.moshen.BuildConfig
|
||||||
import com.mango.moshen.R
|
import com.mango.moshen.R
|
||||||
import com.mango.moshen.UIHelper
|
import com.mango.moshen.UIHelper
|
||||||
import com.mango.moshen.avroom.activity.AVRoomActivity
|
import com.mango.moshen.avroom.activity.AVRoomActivity
|
||||||
@@ -54,6 +55,7 @@ import com.mango.moshen.home.helper.OpenRoomHelper
|
|||||||
import com.mango.moshen.module_hall.HallDataManager
|
import com.mango.moshen.module_hall.HallDataManager
|
||||||
import com.mango.moshen.skill.activity.SkillHomeActivity
|
import com.mango.moshen.skill.activity.SkillHomeActivity
|
||||||
import com.mango.moshen.skill.activity.SkillHomeActivity.Companion.start
|
import com.mango.moshen.skill.activity.SkillHomeActivity.Companion.start
|
||||||
|
import com.mango.moshen.treasurefairy.TreasureFairyActivity
|
||||||
import com.mango.moshen.ui.patriarch.PatriarchModeActivity
|
import com.mango.moshen.ui.patriarch.PatriarchModeActivity
|
||||||
import com.mango.moshen.ui.pay.ChargeActivity
|
import com.mango.moshen.ui.pay.ChargeActivity
|
||||||
import com.mango.moshen.ui.relation.AttentionListActivity
|
import com.mango.moshen.ui.relation.AttentionListActivity
|
||||||
@@ -517,6 +519,10 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
)
|
)
|
||||||
R.id.me_item_setting -> UIHelper.showSettingAct(mContext)
|
R.id.me_item_setting -> UIHelper.showSettingAct(mContext)
|
||||||
R.id.me_item_vip -> {
|
R.id.me_item_vip -> {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
TreasureFairyActivity.start(mContext)
|
||||||
|
return
|
||||||
|
}
|
||||||
VipMainActivity.start(mContext)
|
VipMainActivity.start(mContext)
|
||||||
StatisticManager.Instance()
|
StatisticManager.Instance()
|
||||||
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ME_CLICK, "贵族我的入口点击事件")
|
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ME_CLICK, "贵族我的入口点击事件")
|
||||||
|
@@ -0,0 +1,74 @@
|
|||||||
|
package com.mango.moshen.treasurefairy;
|
||||||
|
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.ColorFilter;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Path;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
class CustomDrawable extends Drawable {
|
||||||
|
private final Paint srcPaint;
|
||||||
|
private final Drawable innerDrawable;
|
||||||
|
/**
|
||||||
|
* 使用时需要自定义path
|
||||||
|
*/
|
||||||
|
private Path srcPath = new Path();
|
||||||
|
private final PorterDuffXfermode xFermode =new PorterDuffXfermode(PorterDuff.Mode.CLEAR);
|
||||||
|
|
||||||
|
public CustomDrawable(Drawable innerDrawable) {
|
||||||
|
this.innerDrawable = innerDrawable;
|
||||||
|
// path默认实现
|
||||||
|
srcPath.addRect(100, 100, 200, 200, Path.Direction.CW);
|
||||||
|
srcPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
srcPaint.setColor(0xffffffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置内部透明的部分
|
||||||
|
*/
|
||||||
|
public void setSrcPath(Path srcPath) {
|
||||||
|
this.srcPath = srcPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(@NonNull Canvas canvas) {
|
||||||
|
innerDrawable.setBounds(getBounds());
|
||||||
|
if (srcPath == null || srcPath.isEmpty()) {
|
||||||
|
innerDrawable.draw(canvas);
|
||||||
|
} else {
|
||||||
|
// 将绘制操作保存到新的图层
|
||||||
|
int saveCount = canvas.saveLayer(0, 0, getBounds().width(), getBounds().height(), srcPaint,
|
||||||
|
Canvas.ALL_SAVE_FLAG);
|
||||||
|
// 绘制目标图
|
||||||
|
innerDrawable.draw(canvas);
|
||||||
|
// 设置混合模式
|
||||||
|
srcPaint.setXfermode(xFermode);
|
||||||
|
// src 绘制源图
|
||||||
|
canvas.drawPath(srcPath, srcPaint);
|
||||||
|
// 清除混合模式
|
||||||
|
srcPaint.setXfermode(null);
|
||||||
|
// 还原画布
|
||||||
|
canvas.restoreToCount(saveCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAlpha(int alpha) {
|
||||||
|
innerDrawable.setAlpha(alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setColorFilter(@Nullable ColorFilter colorFilter) {
|
||||||
|
innerDrawable.setColorFilter(colorFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOpacity() {
|
||||||
|
return innerDrawable.getOpacity();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
package com.mango.moshen.treasurefairy
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import androidx.annotation.Nullable
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.databinding.ItemTreasureFairyHomeBinding
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 技能卡
|
||||||
|
*/
|
||||||
|
class FairyItemView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
@Nullable attrs: AttributeSet? = null,
|
||||||
|
defStyleAttr: Int = 0
|
||||||
|
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
private val binding: ItemTreasureFairyHomeBinding
|
||||||
|
|
||||||
|
|
||||||
|
init {
|
||||||
|
inflate(context, R.layout.item_treasure_fairy_home, this)
|
||||||
|
binding = ItemTreasureFairyHomeBinding.bind(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -0,0 +1,133 @@
|
|||||||
|
package com.mango.moshen.treasurefairy
|
||||||
|
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.graphics.Path
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.view.*
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.mango.moshen.R
|
||||||
|
import com.mango.moshen.base.BaseViewBindingActivity
|
||||||
|
import com.mango.moshen.databinding.ActivityTreasureFairyBinding
|
||||||
|
import com.mango.treasure_box.bean.PrizeInfo
|
||||||
|
import com.netease.nim.uikit.StatusBarUtil
|
||||||
|
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
|
import org.greenrobot.eventbus.EventBus
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
|
||||||
|
class TreasureFairyActivity : BaseViewBindingActivity<ActivityTreasureFairyBinding>() {
|
||||||
|
private var height = 0
|
||||||
|
private var selectIndex = 0
|
||||||
|
private val removeRunnable = Runnable { binding.llPrizeHint.removeAllViews() }
|
||||||
|
private val hintPrizeCacheList = ArrayList<PrizeInfo>()
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
EventBus.getDefault().register(this)
|
||||||
|
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||||
|
height = ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||||
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, height)
|
||||||
|
window.setGravity(Gravity.BOTTOM)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
val views = listOf<View>(
|
||||||
|
binding.fairyItem0, binding.fairyItem1, binding.fairyItem2, binding.fairyItem3,
|
||||||
|
binding.fairyItem4, binding.fairyItem5, binding.fairyItem6, binding.fairyItem7,
|
||||||
|
binding.fairyItem8, binding.fairyItem9, binding.fairyItem10, binding.fairyItem11
|
||||||
|
)
|
||||||
|
|
||||||
|
Observable.interval(100, TimeUnit.MILLISECONDS)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.compose(bindToLifecycle())
|
||||||
|
.doOnNext {
|
||||||
|
views[selectIndex].isSelected = false
|
||||||
|
selectIndex++
|
||||||
|
if (selectIndex == views.size) selectIndex = 0
|
||||||
|
views[selectIndex].isSelected = true
|
||||||
|
}
|
||||||
|
.subscribe()
|
||||||
|
binding.ivLuckyStone.post {
|
||||||
|
val drawable = CustomDrawable(binding.ivLuckyStone.drawable)
|
||||||
|
val path = Path()
|
||||||
|
path.addRect(
|
||||||
|
0f,
|
||||||
|
0f,
|
||||||
|
binding.ivLuckyStone.width.toFloat(),
|
||||||
|
binding.ivLuckyStone.height.toFloat() / 2,
|
||||||
|
Path.Direction.CW
|
||||||
|
)
|
||||||
|
drawable.setSrcPath(path)
|
||||||
|
binding.ivLuckyStone.setImageDrawable(drawable)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
private fun looperHintPrize() {
|
||||||
|
Observable.interval(0, 250, TimeUnit.MILLISECONDS)
|
||||||
|
.compose(bindToLifecycle())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.filter { hintPrizeCacheList.size > 0 }
|
||||||
|
.subscribe(
|
||||||
|
{
|
||||||
|
addPrizeHintView(hintPrizeCacheList.removeAt(0))
|
||||||
|
}) { looperHintPrize() } //出错了继续looper......
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addPrizeHintView(prizeInfo: PrizeInfo) {
|
||||||
|
binding.llPrizeHint.removeCallbacks(removeRunnable)
|
||||||
|
binding.llPrizeHint.postDelayed(removeRunnable, 3000)
|
||||||
|
val linearLayout =
|
||||||
|
LayoutInflater.from(this).inflate(R.layout.item_fairy_prize_hint, null) as LinearLayout
|
||||||
|
val layoutParams =
|
||||||
|
LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ScreenUtil.dip2px(25f))
|
||||||
|
layoutParams.setMargins(0, 0, 0, ScreenUtil.dip2px(5f))
|
||||||
|
linearLayout.layoutParams = layoutParams
|
||||||
|
linearLayout.setBackgroundResource(R.drawable.treasure_fairy_bg_big_prize)
|
||||||
|
linearLayout.setPadding(ScreenUtil.dip2px(10f), 0, ScreenUtil.dip2px(10f), 0)
|
||||||
|
binding.llPrizeHint.addView(linearLayout)
|
||||||
|
if (binding.llPrizeHint.childCount > 6) {
|
||||||
|
binding.llPrizeHint.removeViewAt(0)
|
||||||
|
}
|
||||||
|
for (i in 0 until binding.llPrizeHint.childCount) {
|
||||||
|
ObjectAnimator.ofFloat(
|
||||||
|
binding.llPrizeHint.getChildAt(i),
|
||||||
|
"translationY",
|
||||||
|
ScreenUtil.dip2px(25f).toFloat(),
|
||||||
|
0f
|
||||||
|
)
|
||||||
|
.setDuration(200)
|
||||||
|
.start()
|
||||||
|
}
|
||||||
|
(linearLayout.findViewById<View>(R.id.tv_prize_name) as TextView).text =
|
||||||
|
prizeInfo.prizeName
|
||||||
|
(linearLayout.findViewById<View>(R.id.tv_prize_num) as TextView).text =
|
||||||
|
"x" + prizeInfo.prizeNum
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun needSteepStateBar(): Boolean {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun setStatusBar() {
|
||||||
|
super.setStatusBar()
|
||||||
|
StatusBarUtil.transparencyBar(this)
|
||||||
|
StatusBarUtil.StatusBarLightMode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun start(context: Context) {
|
||||||
|
val starter = Intent(context, TreasureFairyActivity::class.java)
|
||||||
|
context.startActivity(starter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_big_prize.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_home.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_key_number.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_open_1.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_open_10.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_bg_open_100.png
Normal file
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_ic_home_title.png
Normal file
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_ic_more.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/treasure_fairy_ic_my_fairy.png
Normal file
After Width: | Height: | Size: 12 KiB |
@@ -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_bg_item_select" android:state_selected="true" />
|
||||||
|
<item android:drawable="@drawable/treasure_fairy_bg_item_unselect" />
|
||||||
|
|
||||||
|
</selector>
|
308
app/src/main/res/layout/activity_treasure_fairy.xml
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
<?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_title"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_home_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" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_key_num"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_key_number"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:text="12.2W"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_more"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_more" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_fairy_treasure"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_my_fairy"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_more"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="42dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_more"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_title" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_0"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="14dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/fairy_item_1"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="spread"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/iv_more"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/fairy_item_2"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_2"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/fairy_item_3"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/fairy_item_1"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_3"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/fairy_item_2"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_4"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_3"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/fairy_item_3"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_5"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_4"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/fairy_item_4"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_6"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_5"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/fairy_item_5"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_7"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_2"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_6"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_8"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_1"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_7"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_9"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_8"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_10"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_5"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<com.mango.moshen.treasurefairy.FairyItemView
|
||||||
|
android:id="@+id/fairy_item_11"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="75:81"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/fairy_item_0"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/fairy_item_4"
|
||||||
|
app:layout_constraintWidth_percent="0.2" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bg_lucky_value"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_lucky_value"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/fairy_item_0" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_current_lucky_value_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="当前幸运值:"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg_lucky_value"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/tv_current_lucky_value"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/view_bg_lucky_value" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_current_lucky_value"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="2365"
|
||||||
|
android:textColor="#ffffe8aa"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBaseline_toBaselineOf="@id/tv_current_lucky_value_text"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/tv_current_lucky_value_text" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_lucky_stone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/treasure_fairy_ic_lucky_stone_default"
|
||||||
|
android:src="@drawable/treasure_fairy_ic_lucky_stone"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_open_1"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:src="@drawable/treasure_fairy_bg_open_1"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="230:89"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/iv_open_10"
|
||||||
|
app:layout_constraintHorizontal_chainStyle="packed"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintWidth_percent="0.306" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_open_10"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:src="@drawable/treasure_fairy_bg_open_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="230:89"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/iv_open_100"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_open_1"
|
||||||
|
app:layout_constraintWidth_percent="0.306" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_open_100"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:layout_marginBottom="35dp"
|
||||||
|
android:src="@drawable/treasure_fairy_bg_open_100"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="230:89"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_open_10"
|
||||||
|
app:layout_constraintWidth_percent="0.306" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_prize_hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="155dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/iv_open_1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
android:id="@+id/fragment_container"
|
||||||
|
android:layout_width="199dp"
|
||||||
|
android:layout_height="287dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="@drawable/bg_treasure_box_more"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/view_bg" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
35
app/src/main/res/layout/item_fairy_prize_hint.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?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="wrap_content"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="10dp"
|
||||||
|
android:background="@drawable/treasure_fairy_bg_big_prize">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_prize_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:lines="1"
|
||||||
|
android:textColor="#FFE8AA"
|
||||||
|
android:textSize="11sp"
|
||||||
|
tools:text="哈哈哈哈" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_prize_num"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:lines="1"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:textColor="#FFE8AA"
|
||||||
|
android:textSize="11sp"
|
||||||
|
tools:text="x12" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
32
app/src/main/res/layout/item_treasure_fairy_home.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?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="match_parent"
|
||||||
|
android:background="@drawable/selector_bg_fairy_home_item"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="2dp">
|
||||||
|
|
||||||
|
<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>
|