فهرست منبع

打包测试发布版本

Bitliker 9 سال پیش
والد
کامیت
c0607dc468

+ 0 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/helper/AvatarHelper.java

@@ -277,7 +277,6 @@ public class AvatarHelper {
 
 
     public void displayAvatar(String userId, final ImageAware imageAware, final boolean isThumb) {
     public void displayAvatar(String userId, final ImageAware imageAware, final boolean isThumb) {
         final String url = getAvatarUrl(userId, isThumb);
         final String url = getAvatarUrl(userId, isThumb);
-        Log.d("wang", "头像url:" + url);
         if (TextUtils.isEmpty(url)) {
         if (TextUtils.isEmpty(url)) {
             return;
             return;
         }
         }

+ 5 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkActivity.java

@@ -8,6 +8,7 @@ import android.os.Bundle;
 import android.support.v4.content.LocalBroadcastManager;
 import android.support.v4.content.LocalBroadcastManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
 import android.util.Log;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
@@ -153,6 +154,7 @@ public class WorkActivity extends OABaseActivity implements View.OnClickListener
     public void showDistance(String distance) {
     public void showDistance(String distance) {
         if (!StringUtils.isEmpty(distance))
         if (!StringUtils.isEmpty(distance))
             unoffice_mm.setText(distance);
             unoffice_mm.setText(distance);
+        else unoffice_mm.setText("");
     }
     }
 
 
     @Override
     @Override
@@ -400,7 +402,6 @@ public class WorkActivity extends OABaseActivity implements View.OnClickListener
     @Override
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (0x12 == requestCode) {
         if (0x12 == requestCode) {
-            Log.i("gongpengming", "进来了的");
             presenter.loadWorkData(selectTime, false);
             presenter.loadWorkData(selectTime, false);
         }
         }
         if (data == null) return;
         if (data == null) return;
@@ -423,6 +424,9 @@ public class WorkActivity extends OABaseActivity implements View.OnClickListener
         } else if (!StringUtils.isEmpty(macError)) {
         } else if (!StringUtils.isEmpty(macError)) {
             Crouton.showToast(this, macError, R.color.load_warning);
             Crouton.showToast(this, macError, R.color.load_warning);
             return false;
             return false;
+        } else if (TextUtils.isEmpty(unoffice_mm.getText())) {
+            Crouton.showToast(this, R.string.not_addr_message, R.color.load_warning);
+            return false;
         }
         }
         return true;
         return true;
     }
     }

+ 130 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/MessageAdapter.java

@@ -0,0 +1,130 @@
+package com.xzjmyk.pm.activity.ui.erp.adapter;
+
+import android.content.Context;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.xzjmyk.pm.activity.MyApplication;
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.Friend;
+import com.xzjmyk.pm.activity.bean.message.XmppMessage;
+import com.xzjmyk.pm.activity.helper.AvatarHelper;
+import com.xzjmyk.pm.activity.sortlist.BaseSortModel;
+import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
+import com.xzjmyk.pm.activity.util.HtmlUtils;
+import com.xzjmyk.pm.activity.util.StringUtils;
+import com.xzjmyk.pm.activity.util.TimeUtils;
+
+import java.util.List;
+
+/**
+ * Created by Bitliker on 2017/3/1.
+ */
+
+public class MessageAdapter extends BaseAdapter {
+
+    private List<BaseSortModel<Friend>> mFriendList;
+    private Context mContext;
+
+    public MessageAdapter(List<BaseSortModel<Friend>> mFriendList, Context mContext) {
+        this.mFriendList = mFriendList;
+        this.mContext = mContext;
+    }
+
+    public List<BaseSortModel<Friend>> getmFriendList() {
+        return mFriendList;
+    }
+
+    public void setmFriendList(List<BaseSortModel<Friend>> mFriendList) {
+        this.mFriendList = mFriendList;
+    }
+
+    @Override
+    public int getCount() {
+        return ListUtils.isEmpty(mFriendList) ? 0 : mFriendList.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return mFriendList.get(position).getBean();
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return position;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        Friend friend = (Friend) getItem(position);
+        ViewHolder holder = null;
+        if (convertView == null) {
+            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_message, null);
+            holder = new ViewHolder();
+            holder.avatar_img = (ImageView) convertView.findViewById(R.id.avatar_img);
+            holder.num_tv = (TextView) convertView.findViewById(R.id.num_tv);
+            holder.nick_name_tv = (TextView) convertView.findViewById(R.id.nick_name_tv);
+            holder.content_tv = (TextView) convertView.findViewById(R.id.content_tv);
+            holder.time_tv = (TextView) convertView.findViewById(R.id.time_tv);
+            convertView.setTag(holder);
+        } else {
+            holder = (ViewHolder) convertView.getTag();
+        }
+        bindView(holder, friend);
+        return convertView;
+    }
+
+    private void bindView(ViewHolder holder, Friend friend) {
+        holder.avatar_img.setBackgroundResource(R.color.transparent);
+        //设置头像
+        if (friend.getRoomFlag() == 0) {// 这是单个人
+            AvatarHelper.getInstance().display(friend.getUserId(), holder.avatar_img, false, true);//每次刷新都会去删除此人缓存
+//            AvatarHelper.getInstance().displayAvatar(friend.getUserId(), holder.avatar_img, true);
+        } else {
+            if (TextUtils.isEmpty(friend.getRoomCreateUserId())) {
+                holder.avatar_img.setImageResource(R.drawable.qunliao);
+            } else {
+                AvatarHelper.getInstance().displayAvatarPng(friend.getRoomCreateUserId(), holder.avatar_img, true);// 目前在备注名放房间的创建者Id
+            }
+        }
+        //设置名字和时间
+        holder.nick_name_tv.setText(friend.getRemarkName() != null ? friend.getRemarkName() : friend.getNickName());
+        holder.time_tv.setText(TimeUtils.getFriendlyTimeDesc(MyApplication.getInstance(), friend.getTimeSend()));
+        //设置内容数据显示
+        CharSequence content = "";
+        if (friend.getType() == XmppMessage.TYPE_TEXT) {
+            String s = StringUtils.replaceSpecialChar(friend.getContent());
+            content = HtmlUtils.transform200SpanString(s.replaceAll("\n", "\r\n"), true);
+        } else {
+            content = friend.getContent();
+        }
+        holder.content_tv.setText(content);
+        //设置红点显示数量
+        if (friend.getUnReadNum() > 0) {
+            String numStr = friend.getUnReadNum() >= 99 ? "99+" : friend.getUnReadNum() + "";
+            holder.num_tv.setText(numStr);
+            holder.num_tv.setVisibility(View.VISIBLE);
+        } else {
+            holder.num_tv.setVisibility(View.GONE);
+        }
+
+    }
+
+    class ViewHolder {
+        //头像
+        ImageView avatar_img;
+        //数目
+        TextView num_tv;
+        //名字
+        TextView nick_name_tv;
+        //内容
+        TextView content_tv;
+        //时间
+        TextView time_tv;
+    }
+}

