Просмотр исходного кода

工作日报界面一完成1 备份

FANGLH 9 лет назад
Родитель
Сommit
463085b19d

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

@@ -2,8 +2,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     package="com.xzjmyk.pm.activity"
-    android:versionCode="69"
-    android:versionName="5.5.5">
+    android:versionCode="70"
+    android:versionName="5.5.6.0">
 
     <uses-sdk
         android:minSdkVersion="11"

+ 384 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/adapter/WorkDailyPaperAdapter.java

@@ -0,0 +1,384 @@
+package com.xzjmyk.pm.activity.adapter;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.text.SpannableStringBuilder;
+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.LinearLayout;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.xzjmyk.pm.activity.MyApplication;
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.User;
+import com.xzjmyk.pm.activity.bean.circle.Comment;
+import com.xzjmyk.pm.activity.bean.circle.Praise;
+import com.xzjmyk.pm.activity.bean.circle.PublicMessage;
+import com.xzjmyk.pm.activity.helper.AvatarHelper;
+import com.xzjmyk.pm.activity.ui.base.BaseActivity;
+import com.xzjmyk.pm.activity.util.HtmlUtils;
+import com.xzjmyk.pm.activity.util.LinkMovementClickMethod;
+import com.xzjmyk.pm.activity.util.StringUtils;
+import com.xzjmyk.pm.activity.util.TimeUtils;
+import com.xzjmyk.pm.activity.util.ToastUtil;
+import com.xzjmyk.pm.activity.view.MyListView;
+import com.xzjmyk.pm.activity.volley.ObjectResult;
+import com.xzjmyk.pm.activity.volley.Result;
+import com.xzjmyk.pm.activity.volley.StringJsonObjectRequest;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * Created by FANGlh on 2016/11/1.
+ */
+public class WorkDailyPaperAdapter extends BaseAdapter{
+    private static final int PRAISE_WHAT = 0x11;
+    private User user;
+    private List<PublicMessage> messages;
+    private Context context;
+    private CommentAdapter mAdapter;
+    private int pon;//点赞的对象
+    private Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            String message = msg.getData().getString("result");
+            switch (msg.what) {
+                case PRAISE_WHAT:
+                    JSONObject json = JSON.parseObject(message);
+                    if (json.getIntValue("resultCode") != 1) return;
+                    if (json.getString("data") == null) {//为取消点赞
+                        messages.get(pon).setIsPraise(0);
+                        messages.get(pon).setPraise(messages.get(pon).getPraise() - 1);
+                        List<Praise> praises = messages.get(pon).getPraises();
+                        for (int i = 0; i < praises.size(); i++) {
+                            if (praises.get(i).getUserId().equals(MyApplication.getInstance().mLoginUser.getUserId())) {
+                                praises.remove(i);
+                                break;
+                            }
+                        }
+                    } else {//点赞
+                        messages.get(pon).setIsPraise(1);
+                        Praise bean = new Praise();
+                        bean.setNickName(MyApplication.getInstance().mLoginUser.getNickName());
+                        bean.setUserId(MyApplication.getInstance().mLoginUser.getUserId());
+                        bean.setPraiseId(json.getString("data"));
+                        messages.get(pon).getPraises().add(0, bean);
+                        messages.get(pon).setPraise(messages.get(pon).getPraise() + 1);
+                    }
+                    notifyDataSetChanged();
+                    break;
+            }
+
+        }
+    };
+
+    public WorkDailyPaperAdapter(Context context, List<PublicMessage> messages) {
+        this.context = context;
+        this.messages = messages;
+        this.user = MyApplication.getInstance().mLoginUser;
+    }
+
+    public void setData(List<PublicMessage> messages) {
+        this.messages = messages;
+    }
+
+
+    @Override
+    public int getCount() {
+        return messages == null ? 0 : messages.size();
+    }
+
+    @Override
+    public Object getItem(int i) {
+        return messages.get(i);
+    }
+
+    @Override
+    public long getItemId(int i) {
+        return i;
+    }
+
+    @Override
+    public View getView(int i, View view, ViewGroup viewGroup) {
+        ViewHolder holder;
+        if (view == null) {
+            holder = new ViewHolder();
+            view = LayoutInflater.from(context).inflate(R.layout.item_activity_worklogs, null);
+            holder.avatar_img = (ImageView) view.findViewById(R.id.avatar_img);
+            holder.comment_tag = (LinearLayout) view.findViewById(R.id.comment_tag);
+            holder.name_tv = (TextView) view.findViewById(R.id.name_tv);
+            holder.content_tv = (TextView) view.findViewById(R.id.content_tv);
+            holder.time_tv = (TextView) view.findViewById(R.id.time_tv);
+            holder.like_tv = (TextView) view.findViewById(R.id.like_tv);
+            holder.command_tv = (TextView) view.findViewById(R.id.command_tv);
+            holder.command_lv = (MyListView) view.findViewById(R.id.command_lv);
+            view.setTag(holder);
+        } else {
+            holder = (ViewHolder) view.getTag();
+        }
+        bindData(holder, i);
+        return view;
+    }
+
+    private PublicMessage.Body body;//临时变量
+
+    private void bindData(ViewHolder holder, final int i) {
+        final PublicMessage message = messages.get(i);
+        holder.name_tv.setText(message.getNickName());//名字
+        AvatarHelper.getInstance().displayAvatar(message.getUserId(), holder.avatar_img, false);//头像设置
+        holder.time_tv.setText(TimeUtils.getFriendlyTimeDesc(context, (int) message.getTime()));//时间设置
+        body = message.getBody();
+        String text;
+        if (body == null || body.getText() == null) text = "";
+        else text = body.getText();
+        holder.content_tv.setText(text);
+        final List<Comment> comments = message.getComments();
+        holder.like_tv.setText(message.getPraise() + "");
+        final boolean isPraise = message.getIsPraise() != 1;
+        holder.command_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                if (listener == null) return;
+                listener.onClick(i, message.getMessageId(), message.getUserId(), message.getNickName());
+            }
+        });
+        holder.like_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                praiseOrCancle(i, isPraise);
+            }
+        });
+        if (comments == null || comments.size() <= 0) {
+            holder.comment_tag.setVisibility(View.GONE);
+        } else {
+            holder.comment_tag.setVisibility(View.VISIBLE);
+        }
+        holder.command_tv.setText(comments.size() + "");
+        mAdapter = new CommentAdapter(comments);
+        holder.command_lv.setAdapter(mAdapter);
+    }
+
+    class ViewHolder {
+        ImageView avatar_img; //头像
+        TextView name_tv,//名字
+                content_tv,//内容
+                time_tv, //发表时间
+                like_tv, //点赞按钮
+                command_tv;//评论
+        MyListView command_lv;
+        LinearLayout comment_tag;
+    }
+
+
+    //评论适配器
+    public class CommentAdapter extends BaseAdapter {
+        private int messagePosition;
+        private List<Comment> datas;
+
+        public CommentAdapter(int messagePosition, List<Comment> datas) {
+            this.messagePosition = messagePosition;
+            this.datas = datas;
+        }
+
+        public CommentAdapter(List<Comment> datas) {
+            this.datas = datas;
+        }
+
+        @Override
+        public int getCount() {
+            return datas.size();
+        }
+
+        @Override
+        public Object getItem(int position) {
+            return position;
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        @Override
+        public View getView(final int position, View convertView, ViewGroup parent) {
+            ViewHolder holder = null;
+            if (convertView == null) {
+                holder = new ViewHolder();
+                convertView = LayoutInflater.from(context).inflate(R.layout.p_msg_comment_list_item, null);
+                holder.text_view = (TextView) convertView.findViewById(R.id.text_view);
+                convertView.setTag(holder);
+            } else {
+                holder = (ViewHolder) convertView.getTag();
+            }
+            final Comment comment = datas.get(position);
+            SpannableStringBuilder builder = new SpannableStringBuilder();
+            String showName = comment.getNickName();
+            UserClickableSpan.setClickableSpan(context, builder, showName, comment.getUserId());// 设置评论者的ClickSpanned
+            if (!TextUtils.isEmpty(comment.getToUserId()) && !TextUtils.isEmpty(comment.getToNickname())) {
+                builder.append(context.getString(R.string.replay));
+                String toShowName = comment.getToNickname();
+                UserClickableSpan.setClickableSpan(context, builder, toShowName, comment.getToUserId());// 设置被评论者的ClickSpanned
+            }
+
+            builder.append(":");
+            // 设置评论内容
+            String commentBody = comment.getBody();
+            if (!TextUtils.isEmpty(commentBody)) {
+                commentBody = StringUtils.replaceSpecialChar(comment.getBody());
+                CharSequence charSequence = HtmlUtils.transform200SpanString(commentBody.replaceAll("\n", "\r\n"),
+                        true);
+                builder.append(charSequence);
+            }
+            holder.text_view.setText(builder);
+            holder.text_view.setLinksClickable(true);
+            holder.text_view.setMovementMethod(LinkMovementClickMethod.getInstance());
+            holder.text_view.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    //点击操作
+//                    if (comment.getUserId().equals(mLoginUserId)) {// 如果消息是我发的,那么就弹出删除和复制的对话框
+//                        showCommentLongClickDialog(messagePosition, position, CommentAdapter.this);
+//                    } else {// 弹出回复的框
+//                        String toShowName = getShowName(comment.getUserId(), comment.getNickName());
+//                        // 懒得写回调的,直接强转,以后如果不适用,可以写个接口回调
+//                        if (context instanceof BusinessCircleActivity) {
+//                            ((BusinessCircleActivity) mContext).showCommentEnterView(messagePosition,
+//                                    comment.getUserId(), comment.getNickName(), toShowName);
+//
+//                        } else {
+//                            ((MainActivity) context).getBusinessCircleFragment().showCommentEnterView(messagePosition,
+//                                    comment.getUserId(), comment.getNickName(), toShowName);
+//                        }
+//                    }
+                }
+            });
+            holder.text_view.setOnLongClickListener(new View.OnLongClickListener() {
+                @Override
+                public boolean onLongClick(View v) {
+
+                    return true;
+                }
+            });
+
+            return convertView;
+        }
+
+        class ViewHolder {
+            TextView text_view;
+        }
+    }
+
+
+    private ButtonViewListener listener;
+
+    public void setButtonViewListener(ButtonViewListener listener) {
+        this.listener = listener;
+    }
+
+    public interface ButtonViewListener {
+        void onClick(int i, String messageId, String userId, String nickName);
+    }
+
+
+    /**
+     * 赞或者取消赞
+     *
+     * @param
+     * @param isPraise
+     */
+//    private void praiseOrCancle(final int position, final boolean isPraise) {
+//        pon = position;
+//        //参数
+//        final PublicMessage message = messages.get(position);
+//        String requestUrl = null;
+//        if (isPraise) {
+//            requestUrl = MyApplication.getInstance().getConfig().MSG_PRAISE_ADD;
+//        } else {
+//            requestUrl = MyApplication.getInstance().getConfig().MSG_PRAISE_DELETE;
+//        }
+//        HashMap<String, Object> params = new HashMap<>();
+//        params.put("access_token", MyApplication.getInstance().mAccessToken);
+//        params.put("messageId", message.getMessageId());
+//        ViewUtil.httpSendRequest(context, requestUrl, params, handler, null, PRAISE_WHAT, null, null, "get");
+//    }
+
+    /**
+     * 赞或者取消赞
+     *
+     * @param
+     * @param isPraise
+     */
+    private void praiseOrCancle(final int position, final boolean isPraise) {
+        pon = position;
+        final PublicMessage message = messages.get(position);
+        if (message == null) {
+            return;
+        }
+
+        HashMap<String, String> params = new HashMap<String, String>();
+        params.put("access_token", MyApplication.getInstance().mAccessToken);
+        params.put("messageId", message.getMessageId());
+        String requestUrl = null;
+        if (isPraise) {
+            requestUrl = MyApplication.getInstance().getConfig().MSG_PRAISE_ADD;
+        } else {
+            requestUrl = MyApplication.getInstance().getConfig().MSG_PRAISE_DELETE;
+        }
+
+        StringJsonObjectRequest<Void> request = new StringJsonObjectRequest<Void>(requestUrl, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError arg0) {
+                ToastUtil.showErrorNet(context);
+            }
+        }, new StringJsonObjectRequest.Listener<Void>() {
+
+            @Override
+            public void onResponse(ObjectResult<Void> result) {
+                boolean success = Result.defaultParser(context, result, true);
+                if (success) {
+                    message.setIsPraise(isPraise ? 1 : 0);
+                    List<Praise> praises = message.getPraises();
+                    if (praises == null) {
+                        praises = new ArrayList<Praise>();
+                        message.setPraises(praises);
+                    }
+                    int praiseCount = message.getPraise();
+                    if (isPraise) {// 代表我点赞
+                        // 消息实体的改变
+                        Praise praise = new Praise();
+                        praise.setUserId(MyApplication.getInstance().mLoginUser.getUserId());
+                        praise.setNickName(MyApplication.getInstance().mLoginUser.getNickName());
+                        praises.add(0, praise);
+                        praiseCount++;
+                        message.setPraise(praiseCount);
+                    } else {// 取消我的赞
+                        // 消息实体的改变
+                        for (int i = 0; i < praises.size(); i++) {
+                            if (MyApplication.getInstance().mLoginUser.getUserId().equals(praises.get(i).getUserId())) {
+                                praises.remove(i);
+                                praiseCount--;
+                                message.setPraise(praiseCount);
+                                break;
+                            }
+                        }
+                    }
+                    notifyDataSetChanged();
+                }
+            }
+        }, Void.class, params);
+        ((BaseActivity) context).addDefaultRequest(request);
+    }
+
+}
+

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/bean/circle/PublicMessage.java

