Kaynağa Gözat

Merge branch 'developer_master' of https://gitlab.com/Arisono/SkWeiChat-Baidu into developer_master

gongpm 9 yıl önce
ebeveyn
işleme
52c86357e8

+ 1 - 5
WeiChat/build.gradle

@@ -34,13 +34,10 @@ dependencies {
     compile project(':libedittextformlibrary')
     compile project(':libfloatingactionbutton')
     compile project(':libpsectionlistview')
-
-
     compile 'com.android.support:support-v4:22.2.0'
     compile 'com.android.support:appcompat-v7:22.2.0'
-
     compile 'com.commit451:PhotoView:1.2.5'
-
+    compile 'me.gujun.android.taggroup:library:1.4@aar'
     compile files('libs/android-async-http-1.4.5.jar')
     compile files('libs/asmack.jar')
     compile files('libs/BaiduLBS_Android.jar')
@@ -55,7 +52,6 @@ dependencies {
     compile files('libs/universal-image-loader-1.9.0.jar')
     compile files('libs/volley.jar')
     compile files('libs/pushservice-4.5.5.77.jar')
-
     compile files('libs/xutils.jar')
     compile files('libs/flexjson-2.1.jar')
 }

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

@@ -104,7 +104,9 @@
         <activity android:name=".ui.erp.activity.QueryActivity" />
         <activity android:name=".ui.erp.activity.ErpMenActivity" />
         <activity android:name=".ui.erp.activity.DbfindListActivity" />
-        <activity android:name=".ui.erp.activity.AddTaskActivity" />
+        <activity android:name=".ui.erp.activity.AddTaskActivity"
+            android:windowSoftInputMode="adjustUnspecified|stateHidden"
+            android:configChanges="orientation|keyboardHidden"/>
         <activity android:name=".ui.erp.activity.WebViewCommActivity" />
 
         <activity

+ 28 - 8
WeiChat/src/main/java/com/sk/weichat/ui/erp/activity/AddTaskActivity.java

@@ -53,6 +53,7 @@ import com.sk.weichat.ui.erp.util.RecordUtil;
 import com.sk.weichat.ui.erp.util.StringUtils;
 import com.sk.weichat.ui.erp.view.DateTimePickerDialog;
 import com.sk.weichat.ui.erp.view.SwitchView;
+import com.sk.weichat.view.TagGroup;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -76,7 +77,8 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
     @ViewInject(R.id.et_task_remark)
     private EditText et_task_remark;
     @ViewInject(R.id.et_task_people)
-    private EditText et_task_people;
+    private TagGroup et_task_people;
+
     @ViewInject(R.id.cb_task_reply)
     private SwitchView cb_task_reply;
     @ViewInject(R.id.et_task_startime)
@@ -211,6 +213,9 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
                     String id = msg.getData().getString("id");
                     saveTask(id);
                     break;
+                case Constants.APP_SOCKETIMEOUTEXCEPTION:
+                    ViewUtil.ToastMessage(ct,msg.getData().getString("result"));
+                    break;
                 default:
                     break;
             }
@@ -251,8 +256,9 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
                 return false;
             }
         });
-        et_task_people.setText(people);
+        et_task_people.setTags(people);
         et_task_people.setOnKeyListener(null);
+        et_task_people.setIsAppendMode(true);
         iv_find.setOnClickListener(this);
         bt_voice_play.setOnClickListener(this);
         bt_recode.setOnTouchListener(new VoiceTouchListen());