+ 4 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java

@@ -512,7 +512,7 @@ public class ViewUtil {
     }
     }
 
 
     public static void ChangeStatusB2B(String result) {
     public static void ChangeStatusB2B(String result) {
-        LogUtil.d("b2b login:"+result);
+        LogUtil.d("b2b login:" + result);
         if (erp_phone != null) {
         if (erp_phone != null) {
             Log.i("login_status", "ChangeStatusB2B:" + erp_phone);
             Log.i("login_status", "ChangeStatusB2B:" + erp_phone);
             Log.i("login_status", "ChangeStatusB2B:" + erp_password);
             Log.i("login_status", "ChangeStatusB2B:" + erp_password);
@@ -736,10 +736,10 @@ public class ViewUtil {
                             && headers != null) {
                             && headers != null) {
                         headers.put("sessionUser", CommonUtil.getSharedPreferences(ct, "erp_username"));
                         headers.put("sessionUser", CommonUtil.getSharedPreferences(ct, "erp_username"));
                     }
                     }
+                    LogUtil.prinlnLongMsg("result", "http 发送请求-----------------------------------------");
+                    LogUtil.prinlnLongMsg("result", "url:" + url);
+                    LogUtil.prinlnLongMsg("result", "parms:" + params.toString());
                     HttpUtil.Response result = httpSendTask(url, params, headers, request);
                     HttpUtil.Response result = httpSendTask(url, params, headers, request);
-                    Log.i("result", "http 发送请求-----------------------------------------");
-                    Log.i("result", "url:" + url);
-                    Log.i("result", "parms:" + params.toString());
                     if (result != null) {
                     if (result != null) {
                         Log.i("result", "statusCode:" + result.getStatusCode());
                         Log.i("result", "statusCode:" + result.getStatusCode());
                         // Log.i("result", "statusCode:" +result.getResponseText());
                         // Log.i("result", "statusCode:" +result.getResponseText());

+ 6 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/presenter/AddFlihtsPresenter.java

@@ -70,7 +70,12 @@ public class AddFlihtsPresenter implements HttpHandler.OnResultListener {
     }
     }
 
 
     public void submit(String name) {
     public void submit(String name) {
-        name = name.replace("\n", "").replace(" ", "");
+        name = StringUtils.string2Json(name);
+        name = name.replace("\n", "").replace(" ", "").replace("%", "");
+        if (StringUtils.isEmpty(name)) {
+            iAddFlihtsView.showToast("规则名称为空或是包含特殊字符,请检查后提交", R.color.load_warning);
+            return;
+        }
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
         param.put("caller", "WorkDate");
         param.put("caller", "WorkDate");
         Map<String, Object> formStore = new HashMap<>();
         Map<String, Object> formStore = new HashMap<>();

+ 2 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/presenter/FlightsPresernter.java

@@ -210,8 +210,8 @@ public class FlightsPresernter implements HttpHandler.OnResultListener {
         }
         }
         employeesModel.setEmployeecode(OACheckUtil.getJson2Text(object, "defaultmancode"));
         employeesModel.setEmployeecode(OACheckUtil.getJson2Text(object, "defaultmancode"));
         employeesModel.setEmployeeNames(OACheckUtil.getJson2Text(object, "defaultman"));
         employeesModel.setEmployeeNames(OACheckUtil.getJson2Text(object, "defaultman"));
-        hrorgsModel.setEmployeecode(OACheckUtil.getJson2Text(object, "hrorgcode"));
-        hrorgsModel.setEmployeeNames(OACheckUtil.getJson2Text(object, "hrorgname"));
+//        hrorgsModel.setEmployeecode(OACheckUtil.getJson2Text(object, "hrorgcode"));
+//        hrorgsModel.setEmployeeNames(OACheckUtil.getJson2Text(object, "hrorgname"));
         model.setId(OACheckUtil.getJsonIntager(object, "wd_id"));
         model.setId(OACheckUtil.getJsonIntager(object, "wd_id"));
         model.setCode(OACheckUtil.getJson2Text(object, "wd_code"));
         model.setCode(OACheckUtil.getJson2Text(object, "wd_code"));
         model.setTimeModel(timeModel);
         model.setTimeModel(timeModel);

+ 183 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/presenter/MessagePresenter.java

@@ -0,0 +1,183 @@
+package com.xzjmyk.pm.activity.ui.erp.presenter;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.text.TextUtils;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.xzjmyk.pm.activity.MyApplication;
+import com.xzjmyk.pm.activity.bean.Friend;
+import com.xzjmyk.pm.activity.bean.message.XmppMessage;
+import com.xzjmyk.pm.activity.db.dao.FriendDao;
+import com.xzjmyk.pm.activity.sortlist.BaseSortModel;
+import com.xzjmyk.pm.activity.sortlist.PingYinUtil;
+import com.xzjmyk.pm.activity.ui.erp.presenter.imp.IMessageView;
+import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
+import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
+import com.xzjmyk.pm.activity.ui.erp.util.auto.HttpHandler;
+import com.xzjmyk.pm.activity.util.WorkHandlerUtil;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Bitliker on 2017/3/1.
+ */
+
+public class MessagePresenter implements HttpHandler.OnResultListener {
+    private final int LOAD_EMNEWS = 0x11;
+
+    private List<BaseSortModel<Friend>> mFriendList;
+
+    private Comparator<BaseSortModel<Friend>> erpComparator;
+    private IMessageView iMessageView;
+    private Context ct;
+
+    public MessagePresenter(Context ct, IMessageView iMessageView) {
+        this.ct = ct;
+        if (iMessageView == null)
+            new NullPointerException("IMessageView 不能为空");
+        this.iMessageView = iMessageView;
+    }
+
+
+    public void loadData() {
+        Map<String, Object> param = new HashMap<>();
+        param.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
+        HttpHandler.getInstance().loadERPByNet(LOAD_EMNEWS, "mobile/queryEmNews.action", param, null, this);
+    }
+
+    @Override
+    public void result(int what, boolean isJSON, String message, Bundle bundle) {
+        if (!isJSON) {
+            //TODO 返回数据错误
+            return;
+        }
+        JSONObject object = JSON.parseObject(message);
+        switch (what) {
+            case LOAD_EMNEWS:
+                int allCount = WorkHandlerUtil.getIntByJson(object, "allCount");
+                if (!object.containsKey("listdata")) return;
+                JSONArray array = object.getJSONArray("listdata");
+                handlerNewsFormErp(array);
+                loadDataByIm();
+                break;
+        }
+    }
+
+    @Override
+    public void error(int what, int statuCode, String message, Bundle bundle) {
+
+    }
+
+
+    private void handlerNewsFormErp(JSONArray array) {
+        if (ListUtils.isEmpty(array)) {
+            //TODO  为空数据情况下
+            return;
+        }
+        List<BaseSortModel<Friend>> erpFriend = new ArrayList<>();
+        JSONObject object = null;
+        Friend friend = null;
+        for (int i = 0; i < array.size(); i++) {
+            object = array.getJSONObject(i);
+            friend = new Friend();
+            friend.setNickName(object.getString("title"));
+            friend.setContent(object.getString("lastMessage"));
+            friend.setTimeSend(10000000);
+            friend.setType(XmppMessage.TYPE_ERP);
+            friend.setDescription(object.getString("type"));
+            BaseSortModel<Friend> mode = new BaseSortModel<>();
+            mode.setBean(friend);
+            setSortCondition(mode);
+            erpFriend.add(mode);
+        }
+        if (erpComparator == null) {
+            erpComparator = new Comparator<BaseSortModel<Friend>>() {
+                public int compare(BaseSortModel<Friend> s1, BaseSortModel<Friend> s2) {
+                    return (s1.getBean().getTimeSend() - s2.getBean().getTimeSend());
+                }
+            };
+        }
+        Collections.sort(erpFriend, erpComparator);
+        mFriendList.addAll(0, erpFriend);
+        iMessageView.showModel(erpFriend);
+    }
+
+    private final void setSortCondition(BaseSortModel<Friend> mode) {
+        Friend friend = mode.getBean();
+        if (friend == null) {
+            return;
+        }
+        String name = friend.getShowName();
+        String wholeSpell = PingYinUtil.getPingYin(name);
+        if (!TextUtils.isEmpty(wholeSpell)) {
+            String firstLetter = Character.toString(wholeSpell.charAt(0));
+            mode.setWholeSpell(wholeSpell);
+            mode.setFirstLetter(firstLetter);
+            mode.setSimpleSpell(PingYinUtil.converterToFirstSpell(name));
+        } else {// 如果全拼为空,理论上是一种错误情况,因为这代表着昵称为空
+            mode.setWholeSpell("#");
+            mode.setFirstLetter("#");
+            mode.setSimpleSpell("#");
+        }
+    }
+
+
+    /**
+     * 请求加载新的筛选条件的数据
+     * <p/>
+     * 是下拉刷新,还是上拉加载
+     */
+    private void loadDataByIm() {
+        //TODO im部分
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                String mLoginUserId = MyApplication.getInstance().mLoginUser.getUserId();
+                long startTime = System.currentTimeMillis();
+                final List<Friend> friends = FriendDao.getInstance().getNearlyFriendMsg(mLoginUserId);
+                setFriendName(friends, mLoginUserId);
+                long delayTime = 200 - (startTime - System.currentTimeMillis());// 保证至少200ms的刷新过程
+                if (delayTime < 0) {
+                    delayTime = 0;
+                }
+                HttpHandler.getInstance().postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        if (friends != null && friends.size() > 0) {
+                            for (int i = 0; i < friends.size(); i++) {
+                                BaseSortModel<Friend> mode = new BaseSortModel<>();
+                                mode.setBean(friends.get(i));
+                                setSortCondition(mode);
+                                mFriendList.add(mode);
+                            }
+                        }
+                        iMessageView.showModel(mFriendList);
+                    }
+                }, delayTime);
+            }
+        }).start();
+    }
+
+    private void setFriendName(List<Friend> friends, String id) {
+        List<Friend> f = FriendDao.getInstance().getFriends(id);
+        if (friends == null) return;
+        for (int i = 0; i < friends.size(); i++) {
+            for (int j = 0; j < f.size(); j++) {
+                if (friends.get(i).get_id() == f.get(j).get_id()) {
+                    friends.get(i).setNickName(f.get(j).getNickName());
+                    friends.get(i).setRemarkName(f.get(j).getRemarkName());
+                    break;
+                }
+            }
+        }
+    }
+
+}

