Commit cb62ca79 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent ae639423
......@@ -695,12 +695,13 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
private fun showPayCancelDialog() {
VipPayCancelDialog(this, object : DialogListener() {
val vipBean = vipList!![0]
VipPayCancelDialog(this,vipBean.price, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
val vipBean = vipList!![0]
vipPresenter.getVipPayParams(
"ALIPAY",
vipBean.pid, isAliPayInstalled()
......
......@@ -55,7 +55,6 @@ class PayYesDialog(
iv_dialog_vip_quit.setOnClickListener(listener)
tv_dialog_vip_next.setOnClickListener(listener)
if (vipBean.trial == 0) {
//0-没签约 无0.01
tv_dialog_vip_count.text = SpanUtils()
.append("" + vipBean.price)
......@@ -64,14 +63,5 @@ class PayYesDialog(
.setFontSize(16, true)
.create()
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
} else {
tv_dialog_vip_count.text = SpanUtils()
.append("0.01")
.setFontSize(30, true)
.append(" 元")
.setFontSize(16, true)
.create()
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top1)
}
}
}
\ No newline at end of file
......@@ -9,9 +9,11 @@ import android.view.WindowManager
import com.duben.miniplaylet.R
import com.duben.miniplaylet.common.AppConfig
import com.duben.miniplaylet.utils.MilliCountDownTimer
import kotlinx.android.synthetic.main.dialog_vip_pay_cancel.*
class VipPayCancelDialog(
val activity: Activity,
val cash: Double,
private val listener: DialogListener
) :
Dialog(activity, R.style.dialog) {
......@@ -39,7 +41,7 @@ class VipPayCancelDialog(
findViewById<View>(R.id.iv_back).setOnClickListener {
dismiss()
}
tv_cancel_cash.text="${cash}元"
listener.setDialog(this)
findViewById<View>(R.id.btn).setOnClickListener(listener)
......
......@@ -19,16 +19,32 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="360dp"
android:layout_marginTop="30dp"
android:src="@mipmap/bg_vip_cancel"
<FrameLayout
android:layout_width="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="360dp"
android:layout_marginTop="30dp"
android:src="@mipmap/bg_vip_cancel"
/>
<TextView
android:id="@+id/tv_cancel_cash"
android:layout_width="wrap_content"
android:textSize="30dp"
android:text="0.01元"
android:textStyle="bold"
android:layout_marginLeft="110dp"
android:layout_marginTop="193dp"
android:textColor="@color/tv_message_recente_money"
android:layout_height="wrap_content"></TextView>
</FrameLayout>
<Button
android:id="@+id/btn"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment