ソースを参照

提交类型 新功能修改
提交内容 首页四个图标【动画效果

Bitliker 8 年 前
コミット
c379017ed2

+ 2 - 1
WeiChat/src/main/AndroidManifest.xml

@@ -257,7 +257,8 @@
         <activity android:name=".ui.erp.activity.NewsTwoActivity" />
         <activity android:name=".ui.erp.activity.NoticesActivity" />
         <activity android:name=".ui.erp.activity.InformActivity" />
-        <activity android:name=".ui.platform.task.TaskActivity">
+        <activity android:name=".ui.platform.task.TaskActivity"
+            android:theme="@style/MainBaseTheme">
             <intent-filter>
                 <action android:name="com.modular.task.TaskActivity" />
                 <category android:name="android.intent.category.DEFAULT" />

+ 65 - 89
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/platform/task/TaskActivity.java

@@ -9,20 +9,16 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
-import android.support.v7.app.ActionBar;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.util.Log;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.WindowManager;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
 import android.widget.Button;
-import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.PopupWindow;
 import android.widget.TextView;
@@ -36,24 +32,23 @@ import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.core.app.Constants;
 import com.core.app.MyApplication;
-import com.core.base.BaseActivity;
+import com.core.base.SupportToolBarActivity;
 import com.core.net.http.HttpClient;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
 import com.core.utils.FlexJsonUtil;
 import com.core.utils.IntentUtils;
-import com.core.utils.ToastUtil;
 import com.core.widget.EmptyLayout;
-import com.core.widget.VoiceSearchView;
 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.R;
 import com.modular.appmessages.adapter.NewSchedultAdapter;
 import com.modular.appmessages.model.AllProcess;
+import com.modular.apputils.widget.MenuVoiceSearchView;
 import com.uas.appworks.CRM.erp.activity.TaskAddErpActivity;
 import com.uas.appworks.OA.erp.activity.DetailTaskActivity;
+import com.xzjmyk.pm.activity.view.DivideRadioGroup;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -71,7 +66,7 @@ import java.util.regex.PatternSyntaxException;
  */
 
 @SuppressWarnings({"unused", "deprecation"})
