Commit b536733c authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 0c88bda6
......@@ -9,6 +9,7 @@ public class AppConfig {
public static boolean app_updateing = false;
public static boolean mainShowHalfAd = false;
public static boolean mainMusicRefresh = false;
public static int fragmentClickFlag = 0;
public static int riskPercentage = 0;
......
......@@ -15,6 +15,7 @@ import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.AlipayAuthManager
import com.duben.dayplaylet.manager.AppHttpManager
......@@ -93,11 +94,11 @@ class NineActivity : BaseActivity(), View.OnClickListener {
when (v.id) {
R.id.iv_nine_back -> {
AppConfig.mainMusicRefresh=true
refreshTaskCount()
Handler(Looper.getMainLooper()).postDelayed({
refreshTaskCount()
finish()
}, 500)
finish()
}
R.id.iv_nine_next -> {
isClickFlag = true
......
......@@ -182,9 +182,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
Constant.CARRIERTYPE_REWARD_FIRST -> {
val tempCoin = userInfo?.rewardCoin ?: 0
Handler(Looper.getMainLooper()).postDelayed({
if (tempCoin == 0) {
tv_cash.text = "18.88元"
}
tv_cash.text = "18.88元"
ConsumerToastUtil.showAwardText(requireContext(), tempCoin, 0)
Handler(Looper.getMainLooper()).postDelayed({
addAnimation(iv_main_tempanim, iv_cash, R.mipmap.ic_redpkg)
......@@ -199,9 +197,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}, 300)
}, 1400)
Handler(Looper.getMainLooper()).postDelayed({
if (tempCoin == 0) {
tv_cash.text = "18.88元"
}
tv_cash.text = "18.88元"
showSignDialog()
}, 2000)
}, 300)
......
......@@ -121,6 +121,13 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
MyExpressManager.instance.preLoadAd()
musicPresenter.rdSongMsg()
if (AppConfig.mainMusicRefresh) {
AppConfig.mainMusicRefresh = false
Handler(Looper.getMainLooper()).postDelayed({
musicPresenter.rdSongMsg()
}, 1500)
}
}
}
......
......@@ -105,6 +105,7 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
if (AntiShake.check(tv_my_id?.id)) return
AppConfig.mainShowHalfAd = false
MyExpressManager.instance.preLoadAd()
if (!TextUtils.isEmpty(userManager?.userID)) {
......
......@@ -74,7 +74,7 @@ class VideoRewardDialog(
pb.progress = currentCash.toInt()
tvStr.text = "${currentCash}/100"
ibClose.setOnClickListener { dismiss() }
ibClose.setOnClickListener(listener)
ll.setOnClickListener(listener)
playFingerAnim(lav)
......
......@@ -203,9 +203,15 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override fun onResume() {
super.onResume()
dpWidget?.fragment?.onResume()
videoPresenter.rdVedioMsg()
}
override fun onPause() {
super.onPause()
dpWidget?.fragment?.onPause()
}
private fun isLockIndex(): Boolean {
return mCurrentIndex > mInitUnlockIndex
}
......@@ -539,8 +545,17 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO)
when (v?.id) {
R.id.ll -> {
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO)
}
R.id.ib_close -> {
dialog?.dismiss()
dpWidget?.fragment?.onResume()
}
}
}
}
)
......
......@@ -3,8 +3,8 @@
android:shape="rectangle">
<!-- 填充的颜色 -->
<stroke
android:width="1dp"
android:color="@color/red" />
android:width="2dp"
android:color="@color/color_F8B243" />
<solid android:color="@color/white" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
......
......@@ -3,8 +3,8 @@
android:shape="rectangle">
<!-- 填充的颜色 -->
<stroke
android:width="1dp"
android:color="@color/graya" />
android:width="2dp"
android:color="@color/color_C6C6C6" />
<solid android:color="@color/white" />
<!-- 设置按钮的四个角为弧形 -->
......
......@@ -41,5 +41,8 @@
<color name="color_50FFFC9F">#80FFFC9F</color>
<color name="color_8D8F90">#7F8182</color>
<color name="color_F8B243">#F8B243</color>
<color name="color_C6C6C6">#C6C6C6</color>
</resources>
\ No newline at end of file
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