Commit 2a95ecdd authored by mengcuiguang's avatar mengcuiguang

代码优化

parent b087bc27
......@@ -348,19 +348,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
isShowNewuserFlag = true
showNewcomerDialog(user.userMsg.rewardCoin)
} else {
iv_main_newcomer.visibility = View.VISIBLE
Handler(Looper.getMainLooper()).postDelayed({
if (!isAdded) return@postDelayed
rope?.stop()
rope = null
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.playOn(iv_main_newcomer)
}, 300)
// iv_main_newcomer.visibility = View.VISIBLE
//
// Handler(Looper.getMainLooper()).postDelayed({
// if (!isAdded) return@postDelayed
//
// rope?.stop()
// rope = null
// rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
// .playOn(iv_main_newcomer)
// }, 300)
}
} else {
iv_main_newcomer.visibility = View.GONE
// iv_main_newcomer.visibility = View.GONE
}
......@@ -453,17 +453,17 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
when (v.id) {
R.id.tv_newcomer_time -> {
newcomerDialog?.dismiss()
iv_main_newcomer.visibility = View.VISIBLE
Handler(Looper.getMainLooper()).postDelayed({
if (!isAdded) return@postDelayed
rope?.stop()
rope = null
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.playOn(iv_main_newcomer)
}, 300)
// newcomerDialog?.dismiss()
// iv_main_newcomer.visibility = View.VISIBLE
//
// Handler(Looper.getMainLooper()).postDelayed({
// if (!isAdded) return@postDelayed
//
// rope?.stop()
// rope = null
// rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
// .playOn(iv_main_newcomer)
// }, 300)
}
}
}
......
......@@ -59,7 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
isClickBtn = true
adListener?.showAd()
}
tv_newcomer_time.setOnClickListener(listener)
// tv_newcomer_time.setOnClickListener(listener)
val sumCoin = rewardCoin.toString()
val allcoinBig = BigDecimal(sumCoin)
......@@ -72,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int,
.append("元")
.create()
// Handler().postDelayed({
// startTimer()
// }, 900)
Handler().postDelayed({
startTimer()
}, 900)
}
override fun dismiss() {
super.dismiss()
// if (timer != null) { //防止计时器重复
// timer!!.stop()
// timer = null
// }
if (timer != null) { //防止计时器重复
timer!!.stop()
timer = null
}
}
fun startTimer() {
......
......@@ -37,7 +37,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@mipmap/ic_draw_quit"
android:gravity="center"
android:textColor="@color/white"
android:textSize="14sp"></TextView>
......
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