Commit b536733c authored by mengcuiguang's avatar mengcuiguang

代码优化

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