+ 32 - 5
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/presenter/WorkPresenter.java

@@ -50,6 +50,7 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
     private final int MAC_VAL = 0x13;
     private final int MAC_VAL = 0x13;
     private final int LOAD_MAC = 0x14;
     private final int LOAD_MAC = 0x14;
     private final int SIGNING = 0x15;//签到
     private final int SIGNING = 0x15;//签到
+    private final int LOAD_WORK_SET = 0x16;//获取考勤设置
     private double distance;
     private double distance;
 
 
     //本地位置
     //本地位置
@@ -172,6 +173,7 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
         loaction = MyApplication.getInstance().getBdLocationHelper().getName();
         loaction = MyApplication.getInstance().getBdLocationHelper().getName();
         address = MyApplication.getInstance().getBdLocationHelper().getAddress();
         address = MyApplication.getInstance().getBdLocationHelper().getAddress();
         if (iWorkView == null) return;
         if (iWorkView == null) return;
+        distance = 0;
         iWorkView.showDistance(getDistance());
         iWorkView.showDistance(getDistance());
         iWorkView.showLocation(address);
         iWorkView.showLocation(address);
 
 
@@ -242,6 +244,7 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
                 });
                 });
     }
     }
 
 
+
     /**
     /**
      * 处理打卡签到
      * 处理打卡签到
      *
      *
@@ -273,6 +276,8 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
                     companyLocation = location;
                     companyLocation = location;
                 }
                 }
             }
             }
+        } else {
+            companyLocation = null;
         }
         }
         try {
         try {
             if (ListUtils.isEmpty(locationList) && iWorkView != null)
             if (ListUtils.isEmpty(locationList) && iWorkView != null)
@@ -366,7 +371,7 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
             if (iWorkView != null)
             if (iWorkView != null)
                 iWorkView.showToast(R.string.not_signin_agin, R.color.load_warning);
                 iWorkView.showToast(R.string.not_signin_agin, R.color.load_warning);
             return false;
             return false;
-        } else if (distance == 0 || companyLocation == null || companyLocation.getInnerdistance() < distance) {
+        } else if (companyLocation == null || companyLocation.getInnerdistance() < distance) {
             if (iWorkView != null)
             if (iWorkView != null)
                 iWorkView.showToast(R.string.too_long, R.color.load_warning);
                 iWorkView.showToast(R.string.too_long, R.color.load_warning);
             return false;
             return false;
@@ -398,20 +403,36 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
     public void start(boolean canShowTocat) {
     public void start(boolean canShowTocat) {
         this.canShowTocat = canShowTocat;
         this.canShowTocat = canShowTocat;
         MyApplication.getInstance().getBdLocationHelper().requestLocation();
         MyApplication.getInstance().getBdLocationHelper().requestLocation();
-        loadWorkData(System.currentTimeMillis(), canShowTocat);
         if (MyApplication.getInstance().isNetworkActive()) {
         if (MyApplication.getInstance().isNetworkActive()) {
             getMacByNet();
             getMacByNet();
+            loadWorkData(System.currentTimeMillis(), canShowTocat);
+        } else {
+            iWorkView.showToast(R.string.networks_out, R.color.load_warning);
         }
         }
     }
     }
 
 
+    private void loadWorkSet(long time) {
+        if (iWorkView != null)
+            iWorkView.showLoading();
+        //获取考勤高级设置时间请求
+        Map<String, Object> param = new HashMap<>();
+        param.put("code", 1);
+        Bundle bundle = new Bundle();
+        bundle.putLong("time", time);
+        HttpHandler.getInstance().loadERPByNet(LOAD_WORK_SET, "/mobile/getconfigs.action", param, bundle, this);
+    }
+
+
     public void loadWorkData(long time, boolean canShowTocat) {
     public void loadWorkData(long time, boolean canShowTocat) {
         this.canShowTocat = canShowTocat;
         this.canShowTocat = canShowTocat;
         if (!MyApplication.getInstance().isNetworkActive() && canShowTocat) {
         if (!MyApplication.getInstance().isNetworkActive() && canShowTocat) {
             iWorkView.showToast(R.string.networks_out, R.color.load_warning);
             iWorkView.showToast(R.string.networks_out, R.color.load_warning);
             return;
             return;
         }
         }
-        if (iWorkView != null)
-            iWorkView.showLoading();
+        loadWorkSet(time);
+    }
+
+    private void loadWorkData(long time) {
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
         param.put("date", TimeUtils.int_long_2_str(time));
         param.put("date", TimeUtils.int_long_2_str(time));
         param.put("emcode", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_username"));
         param.put("emcode", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_username"));
@@ -420,7 +441,6 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
         HttpHandler.getInstance().loadERPByNet(WORK_DATA, "mobile/getWorkDate.action", param, bundle, this);
         HttpHandler.getInstance().loadERPByNet(WORK_DATA, "mobile/getWorkDate.action", param, bundle, this);
     }
     }
 
 
-
     @Override
     @Override
     public void submit(ArrayList<WorkModel> models, String macAddress) {
     public void submit(ArrayList<WorkModel> models, String macAddress) {
         if (isSubmitAble(models)) {
         if (isSubmitAble(models)) {
@@ -482,6 +502,13 @@ public class WorkPresenter implements HttpHandler.OnResultListener, IWorkPresent
             ArrayList<WorkModel> models = null;
             ArrayList<WorkModel> models = null;
             if (iWorkView != null) iWorkView.dimssLoading();
             if (iWorkView != null) iWorkView.dimssLoading();
             switch (what) {
             switch (what) {
+                case LOAD_WORK_SET:
+                    long t = System.currentTimeMillis();
+                    if (bundle != null) t = bundle.getLong("time");
+                    if (isJSON)
+                        WorkHandlerUtil.handlerWorkSet(JSON.parseObject(message));
+                    loadWorkData(t);
+                    break;
                 case WORK_DATA://打卡班次
                 case WORK_DATA://打卡班次
                     long time = System.currentTimeMillis();
                     long time = System.currentTimeMillis();
                     if (bundle != null) time = bundle.getLong("time");
                     if (bundle != null) time = bundle.getLong("time");

+ 15 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/presenter/imp/IMessageView.java

@@ -0,0 +1,15 @@
+package com.xzjmyk.pm.activity.ui.erp.presenter.imp;
+
+import com.xzjmyk.pm.activity.bean.Friend;
+import com.xzjmyk.pm.activity.sortlist.BaseSortModel;
+
+import java.util.List;
+
+/**
+ * Created by Bitliker on 2017/3/1.
+ */
+
+public interface IMessageView {
+
+    void showModel(List<BaseSortModel<Friend>> models);
+}