@@ -329,14 +335,14 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
                 break;
             case R.id.bt_task_add:
                 if (!StringUtils.isEmpty(et_task_startime.getText().toString())
-                        && !StringUtils.isEmpty(et_task_people.getText().toString())
+                        && et_task_people.getTags().length>0
                         && !StringUtils.isEmpty(et_task_remark.getText().toString())) {
                     boolean falg = ViewUtil.isCheckDateTime(
                             CommonUtil.getStringDate(System.currentTimeMillis()),
                             et_task_startime.getText().toString(), "yyyy-MM-dd HH:mm:ss");
                     if (et_task_remark.getText().toString().length() <= 200) {
                         if (!falg) {
-                            if (!et_task_people.getText().toString().equals("未填写")) {
+                            if (et_task_people.getTags().length>0) {
                                 //保存附件
                                 if (finalFile != null) {
                                     saveAmrFile();//附件保存
@@ -511,12 +517,24 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
         int type = cb_task_reply.isChecked() == true ? 1 : 0;
         String name = "来自" + CommonUtil.getSharedPreferences(ct, "erp_username") + "的任务";
         String formStore;
+        String[] people= et_task_people.getTags();
+        String resourcename="";
+        for (int i=0;i<people.length;i++)
+        {
+            if (i==people.length-1){
+                resourcename=resourcename+people[i].trim();
+            }
+            else{
+                resourcename=resourcename+people[i].trim()+",";
+            }
+        }
 
         if (id == null) {
+
             formStore = "{'name':'" + name + "'"
                     + ",'startdate':'" + CommonUtil.getStringDate(System.currentTimeMillis()) + "',"
                     + "'enddate':'" + et_task_startime.getText().toString() + "',"
-                    + "'type':'" + type + "','resourcename':'" + et_task_people.getText().toString() + "',"
+                    + "'type':'" + type + "','resourcename':'" +resourcename + "',"
                     + "'description':'" + et_task_remark.getText().toString() + "'"
                     + "}";
         } else {
@@ -524,7 +542,7 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
             formStore = "{'name':'" + name + "'"
                     + ",'startdate':'" + CommonUtil.getStringDate(System.currentTimeMillis()) + "',"
                     + "'enddate':'" + et_task_startime.getText().toString() + "',"
-                    + "'type':'" + type + "','resourcename':'" + et_task_people.getText().toString() + "',"
+                    + "'type':'" + type + "','resourcename':'" +resourcename + "',"
                     + "'description':'" + et_task_remark.getText().toString() + "',"
                     + "'attachs':'" + id + "'"
                     + "}";
@@ -839,11 +857,13 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
                 }
                 if (resultCode == 2) {
                     String en_name = data.getStringExtra("en_name");
-                    et_task_people.setText(en_name);
+                    et_task_people.setTags(en_name);
                 }
                 if (resultCode == 1) {
                     String values = data.getStringExtra("employees");
-                    et_task_people.setText(values);
+                    Log.i("fromStore",values);
+                    String[] tag_values=values.split(",");
+                    et_task_people.setTags(tag_values);
                 }
                 break;
             case 1:

+ 6 - 0
WeiChat/src/main/res/layout/act_list_dbfind_employee.xml

@@ -53,6 +53,12 @@
                 android:visibility="gone" />
         </RelativeLayout>
     </RelativeLayout>
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:textColor="@color/gray_light"
+        android:text="长按可以多选人员"/>
     <com.handmark.pulltorefresh.library.PullToRefreshListView
         android:id="@+id/lv_employee"
         android:layout_width="match_parent"

+ 129 - 93
WeiChat/src/main/res/layout/act_task_add.xml

@@ -1,17 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical"
-        >
-        <LinearLayout
-        android:orientation="vertical"
-        android:layout_height="match_parent"
-        android:layout_width="match_parent">
+        android:orientation="vertical">
+
         <LinearLayout
-              android:orientation="vertical"
-              style="@style/form_relative_customer">
+            style="@style/form_relative_customer"
+            android:orientation="vertical">
+
             <EditText
                 android:id="@+id/et_task_remark"
                 style="@style/form_relative_right_text"
@@ -20,16 +22,18 @@
                 android:layout_marginLeft="10dp"
                 android:hint="输入任务描述" />
 
-      		</LinearLayout>
-         <View
+        </LinearLayout>
+
+        <View
             android:layout_width="match_parent"
             android:layout_height="0.5dp"
             android:layout_marginLeft="5dp"
             android:layout_marginRight="5dp"
             android:background="@color/light_grey" />
-         <RelativeLayout 
-               android:layout_height="50dp"
-         style="@style/form_relative_customer">
+
+        <RelativeLayout
+            style="@style/form_relative_customer"
+            android:layout_height="50dp">
 
             <TextView
                 android:id="@+id/tv_task_startime"
@@ -40,31 +44,34 @@
                 android:text="截止时间" />
 
             <EditText
-                android:clickable="true"
                 android:id="@+id/et_task_startime"
                 style="@style/form_relative_right_text"
                 android:layout_marginLeft="10dp"
                 android:layout_toRightOf="@+id/tv_task_startime"
+                android:clickable="true"
                 android:hint="输入截止时间" />
 
         </RelativeLayout>
-         <View
+
+        <View
             android:layout_width="match_parent"
             android:layout_height="0.5dp"
             android:layout_marginLeft="5dp"
             android:layout_marginRight="5dp"
             android:background="@color/light_grey" />
-           <!-- 语音 -->
-           <LinearLayout 
-               android:id="@+id/lay_voice_layout"
-               android:orientation="horizontal"
-               android:visibility="gone"
-               style="@style/form_relative_customer">
-             <TextView 
-                 android:layout_width="wrap_content"
-                 android:layout_height="wrap_content"
-                 android:padding="15dp"
-                 android:text="语音"/>
+        <!-- 语音 -->
+        <LinearLayout
+            android:id="@+id/lay_voice_layout"
+            style="@style/form_relative_customer"
+            android:orientation="horizontal"
+            android:visibility="gone">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:padding="15dp"
+                android:text="语音" />
+
             <LinearLayout
                 android:id="@+id/voice_display_voice_layout"
                 android:layout_width="150dip"
@@ -75,53 +82,57 @@
                 android:background="@drawable/globle_player_bg"
                 android:gravity="center_vertical"
                 android:orientation="horizontal"
-                android:visibility="visible" >
+                android:visibility="visible">
 
-              <ImageView
-                android:id="@+id/voice_display_voice_play"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:src="@drawable/globle_player_btn_play" />
-
-            <ProgressBar
-                android:id="@+id/voice_display_voice_progressbar"
-                style="?android:attr/progressBarStyleHorizontal"
-                android:layout_width="0dp"
-                android:layout_height="6dip"
-                android:layout_margin="8dip"
-                android:layout_weight="1"
-                android:max="100"
-                android:progress="0"
-                android:progressDrawable="@drawable/globle_player_progress_bar_bg" />
+                <ImageView
+                    android:id="@+id/voice_display_voice_play"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:src="@drawable/globle_player_btn_play" />
 
-            <TextView
-                android:id="@+id/voice_display_voice_time"
+                <ProgressBar
+                    android:id="@+id/voice_display_voice_progressbar"
+                    style="?android:attr/progressBarStyleHorizontal"
+                    android:layout_width="0dp"
+                    android:layout_height="6dip"
+                    android:layout_margin="8dip"
+                    android:layout_weight="1"
+                    android:max="100"
+                    android:progress="0"
+                    android:progressDrawable="@drawable/globle_player_progress_bar_bg" />
+
+                <TextView
+                    android:id="@+id/voice_display_voice_time"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=""
+                    android:textColor="#999999"
+                    android:textSize="12sp" />
+
+            </LinearLayout>
+
+            <ImageView
+                android:id="@+id/iv_delete_voice"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text=""
-                android:textColor="#999999"
-                android:textSize="12sp" />
-        
-            </LinearLayout>
-               <ImageView
-                   android:id="@+id/iv_delete_voice"
-                   android:layout_width="wrap_content"
-                   android:layout_height="wrap_content"
-                   android:layout_gravity="center_vertical"
-                   android:layout_marginLeft="10dp"
-                   android:background="@drawable/iconfont_shanchu" />
-           </LinearLayout>
-         <View
+                android:layout_gravity="center_vertical"
+                android:layout_marginLeft="10dp"
+                android:background="@drawable/iconfont_shanchu" />
+        </LinearLayout>
+
+        <View
             android:id="@+id/view_line"
             android:layout_width="match_parent"
             android:layout_height="0.5dp"
             android:layout_marginLeft="5dp"
             android:layout_marginRight="5dp"
-            android:visibility="gone"
-            android:background="@color/light_grey" />
-        <RelativeLayout 
-              android:layout_height="50dp"
-         style="@style/form_relative_customer">
+            android:background="@color/light_grey"
+            android:visibility="gone" />
+
+        <RelativeLayout
+            style="@style/form_relative_customer"
+            android:layout_height="50dp">
+
             <TextView
                 android:id="@+id/tv_task_reply"
                 android:layout_width="wrap_content"
@@ -129,6 +140,7 @@
                 android:layout_centerVertical="true"
                 android:layout_marginLeft="10dp"
                 android:text="需要回复" />
+
             <com.sk.weichat.ui.erp.view.SwitchView
                 android:id="@+id/cb_task_reply"
                 android:layout_width="50dp"
@@ -137,15 +149,18 @@
                 android:layout_centerVertical="true"
                 android:layout_marginRight="20dp" />
         </RelativeLayout>
-         <View
+
+        <View
             android:layout_width="match_parent"
             android:layout_height="0.5dp"
             android:layout_marginLeft="5dp"
             android:layout_marginRight="5dp"
             android:background="@color/light_grey" />
-         <RelativeLayout
-               android:layout_height="50dp" 
-         style="@style/form_relative_customer">
+
+        <RelativeLayout
+            style="@style/form_relative_customer"
+            android:layout_height="90dp">
+
             <TextView
                 android:id="@+id/tv_task_peoples"
                 android:layout_width="wrap_content"
@@ -154,14 +169,31 @@
                 android:layout_marginLeft="10dp"
                 android:text="   处理人" />
 
-            <EditText
+            <!--<EditText
                 android:id="@+id/et_task_people"
                 android:layout_width="wrap_content"
                 android:layout_height="fill_parent"
                 android:layout_marginLeft="10dp"
+                android:layout_toLeftOf="@+id/iv_find"
                 android:layout_toRightOf="@+id/tv_task_peoples"
+                android:background="@null" />-->
+            <ScrollView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
                 android:layout_toLeftOf="@+id/iv_find"
-                android:background="@null" />
+                android:layout_marginLeft="10dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginBottom="5dp"
+                android:scrollbars="none"
+                android:layout_toRightOf="@+id/tv_task_peoples">
+                <com.sk.weichat.view.TagGroup
+                    style="@style/TagGroup"
+                    android:id="@+id/et_task_people"
+                    android:layout_width="wrap_content"
+                    android:layout_height="fill_parent"
+                    android:background="@null"
+                    />
+            </ScrollView>
 
             <ImageView
                 android:id="@+id/iv_find"
@@ -173,41 +205,45 @@
                 android:src="@drawable/icon_find_voice" />
 
         </RelativeLayout>
-         <View
+
+        <View
             android:layout_width="match_parent"
             android:layout_height="0.5dp"
             android:layout_marginLeft="5dp"
             android:layout_marginRight="5dp"
             android:background="@color/light_grey" />
- 		 <LinearLayout
-           style="@style/form_linear_customer">
-          <Button
-              android:id="@+id/bt_task_add"
-              android:layout_width="match_parent"
-              android:layout_height="40dp"
-              android:layout_marginBottom="10dp"
-              android:layout_marginLeft="10dp"
-              android:layout_marginRight="10dp"
-              android:layout_marginTop="10dp"
-              android:background="@drawable/btn_index_selector"
-              android:text="保存"
-              android:textColor="@color/white" />
-          </LinearLayout>
+
+        <LinearLayout style="@style/form_linear_customer">
+
+            <Button
+                android:id="@+id/bt_task_add"
+                android:layout_width="match_parent"
+                android:layout_height="40dp"
+                android:layout_marginBottom="10dp"
+                android:layout_marginLeft="10dp"
+                android:layout_marginRight="10dp"
+                android:layout_marginTop="10dp"
+                android:background="@drawable/btn_index_selector"
+                android:text="保存"
+                android:textColor="@color/white" />
+        </LinearLayout>
     </LinearLayout>
-    <include 
+
+    <include
         android:id="@+id/ic_voice_center"
-        layout="@layout/include_voice_center_size" 
+        layout="@layout/include_voice_center_size"
         android:layout_width="200dp"
         android:layout_height="200dp"
-        android:visibility="invisible"
-        android:layout_centerInParent="true"/>
+        android:layout_centerInParent="true"
+        android:visibility="invisible" />
+
     <ImageView
         android:id="@+id/iv_recode"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:layout_centerInParent="true"
-        android:padding="20dp"
         android:contentDescription="@string/app_name"
+        android:padding="20dp"
         android:src="@drawable/icon_voice_black" />
-    </RelativeLayout>
+</RelativeLayout>

+ 46 - 0
WeiChat/src/main/res/values/attrs.xml

@@ -13,6 +13,52 @@
     </declare-styleable>
 
 
+    <declare-styleable name="TagGroup">
+        <!-- Whether the tag group is in append mode. -->
+        <attr name="atg_isAppendMode" format="boolean" />
+        <!-- If the tag group is in append mode, what the hint of input tag. -->
+        <attr name="atg_inputHint" format="string" />
+
+        <!-- The tag view outline border color. -->
+        <attr name="atg_borderColor" format="color" />
+        <!-- The tag view text color. -->
+        <attr name="atg_textColor" format="color" />
+        <!-- The tag view background color. -->
+        <attr name="atg_backgroundColor" format="color" />
+
+        <!-- The dash outline border color, when in append mode. -->
+        <attr name="atg_dashBorderColor" format="color" />
+        <!-- The input tag hint text color, when in append mode. -->
+        <attr name="atg_inputHintColor" format="color" />
+        <!-- The input tag type text color, when in append mode. -->
+        <attr name="atg_inputTextColor" format="color" />
+
+        <!-- The checked tag view outline border color. -->
+        <attr name="atg_checkedBorderColor" format="color" />
+        <!-- The checked text color. -->
+        <attr name="atg_checkedTextColor" format="color" />
+        <!-- The checked marker color. -->
+        <attr name="atg_checkedMarkerColor" format="color" />
+        <!-- The checked tag view background color. -->
+        <attr name="atg_checkedBackgroundColor" format="color" />
+
+        <!-- The tag view background color, when the tag view is being pressed. -->
+        <attr name="atg_pressedBackgroundColor" format="color" />
+
+        <!-- The tag view outline border stroke width. -->
+        <attr name="atg_borderStrokeWidth" format="dimension" />
+        <!-- The tag view text size. -->
+        <attr name="atg_textSize" format="dimension" />
+
+        <attr name="atg_horizontalSpacing" format="dimension" />
+        <attr name="atg_verticalSpacing" format="dimension" />
+        <attr name="atg_horizontalPadding" format="dimension" />
+        <attr name="atg_verticalPadding" format="dimension" />
+    </declare-styleable>
+
+    <declare-styleable name="Themes">
+        <attr name="tagGroupStyle" format="reference" />
+    </declare-styleable>
 
 
 </resources>

+ 3 - 0
WeiChat/src/main/res/values/strings.xml

@@ -345,4 +345,7 @@
     <string name="create_new_chat">创建新聊天</string>
     <string name="recent_chat">最近聊天</string>
     <string name="select_group_chat_instant">选择一个群</string>
+
+
+    <string name="add_tag">Add Tag</string>
 </resources>

+ 62 - 0
WeiChat/src/main/res/values/styles.xml

@@ -463,4 +463,66 @@
         <item name="android:layout_marginBottom">7dp</item>
         <item name="android:layout_marginTop">7dp</item>
     </style>
+
+
+    <style name="TagGroup">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="atg_isAppendMode">false</item>
+        <item name="atg_inputHint">@string/add_tag</item>
+        <item name="atg_borderColor">#49C120</item>
+        <item name="atg_textColor">#49C120</item>
+        <item name="atg_backgroundColor">#FFFFFF</item>
+        <item name="atg_dashBorderColor">#AAAAAA</item>
+        <item name="atg_inputHintColor">#80000000</item>
+        <item name="atg_inputTextColor">#DE000000</item>
+        <item name="atg_checkedBorderColor">#49C120</item>
+        <item name="atg_checkedTextColor">#FFFFFF</item>
+        <item name="atg_checkedMarkerColor">#FFFFFF</item>
+        <item name="atg_checkedBackgroundColor">#49C120</item>
+        <item name="atg_pressedBackgroundColor">#EDEDED</item>
+        <item name="atg_borderStrokeWidth">0.5dp</item>
+        <item name="atg_textSize">13sp</item>
+        <item name="atg_horizontalSpacing">8dp</item>
+        <item name="atg_verticalSpacing">4dp</item>
+        <item name="atg_horizontalPadding">12dp</item>
+        <item name="atg_verticalPadding">3dp</item>
+    </style>
+
+    <style name="TagGroup.Small" parent="TagGroup">
+        <item name="atg_textSize">10sp</item>
+        <item name="atg_horizontalSpacing">6dp</item>
+        <item name="atg_verticalSpacing">3dp</item>
+        <item name="atg_horizontalPadding">8dp</item>
+        <item name="atg_verticalPadding">2dp</item>
+    </style>
+
+    <style name="TagGroup.Large" parent="TagGroup">
+        <item name="atg_borderStrokeWidth">0.7dp</item>
+        <item name="atg_textSize">15sp</item>
+        <item name="atg_horizontalSpacing">9dp</item>
+        <item name="atg_verticalSpacing">5dp</item>
+        <item name="atg_horizontalPadding">14dp</item>
+        <item name="atg_verticalPadding">4dp</item>
+    </style>
+
+    <style name="TagGroup.Beauty_Red" parent="TagGroup">
+        <item name="atg_borderColor">#FF3D7F</item>
+        <item name="atg_textColor">#FF3D7F</item>
+        <item name="atg_checkedBorderColor">#FF3D7F</item>
+        <item name="atg_checkedBackgroundColor">#FF3D7F</item>
+    </style>
+
+    <style name="TagGroup.Beauty_Red.Inverse" parent="TagGroup">
+        <item name="atg_borderColor">#FF3D7F</item>
+        <item name="atg_textColor">#FFFFFF</item>
+        <item name="atg_backgroundColor">#FF3D7F</item>
+        <item name="atg_inputHintColor">#80FFFFFF</item>
+        <item name="atg_inputTextColor">#DEFFFFFF</item>
+        <item name="atg_checkedBorderColor">#FF3D7F</item>
+        <item name="atg_checkedTextColor">#FF3D7F</item>
+        <item name="atg_checkedMarkerColor">#FF3D7F</item>
+        <item name="atg_checkedBackgroundColor">#FFFFFF</item>
+        <item name="atg_pressedBackgroundColor">#FF99B1</item>
+    </style>
 </resources>