提现 UI+1

This commit is contained in:
renhaoting 2025-11-24 18:53:04 +08:00
parent cdc015c3e1
commit 92ba0f4831
9 changed files with 210 additions and 8 deletions

View File

@ -5,6 +5,9 @@ import android.content.Intent
import android.view.LayoutInflater
import androidx.activity.viewModels
import com.ama.core.architecture.appBase.AppViewsActivity
import com.ama.core.architecture.util.ResUtil
import com.ama.core.architecture.util.setOnClickBatch
import com.gamedog.vididin.R
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
import dagger.hilt.android.AndroidEntryPoint
import kotlin.getValue
@ -24,7 +27,42 @@ class WithDrawActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), On
}
override fun ViewBinding.initViews() {
//TODO("Not yet implemented")
with(binding) {
withdraw01.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 0.1, {
})
withdraw01.setSelected()
withdraw10.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 10, {
})
withdraw20.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 20, {
})
withdraw50.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 50, {
})
withdraw100.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 100, {
})
withdraw300.setNumAndAction(ResUtil.getString(R.string.cash) + " " + 300, {
})
withdrawPix2.setIconAndText(R.mipmap.pix2, R.string.pix2, {
})
tvSacar.setOnClickListener {
}
}
}
override fun ViewBinding.initListeners() {

View File

@ -0,0 +1,48 @@
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.gamedog.vididin.R
import com.gamedog.vididin.databinding.WithdrawItemViewBinding as ViewBinding
class WithDrawItemView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private var mBinding: ViewBinding
init {
mBinding = ViewBinding.inflate(LayoutInflater.from(context), this, true)
mBinding.run {
}
}
fun setNumAndAction(number: String, clickAction: ()->Unit) {
mBinding.tvWithdrawNum.text = number
mBinding.root.setOnClickListener {
clickAction.invoke()
}
}
fun setIconAndText(iconRes: Int, textRes: Int, clickAction: ()->Unit) {
mBinding.tvWithdrawNum.text = ResUtil.getString(textRes)
mBinding.ivItemIcon.setImageResource(iconRes)
mBinding.root.setOnClickListener {
clickAction.invoke()
}
}
fun setSelected() {
mBinding.root.setBackgroundResource(R.drawable.withdraw_item_bg_selected)
}
}

View File

@ -0,0 +1,12 @@
<?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="#ff009b39" />
<gradient android:type="linear" android:useLevel="true"
android:startColor="#ffe8ffef"
android:endColor="#ffffffff" android:angle="90" />
<corners android:radius="10dp" />
</shape>

View File

@ -0,0 +1,12 @@
<?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="#ffeeeeee" />
<gradient android:type="linear" android:useLevel="true"
android:startColor="#ffffffff"
android:endColor="#ffffffff" android:angle="90" />
<corners android:radius="10dp" />
</shape>

View File

@ -121,6 +121,62 @@
android:layout_marginTop="10dp"
android:orientation="vertical">
<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:layout_height="wrap_content"
android:layout_weight="1"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_10"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_20"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</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"
/>
<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>
@ -139,14 +195,14 @@
/>
<LinearLayout
android:layout_width="match_parent"
<com.gamedog.vididin.features.withdraw.widget.WithDrawItemView
android:id="@+id/withdraw_pix2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:orientation="vertical">
</LinearLayout>
android:layout_weight="1"
/>
@ -158,7 +214,7 @@
android:id="@+id/tv_sacar"
android:layout_width="345dp"
android:layout_height="66dp"
android:layout_marginTop="145dp"
android:layout_marginTop="75dp"
android:layout_gravity="center_horizontal"
android:paddingVertical="8dp"
android:gravity="center"

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:layout_width="109dp"
android:layout_height="75dp"
android:orientation="vertical"
android:background="@drawable/withdraw_item_bg_unselected"
android:gravity="center_horizontal"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_item_icon"
android:layout_width="17dp"
android:layout_height="22dp"
android:layout_marginTop="10dp"
android:src="@mipmap/icon_cash"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_withdraw_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/green_1a"
android:text="@string/cash00"
/>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -85,6 +85,7 @@
<color name="gray_60">#FF606060</color>
<color name="black_33">#333333</color>
<color name="black_28">#FF2F2828</color>
<color name="green_1a">#FF00591A</color>
</resources>

View File

@ -22,7 +22,9 @@
<string name="watch_video_hint">Parabéns! Você ganhou a recompensa por assistir ao vídeo!</string>
<string name="papabens">Parabéns!</string>
<string name="papabens_hint">Você recebeu um presente de boas-vindas</string>
<string name="cash">R$ </string>
<string name="cash01">R$ 0.1</string>
<string name="cash00">R$ 0.0</string>
<string name="beginner_withdraw_title">Saque para Novatos</string>
<string name="daily_video_task_title">Assistir a %d vídeo</string>
<string name="beginner_notify_title">Notificações push</string>
@ -55,6 +57,7 @@
<string name="with_draw_select_number">Selecione o valor</string>
<string name="pix2_title">Método de retirada</string>
<string name="sacar">Sacar</string>
<string name="pix2">PIX2</string>
</resources>