|
|
@@ -7,7 +7,6 @@ import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Message;
|
|
|
-import android.support.v7.app.ActionBar;
|
|
|
import android.text.Editable;
|
|
|
import android.text.TextWatcher;
|
|
|
import android.util.Log;
|
|
|
@@ -18,7 +17,6 @@ import android.view.View;
|
|
|
import android.view.WindowManager;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.Button;
|
|
|
-import android.widget.ImageView;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
@@ -35,7 +33,7 @@ import com.core.api.wxapi.ApiConfig;
|
|
|
import com.core.api.wxapi.ApiUtils;
|
|
|
import com.core.app.Constants;
|
|
|
import com.core.app.MyApplication;
|
|
|
-import com.core.base.BaseActivity;
|
|
|
+import com.core.base.SupportToolBarActivity;
|
|
|
import com.core.model.Friend;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
import com.core.widget.EmptyLayout;
|
|
|
@@ -44,12 +42,13 @@ import com.core.xmpp.dao.FriendDao;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
-import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
import com.modular.appmessages.adapter.NewSchedultAdapter;
|
|
|
+import com.modular.appmessages.model.AllProcess;
|
|
|
+import com.uas.appworks.CRM.erp.activity.TaskAddErpActivity;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.activity.WebViewLoadActivity;
|
|
|
-import com.modular.appmessages.model.AllProcess;
|
|
|
import com.xzjmyk.pm.activity.util.oa.CommonUtil;
|
|
|
+import com.xzjmyk.pm.activity.view.DivideRadioGroup;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
@@ -64,7 +63,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
import static com.xzjmyk.pm.activity.util.oa.CommonUtil.getEmcode;
|
|
|
|
|
|
-public class TaskB2BActivity extends BaseActivity implements View.OnClickListener {
|
|
|
+public class TaskB2BActivity extends SupportToolBarActivity implements View.OnClickListener {
|
|
|
|
|
|
|
|
|
private EmptyLayout mEmptyLayout;
|
|
|
@@ -79,15 +78,7 @@ public class TaskB2BActivity extends BaseActivity implements View.OnClickListene
|
|
|
private List<AllProcess> real_List = new ArrayList<>();
|
|
|
private String login_Name = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
|
|
|
private int tab_type = 1;
|
|
|
- @ViewInject(R.id.isend_tv)
|
|
|
- private TextView isend_tv;
|
|
|
- @ViewInject(R.id.wait_tv)
|
|
|
- private TextView wait_tv;
|
|
|
- @ViewInject(R.id.done_tv)
|
|
|
- private TextView done_tv;
|
|
|
- @ViewInject(R.id.back)
|
|
|
- private ImageView iv_back;
|
|
|
- @ViewInject(R.id.voiceSearchView)
|
|
|
+ private DivideRadioGroup tabGroup;
|
|
|
private VoiceSearchView voiceSearchView;
|
|
|
private int mCurrentPage = 1;
|
|
|
private int mPosition = -1;
|
|
|
@@ -301,11 +292,18 @@ public class TaskB2BActivity extends BaseActivity implements View.OnClickListene
|
|
|
if (!ListUtils.isEmpty(doneList))
|
|
|
Collections.sort(doneList, comparator);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public int getToolBarId() {
|
|
|
+ return com.modular.appmessages.R.id.cycleCountToolBar;
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public int getLayoutRes() {
|
|
|
+ return com.modular.appmessages.R.layout.acativity_task_list;
|
|
|
+ }
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
- setContentView(R.layout.task_listview);
|
|
|
context = TaskB2BActivity.this;
|
|
|
ViewUtils.inject(this);
|
|
|
getSupportActionBar().setTitle("待办工作");
|
|
|
@@ -331,25 +329,14 @@ public class TaskB2BActivity extends BaseActivity implements View.OnClickListene
|
|
|
final int position, long id) {
|
|
|
mPosition = (int) parent.getItemIdAtPosition(position);
|
|
|
NewSchedultAdapter.Store store = (NewSchedultAdapter.Store) view.getTag();
|
|
|
- store.iv_website.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- handler.postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- loadWebView(position);
|
|
|
- }
|
|
|
- }, 500);
|
|
|
- }
|
|
|
- });
|
|
|
Intent intent = new Intent(context, TaskDetailB2BActivity.class);
|
|
|
intent.putExtra("description", store.tv_task_description);
|
|
|
intent.putExtra("duration", store.tv_task_duration);
|
|
|
- intent.putExtra("status", store.tv_task_status.getText().toString());
|
|
|
- intent.putExtra("taskid", store.pTextView3.getText().toString());//编号
|
|
|
- intent.putExtra("taskname", store.pTextView4.getText().toString());//名称
|
|
|
- intent.putExtra("taskemcode", store.pTextView1.getText().toString());//发起人
|
|
|
- intent.putExtra("tasktime", store.pTextView2.getText().toString());//发起时间
|
|
|
+ intent.putExtra("status", store.tv_task_status);
|
|
|
+ intent.putExtra("taskid", store.pTextView3);//编号
|
|
|
+ intent.putExtra("taskname", store.pTextView4);//名称
|
|
|
+ intent.putExtra("taskemcode", store.pTextView1);//发起人
|
|
|
+ intent.putExtra("tasktime", store.pTextView2);//发起时间
|
|
|
intent.putExtra("performer", store.tv_task_performer);//处理人
|
|
|
intent.putExtra("emcode", store.tv_ra_resourcecode);//处理人编号
|
|
|
intent.putExtra("taskcode", store.taskCode);//处理人编号
|
|
|
@@ -489,19 +476,46 @@ public class TaskB2BActivity extends BaseActivity implements View.OnClickListene
|
|
|
}
|
|
|
|
|
|
private void initHeaderView() {
|
|
|
- View view = LayoutInflater.from(ct).inflate(R.layout.task_header, null);
|
|
|
- ActionBar bar = this.getSupportActionBar();
|
|
|
- bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
|
|
- wait_tv = (TextView) view.findViewById(R.id.wait_tv);
|
|
|
- done_tv = (TextView) view.findViewById(R.id.done_tv);
|
|
|
- isend_tv = (TextView) view.findViewById(R.id.isend_tv);
|
|
|
- iv_back = (ImageView) view.findViewById(R.id.back);
|
|
|
- bar.setCustomView(view);
|
|
|
- isend_tv.setOnClickListener(this);
|
|
|
- done_tv.setOnClickListener(this);
|
|
|
- wait_tv.setOnClickListener(this);
|
|
|
- wait_tv.setSelected(true);
|
|
|
- iv_back.setOnClickListener(this);
|
|
|
+ voiceSearchView = findViewById(com.modular.appmessages.R.id.mVoiceSearchView);
|
|
|
+ findViewById(com.modular.appmessages.R.id.backImg).setOnClickListener(this);
|
|
|
+ findViewById(com.modular.appmessages.R.id.addImg).setOnClickListener(this);
|
|
|
+ tabGroup = findViewById(com.modular.appmessages.R.id.tabGroup);
|
|
|
+ final View todoLine = findViewById(com.modular.appmessages.R.id.todoLine);
|
|
|
+ final View doneDealLine = findViewById(com.modular.appmessages.R.id.doneDealLine);
|
|
|
+ final View byMeLine = findViewById(com.modular.appmessages.R.id.byMeLine);
|
|
|
+ tabGroup.setOnCheckedChangeListener(new DivideRadioGroup.OnCheckedChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(DivideRadioGroup group, int checkedId) {
|
|
|
+ todoLine.setVisibility(View.GONE);
|
|
|
+ doneDealLine.setVisibility(View.GONE);
|
|
|
+ byMeLine.setVisibility(View.GONE);
|
|
|
+ if (checkedId == com.modular.appmessages.R.id.todoRb) {
|
|
|
+ todoLine.setVisibility(View.VISIBLE);
|
|
|
+ tab_type = 1;
|
|
|
+ adapter = new NewSchedultAdapter(ct, waitList);
|
|
|
+ real_List = waitList;
|
|
|
+ } else if (checkedId == com.modular.appmessages.R.id.doneDealRb) {
|
|
|
+ doneDealLine.setVisibility(View.VISIBLE);
|
|
|
+ tab_type = 2;
|
|
|
+ adapter = new NewSchedultAdapter(ct, doneList);
|
|
|
+ real_List = doneList;
|
|
|
+ } else if (checkedId == com.modular.appmessages.R.id.byMeRb) {
|
|
|
+ byMeLine.setVisibility(View.VISIBLE);
|
|
|
+ tab_type = 3;
|
|
|
+ adapter = new NewSchedultAdapter(ct, isendList);
|
|
|
+ adapter.setiSend("iSend");
|
|
|
+ real_List = isendList;
|
|
|
+ }
|
|
|
+ if (adapter == null) return;
|
|
|
+ listview_main.setAdapter(adapter);
|
|
|
+ if (adapter.getCount() != 0) {
|
|
|
+ sendHomeBroadcast(adapter.getCount());
|
|
|
+ } else {
|
|
|
+ mEmptyLayout.showEmpty();
|
|
|
+ }
|
|
|
+ listview_main.onRefreshComplete();
|
|
|
+ }
|
|
|
+ });
|
|
|
voiceSearchView.setOnClickListener(this);
|
|
|
tab_type = 1;
|
|
|
}
|
|
|
@@ -740,40 +754,13 @@ public class TaskB2BActivity extends BaseActivity implements View.OnClickListene
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
switch (v.getId()) {
|
|
|
- case R.id.wait_tv:
|
|
|
- tab_type = 1;
|
|
|
- wait_tv.setSelected(true);
|
|
|
- done_tv.setSelected(false);
|
|
|
- isend_tv.setSelected(false);
|
|
|
- doShowListData();
|
|
|
- break;
|
|
|
- case R.id.done_tv:
|
|
|
- tab_type = 2;
|
|
|
- wait_tv.setSelected(false);
|
|
|
- done_tv.setSelected(true);
|
|
|
- isend_tv.setSelected(false);
|
|
|
- doShowListData();
|
|
|
+ case R.id.addImg:
|
|
|
+ startActivityForResult(new Intent(context, TaskAddErpActivity.class), 0x17);
|
|
|
break;
|
|
|
- case R.id.isend_tv:
|
|
|
- tab_type = 3;
|
|
|
- wait_tv.setSelected(false);
|
|
|
- done_tv.setSelected(false);
|
|
|
- isend_tv.setSelected(true);
|
|
|
- doShowListData();
|
|
|
- break;
|
|
|
-
|
|
|
- case R.id.back:
|
|
|
+ case R.id.backImg:
|
|
|
onBackPressed();
|
|
|
break;
|
|
|
}
|
|
|
- if (adapter == null) return;
|
|
|
- listview_main.setAdapter(adapter);
|
|
|
- if (adapter.getCount() != 0) {
|
|
|
- sendHomeBroadcast(adapter.getCount());
|
|
|
- } else {
|
|
|
- mEmptyLayout.showEmpty();
|
|
|
- }
|
|
|
- listview_main.onRefreshComplete();
|
|
|
}
|
|
|
|
|
|
private void sendServiceForISend(int mCurrentPage) {
|