@@ -19,7 +19,7 @@ import java.util.List;
 public class PublicMessage implements Serializable {
     private static final long serialVersionUID = -2853687308018351618L;
 
-    public static class Resource implements Serializable {
+    public static class Resource implements Serializable{
         private static final long serialVersionUID = 1665607875044805022L;
 
         @JSONField(name = "oUrl")

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

@@ -93,7 +93,7 @@ public class AddLogActivity extends BaseActivity{
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.menu_push, menu);
+        getMenuInflater().inflate(R.menu.menu_list, menu);
         return super.onCreateOptionsMenu(menu);
     }
 

+ 4 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/WorkLogsActivity.java

@@ -16,7 +16,7 @@ import com.handmark.pulltorefresh.library.PullToRefreshBase;
 import com.handmark.pulltorefresh.library.PullToRefreshListView;
 import com.xzjmyk.pm.activity.MyApplication;
 import com.xzjmyk.pm.activity.R;
-import com.xzjmyk.pm.activity.adapter.WorkLogAdapter;
+import com.xzjmyk.pm.activity.adapter.WorkDailyPaperAdapter;
 import com.xzjmyk.pm.activity.bean.circle.Comment;
 import com.xzjmyk.pm.activity.bean.circle.PublicMessage;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
@@ -49,7 +49,7 @@ public class WorkLogsActivity extends BaseActivity {
     private CommentItemChche itemChche;
     private static int requestCode = 0x21;
     public static int resultCode = 0x22;
-    private WorkLogAdapter mAdapter;
+    private WorkDailyPaperAdapter mAdapter;
     private ClearEditText search_edit;
     private PullToRefreshListView context_rv;
 
@@ -164,7 +164,7 @@ public class WorkLogsActivity extends BaseActivity {
                 requestMyBusiness(false);
             }
         });
-        mAdapter.setButtonViewListener(new WorkLogAdapter.ButtonViewListener() {
+        mAdapter.setButtonViewListener(new WorkDailyPaperAdapter.ButtonViewListener() {
             @Override
             public void onClick(int i, String messageId, String toUserId, String toName) {
                 if (itemChche == null)
@@ -184,7 +184,7 @@ public class WorkLogsActivity extends BaseActivity {
         search_edit = (ClearEditText) findViewById(R.id.search_edit);
         context_rv = (PullToRefreshListView) findViewById(R.id.context_rv);
         context_rv.setMode(PullToRefreshBase.Mode.BOTH);
-        mAdapter = new WorkLogAdapter(ct, showMag);
+        mAdapter = new WorkDailyPaperAdapter(ct, showMag);
         context_rv.setAdapter(mAdapter);
         initData();
     }

+ 3 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/SigninFragment.java

@@ -265,13 +265,13 @@ public class SigninFragment extends EasyFragment implements View.OnClickListener
                         Crouton.makeText(ct, "当前网络不可用,请检查网络连接");
                         return;
                     }
-                   /* if (isMacInNet) {
+                   if (isMacInNet) {
                         validatorMac();
                     } else {
                         showFristMac();
-                    }*/
+                    }
+
 
-                    validatorMac();
                 }
                 break;
             case R.id.title:

BIN
WeiChat/src/main/res/drawable-hdpi/general_submit.png


+ 152 - 127
WeiChat/src/main/res/layout/activity_add_log.xml

@@ -1,128 +1,165 @@
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.oa.AddLogActivity">
-<LinearLayout
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:whatever="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@drawable/bg_main"
     android:orientation="vertical">
-                <LinearLayout
+
+    <com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:fillViewport="true">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:id="@+id/ly_head_display"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+
+                <View
                     android:layout_width="match_parent"
-                    android:layout_height="50dp"
-                    android:orientation="horizontal"
-                    android:visibility="gone">
+                    android:layout_height="@dimen/line"
+                    android:layout_marginTop="8dp"
+                    android:background="@color/item_line" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="18sp"
+                    android:text="工作总结"
+                    android:paddingLeft="20dp"
+                    android:layout_marginTop="1dp"
+                    />
+                <com.andreabaccega.widget.FormEditText
+                    android:id="@+id/sum_tv"
+                    style="@style/form_relative_right_text"
+                    android:hint="请输入今日工作总结(必填)"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginTop="1dp"
+                    android:gravity="top"
+                    android:minHeight="120dp"
+                    android:maxHeight="300dp"
+                    android:padding="5dp"
+                    />
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/line"
+                    android:background="@color/item_line" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textSize="18sp"
+                    android:text="工作计划"
+                    android:paddingLeft="20dp"
+                    android:layout_marginTop="1dp"/>
+                <com.andreabaccega.widget.FormEditText
+                    android:id="@+id/plan_tv"
+                    style="@style/form_relative_right_text"
+                    android:layout_marginLeft="20dp"
+                    android:gravity="top"
+                    android:hint="请输入明日工作计划(非必填)"
+                    android:layout_marginTop="1dp"
+                    android:minHeight="120dp"
+                    android:maxHeight="300dp"
+                    android:padding="5dp" />
 
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/line"
+                    android:background="@color/item_line" />
+
+                <RelativeLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    >
                     <TextView
                         android:layout_width="wrap_content"
-                        android:layout_height="match_parent"
-                        android:layout_marginLeft="10dp"
-                        android:gravity="center_vertical"
-                        android:text="日志类型"
-                        android:textColor="@color/text_main"
-                        android:textSize="@dimen/text_main" />
+                        android:layout_height="wrap_content"
+                        android:text="工作心得"
+                        android:paddingLeft="20dp"
+                        android:layout_marginTop="1dp"
+                        android:textSize="18sp"
+                        />
+                    <ImageButton
+                        android:id="@+id/im_Experience_sharing"
+                        android:layout_width="40dp"
+                        android:layout_height="40dp"
+                        android:src="@drawable/icon_app_share"
+                        android:layout_alignParentRight="true"
+                        android:layout_marginTop="1dp"
+                        android:layout_marginRight="20dp"
+                        />
+                </RelativeLayout>
+                <com.andreabaccega.widget.FormEditText
+                    android:id="@+id/learned_tv"
+                    style="@style/form_relative_right_text"
+                    android:layout_marginLeft="20dp"
+                    android:gravity="top"
+                    android:hint="点击分享按钮可将工作心得分享到工作圈(非必填)"
+                    android:minHeight="120dp"
+                    android:maxHeight="300dp"
+                    android:layout_marginTop="1dp"
+                    android:padding="5dp" />
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="@dimen/line"
+                    android:background="@color/item_line" />
+            </LinearLayout>
 
-                    <TextView
-                        android:id="@+id/type_tv"
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:layout_marginLeft="20dp"
-                        android:drawableRight="@drawable/oa_next"
-                        android:gravity="center_vertical"
-                        android:textColor="@color/text_main"
-                        android:textSize="@dimen/text_main" />
-                </LinearLayout>
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="18sp"
-        android:text="工作总结"
-        android:paddingLeft="10dp"
-        android:layout_marginTop="8dp"
-        />
-    <EditText
-        android:id="@+id/sum_tv"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@null"
-        android:gravity="left|start"
-        android:hint="请输入今日工作总结(必填)"
-        android:minLines="5"
-        android:paddingLeft="10dp"
-        android:textColor="@color/text_hine"
-        android:textSize="15sp"
-        android:layout_marginTop="8dp"/>
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="18sp"
-        android:text="工作计划"
-        android:paddingLeft="10dp"
-        android:layout_marginTop="8dp"
-        />
-    <EditText
-        android:id="@+id/plan_tv"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@null"
-        android:gravity="left|start"
-        android:hint="请输入明日工作计划(非必填)"
-        android:minLines="5"
-        android:paddingLeft="10dp"
-        android:textColor="@color/text_hine"
-        android:textSize="15sp" />
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2px"
-        android:background="@color/item_line" />
-
-   <RelativeLayout
-       android:layout_width="wrap_content"
-       android:layout_height="wrap_content"
-      >
-
-       <TextView
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:text="工作心得"
-           android:paddingLeft="10dp"
-           android:layout_marginTop="8dp"
-           android:textSize="18sp"
-           />
-       <ImageButton
-           android:id="@+id/im_Experience_sharing"
-           android:layout_width="wrap_content"
-           android:layout_height="wrap_content"
-           android:src="@drawable/icon_app_share"
-           android:layout_alignParentRight="true"
-           />
-
-   </RelativeLayout>
-    <EditText
-        android:id="@+id/learned_tv"
+
+        </LinearLayout>
+    </com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView>
+
+    <LinearLayout
+        android:id="@+id/ly_bottom_submit"
+        style="@style/form_linear_customer">
+
+        <Button
+            android:id="@+id/btn_Daily_submitted"
+            style="@style/from_button_base_bule"
+            android:layout_marginTop="10dp"
+            android:textSize="20sp"
+            android:text="提    交" />
+    </LinearLayout>
+
+    <include layout="@layout/item_work_view" />
+
+
+
+    <!--gone-->
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@null"
-        android:gravity="left|start"
-        android:hint="点击分享按钮可将工作心得分享到工作圈(非必填)"
-        android:minLines="5"
-        android:paddingLeft="10dp"
-        android:textColor="@color/text_hine"
-        android:textSize="15sp" />
+        android:layout_height="50dp"
+        android:orientation="horizontal"
+        android:visibility="gone">
 
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="10dp"
+            android:gravity="center_vertical"
+            android:text="日志类型"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+        <TextView
+            android:id="@+id/type_tv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="20dp"
+            android:drawableRight="@drawable/oa_next"
+            android:gravity="center_vertical"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+    </LinearLayout>
     <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -133,16 +170,4 @@
         android:textColor="@color/text_main"
         android:textSize="@dimen/text_main"
         android:visibility="gone" />
-
-
-    <Button
-        android:id="@+id/btn_Daily_submitted"
-        android:layout_width="250dp"
-        android:layout_height="50dp"
-        style="@style/BlueButtonStyle"
-        android:layout_gravity="center_horizontal"
-        android:textSize="20sp"
-        android:layout_marginTop="70dp"
-        android:text="提    交"/>
-</LinearLayout>
-</ScrollView>
+</LinearLayout>

+ 97 - 44
WeiChat/src/main/res/layout/item_activity_worklogs.xml

@@ -1,50 +1,108 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/item_color2"
     android:orientation="vertical"
-    android:padding="10dp">
+    >
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="5dp">
 
-    <ImageView
-        android:id="@+id/avatar_img"
-        android:layout_width="40dp"
-        android:layout_height="40dp"
-        android:background="@drawable/avatar_normal"
-        android:contentDescription="@string/app_name"
-        android:scaleType="fitXY" />
+        <ImageView
+            android:id="@+id/avatar_img"
+            android:layout_width="40dp"
+            android:layout_height="40dp"
+            android:background="@drawable/avatar_normal"
+            android:contentDescription="@string/app_name"
+            android:layout_marginLeft="10dp" />
 
-    <TextView
-        android:id="@+id/name_tv"
+        <TextView
+            android:id="@+id/name_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:layout_toRightOf="@+id/avatar_img"
+            android:text="方龙海"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_main" />
+
+        <TextView
+            android:id="@+id/time_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignLeft="@+id/name_tv"
+            android:layout_below="@+id/name_tv"
+            android:layout_marginTop="5dp"
+            android:gravity="left|top"
+            android:text="1月12日 19:40"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_min" />
+    </RelativeLayout>
+    <View
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
         android:layout_marginLeft="10dp"
-        android:layout_toRightOf="@+id/avatar_img"
-        android:text="周建伟"
-        android:textColor="@color/text_main"
-        android:textSize="@dimen/text_main" />
-
-    <TextView
-        android:id="@+id/time_tv"
+        android:layout_marginRight="10dp"
+        android:layout_height="1dp"
+        android:background="#FBFAFA"
+        android:layout_marginTop="2dp"/>
+    <RelativeLayout
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignLeft="@+id/name_tv"
-        android:layout_below="@+id/name_tv"
-        android:layout_marginTop="5dp"
-        android:gravity="left|top"
-        android:text="1月12日 19:40"
-        android:textColor="@color/text_hine"
-        android:textSize="@dimen/text_min" />
-
+        >
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="工作总结"
+            android:layout_marginLeft="10dp"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_main"/>
+        <TextView
+            android:id="@+id/tv_Pending_approval"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="待审批"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="20dp"
+            android:textColor="@color/red"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_main"/>
+    </RelativeLayout>
     <TextView
         android:id="@+id/content_tv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_below="@+id/avatar_img"
-        android:layout_marginTop="10dp"
+        android:layout_marginTop="0dp"
         android:layout_toRightOf="@id/avatar_img"
-        android:minLines="3" />
+        android:minLines="3"
+        android:maxLines="6"
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
+        android:textSize="@dimen/text_hine"
+        />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#EBE9E9"
+        android:layout_marginTop="2dp"/>
+
+
+
+
+
+
+
+
+
 
+
+
+
+    <!--以下布局被gone-->
     <RelativeLayout
         android:id="@+id/client_tag_rl"
         android:layout_width="match_parent"
@@ -79,15 +137,14 @@
             android:textSize="@dimen/text_hine" />
 
     </RelativeLayout>
-
-
     <LinearLayout
         android:id="@+id/comment_tag"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@+id/client_tag_rl"
         android:layout_marginTop="5dp"
-        android:orientation="vertical">
+        android:orientation="vertical"
+        android:visibility="gone">
 
         <TextView
             android:layout_width="wrap_content"
@@ -97,27 +154,23 @@
             android:maxLines="1"
             android:text="以下为直属领导的点评:"
             android:textColor="@color/text_hine"
-            android:textSize="@dimen/text_hine" />
+            android:textSize="@dimen/text_hine"
+            />
 
         <com.xzjmyk.pm.activity.view.MyListView
             android:id="@+id/command_lv"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
+            android:layout_height="wrap_content"
+            />
     </LinearLayout>
-
-    <!--<View-->
-        <!--android:layout_width="match_parent"-->
-        <!--android:layout_height="2px"-->
-        <!--android:layout_below="@+id/comment_tag"-->
-        <!--android:background="@color/item_line" />-->
-
     <RelativeLayout
         android:id="@+id/operate_tag"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@+id/comment_tag"
         android:layout_centerHorizontal="true"
-        android:layout_marginTop="10dp">
+        android:layout_marginTop="10dp"
+        android:visibility="gone">
 
         <TextView
             android:id="@+id/like_tv"
@@ -141,4 +194,4 @@
     </RelativeLayout>
 
 
-</RelativeLayout>
+</LinearLayout>

+ 197 - 0
WeiChat/src/main/res/layout/item_activity_worklogs2.xml

@@ -0,0 +1,197 @@
+<?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="@color/item_color2"
+    android:orientation="vertical"
+    >
+<RelativeLayout
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginTop="5dp">
+
+    <ImageView
+        android:id="@+id/avatar_img"
+        android:layout_width="40dp"
+        android:layout_height="40dp"
+        android:background="@drawable/avatar_normal"
+        android:contentDescription="@string/app_name"
+        android:layout_marginLeft="10dp" />
+
+    <TextView
+        android:id="@+id/name_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_toRightOf="@+id/avatar_img"
+        android:text="方龙海"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/time_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/name_tv"
+        android:layout_below="@+id/name_tv"
+        android:layout_marginTop="5dp"
+        android:gravity="left|top"
+        android:text="1月12日 19:40"
+        android:textColor="@color/text_hine"
+        android:textSize="@dimen/text_min" />
+</RelativeLayout>
+    <View
+        android:layout_width="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:layout_height="1dp"
+        android:background="#FBFAFA"
+        android:layout_marginTop="2dp"/>
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        >
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="工作总结"
+        android:layout_marginLeft="10dp"
+        android:layout_marginTop="5dp"
+        android:layout_marginBottom="0dp"
+        android:textSize="@dimen/text_main"/>
+        <TextView
+            android:id="@+id/tv_Pending_approval"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="待审批"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="20dp"
+            android:textColor="@color/red"
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="0dp"
+            android:textSize="@dimen/text_main"/>
+    </RelativeLayout>
+    <TextView
+        android:id="@+id/content_tv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="0dp"
+        android:layout_toRightOf="@id/avatar_img"
+        android:minLines="3"
+        android:maxLines="6"
+        android:layout_marginLeft="15dp"
+        android:layout_marginRight="15dp"
+        android:textSize="@dimen/text_hine"
+        />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="#EBE9E9"
+        android:layout_marginTop="2dp"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+    <!--以下布局被gone-->
+                    <RelativeLayout
+                        android:id="@+id/client_tag_rl"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_below="@+id/content_tv"
+                        android:layout_marginTop="20dp"
+                        android:background="@color/item_color1"
+                        android:gravity="center_vertical"
+                        android:padding="5dp"
+                        android:visibility="gone">
+
+                        <TextView
+                            android:id="@+id/client_tag_tv"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:drawableLeft="@drawable/oa_client"
+                            android:gravity="center_vertical"
+                            android:text="关联客户(3):"
+                            android:textColor="@color/text_hine"
+                            android:textSize="@dimen/text_hine" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_alignTop="@+id/client_tag_tv"
+                            android:layout_marginLeft="3dp"
+                            android:layout_marginTop="3dp"
+                            android:layout_toRightOf="@+id/client_tag_tv"
+                            android:maxLines="1"
+                            android:text="背景灌灌灌灌灌灌灌灌"
+                            android:textColor="@color/text_hine"
+                            android:textSize="@dimen/text_hine" />
+
+                    </RelativeLayout>
+    <LinearLayout
+        android:id="@+id/comment_tag"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/client_tag_rl"
+        android:layout_marginTop="5dp"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableLeft="@drawable/oa_rb_pass"
+            android:gravity="center_vertical"
+            android:maxLines="1"
+            android:text="以下为直属领导的点评:"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_hine"
+            />
+
+        <com.xzjmyk.pm.activity.view.MyListView
+            android:id="@+id/command_lv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            />
+    </LinearLayout>
+    <RelativeLayout
+        android:id="@+id/operate_tag"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/comment_tag"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="10dp"
+        android:visibility="gone">
+
+        <TextView
+            android:id="@+id/like_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="50dp"
+            android:drawableLeft="@drawable/likes"
+            android:gravity="center"
+            android:padding="10dp"
+            android:text="0" />
+
+        <TextView
+            android:id="@+id/command_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="50dp"
+            android:drawableLeft="@drawable/operate_more"
+            android:padding="10dp"
+            android:text="0" />
+    </RelativeLayout>
+
+
+</LinearLayout>

+ 12 - 0
WeiChat/src/main/res/menu/menu_list.xml

@@ -0,0 +1,12 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="com.xzjmyk.pm.activity.MainActivity">
+
+    <item
+        android:id="@+id/push"
+        android:title="提交"
+        android:icon="@drawable/xlist"
+        app:showAsAction="ifRoom" />
+
+</menu>

+ 0 - 1
WeiChat/src/main/res/menu/menu_push.xml

@@ -6,7 +6,6 @@
     <item
         android:id="@+id/push"
         android:title="提交"
-        android:icon="@drawable/xlist"
         app:showAsAction="ifRoom" />
 
 </menu>

+ 1 - 1
WeiChat/src/main/res/values/styles.xml

@@ -309,7 +309,7 @@
 
     <style name="form_relative_right_text">
         <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_height">match_parent</item>
         <item name="android:layout_centerVertical">true</item>
         <item name="android:layout_alignParentRight">true</item>
         <item name="android:layout_marginRight">20dp</item>