Commit 7b02cff9 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent e4e5a11c
......@@ -23,10 +23,7 @@ class DetailAdDialog(private val context: Context, private val listener: DialogL
context, R.style.dialog
) {
private val lp: WindowManager.LayoutParams
private val iv_agreement_quit: ImageView
private val tv_detail_ad_next: TextView
private val tv_rule_date1: TextView
private val tv_rule_date2: TextView
private val iv_detail_ad_next: ImageView
init {
setContentView(R.layout.dialog_detail_ad)
......@@ -47,12 +44,8 @@ class DetailAdDialog(private val context: Context, private val listener: DialogL
}
// 查找View
tv_detail_ad_next = findViewById<View>(R.id.tv_agreement_next) as TextView
iv_agreement_quit = findViewById<View>(R.id.iv_agreement_quit) as ImageView
tv_rule_date1 = findViewById<View>(R.id.tv_rule_date1) as TextView
tv_rule_date2 = findViewById<View>(R.id.tv_rule_date2) as TextView
iv_agreement_quit.setOnClickListener(listener)
tv_detail_ad_next.setOnClickListener(listener)
iv_detail_ad_next = findViewById<View>(R.id.iv_detail_ad_next) as ImageView
iv_detail_ad_next.setOnClickListener(listener)
}
}
\ No newline at end of file
......@@ -469,10 +469,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private fun adDialog() {
detailAdDialog = DetailAdDialog(context, object : DialogListener() {
override fun onClick(v: View) {
if (AntiShake.check(v.id)) return
// if (AntiShake.check(v.id)) return
when (v.id) {
R.id.tv_detail_ad_next -> {
R.id.iv_detail_ad_next -> {
showAd()
detailAdDialog?.dismiss()
}
......
......@@ -25,7 +25,7 @@
android:textStyle="bold"></TextView>
<ImageView
android:id="@+id/iv_agreement_quit"
android:id="@+id/iv_detail_ad_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
......
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