精灵夺宝:UI优化

This commit is contained in:
huangjian
2023-03-01 22:45:25 +08:00
parent 41ca42a4a2
commit deaa1a19df
27 changed files with 347 additions and 253 deletions

View File

@@ -1123,10 +1123,7 @@
android:name=".ui.webview.DialogWebViewActivity" android:name=".ui.webview.DialogWebViewActivity"
android:theme="@style/dialog_web_view_activity" android:theme="@style/dialog_web_view_activity"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.webview.FairyDialogWebViewActivity"
android:theme="@style/dialog_web_view_activity"
android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".ui.webview.DatingRuleWebViewActivity" android:name=".ui.webview.DatingRuleWebViewActivity"
android:theme="@style/dialog_web_view_activity" /> android:theme="@style/dialog_web_view_activity" />
@@ -1293,6 +1290,10 @@
android:name=".treasurefairy.HomeFairyActivity" android:name=".treasurefairy.HomeFairyActivity"
android:theme="@style/dialog_web_view_activity" /> android:theme="@style/dialog_web_view_activity" />
<activity
android:name=".ui.webview.FairyDialogWebViewActivity"
android:theme="@style/dialog_web_view_activity" />
</application> </application>
</manifest> </manifest>

View File

@@ -57,12 +57,14 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
import com.mango.core.im.custom.bean.FairyMsgAttachment; import com.mango.core.im.custom.bean.FairyMsgAttachment;
import com.mango.core.im.custom.bean.RoomKitchenAttachment; import com.mango.core.im.custom.bean.RoomKitchenAttachment;
import com.mango.core.im.custom.bean.WishListAttachment; import com.mango.core.im.custom.bean.WishListAttachment;
import com.mango.core.room.anotherroompk.ShowUserInfoDialogEvent;
import com.mango.core.room.wishlist.WishListModel; import com.mango.core.room.wishlist.WishListModel;
import com.mango.core.treasurefairy.FairyMsgInfo; import com.mango.core.treasurefairy.FairyMsgInfo;
import com.mango.core.utils.StringExtensionKt; import com.mango.core.utils.StringExtensionKt;
import com.mango.moshen.treasure_box.widget.GoldBoxHelper; import com.mango.moshen.treasure_box.widget.GoldBoxHelper;
import com.mango.moshen.treasurefairy.HomeFairyActivity; import com.mango.moshen.treasurefairy.HomeFairyActivity;
import com.mango.moshen.utils.MsgBuilder; import com.mango.moshen.utils.MsgBuilder;
import com.mango.xchat_android_library.rxbus.RxBus;
import com.netease.nim.uikit.business.uinfo.UserInfoHelper; import com.netease.nim.uikit.business.uinfo.UserInfoHelper;
import com.netease.nim.uikit.common.ui.span.RadiusBackgroundSpan; import com.netease.nim.uikit.common.ui.span.RadiusBackgroundSpan;
import com.netease.nim.uikit.common.util.log.LogUtil; import com.netease.nim.uikit.common.util.log.LogUtil;
@@ -1051,13 +1053,12 @@ public class MessageView extends FrameLayout {
builder.append(" 去参加!", new OriginalDrawStatusClickSpan(Color.parseColor("#FFBC51")) { builder.append(" 去参加!", new OriginalDrawStatusClickSpan(Color.parseColor("#FFBC51")) {
@Override @Override
public void onClick(@NonNull View widget) { public void onClick(@NonNull View widget) {
HomeFairyActivity.start(mContext);
} }
}); });
tvContent.setOnClickListener(v -> HomeFairyActivity.start(mContext));
} else {
tvContent.setOnClickListener(null);
} }
tvContent.setOnClickListener(null);
tvContent.setMovementMethod(new LinkMovementMethod());
tvContent.setText(builder.build()); tvContent.setText(builder.build());
} }
} }
@@ -1067,7 +1068,13 @@ public class MessageView extends FrameLayout {
private SpannableBuilder builderConvertMsg(TextView textView, @NonNull FairyMsgInfo fairyMsgInfo, String type) { private SpannableBuilder builderConvertMsg(TextView textView, @NonNull FairyMsgInfo fairyMsgInfo, String type) {
return new SpannableBuilder(textView) return new SpannableBuilder(textView)
.append("厉害了!", new ForegroundColorSpan(whiteColor)) .append("厉害了!", new ForegroundColorSpan(whiteColor))
.append(StringExtensionKt.subAndReplaceDot(fairyMsgInfo.getNick(), 7), new ForegroundColorSpan(roomTipNickColor)) .append(StringExtensionKt.subAndReplaceDot(fairyMsgInfo.getNick(), 7), new OriginalDrawStatusClickSpan(roomTipNickColor, false) {
@Override
public void onClick(@NonNull View widget) {
RxBus.get().post(new ShowUserInfoDialogEvent(String.valueOf(fairyMsgInfo.getUid())));
}
})
.append("在夺宝精灵中 " + type, new ForegroundColorSpan(whiteColor)) .append("在夺宝精灵中 " + type, new ForegroundColorSpan(whiteColor))
.append(fairyMsgInfo.getRewardShowValue() + "" + fairyMsgInfo.getRewardName(), new ForegroundColorSpan(roomTipColor)); .append(fairyMsgInfo.getRewardShowValue() + "" + fairyMsgInfo.getRewardName(), new ForegroundColorSpan(roomTipColor));
} }
@@ -1075,7 +1082,13 @@ public class MessageView extends FrameLayout {
private SpannableBuilder builderDrawMsg(TextView textView, @NonNull FairyMsgInfo fairyMsgInfo, String desc) { private SpannableBuilder builderDrawMsg(TextView textView, @NonNull FairyMsgInfo fairyMsgInfo, String desc) {
SpannableBuilder builder = new SpannableBuilder(textView) SpannableBuilder builder = new SpannableBuilder(textView)
.append(desc, new ForegroundColorSpan(whiteColor)) .append(desc, new ForegroundColorSpan(whiteColor))
.append(StringExtensionKt.subAndReplaceDot(fairyMsgInfo.getNick(), 7), new ForegroundColorSpan(roomTipNickColor)) .append(StringExtensionKt.subAndReplaceDot(fairyMsgInfo.getNick(), 7), new OriginalDrawStatusClickSpan(roomTipNickColor, false) {
@Override
public void onClick(@NonNull View widget) {
RxBus.get().post(new ShowUserInfoDialogEvent(String.valueOf(fairyMsgInfo.getUid())));
}
})
.append(" 在夺宝精灵中获得 ", new ForegroundColorSpan(whiteColor)) .append(" 在夺宝精灵中获得 ", new ForegroundColorSpan(whiteColor))
.append(fairyMsgInfo.getRewardName(), new ForegroundColorSpan(Color.WHITE)); .append(fairyMsgInfo.getRewardName(), new ForegroundColorSpan(Color.WHITE));
if (fairyMsgInfo.getRewardNum() > 1) { if (fairyMsgInfo.getRewardNum() > 1) {

View File

@@ -2,12 +2,14 @@ package com.mango.moshen.common.widget;
import androidx.annotation.ColorInt; import androidx.annotation.ColorInt;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import android.text.TextPaint; import android.text.TextPaint;
import android.text.style.ClickableSpan; import android.text.style.ClickableSpan;
public abstract class OriginalDrawStatusClickSpan extends ClickableSpan { public abstract class OriginalDrawStatusClickSpan extends ClickableSpan {
private final Integer mColor; private final Integer mColor;
private final boolean underlineText;
public OriginalDrawStatusClickSpan() { public OriginalDrawStatusClickSpan() {
this(null); this(null);
@@ -15,13 +17,19 @@ public abstract class OriginalDrawStatusClickSpan extends ClickableSpan {
public OriginalDrawStatusClickSpan(@ColorInt Integer color) { public OriginalDrawStatusClickSpan(@ColorInt Integer color) {
this.mColor = color; this.mColor = color;
this.underlineText = true;
}
public OriginalDrawStatusClickSpan(@ColorInt Integer color, boolean underlineText) {
this.mColor = color;
this.underlineText = false;
} }
@Override @Override
public void updateDrawState(@NonNull TextPaint ds) { public void updateDrawState(@NonNull TextPaint ds) {
if (mColor != null) { if (mColor != null) {
ds.setColor(mColor); ds.setColor(mColor);
ds.setUnderlineText(true); ds.setUnderlineText(underlineText);
} }
} }

View File

@@ -187,7 +187,7 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
private fun checkKeyNum(num: Int): Boolean { private fun checkKeyNum(num: Int): Boolean {
val keyNum = binding.tvKeyNum.text.toString().toInt() val keyNum = binding.tvKeyNum.text.toString().toInt()
if (keyNum > num) { if (keyNum >= num) {
return true return true
} }
DialogManager(context).showOkCancelDialog("购买限时装扮活动夺宝券", "去参与", "取消") { DialogManager(context).showOkCancelDialog("购买限时装扮活动夺宝券", "去参与", "取消") {

View File

@@ -7,6 +7,8 @@ import android.view.WindowManager
import androidx.core.view.isInvisible import androidx.core.view.isInvisible
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import com.mango.core.utils.subAndReplaceDot import com.mango.core.utils.subAndReplaceDot
import com.mango.core.utils.toIntOrDef
import com.mango.core.utils.toast
import com.mango.moshen.R import com.mango.moshen.R
import com.mango.moshen.base.BaseDialog import com.mango.moshen.base.BaseDialog
import com.mango.moshen.databinding.TreasureFairyDialogForestBinding import com.mango.moshen.databinding.TreasureFairyDialogForestBinding
@@ -73,18 +75,22 @@ class ForestFairyDialog : BaseDialog<TreasureFairyDialogForestBinding>() {
switchType() switchType()
} }
binding.viewBgGrab1.setOnClickListener { binding.viewBgGrab1.setOnClickListener {
if (checkBallNum(1)) {
enabledOpenBtn(false) enabledOpenBtn(false)
binding.animView.startPlay(requireContext().assets, "vap/fairy_anim_once.mp4") binding.animView.startPlay(requireContext().assets, "vap/fairy_anim_once.mp4")
binding.animView.postDelayed(showResultRunnable, 1900) binding.animView.postDelayed(showResultRunnable, 1900)
viewModel.drawForestFairy(1, currentType) viewModel.drawForestFairy(1, currentType)
} }
}
binding.viewBgGrab10.setOnClickListener { binding.viewBgGrab10.setOnClickListener {
if (checkBallNum(10)) {
enabledOpenBtn(false) enabledOpenBtn(false)
binding.animView.startPlay(requireContext().assets, "vap/fairy_anim_ten.mp4") binding.animView.startPlay(requireContext().assets, "vap/fairy_anim_ten.mp4")
binding.animView.postDelayed(showResultRunnable, 1900) binding.animView.postDelayed(showResultRunnable, 1900)
viewModel.drawForestFairy(10, currentType) viewModel.drawForestFairy(10, currentType)
} }
}
binding.animView.setOnClickListener { binding.animView.setOnClickListener {
if (canShowResult) { if (canShowResult) {
@@ -118,6 +124,22 @@ class ForestFairyDialog : BaseDialog<TreasureFairyDialogForestBinding>() {
} }
private fun checkBallNum(openNum: Int): Boolean {
val ballNum = viewModel.forestInfoLiveData.value?.let {
when (currentType) {
BASE -> it.lowBallNum.toIntOrDef(0)
EPIC -> it.middleBallNum.toIntOrDef(0)
else -> it.highBallNum.toIntOrDef(0)
}
} ?: 0
return if (ballNum >= openNum) {
true
} else {
"精灵球数量不足".toast()
false
}
}
private fun enabledOpenBtn(enable: Boolean) { private fun enabledOpenBtn(enable: Boolean) {
binding.viewBgGrab1.isEnabled = enable binding.viewBgGrab1.isEnabled = enable
binding.viewBgGrab10.isEnabled = enable binding.viewBgGrab10.isEnabled = enable

View File

@@ -6,6 +6,7 @@ import android.view.Gravity
import android.view.WindowManager import android.view.WindowManager
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.mango.core.DemoCache
import com.mango.moshen.R import com.mango.moshen.R
import com.mango.moshen.avroom.adapter.RoomVPAdapter import com.mango.moshen.avroom.adapter.RoomVPAdapter
import com.mango.moshen.base.BaseDialog import com.mango.moshen.base.BaseDialog
@@ -52,9 +53,9 @@ class MyFairyDialog : BaseDialog<TreasureFairyDialogMyFairyBinding>() {
1 -> binding.rg.check(R.id.rb_epic) 1 -> binding.rg.check(R.id.rb_epic)
2 -> binding.rg.check(R.id.rb_legend) 2 -> binding.rg.check(R.id.rb_legend)
} }
DemoCache.saveMyFairyIndex(position)
} }
}) })
binding.viewPager.adapter = RoomVPAdapter( binding.viewPager.adapter = RoomVPAdapter(
childFragmentManager, childFragmentManager,
listOf( listOf(
@@ -63,6 +64,9 @@ class MyFairyDialog : BaseDialog<TreasureFairyDialogMyFairyBinding>() {
MyFairyFragment.newInstance(MyFairyItemView.LEGEND) MyFairyFragment.newInstance(MyFairyItemView.LEGEND)
) )
) )
binding.viewPager.setCurrentItem(DemoCache.readMyFairyIndex(), false)
viewModel.getMyFairyInfo() viewModel.getMyFairyInfo()
} }

View File

@@ -8,6 +8,7 @@ import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.mango.core.treasurefairy.SendFairyInfo import com.mango.core.treasurefairy.SendFairyInfo
import com.mango.moshen.base.BaseDialog import com.mango.moshen.base.BaseDialog
import com.mango.moshen.common.EmptyViewHelper
import com.mango.moshen.databinding.TreasureFairyDialogMyFairyRecordBinding import com.mango.moshen.databinding.TreasureFairyDialogMyFairyRecordBinding
import com.mango.moshen.treasurefairy.FairyViewModel import com.mango.moshen.treasurefairy.FairyViewModel
import com.mango.moshen.treasurefairy.adapter.MyFairyRecordAdapter import com.mango.moshen.treasurefairy.adapter.MyFairyRecordAdapter
@@ -40,6 +41,7 @@ class MyFairyRecordDialog : BaseDialog<TreasureFairyDialogMyFairyRecordBinding>(
rvDelegate = RVDelegate.Builder<SendFairyInfo>() rvDelegate = RVDelegate.Builder<SendFairyInfo>()
.setAdapter(recordAdapter) .setAdapter(recordAdapter)
.setRecyclerView(binding.recyclerView) .setRecyclerView(binding.recyclerView)
.setEmptyView(EmptyViewHelper.createEmptyTextView(context,"暂无记录"))
.setLayoutManager(LinearLayoutManager(context)) .setLayoutManager(LinearLayoutManager(context))
.build() .build()

View File

@@ -6,6 +6,7 @@ import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.FrameLayout;
import com.mango.moshen.R; import com.mango.moshen.R;
import com.netease.nim.uikit.common.util.sys.ScreenUtil; import com.netease.nim.uikit.common.util.sys.ScreenUtil;
@@ -22,8 +23,13 @@ public class FairyDialogWebViewActivity extends CommonWebViewActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, ScreenUtil.screenWidth * 1100 / 750); getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(this));
getWindow().setGravity(Gravity.BOTTOM); getWindow().setGravity(Gravity.BOTTOM);
View layoutRoot = findViewById(R.id.ll_root);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) layoutRoot.getLayoutParams();
layoutParams.height = ScreenUtil.screenWidth * 1100 / 750;
layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT;
layoutRoot.setLayoutParams(layoutParams);
layoutTitleBar.setVisibility(View.GONE); layoutTitleBar.setVisibility(View.GONE);
webView.setBackgroundColor(0); webView.setBackgroundColor(0);
webView.getBackground().setAlpha(0); webView.getBackground().setAlpha(0);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -2,7 +2,11 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#00A69D" /> <solid android:color="#007983" />
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<stroke
android:width="1px"
android:color="#FFE8AA" />
</shape> </shape>

View File

@@ -6,8 +6,10 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:id="@+id/ll_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="bottom"
android:background="@drawable/treasure_fairy_bg_elf" android:background="@drawable/treasure_fairy_bg_elf"
android:orientation="vertical"> android:orientation="vertical">

View File

@@ -13,12 +13,12 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="50dp"
tools:background="@color/black"> tools:background="@color/black">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:background="@drawable/all_service_gift_level_one_background" android:background="@drawable/all_service_gift_level_one_background"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
@@ -157,7 +157,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="2dp" android:layout_marginTop="62dp"
android:layout_marginEnd="9dp" android:layout_marginEnd="9dp"
android:src="@drawable/ic_close_all_server_one" /> android:src="@drawable/ic_close_all_server_one" />

View File

@@ -10,10 +10,14 @@
type="com.mango.core.noble.AllServiceGiftProtocol.DataBean" /> type="com.mango.core.noble.AllServiceGiftProtocol.DataBean" />
</data> </data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="50dp" android:layout_marginTop="60dp"
tools:background="@color/black"> tools:background="@color/black">
<com.opensource.svgaplayer.SVGAImageView <com.opensource.svgaplayer.SVGAImageView
@@ -33,12 +37,12 @@
android:id="@+id/ll_root" android:id="@+id/ll_root"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintDimensionRatio="750:195"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingEnd="20dp" android:paddingEnd="20dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintDimensionRatio="750:195"
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"
@@ -176,14 +180,16 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="2dp" android:layout_marginTop="62dp"
android:layout_marginEnd="9dp" android:layout_marginEnd="9dp"
android:visibility="gone"
android:src="@drawable/ic_close_all_server_three" android:src="@drawable/ic_close_all_server_three"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout> </layout>

View File

@@ -13,12 +13,12 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="50dp"
tools:background="@color/black"> tools:background="@color/black">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:background="@drawable/all_service_gift_level_two_background" android:background="@drawable/all_service_gift_level_two_background"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
@@ -157,7 +157,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="2dp" android:layout_marginTop="62dp"
android:layout_marginEnd="9dp" android:layout_marginEnd="9dp"
android:src="@drawable/ic_close_all_server_two" /> android:src="@drawable/ic_close_all_server_two" />

View File

@@ -235,12 +235,13 @@
android:id="@+id/tv_nickname" android:id="@+id/tv_nickname"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="用户昵称~" android:layout_marginStart="5dp"
android:textColor="#ffffffff" android:textColor="@color/white"
android:textSize="13sp" android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@id/iv_avatar" app:layout_constraintBottom_toBottomOf="@id/iv_avatar"
app:layout_constraintStart_toEndOf="@id/iv_avatar" app:layout_constraintStart_toEndOf="@id/iv_avatar"
app:layout_constraintTop_toTopOf="@id/iv_avatar" /> app:layout_constraintTop_toTopOf="@id/iv_avatar"
tools:text="用户昵称~" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@@ -258,11 +258,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:textColor="#ff59fdff" android:textColor="#ff59fdff"
android:textSize="12sp" android:textSize="10dp"
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 后下次夺宝,额外获赠精灵球" /> tools:text="幸运值达到X后下次夺宝获赠精灵球" />
<View <View
android:id="@+id/view_prize_click" android:id="@+id/view_prize_click"

View File

@@ -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"

View File

@@ -51,7 +51,8 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:src="@drawable/treasure_fairy_ic_forest_next" android:rotation="180"
android:src="@drawable/treasure_fairy_ic_exchange_next"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@id/view_bg_gift" app:layout_constraintBottom_toBottomOf="@id/view_bg_gift"
app:layout_constraintStart_toStartOf="@id/view_bg_gift" app:layout_constraintStart_toStartOf="@id/view_bg_gift"
@@ -63,8 +64,7 @@
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:rotation="180" android:src="@drawable/treasure_fairy_ic_exchange_next"
android:src="@drawable/treasure_fairy_ic_forest_next"
app:layout_constraintEnd_toEndOf="@id/view_bg_gift" app:layout_constraintEnd_toEndOf="@id/view_bg_gift"
app:layout_constraintTop_toTopOf="@id/iv_previous" /> app:layout_constraintTop_toTopOf="@id/iv_previous" />

View File

@@ -33,7 +33,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginBottom="20dp" /> android:layout_marginBottom="20dp" />
</LinearLayout> </LinearLayout>

View File

@@ -41,7 +41,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginBottom="20dp" /> android:layout_marginBottom="20dp" />
</LinearLayout> </LinearLayout>

View File

@@ -135,12 +135,11 @@
android:id="@+id/recycler_view" android:id="@+id/recycler_view"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="26dp" android:layout_marginTop="26dp"
android:layout_marginEnd="13dp"
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_bottom" /> app:layout_constraintTop_toTopOf="@id/view_bg_bottom"
app:layout_constraintWidth_percent="0.95" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout 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_width="match_parent"
@@ -12,9 +12,14 @@
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:layout_width="90dp" android:id="@+id/fl_prize"
android:layout_height="90dp" android:layout_width="0dp"
android:background="@drawable/shape_006e7c_to_00b9af"> android:layout_height="0dp"
android:background="@drawable/shape_006e7c_to_00b9af"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView <ImageView
android:id="@+id/iv_prize_icon" android:id="@+id/iv_prize_icon"
@@ -38,6 +43,9 @@
android:maxLines="1" android:maxLines="1"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/fl_prize"
tools:text="精灵球" /> tools:text="精灵球" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -11,7 +11,7 @@
android:background="@drawable/treasure_fairy_bg_test_fairy_item_unselect" android:background="@drawable/treasure_fairy_bg_test_fairy_item_unselect"
tools:layout_width="65dp"> tools:layout_width="65dp">
<LinearLayout <View
android:id="@+id/ll_root" android:id="@+id/ll_root"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@@ -22,30 +22,38 @@
app:layout_constraintDimensionRatio="132:156" app:layout_constraintDimensionRatio="132:156"
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" />
<ImageView <ImageView
android:id="@+id/iv_fairy_icon" android:id="@+id/iv_fairy_icon"
android:layout_width="44dp" android:layout_width="0dp"
android:layout_height="44dp" android:layout_height="0dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginTop="4dp" android:layout_marginTop="3dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/default_cover" /> android:src="@drawable/default_cover"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.67" />
<TextView <TextView
android:id="@+id/tv_fairy_name" android:id="@+id/tv_fairy_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp" android:layout_marginTop="2dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:includeFontPadding="false" android:includeFontPadding="false"
android:maxLines="1" android:maxLines="1"
android:text="精灵球" android:text="精灵球"
android:textColor="#1F5764" android:textColor="#1F5764"
android:textSize="13sp" /> android:textSize="13dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/iv_fairy_icon" />
<TextView <TextView
android:id="@+id/tv_fairy_num" android:id="@+id/tv_fairy_num"
@@ -53,10 +61,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="11sp" android:textSize="11dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_fairy_name"
tools:text="1/5" /> tools:text="1/5" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -194,9 +194,9 @@
<dimen name="dp_32">32dp</dimen> <dimen name="dp_32">32dp</dimen>
<dimen name="dp_6">6dp</dimen> <dimen name="dp_6">6dp</dimen>
<dimen name="all_service_three_dialog_height">242dp</dimen> <dimen name="all_service_three_dialog_height">292dp</dimen>
<dimen name="all_service_two_dialog_height">230dp</dimen> <dimen name="all_service_two_dialog_height">280dp</dimen>
<dimen name="all_service_one_dialog_height">150dp</dimen> <dimen name="all_service_one_dialog_height">200dp</dimen>
<dimen name="dp_sign_in_total_reward_item_size">53dp</dimen> <dimen name="dp_sign_in_total_reward_item_size">53dp</dimen>
<dimen name="sp_21">21sp</dimen> <dimen name="sp_21">21sp</dimen>

View File

@@ -65,6 +65,7 @@ public class DemoCache {
private static final String KEY_SHOW_FAIRY_TIP = "key_show_fairy_tip"; private static final String KEY_SHOW_FAIRY_TIP = "key_show_fairy_tip";
private static final String KEY_NEW_GIFT_TYPE_TIP = "key_new_gift_type_tip"; private static final String KEY_NEW_GIFT_TYPE_TIP = "key_new_gift_type_tip";
private static final String KEY_NEW_GIFT_TYPE_TIP_INDICATOR = "key_new_gift_type_tip_indicator"; private static final String KEY_NEW_GIFT_TYPE_TIP_INDICATOR = "key_new_gift_type_tip_indicator";
private static final String KEY_MY_FAIRY_INDEX = "key_my_fairy_index";
private static StatusBarNotificationConfig notificationConfig; private static StatusBarNotificationConfig notificationConfig;
@@ -393,4 +394,12 @@ public class DemoCache {
return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, true); return SettingsPref.instance().getBoolean(KEY_NEW_GIFT_TYPE_TIP_INDICATOR, true);
} }
public static void saveMyFairyIndex(int index) {
SettingsPref.instance().putInt(KEY_MY_FAIRY_INDEX, index);
}
public static int readMyFairyIndex() {
return SettingsPref.instance().getInt(KEY_MY_FAIRY_INDEX, 0);
}
} }