+ 2 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java

@@ -139,7 +139,6 @@ public class MessageFragment extends EasyFragment implements RecognizerDialogLis
     };
     };
 
 
     public OnRefreshUIListener refreshRedUIListener = null;
     public OnRefreshUIListener refreshRedUIListener = null;
-    private ArrayList<SubscriptionMessage> SubscriptionMessages;
     private ImageView voice_search;
     private ImageView voice_search;
 
 
     @Override
     @Override
@@ -1026,7 +1025,8 @@ public class MessageFragment extends EasyFragment implements RecognizerDialogLis
     }
     }
 
 
     public static final int GONGGAO_MSG = 0X00a, NOTICE_MSG = 0X00b, NES_MSG = 0X00c, TASK_MSG = 0X00d, DAIBAN_MSG = 0X00e;
     public static final int GONGGAO_MSG = 0X00a, NOTICE_MSG = 0X00b, NES_MSG = 0X00c, TASK_MSG = 0X00d, DAIBAN_MSG = 0X00e;
-    private int GONGGAO_count = 0, NOTICE_count = 0, NES_count = 0, TASK_count = 0, DAIBAN_count = 0, SUBRICE_count = 0, BMSGS_count = 0;
+    private int GONGGAO_count = 0, NOTICE_count = 0, NES_count = 0, TASK_count = 0, DAIBAN_count = 0,
+            SUBRICE_count = 0, BMSGS_count = 0;
 
 
     private void updateGongGao(Message msg) {
     private void updateGongGao(Message msg) {
         final String result = msg.getData().getString("result");
         final String result = msg.getData().getString("result");

+ 153 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/NewMessageFragment.java

@@ -1,17 +1,65 @@
 package com.xzjmyk.pm.activity.ui.message;
 package com.xzjmyk.pm.activity.ui.message;
 
 
-
+import android.content.Context;
+import android.content.Intent;
 import android.os.Bundle;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import android.provider.Settings;
+import android.text.Editable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.TextView;
 
 
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.iflytek.cloud.speech.RecognizerResult;
+import com.iflytek.cloud.speech.SpeechError;
+import com.iflytek.cloud.ui.RecognizerDialogListener;
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.audio.voicerecognition.JsonParser;
+import com.xzjmyk.pm.activity.audio.voicerecognition.VoiceToWord;
+import com.xzjmyk.pm.activity.bean.Friend;
+import com.xzjmyk.pm.activity.sortlist.BaseSortModel;
+import com.xzjmyk.pm.activity.ui.MainActivity;
 import com.xzjmyk.pm.activity.ui.base.EasyFragment;
 import com.xzjmyk.pm.activity.ui.base.EasyFragment;
+import com.xzjmyk.pm.activity.ui.erp.adapter.MessageAdapter;
+import com.xzjmyk.pm.activity.ui.erp.entity.EditChangeListener;
+import com.xzjmyk.pm.activity.ui.erp.presenter.MessagePresenter;
+import com.xzjmyk.pm.activity.ui.erp.presenter.imp.IMessageView;
+import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
+import com.xzjmyk.pm.activity.view.ClearEditText;
+import com.xzjmyk.pm.activity.view.DrawableCenterTextView;
+
+import java.util.List;
 
 
 /**
 /**
- * A simple {@link Fragment} subclass.
+ * Created by Bitliker on 2017/3/1.
  */
  */
-public class NewMessageFragment extends EasyFragment {
 
 
+public class NewMessageFragment extends EasyFragment implements IMessageView, RecognizerDialogListener, View.OnClickListener {
+
+    @ViewInject(R.id.search_edit)
+    private ClearEditText search_edit;
+
+    @ViewInject(R.id.message_net_set)
+    private DrawableCenterTextView message_net_set;
+    @ViewInject(R.id.listView)
+    private PullToRefreshListView listView;
+
+    private MainActivity mContext;
+    private MessagePresenter presenter;
+    private MessageAdapter mAdapter = null;
+    private VoiceToWord mVoice;//语音工具
+
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        if (context instanceof MainActivity)
+            mContext = (MainActivity) context;
+        else new ClassCastException("该碎片必须由MainActivity生成");
+    }
 
 
     @Override
     @Override
     protected int inflateLayoutId() {
     protected int inflateLayoutId() {
@@ -21,7 +69,108 @@ public class NewMessageFragment extends EasyFragment {
     @Override
     @Override
     protected void onCreateView(Bundle savedInstanceState, boolean createView) {
     protected void onCreateView(Bundle savedInstanceState, boolean createView) {
         if (createView) {
         if (createView) {
+            ViewUtils.inject(getmRootView());
+            initView();
+            initEvent();
+        }
+    }
+
+    private void initEvent() {
+        mVoice.setRecognizerDialogListener(this);
+        findViewById(R.id.voice_search_iv).setOnClickListener(this);
+        message_net_set.setOnClickListener(this);
+        search_edit.addTextChangedListener(new EditChangeListener() {
+            @Override
+            public void afterTextChanged(Editable s) {
+                //TODO 输入后搜索
+            }
+        });
+
+        listView.getRefreshableView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                //TODO 点击
+            }
+        });
+
+        listView.getRefreshableView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
+            @Override
+            public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
+                //TODO 长点击
+
+                return false;
+            }
+        });
+
+    }
+
+    private void initView() {
+        mVoice = new VoiceToWord(mContext, "534e3fe2");
+        listView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);//只有下拉没有上拉
+        listView.getRefreshableView().addHeaderView(initHeaderView());
+        presenter = new MessagePresenter(mContext, this);
+        presenter.loadData();
+    }
+
+
+    private View initHeaderView() {
+        View view = LayoutInflater.from(mContext).inflate(R.layout.new_message_header, null);
+
+        TextView schedule_num_tv = (TextView) view.findViewById(R.id.schedule_num_tv);//审批流
+        TextView waitting_work_num_tv = (TextView) view.findViewById(R.id.waitting_work_num_tv);//待办工作
+        TextView subscribe_num_tv = (TextView) view.findViewById(R.id.subscribe_num_tv);//我的订阅
 
 
+        TextView schedule_content_tv = (TextView) view.findViewById(R.id.schedule_content_tv);//审批流
+        TextView waitting_work_content_tv = (TextView) view.findViewById(R.id.waitting_work_content_tv);//待办工作
+        TextView subscribe_content_tv = (TextView) view.findViewById(R.id.subscribe_content_tv);//我的订阅
+
+
+        view.findViewById(R.id.schedule_rl).setOnClickListener(this);//审批流
+        view.findViewById(R.id.waitting_work_rl).setOnClickListener(this);//待办工作
+        view.findViewById(R.id.subscribe_rl).setOnClickListener(this);//我的订阅
+
+        return view;
+    }
+
+
+    //语音数据回调
+    @Override
+    public void onResult(RecognizerResult recognizerResult, boolean b) {
+        String text = JsonParser.parseIatResult(recognizerResult.getResultString());
+        search_edit.setText(search_edit.getText().toString() + CommonUtil.getPlaintext(text));
+
+    }
+
+    @Override
+    public void onError(SpeechError speechError) {
+
+    }
+
+    //点击时间回调
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.voice_search_iv://点击语音
+                mVoice.GetWordFromVoice();
+                break;
+            case R.id.message_net_set://点击无网络情况
+                startActivity(new Intent(Settings.ACTION_SETTINGS));
+                break;
+
+        }
+
+    }
+
+    @Override
+    public void showModel(List<BaseSortModel<Friend>> models) {
+        if (listView.isRefreshing())
+            listView.onRefreshComplete();
+        if (mAdapter == null) {
+            mAdapter = new MessageAdapter(models, mContext);
+            listView.getRefreshableView().setAdapter(mAdapter);
+        } else {
+            mAdapter.setmFriendList(models);
+            mAdapter.notifyDataSetChanged();
         }
         }
     }
     }
 }
 }

+ 5 - 5
WeiChat/src/main/res/layout/activity_work.xml

@@ -29,14 +29,14 @@
 
 
     <View
     <View
         android:id="@+id/line"
         android:id="@+id/line"
-        android:visibility="invisible"
         android:layout_width="2px"
         android:layout_width="2px"
         android:layout_height="match_parent"
         android:layout_height="match_parent"
         android:layout_above="@+id/signin_btn"
         android:layout_above="@+id/signin_btn"
         android:layout_below="@id/date_tv"
         android:layout_below="@id/date_tv"
         android:layout_centerHorizontal="true"
         android:layout_centerHorizontal="true"
-        android:layout_marginTop="25dp"
-        android:background="@color/item_line" />
+        android:layout_marginTop="30dp"
+        android:background="@color/item_line"
+        android:visibility="invisible" />
 
 
     <FrameLayout
     <FrameLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
@@ -58,10 +58,10 @@
 
 
 
 
         <RelativeLayout
         <RelativeLayout
-            android:visibility="gone"
             android:id="@+id/empty_rl"
             android:id="@+id/empty_rl"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
-            android:layout_height="match_parent">
+            android:layout_height="match_parent"
+            android:visibility="gone">
 
 
             <TextView
             <TextView
                 android:id="@+id/empty_tv"
                 android:id="@+id/empty_tv"

+ 4 - 18
WeiChat/src/main/res/layout/fragment_contact.xml

@@ -3,31 +3,17 @@
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     android:background="@drawable/bg_main">
     android:background="@drawable/bg_main">
 
 
-    <!--<com.handmark.pulltorefresh.library.PullToRefreshListView xmlns:ptr="http://schemas.android.com/apk/res-auto"
-        android:id="@+id/pull_refresh_list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:divider="#00000000"
-        android:dividerHeight="0dip"
-        android:listSelector="@android:color/transparent"
-        ptr:ptrAnimationStyle="flip"
-        ptr:ptrDrawableEnd="@drawable/default_ptr_rotate"
-        ptr:ptrDrawableStart="@drawable/default_ptr_flip"
-        ptr:ptrHeaderTextColor="@color/refresh"
-        ptr:ptrMode="both"
-        ptr:ptrOverScroll="false"
-        ptr:ptrScrollingWhileRefreshingEnabled="true"
-        ptr:ptrShowIndicator="false"
-        android:visibility="gone"/>-->
     <com.yalantis.phoenix.PullToRefreshView
     <com.yalantis.phoenix.PullToRefreshView
         android:id="@+id/contact_ptrv"
         android:id="@+id/contact_ptrv"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
         android:layout_height="match_parent">
+
         <se.emilsjolander.stickylistheaders.StickyListHeadersListView
         <se.emilsjolander.stickylistheaders.StickyListHeadersListView
             android:id="@+id/pull_refresh_list"
             android:id="@+id/pull_refresh_list"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
+            android:layout_height="match_parent" />
     </com.yalantis.phoenix.PullToRefreshView>
     </com.yalantis.phoenix.PullToRefreshView>
+
     <TextView
     <TextView
         android:id="@+id/text_dialog"
         android:id="@+id/text_dialog"
         android:layout_width="80.0dip"
         android:layout_width="80.0dip"
@@ -40,7 +26,7 @@
         android:textSize="30.0dip"
         android:textSize="30.0dip"
         android:visibility="invisible" />
         android:visibility="invisible" />
 
 
-     <com.xzjmyk.pm.activity.sortlist.SideBar
+    <com.xzjmyk.pm.activity.sortlist.SideBar
         android:id="@+id/sidebar"
         android:id="@+id/sidebar"
         android:layout_width="30.0dip"
         android:layout_width="30.0dip"
         android:layout_height="match_parent"
         android:layout_height="match_parent"

+ 4 - 21
WeiChat/src/main/res/layout/fragment_new_message.xml

@@ -1,6 +1,4 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:slide="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     android:background="#ebe9e9"
     android:background="#ebe9e9"
@@ -53,23 +51,8 @@
         android:textColor="@color/black"
         android:textColor="@color/black"
         android:visibility="gone" />
         android:visibility="gone" />
 
 
-    <com.xzjmyk.pm.activity.view.PullToRefreshListView
-        android:id="@+id/pull_refresh_list"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#ebe9e9"
-        android:hardwareAccelerated="false"
-        android:layerType="software"
-        app:ptrAnimationStyle="flip"
-        app:ptrDrawableEnd="@drawable/default_ptr_rotate"
-        app:ptrDrawableStart="@drawable/default_ptr_flip"
-        app:ptrHeaderTextColor="@color/black"
-        app:ptrOverScroll="false"
-        app:ptrScrollingWhileRefreshingEnabled="true"
-        app:ptrShowIndicator="false"
-        slide:slideAnimationTime="200"
-        slide:slideLeftAction="scroll"
-        slide:slideMode="right"
-        slide:slideRightAction="scroll" />
-
+    <com.handmark.pulltorefresh.library.PullToRefreshListView
+        android:id="@+id/listView"
+        style="@style/ListViewBasic"
+        android:divider="@drawable/bg_bar" />
 </LinearLayout>
 </LinearLayout>

+ 79 - 0
WeiChat/src/main/res/layout/item_message.xml

@@ -0,0 +1,79 @@
+<?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="@dimen/item_height"
+    android:background="@drawable/selector_me_menu_item_bg"
+    android:descendantFocusability="blocksDescendants"
+    android:minHeight="@dimen/item_height"
+    android:paddingLeft="15dp"
+    android:paddingRight="15dp">
+
+    <FrameLayout
+        android:id="@+id/schedule_head_area"
+        android:layout_width="57dp"
+        android:layout_height="64dp"
+        android:layout_centerVertical="true">
+
+        <ImageView
+            android:id="@+id/avatar_img"
+            android:layout_width="@dimen/item_img_height"
+            android:layout_height="@dimen/item_img_width"
+            android:layout_gravity="center_vertical"
+            android:background="@color/transparent"
+            android:contentDescription="@string/app_name"
+            android:padding="1dp"
+            android:src="@drawable/home_image_01_u" />
+
+        <TextView
+            android:id="@+id/num_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="top|right"
+            android:background="@drawable/tab_unread_bg"
+            android:gravity="center"
+            android:text="999"
+            android:textColor="@android:color/white"
+            android:textSize="10.0dip" />
+    </FrameLayout>
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_centerVertical="true"
+        android:layout_marginLeft="3dp"
+        android:layout_toRightOf="@id/schedule_head_area"
+        android:gravity="center_vertical">
+
+        <TextView
+            android:id="@+id/nick_name_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_toLeftOf="@+id/time_tv"
+            android:ellipsize="end"
+            android:text="我的审批"
+            android:textColor="@color/text_main"
+            android:textSize="16sp" />
+
+        <TextView
+            android:id="@+id/time_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:ellipsize="end"
+            android:textColor="@color/text_hine"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/content_tv"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/nick_name_tv"
+            android:layout_marginTop="8dp"
+            android:ellipsize="end"
+            android:textColor="@color/text_hine"
+            android:textSize="14sp" />
+    </RelativeLayout>
+
+</RelativeLayout>
+
+

+ 29 - 24
WeiChat/src/main/res/layout/item_works.xml

@@ -6,15 +6,16 @@
     <RelativeLayout
     <RelativeLayout
         android:id="@+id/work_context"
         android:id="@+id/work_context"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-    >
+        android:layout_height="wrap_content">
 
 
-        <View
+        <ImageView
             android:id="@+id/point"
             android:id="@+id/point"
-            android:layout_width="15dp"
-            android:layout_height="15dp"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
             android:layout_centerHorizontal="true"
             android:layout_centerHorizontal="true"
-            android:background="@drawable/signin_point" />
+            android:padding="5dp"
+            android:src="@drawable/signin_point" />
+
         <View
         <View
             android:layout_width="2px"
             android:layout_width="2px"
             android:layout_height="180dp"
             android:layout_height="180dp"
@@ -51,6 +52,7 @@
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignTop="@+id/point"
             android:layout_alignTop="@+id/point"
             android:layout_marginLeft="10dp"
             android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
             android:layout_toRightOf="@+id/point"
             android:layout_toRightOf="@+id/point"
             android:text="上班打卡 "
             android:text="上班打卡 "
             android:textColor="@color/text_hine"
             android:textColor="@color/text_hine"
@@ -92,13 +94,14 @@
             android:textSize="@dimen/text_hine"
             android:textSize="@dimen/text_hine"
             android:visibility="gone" />
             android:visibility="gone" />
 
 
-        <View
+        <ImageView
             android:id="@+id/point2"
             android:id="@+id/point2"
-            android:layout_width="15dp"
-            android:layout_height="15dp"
+            android:layout_width="25dp"
+            android:layout_height="25dp"
             android:layout_centerHorizontal="true"
             android:layout_centerHorizontal="true"
             android:layout_marginTop="90dp"
             android:layout_marginTop="90dp"
-            android:background="@drawable/signin_point" />
+            android:padding="5dp"
+            android:src="@drawable/signin_point" />
 
 
         <TextView
         <TextView
             android:id="@+id/off_time"
             android:id="@+id/off_time"
@@ -111,17 +114,6 @@
             android:textColor="@color/text_hine"
             android:textColor="@color/text_hine"
             android:textSize="@dimen/text_main" />
             android:textSize="@dimen/text_main" />
 
 
-        <TextView
-            android:id="@+id/time_tag2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignTop="@+id/point2"
-            android:layout_toLeftOf="@+id/off_time"
-            android:gravity="center"
-            android:text="下班时间   "
-            android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_main" />
-
 
 
         <TextView
         <TextView
             android:id="@+id/signin_tag2"
             android:id="@+id/signin_tag2"
@@ -138,8 +130,8 @@
             android:id="@+id/off_signin"
             android:id="@+id/off_signin"
             android:layout_width="wrap_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_alignLeft="@id/work_signin"
             android:layout_alignTop="@+id/point2"
             android:layout_alignTop="@+id/point2"
-            android:layout_toRightOf="@+id/signin_tag2"
             android:textColor="@color/text_hine"
             android:textColor="@color/text_hine"
             android:textSize="@dimen/text_main" />
             android:textSize="@dimen/text_main" />
 
 
@@ -169,14 +161,27 @@
             android:src="@drawable/btn_shensu"
             android:src="@drawable/btn_shensu"
             android:textSize="@dimen/text_hine"
             android:textSize="@dimen/text_hine"
             android:visibility="gone" />
             android:visibility="gone" />
+
+        <TextView
+            android:id="@+id/time_tag2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:text="下班时间   "
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_main"
+            android:layout_alignBaseline="@+id/off_time"
+            android:layout_alignBottom="@+id/off_time"
+            android:layout_toLeftOf="@+id/off_time"
+            android:layout_toStartOf="@+id/off_time" />
     </RelativeLayout>
     </RelativeLayout>
 
 
     <LinearLayout
     <LinearLayout
         android:id="@+id/free_context"
         android:id="@+id/free_context"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:visibility="gone"
-        android:padding="10dp">
+        android:padding="10dp"
+        android:visibility="gone">
 
 
         <View
         <View
             android:layout_width="15dp"
             android:layout_width="15dp"

+ 17 - 26
WeiChat/src/main/res/layout/new_message_header.xml

@@ -14,7 +14,7 @@
         android:minHeight="@dimen/item_height"
         android:minHeight="@dimen/item_height"
         android:paddingLeft="15dp"
         android:paddingLeft="15dp"
         android:paddingRight="15dp">
         android:paddingRight="15dp">
-        <!--android:background="@color/item_color1"-->
+
         <FrameLayout
         <FrameLayout
             android:id="@+id/schedule_head_area"
             android:id="@+id/schedule_head_area"
             android:layout_width="57dp"
             android:layout_width="57dp"
@@ -38,10 +38,9 @@
                 android:layout_gravity="top|right"
                 android:layout_gravity="top|right"
                 android:background="@drawable/tab_unread_bg"
                 android:background="@drawable/tab_unread_bg"
                 android:gravity="center"
                 android:gravity="center"
-
+                android:text="999"
                 android:textColor="@android:color/white"
                 android:textColor="@android:color/white"
-                android:textSize="10.0dip"
-                android:visibility="gone" />
+                android:textSize="10.0dip" />
         </FrameLayout>
         </FrameLayout>
 
 
         <RelativeLayout
         <RelativeLayout
@@ -59,7 +58,6 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_toLeftOf="@+id/schedule_time_tv"
                 android:layout_toLeftOf="@+id/schedule_time_tv"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:text="我的审批"
                 android:text="我的审批"
                 android:textColor="@color/text_main"
                 android:textColor="@color/text_main"
                 android:textSize="16sp" />
                 android:textSize="16sp" />
@@ -70,7 +68,6 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_alignParentRight="true"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
 
 
@@ -81,18 +78,19 @@
                 android:layout_below="@id/schedule_name_tv"
                 android:layout_below="@id/schedule_name_tv"
                 android:layout_marginTop="8dp"
                 android:layout_marginTop="8dp"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
         </RelativeLayout>
         </RelativeLayout>
 
 
     </RelativeLayout>
     </RelativeLayout>
+
     <View
     <View
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="@dimen/line"
         android:layout_height="@dimen/line"
         android:layout_marginLeft="10dp"
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:layout_marginRight="10dp"
         android:background="@color/item_line" />
         android:background="@color/item_line" />
+
     <RelativeLayout
     <RelativeLayout
         android:id="@+id/waitting_work_rl"
         android:id="@+id/waitting_work_rl"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
@@ -126,10 +124,10 @@
                 android:layout_gravity="top|right"
                 android:layout_gravity="top|right"
                 android:background="@drawable/tab_unread_bg"
                 android:background="@drawable/tab_unread_bg"
                 android:gravity="center"
                 android:gravity="center"
+                android:text="999"
                 android:textColor="@android:color/white"
                 android:textColor="@android:color/white"
                 android:textSize="10.0dip"
                 android:textSize="10.0dip"
-                android:visibility="visible"
-                android:text="999"/>
+                android:visibility="visible" />
         </FrameLayout>
         </FrameLayout>
 
 
         <RelativeLayout
         <RelativeLayout
@@ -147,7 +145,6 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_toLeftOf="@+id/waitting_work_time_tv"
                 android:layout_toLeftOf="@+id/waitting_work_time_tv"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:text="待办工作"
                 android:text="待办工作"
                 android:textColor="@color/text_main"
                 android:textColor="@color/text_main"
                 android:textSize="16sp" />
                 android:textSize="16sp" />
@@ -158,7 +155,6 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_alignParentRight="true"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
 
 
@@ -166,23 +162,25 @@
                 android:id="@+id/waitting_work_content_tv"
                 android:id="@+id/waitting_work_content_tv"
                 android:layout_width="fill_parent"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_below="@id/waitting_work_name_tv"
-                android:layout_marginTop="8dp"
+                android:layout_alignParentLeft="true"
+                android:layout_alignParentStart="true"
+                android:layout_below="@+id/waitting_work_name_tv"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
         </RelativeLayout>
         </RelativeLayout>
 
 
     </RelativeLayout>
     </RelativeLayout>
+
     <View
     <View
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="@dimen/line"
         android:layout_height="@dimen/line"
         android:layout_marginLeft="10dp"
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:layout_marginRight="10dp"
         android:background="@color/item_line" />
         android:background="@color/item_line" />
+
     <RelativeLayout
     <RelativeLayout
-        android:id="@+id/_rl"
+        android:id="@+id/subscribe_rl"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="@dimen/item_height"
         android:layout_height="@dimen/item_height"
         android:background="@drawable/selector_me_menu_item_bg"
         android:background="@drawable/selector_me_menu_item_bg"
@@ -190,15 +188,13 @@
         android:minHeight="@dimen/item_height"
         android:minHeight="@dimen/item_height"
         android:paddingLeft="15dp"
         android:paddingLeft="15dp"
         android:paddingRight="15dp">
         android:paddingRight="15dp">
-        <!--android:background="@color/item_color1"-->
+
         <FrameLayout
         <FrameLayout
             android:id="@+id/head_area"
             android:id="@+id/head_area"
             android:layout_width="57dp"
             android:layout_width="57dp"
             android:layout_height="64dp"
             android:layout_height="64dp"
             android:layout_centerVertical="true">
             android:layout_centerVertical="true">
-
             <ImageView
             <ImageView
-                android:id="@+id/avatar_img"
                 android:layout_width="@dimen/item_img_height"
                 android:layout_width="@dimen/item_img_height"
                 android:layout_height="@dimen/item_img_width"
                 android:layout_height="@dimen/item_img_width"
                 android:layout_gravity="center_vertical"
                 android:layout_gravity="center_vertical"
@@ -208,19 +204,17 @@
                 android:src="@drawable/tingyue" />
                 android:src="@drawable/tingyue" />
 
 
             <TextView
             <TextView
-                android:id="@+id/num_tv"
+                android:id="@+id/subscribe_num_tv"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="top|right"
                 android:layout_gravity="top|right"
                 android:background="@drawable/tab_unread_bg"
                 android:background="@drawable/tab_unread_bg"
                 android:gravity="center"
                 android:gravity="center"
                 android:textColor="@android:color/white"
                 android:textColor="@android:color/white"
-                android:textSize="10.0dip"
-                android:visibility="gone" />
+                android:textSize="10.0dip" />
         </FrameLayout>
         </FrameLayout>
 
 
         <RelativeLayout
         <RelativeLayout
-            android:id="@+id/content"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_height="match_parent"
             android:layout_centerVertical="true"
             android:layout_centerVertical="true"
@@ -234,7 +228,6 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_toLeftOf="@+id/time_tv"
                 android:layout_toLeftOf="@+id/time_tv"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:text="我的订阅"
                 android:text="我的订阅"
                 android:textColor="@color/text_main"
                 android:textColor="@color/text_main"
                 android:textSize="16sp" />
                 android:textSize="16sp" />
@@ -245,18 +238,16 @@
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_alignParentRight="true"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
 
 
             <TextView
             <TextView
-                android:id="@+id/content_tv"
+                android:id="@+id/subscribe_content_tv"
                 android:layout_width="fill_parent"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_below="@id/nick_name_tv"
                 android:layout_below="@id/nick_name_tv"
                 android:layout_marginTop="8dp"
                 android:layout_marginTop="8dp"
                 android:ellipsize="end"
                 android:ellipsize="end"
-                android:singleLine="true"
                 android:textColor="@color/text_hine"
                 android:textColor="@color/text_hine"
                 android:textSize="14sp" />
                 android:textSize="14sp" />
         </RelativeLayout>
         </RelativeLayout>