Commit b29a856a authored by jyx's avatar jyx

代码优化

parent 3d682bf3
......@@ -58,12 +58,12 @@ public class AwardPresenter extends BasePresenter<AwardView> {
riskFlag = data.get("riskinfoRate").getAsBoolean();
}
boolean hideSomeodular = false;
JsonElement hideSomeodularElement = data.get("hideSomeodular");
if (hideSomeodularElement != null) {
hideSomeodular = data.get("hideSomeodular").getAsBoolean();
boolean showHigh = false;
JsonElement showHighElement = data.get("showHigh");
if (showHighElement != null) {
showHigh = data.get("showHigh").getAsBoolean();
}
view.getUserTaskMsgSuc(data.get("coin").getAsInt(), riskFlag, hideSomeodular);
view.getUserTaskMsgSuc(data.get("coin").getAsInt(), riskFlag, showHigh);
}
break;
default:
......@@ -160,6 +160,39 @@ public class AwardPresenter extends BasePresenter<AwardView> {
});
}
/**
* 设置高额任务状态
* <p>
* value
*/
public void setHighTaskType(String value) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("carrierType", Constant.CARRIER_HIGH_ACTIVITY);
vo.put("value", value);
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onError(Throwable e) {
}
@Override
public void onCompleted() {
super.onCompleted();
}
@Override
public void onNext(BaseResponse<Object> objectBaseResponse) {
if (isLinkView()) return;
switch (objectBaseResponse.getStatus()) {
// if (!TextUtils.equals(value, "3")) {
//// getAutoUserHallBaseMsg()
// }
}
}
});
}
public void riskinfo() {
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
......
......@@ -275,7 +275,6 @@ open class MyPresenter : BasePresenter<MyView>() {
})
}
fun getHallBaseMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.hallBaseMsg,
......
......@@ -25,10 +25,7 @@ import com.mints.goodmoney.service.AppInstallService
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport
import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.goodmoney.utils.AppUtil
import com.mints.goodmoney.utils.SoundPoolUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.goodmoney.utils.Utils
import com.mints.goodmoney.utils.*
import com.mints.goodmoney.utils.rxutil.CommonRxTask
import com.mints.goodmoney.utils.rxutil.RxjavaUtil
import com.umeng.analytics.MobclickAgent
......@@ -412,6 +409,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
1 -> {
if (mCurrentPkg == null) {
showToast("任务异常,请重试~")
awardPresenter.setHighTaskType("0")
} else {
if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
AppTryPlayManager.toTryPlay(mCurrentPkg!!)
......@@ -424,6 +423,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
2 -> {
if (mCurrentPkg == null) {
showToast("任务异常,请重试~")
awardPresenter.setHighTaskType("0")
} else {
if (AppUtil.checkPackInfo(mContext, mCurrentPkg!!)) {
AppTryPlayManager.toTryPlay(mCurrentPkg!!)
......@@ -434,9 +434,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
// 试玩完成,领取奖励
3 -> {
// val vo = HashMap<String, Any>()
// vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
// awardPresenter.reportAddCoinMsg(vo)
val vo = HashMap<String, Any>()
vo["carrierType"] = Constant.CARRIER_HIGH_ACTIVITY
awardPresenter.reportAddCoinMsg(vo)
readyGoThenKill(DrawcashActivity::class.java)
}
......@@ -551,12 +551,14 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
mTimer?.start()
}
override fun getUserTaskMsgSuc(coin: Int, riskFlag: Boolean, hideSomeodular: Boolean) {
override fun getUserTaskMsgSuc(coin: Int, riskFlag: Boolean, showHigh: Boolean) {
if (carrierType == Constant.CARRIER_CHALLENGE_TURN || // 大转盘
carrierType == Constant.CARRIER_BLESSINGBAG || // 首页福袋
carrierType == Constant.CARRIER_BLESSINGBAG_DOUBLE || // 首页福袋
carrierType == Constant.CARRIER_HOMEVEDIO || // 首页红包
carrierType == Constant.CARRIER_SMALLHOMEVEDIO || // 短视频红包
carrierType == Constant.CARRIER_HOMEVEDIO) { // 小视频红包
isSuperTask = hideSomeodular
carrierType == Constant.CARRIER_SMALLHOMEVEDIO_DOUBLE || // 短视频红包翻倍
carrierType == Constant.CARRIER_HOMEVEDIO_DOUBLE) { // 小视频红包翻倍
isSuperTask = true
if (isSuperTask) {
refreshHighTask()
}
......@@ -619,6 +621,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 用户点击激励视频但并未下载安装
if ((mReceiverBroadcastReceiver != null && superTaskStatus == 0) ||
(mReceiverBroadcastReceiver == null && superTaskStatus == 4)) {
awardPresenter.setHighTaskType("0")
tvAwardHighContent.visibility = View.VISIBLE
tvAwardHighInfo.visibility = View.GONE
tvAwardHighInfo2.visibility = View.GONE
......@@ -654,6 +658,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 用户开启
if (AppTryPlayManager.getTryPlayIsOK(mCurrentPkg!!, 5)) {
awardPresenter.setHighTaskType("1")
tvAwardHighContent.visibility = View.VISIBLE
tvAwardHighInfo.visibility = View.VISIBLE
tvAwardHigh.visibility = View.VISIBLE
......@@ -696,6 +702,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
val pkg = intent.getStringExtra("pkg")
mCurrentPkg = pkg
awardPresenter.setHighTaskType("3")
} catch (e: Exception) {
e.printStackTrace()
}
......
......@@ -105,12 +105,13 @@
<TextView
android:id="@+id/tvAwardHigh"
android:layout_width="160dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/shape_btn_gold_right"
android:drawablePadding="4dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="超级加倍领取"
......
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