0元购规则dialog
This commit is contained in:
parent
a5b384dbff
commit
4a5fcfa0bb
|
|
@ -44,6 +44,9 @@ class ZeroBuyActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
|||
showHintInfo()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
ZeroBuyRulesDialog(this@ZeroBuyActivity).show()
|
||||
}
|
||||
|
||||
override fun ViewBinding.initWindowInsets() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.gamedog.vididin.features.zero
|
||||
|
||||
|
||||
import android.content.Context
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.ama.core.architecture.widget.BindingDialog
|
||||
import com.gamedog.vididin.databinding.DialogZeroBuyRuleBinding as ViewBinding
|
||||
import com.gamedog.vididin.router.Router
|
||||
|
||||
|
||||
class ZeroBuyRulesDialog(context: Context) : BindingDialog<ViewBinding>(context, ViewBinding::inflate) {
|
||||
|
||||
init {
|
||||
build()
|
||||
}
|
||||
|
||||
|
||||
private fun build() {
|
||||
with()
|
||||
setCenter()
|
||||
setMaskValue(0.8f)
|
||||
setCanCancel(false)
|
||||
|
||||
mBinding.run {
|
||||
setOnClickBatch(tvConfirm, ivClose) {
|
||||
when (this) {
|
||||
tvConfirm, ivClose -> {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun gotoWatchVideo() {
|
||||
ownerActivity?.let { Router.Withdraw.startActivity(it) }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -17,9 +17,9 @@ class BeginnerGiftDialog(context: Context) : BindingDialog<DialogBeginnerGiftBin
|
|||
|
||||
private fun build() {
|
||||
with()
|
||||
setCanceledOnTouchOutside(false)
|
||||
setCenter()
|
||||
setMaskValue(0.93f)
|
||||
setCanCancel(false)
|
||||
|
||||
mBinding.run {
|
||||
setOnClickBatch(tvAction) {
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ class WatchVideoDialog(context: Context) : BindingDialog<DialogWatchVideoBinding
|
|||
|
||||
private fun build() {
|
||||
with()
|
||||
setCanceledOnTouchOutside(false)
|
||||
setCenter()
|
||||
setMaskValue(0.93f)
|
||||
setCanCancel(false)
|
||||
|
||||
mBinding.run {
|
||||
setOnClickBatch(flAction, ivClose) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient android:type="linear" android:useLevel="true"
|
||||
android:startColor="#ff009c37"
|
||||
android:endColor="#ff29ce00" android:angle="90" />
|
||||
<corners android:topLeftRadius="42dp" android:topRightRadius="42dp" android:bottomLeftRadius="42dp" android:bottomRightRadius="42dp" />
|
||||
</shape>
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="end"
|
||||
android:src="@mipmap/icon_close"
|
||||
android:layout_marginEnd="30dp"
|
||||
/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:clipChildren="false"
|
||||
android:gravity="center_horizontal"
|
||||
android:background="@drawable/bg_benefit_top_white"
|
||||
>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/black_28"
|
||||
android:text="@string/zero_buy_rule_dialog_title"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray6"
|
||||
android:text="@string/zero_buy_rule_dialog_descript"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_rules_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/gray9"
|
||||
android:text="@string/zero_buy_rule_dialog_rule"
|
||||
/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_but_zero_buy_dialog"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/understood"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
@ -84,6 +84,7 @@
|
|||
<color name="red_10_dark">#FF872D10</color>
|
||||
<color name="gray_60">#FF606060</color>
|
||||
<color name="black_33">#333333</color>
|
||||
<color name="black_28">#FF2F2828</color>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
@ -46,6 +46,10 @@
|
|||
<string name="benefit_task_top_hint">Conclua todas as tarefas para retirar R$ 1.0</string>
|
||||
<string name="benefit_task_item_description">Assista a notícias ou vídeos curtos por 800 min</string>
|
||||
<string name="go_and_do">Ir para</string>
|
||||
<string name="zero_buy_rule_dialog_title">Regras para Ganhar</string>
|
||||
<string name="zero_buy_rule_dialog_descript">Número Sorteado = Segundos da Conclusão % Número de Participantes + 1%: Computes the remainder after division by team size.</string>
|
||||
<string name="zero_buy_rule_dialog_rule">· Gaste Moedas de Propaganda para participar;\n <![CDATA[·Draw when ful l& Reembolso automático se não completar.]]></string>
|
||||
<string name="understood">Entendi</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
@ -137,13 +137,19 @@ open class BindingDialog<VB : ViewBinding>(private val context: Context,
|
|||
return this
|
||||
}
|
||||
|
||||
fun setCanCancel(cancelable: Boolean = true): BindingDialog<VB> {
|
||||
setCanceledOnTouchOutside(cancelable)
|
||||
setCancelable(cancelable)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun setCenter(cancelable: Boolean = true): BindingDialog<VB> {
|
||||
setGravity(Gravity.CENTER)
|
||||
setWidthRatio(0.8)
|
||||
setBgRadius(16)
|
||||
setAnimationsStyle(R.style.dialog_alpha)
|
||||
setCanceledOnTouchOutside(cancelable)
|
||||
setCancelable(cancelable)
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue