Commit b29a856a authored by jyx's avatar jyx

代码优化

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