Commit 2a95ecdd authored by mengcuiguang's avatar mengcuiguang

代码优化

parent b087bc27
...@@ -348,19 +348,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -348,19 +348,19 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
isShowNewuserFlag = true isShowNewuserFlag = true
showNewcomerDialog(user.userMsg.rewardCoin) showNewcomerDialog(user.userMsg.rewardCoin)
} else { } else {
iv_main_newcomer.visibility = View.VISIBLE // iv_main_newcomer.visibility = View.VISIBLE
//
Handler(Looper.getMainLooper()).postDelayed({ // Handler(Looper.getMainLooper()).postDelayed({
if (!isAdded) return@postDelayed // if (!isAdded) return@postDelayed
//
rope?.stop() // rope?.stop()
rope = null // rope = null
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1) // rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.playOn(iv_main_newcomer) // .playOn(iv_main_newcomer)
}, 300) // }, 300)
} }
} else { } else {
iv_main_newcomer.visibility = View.GONE // iv_main_newcomer.visibility = View.GONE
} }
...@@ -453,17 +453,17 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -453,17 +453,17 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
when (v.id) { when (v.id) {
R.id.tv_newcomer_time -> { R.id.tv_newcomer_time -> {
newcomerDialog?.dismiss() // newcomerDialog?.dismiss()
iv_main_newcomer.visibility = View.VISIBLE // iv_main_newcomer.visibility = View.VISIBLE
//
Handler(Looper.getMainLooper()).postDelayed({ // Handler(Looper.getMainLooper()).postDelayed({
if (!isAdded) return@postDelayed // if (!isAdded) return@postDelayed
//
rope?.stop() // rope?.stop()
rope = null // rope = null
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1) // rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1)
.playOn(iv_main_newcomer) // .playOn(iv_main_newcomer)
}, 300) // }, 300)
} }
} }
} }
......
...@@ -59,7 +59,7 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int, ...@@ -59,7 +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) // tv_newcomer_time.setOnClickListener(listener)
val sumCoin = rewardCoin.toString() val sumCoin = rewardCoin.toString()
val allcoinBig = BigDecimal(sumCoin) val allcoinBig = BigDecimal(sumCoin)
...@@ -72,18 +72,18 @@ class NewcomerDialog(private val context: Context, private val rewardCoin: Int, ...@@ -72,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,7 +37,6 @@ ...@@ -37,7 +37,6 @@
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>
......
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