提现root act UI调整1

This commit is contained in:
renhaoting 2025-12-12 16:30:36 +08:00
parent de9f32ae5b
commit f8e8657159
10 changed files with 302 additions and 175 deletions

View File

@ -93,25 +93,11 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
})
withdrawPix2.setSelectedState(true)
//withdrawPix2.setSelectedState(true)
updateUIItemSelectStates(0)
setOnClickBatch(tvSacar, withdrawRecord) {
setOnClickBatch(withdrawRecord) {
when(this) {
tvSacar -> {
if (mItemViewList.get(mCurSelectedIndex).getCashNum() > 1F) {
gotoWithdrawSubActivity(mCurSelectedIndex)
} else {
val hasBindBank = AccountManager.hasValidBankInfo()
val cashNum = mItemViewList.get(mCurSelectedIndex).getCashNum()
if (!hasBindBank) {
WithdrawBindBankDialog(this@WithDrawActivity).setWithDrawCashNum(cashNum).show()
} else {
WithdrawInfoConfirmDialog(this@WithDrawActivity).setWithDrawCashNum(cashNum).show()
}
}
}
withdrawRecord -> {
Router.WithdrawRecord.startActivity(this@WithDrawActivity)
}
@ -124,7 +110,21 @@ class WithDrawActivity : AppViewsEmptyViewModelActivity<ViewBinding>() {
private fun updateUIItemSelectStates(itemIndex: Int) {
mCurSelectedIndex = itemIndex
mItemViewList.forEachIndexed { index, view ->
view.setSelectedState(index == mCurSelectedIndex)
//view.setSelectedState(index == mCurSelectedIndex)
}
}
private fun handleGotoWithdraw() {
if (mItemViewList.get(mCurSelectedIndex).getCashNum() > 1F) {
gotoWithdrawSubActivity(mCurSelectedIndex)
} else {
val hasBindBank = AccountManager.hasValidBankInfo()
val cashNum = mItemViewList.get(mCurSelectedIndex).getCashNum()
if (!hasBindBank) {
WithdrawBindBankDialog(this@WithDrawActivity).setWithDrawCashNum(cashNum).show()
} else {
WithdrawInfoConfirmDialog(this@WithDrawActivity).setWithDrawCashNum(cashNum).show()
}
}
}

View File

@ -0,0 +1,54 @@
package com.gamedog.vididin.features.withdraw.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.ama.core.architecture.util.ResUtil
import com.vididin.real.money.game.R
import com.vididin.real.money.game.databinding.WithdrawItemBankViewBinding as ViewBinding
class WithDrawItemBankView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private var mItemIndex: Int = 0
private var mIsSelected = false
private var mBinding: ViewBinding
init {
mBinding = ViewBinding.inflate(LayoutInflater.from(context), this, true)
}
/**
* For withdraw number in top area
*/
fun setNumAndAction(itemIndex: Int, clickAction: (Int)->Unit) {
mItemIndex = itemIndex
mBinding.root.setOnClickListener {
clickAction.invoke(mItemIndex)
}
}
/**
* For bank item in bottom area
*/
fun setIconAndText(iconRes: Int, textRes: Int, clickAction: ()->Unit) {
mBinding.tvWithdrawNum.text = ResUtil.getString(textRes)
mBinding.ivItemIcon.setImageResource(iconRes)
mBinding.root.setOnClickListener {
clickAction.invoke()
}
}
fun setSelectedState(isSelected: Boolean) {
mIsSelected = isSelected
mBinding.root.setBackgroundResource(if (mIsSelected) R.drawable.withdraw_item_bg_selected else R.drawable.withdraw_item_bg_unselected)
}
}

View File

@ -15,7 +15,6 @@ class WithDrawItemView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private var mItemIndex: Int = 0
private var mIsSelected = false
private var mCashNum: Float = 0F
private var mBinding: ViewBinding
@ -49,10 +48,6 @@ class WithDrawItemView @JvmOverloads constructor(
}
}
fun setSelectedState(isSelected: Boolean) {
mIsSelected = isSelected
mBinding.root.setBackgroundResource(if (mIsSelected) R.drawable.withdraw_item_bg_selected else R.drawable.withdraw_item_bg_unselected)
}
fun getCashNum(): Float {
return mCashNum

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="2dp" android:color="#ff00591a" />
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
</shape>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ff00591a" />
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp" android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" />
</shape>

View File

@ -3,7 +3,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="150dp"
@ -21,7 +21,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -111,154 +110,107 @@
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginLeft="15dp"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/gray3"
android:text="@string/with_draw_select_number"
/>
<LinearLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
android:layout_marginBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_01"
android:layout_width="0dp"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/gray3"
android:text="@string/pix2_title"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_10"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="@dimen/dp10"
android:orientation="horizontal">
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemBankView
android:id="@+id/withdraw_pix2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
/>
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginLeft="15dp"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/gray3"
android:text="@string/with_draw_select_number"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_20"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
android:layout_marginHorizontal="15dp"
android:layout_marginBottom="15dp"
android:orientation="vertical">
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp10"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp10"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_50"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp10"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_100"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp10"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_300"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp10"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_50"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_100"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginHorizontal="@dimen/dp10"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_300"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginLeft="15dp"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/gray3"
android:text="@string/pix2_title"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_pix2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:visibility="invisible"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:visibility="invisible"
/>
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_sacar"
android:layout_width="345dp"
android:layout_height="66dp"
android:layout_marginTop="75dp"
android:layout_gravity="center_horizontal"
android:paddingVertical="8dp"
android:gravity="center"
android:background="@mipmap/bg_but_green"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/white"
android:text="@string/sacar"
/>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="51dp"
android:orientation="horizontal"
android:padding="@dimen/dp1"
android:gravity="center_vertical"
android:background="@drawable/withdraw_item_bg_selected"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_item_icon"
android:layout_width="17dp"
android:layout_height="22dp"
android:layout_marginStart="17dp"
android:src="@mipmap/pix2_big"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_withdraw_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/green_1a"
android:text="@string/pix2"
/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/gray_de"
android:layout_marginStart="20dp"
android:layout_marginVertical="17dp"
/>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/gray9"
android:text="@string/pix2_hint"
/>
</LinearLayout>

View File

@ -1,26 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="76dp"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_margin="@dimen/dp1"
android:background="@drawable/bg_withdraw_item">
<LinearLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_width="75dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/withdraw_item_bg_unselected"
android:gravity="center"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="H, 109:75"
>
android:gravity="center_horizontal"
android:background="@drawable/bg_withdraw_item_left">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_item_icon"
android:layout_width="17dp"
android:layout_height="22dp"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginTop="10dp"
android:src="@mipmap/icon_cash"/>
@ -30,14 +28,75 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textSize="15sp"
android:textSize="18sp"
android:textStyle="bold"
android:textColor="@color/green_1a"
android:textColor="@color/white"
android:text="@string/cash00"
/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center_vertical"
android:layout_marginHorizontal="10dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/gray3"
android:text="@string/cost_gold"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:gravity="center_vertical">
<com.ama.core.architecture.widget.CustomProgressBar
android:id="@+id/progress_bar"
android:layout_width="60dp"
android:layout_height="5dp"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:textSize="12sp"
android:textStyle="bold"
android:textColor="@color/gray9"
android:text="@string/percent"
/>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_sacar"
android:layout_width="90dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:background="@mipmap/bg_but_green"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/white"
android:text="@string/sacar"
/>
</LinearLayout>

View File

@ -100,5 +100,6 @@
<color name="red_7f">#FFFF7F00</color>
<color name="yellow_e0">#FFFEE000</color>
<color name="green_ce">#FF29CE00</color>
<color name="gray_de">#ffd8eade</color>
</resources>

View File

@ -144,5 +144,8 @@
<string name="with_draw_sub_hint">1. Grandes quantias em dinheiro sro distribuidas em vários dias;todas asrecompensas sao reais e válidas.\n2. Assistir a videos na p¡gina atual pode aumentar o progresso datarefa. Quando oprogresso atingir 100%, a recompensa diária emdinheiro pode ser reivindicada.\n3. Após reivindicar uma recompensa com sucesso, vocé podereceber a proximarecompensa em dinheiro no dia sequinte.4. Se a reivindicacao falhar, verifique se as informac\'es da contaestaopreenchidas corretamente e tente reivindicar a recompensaem dinheironovamente.\n5.Se houver comportamento de fraude, o sistema banirá a contae a colocara na</string>
<string name="title_withdraw_sub">Recompensas Diárias em Dinheiro</string>
<string name="withdraw_sub_bottom_hint">Clique em \"Saque Já\" para acelerar</string>
<string name="cost_gold">Consumo de moedas</string>
<string name="percent">%</string>
<string name="pix2_hint">Vincular conta para saque</string>
</resources>