-public class TaskActivity extends BaseActivity implements OnClickListener {
+public class TaskActivity extends SupportToolBarActivity implements OnClickListener {
     private final int PAGE_SIZE = 2000;
     private EmptyLayout mEmptyLayout;
     private Context context;
@@ -86,20 +81,14 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
     private String login_Name = CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_emname");
     private HttpClient hClient;
     private String task_url = "jsps/mobile/task.jsp?caller=ResourceAssignment!Bill%26id=";
-    @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;
+
     private int tab_type = 1;
-    @ViewInject(R.id.voiceSearchView)
-    private VoiceSearchView voiceSearchView;
+    private MenuVoiceSearchView voiceSearchView;
 
     private int mCurrentPage = 1;
     private int mPosition = -1;
+
+
     private Handler handler = new Handler() {
         @SuppressWarnings({"unchecked", "rawtypes"})
         public void handleMessage(Message msg) {
@@ -188,9 +177,9 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
             if (!ListUtils.isEmpty(waitList)) waitList.clear();
             if (!ListUtils.isEmpty(doneList)) doneList.clear();
             if (!ListUtils.isEmpty(isendList)) isendList.clear();
-            ToastMessage(getString(R.string.common_refresh_finish));
+            showToast(getString(R.string.common_refresh_finish));
         } else {
-            ToastMessage(getString(R.string.common_up_finish));
+            showToast(getString(R.string.common_up_finish));
         }
         listview_main.onRefreshComplete();
         if (ListUtils.isEmpty(allList)) return;
@@ -250,10 +239,20 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
 
     }
 
+
+    @Override
+    public int getToolBarId() {
+        return R.id.cycleCountToolBar;
+    }
+
+    @Override
+    public int getLayoutRes() {
+        return R.layout.acativity_task_list;
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.task_listview);
         context = TaskActivity.this;
         ViewUtils.inject(this);
         // 表示已读
@@ -272,7 +271,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
         if (CommonUtil.isNetWorkConnected(ct)) {
             sendResquestForServerAll(2, mCurrentPage);  // update TODO :出息进来请求所有任务数据
         } else {
-            ToastUtil.showToast(ct, R.string.networks_out);
+             showToast( R.string.networks_out);
         }
         initSearchEvent();
         /**注释:监听 */
@@ -439,19 +438,46 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
     }
 
     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(R.id.mVoiceSearchView);
+        findViewById(R.id.backImg).setOnClickListener(this);
+        findViewById(R.id.addImg).setOnClickListener(this);
+        DivideRadioGroup tabGroup = findViewById(R.id.tabGroup);
+        final View todoLine = findViewById(R.id.todoLine);
+        final View doneDealLine = findViewById(R.id.doneDealLine);
+        final View byMeLine = findViewById(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 == R.id.todoRb) {
+                    todoLine.setVisibility(View.VISIBLE);
+                    tab_type = 1;
+                    adapter = new NewSchedultAdapter(TaskActivity.this, waitList);
+                    real_List = waitList;
+                } else if (checkedId == R.id.doneDealRb) {
+                    doneDealLine.setVisibility(View.VISIBLE);
+                    tab_type = 2;
+                    adapter = new NewSchedultAdapter(TaskActivity.this, doneList);
+                    real_List = doneList;
+                } else if (checkedId == R.id.byMeRb) {
+                    byMeLine.setVisibility(View.VISIBLE);
+                    tab_type = 3;
+                    adapter = new NewSchedultAdapter(TaskActivity.this, 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;
     }
@@ -459,45 +485,13 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
     @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);
-                adapter = new NewSchedultAdapter(TaskActivity.this, waitList);
-                real_List = waitList;
-                break;
-            case R.id.done_tv:
-                tab_type = 2;
-                wait_tv.setSelected(false);
-                done_tv.setSelected(true);
-                isend_tv.setSelected(false);
-                adapter = new NewSchedultAdapter(TaskActivity.this, doneList);
-                real_List = doneList;
-                break;
-            case R.id.isend_tv:
-                tab_type = 3;
-                wait_tv.setSelected(false);
-                done_tv.setSelected(false);
-                isend_tv.setSelected(true);
-                adapter = new NewSchedultAdapter(TaskActivity.this, isendList);
-                adapter.setiSend("iSend");
-                real_List = isendList;
+            case R.id.addImg:
+                startActivityForResult(new Intent(context, TaskAddErpActivity.class), 0x17);
                 break;
-
             case R.id.back:
                 onBackPressed();
                 break;
         }
-
-        if (adapter == null) return;
-        listview_main.setAdapter(adapter);
-        if (adapter.getCount() != 0) {
-            sendHomeBroadcast(adapter.getCount());
-        } else {
-            mEmptyLayout.showEmpty();
-        }
-        listview_main.onRefreshComplete();
     }
 
     @Override
