|
|
@@ -2,66 +2,38 @@ package com.sheep.gamegroup.view.activity;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
|
-import android.database.Cursor;
|
|
|
-import android.net.Uri;
|
|
|
-import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
-import android.os.Message;
|
|
|
-import android.provider.MediaStore;
|
|
|
-import android.support.v4.widget.SwipeRefreshLayout;
|
|
|
-import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
-import android.widget.AdapterView;
|
|
|
import android.widget.ListView;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.kfzs.appstore.utils.string.HexUtils;
|
|
|
import com.kfzs.duanduan.event.BigEvent;
|
|
|
import com.kfzs.duanduan.event.EventTypes;
|
|
|
-import com.kfzs.duanduan.react.upfile.UpFileListener;
|
|
|
-import com.kfzs.duanduan.react.upfile.UpFileUtils;
|
|
|
-import com.kfzs.duanduan.view.ListMore;
|
|
|
import com.sheep.gamegroup.di.components.DaggerTaskListComponent;
|
|
|
import com.sheep.gamegroup.di.modules.TaskListModule;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
-import com.sheep.gamegroup.model.entity.DialogEntity;
|
|
|
-import com.sheep.gamegroup.model.entity.RecyleObj;
|
|
|
-import com.sheep.gamegroup.model.entity.RecyleType;
|
|
|
import com.sheep.gamegroup.model.entity.TaskAcceptedEty;
|
|
|
-import com.sheep.gamegroup.model.entity.TaskEty;
|
|
|
-import com.sheep.gamegroup.model.entity.TaskReleaseEty;
|
|
|
-import com.sheep.gamegroup.model.entity.UploadResult;
|
|
|
-import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.presenter.TaskListContract;
|
|
|
import com.sheep.gamegroup.presenter.TaskListPresenter;
|
|
|
-import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.gamegroup.view.adapter.TaskListItemAdp;
|
|
|
import com.sheep.gamegroup.view.customview.RefreshLayout;
|
|
|
-import com.sheep.gamegroup.view.dialog.DialogShowLoading;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.base.AbsChooseImageActivity;
|
|
|
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
-import java.io.File;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
-import butterknife.ButterKnife;
|
|
|
-import go.kfzssafe.Kfzssafe;
|
|
|
-import rx.android.schedulers.AndroidSchedulers;
|
|
|
-import rx.schedulers.Schedulers;
|
|
|
|
|
|
/**
|
|
|
* 任务列表
|
|
|
@@ -73,6 +45,8 @@ public class TaskListAct extends AbsChooseImageActivity implements TaskListContr
|
|
|
ListView withdrawalListview;
|
|
|
@BindView(R.id.swipe_container)
|
|
|
RefreshLayout swipe_container;
|
|
|
+ @BindView(R.id.empty_view)
|
|
|
+ View empty_view;
|
|
|
|
|
|
@Inject
|
|
|
TaskListPresenter presenter;
|
|
|
@@ -173,34 +147,38 @@ public class TaskListAct extends AbsChooseImageActivity implements TaskListContr
|
|
|
public void initData() {
|
|
|
// showProgress();
|
|
|
// swipe_container.setRefreshing(true);
|
|
|
+ empty_view.setVisibility(View.INVISIBLE);
|
|
|
presenter.acceptedTask(page,per_page);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updataView(Object o) {
|
|
|
- hideProgress();
|
|
|
- swipe_container.setRefreshing(false);
|
|
|
- try{
|
|
|
+ try {
|
|
|
BaseMessage baseMessage = (BaseMessage) o;
|
|
|
List<TaskAcceptedEty> releaseEtyList = JSONArray.parseArray(JSONArray.toJSONString(baseMessage.getData()), TaskAcceptedEty.class);
|
|
|
- for (TaskAcceptedEty ety: releaseEtyList){
|
|
|
- if(!etyList.contains(ety)){
|
|
|
+ for (TaskAcceptedEty ety : releaseEtyList) {
|
|
|
+ if (!etyList.contains(ety)) {
|
|
|
etyList.add(ety);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
// etyList.addAll(releaseEtyList);
|
|
|
- adp.notifyDataSetChanged();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ notifyDataSetChanged();
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public void failView(Object o) {
|
|
|
+ private void notifyDataSetChanged(){
|
|
|
+ if(etyList.isEmpty())
|
|
|
+ empty_view.setVisibility(View.VISIBLE);
|
|
|
hideProgress();
|
|
|
swipe_container.setRefreshing(false);
|
|
|
adp.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void failView(Object o) {
|
|
|
+ notifyDataSetChanged();
|
|
|
G.showToast(((BaseMessage) o).getMsg()+"");
|
|
|
}
|
|
|
|