Commit c7281248 authored by mengcuiguang's avatar mengcuiguang

Merge branch 'dev_wangzhuan_meirixiaoduanju_0927' of...

Merge branch 'dev_wangzhuan_meirixiaoduanju_0927' of http://gitlab.mints-id.com/android/android_vedio into dev_wangzhuan_meirixiaoduanju_0927
parents 04f8552c 1021429d
...@@ -32,7 +32,6 @@ import com.duben.dayplaylet.utils.rxutil.RxjavaUtil ...@@ -32,7 +32,6 @@ import com.duben.dayplaylet.utils.rxutil.RxjavaUtil
import com.duben.library.net.neterror.BaseSubscriber import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable import com.duben.library.net.neterror.Throwable
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_hint.*
import kotlinx.android.synthetic.main.activity_nine.* import kotlinx.android.synthetic.main.activity_nine.*
/** /**
...@@ -94,10 +93,10 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -94,10 +93,10 @@ class NineActivity : BaseActivity(), View.OnClickListener {
when (v.id) { when (v.id) {
R.id.iv_nine_back -> { R.id.iv_nine_back -> {
AppConfig.mainMusicRefresh=true AppConfig.mainMusicRefresh = true
refreshTaskCount() refreshTaskCount()
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if(isFinishing) return@postDelayed if (isFinishing) return@postDelayed
finish() finish()
}, 500) }, 500)
...@@ -116,7 +115,7 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -116,7 +115,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
} }
override fun authFail(resultStatus: String) { override fun authFail(resultStatus: String) {
showToast("支付宝授权失败 " + resultStatus) showToast("支付宝授权失败 $resultStatus")
} }
}) })
return return
...@@ -174,14 +173,14 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -174,14 +173,14 @@ class NineActivity : BaseActivity(), View.OnClickListener {
*/ */
private fun adCloseNext(carrierType: String) { private fun adCloseNext(carrierType: String) {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if(isFinishing) return@postDelayed if (isFinishing) return@postDelayed
startNine() startNine()
}, 500) }, 500)
} }
fun startNine() { private fun startNine() {
if (!lucky_panel2.isGameRunning) { if (!lucky_panel2.isGameRunning) {
lucky_panel2.startGame() lucky_panel2.startGame()
...@@ -198,19 +197,21 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -198,19 +197,21 @@ class NineActivity : BaseActivity(), View.OnClickListener {
lucky_panel2.tryToStop(5) lucky_panel2.tryToStop(5)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if(isFinishing) return@postDelayed if (isFinishing) return@postDelayed
showWithdrawSucDialog(0.0) showWithdrawSucDialog(cash)
}, 2000) }, 2000)
} }
}) })
} }
} }
private fun showWithdrawSucDialog(cash: Double) { private fun showWithdrawSucDialog(cash: String) {
if (mWithDrawSucDialog != null && mWithDrawSucDialog!!.isShowing) return
TrackManager.getInstance().addCashoutReq(drawId) TrackManager.getInstance().addCashoutReq(drawId)
mWithDrawSucDialog = mWithDrawSucDialog =
WithDrawSucDialog(context, cash.toString(), object : DialogListener() { WithDrawSucDialog(context, cash, 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() dialog?.dismiss()
...@@ -282,7 +283,7 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -282,7 +283,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
} }
override fun authFail(resultStatus: String) { override fun authFail(resultStatus: String) {
showToast("支付宝授权失败 " + resultStatus) showToast("支付宝授权失败 $resultStatus")
} }
}) })
return return
......
...@@ -124,7 +124,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -124,7 +124,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
if (AppConfig.mainMusicRefresh) { if (AppConfig.mainMusicRefresh) {
AppConfig.mainMusicRefresh = false AppConfig.mainMusicRefresh = false
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
musicPresenter.rdSongMsg() musicPresenter.rdSongMsg()
}, 1500) }, 1500)
...@@ -184,10 +184,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -184,10 +184,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
if (map == null) { if (map == null) {
return return
} }
mPos = position
RxBus.getDefault().post(MsgEvent("" + map["group_id"])) RxBus.getDefault()
.postSticky(MsgEvent("" + map["group_id"], position))
mPos = position
LogUtil.d(TAG, "onDPPageChange: $position, map = $map") LogUtil.d(TAG, "onDPPageChange: $position, map = $map")
} }
...@@ -244,23 +245,23 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -244,23 +245,23 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
quizTvPop.visibility = View.GONE quizTvPop.visibility = View.GONE
finger.visibility = View.GONE finger.visibility = View.GONE
mainHandler.postDelayed({ // mainHandler.postDelayed({
if(!isAdded) return@postDelayed // if (!isAdded) return@postDelayed
//
// 点击过后不展示 // // 点击过后不展示
if (!rlOption0.isClickable) return@postDelayed // if (!rlOption0.isClickable || !rlOption1.isClickable) return@postDelayed
//
val ls = finger.layoutParams as RelativeLayout.LayoutParams // val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams // val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) { // if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0) // ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0) // ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else { // } else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1) // ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1) // ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
} // }
playFingerAnim(finger) // playFingerAnim(finger)
}, 5000) // }, 5000)
for (i in optionsList.indices) { for (i in optionsList.indices) {
val right = answer == i val right = answer == i
...@@ -334,7 +335,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -334,7 +335,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
} }
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
quizIv.visibility = View.GONE quizIv.visibility = View.GONE
}, 1000) }, 1000)
...@@ -356,7 +357,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -356,7 +357,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
} }
} }
RxBus.getDefault().toObservable(MsgEvent::class.java) RxBus.getDefault().tObservableStick(MsgEvent::class.java)
.subscribe(object : Observer<MsgEvent> { .subscribe(object : Observer<MsgEvent> {
override fun onSubscribe(d: Disposable) { override fun onSubscribe(d: Disposable) {
} }
...@@ -364,14 +365,45 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -364,14 +365,45 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
override fun onNext(t: MsgEvent) { override fun onNext(t: MsgEvent) {
// if (!t.msg.equals(feedParamsForCallback["group_id"])) return // if (!t.msg.equals(feedParamsForCallback["group_id"])) return
if (t.position != mPos) return
LogUtil.d(
TAG,
"answer -> " + answer + "nextIsAd -> " + mMusicBean?.nextIsAd
)
finger.setImageDrawable(null)
mainHandler.postDelayed({
if (!isAdded) return@postDelayed
// 点击过后不展示
if (!rlOption0.isClickable || !rlOption1.isClickable) return@postDelayed
val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
}
playFingerAnim(finger)
}, 5000)
// 重置状态
// finger.visibility = View.GONE
// quizLLPop.visibility = View.GONE
// quizTvPop.visibility = View.GONE
for (i in optionsList.indices) { for (i in optionsList.indices) {
val right = answer == i val right = answer == i
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
if (right) { if (right) {
mMusicBean?.let { mMusicBean?.let {
if (it.nextIsAd && optionsList[i].isClickable) { if (it.nextIsAd && optionsList[i].isClickable) {
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
if (i == 0) { if (i == 0) {
quizIvRedbox0.visibility = quizIvRedbox0.visibility =
View.VISIBLE View.VISIBLE
...@@ -384,6 +416,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -384,6 +416,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
quizIvRedbox0.visibility = View.GONE quizIvRedbox0.visibility = View.GONE
} }
} }
break
} }
} }
} }
...@@ -581,7 +614,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -581,7 +614,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
if (!isNineFlag) { if (!isNineFlag) {
isNineFlag = true isNineFlag = true
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
val bundle = Bundle() val bundle = Bundle()
bundle.putString(NineActivity.DRAW_ID, it.unitId) bundle.putString(NineActivity.DRAW_ID, it.unitId)
...@@ -637,26 +670,26 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -637,26 +670,26 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
} else { } else {
tv_cash_reward.text = "+$cashReward" tv_cash_reward.text = "+$cashReward"
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_cash_reward, iv_cash) addAnimation(iv_cash_reward, iv_cash)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_cash_reward, iv_cash) addAnimation(iv_cash_reward, iv_cash)
}, 200) }, 200)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_cash_reward, iv_cash) addAnimation(iv_cash_reward, iv_cash)
}, 400) }, 400)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_cash_reward, iv_cash) addAnimation(iv_cash_reward, iv_cash)
}, 800) }, 800)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
rope = null rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_cash) rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_cash)
}, 1000) }, 1200)
}, 100) }, 100)
} }
...@@ -666,31 +699,31 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -666,31 +699,31 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
} else { } else {
tv_gold_reward.text = "+$goldReward" tv_gold_reward.text = "+$goldReward"
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_gold_reward, iv_gold) addAnimation(iv_gold_reward, iv_gold)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_gold_reward, iv_gold) addAnimation(iv_gold_reward, iv_gold)
}, 200) }, 200)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_gold_reward, iv_gold) addAnimation(iv_gold_reward, iv_gold)
}, 400) }, 400)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
addAnimation(iv_gold_reward, iv_gold) addAnimation(iv_gold_reward, iv_gold)
}, 800) }, 800)
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
rope = null rope = null
rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_gold) rope = YoYo.with(Techniques.Pulse).duration(300).playOn(rl_gold)
}, 1000) }, 1200)
}, 100) }, 100)
} }
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
cl_reward.visibility = View.GONE cl_reward.visibility = View.GONE
}, 1500) }, 1500)
} }
...@@ -807,7 +840,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -807,7 +840,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
}) })
mTimer?.start() mTimer?.start()
mainHandler.postDelayed({ mainHandler.postDelayed({
if(!isAdded) return@postDelayed if (!isAdded) return@postDelayed
rope = null rope = null
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1) rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1)
.playOn(quizLLPop) .playOn(quizLLPop)
......
...@@ -93,10 +93,14 @@ public class RxBus { ...@@ -93,10 +93,14 @@ public class RxBus {
} }
public static class MsgEvent { public static class MsgEvent {
private int position;
private String msg; private String msg;
public MsgEvent(String msg) { public MsgEvent(String msg, int position) {
this.msg = msg; this.msg = msg;
this.position = position;
} }
public String getMsg() { public String getMsg() {
...@@ -106,5 +110,13 @@ public class RxBus { ...@@ -106,5 +110,13 @@ public class RxBus {
public void setMsg(String msg) { public void setMsg(String msg) {
this.msg = msg; this.msg = msg;
} }
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
} }
} }
\ 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