Commit 95943cd1 authored by mengcuiguang's avatar mengcuiguang

新人红包去除倒计时,添加关闭

parent 951df63f
...@@ -18,7 +18,7 @@ import kotlinx.android.synthetic.main.dialog_newcomer.* ...@@ -18,7 +18,7 @@ import kotlinx.android.synthetic.main.dialog_newcomer.*
import kotlinx.android.synthetic.main.dialog_sign.* import kotlinx.android.synthetic.main.dialog_sign.*
import java.math.BigDecimal import java.math.BigDecimal
class NewcomerDialog(private val context: Context, private val rewardCoin: Int) : class NewcomerDialog(private val context: Context, private val rewardCoin: Int, listener: DialogListener) :
Dialog( Dialog(
context, R.style.dialog context, R.style.dialog
) { ) {
...@@ -59,6 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int) ...@@ -59,6 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int)
isClickBtn = true isClickBtn = true
adListener?.showAd() adListener?.showAd()
} }
tv_newcomer_time.setOnClickListener(listener)
val sumCoin = rewardCoin.toString() val sumCoin = rewardCoin.toString()
val allcoinBig = BigDecimal(sumCoin) val allcoinBig = BigDecimal(sumCoin)
...@@ -71,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int) ...@@ -71,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int)
.append("元") .append("元")
.create() .create()
Handler().postDelayed({ // Handler().postDelayed({
startTimer() // startTimer()
}, 900) // }, 900)
} }
override fun dismiss() { override fun dismiss() {
super.dismiss() super.dismiss()
if (timer != null) { //防止计时器重复 // if (timer != null) { //防止计时器重复
timer!!.stop() // timer!!.stop()
timer = null // timer = null
} // }
} }
fun startTimer() { fun startTimer() {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:background="@mipmap/ic_draw_quit"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp"></TextView> android:textSize="14sp"></TextView>
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
android:id="@+id/iv_main_sign" android:id="@+id/iv_main_sign"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="400dp" android:layout_marginTop="330dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
...@@ -201,6 +201,18 @@ ...@@ -201,6 +201,18 @@
android:textSize="13sp" /> android:textSize="13sp" />
</FrameLayout> </FrameLayout>
<ImageView
android:id="@+id/iv_main_newcomer"
android:layout_width="65dp"
android:layout_height="65dp"
android:layout_marginLeft="10dp"
android:visibility="gone"
android:layout_marginTop="430dp"
android:layout_marginRight="20dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@mipmap/ic_main_comer" />
<ImageView <ImageView
android:id="@+id/iv_main_tempanim" android:id="@+id/iv_main_tempanim"
......
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