Commit 903f90e5 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 3e3c9a58
......@@ -10,8 +10,8 @@ android {
applicationId "com.duben.duoduoplaylet"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.0.1"
flavorDimensions "default"
// dex突破65535的限制
......
......@@ -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()
......
......@@ -63,11 +63,7 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable_wx)
}
if (vipBean.price < 1) {
holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
} else {
holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
}
if (vipBean.oldPrice > 0) {
holder.tvVipItemMoney.visibility = View.VISIBLE
holder.tvVipItemMoney.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中间横线(删除线)
......
......@@ -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.duoduoplaylet.R
import com.duben.duoduoplaylet.common.AppConfig
import com.duben.duoduoplaylet.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