|
|
@@ -1179,8 +1179,15 @@ public class CommonUtil {
|
|
|
action1.call(1);
|
|
|
}
|
|
|
}));
|
|
|
- } else {
|
|
|
- G.showToast(baseMessage);
|
|
|
+ } else if(baseMessage.getCode() == 0){
|
|
|
+ try {
|
|
|
+ if (action1 != null)
|
|
|
+ action1.call(TextUtils.isEmpty(baseMessage.getData()+"")?0:Integer.valueOf(baseMessage.getData()+""));
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ G.showToast(baseMessage.getMsg());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -2137,29 +2144,41 @@ public class CommonUtil {
|
|
|
/**
|
|
|
* 玩转游戏 按钮设置
|
|
|
* type 1
|
|
|
+ * 0,--------1,已接受任务 2,正在进行中,3完成任务,4放弃任务,5任务失败,6审核失败,7提交审核,8任务已下线,9至少完成了一个任务了
|
|
|
*/
|
|
|
- public void palyGameDetailBtnValue(final Context context, final GameEntity gameEntity, TextView detail_task_tv_center, int type){
|
|
|
+ public void palyGameDetailBtnValue(final Context context, final GameEntity gameEntity, final TextView detail_task_tv_center, final int type){
|
|
|
final TaskReleaseEty releaseEty = gameEntity.getRelease_task();
|
|
|
final TaskEty taskEty = releaseEty != null?releaseEty.getTask():null;
|
|
|
if(releaseEty != null && taskEty != null) {//游戏任务
|
|
|
|
|
|
if (taskEty.isGameReservationCantDownload()) {//预约
|
|
|
- detail_task_tv_center.setText("预约下载");
|
|
|
- detail_task_tv_center.setEnabled(true);
|
|
|
- if(type == 0){
|
|
|
- detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- CommonUtil.getInstance().reservationGameTask(context, releaseEty, new Action1<Integer>() {
|
|
|
- @Override
|
|
|
- public void call(Integer integer) {
|
|
|
+ if(gameEntity.getStatus() == 1 || gameEntity.getStatus() == 2 || gameEntity.getStatus() == 3){
|
|
|
+ detail_task_tv_center.setText("已经预约");
|
|
|
+ detail_task_tv_center.setEnabled(false);
|
|
|
+ }else {
|
|
|
+ detail_task_tv_center.setText("预约下载");
|
|
|
+ detail_task_tv_center.setEnabled(true);
|
|
|
+ if(type == 0){
|
|
|
+ detail_task_tv_center.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ CommonUtil.getInstance().reservationGameTask(context, releaseEty, new Action1<Integer>() {
|
|
|
+ @Override
|
|
|
+ public void call(Integer integer) {
|
|
|
+ if(integer > 0){
|
|
|
+ gameEntity.setAccepted_task_id(integer);
|
|
|
+ detail_task_tv_center.setText("已预约");
|
|
|
+ detail_task_tv_center.setEnabled(false);
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
releaseEty.getDownloadHelper().updateDownloadTaskView((Activity) context, taskEty, detail_task_tv_center, null, type);
|
|
|
}
|
|
|
@@ -2176,7 +2195,7 @@ public class CommonUtil {
|
|
|
* 领取礼包
|
|
|
* @param item
|
|
|
*/
|
|
|
- public void receiveGiftById(final Context context, final GiftBagApp item, final Action1<Integer> action1) {
|
|
|
+ public void receiveGiftById(final Context context, final GiftBagApp item, final Action1<Integer> action1, final String packageName) {
|
|
|
SheepApp.getInstance().getNetComponent().getApiService().receiveGiftBag(item.getGift_bag().getId())
|
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
@@ -2187,7 +2206,7 @@ public class CommonUtil {
|
|
|
item.setCode(code);
|
|
|
if(action1 != null)
|
|
|
action1.call(TO_REFRESH);
|
|
|
- ViewUtil.shareGetWelfareDialog((Activity) context, item);
|
|
|
+ ViewUtil.shareGetWelfareDialog((Activity) context, item, packageName);
|
|
|
}
|
|
|
|
|
|
@Override
|