|
@@ -35,6 +35,7 @@ import com.kfzs.duanduan.event.BigEvent;
|
|
|
import com.kfzs.duanduan.event.EventTypes;
|
|
import com.kfzs.duanduan.event.EventTypes;
|
|
|
import com.kfzs.duanduan.services.DownloadTaskService;
|
|
import com.kfzs.duanduan.services.DownloadTaskService;
|
|
|
import com.kfzs.duanduan.utils.ApkUtils;
|
|
import com.kfzs.duanduan.utils.ApkUtils;
|
|
|
|
|
+import com.kfzs.duanduan.utils.dlg.SkipUtils;
|
|
|
import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
|
|
import com.sheep.gamegroup.absBase.AbsChooseImageActivity;
|
|
|
import com.sheep.gamegroup.di.components.DaggerTaskDetailComponent;
|
|
import com.sheep.gamegroup.di.components.DaggerTaskDetailComponent;
|
|
|
import com.sheep.gamegroup.di.modules.TaskDetailModule;
|
|
import com.sheep.gamegroup.di.modules.TaskDetailModule;
|
|
@@ -60,7 +61,9 @@ import com.sheep.gamegroup.util.MyDbManager;
|
|
|
import com.sheep.gamegroup.util.MyListview;
|
|
import com.sheep.gamegroup.util.MyListview;
|
|
|
import com.sheep.gamegroup.util.TimeUtil;
|
|
import com.sheep.gamegroup.util.TimeUtil;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
|
|
+import com.sheep.gamegroup.util.ViewUtil;
|
|
|
import com.sheep.gamegroup.view.adapter.AdpTaskDetailChildListview;
|
|
import com.sheep.gamegroup.view.adapter.AdpTaskDetailChildListview;
|
|
|
|
|
+import com.sheep.gamegroup.view.adapter.TaskdetailSonListviewAdp;
|
|
|
import com.sheep.gamegroup.view.adapter.TaskdetailSonRecycleViewAdp;
|
|
import com.sheep.gamegroup.view.adapter.TaskdetailSonRecycleViewAdp;
|
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
import com.sheep.jiuyan.samllsheep.BuildConfig;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
@@ -68,6 +71,7 @@ import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
import com.sheep.jiuyan.samllsheep.utils.ClassFileHelper;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
|
|
import com.sheep.jiuyan.samllsheep.utils.PackageUtil;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
import org.greenrobot.eventbus.EventBus;
|
|
@@ -126,11 +130,13 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
LinearLayout detail_item_layout_2;
|
|
LinearLayout detail_item_layout_2;
|
|
|
@BindView(R.id.detail_item_layout_3)
|
|
@BindView(R.id.detail_item_layout_3)
|
|
|
LinearLayout detail_item_layout_3;
|
|
LinearLayout detail_item_layout_3;
|
|
|
|
|
+ @BindView(R.id.item_layout)
|
|
|
|
|
+ RelativeLayout item_layout;
|
|
|
/**
|
|
/**
|
|
|
* 2.6详情改版
|
|
* 2.6详情改版
|
|
|
*/
|
|
*/
|
|
|
@BindView(R.id.detail_task_recyclerview)
|
|
@BindView(R.id.detail_task_recyclerview)
|
|
|
- RecyclerView detail_task_recyclerview;
|
|
|
|
|
|
|
+ MyListview detail_task_recyclerview;
|
|
|
@BindView(R.id.ems_game_layout)
|
|
@BindView(R.id.ems_game_layout)
|
|
|
RelativeLayout ems_game_layout;
|
|
RelativeLayout ems_game_layout;
|
|
|
@BindView(R.id.detail_share_friend_tv)
|
|
@BindView(R.id.detail_share_friend_tv)
|
|
@@ -147,6 +153,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
private TaskAcceptedEty taskAcceptedEty;
|
|
private TaskAcceptedEty taskAcceptedEty;
|
|
|
|
|
|
|
|
private int taskId = -1;
|
|
private int taskId = -1;
|
|
|
|
|
+ private int game_id = -1;
|
|
|
|
|
|
|
|
private int type;//-1:开始任务 1:下载 2:安装 3:打开 10:打开H5
|
|
private int type;//-1:开始任务 1:下载 2:安装 3:打开 10:打开H5
|
|
|
|
|
|
|
@@ -158,6 +165,9 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
//2.6
|
|
//2.6
|
|
|
private boolean btn_show;//true:不显示按钮
|
|
private boolean btn_show;//true:不显示按钮
|
|
|
|
|
|
|
|
|
|
+ //是否刷新页面
|
|
|
|
|
+ private boolean isFresh;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
protected int getLayoutId() {
|
|
|
return R.layout.task_detail_layout;
|
|
return R.layout.task_detail_layout;
|
|
@@ -170,6 +180,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
btn_show = getIntent().getBooleanExtra("btn_show", false);
|
|
btn_show = getIntent().getBooleanExtra("btn_show", false);
|
|
|
isFromTaskList = taskAcceptedEty != null;
|
|
isFromTaskList = taskAcceptedEty != null;
|
|
|
taskId = getIntent().getIntExtra("task_id", -1);
|
|
taskId = getIntent().getIntExtra("task_id", -1);
|
|
|
|
|
+ game_id = getIntent().getIntExtra("game_id", -1);
|
|
|
DaggerTaskDetailComponent.builder()
|
|
DaggerTaskDetailComponent.builder()
|
|
|
.netComponent(SheepApp.get(activity).getNetComponent())
|
|
.netComponent(SheepApp.get(activity).getNetComponent())
|
|
|
.taskDetailModule(new TaskDetailModule(this))
|
|
.taskDetailModule(new TaskDetailModule(this))
|
|
@@ -207,7 +218,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void initWigget() {
|
|
private void initWigget() {
|
|
|
- detail_shrae_friend_layout.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
+ detail_shrae_friend_layout.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
taskEty = taskReleaseEty.getTask();
|
|
taskEty = taskReleaseEty.getTask();
|
|
|
if (taskEty.getChild() != null && taskEty.getChild().size() > 0) {
|
|
if (taskEty.getChild() != null && taskEty.getChild().size() > 0) {
|
|
@@ -271,13 +282,23 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
case 1:
|
|
case 1:
|
|
|
case 3:
|
|
case 3:
|
|
|
default:
|
|
default:
|
|
|
- if (taskReleaseEty.isIs_running()) {
|
|
|
|
|
|
|
+ if (taskReleaseEty.isIs_running() || game_id > 0) {
|
|
|
|
|
|
|
|
setBtnStr(taskEty, mDownloadTaskService, new Action1<Object>(){
|
|
setBtnStr(taskEty, mDownloadTaskService, new Action1<Object>(){
|
|
|
@Override
|
|
@Override
|
|
|
public void call(Object o) {
|
|
public void call(Object o) {
|
|
|
if(o instanceof Integer){
|
|
if(o instanceof Integer){
|
|
|
type = (int) o;
|
|
type = (int) o;
|
|
|
|
|
+ if(type == 1002 ||type == 1003){
|
|
|
|
|
+ btnTaskItem.setVisibility(View.GONE);
|
|
|
|
|
+ btnUpImag.setVisibility(View.VISIBLE);
|
|
|
|
|
+ if(game_id > 0){
|
|
|
|
|
+ btnTaskItem.setVisibility(View.VISIBLE);
|
|
|
|
|
+ btnUpImag.setVisibility(View.GONE);
|
|
|
|
|
+ btnTaskItem.setText("去充值");
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
} else if( o instanceof String){
|
|
} else if( o instanceof String){
|
|
|
btnTaskItem.setText((String) o);
|
|
btnTaskItem.setText((String) o);
|
|
|
} else if( o instanceof Boolean){
|
|
} else if( o instanceof Boolean){
|
|
@@ -320,9 +341,9 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
|
|
|
|
|
taskSchedule();
|
|
taskSchedule();
|
|
|
//2.6修改
|
|
//2.6修改
|
|
|
- if(btn_show)
|
|
|
|
|
- bottom_btn_layout.setVisibility(View.GONE);
|
|
|
|
|
- setSonVuewShow();
|
|
|
|
|
|
|
+// if(btn_show)
|
|
|
|
|
+// bottom_btn_layout.setVisibility(View.GONE);
|
|
|
|
|
+// setSonVuewShow();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void checkAcceptedTask() {
|
|
private void checkAcceptedTask() {
|
|
@@ -393,6 +414,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
} else {//应用
|
|
} else {//应用
|
|
|
buttonStr = CommonUtil.OPEN_APPLY;
|
|
buttonStr = CommonUtil.OPEN_APPLY;
|
|
|
}
|
|
}
|
|
|
|
|
+// if(taskEty.getTask_type() == 1002 ||taskEty.getTask_type() == 1003){
|
|
|
|
|
+// action1.call(taskEty.getTask_type());
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
} else {
|
|
} else {
|
|
|
action1.call(DownloadTaskService.STATUS_INIT);
|
|
action1.call(DownloadTaskService.STATUS_INIT);
|
|
|
if (taskEty.getDownload_link() == null || !taskEty.getDownload_link().startsWith("http")) {
|
|
if (taskEty.getDownload_link() == null || !taskEty.getDownload_link().startsWith("http")) {
|
|
@@ -457,6 +482,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
case R.id.ll_infos:
|
|
case R.id.ll_infos:
|
|
|
break;
|
|
break;
|
|
|
case R.id.btn_task_item:
|
|
case R.id.btn_task_item:
|
|
|
|
|
+ if((game_id > 0 && (btnTaskItem.getText() + "").equals("去充值"))){
|
|
|
|
|
+ ViewUtil.showGamePayAccount((Activity) activity, game_id);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
switch (type) {
|
|
switch (type) {
|
|
|
case -1:
|
|
case -1:
|
|
|
if (taskReleaseEty.getAccepted_task_id() > 0) {
|
|
if (taskReleaseEty.getAccepted_task_id() > 0) {
|
|
@@ -534,8 +563,8 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
case R.id.detail_share_friend_tv:
|
|
case R.id.detail_share_friend_tv:
|
|
|
try{
|
|
try{
|
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
|
- stringBuffer.append(SheepApp.getInstance().getConnectAddress().getAppUrl()+"/#/?");
|
|
|
|
|
- stringBuffer.append("authorization="+ DDProviderHelper.getInstance().getLastUserToken(KFZSApp.context));
|
|
|
|
|
|
|
+ stringBuffer.append(SpUtils.getTaskDetailsUrl(activity)+"/#/?");
|
|
|
|
|
+ stringBuffer.append("authorization="+ SpUtils.getOpenId(activity));
|
|
|
stringBuffer.append("&task_id="+taskReleaseEty.getAccepted_task_id());
|
|
stringBuffer.append("&task_id="+taskReleaseEty.getAccepted_task_id());
|
|
|
stringBuffer.append("&invitation_code="+MyDbManager.getInstance().dbFindValue());
|
|
stringBuffer.append("&invitation_code="+MyDbManager.getInstance().dbFindValue());
|
|
|
CommonUtil.getInstance()
|
|
CommonUtil.getInstance()
|
|
@@ -755,6 +784,10 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //图片展示
|
|
|
|
|
+ if(requestCode == 101){
|
|
|
|
|
+ isFresh = true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -889,7 +922,7 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
@Override
|
|
@Override
|
|
|
protected void onResume() {
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
super.onResume();
|
|
|
- if (taskId != -1 && !isGetTaskDesc) {
|
|
|
|
|
|
|
+ if (taskId != -1 && !isGetTaskDesc && !isFresh) {
|
|
|
isGetTaskDesc = true;
|
|
isGetTaskDesc = true;
|
|
|
presenter.taskDesc(taskId);
|
|
presenter.taskDesc(taskId);
|
|
|
}
|
|
}
|
|
@@ -898,8 +931,9 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
/**
|
|
/**
|
|
|
* 子任务模块显示
|
|
* 子任务模块显示
|
|
|
*/
|
|
*/
|
|
|
- TaskdetailSonRecycleViewAdp sonRecycleViewAdp;
|
|
|
|
|
|
|
+ TaskdetailSonListviewAdp sonListviewAdp;
|
|
|
private void setSonVuewShow(){
|
|
private void setSonVuewShow(){
|
|
|
|
|
+ item_layout.setBackgroundResource(R.drawable.sp_bg_white_solid_top);
|
|
|
detail_task_recyclerview.setVisibility(View.GONE);
|
|
detail_task_recyclerview.setVisibility(View.GONE);
|
|
|
ems_game_layout.setVisibility(View.GONE);
|
|
ems_game_layout.setVisibility(View.GONE);
|
|
|
switch (taskEty.getTask_type()){
|
|
switch (taskEty.getTask_type()){
|
|
@@ -908,22 +942,38 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
detail_task_recyclerview.setVisibility(View.VISIBLE);
|
|
detail_task_recyclerview.setVisibility(View.VISIBLE);
|
|
|
detail_item_layout_2.setVisibility(View.GONE);
|
|
detail_item_layout_2.setVisibility(View.GONE);
|
|
|
detail_item_layout_3.setVisibility(View.GONE);
|
|
detail_item_layout_3.setVisibility(View.GONE);
|
|
|
- detail_task_recyclerview.setLayoutManager(new LinearLayoutManager(activity));
|
|
|
|
|
- sonRecycleViewAdp = new TaskdetailSonRecycleViewAdp(taskEty.getChild(), activity);
|
|
|
|
|
- detail_task_recyclerview.setAdapter(sonRecycleViewAdp);
|
|
|
|
|
|
|
+ detail_task_listview.setVisibility(View.GONE);
|
|
|
|
|
+ sonListviewAdp = new TaskdetailSonListviewAdp(taskEty.getChild(), activity);
|
|
|
|
|
+ detail_task_recyclerview.setAdapter(sonListviewAdp);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ return;
|
|
|
case 1002:
|
|
case 1002:
|
|
|
case 1003://游戏任务
|
|
case 1003://游戏任务
|
|
|
ems_game_layout.setVisibility(View.VISIBLE);
|
|
ems_game_layout.setVisibility(View.VISIBLE);
|
|
|
|
|
+ detail_shrae_friend_layout.setVisibility(View.GONE);
|
|
|
|
|
+ item_layout.setBackgroundResource(R.drawable.x_shap_shadow_bg_rectgangle_white);
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// detail_task_recyclerview.setAdapter();
|
|
|
|
|
|
|
+ //fuck
|
|
|
|
|
+ if(taskEty.getDescEntityList() != null && taskEty.getDescEntityList().size()>0){
|
|
|
|
|
+ List<TaskChild> descEntityArrayList = new ArrayList<>();
|
|
|
|
|
+ TaskChild taskChild = new TaskChild();
|
|
|
|
|
+ taskChild.setDescEntityList(taskEty.getDescEntityList());
|
|
|
|
|
+ taskChild.setScreenshotsList(taskEty.getScreenshotsList());
|
|
|
|
|
+ descEntityArrayList.add(taskChild);
|
|
|
|
|
+ detail_task_recyclerview.setVisibility(View.VISIBLE);
|
|
|
|
|
+ detail_item_layout_2.setVisibility(View.GONE);
|
|
|
|
|
+ detail_item_layout_3.setVisibility(View.GONE);
|
|
|
|
|
+ detail_task_listview.setVisibility(View.GONE);
|
|
|
|
|
+ sonListviewAdp = new TaskdetailSonListviewAdp(descEntityArrayList, activity);
|
|
|
|
|
+ detail_task_recyclerview.setAdapter(sonListviewAdp);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -947,10 +997,15 @@ public class TaskDetailAct extends AbsChooseImageActivity implements TaskDetailC
|
|
|
@Override
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
hideProgress();
|
|
hideProgress();
|
|
|
- G.showToast(baseMessage.getErrorMsg());
|
|
|
|
|
- initData();
|
|
|
|
|
-
|
|
|
|
|
- taskReleaseEty.getTask().setRelease_task_id(taskReleaseEty.getId());
|
|
|
|
|
|
|
+// G.showToast(taskReleaseEty.getBonus() + "元");
|
|
|
|
|
+ ViewUtil.showMsgDialog(activity,
|
|
|
|
|
+ "提示",
|
|
|
|
|
+ "恭喜你获得"+taskReleaseEty.getBonus() + "元奖励",
|
|
|
|
|
+ true);
|
|
|
|
|
+// finish();
|
|
|
|
|
+// initData();
|
|
|
|
|
+
|
|
|
|
|
+// taskReleaseEty.getTask().setRelease_task_id(taskReleaseEty.getId());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|