@@ -606,7 +600,7 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
 
     /**
      * @author LiuJie
-     *         线程
+     * 线程
      */
     public class getallprocess_run implements Runnable {
         @Override
@@ -864,24 +858,6 @@ public class TaskActivity extends BaseActivity implements OnClickListener {
         sendDataToServer(url, param, LOAD_EM_NAME);
     }
 
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-//        getMenuInflater().inflate(R.menu.menu_state, menu);
-        getMenuInflater().inflate(R.menu.menu_add_icon, menu);
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-//        if (item.getItemId() == R.id.reset) {
-//            View view = getWindow().findViewById(item.getItemId());
-//            showWindow(view);
-//        }
-        if (item.getItemId() == R.id.add_item) {
-            startActivityForResult(new Intent(context, TaskAddErpActivity.class), 0x17);
-        }
-        return super.onOptionsItemSelected(item);
-    }
 
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {

+ 4 - 4
app_modular/appmessages/src/main/AndroidManifest.xml

@@ -46,10 +46,10 @@
             android:name=".activity.TaskNewActivity"
             android:theme="@style/MainBaseTheme"
             android:windowSoftInputMode="adjustPan|stateHidden">
-            <intent-filter>
-                <action android:name="com.modular.task.TaskActivity" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
+            <!--<intent-filter>-->
+                <!--<action android:name="com.modular.task.TaskActivity" />-->
+                <!--<category android:name="android.intent.category.DEFAULT" />-->
+            <!--</intent-filter>-->
         </activity>
 
         <activity

+ 0 - 2
app_modular/appmessages/src/main/java/com/modular/appmessages/adapter/NewSchedultAdapter.java

@@ -140,8 +140,6 @@ public class NewSchedultAdapter extends BaseAdapter {
             store.tv_task_performer = fields_object.getDealpersoncode() == null ? "未填写" : fields_object.getDealpersoncode();
             store.attachs = fields_object.getAttachs();
             store.task_id = fields_object.getRa_taskid();
-
-            //TODO update FANGlg 列表做的和审批流一样
             String recoder_name = "";
             if (!StringUtil.isEmpty(iSend) && "iSend".equals(iSend)){
                 recoder_name = "";

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/ApprovalListFragment.java

@@ -281,7 +281,7 @@ public class ApprovalListFragment extends ViewPagerLazyFragment implements OnSma
             Collections.sort(approvalLists, mComparator);
         }
         if (mApprovalListAdapter == null) {
-            mApprovalListAdapter = new ApprovalListAdapter(getContext(), approvalLists, mOnItemClickListener);
+            mApprovalListAdapter = new ApprovalListAdapter(getContext(),tabItem, approvalLists, mOnItemClickListener);
             mRecyclerView.setAdapter(mApprovalListAdapter);
         } else {
             if (page == 1) {

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/fragment/TaskListFragment.java

@@ -280,7 +280,7 @@ public class TaskListFragment extends ViewPagerLazyFragment implements OnSmartHt
             Collections.sort(approvalLists, mComparator);
         }
         if (mApprovalListAdapter == null) {
-            mApprovalListAdapter = new ApprovalListAdapter(getContext(), approvalLists, mOnItemClickListener);
+            mApprovalListAdapter = new ApprovalListAdapter(getContext(),tabItem, approvalLists, mOnItemClickListener);
             mRecyclerView.setAdapter(mApprovalListAdapter);
         } else {
             if (page == 1) {

+ 16 - 7
app_modular/apputils/src/main/java/com/modular/apputils/adapter/ApprovalListAdapter.java

@@ -27,9 +27,11 @@ public class ApprovalListAdapter extends RecyclerView.Adapter<ApprovalListAdapte
     private Context ct;
     private List<ApprovalList> showModels;
     private List<ApprovalList> allModels;
+    private int tabItem;
 
-    public ApprovalListAdapter(Context ct, List<ApprovalList> approvalLists,OnItemClickListener mOnItemClickListener) {
+    public ApprovalListAdapter(Context ct, int tabItem,List<ApprovalList> approvalLists,OnItemClickListener mOnItemClickListener) {
         this.ct = ct;
+        this.tabItem = tabItem;
         this.mOnItemClickListener = mOnItemClickListener;
         this.allModels = approvalLists;
         this.showModels = this.allModels;
@@ -59,12 +61,6 @@ public class ApprovalListAdapter extends RecyclerView.Adapter<ApprovalListAdapte
     @Override
     public void onBindViewHolder(ViewHolder viewHolder, int position) {
         ApprovalList model = showModels.get(position);
-        if (!StringUtil.isEmpty(model.getImid())) {
-            AvatarHelper.getInstance().displayCircular(model.getImid(), viewHolder.headImage, true, false);//显示圆角图片
-        } else {
-            String imageUri = "drawable://" + R.drawable.common_header_boy;
-            AvatarHelper.getInstance().displayCircular(imageUri, viewHolder.headImage, true);
-        }
         String jpName = model.getName() == null ? "" : (model.getName().replace("流程", ""));
         String name = model.getLauncherName() + "的" + jpName;
         viewHolder.titleTv.setText(name);
@@ -73,6 +69,14 @@ public class ApprovalListAdapter extends RecyclerView.Adapter<ApprovalListAdapte
         viewHolder.subTitle.setText(model.getSubTitle());
         viewHolder.itemView.setTag(model);
         viewHolder.itemView.setOnClickListener(mOnClickListener);
+        if (viewHolder.headImage.getVisibility()==View.VISIBLE){
+            if (!StringUtil.isEmpty(model.getImid())) {
+                AvatarHelper.getInstance().displayCircular(model.getImid(), viewHolder.headImage, true, false);//显示圆角图片
+            } else {
+                String imageUri = "drawable://" + R.drawable.common_header_boy;
+                AvatarHelper.getInstance().displayCircular(imageUri, viewHolder.headImage, true);
+            }
+        }
     }
 
     @Override
@@ -134,6 +138,11 @@ public class ApprovalListAdapter extends RecyclerView.Adapter<ApprovalListAdapte
             statusTv = itemView.findViewById(R.id.statusTv);
             titleTv = itemView.findViewById(R.id.titleTv);
             subTitle = itemView.findViewById(R.id.subTitle);
+            if (tabItem==3){
+                headImage.setVisibility(View.GONE);
+            }else{
+                headImage.setVisibility(View.VISIBLE);
+            }
         }
     }
 }

+ 5 - 0
app_modular/apputils/src/main/res/drawable/text_bule_hint_bg.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+<item android:drawable="@color/approval_select_tab" android:state_checked="true"/>
+<item android:drawable="@color/approval_tab"/>
+</selector>

+ 111 - 0
app_modular/apputils/src/main/res/layout/acativity_task_list.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/bg_main"
+    android:orientation="vertical">
+
+    <include
+        layout="@layout/action_device_cycle_count"
+        android:layout_width="match_parent"
+        android:layout_height="?attr/actionBarSize" />
+
+    <com.xzjmyk.pm.activity.view.DivideRadioGroup
+        android:id="@+id/tabGroup"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:orientation="horizontal">
+
+        <FrameLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <View
+                android:id="@+id/todoLine"
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:layout_gravity="bottom"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_marginRight="@dimen/padding"
+                android:background="#1084D1" />
+
+            <RadioButton
+                android:id="@+id/todoRb"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:button="@null"
+                android:checked="true"
+                android:gravity="center"
+                android:text="@string/task_wait_todo"
+                android:textColor="@drawable/text_bule_hint_bg" />
+
+        </FrameLayout>
+
+        <FrameLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <View
+                android:id="@+id/doneDealLine"
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:layout_gravity="bottom"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_marginRight="@dimen/padding"
+                android:background="#1084D1"
+                android:visibility="gone" />
+
+            <RadioButton
+                android:id="@+id/doneDealRb"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:button="@null"
+                android:gravity="center"
+                android:text="@string/task_done_deal"
+                android:textColor="@drawable/text_bule_hint_bg" />
+        </FrameLayout>
+
+
+        <FrameLayout
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+
+            <View
+                android:id="@+id/byMeLine"
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:layout_gravity="bottom"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_marginRight="@dimen/padding"
+                android:background="#1084D1"
+                android:visibility="gone" />
+
+            <RadioButton
+                android:id="@+id/byMeRb"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:button="@null"
+                android:gravity="center"
+                android:text="@string/task_request_me"
+                android:textColor="@drawable/text_bule_hint_bg" />
+        </FrameLayout>
+
+    </com.xzjmyk.pm.activity.view.DivideRadioGroup>
+
+    <com.handmark.pulltorefresh.library.PullToRefreshListView
+        android:id="@+id/listview_schedult"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/tv_dispaly_top"
+        android:divider="@color/gray_light"
+        android:dividerPadding="1px"
+        android:fadingEdge="none"
+        android:listSelector="#00000000"
+        android:scrollbars="none"
+        android:scrollingCache="false" />
+</LinearLayout>

+ 6 - 3
app_modular/apputils/src/main/res/layout/item_approval_list.xml

@@ -1,13 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:background="#f2f2f2">
+    android:layout_height="wrap_content">
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="60dp"
         android:layout_margin="@dimen/padding"
+        android:paddingLeft="@dimen/padding"
+        android:paddingRight="@dimen/padding"
+        android:paddingTop="@dimen/paddingMin"
+        android:paddingBottom="@dimen/paddingMin"
         android:background="@drawable/radian_white_utils_bg">
 
         <de.hdodenhof.circleimageview.CircleImageView

+ 1 - 0
app_modular/apputils/src/main/res/layout/simply_refresh_recyclerview.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
+    android:background="#F2F2F2"
     android:layout_height="match_parent">
 
     <com.module.recyclerlibrary.ui.refresh.simlpe.SimpleRefreshLayout