|
@@ -1,8 +1,8 @@
|
|
|
package com.sheep.gamegroup.util;
|
|
package com.sheep.gamegroup.util;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
-import android.text.Html;
|
|
|
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
|
+import android.view.Gravity;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
@@ -10,6 +10,7 @@ import android.widget.TextView;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
import com.kfzs.duanduan.utils.NumberFormatUtils;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
|
|
+import com.sheep.gamegroup.model.entity.OrienteeringDetail;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
@@ -81,6 +82,26 @@ public class TaskHelper {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ private OrienteeringDetail orienteeringDetail;
|
|
|
|
|
+ private void initGameTask(final View itemView, String third_task_id) {
|
|
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().getMyGame(third_task_id)
|
|
|
|
|
+ .subscribeOn(Schedulers.io())
|
|
|
|
|
+ .observeOn(AndroidSchedulers.mainThread())
|
|
|
|
|
+ .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNext(BaseMessage baseMessage) {
|
|
|
|
|
+ LogUtil.println("baseMessage onNext "+JSON.toJSONString(baseMessage));
|
|
|
|
|
+ orienteeringDetail = baseMessage.getData(OrienteeringDetail.class);
|
|
|
|
|
+ loadTask(itemView);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onError(BaseMessage baseMessage) {
|
|
|
|
|
+ LogUtil.println("baseMessage onError "+JSON.toJSONString(baseMessage));
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public boolean hasTask() {
|
|
public boolean hasTask() {
|
|
|
return taskReleaseEty != null && taskReleaseEty.getTask() != null;
|
|
return taskReleaseEty != null && taskReleaseEty.getTask() != null;
|
|
@@ -89,48 +110,111 @@ public class TaskHelper {
|
|
|
private RxjavaCountDownTimer timer;
|
|
private RxjavaCountDownTimer timer;
|
|
|
public void loadTask(final View itemView) {
|
|
public void loadTask(final View itemView) {
|
|
|
itemView.setVisibility(View.VISIBLE);
|
|
itemView.setVisibility(View.VISIBLE);
|
|
|
|
|
+ if(taskReleaseEty == null){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
final TaskEty taskEty = taskReleaseEty.getTask();
|
|
final TaskEty taskEty = taskReleaseEty.getTask();
|
|
|
|
|
+ if(taskEty == null){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
ImageView find_information_game_icon = (ImageView)itemView.findViewById(R.id.find_information_game_icon);
|
|
ImageView find_information_game_icon = (ImageView)itemView.findViewById(R.id.find_information_game_icon);
|
|
|
TextView find_information_game_name = (TextView)itemView.findViewById(R.id.find_information_game_name);
|
|
TextView find_information_game_name = (TextView)itemView.findViewById(R.id.find_information_game_name);
|
|
|
TextView find_information_game_surplus = (TextView)itemView.findViewById(R.id.find_information_game_surplus);
|
|
TextView find_information_game_surplus = (TextView)itemView.findViewById(R.id.find_information_game_surplus);
|
|
|
TextView find_information_game_time = (TextView)itemView.findViewById(R.id.find_information_game_time);
|
|
TextView find_information_game_time = (TextView)itemView.findViewById(R.id.find_information_game_time);
|
|
|
TextView find_information_game_yuan = (TextView)itemView.findViewById(R.id.find_information_game_yuan);
|
|
TextView find_information_game_yuan = (TextView)itemView.findViewById(R.id.find_information_game_yuan);
|
|
|
|
|
+ TextView find_information_game_task0 = (TextView)itemView.findViewById(R.id.find_information_game_task0);
|
|
|
TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task);
|
|
TextView find_information_game_task = (TextView)itemView.findViewById(R.id.find_information_game_task);
|
|
|
final TextView find_information_game_task_end_time = (TextView)itemView.findViewById(R.id.find_information_game_task_end_time);
|
|
final TextView find_information_game_task_end_time = (TextView)itemView.findViewById(R.id.find_information_game_task_end_time);
|
|
|
- ViewUtil.setImage(find_information_game_icon, taskEty.getIcon());
|
|
|
|
|
|
|
+ if(orienteeringDetail != null){//已经完成的游戏任务
|
|
|
|
|
+ find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task0.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_yuan.setVisibility(View.INVISIBLE);
|
|
|
|
|
+ find_information_game_surplus.setText(String.format(Locale.CHINA, "可定向消费:%.1f元", orienteeringDetail.getBalance()));
|
|
|
|
|
+ find_information_game_surplus.setTextColor(activity.getResources().getColor(R.color.red_fd2d54));
|
|
|
|
|
+ find_information_game_task.setText("去充值");
|
|
|
|
|
+ find_information_game_task.setEnabled(true);
|
|
|
|
|
+ downloadHelper.updateDownloadTaskView(activity, taskEty, find_information_game_task0);
|
|
|
|
|
+ find_information_game_task.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ ViewUtil.showGamePayAccount(activity, orienteeringDetail.getGame_id());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ itemView.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ reloadDataType = 1;//回来后将刷新界面数据 taskAcceptedEty
|
|
|
|
|
+ Jump2View.getInstance().goGameTaskDetailView(activity, release_task_id, orienteeringDetail.getGame_id(),1);
|
|
|
|
|
+ UMConfigUtils.IdEvent.TASK.commit(release_task_id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ GlideImageLoader.centerImage(find_information_game_icon, taskEty.getIcon());
|
|
|
ViewUtil.setText(find_information_game_name, taskReleaseEty.getName());
|
|
ViewUtil.setText(find_information_game_name, taskReleaseEty.getName());
|
|
|
ViewUtil.setText(find_information_game_surplus, String.format(Locale.CHINA, "剩余%s份", taskReleaseEty.getLast_num()));
|
|
ViewUtil.setText(find_information_game_surplus, String.format(Locale.CHINA, "剩余%s份", taskReleaseEty.getLast_num()));
|
|
|
ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "截止日期:%s", taskReleaseEty.getDeadline().equals("永久") ? taskReleaseEty.getDeadline() : TimeUtil.TimeStamp2Date(NumberFormatUtils.parseLong(taskReleaseEty.getDeadline()), "yyyy/MM/dd HH:mm")));
|
|
ViewUtil.setText(find_information_game_time, String.format(Locale.CHINA, "截止日期:%s", taskReleaseEty.getDeadline().equals("永久") ? taskReleaseEty.getDeadline() : TimeUtil.TimeStamp2Date(NumberFormatUtils.parseLong(taskReleaseEty.getDeadline()), "yyyy/MM/dd HH:mm")));
|
|
|
ViewUtil.setText(find_information_game_yuan, String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonus()));
|
|
ViewUtil.setText(find_information_game_yuan, String.format(Locale.CHINA, "+%s元", taskReleaseEty.getBonus()));
|
|
|
|
|
+ find_information_game_task0.setVisibility(View.GONE);
|
|
|
find_information_game_yuan.setVisibility(View.VISIBLE);
|
|
find_information_game_yuan.setVisibility(View.VISIBLE);
|
|
|
- if(taskAcceptedEty != null){
|
|
|
|
|
- switch (taskAcceptedEty.getStatus()) {
|
|
|
|
|
- case 1://"已接受任务";
|
|
|
|
|
- case 2:// "正在进行中";
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.VISIBLE);
|
|
|
|
|
- if(!taskReleaseEty.getDeadline().equals("永久")){
|
|
|
|
|
- find_information_game_task_end_time.setText(TimeUtil.getHours(taskAcceptedEty.getEnd_time() * 1000));
|
|
|
|
|
- timer = RxjavaCountDownTimer.getInstance(taskAcceptedEty.getEnd_time())
|
|
|
|
|
- .setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onFinish() {
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- refreshTask();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onTicker(long time) {
|
|
|
|
|
- find_information_game_task_end_time.setText(TimeUtil.getHours(time * 1000));
|
|
|
|
|
- }
|
|
|
|
|
- }).start();
|
|
|
|
|
|
|
+ switch (taskEty.getTask_type()) {// 1时间试玩任务 2 信用卡任务 3应用下载 4h5业务 1001畅思 1000连续任务, 1002 1003游戏任务
|
|
|
|
|
+ case 2://信用卡任务
|
|
|
|
|
+ find_information_game_task.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_yuan.setGravity(Gravity.END);
|
|
|
|
|
+ String[] remarks = new String[0];
|
|
|
|
|
+ if(!TextUtils.isEmpty(taskEty.getRemarks())) {
|
|
|
|
|
+ remarks = taskEty.getRemarks().split(";");
|
|
|
|
|
+ }
|
|
|
|
|
+ find_information_game_time.setText(remarks.length > 0 ? remarks[0] : "");
|
|
|
|
|
+ find_information_game_surplus.setText(remarks.length > 1 ? remarks[1] : "");
|
|
|
|
|
+ itemView.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ Jump2View.getInstance().goCreditCardTaskDetail(activity, taskReleaseEty.getId());
|
|
|
}
|
|
}
|
|
|
- find_information_game_task.setText("取消任务");
|
|
|
|
|
- find_information_game_task.setEnabled(true);
|
|
|
|
|
- find_information_game_task.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View view) {
|
|
|
|
|
- FIND_TASK.onEvent("release_task_id", release_task_id, "action", "取消任务");
|
|
|
|
|
- SheepApp.getInstance().getNetComponent().getApiService().giveUpTask(taskAcceptedEty.getId())
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1001:
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1://时间试玩任务
|
|
|
|
|
+ case 3://应用下载
|
|
|
|
|
+ case 4://h5业务
|
|
|
|
|
+ case 1000://连续任务
|
|
|
|
|
+ case 1002://游戏任务
|
|
|
|
|
+ case 1003://游戏任务
|
|
|
|
|
+ default:
|
|
|
|
|
+ find_information_game_yuan.setGravity(Gravity.CENTER);
|
|
|
|
|
+ if(taskAcceptedEty != null){
|
|
|
|
|
+ switch (taskAcceptedEty.getStatus()) {
|
|
|
|
|
+ case 1://"已接受任务";
|
|
|
|
|
+ case 2:// "正在进行中";
|
|
|
|
|
+ if(taskReleaseEty.getDeadline().equals("永久")){
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task_end_time.setText(TimeUtil.getHours(taskAcceptedEty.getEnd_time() * 1000));
|
|
|
|
|
+ timer = RxjavaCountDownTimer.getInstance(taskAcceptedEty.getEnd_time())
|
|
|
|
|
+ .setOnTickListener(new RxjavaCountDownTimer.OnTickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFinish() {
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ refreshTask();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onTicker(long time) {
|
|
|
|
|
+ find_information_game_task_end_time.setText(TimeUtil.getHours(time * 1000));
|
|
|
|
|
+ }
|
|
|
|
|
+ }).start();
|
|
|
|
|
+ }
|
|
|
|
|
+ find_information_game_task.setText("取消任务");
|
|
|
|
|
+ find_information_game_task.setEnabled(true);
|
|
|
|
|
+ find_information_game_task.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ FIND_TASK.onEvent("release_task_id", release_task_id, "action", "取消任务");
|
|
|
|
|
+ SheepApp.getInstance().getNetComponent().getApiService().giveUpTask(taskAcceptedEty.getId())
|
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
.subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
|
|
@@ -146,76 +230,83 @@ public class TaskHelper {
|
|
|
G.showToast(baseMessage);
|
|
G.showToast(baseMessage);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- //暂停下载
|
|
|
|
|
- CommonUtil.getInstance().stopDownloadTask(activity, taskEty.getDownload_link());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- break;
|
|
|
|
|
- case 6://审核失败
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
- find_information_game_task.setText("审核失败");
|
|
|
|
|
- find_information_game_task.setEnabled(false);
|
|
|
|
|
- break;
|
|
|
|
|
- //不可操作
|
|
|
|
|
- case 7:// "提交审核";
|
|
|
|
|
|
|
+ //暂停下载
|
|
|
|
|
+ CommonUtil.getInstance().stopDownloadTask(activity, taskEty.getDownload_link());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 6://审核失败
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task.setText("审核失败");
|
|
|
|
|
+ find_information_game_task.setEnabled(false);
|
|
|
|
|
+ break;
|
|
|
|
|
+ //不可操作
|
|
|
|
|
+ case 7:// "提交审核";
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task.setText("正在审核");
|
|
|
|
|
+ find_information_game_task.setEnabled(false);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3://完成任务
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task.setText("已经完成");
|
|
|
|
|
+ find_information_game_task.setEnabled(false);
|
|
|
|
|
+ if(taskEty.isGameTask()){
|
|
|
|
|
+ initGameTask(itemView, taskEty.getThird_task_id());
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 8://任务已经下线
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
+ find_information_game_task.setText("已经下线");
|
|
|
|
|
+ find_information_game_task.setEnabled(false);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 9:// "至少完成一个任务了";
|
|
|
|
|
+ default:
|
|
|
|
|
+ find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
+ find_information_game_task.setVisibility(View.GONE);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if(taskReleaseEty.isOffline()){//任务已经下线
|
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
- find_information_game_task.setText("正在审核");
|
|
|
|
|
|
|
+ find_information_game_task.setText("已经下线");
|
|
|
find_information_game_task.setEnabled(false);
|
|
find_information_game_task.setEnabled(false);
|
|
|
- break;
|
|
|
|
|
- case 3://完成任务
|
|
|
|
|
|
|
+ } else if("0".equals(taskReleaseEty.getLast_num())){
|
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
- find_information_game_task.setText("已经完成");
|
|
|
|
|
|
|
+ find_information_game_task.setText("任务已抢光");
|
|
|
find_information_game_task.setEnabled(false);
|
|
find_information_game_task.setEnabled(false);
|
|
|
- break;
|
|
|
|
|
- case 8://任务已经下线
|
|
|
|
|
|
|
+ } else {
|
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
- find_information_game_task.setText("已经下线");
|
|
|
|
|
- find_information_game_task.setEnabled(false);
|
|
|
|
|
- break;
|
|
|
|
|
- case 9:// "至少完成一个任务了";
|
|
|
|
|
- default:
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- find_information_game_task.setVisibility(View.GONE);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- } else if(taskReleaseEty.isOffline()){//任务已经下线
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
- find_information_game_task.setText("已经下线");
|
|
|
|
|
- find_information_game_task.setEnabled(false);
|
|
|
|
|
- } else if("0".equals(taskReleaseEty.getLast_num())){
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
- find_information_game_task.setText("任务已抢光");
|
|
|
|
|
- find_information_game_task.setEnabled(false);
|
|
|
|
|
- } else {
|
|
|
|
|
- find_information_game_task_end_time.setVisibility(View.GONE);
|
|
|
|
|
- find_information_game_task.setVisibility(View.VISIBLE);
|
|
|
|
|
- find_information_game_task.setText("领取任务");
|
|
|
|
|
- find_information_game_task.setEnabled(true);
|
|
|
|
|
- find_information_game_task.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View view) {
|
|
|
|
|
- taskEty.setRunTask(0);
|
|
|
|
|
- taskEty.setRelease_task_id(taskReleaseEty.getId());
|
|
|
|
|
- taskEty.setName(taskReleaseEty.getName());
|
|
|
|
|
- taskEty.setAcceptedTaskId(taskReleaseEty.getAccepted_task_id());
|
|
|
|
|
- Jump2View.getInstance().goDialogActivityView(activity, taskEty);
|
|
|
|
|
- FIND_TASK.onEvent("release_task_id", release_task_id, "action", "领取任务");
|
|
|
|
|
|
|
+ find_information_game_task.setText("领取任务");
|
|
|
|
|
+ find_information_game_task.setEnabled(true);
|
|
|
|
|
+ find_information_game_task.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ taskEty.setRunTask(0);
|
|
|
|
|
+ taskEty.setRelease_task_id(taskReleaseEty.getId());
|
|
|
|
|
+ taskEty.setName(taskReleaseEty.getName());
|
|
|
|
|
+ taskEty.setAcceptedTaskId(taskReleaseEty.getAccepted_task_id());
|
|
|
|
|
+ Jump2View.getInstance().goDialogActivityView(activity, taskEty);
|
|
|
|
|
+ FIND_TASK.onEvent("release_task_id", release_task_id, "action", "领取任务");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ itemView.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ reloadDataType = 1;//回来后将刷新界面数据 taskAcceptedEty
|
|
|
|
|
+ Jump2View.getInstance().goTaskDetailView(activity, release_task_id);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
- itemView.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View view) {
|
|
|
|
|
- Jump2View.getInstance().goTaskDetailView(activity, release_task_id);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//刷新界面
|
|
//刷新界面
|
|
|
public void refreshTask() {
|
|
public void refreshTask() {
|
|
|
clear();
|
|
clear();
|
|
@@ -223,7 +314,14 @@ public class TaskHelper {
|
|
|
taskReleaseEty = null;
|
|
taskReleaseEty = null;
|
|
|
initAcceptedTask(activity, release_task_id);
|
|
initAcceptedTask(activity, release_task_id);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ private int reloadDataType;//0 不刷新数据 1刷新 taskAcceptedEty
|
|
|
|
|
+ public void onResume() {
|
|
|
|
|
+ switch (reloadDataType){
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ refreshTask();
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
/**
|
|
/**
|
|
|
* 清理计时器
|
|
* 清理计时器
|
|
|
*/
|
|
*/
|
|
@@ -232,4 +330,23 @@ public class TaskHelper {
|
|
|
timer.clear();
|
|
timer.clear();
|
|
|
timer = null;
|
|
timer = null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private DownloadHelper downloadHelper = new DownloadHelper();
|
|
|
|
|
+
|
|
|
|
|
+ public void updateState(int status) {
|
|
|
|
|
+ downloadHelper.updateState(status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|