[Modify]夺宝精灵和尋愛邏輯修改
@@ -224,9 +224,9 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
|
||||
binding.tvShortLuckyValue.text =
|
||||
SpannableBuilder()
|
||||
.append("達到", ForegroundColorSpan("#59FDFF".toColorInt()))
|
||||
.append("還差", ForegroundColorSpan("#59FDFF".toColorInt()))
|
||||
.append("${it.needLuckyNum}", ForegroundColorSpan("#FFE8AA".toColorInt()))
|
||||
.append("后下次奪寶,額外獲贈傳説精靈", ForegroundColorSpan("#59FDFF".toColorInt()))
|
||||
.append("幸運值,額外獲贈傳説精靈", ForegroundColorSpan("#59FDFF".toColorInt()))
|
||||
.build()
|
||||
binding.ivLuckyStone.post {
|
||||
val drawable =
|
||||
|
@@ -1,10 +1,12 @@
|
||||
package com.yizhuan.erban.treasurefairy.adapter
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.ExchangeGiftInfo
|
||||
import com.yizhuan.xchat_android_core.treasurefairy.PropItemInfo
|
||||
|
||||
class ExchangeDebrisAdapter :
|
||||
BaseQuickAdapter<ExchangeGiftInfo, BaseViewHolder>(R.layout.treasure_fairy_item_exchange_debris) {
|
||||
@@ -12,7 +14,19 @@ class ExchangeDebrisAdapter :
|
||||
override fun convert(helper: BaseViewHolder, item: ExchangeGiftInfo) {
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_prize_icon), item.rewardPicUrl)
|
||||
helper.setText(R.id.tv_prize_name, item.getPrizeName())
|
||||
helper.setText(R.id.tv_need_num, "${item.expendNum}")
|
||||
|
||||
val adapter: BaseQuickAdapter<PropItemInfo, BaseViewHolder> =
|
||||
object : BaseQuickAdapter<PropItemInfo, BaseViewHolder>(R.layout.item_exchange_debris) {
|
||||
override fun convert(helper: BaseViewHolder, item: PropItemInfo) {
|
||||
ImageLoadUtilsV2.loadImage(helper.getView(R.id.iv_icon), item.picUrl)
|
||||
helper.setText(R.id.tv_num, "${item.propName}x${item.propNum}")
|
||||
}
|
||||
}
|
||||
helper.getView<RecyclerView>(R.id.mRecyclerView).adapter = adapter
|
||||
item.propItems?.let {
|
||||
adapter.setNewData(it)
|
||||
}
|
||||
|
||||
helper.addOnClickListener(R.id.tv_exchange)
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,6 @@ import com.yizhuan.xchat_android_core.utils.toast
|
||||
class ExchangeDebrisFragment :
|
||||
BaseViewBindingFragment<TreasureFairyFragmentExchangeDebrisBinding>() {
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(fairyType: Int): ExchangeDebrisFragment {
|
||||
val args = Bundle()
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_box_buy.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_token.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
6
app/src/main/res/drawable/bg_683fad_10.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#683FAD" />
|
||||
<corners android:radius="@dimen/dp_10" />
|
||||
</shape>
|
5
app/src/main/res/drawable/bg_8651e0.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#8651e0" />
|
||||
</shape>
|
9
app/src/main/res/drawable/bg_8651e0_stroke_ffffff.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">
|
||||
<stroke
|
||||
android:width="0.5dp"
|
||||
android:color="@color/color_white" />
|
||||
<corners android:radius="@dimen/dp_15" />
|
||||
<solid android:color="@color/color_8651E0"/>
|
||||
</shape>
|
7
app/src/main/res/drawable/selector_bg_box_price.xml
Normal file
@@ -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/bg_683fad_10" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/bg_8651e0" />
|
||||
|
||||
</selector>
|
@@ -34,7 +34,6 @@
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginBottom="150dp"
|
||||
android:layout="@layout/layout_vs_task_tips"
|
||||
/>
|
||||
android:layout="@layout/layout_vs_task_tips" />
|
||||
|
||||
</FrameLayout>
|
25
app/src/main/res/layout/item_exchange_debris.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_6">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_25"
|
||||
android:layout_height="@dimen/dp_25"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_num"
|
||||
tools:text="天菊龜x2"
|
||||
android:textSize="8sp"
|
||||
android:textColor="@color/color_white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
@@ -46,19 +46,16 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="我的可愛頭飾(1天)" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_need_num"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/mRecyclerView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="3dp"
|
||||
android:gravity="center"
|
||||
android:text="3"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_prize_name"
|
||||
app:drawableStartCompat="@drawable/treasure_fairy_ic_exchange_debris" />
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_exchange"
|
||||
@@ -72,6 +69,6 @@
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_need_num" />
|
||||
app:layout_constraintTop_toBottomOf="@id/mRecyclerView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -686,5 +686,7 @@
|
||||
<color name="color_66F6F6F6">#66F6F6F6</color>
|
||||
<color name="color_3AEAC7">#3AEAC7</color>
|
||||
<color name="color_FFFEBB">#FFFEBB</color>
|
||||
<color name="color_8651E0">#8651E0</color>
|
||||
<color name="color_7748C7">#7748C7</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -85,6 +85,10 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
private int sendMessageSwitchLevel;
|
||||
private int price;
|
||||
|
||||
private boolean isSelect = false;
|
||||
|
||||
private int mNum = 1;
|
||||
|
||||
public static void start(Context context) {
|
||||
Intent starter = new Intent(context, TreasureBoxActivity.class);
|
||||
context.startActivity(starter);
|
||||
@@ -121,45 +125,53 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
if (walletInfo != null) {
|
||||
mBinding.tvDiamondNum.setText(FormatUtils.formatBigInteger(walletInfo.getDiamondNum()));
|
||||
}
|
||||
mBinding.editNum.addTextChangedListener(new TextWatcherWrapper() {
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
int num = StringUtils.toInt(mBinding.editNum.getText().toString(), 0);
|
||||
if (num > 200) {
|
||||
mBinding.editNum.setText("200");
|
||||
mBinding.editNum.setSelection(3);
|
||||
SingleToastUtil.showToast(ResUtil.getString(R.string.treasure_box_activity_treasureboxactivity_01));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.view1.setOnClickListener(v -> setBoxPriceSelect(1));
|
||||
mBinding.view2.setOnClickListener(v -> setBoxPriceSelect(2));
|
||||
mBinding.view3.setOnClickListener(v -> setBoxPriceSelect(3));
|
||||
|
||||
mBinding.view1.setSelected(true);
|
||||
mBinding.tv1.setAlpha(1f);
|
||||
|
||||
loadKeyInfo();
|
||||
looperPrize();
|
||||
looperHintPrize();
|
||||
|
||||
new SoftKeyboardStateHelper(mBinding.editNum).addSoftKeyboardStateListener(new SoftKeyboardStateHelper.SoftKeyboardStateListener() {
|
||||
@Override
|
||||
public void onSoftKeyboardOpened(int keyboardHeightInPx) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSoftKeyboardClosed() {
|
||||
int num = StringUtils.toInt(mBinding.editNum.getText().toString(), 0);
|
||||
if (num == 0) {
|
||||
mBinding.editNum.setText("1");
|
||||
mBinding.editNum.setSelection(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
private void setBoxPriceSelect(int pos) {
|
||||
isSelect = true;
|
||||
if(pos == 1){
|
||||
mNum = 1;
|
||||
mBinding.view1.setSelected(true);
|
||||
mBinding.view2.setSelected(false);
|
||||
mBinding.view3.setSelected(false);
|
||||
mBinding.tv1.setAlpha(1f);
|
||||
mBinding.tv2.setAlpha(0.4f);
|
||||
mBinding.tv3.setAlpha(0.4f);
|
||||
} else if(pos == 2){
|
||||
mNum = 10;
|
||||
mBinding.view1.setSelected(false);
|
||||
mBinding.view2.setSelected(true);
|
||||
mBinding.view3.setSelected(false);
|
||||
mBinding.tv1.setAlpha(0.4f);
|
||||
mBinding.tv2.setAlpha(1f);
|
||||
mBinding.tv3.setAlpha(0.4f);
|
||||
} else if(pos == 3){
|
||||
mNum = 100;
|
||||
mBinding.view1.setSelected(false);
|
||||
mBinding.view2.setSelected(false);
|
||||
mBinding.view3.setSelected(true);
|
||||
mBinding.tv1.setAlpha(0.4f);
|
||||
mBinding.tv2.setAlpha(0.4f);
|
||||
mBinding.tv3.setAlpha(1f);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"CheckResult", "ClickableViewAccessibility"})
|
||||
private void loadKeyInfo() {
|
||||
sendMessageSwitchLevel = AvRoomDataManager.get().mFindLoveSwitchVo.getSendMsgLevel();
|
||||
price = (int) AvRoomDataManager.get().mFindLoveSwitchVo.getPrice();
|
||||
mBinding.tvDiamond.setText(getString(R.string.text_diamond, price));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,14 +186,14 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
case R.id.tv_rank:
|
||||
BoxRankingActivity.start(this);
|
||||
break;
|
||||
case R.id.iv_open:
|
||||
openBox(StringUtils.toInt(mBinding.editNum.getText().toString(), 0));
|
||||
case R.id.iv_box_1:
|
||||
openBox(1);
|
||||
break;
|
||||
case R.id.iv_sub:
|
||||
mBinding.editNum.setText(String.valueOf(Math.max(StringUtils.toInt(mBinding.editNum.getText().toString(), 0) - 1, 1)));
|
||||
case R.id.iv_box_2:
|
||||
openBox(10);
|
||||
break;
|
||||
case R.id.iv_add:
|
||||
mBinding.editNum.setText(String.valueOf(Math.min((StringUtils.toInt(mBinding.editNum.getText().toString(), 0) + 1), 9999)));
|
||||
case R.id.iv_box_3:
|
||||
openBox(100);
|
||||
break;
|
||||
case R.id.view_bg:
|
||||
case R.id.iv_title:
|
||||
@@ -199,13 +211,17 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
return;
|
||||
}
|
||||
boolean sendMessage = (sendMessageSwitchLevel != 0 && UserUtils.getExpLevel() < sendMessageSwitchLevel) || DemoCache.readNeedBoxMsg();
|
||||
mBinding.ivOpen.setEnabled(false);
|
||||
mBinding.ivBox1.setEnabled(false);
|
||||
mBinding.ivBox2.setEnabled(false);
|
||||
mBinding.ivBox3.setEnabled(false);
|
||||
mBinding.ivBoxOpen.startAnimation();
|
||||
long startTime = System.currentTimeMillis();
|
||||
BoxModel.get().openBoxDraw(count, sendMessage)
|
||||
.compose(bindToLifecycle())
|
||||
.doOnError(throwable -> {
|
||||
mBinding.ivOpen.setEnabled(true);
|
||||
mBinding.ivBox1.setEnabled(true);
|
||||
mBinding.ivBox2.setEnabled(true);
|
||||
mBinding.ivBox3.setEnabled(true);
|
||||
if (throwable instanceof FailReasonException) {
|
||||
FailReasonException failReasonException = (FailReasonException) throwable;
|
||||
if (failReasonException.getCode() == BoxModel.ERROR_CODE_DIAMOND) {
|
||||
@@ -221,7 +237,9 @@ public class TreasureBoxActivity extends BaseBindingActivity<ActivityTreasureBox
|
||||
.delay(startTime - System.currentTimeMillis() + 300, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.flatMap(openBoxResult -> {
|
||||
mBinding.ivOpen.setEnabled(true);
|
||||
mBinding.ivBox1.setEnabled(true);
|
||||
mBinding.ivBox2.setEnabled(true);
|
||||
mBinding.ivBox3.setEnabled(true);
|
||||
cacheList.addAll(openBoxResult);
|
||||
return Observable.fromIterable(openBoxResult);
|
||||
})
|
||||
|
BIN
app/src/module_treasure_box/res/drawable-xhdpi/ic_box_1.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
app/src/module_treasure_box/res/drawable-xhdpi/ic_box_10.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
app/src/module_treasure_box/res/drawable-xhdpi/ic_box_100.png
Normal file
After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 382 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 32 KiB |
@@ -18,8 +18,8 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/view_bg"
|
||||
android:layout_width="285dp"
|
||||
android:layout_height="434dp"
|
||||
android:layout_width="311dp"
|
||||
android:layout_height="474dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/treasure_box_bg_normal"
|
||||
android:onClick="@{click}"
|
||||
@@ -70,13 +70,194 @@
|
||||
android:id="@+id/iv_first_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_60"
|
||||
android:layout_marginTop="84dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_box_temp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_bg" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_box_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_box_1"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_first_box"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_first_box" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_box_2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_box_10"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_first_box"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_box_1" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_box_3"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_box_100"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_first_box"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_first_box"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_box_2" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cs_bottom"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@drawable/bg_8651e0_stroke_ffffff"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_first_box"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_first_box"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_first_box">
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_box_num"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="0"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
app:solid="@color/color_7748C7"
|
||||
app:corner="@dimen/dp_8"
|
||||
app:layout_constraintDimensionRatio="42:16"
|
||||
app:layout_constraintWidth_percent="0.145"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:src="@drawable/ic_token"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_1"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:background="@drawable/selector_bg_box_price"
|
||||
app:layout_constraintDimensionRatio="30:16"
|
||||
app:layout_constraintWidth_percent="0.104"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_box_num"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_1"
|
||||
android:text="1"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:alpha="0.4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="@+id/view_1"
|
||||
app:layout_constraintEnd_toEndOf="@+id/view_1"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_1"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_1"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_2"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:background="@drawable/selector_bg_box_price"
|
||||
app:layout_constraintDimensionRatio="30:16"
|
||||
app:layout_constraintWidth_percent="0.104"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_1"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="10"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:alpha="0.4"
|
||||
app:layout_constraintStart_toStartOf="@+id/view_2"
|
||||
app:layout_constraintEnd_toEndOf="@+id/view_2"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_2"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_2"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_3"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:background="@drawable/selector_bg_box_price"
|
||||
app:layout_constraintDimensionRatio="30:16"
|
||||
app:layout_constraintWidth_percent="0.104"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_2"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:alpha="0.4"
|
||||
app:layout_constraintStart_toStartOf="@+id/view_3"
|
||||
app:layout_constraintEnd_toEndOf="@+id/view_3"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_3"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_3"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:gravity="center"
|
||||
android:text="輸入數量"
|
||||
android:textColor="@color/white_tran_40"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:corner="@dimen/dp_10"
|
||||
app:solid="@color/color_7748C7"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_3"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_buy"/>
|
||||
|
||||
<com.coorchice.library.SuperTextView
|
||||
android:id="@+id/tv_buy"
|
||||
android:text="購買"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:gravity="center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_box_buy"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
app:layout_constraintDimensionRatio="52:22"
|
||||
app:layout_constraintWidth_percent="0.18"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/iv_box"
|
||||
android:layout_width="190dp"
|
||||
@@ -116,75 +297,6 @@
|
||||
app:layout_constraintStart_toStartOf="@id/iv_box"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_box" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:background="@drawable/ic_add_num_bg"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_open"
|
||||
app:layout_constraintEnd_toEndOf="@+id/view_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/view_bg">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_sub"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/treasure_box_sub_normal" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_num"
|
||||
android:layout_width="62dp"
|
||||
android:layout_height="23dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:background="@null"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLength="4"
|
||||
android:minWidth="40dp"
|
||||
android:text="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_add"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/treasure_box_add_normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_open"
|
||||
android:layout_width="135dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/click_open_box_selector"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_bg" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_diamond"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_DF7604"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_open"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_open"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_open"
|
||||
tools:text="1000钻/次"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_prize_hint"
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -13,7 +13,8 @@ data class ExchangeGiftInfo(
|
||||
val rewardType: String = "",
|
||||
val type: Int = 0,
|
||||
val createTime: Long = 0,
|
||||
val convertLevel: Int = 0
|
||||
val convertLevel: Int = 0,
|
||||
val propItems: List<PropItemInfo> ?= null
|
||||
) {
|
||||
|
||||
fun getPrizeName(): String {
|
||||
|
@@ -0,0 +1,8 @@
|
||||
package com.yizhuan.xchat_android_core.treasurefairy
|
||||
|
||||
data class PropItemInfo(
|
||||
val picUrl: String = "",
|
||||
val propId: Int = 0,
|
||||
val propName: String = "",
|
||||
val propNum: Int = 0
|
||||
)
|