Browse Source

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

# Conflicts:
#	WeiChat/build.gradle
#	WeiChat/src/main/res/values/colors.xml
RaoMeng 9 years ago
parent
commit
c750fcf7b8
62 changed files with 2514 additions and 1234 deletions
  1. 34 14
      WeiChat/src/main/AndroidManifest.xml
  2. 20 17
      WeiChat/src/main/java/com/xzjmyk/pm/activity/BdLocationHelper.java
  3. 4 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/bean/oa/Signin.java
  4. 3 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/base/BaseActivity.java
  5. 0 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java
  6. 9 9
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessActivity.java
  7. 19 18
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessAddActivity.java
  8. 16 16
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailActivty.java
  9. 4 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java
  10. 4 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessLessActivity.java
  11. 7 5
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessTransferActivity.java
  12. 94 69
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/ClientActivity.java
  13. 34 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/CustomerAddActivity.java
  14. 70 29
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/TaskAddActivity.java
  15. 3 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java
  16. 1 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportPlanActivity.java
  17. 25 9
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddMeetingActivity.java
  18. 79 4
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AlarmReceiver.java
  19. 8 10
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MeetDetailsActivity.java
  20. 5 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MeetingActivity.java
  21. 22 10
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java
  22. 1 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SaveMeetActivity.java
  23. 3 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SigninActivity.java
  24. 5 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/UserSelectActivity.java
  25. 4 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/HListViewOneAdapter.java
  26. 145 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/SigninAdapter.java
  27. 6 7
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/OutofficeFragment.java
  28. 2 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/SigninClickFragment.java
  29. 548 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/SigninFragment.java
  30. 7 8
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java
  31. 55 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/LoginERPUilt.java
  32. 56 10
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/ViewUtil.java
  33. 49 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/view/CalendarPopup.java
  34. 5 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/util/BaiduMapUtil.java
  35. 5 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/CalendarView.java
  36. 838 915
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Crouton.java
  37. BIN
      WeiChat/src/main/res/drawable-hdpi/end_meeting.png
  38. BIN
      WeiChat/src/main/res/drawable-hdpi/end_meeting_pass.png
  39. BIN
      WeiChat/src/main/res/drawable-hdpi/ic_metting_people.png
  40. BIN
      WeiChat/src/main/res/drawable-hdpi/signin.png
  41. BIN
      WeiChat/src/main/res/drawable-xhdpi/end_meeting.png
  42. BIN
      WeiChat/src/main/res/drawable-xhdpi/end_meeting_pass.png
  43. BIN
      WeiChat/src/main/res/drawable-xhdpi/signin.png
  44. BIN
      WeiChat/src/main/res/drawable-xxhdpi/end_meeting.png
  45. BIN
      WeiChat/src/main/res/drawable-xxhdpi/end_meeting_pass.png
  46. BIN
      WeiChat/src/main/res/drawable-xxhdpi/ic_metting_people.png
  47. BIN
      WeiChat/src/main/res/drawable-xxhdpi/signin.png
  48. 5 0
      WeiChat/src/main/res/drawable/endmeeting.xml
  49. 19 8
      WeiChat/src/main/res/layout/activity_add_meeting.xml
  50. 2 1
      WeiChat/src/main/res/layout/activity_business_add.xml
  51. 14 8
      WeiChat/src/main/res/layout/activity_meet_details.xml
  52. 10 2
      WeiChat/src/main/res/layout/activity_oa.xml
  53. 71 0
      WeiChat/src/main/res/layout/calender_popup.xml
  54. 99 0
      WeiChat/src/main/res/layout/fragment_click_signin.xml
  55. 3 3
      WeiChat/src/main/res/layout/fragment_outoffice.xml
  56. 7 5
      WeiChat/src/main/res/layout/fragment_signin.xml
  57. 4 0
      WeiChat/src/main/res/layout/item_signin_list.xml
  58. 16 12
      WeiChat/src/main/res/layout/view_empty.xml
  59. 51 3
      WeiChat/src/main/res/values-v14/styles.xml
  60. 11 2
      WeiChat/src/main/res/values/colors.xml
  61. 10 1
      WeiChat/src/main/res/values/gpm_values.xml
  62. 2 2
      WeiChat/src/main/res/values/strings.xml

+ 34 - 14
WeiChat/src/main/AndroidManifest.xml

@@ -410,25 +410,36 @@
         <activity
             android:name=".ui.erp.activity.oa.AddMeetingActivity"
             android:label="新增会议" />
-        <activity android:name=".ui.erp.activity.oa.OAActivity" />
+        <activity android:name=".ui.erp.activity.oa.OAActivity"
+            />
         <activity
             android:name=".ui.erp.activity.oa.StatisticsActivity"
             android:label="考勤统计" />
         <activity android:name=".ui.erp.activity.TextErpActivity" />
-        <activity android:name=".ui.erp.activity.crm.BusinessActivity" />
-        <activity android:name=".ui.erp.activity.crm.BusinessDetailActivty" />
-        <activity android:name=".ui.erp.activity.crm.BusinessDetailInfoActivity" />
-        <activity android:name=".ui.erp.activity.crm.BusinessLessActivity" />
-        <activity android:name=".ui.erp.activity.crm.BusinessTransferActivity" />
-        <activity android:name=".ui.erp.activity.crm.BusinessSelectCustomerActivity" />
+        <activity android:name=".ui.erp.activity.crm.BusinessActivity"
+            android:theme="@style/CrmThemeBlue"/>
+        <activity android:name=".ui.erp.activity.crm.BusinessDetailActivty"
+            android:theme="@style/CrmThemeBlue"/>
+        <activity android:name=".ui.erp.activity.crm.BusinessDetailInfoActivity"
+            android:theme="@style/CrmThemeBlue"/>
+        <activity android:name=".ui.erp.activity.crm.BusinessLessActivity"
+            android:theme="@style/CrmThemeBlue"/>
+        <activity android:name=".ui.erp.activity.crm.BusinessTransferActivity"
+            android:theme="@style/CrmThemeBlue"/>
+        <activity android:name=".ui.erp.activity.crm.BusinessSelectCustomerActivity"
+            android:theme="@style/CrmThemeBlue"/>
         <activity
             android:name=".ui.message.uas.B2bMsgActivity"
             android:launchMode="singleTask" />
         <activity
             android:name=".ui.erp.activity.oa.OutofficeActivity"
+            android:theme="@style/OAThemeOutOffice"
+            android:configChanges="orientation|keyboardHidden"
+            android:windowSoftInputMode="adjustUnspecified|stateHidden"
             android:label="外勤签到" />
         <activity
             android:name=".ui.erp.activity.oa.MeetDetailsActivity"
+            android:theme="@style/OAThemeMeet"
             android:label="会议详情" />
         <activity
             android:name=".ui.erp.activity.oa.OARegisterActivity"
@@ -438,11 +449,15 @@
             android:configChanges="orientation|keyboardHidden"
             android:theme="@style/CrmThemeBlue"
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
-        <activity android:name=".ui.erp.activity.crm.CustomerDetailActivity" />
-        <activity android:name=".ui.erp.activity.crm.CustomerListActivity" />
-        <activity android:name=".ui.erp.activity.crm.CustomerMutilSelectActivity" />
+        <activity android:name=".ui.erp.activity.crm.CustomerDetailActivity"
+            android:theme="@style/CrmThemeCustomer"/>
+        <activity android:name=".ui.erp.activity.crm.CustomerListActivity"
+            android:theme="@style/CrmThemeCustomer"/>
+        <activity android:name=".ui.erp.activity.crm.CustomerMutilSelectActivity"
+            android:theme="@style/CrmThemeCustomer"/>
         <activity
             android:name=".ui.erp.activity.crm.SalesRankingActivity"
+            android:theme="@style/CrmThemeRank"
             android:label="@string/title_activity_sales_ranking" />
         <activity
             android:name=".ui.erp.activity.crm.VisitReportAddActivity"
@@ -455,15 +470,16 @@
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
         <activity
             android:name=".ui.erp.activity.crm.VisitReportPlanActivity"
-            android:configChanges="orientation|keyboardHidden"
             android:theme="@style/CrmThemeTask"
+            android:configChanges="orientation|keyboardHidden"
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
         <activity
             android:name=".ui.erp.activity.crm.BusinessAddActivity"
             android:configChanges="orientation|keyboardHidden"
             android:theme="@style/CrmThemeBlue"
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
-        <activity android:name=".ui.erp.activity.crm.CustomerListSelectActivity" />
+        <activity android:name=".ui.erp.activity.crm.CustomerListSelectActivity"
+            android:theme="@style/CrmThemeCustomer"/>
         <activity android:name=".ui.erp.activity.oa.AddMeetMainActivity" />
         <activity
             android:name=".ui.erp.activity.oa.WorkLogsActivity"
@@ -490,16 +506,19 @@
             android:label="签到提醒" />
         <activity
             android:name=".ui.erp.activity.oa.MeetingActivity"
+            android:theme="@style/OAThemeMeet"
             android:label="会议管理" />
         <activity
             android:name=".ui.message.SubscripSetActivity"
             android:label="申请订阅" />
         <activity
             android:name=".ui.erp.activity.oa.OutofficeSetActivity"
+            android:theme="@style/OAThemeOutOffice"
             android:label="签到设置" />
         <activity android:name=".ui.erp.activity.oa.TestActivity" />
         <activity
             android:name=".ui.erp.activity.oa.OutSigninOKActivity"
+            android:theme="@style/OAThemeOutOffice"
             android:label="签到详情" />
         <activity
             android:name=".ui.erp.activity.crm.ContactManAddActivity"
@@ -507,11 +526,12 @@
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
         <activity
             android:name=".ui.erp.activity.oa.SaveMeetActivity"
-            android:label="保存会议纪要" />
+            android:label="会议纪要" />
         <activity
             android:name=".ui.erp.activity.oa.UserSelectActivity"
             android:label="选择人员" />
-        <activity android:name=".ui.erp.activity.crm.BusinessStateActivity" />
+        <activity android:name=".ui.erp.activity.crm.BusinessStateActivity"
+            android:theme="@style/CrmThemeBlue"/>
         <activity
             android:name=".ui.erp.activity.oa.AddMeetTaskActivity"
             android:label="会议任务" />

+ 20 - 17
WeiChat/src/main/java/com/xzjmyk/pm/activity/BdLocationHelper.java

@@ -11,6 +11,7 @@ import com.baidu.location.LocationClientOption;
 import com.baidu.location.LocationClientOption.LocationMode;
 import com.baidu.location.Poi;
 import com.xzjmyk.pm.activity.sp.LocationSp;
+import com.xzjmyk.pm.activity.util.StringUtils;
 
 import java.util.List;
 
@@ -43,12 +44,18 @@ public class BdLocationHelper {
         mLocationClient = new LocationClient(context); // 声明LocationClient类
         mLocationClient.registerLocationListener(mMyLocationListener); // 注册监听函数
         LocationClientOption option = new LocationClientOption();
-        option.setLocationMode(LocationMode.Hight_Accuracy);// 设置定位模式
-        option.setCoorType("bd09ll");// 返回的定位结果是百度经纬度,默认值gcj02
-        option.setScanSpan(5000);// 设置发起定位请求的间隔时间为10s
-        option.setIsNeedAddress(true);
-        option.setNeedDeviceDirect(false);
+        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);//可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
+        option.setCoorType("bd09ll");//可选,默认gcj02,设置返回的定位结果坐标系
+        option.setScanSpan(5000);// 设置发起定位请求的间隔时间为10s;//可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的
+        option.setIsNeedAddress(true);//可选,设置是否需要地址信息,默认不需要
         option.setOpenGps(true);//可选,默认false,设置是否使用gps
+        option.setLocationNotify(true);//可选,默认false,设置是否当gps有效时按照1S1次频率输出GPS结果
+        option.setIsNeedLocationDescribe(true);//可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”
+        option.setIsNeedLocationPoiList(true);//可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到
+        option.setIgnoreKillProcess(false);//可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死
+        option.SetIgnoreCacheException(false);//可选,默认false,设置是否收集CRASH信息,默认收集
+        option.setEnableSimulateGps(false);//可选,默认false,设置是否需要过滤gps仿真结果,默认需要
+        option.setNeedDeviceDirect(false);
         mLocationClient.setLocOption(option);
         requestLocation();//重新定位
 
@@ -81,18 +88,11 @@ public class BdLocationHelper {
             if (location != null) {
                 resultCode = location.getLocType();
             }
-          // Log.i("gongpengming", StringUtils.isEmail(location.getLocationDescribe()) ? "空的" : location.getLocationDescribe());
-            if (location.getPoiList() == null || location.getPoiList().size() <= 0) {
-            //    Log.i("gongpengming", "location.getPoiList()不对劲");
-            } else {
-           //    Log.i("gongpengming", "location.getPoiList()不对劲");
-            }
-            setPois(location.getPoiList());
             // 百度定位失败
             if (resultCode != BDLocation.TypeGpsLocation && resultCode != BDLocation.TypeCacheLocation
                     && resultCode != BDLocation.TypeOffLineLocation && resultCode != BDLocation.TypeNetWorkLocation) {
                 if (AppConfig.DEBUG) {
-                //    Log.d(AppConfig.TAG, "百度定位失败");
+                    Log.d(AppConfig.TAG, "百度定位失败");
                 }
                 mFaildCount++;
                 if (mFaildCount > 3) {// 停止定位
@@ -104,6 +104,8 @@ public class BdLocationHelper {
             // 百度定位成功
             mLongitude = location.getLongitude();
             mLatitude = location.getLatitude();
+            name = location.getLocationDescribe();
+            pois = location.getPoiList();
             if (location.getLocType() == BDLocation.TypeNetWorkLocation) {
                 mAddress = location.getAddrStr();
                 mProvinceName = location.getProvince();
@@ -137,12 +139,13 @@ public class BdLocationHelper {
 
     };
 
-    public List<Poi> getPois() {
-        return pois;
+
+    public String getName() {
+        return pois == null ? (name == null ? "当前位置" : name) : (pois.get(0) == null ? (name == null ? "当前位置" : name) : pois.get(0).getName());
     }
 
-    public void setPois(List<Poi> pois) {
-        this.pois = pois;
+    public void setName(String name) {
+        this.name = name;
     }
 
     // 获取经纬度

+ 4 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/bean/oa/Signin.java

@@ -9,10 +9,10 @@ import android.os.Parcelable;
 public class Signin implements Parcelable {
 
     private String code;//员工编号
-    private String utime;//签到日期
-    private String dtime;//获取的上班时间,当有多次排班,用分号分别
-    private String usigmin;//签到上班时间,当有多次排班,用分号分别
-    private String dsigmin;//签到下班时间,当有多次排班,用分号分别
+    private String utime;//上班时间
+    private String dtime;//下班时间
+    private String usigmin;//上班开始时间
+    private String dsigmin;//下班开始时间
     public Signin() {
     }
 

+ 3 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/base/BaseActivity.java

@@ -28,6 +28,8 @@ public abstract class BaseActivity extends ActionBackActivity {
     public CustomProgressDialog progressDialog;
     public Context ct;
     public Activity activity;
+    
+    public  void preOnCreacte(){};
 
     public BaseActivity() {
         super();
@@ -49,6 +51,7 @@ public abstract class BaseActivity extends ActionBackActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        preOnCreacte();
         ct=this;
         activity=this;
         setNotTouchEvent(true);

+ 0 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java

@@ -6,7 +6,6 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
-import android.util.Log;
 import android.view.View;
 import android.webkit.CookieManager;
 import android.webkit.CookieSyncManager;
@@ -211,7 +210,6 @@ public class WebViewCommActivity extends BaseActivity {
         ViewUtil.ct = this;
         ViewUtil.LoginERPTask(this, hander, reCode);
         PreferenceUtils.putLong(context, TIME, System.currentTimeMillis());
-
     }
 
     @Override

+ 9 - 9
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessActivity.java

@@ -71,15 +71,15 @@ public class BusinessActivity extends BaseActivity implements View.OnClickListen
     private ArrayList<ArrayList<String>> gridlists = new ArrayList<ArrayList<String>>();
     private String gridData = "  [\n" +
             "[\"颜色\",\"商机阶段\",\"商机数量\",\"商机转化率\"],\n" +
-            "[\"#FF0000\",\"152,002\",\"1223\",\"22\"],\n" +
-            "[\"#00CCFF\",\"8,775\",\"22\",\"323\"],\n" +
-            "[\"#FFFF00\",\"2,000\",\"232\",\"43242\"],\n" +
-            "[\"#00FF00\",\"11\",\"12312\",\"232433432\"],\n" +
-            "[\"#FF00FF\",\"11\",\"12312\",\"232433432\"],\n" +
-            "[\"#FF9900\",\"11\",\"12312\",\"232433432\"],\n" +
-            "[\"#993366\",\"11\",\"12312\",\"232433432\"],\n" +
-            "[\"#C0C0C0\",\"11\",\"12312\",\"232433432\"],\n" +
-            "[\"#FFCC99\",\"11\",\"12312\",\"232433432\"]\n" +
+            "[\"#FF0000\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#00CCFF\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#FFFF00\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#00FF00\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#FF00FF\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#FF9900\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#993366\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#C0C0C0\",\"0\",\"0\",\"0\"],\n" +
+            "[\"#FFCC99\",\"0\",\"0\",\"0\"]\n" +
             "]";
 
     @Override

+ 19 - 18
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessAddActivity.java

@@ -82,6 +82,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
     private List<String> lists = new ArrayList<String>();
     private int et_business_enterCode;
     private int mBcId;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -97,7 +98,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
         et_business_source.setOnClickListener(this);
         et_business_enterMan.setOnClickListener(this);
 //        et_business_no.setOnClickListener(this);
-     //   et_business.setKeyListener(null);
+        //   et_business.setKeyListener(null);
 //        et_business_no.setKeyListener(null);
         //et_business_jieDuan.setKeyListener(null);
         et_business_source.setKeyListener(null);
@@ -115,7 +116,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
     }
 
     private void initData() {
-        CommonUtil.getCommonId(this,"BUSINESSCHANCE_SEQ",mHandler,GET_BC_ID);
+        CommonUtil.getCommonId(this, "BUSINESSCHANCE_SEQ", mHandler, GET_BC_ID);
         getCodeByNet();
     }
 
@@ -164,7 +165,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
         switch (item.getItemId()) {
             case R.id.btn_save:
                 if (et_business_name.testValidity() && et_business_source.testValidity() &&
-                        et_business.testValidity() && et_business_type.testValidity() &&
+                        et_business.testValidity() &&
                         et_business_jieDuan.testValidity()) {
                     sendHttpResquest();
                 }
@@ -183,7 +184,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
     private static final int LOAD_MANGENJIN = 5;
     private static final int GET_BC_ID = 6;
     private JSONArray jsons;
-    
+
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -272,7 +273,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
                     String resultStr = msg.getData().getString("result");
                     try {
                         JSONObject resultJsonObject = new JSONObject(resultStr);
-                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
+                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")) {
                             mBcId = resultJsonObject.getInt("id");
                         }
                     } catch (JSONException e) {
@@ -313,19 +314,19 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
         String bc_remark = getEditText(et_business_remark);//备注
         String bc_position = getEditText(et_company_position); //职位
         String bc_type = getEditText(et_business_type);  //商机类型
-        String enterCode=null;
-        if (et_business_enterCode==0){
-            enterCode="";
-        }else{
-            enterCode=CommonUtil.getSharedPreferences(ct,"erp_username");
+        String enterCode = null;
+        if (et_business_enterCode == 0) {
+            enterCode = "";
+        } else {
+            enterCode = CommonUtil.getSharedPreferences(ct, "erp_username");
         }
-        LogUtil.e("commonbcid",mBcId+"");
+        LogUtil.e("commonbcid", mBcId + "");
         String formStore =
                 "{\n" +
                         "\"bc_id\":" + mBcId + ",\n" +
                         "\"bc_code\":\"" + et_business_no.getText().toString() + "\",\n" +   //商机名称
                         "\"bc_status\":\"" + "在录入" + "\",\n" +
-                        "\"bc_domancode\":\"" + enterCode+ "\",\n" +
+                        "\"bc_domancode\":\"" + enterCode + "\",\n" +
                         "\"bc_statuscode\":\"" + "ENTERING" + "\",\n" +
                         "\"bc_description\":\"" + name + "\",\n" +   //商机名称
                         "\"bc_from\":\"" + from + "\",\n" +          //商机来源
@@ -438,17 +439,17 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
                     public void onListItemClick(int position, String value) {
                         et.setText(value);
                         for (int i = 0; i < jsons.size(); i++) {
-                            if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)){
-                             String bd_prop=   jsons.getJSONObject(i).getString("BD_PROP");
-                                if (bd_prop.equals("公有")){
+                            if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)) {
+                                String bd_prop = jsons.getJSONObject(i).getString("BD_PROP");
+                                if (bd_prop.equals("公有")) {
                                     //跟进人不可编辑,不可点击
                                     et_business_enterMan.setClickable(false);
                                     et_business_enterMan.setEnabled(false);
                                     et_business_enterMan.setText("");
-                                    et_business_enterCode=0;
-                                }else{
+                                    et_business_enterCode = 0;
+                                } else {
                                     //跟进人可编辑
-                                    et_business_enterCode=1;
+                                    et_business_enterCode = 1;
                                     et_business_enterMan.setEnabled(true);
                                     et_business_enterMan.setClickable(true);
                                     et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());

+ 16 - 16
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailActivty.java

@@ -113,9 +113,9 @@ public class BusinessDetailActivty extends BaseActivity {
                 final BussinessDetailAdapter.ViewHolder holder = (BussinessDetailAdapter.ViewHolder) view.getTag();
 
                 startActivity(new Intent(BusinessDetailActivty.this, BusinessDetailInfoActivity.class)
-                        .putExtra("type", holder.type)
-                        .putExtra("formCondition", formCondition + "=" + holder.bc_id)
-                        .putExtra("gridCondition", gridCondition + "=" + holder.bc_id)
+                                .putExtra("type", holder.type)
+                                .putExtra("formCondition", formCondition + "=" + holder.bc_id)
+                                .putExtra("gridCondition", gridCondition + "=" + holder.bc_id)
                 );
             }
         });
@@ -353,7 +353,7 @@ public class BusinessDetailActivty extends BaseActivity {
                             model.setName(array.getJSONObject(i).getString("bc_description"));
                             model.setPhone(array.getJSONObject(i).getString("bc_tel"));
                             model.setNote(array.getJSONObject(i).getString("bc_remark"));
-                            model.setSource(array.getJSONObject(i).getString("bc_from"));//BC_NICHEHOUSE
+                            model.setSource(array.getJSONObject(i).getString("bc_from"));
                             model.setSteps(array.getJSONObject(i).getString("bc_nichehouse"));
                             if (array.getJSONObject(i).getObject("bc_id", Object.class) instanceof Integer) {
                                 model.setBc_id(array.getJSONObject(i).getInteger("bc_id"));
@@ -363,15 +363,13 @@ public class BusinessDetailActivty extends BaseActivity {
                         }
                     } else {
                         mEmptyLayout.showEmpty();
-                        ToastMessage("数据加载完毕!");
+                        if (page == 1) {
+                            Crouton.makeText(activity, 30, "暂时没有数据!", getResources().getColor(R.color.light_green), 3000).show();
+                        } else {
+                            Crouton.makeText(activity, 30, "数据加载完成!", getResources().getColor(R.color.light_green), 3000).show();
+                        }
+
                     }
-//                    "bc_tel":"",
-//                        "bc_code":"2016050004",
-//                        "bc_remark":"",
-//                        "bc_recorddate":"2016-05-24 00:00:00",
-//                        "bc_description":"测试",
-//                        "bc_from":"",
-//                        "bc_id":730
                     mAdapter = new BussinessDetailAdapter(ct, mData);
                     mlist.setAdapter(mAdapter);
                     if (page != 1) {
@@ -387,16 +385,18 @@ public class BusinessDetailActivty extends BaseActivity {
                 case BUSINESS_QIANG:
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     progressDialog.dismiss();
-                    Crouton.makeText(BusinessDetailActivty.this,45,"成功抢得此商机,\n" +
-                            "请到商机跟进中查看商机!\n",
+                    Crouton.makeText(BusinessDetailActivty.this, 45, "成功抢得此商机,\n" +
+                                    "请到商机跟进中查看商机!\n",
                             getResources().getColor(R.color.light_green),
                             5000).show();
                     sendHttpResquest(Constants.HTTP_SUCCESS_INIT, page = 1);
                     break;
                 case BUSINESS_FENPEI:
                     progressDialog.dismiss();
-                    ToastMessage("分配商机成功!");
-                    startActivity(new Intent(ct, BusinessActivity.class));
+                    Crouton.makeText(BusinessDetailActivty.this, 45, "成功分配商机!",
+                            getResources().getColor(R.color.light_green),
+                            5000).show();
+                    sendHttpResquest(Constants.HTTP_SUCCESS_INIT, page = 1);
                     break;
                 case CAN_QIANG_NOT:
                     JSONObject result = JSON.parseObject(msg.getData().getString("result"));

+ 4 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java

@@ -391,6 +391,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                         Crouton.makeText(BusinessDetailInfoActivity.this, "您已超出最大获取商机数!", 0xffff4444, 2000).show();
                     }
                 case 5:
+                    progressDialog.dismiss();
                      result = JSON.parseObject(msg.getData().getString("result"));
                     JSONArray items=result.getJSONArray("result");
                     if (items!=null){
@@ -399,6 +400,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                         }else{
                             Intent intent = new Intent(ct, TaskAddActivity.class);
                             intent.putExtra("type", 1);
+                            intent.putExtra("from","BusinessDetailInfo");
                             intent.putExtra("data", bt_code);
                             startActivityForResult(intent, 0x11);
                         }
@@ -407,7 +409,8 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
                     progressDialog.dismiss();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
-
+                    Crouton.makeText(BusinessDetailInfoActivity.this, msg.getData().getString("result"),
+                            0xffff4444, 2000).show();
                     break;
             }
         }

+ 4 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessLessActivity.java

@@ -23,6 +23,7 @@ import com.xzjmyk.pm.activity.ui.erp.util.CodeUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.Constants;
 import com.xzjmyk.pm.activity.util.ToastUtil;
+import com.xzjmyk.pm.activity.view.crouton.Crouton;
 import com.xzjmyk.pm.activity.view.wheel.DatePicker;
 
 import java.util.Calendar;
@@ -142,7 +143,7 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
                 case Constants.HTTP_SUCCESS_INIT:
                     progressDialog.dismiss();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
-                    ViewUtil.ToastMessage(ct, "操作成功!");
+                    Crouton.makeText(activity,30,"操作成功!",getResources().getColor(R.color.light_green),2000);
                     if (type == 2) {
                         updataSchedule(0x16);
                     }
@@ -153,6 +154,8 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
                     progressDialog.dismiss();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
+                    Crouton.makeText(activity, 30, msg.getData().getString("result"), 
+                            getResources().getColor(R.color.red), 2000);
                     break;
                 case 2:
                     progressDialog.dismiss();

+ 7 - 5
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessTransferActivity.java

@@ -212,8 +212,8 @@ public class BusinessTransferActivity extends BaseActivity {
                     if (!items.isEmpty()){
                         for (int i=0;i<items.size();i++){
                             Business model = new Business();
-                            model.setName(items.getJSONObject(i).getString("DLC_VALUE"));
-                            model.setNum(items.getJSONObject(i).getString("DLC_DISPLAY"));
+                            model.setName(items.getJSONObject(i).getString("BD_NAME"));
+                           // model.setNum(items.getJSONObject(i).getString("DLC_DISPLAY"));
                             mData.add(model);
                         }
                     }
@@ -242,10 +242,12 @@ public class BusinessTransferActivity extends BaseActivity {
 
     private void sendHttpResquest(int what){
         progressDialog.show();
-        String url= Constants.getAppBaseUrl(ct)+"/mobile/crm/getBusinessChanceCombo.action";
+        ///mobile/crm/getNichehouse.action
+        ///mobile/crm/getBusinessChanceCombo.action
+        String url= Constants.getAppBaseUrl(ct)+"/mobile/crm/getNichehouse.action";
         Map<String,Object> params=new HashMap<>();
-        params.put("caller", "BusinessChance");
-        params.put("field", "bc_nichehouse");
+//        params.put("caller", "BusinessChance");
+//        params.put("field", "bc_nichehouse");
         LinkedHashMap<String , Object> headers=new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, what, null, null, "post");

+ 94 - 69
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/ClientActivity.java

@@ -246,7 +246,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
         leftAxis.setDrawGridLines(false);
         leftAxis.setSpaceTop(25f);
         leftAxis.setAxisMinValue(0f);
-        leftAxis.setAxisMaxValue(100f);
+//        leftAxis.setAxisMaxValue(100f);
         leftAxis.setAxisLineColor(getResources().getColor(R.color.red));
         mChart.getAxisRight().setEnabled(false);
         mChart.getAxisLeft().setEnabled(true);
@@ -312,7 +312,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
         leftAxis.setDrawGridLines(false);
         leftAxis.setSpaceTop(25f);
         leftAxis.setAxisMinValue(0f);
-        leftAxis.setAxisMaxValue(100f);
+//        leftAxis.setAxisMaxValue(100f);
         leftAxis.setAxisLineColor(getResources().getColor(R.color.red));
         sChart.getAxisRight().setEnabled(false);
         sChart.getAxisLeft().setEnabled(true);
@@ -407,11 +407,16 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
             }
             @Override
             public String getFormattedValue(float value) {
-                if (value==0){
-                    return "0";
-                }else {
-                    return mFormat.format(value);
+                try {
+                    if (value==0){
+                        return "0";
+                    }else {
+                        return mFormat.format(value);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
+                return  "";
             }
         });
         dataSets.clear();
@@ -461,11 +466,16 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
             }
             @Override
             public String getFormattedValue(float value) {
-                if (value==0){
-                    return "0";
-                }else {
-                    return mFormat.format(value);
+                try {
+                    if (value==0){
+                        return "0";
+                    }else {
+                        return mFormat.format(value);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
+                return "";
             }
         });
         dataSets1.clear();
@@ -530,26 +540,38 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                     if (sales != null) {
                         if (!sales.isEmpty()){
                             if (sales.size() != 2) {
-                                //__元/第__名   第一名:__金额:__元
                                 CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
                                          "NO."+"__"+"\n¥__",
                                         new String[]{"__"},ct.getResources().getColor(R.color.gray)
                                         );
                                 CommonUtil.textAarrySpanForStyle(tv_rank_sale_right,
-                                        "NO.1:" + sales.getJSONArray(0).getString(1)
+                                        "NO." + sales.getJSONArray(0).getIntValue(2)
+                                                + ":" + sales.getJSONArray(0).getString(1)
                                                 + "\n¥" + sales.getJSONArray(0).get(0) + ""
-                                        , new String[]{sales.getJSONArray(0).getString(1),
+                                        , new String[]{
+                                                String.valueOf(sales.getJSONArray(0).getIntValue(2)),
+                                                sales.getJSONArray(0).getString(1),
                                                 String.valueOf(sales.getJSONArray(0).get(0))},
                                         ct.getResources().getColor(R.color.gray));
-//                                tv_rank_sale_right.setText("第一名:" + sales.getJSONArray(0).getString(1)
-//                                        + "金额:" + sales.getJSONArray(0).getIntValue(0) + "元");
-                
                             } else {
-                                tv_rank_sale_left.setText("NO.1\n"+"¥"+sales.getJSONArray(1).get(0));
-                                tv_rank_sale_right.setText("NO._:" + sales.getJSONArray(0).getString(1)
-                                        + "\n¥" + sales.getJSONArray(1).get(0) + "");
-                                sales.getJSONArray(1).get(0);//自己  元
-                                sales.getJSONArray(1).getString(1);//自己
+                                CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
+                                        "NO." + sales.getJSONArray(1).getIntValue(2)
+                                                + ":" + sales.getJSONArray(1).getString(1)
+                                                + "\n¥" + sales.getJSONArray(1).get(0) + ""
+                                        , new String[]{
+                                                String.valueOf(sales.getJSONArray(1).getIntValue(2)),
+                                                sales.getJSONArray(1).getString(1),
+                                                String.valueOf(sales.getJSONArray(1).get(0))},
+                                        ct.getResources().getColor(R.color.gray));
+                                CommonUtil.textAarrySpanForStyle(tv_rank_sale_right,
+                                        "NO." + sales.getJSONArray(0).getIntValue(2)
+                                                + ":" + sales.getJSONArray(0).getString(1)
+                                                + "\n¥" + sales.getJSONArray(0).get(0) + ""
+                                        , new String[]{
+                                                String.valueOf(sales.getJSONArray(0).getIntValue(2)),
+                                                sales.getJSONArray(0).getString(1),
+                                                String.valueOf(sales.getJSONArray(0).get(0))},
+                                        ct.getResources().getColor(R.color.gray));
                             }
                         }
                    
@@ -596,21 +618,35 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
 
                     if (profits != null&&!profits.isEmpty()) {
                         if (profits.size() == 2) {
-                            tv_rank_rirun_left.setText("NO:"+"__"+"\n¥__");
-                            tv_rank_rirun_right.setText("NO1:" + profits.getJSONArray(1).getString(1)
-                                    + "\n¥" + profits.getJSONArray(1).get(0));
-                            profits.getJSONArray(1).get(0);//第一名  元
-                            profits.getJSONArray(1).getString(1);//第一名
-                            profits.getJSONArray(1).getIntValue(2);//第一名  元
+                            CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
+                                    "NO."+profits.getJSONArray(1).getIntValue(2)+":" 
+                                            + profits.getJSONArray(1).getString(1)
+                                            + "\n¥" + profits.getJSONArray(1).get(0) + " "
+                                    , new String[]{
+                                            String.valueOf(profits.getJSONArray(1).getIntValue(2)),
+                                            profits.getJSONArray(1).getString(1),
+                                            String.valueOf(profits.getJSONArray(1).get(0))
+                                    }, ct.getResources().getColor(R.color.gray));
+                            CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,
+                                    "NO." + profits.getJSONArray(0).getIntValue(2)
+                                            + ":" + profits.getJSONArray(0).getString(1)
+                                            + "\n¥" + profits.getJSONArray(0).get(0) + " "
+                                    , new String[]{
+                                            String.valueOf(profits.getJSONArray(0).getIntValue(2)),
+                                            profits.getJSONArray(0).getString(1),
+                                            String.valueOf(profits.getJSONArray(0).get(0))
+                                    }, ct.getResources().getColor(R.color.gray));
                         } else {
                             CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
                                     "NO.__"+"\n¥"+"__",
                                     new String[]{
                                             "__","__"},ct.getResources().getColor(R.color.gray));
                             CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,
-                                    "NO.1:" + profits.getJSONArray(0).getString(1)
+                                    "NO." + profits.getJSONArray(0).getIntValue(2)
+                                            + ":" + profits.getJSONArray(0).getString(1)
                                             + "\n¥" + profits.getJSONArray(0).get(0) + " "
                                     , new String[]{
+                                            String.valueOf(profits.getJSONArray(0).getIntValue(2)),
                                             profits.getJSONArray(0).getString(1),
                                             String.valueOf(profits.getJSONArray(0).get(0))
                                     }, ct.getResources().getColor(R.color.gray));
@@ -621,12 +657,21 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
 
                     if (receivables != null&&!receivables.isEmpty()) {
                         if (receivables.size() == 2) {
-                            tv_rank_income_left.setText("NO.1\n"+"¥"+receivables.getJSONArray(1).get(0));
-                            tv_rank_income_right.setText("NO.1:" + receivables.getJSONArray(1).getString(1)
-                                    + "\n¥" + receivables.getJSONArray(1).get(0));
-                            receivables.getJSONArray(1).get(0);//第一名  元
-                            receivables.getJSONArray(1).getString(1);//第一名
-                            receivables.getJSONArray(1).get(2);//第一名  元
+                            CommonUtil.textAarrySpanForStyle(tv_rank_income_left,
+                                    "NO."+ receivables.getJSONArray(1).getIntValue(2)
+                                            +":" + receivables.getJSONArray(1).getString(1)
+                                            + "\n¥:" + receivables.getJSONArray(1).get(0) + " "
+                                    , new String[]{
+                                            String.valueOf( receivables.getJSONArray(1).getString(2)),
+                                            receivables.getJSONArray(1).getString(1),
+                                            String.valueOf(receivables.getJSONArray(1).get(0))},
+                                    ct.getResources().getColor(R.color.gray));
+                            CommonUtil.textAarrySpanForStyle(tv_rank_income_right,
+                                    "NO.1:" + receivables.getJSONArray(0).getString(1)
+                                            + "\n¥:" + receivables.getJSONArray(0).get(0) + " "
+                                    , new String[]{receivables.getJSONArray(0).getString(1),
+                                            String.valueOf(receivables.getJSONArray(0).get(0))},
+                                    ct.getResources().getColor(R.color.gray));
                         } else {
                             CommonUtil.textSpanForStyle(tv_rank_income_left,
                                     "NO.__"+"\n¥"+"__"
@@ -665,26 +710,6 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                         tv_chuhuo.setText("出货" + root.getIntValue("saleamount") + "元"); 
                         tv_huikuan.setText("回款" + root.getIntValue("backamount") + "元");
                     }
-                    
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_chuhuo
-//                    ,root.getIntValue("saleamount") + " 元出货单金额",
-//                            new String[]{String.valueOf(root.getIntValue("saleamount"))},
-//                            ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_customer,root.getIntValue("customercount") + " 个新增客户"
-//                    ,new String[]{String.valueOf(root.getIntValue("customercount"))},ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle( tv_sale_linkman,root.getIntValue("contactcount") + " 个新增联系人"
-//                            ,new String[]{String.valueOf(root.getIntValue("contactcount"))},ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle( tv_sale_order,root.getIntValue("salecount") + " 个新增销售单"
-//                            ,new String[]{String.valueOf(root.getIntValue("salecount") )},ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_businessChange,root.getIntValue("nichechangecount") + " 个新增商机变更"
-//                            ,new String[]{String.valueOf(root.getIntValue("nichechangecount"))},ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_business,root.getIntValue("nichecount") + " 个新增商机数"
-//                            ,new String[]{String.valueOf(root.getIntValue("nichecount"))},ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_huikuan, root.getIntValue("backamount") + " 元回款"
-//                            , new String[]{String.valueOf(root.getIntValue("backamount"))}, ct.getResources().getColor(R.color.yellow_home));
-//                    CommonUtil.textAarrySpanForStyle(tv_sale_visit, root.getJSONArray("visit").getIntValue(0) + " 个/" + root.getJSONArray("visit").getIntValue(1) + " 次"
-//                            , new String[]{String.valueOf(root.getJSONArray("visit").getIntValue(0)),
-//                            String.valueOf(root.getJSONArray("visit").getIntValue(1))}, ct.getResources().getColor(R.color.yellow_home));
                     break;
                 case INIT_Targets://指标
                     progressDialog.dismiss();
@@ -901,26 +926,26 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                             startActivity(new Intent(ClientActivity.this, BusinessAddActivity.class));
                             break;
                         case 1:
-                            startActivity(new Intent(ClientActivity.this, CustomerAddActivity.class));
+                            startActivity(new Intent(ClientActivity.this, CustomerAddActivity.class).putExtra("type",1));
                             break;
-                        case 2:
+                       /* case 2:
                             startActivity(new Intent(ClientActivity.this, TaskAddActivity.class).putExtra("type", 0));
                             break;
                         case 3:
                             startActivity(new Intent(ClientActivity.this, TaskAddActivity.class).putExtra("type", 1));
-                            break;
+                            break;*/
                         /*case 5:
 
                             break;*/
-                        case 4:
+                        case 2:
                             startActivity(new Intent(ClientActivity.this, VisitReportPlanActivity.class));
                             break;
-                        case 5:
+                        case 3:
                             startActivity(new Intent(ClientActivity.this, VisitReportAddActivity.class));
                             break;
-                        case 6:
+                       /* case 4:
                             startActivity(new Intent(ClientActivity.this, CustomerAddActivity.class).putExtra("type",1));
-                            break;
+                            break;*/
                     }
                     closePoppupWindow();
                 }
@@ -959,36 +984,36 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
         list.add(map);*/
 
         map = new HashMap<String, Object>();
-        map.put("item_name", "建商机");
+        map.put("item_name", "建商机");
         list.add(map);
 
         map = new HashMap<String, Object>();
-        map.put("item_name", "预录入客户");
+        map.put("item_name", "新增客户");
         list.add(map);
         
         
-        map = new HashMap<String, Object>();
+      /*  map = new HashMap<String, Object>();
         map.put("item_name", "新增任务");
         list.add(map);
         map = new HashMap<String, Object>();
         map.put("item_name", "新增日程");
-        list.add(map);
+        list.add(map);*/
 
         /*map = new HashMap<String, Object>();
         map.put("item_name", "新增分享");
         list.add(map);*/
 
         map = new HashMap<String, Object>();
-        map.put("item_name", "拜访计划");
+        map.put("item_name", "新增拜访计划");
         list.add(map);
 
         map = new HashMap<String, Object>();
-        map.put("item_name", "拜访报告");
+        map.put("item_name", "新增拜访报告");
         list.add(map);
 
-        map = new HashMap<String, Object>();
+     /*   map = new HashMap<String, Object>();
         map.put("item_name", "录入客户");
-        list.add(map);
+        list.add(map);*/
         return list;
     }
 

+ 34 - 4
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/CustomerAddActivity.java

@@ -231,10 +231,12 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
     }
 
     private static final int CURRENT_STAGE = 21;
+    private final int CUSTOMTER_TYPE=24;
     private static final int PAY_METHODS = 22;
     private static final int GET_CURRENCY = 23;
     private static final int REQUEST_CLERK = 1;
     private static final int GET_CU_ID = 25;
+    
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -306,9 +308,9 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
                     showSimpleDialog(tv_cu_currency, "币别");
                     break;
                 case GET_CU_ID:
-                    String resultStr = msg.getData().getString("result");
+                    json = msg.getData().getString("result");
                     try {
-                        JSONObject resultJsonObject = new JSONObject(resultStr);
+                        JSONObject resultJsonObject = new JSONObject(json);
                         if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
                             mCuId = resultJsonObject.getInt("id");
                         }
@@ -316,6 +318,23 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
                         e.printStackTrace();
                     }
                     break;
+                case CUSTOMTER_TYPE:
+                     progressDialog.dismiss();
+                     json = msg.getData().getString("result");
+                     Log.i(TAG, "handleMessage:" +json );
+                     mLists.clear();
+                    array = JSON.parseObject(json).getJSONArray("datas");
+                    if (!array.isEmpty()) {
+                        for (int i = 0; i < array.size(); i++) {
+                            mLists.add(array.getJSONObject(i).getString("ck_kind"));
+                        }
+                    }
+
+                    if (mLists.isEmpty()) {
+                        mLists.add("无");
+                    }
+                    showSimpleDialog(et_cu_kind, "客户类型");
+                    break;
             }
         }
     };
@@ -355,7 +374,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
         Map<String, Object> params = new HashMap<>();
         params.put("formStore", formStore);
         if(type==1){
-            url= Constants.getAppBaseUrl(ct) + "scm/sale/saveCustomer.action";
+            url= Constants.getAppBaseUrl(ct) + "scm/sale/saveCustomerBase.action";
             params.put("caller", "Customer");
         }else{
             params.put("caller", "PreCustomer");
@@ -461,6 +480,17 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
         ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, CURRENT_STAGE, null, null, "post");
     }
 
+    public void loadCustomerType(){
+        progressDialog.show();
+        String url = Constants.getAppBaseUrl(ct) + "mobile/common/getDbfind.action";
+        Map<String, Object> params = new HashMap<>();
+        params.put("which", "form");
+        params.put("caller", "Customer!Base");
+        params.put("field", "cu_kind");
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, CUSTOMTER_TYPE, null, null, "post");
+    }
     /**
      * 加载收款方式
      */
@@ -508,7 +538,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
     public void onClick(View v) {
         switch (v.getId()) {
             case R.id.et_cu_kind:
-                onPopupButtonClick(v);
+                loadCustomerType();
                 break;
             case R.id.et_cu_district:
                 onPopupButtonClick(v);

+ 70 - 29
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/TaskAddActivity.java

@@ -55,6 +55,7 @@ public class TaskAddActivity extends BaseActivity implements View.OnClickListene
     private String code = null;
     private int type;
     private boolean isBusiness;
+    private String form;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -68,6 +69,7 @@ public class TaskAddActivity extends BaseActivity implements View.OnClickListene
         ViewUtils.inject(this);
         type = getIntent().getIntExtra("type", 0);
         code = getIntent().getStringExtra("data");
+        form=getIntent().getStringExtra("from");
         isBusiness = getIntent().getBooleanExtra("business", false);
         if (type == 0) {
             getSupportActionBar().setTitle("新增任务");
@@ -85,11 +87,13 @@ public class TaskAddActivity extends BaseActivity implements View.OnClickListene
         tv_priority.setOnClickListener(this);
         tv_date.setOnClickListener(this);
         tv_date_start.setOnClickListener(this);
-        findViewById(R.id.tv_executive).setOnClickListener(this);
+        tv_executive.setOnClickListener(this);
         tv_date.setKeyListener(null);
         tv_date.setFocusable(false);
         tv_date_start.setKeyListener(null);
         tv_date_start.setFocusable(false);
+        tv_executive.setKeyListener(null);
+        tv_executive.setFocusable(false);
         tv_notice.setKeyListener(null);
         tv_notice.setFocusable(false);
         tv_priority.setKeyListener(null);
@@ -112,7 +116,9 @@ public class TaskAddActivity extends BaseActivity implements View.OnClickListene
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
             case R.id.btn_save:
-                if (tv_name.testValidity() && tv_executive.testValidity() && tv_date.testValidity()
+                if (tv_name.testValidity() && 
+                        tv_executive.testValidity()
+                        && tv_date.testValidity()
                         && tv_priority.testValidity()
                         && tv_date_start.testValidity()) {
                     sendHttpResquest(Constants.HTTP_SUCCESS_INIT);
@@ -204,34 +210,69 @@ public class TaskAddActivity extends BaseActivity implements View.OnClickListene
         if (isBusiness) {
             strs = "\"handstatus\":\"" + "未完成" + "\",\n" +//编号
                     "\"handstatuscode\":\"" + "UNFINISHED" + "\",\n";
+        }//BusinessDetailInfo
+        String formStore;
+        if (form.equals("BusinessDetailInfo")){
+             formStore = "{\n" +
+                    "\"taskcode\":\"" + tv_code + "\",\n" +//编号
+                    "\"name\":\"" + tv_name.getText().toString() + "\",\n" +//名称
+                    "\"resourcename\":\"" +//执行人
+                    tv_executive.getText().toString() +
+                    "\",\n" +
+                    "\"enddate\":\"" +//结束时间
+                    tv_date.getText().toString() +
+                    "\",\n" +
+                     "\"class\":\"" +//商机详情进来
+                      "bstask" +
+                     "\",\n" +
+                    "\"startdate\":\"" +//结束时间
+                    tv_date_start.getText().toString() +
+                    "\",\n" +
+                    "\"tasklevel\":\"" +
+                    tv_priority.getText().toString() +//任务优先级
+                    "\",\n" +
+                    "\"taskorschedule\":\"" + str//任务类型
+                    + "\",\n" +
+                    "\"custname\":\"" +
+                    tv_customer.getText().toString() +//联系人
+                    "\",\n" +
+                    "\"timealert\":\"" +
+                    tv_notice.getText().toString() +//提醒
+                    "\",\n" +
+                    "\"description\":\"" +
+                    tv_content.getText().toString() +
+                    "\",\n" + (isBusiness ? strs : "") +
+                    "}";
+        }else{
+           formStore = "{\n" +
+                    "\"taskcode\":\"" + tv_code + "\",\n" +//编号
+                    "\"name\":\"" + tv_name.getText().toString() + "\",\n" +//名称
+                    "\"resourcename\":\"" +//执行人
+                    tv_executive.getText().toString() +
+                    "\",\n" +
+                    "\"enddate\":\"" +//结束时间
+                    tv_date.getText().toString() +
+                    "\",\n" +
+                    "\"startdate\":\"" +//结束时间
+                    tv_date_start.getText().toString() +
+                    "\",\n" +
+                    "\"tasklevel\":\"" +
+                    tv_priority.getText().toString() +//任务优先级
+                    "\",\n" +
+                    "\"taskorschedule\":\"" + str//任务类型
+                    + "\",\n" +
+                    "\"custname\":\"" +
+                    tv_customer.getText().toString() +//联系人
+                    "\",\n" +
+                    "\"timealert\":\"" +
+                    tv_notice.getText().toString() +//提醒
+                    "\",\n" +
+                    "\"description\":\"" +
+                    tv_content.getText().toString() +
+                    "\",\n" + (isBusiness ? strs : "") +
+                    "}";
         }
-        String formStore = "{\n" +
-                "\"taskcode\":\"" + tv_code + "\",\n" +//编号
-                "\"name\":\"" + tv_name.getText().toString() + "\",\n" +//名称
-                "\"resourcename\":\"" +//执行人
-                tv_executive.getText().toString() +
-                "\",\n" +
-                "\"enddate\":\"" +//结束时间
-                tv_date.getText().toString() +
-                "\",\n" +
-                "\"startdate\":\"" +//结束时间
-                tv_date_start.getText().toString() +
-                "\",\n" +
-                "\"tasklevel\":\"" +
-                tv_priority.getText().toString() +//任务优先级
-                "\",\n" +
-                "\"taskorschedule\":\"" + str//任务类型
-                + "\",\n" +
-                "\"custname\":\"" +
-                tv_customer.getText().toString() +//联系人
-                "\",\n" +
-                "\"timealert\":\"" +
-                tv_notice.getText().toString() +//提醒
-                "\",\n" +
-                "\"description\":\"" +
-                tv_content.getText().toString() +
-                "\",\n" + (isBusiness ? strs : "") +
-                "}";
+   
         String url = Constants.getAppBaseUrl(ct) + "plm/task/addbilltask.action";
         Map<String, Object> params = new HashMap<>();
         params.put("formStore", formStore);

+ 3 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java

@@ -198,7 +198,7 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
                 && tv_visit_steps.testValidity() && tv_visit_content.testValidity()) {
             formStore =
                     "{\n" +
-                            " \"vr_id\":" + mVrId + ",\n" +
+                            "\"vr_id\":" + mVrId + ",\n" +
                             "\"vr_code\":\"" + code
                             + "\",\n" +
                             "\"vr_visittime\":\""
@@ -358,6 +358,8 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
                         for (int i = 0; i < array.size(); i++) {
                             if (value.equals(array.getJSONObject(i).getString("CU_NAME"))) {
                                 vp_code = array.getJSONObject(i).getString("CU_CODE");
+                                tv_linksman_login.setText(array.getJSONObject(i).getString("CU_CONTACT"));
+                                tv_address_login.setText(array.getJSONObject(i).getString("CU_ADD1"));
                             }
                         }
                     }

+ 1 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportPlanActivity.java

@@ -24,6 +24,7 @@ import com.xzjmyk.pm.activity.ui.erp.util.ViewUtil;
 import com.xzjmyk.pm.activity.ui.erp.view.SingleDialog;
 import com.xzjmyk.pm.activity.util.BaiduMapUtil;
 import com.xzjmyk.pm.activity.util.DateFormatUtil;
+import com.xzjmyk.pm.activity.util.TimeUtils;
 import com.xzjmyk.pm.activity.view.wheel.DateTimePicker;
 
 import org.json.JSONException;

+ 25 - 9
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/AddMeetingActivity.java

@@ -7,6 +7,8 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.TextView;
@@ -123,6 +125,26 @@ public class AddMeetingActivity extends BaseActivity implements View.OnClickList
         }
     };
 
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        if (item.getItemId() == R.id.save) {
+            CodeUtil.getInstance().getCode(ct, "Meetingroomapply", new CodeUtil.OnCodeLinstener() {
+                @Override
+                public void callBack(final String code) {
+                    ma_code = code;
+                    getIdByNet();
+                }
+            });
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.menu_visit_save, menu);
+        return super.onCreateOptionsMenu(menu);
+    }
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -160,13 +182,7 @@ public class AddMeetingActivity extends BaseActivity implements View.OnClickList
                 }
                 break;
             case R.id.bt_save:
-                CodeUtil.getInstance().getCode(ct, "Meetingroomapply", new CodeUtil.OnCodeLinstener() {
-                    @Override
-                    public void callBack(final String code) {
-                        ma_code = code;
-                        getIdByNet();
-                    }
-                });
+
                 break;
             case R.id.users_rl://选择参会人员
                 Intent intent = new Intent(ct, UserSelectActivity.class);
@@ -320,10 +336,10 @@ public class AddMeetingActivity extends BaseActivity implements View.OnClickList
                 "\"resourcename\":\"" +//执行人
                 resourcename.toString() +
                 "\",\n" +
-                "\"enddate\":\"" +//结束时间
+                "\"startdate\":\"" +//结束时间
                 start_tv.getText().toString() +
                 "\",\n" +
-                "\"startdate\":\"" +//结束时间
+                "\"enddate\":\"" +//结束时间
                 end_tv.getText().toString() +
                 "\",\n" +
                 "\"tasklevel\":\"" +

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

@@ -7,16 +7,24 @@ import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.os.Handler;
+import android.os.Message;
 import android.support.v7.app.NotificationCompat;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.bean.oa.Signin;
 import com.xzjmyk.pm.activity.db.dao.SigninDao;
 import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
+import com.xzjmyk.pm.activity.ui.erp.util.ViewUtil;
 import com.xzjmyk.pm.activity.util.TimeUtils;
 
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -25,13 +33,80 @@ import java.util.regex.Pattern;
  */
 public class AlarmReceiver extends BroadcastReceiver {
 
+    private Context ct;
+    private boolean isU;
+
+    private Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            if (msg.what == 0x11) {
+                String message = msg.getData().getString("result");
+                if (JSON.parseObject(message).containsKey("listdata")) {
+                    JSONArray array = JSON.parseObject(message).getJSONArray("listdata");
+                    String[] time = new String[array.size()];
+                    for (int i = 0; i < array.size(); i++) {
+                        time[i] = array.getJSONObject(i).containsKey("cl_time") ? array.getJSONObject(i).getString("cl_time") : "--";
+                    }
+                    //判断是否已经签到过了
+                    ArrayList<Signin> signins = SigninDao.getInstance(ct).query();
+                    String str = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");
+                    //判断当前时间在哪个区间
+                    for (Signin e : signins) {
+                        if (str.compareTo(e.getUsigmin()) > 0 && str.compareTo(e.getDsigmin()) < 0) {
+                            //当前时间在这个打卡时间之内,判断是否已经打卡
+                            if (e.getUtime() == null || e.getDtime() == null) {
+                                //提醒
+                                sendNotification(ct, isU);
+                                return;
+                            }
+                            if (isU && time.length > 0 && time[0].compareTo(e.getUtime()) < 0) {
+                                //已经打卡到上班卡了
+
+                            } else if (!isU && time.length > 0 && time[time.length - 1].compareTo(e.getDtime()) > 0) {
+                                //已经打卡到下班卡了
+                            } else {
+                                //提醒
+                                sendNotification(ct, isU);
+                            }
+                            break;
+                        }
+                    }
+
+                }
+            }
+
+        }
+    };
+
     @Override
     public void onReceive(Context context, Intent intent) {
+        this.ct = context;
         if (intent.getAction().equals(AlarmaActivity.KEY_ALAR_ACTION)) {//上班签到提醒
-            sendNotification(context, false);//当前为上班   则下一次为下班
-        } else if (intent.getAction().equals(AlarmaActivity.KEY_UALAR_ACTION)) {//下班签到提醒
-            sendNotification(context, true);
+            isU = true;
+        } else {//下班签到提醒
+            isU = true;
         }
+        loadLog(context);
+    }
+
+
+    //获取打卡记录 date:yyyy-MM-dd
+    private void loadLog(Context ct) {
+        //获取网络数据
+        String code = CommonUtil.getSharedPreferences(ct, "erp_username");
+        String date = TimeUtils.s_long_2_str(System.currentTimeMillis());
+        String url = "mobile/common/list.action";
+        final Map<String, Object> param = new HashMap<>();
+        param.put("currentMaster", CommonUtil.getSharedPreferences(ct, "erp_master"));
+        param.put("page", 1);
+        param.put("pageSize", 1000);
+        param.put("condition", "cl_emcode='" + code + "' and to_char(cl_time,'yyyy-MM-dd')='" + date + "'");
+        param.put("caller", "CardLog");
+        param.put("emcode", code);
+        param.put("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"));
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        ViewUtil.httpSendRequest(ct, url, param, handler, headers, 0x11, null, null, "get");
     }
 
     /**
@@ -55,7 +130,7 @@ public class AlarmReceiver extends BroadcastReceiver {
             stringExtra = context.getResources().getString(R.string.ualar_content);
         }
         builder.setContentText(stringExtra);
-        Intent intent = new Intent(context, AlarmaActivity.class);
+        Intent intent = new Intent(context, SigninActivity.class);
         PendingIntent pendingIntent = PendingIntent.getActivity(context.getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
         builder.setContentIntent(pendingIntent);
         mNotificationManager.notify(1000, builder.build());

+ 8 - 10
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/MeetDetailsActivity.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 import android.widget.TextView;
@@ -24,6 +25,7 @@ import com.xzjmyk.pm.activity.ui.base.BaseActivity;
 import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
 import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
 import com.xzjmyk.pm.activity.util.BaiduMapUtil;
+import com.xzjmyk.pm.activity.util.StringUtils;
 import com.xzjmyk.pm.activity.util.TimeUtils;
 import com.xzjmyk.pm.activity.util.ToastUtil;
 
@@ -63,7 +65,6 @@ public class MeetDetailsActivity extends BaseActivity implements View.OnClickLis
     private final int whatLoad = 0x11, SIGNNIN = 0x12, ENDMEET = 0x13;
     private int ma_id;
     private String ma_code;
-    private JSONObject object;
     private boolean isPlay = true;
     private Handler handler = new Handler() {
         @Override
@@ -72,7 +73,6 @@ public class MeetDetailsActivity extends BaseActivity implements View.OnClickLis
             String message = (String) msg.getData().get("result");
             switch (msg.what) {
                 case whatLoad:
-                    object = JSON.parseObject(message).getJSONObject("panelData");
 //                    updataUI();
                     break;
                 case ENDMEET:
@@ -169,7 +169,7 @@ public class MeetDetailsActivity extends BaseActivity implements View.OnClickLis
         findViewById(R.id.location_tag).setOnClickListener(this);
         findViewById(R.id.add_task_ll).setOnClickListener(this);
         if (entity == null) return;
-        if (entity.getMa_recorder() != null && !MyApplication.getInstance().mLoginUser.getNickName().equals(entity.getMa_recorder())) {
+        if (entity.getMa_recorder() != null && !MyApplication.getInstance().mLoginUser.getNickName().equals(entity.getMa_recorder()) || "已结束".equals(status_tv.getText().toString().trim())) {
             end_meet_tv.setVisibility(View.GONE);
         } else {
             end_meet_tv.setVisibility(View.VISIBLE);
@@ -178,21 +178,19 @@ public class MeetDetailsActivity extends BaseActivity implements View.OnClickLis
         addr_tv.setText(entity.getMa_mrname() == null ? "未填写" : entity.getMa_mrname());
         sub_tv.setText(entity.getMa_remark() == null ? "" : entity.getMa_remark());
         user_tv.setText(entity.getMa_recorder() == null ? "" : entity.getMa_recorder());
-        tag_tv.setText(entity.getMa_tag() == null ? "" : entity.getMa_tag());
+        Log.i("gongpengming", (StringUtils.isEmpty(entity.getMa_tag()) ? "未填写" : entity.getMa_tag()));
+        tag_tv.setText(StringUtils.isEmpty(entity.getMa_tag()) ? "未填写" : entity.getMa_tag());
         //设置会议状态
         String str = entity.getMa_stage();
-        if (str == null) {
+        if (StringUtils.isEmpty(str)) {
             if (TimeUtils.f_str_2_long(entity.getMa_starttime()) > System.currentTimeMillis())
                 str = "未开始";
             else
                 str = "进行中";
-        } else {
-            if ("已结束".equals(str)) {
-
-            }
         }
         status_tv.setText(str);
         //设置开始和结束时间的显示
+        name_tv.setText(entity.getMa_theme() == null ? "" : entity.getMa_theme());
         long startLongTime = TimeUtils.f_str_2_long(entity.getMa_starttime());
         oa_meeting_start.setText(TimeUtils.long2str(startLongTime, "MM月dd"));
         oa_meeting_start_date.setText(TimeUtils.long2str(startLongTime, "HH:mm"));
@@ -323,7 +321,7 @@ public class MeetDetailsActivity extends BaseActivity implements View.OnClickLis
                 bean.setMd_title(name_tv.getText().toString());
                 bean.setMd_mtname("");
                 bean.setMd_meetingname("");
-                bean.setMd_meetingcode("");
+                bean.setMd_meetingcode(ma_code);
                 bean.setMd_mrcode("");
                 bean.setMd_mrname("");
                 bean.setMd_starttime(entity == null ? TimeUtils.f_long_2_str(System.currentTimeMillis()) : entity.getMa_starttime());

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

@@ -267,12 +267,11 @@ public class MeetingActivity extends BaseActivity {
             } else {
                 viewholder = (ViewHolder) view.getTag();
             }
-            MeetEntity entity = entities.get(i);
-            bindData(viewholder, entity);
+            bindData(viewholder, i);
             return view;
         }
-
-        private void bindData(ViewHolder viewholder, MeetEntity entity) {
+        private void bindData(ViewHolder viewholder, int i) {
+            MeetEntity entity = entities.get(i);
             //当系统时间<开始时间 会议状态为未开始,
             // 当会议开始时间<系统时间会议状态为进行中,当会议发起人点击结束会议按钮,
             // 状态更新为已结束,否则即使超过会议结束时间状态也是进行中
@@ -283,7 +282,8 @@ public class MeetingActivity extends BaseActivity {
                 else
                     str = "进行中";
             }
-            viewholder.oa_meeting_status_tv.setText(str);
+            entities.get(i).setMa_stage(str);
+            viewholder.oa_meeting_status_tv.setText(entities.get(i).getMa_stage());
             long startLong = TimeUtils.f_str_2_long(entity.getMa_starttime());
             long endLong = TimeUtils.f_str_2_long(entity.getMa_endtime());
             viewholder.oa_meeting_start.setText(TimeUtils.long2str(endLong, "MM月dd日"));
@@ -317,7 +317,6 @@ public class MeetingActivity extends BaseActivity {
             if (resultCode == 0x14) {
                 if ("data".equals(data.getStringExtra("data"))) {
                     list_business.setRefreshing(true);
-                    entities.clear();
                     loadNetData(1);
                 }
             } else if (resultCode == 0x15) {

+ 22 - 10
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java

@@ -6,6 +6,7 @@ import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuItem;
@@ -96,6 +97,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
                     JSONObject jsonObject = JSON.parseObject(message);
                     if (jsonObject.isEmpty()) return;
                     loadSuccess(jsonObject);
+                    rootScrollView.smoothScrollTo(0, 20);
                     break;
             }
         }
@@ -151,7 +153,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
             adapter.setBeans(chche);
         }
         setTaskDay(tag == 1 ? meBeans : otherBeans);
-        rootScrollView.smoothScrollTo(0, 20);
+
     }
 
     private void setTaskDay(List<OABean> beans) {
@@ -191,9 +193,16 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
         return beans;
     }
 
+    @Override
+    public void preOnCreacte() {
+        setTheme(R.style.CrmThemeVisit);
+        Log.i(TAG, "preOnCreacte:");
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        Log.i(TAG, "onCreate:");
         setContentView(R.layout.activity_oa);
         ViewUtils.inject(this);
         getSupportActionBar().setTitle("自动化办公");
@@ -210,7 +219,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
     public boolean onOptionsItemSelected(MenuItem item) {
         if (item.getItemId() == R.id.add_item) {
             showPopupWindow(getWindow().findViewById(R.id.add_item));
-//            popAdd();
         }
         return super.onOptionsItemSelected(item);
     }
@@ -319,6 +327,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
         if (getIntent() == null || getIntent().getIntExtra("type", 0) != 1) return;
         oa_rl_choose.setVisibility(View.GONE);
         getSupportActionBar().setTitle("客户拜访");
+
     }
 
     //获取数据
@@ -403,12 +412,14 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
     private List<Map<String, Object>> getPopData() {
         List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put("item_name", "创建任务");
-        list.add(map);
-        map = new HashMap<>();
-        map.put("item_name", "创建日程");
-        list.add(map);
-        map = new HashMap<>();
+        if (getIntent() == null || getIntent().getIntExtra("type", 0) != 1) {
+            map.put("item_name", "创建任务");
+            list.add(map);
+            map = new HashMap<>();
+            map.put("item_name", "创建日程");
+            list.add(map);
+            map = new HashMap<>();
+        }
         map.put("item_name", "新增拜访计划");
         list.add(map);
         map = new HashMap<>();
@@ -419,7 +430,6 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
 
     //设置控件点击事件
     private void setListener() {
-
         findViewById(R.id.signin).setOnClickListener(this);
         findViewById(R.id.outoffice).setOnClickListener(this);
         findViewById(R.id.meeting).setOnClickListener(this);
@@ -489,6 +499,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
             ok_scale.setVisibility(View.GONE);
             my_log_tag.setBackgroundResource(R.color.darkorange);
             my_client_log_tag.setBackgroundDrawable(null);
+            rootScrollView.smoothScrollTo(0, 20);
             if (adapter != null && meBeans != null) {
                 adapter.setBeans(meBeans);
                 setTaskDay(meBeans);
@@ -503,7 +514,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
                 setTaskDay(otherBeans);
             }
         }
-        rootScrollView.smoothScrollTo(0, 20);
+
     }
 
     //列表适配器
@@ -539,6 +550,7 @@ public class OAActivity extends BaseActivity implements View.OnClickListener {
         public void setBeans(List<OABean> beans) {
             this.beans = getBeans(beans);
             notifyDataSetChanged();
+                rootScrollView.smoothScrollTo(0, 20);
         }
 
         @Override

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

@@ -145,6 +145,7 @@ public class SaveMeetActivity extends BaseActivity {
         }
         progressDialog.show();
         bean.setMd_contents(strChche);
+//        bean.setMd_meetingcode(strChche);
         String url = CommonUtil.getSharedPreferences(this, "erp_baseurl") + "oa/meeting/saveMeetingDoc.action";
         final Map<String, Object> param = new HashMap<>();
         String formStore = FlexJsonUtil.toJson(bean);

+ 3 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/SigninActivity.java

@@ -8,12 +8,12 @@ import android.widget.RadioButton;
 
 import com.xzjmyk.pm.activity.R;
 import com.xzjmyk.pm.activity.ui.base.BaseActivity;
-import com.xzjmyk.pm.activity.ui.erp.fragment.SigninClickFragment;
+import com.xzjmyk.pm.activity.ui.erp.fragment.SigninFragment;
 import com.xzjmyk.pm.activity.ui.erp.fragment.SigninSetFragment;
 
 public class SigninActivity extends BaseActivity {
     private FragmentManager manager;
-    private SigninClickFragment signinFragment;
+    private SigninFragment signinFragment;
     private SigninSetFragment setFragment;
     private RadioButton setting_rb;
 
@@ -26,7 +26,7 @@ public class SigninActivity extends BaseActivity {
 
     private void initView() {
         manager = getSupportFragmentManager();
-        signinFragment = new SigninClickFragment();
+        signinFragment = new SigninFragment();
         manager.beginTransaction().add(R.id.content_fl, signinFragment).commit();
         setting_rb = (RadioButton) findViewById(R.id.setting_rb);
         setting_rb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

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

@@ -111,6 +111,10 @@ public class UserSelectActivity extends BaseActivity {
 
     private void initView() {
         View view = LayoutInflater.from(this).inflate(R.layout.view_empty, null);
+        TextView tvMessage = (TextView) view.findViewById(R.id.textViewMessage);
+        if (!isNet) {
+            tvMessage.setText("当前数据库没有找到数据,请点击通讯录页面的企业架构刷新数据");
+        }
         listview.setEmptyView(view);
         adapter = new MeetSelectAdapter();
         listview.setAdapter(adapter);
@@ -227,7 +231,7 @@ public class UserSelectActivity extends BaseActivity {
                 "whichsys=?");
         manager.closeDB();
         for (int i = 0; i < emList.size(); i++) {//企业通讯人员
-//            if (emList.get(i).getEm_IMID() == 0) continue;
+
             entities.add(EnterChatAction(emList.get(i)));
         }
 

+ 4 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/HListViewOneAdapter.java

@@ -74,11 +74,12 @@ public class HListViewOneAdapter extends BaseAdapter {
                 }else{
                     if (index!=0){
                         holder.tv_item[i].setText("●");
-                        holder.tv_item[i].setTextSize(18);
+                        holder.tv_item[i].setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
                         holder.tv_item[i].setTextColor(Color.parseColor(items.get(i)));
-                      //  holder.tv_item[i].setMinWidth(CommonUtil.dip2px(ct, 105));
+//                        holder.tv_item[i].setMinWidth(CommonUtil.dip2px(ct, 50));
+//                        holder.tv_item[i].setMinHeight(CommonUtil.dip2px(ct, 50));
                     }else{
-                        holder.tv_item[i].setTextSize(14);
+                        holder.tv_item[i].setTextSize(TypedValue.COMPLEX_UNIT_SP,14);
                         holder.tv_item[i].setTextColor(ct.getResources().getColor(R.color.black));
                       //  holder.tv_item[i].setBackgroundColor(ct.getResources().getColor(R.color.yellow_home));
                     }

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

@@ -0,0 +1,145 @@
+package com.xzjmyk.pm.activity.ui.erp.adapter;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.oa.Signin;
+import com.xzjmyk.pm.activity.db.dao.SigninDao;
+import com.xzjmyk.pm.activity.ui.erp.fragment.SigninFragment;
+import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
+import com.xzjmyk.pm.activity.util.TimeUtils;
+
+import java.util.ArrayList;
+
+/**
+ * Created by gongpengming on 2016/9/1.
+ */
+public class SigninAdapter extends RecyclerView.Adapter<SigninAdapter.ViewHoler> {
+    private Context ct;
+    private ArrayList<SigninFragment.Bean> beans;
+    private String time;
+
+    public SigninAdapter(Context ct) {
+        this.ct = ct;
+        time = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");
+    }
+
+    public ArrayList<SigninFragment.Bean> getBeans() {
+        return beans;
+    }
+
+    public void setBeans(ArrayList<SigninFragment.Bean> beans) {
+        this.beans = beans;
+        saveDB(beans);
+        time = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");
+    }
+
+    private void saveDB(ArrayList<SigninFragment.Bean> beans) {
+        ArrayList<Signin> signins = new ArrayList<>();
+        for (SigninFragment.Bean e : beans) {
+            signins.add(new Signin(e.getStartTime(), e.getEndTime(), e.getStartSignin(), e.getEndSignnin()));
+        }
+        SigninDao.getInstance(ct).updata(signins);
+    }
+
+    @Override
+    public ViewHoler onCreateViewHolder(ViewGroup parent, int viewType) {
+        ViewHoler holer = new ViewHoler(LayoutInflater.from(ct).inflate(R.layout.item_signin_list, parent, false));
+        return holer;
+    }
+
+    @Override
+    public void onBindViewHolder(ViewHoler holder, int position) {
+        SigninFragment.Bean b = beans.get(position);
+        holder.time.setText(b.getStartTime() == null ? "" : b.getStartTime());
+        holder.time2.setText(b.getEndTime() == null ? "" : b.getEndTime());
+        //处理签到时间
+        String start = "",
+                end = "";
+        if (!ListUtils.isEmpty(b.getSigninList()) && b.getSigninList().size() > 0) {
+            holder.signin.setText(b.getSigninList().get(0));//填充时间
+            holder.signin2.setText(b.getSigninList().get(b.getSigninList().size() - 1));//填充时间
+            Log.i("gongpengming", b.getStartTime() + "     " + b.getStartSignin() + "    " + getNext90(b.getStartTime(), true) + "    " + b.getSigninList().get(0));
+            start = getTag(b.getStartTime(), b.getStartSignin(), getNext90(b.getStartTime(), true), b.getSigninList().get(0), true);
+            Log.i("gongpengming", b.getEndTime() + "     " + getNext90(b.getEndTime(), false) + "    " + b.getEndSignnin() + "    " + b.getSigninList().get(b.getSigninList().size() - 1));
+            end = getTag(b.getEndTime(), getNext90(b.getEndTime(), false), b.getEndSignnin(), b.getSigninList().get(b.getSigninList().size() - 1), false);
+        } else {
+            start = end = "-1";
+        }
+        Log.i("gongpengming", "start=" + start);
+        Log.i("gongpengming", "end=" + end);
+        //处理标识
+        if ("-1".equals(start)) {//当前时间还没有到达上班时间,不能显示缺勤
+            holder.tag.setVisibility(View.GONE);
+        } else {
+            holder.tag.setText(start);
+            holder.tag.setVisibility(View.VISIBLE);
+        }
+        //处理标识
+        if ("-1".equals(end)) {//当前时间还没有到达下班时间
+            holder.tag2.setVisibility(View.GONE);
+        } else {
+            holder.tag2.setText(end);
+            holder.tag2.setVisibility(View.VISIBLE);
+        }
+    }
+
+    private long long90 = 90 * 1000 * 60;
+
+    private String getNext90(String hhmm, boolean isU) {//通过给出的时分获取到对应90分钟的时分
+        String chche = TimeUtils.s_long_2_str(System.currentTimeMillis()) + " " + hhmm + ":00";
+        long chchelong = isU ? long90 : (-long90);
+        return TimeUtils.long2str(TimeUtils.f_str_2_long(chche) + chchelong, "HH:mm");
+    }
+
+    /**
+     * @param workTime    上班时间
+     * @param startSignin 允许签到开始时间
+     * @param endSignin   允许签到结束时间
+     * @param proit       签到时间
+     * @return
+     */
+    private String getTag(String workTime, String startSignin, String endSignin, String proit, boolean isU) {
+        String tag = "";
+        if (proit.compareTo(workTime) < 0 && proit.compareTo(startSignin) > 0 || (isU && time.compareTo(workTime) < 0)) { //判断正常签到 在startSignin到workTime之间
+            tag = isU ? "-1" : "早退";
+        } else if (proit.compareTo(workTime) > 0 && proit.compareTo(endSignin) < 0 || (!isU && time.compareTo(workTime) < 0)) { //判断迟到签到 在workTime到endSignin
+            tag = isU ? "迟到" : "-1";
+        } else if (isU && proit.compareTo(endSignin) > 0) {//当签到时间大于endSignin,为缺勤
+            tag = "缺勤";
+        } else if (!isU && (proit.compareTo(startSignin) < 0 || proit.compareTo(endSignin) > 0)) {
+            tag = "缺勤";
+        }
+        return tag;
+    }
+
+    @Override
+    public int getItemCount() {
+        return beans == null ? 0 : beans.size();
+    }
+
+    class ViewHoler extends RecyclerView.ViewHolder {
+        TextView time,
+                signin,
+                tag,
+                time2,
+                signin2,
+                tag2;
+
+        public ViewHoler(View itemView) {
+            super(itemView);
+            time = (TextView) itemView.findViewById(R.id.time);
+            signin = (TextView) itemView.findViewById(R.id.signin);
+            tag = (TextView) itemView.findViewById(R.id.tag);
+            time2 = (TextView) itemView.findViewById(R.id.time2);
+            signin2 = (TextView) itemView.findViewById(R.id.signin2);
+            tag2 = (TextView) itemView.findViewById(R.id.tag2);
+        }
+    }
+}

+ 6 - 7
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/OutofficeFragment.java

@@ -4,6 +4,7 @@ import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.text.Html;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -78,7 +79,7 @@ public class OutofficeFragment extends EasyFragment implements View.OnClickListe
                 if (JSON.parseObject(message).containsKey("listdata")) {
                     json = JSON.parseObject(message).getJSONArray("listdata");
                     sigNum = json.size();
-                    num_tv.setText(sigNum + "");
+                    num_tv.setText(Html.fromHtml("<u>" + sigNum + "</u>"));
                 }
             }
 
@@ -117,17 +118,15 @@ public class OutofficeFragment extends EasyFragment implements View.OnClickListe
         AvatarHelper.getInstance().displayAvatar(loginUserId, name_img, true);
         name_tv.setText(MyApplication.getInstance().mLoginUser.getNickName());
         com_tv.setText(CommonUtil.getSharedPreferences(ct, "erp_commpany"));
-        String name = MyApplication.getInstance().getBdLocationHelper().getDistrictName();
-        String addr=MyApplication.getInstance().getBdLocationHelper().getAddress();
-        out_add_name_tv.setText( StringUtils.isEmail(name)?addr:name);
+        String name = MyApplication.getInstance().getBdLocationHelper().getName();
+        String addr = MyApplication.getInstance().getBdLocationHelper().getAddress();
+        out_add_name_tv.setText(name);
         out_add_t_tv.setText(addr);
-
         double latitude = MyApplication.getInstance().getBdLocationHelper().getLatitude();
         double longitude = MyApplication.getInstance().getBdLocationHelper().getLongitude();
         point = new LatLng(latitude, longitude);
-        baseAddr=StringUtils.isEmail(name)?addr:name;
+        baseAddr = StringUtils.isEmail(name) ? addr : name;
         BaiduMapUtil.getInstence().setMapViewPoint(mapView, point);
-
 //        BaiduMapUtil.getInstence().getPoiInfo(ct, new BaiduMapUtil.OnLocationListener() {
 //            @Override
 //            public void result(Map<String, Object> map) {

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

@@ -9,7 +9,6 @@ import android.os.Message;
 import android.support.v7.app.AlertDialog;
 import android.text.Html;
 import android.text.Spanned;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -137,7 +136,7 @@ public class SigninClickFragment extends EasyFragment implements View.OnClickLis
 
     @Override
     protected int inflateLayoutId() {
-        return R.layout.fragment_signin;
+        return R.layout.fragment_click_signin;
     }
 
     @Override
@@ -182,7 +181,6 @@ public class SigninClickFragment extends EasyFragment implements View.OnClickLis
         if (!StringUtils.isEmpty(distance)) {
             distanceOk = (int) Double.parseDouble(distance);
         }
-
         Spanned str = Html.fromHtml("<font color=\'#858585\'>距离考勤地点: " + (distanceOk == -1 ? -1 : distanceOk) + "米    " + "</font><font color=\'#f02387\'><U>地点微调</U></font>");
         return str;
     }
@@ -193,6 +191,7 @@ public class SigninClickFragment extends EasyFragment implements View.OnClickLis
         signin_btn.setOnClickListener(this);
         title.setOnClickListener(this);
         findViewById(R.id.unoffice_mm).setOnClickListener(this);
+        unoffice_mm.setText(getDistance(mylatitude, mylongitude));
     }
 
     private void seccess(boolean is) {

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

@@ -0,0 +1,548 @@
+package com.xzjmyk.pm.activity.ui.erp.fragment;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Html;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baidu.mapapi.search.core.PoiInfo;
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
+import com.xzjmyk.pm.activity.MyApplication;
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.oa.SigninBean;
+import com.xzjmyk.pm.activity.ui.base.BaseActivity;
+import com.xzjmyk.pm.activity.ui.base.EasyFragment;
+import com.xzjmyk.pm.activity.ui.erp.activity.oa.AlarmaActivity;
+import com.xzjmyk.pm.activity.ui.erp.activity.oa.LocationMapActivity;
+import com.xzjmyk.pm.activity.ui.erp.adapter.SigninAdapter;
+import com.xzjmyk.pm.activity.ui.erp.util.CodeUtil;
+import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
+import com.xzjmyk.pm.activity.ui.erp.util.FlexJsonUtil;
+import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
+import com.xzjmyk.pm.activity.ui.erp.util.ViewUtil;
+import com.xzjmyk.pm.activity.util.BaiduMapUtil;
+import com.xzjmyk.pm.activity.util.TimeUtils;
+import com.xzjmyk.pm.activity.view.crouton.Crouton;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * 常量:
+ * 0x11:下拉班次数据what
+ * 0x12:下拉打卡记录what
+ * 0x13:签到接口what
+ * 0x14:调转界面requestCode
+ * Created by gongpengming on 2016/9/1.
+ */
+public class SigninFragment extends EasyFragment implements View.OnClickListener {
+    private static final long DAY_TIME = 1000 * 60 * 60 * 24;
+    @ViewInject(R.id.listview)
+    private RecyclerView listview;
+    @ViewInject(R.id.seting)
+    private ImageView seting;
+    @ViewInject(R.id.title)
+    private TextView title;
+    @ViewInject(R.id.back)
+    private ImageView back;
+    @ViewInject(R.id.signin_btn)
+    private ImageView signin_btn;
+    @ViewInject(R.id.office_addr)
+    private TextView office_addr;//考勤地点
+    @ViewInject(R.id.unoffice_mm)
+    private TextView unoffice_mm;//地点微调
+
+    //变量
+    private BaseActivity ct;
+    private boolean isInCompany = false;//当前员工是否配置公司信息
+    private double companyX;//当前公司位置经度
+    private double companyY;//当前公司位置纬度
+    private int companyDistance = -1;//当前规定距离
+    private double longitude;//当前位置经度
+    private double latitude;//当前位置纬度
+    private int distance = 300;   //当前距离
+    private SigninAdapter adapter;
+    private long selectTime;//当前选择的日期的时间
+    private String code;//账号员工编号
+    private AlertDialog.Builder builder;
+    private String[] timeList = new String[5];
+    private boolean isToday = true;
+
+    private Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            String message = msg.getData().getString("result");
+            if (ct.progressDialog.isShowing())
+                ct.progressDialog.dismiss();
+            switch (msg.what) {
+                case 0x11:
+                    JSONObject jsonObject = JSON.parseObject(message);//返回对象
+                    if (jsonObject.containsKey("success") && jsonObject.getBoolean("success")) {//返回正常
+                        if (jsonObject.containsKey("comaddressset") ? jsonObject.getBoolean("comaddressset") : false) {//如果有分配公司
+                            isInCompany = true;
+                            companyDistance = Integer.parseInt(jsonObject.containsKey("distance") ? jsonObject.getString("distance") : "0");
+                            companyX = Double.parseDouble(jsonObject.containsKey("longitude") ? jsonObject.getString("longitude") : "0");
+                            companyY = Double.parseDouble(jsonObject.containsKey("latitude") ? jsonObject.getString("latitude") : "0");
+                            unoffice_mm.setText(setDistance());
+                        } else {
+                            Crouton.makeText(ct, "当前账号没有分配公司地址,请联系管理员!!");
+                        }
+                        if (jsonObject.containsKey("wd_degree") && jsonObject.getInteger("wd_degree") > 0) {//当该用户有排班
+                            //用户有排班时候
+                            setDataByDegree(jsonObject);
+                        } else {
+                            setDataByNoDegree(jsonObject);
+                        }
+                        loadLog(TimeUtils.s_long_2_str(selectTime));//获取打卡时间
+                    } else {
+                        //如果返回失败
+//                    ct.finish();
+                        Crouton.makeText(ct, "系统尚未找到您的班次,请联系管理员设置班次");
+                    }
+                    break;
+                case 0x12:
+                    if (JSON.parseObject(message).containsKey("listdata")) {
+                        setDataByLogs(JSON.parseObject(message).getJSONArray("listdata"));
+                    } else {
+                        Crouton.makeText(ct, "系统尚未找到您的打卡记录,请联系管理员设置班次");
+                    }
+                    break;
+                case 0x13:
+                    //签到成功
+                    signinOK();
+                    break;
+                default:
+                    break;
+            }
+
+        }
+    };
+
+
+    //生命周期
+    @Override
+    public void onAttach(Context ct) {
+        super.onAttach(ct);
+        this.ct = (BaseActivity) ct;
+    }
+
+    @Override
+    protected int inflateLayoutId() {
+        return R.layout.fragment_signin;
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (data == null) return;
+        if (requestCode == 0x14 && resultCode == LocationMapActivity.REQUCODE) {
+            PoiInfo poi = data.getParcelableExtra(LocationMapActivity.REQUESTNAME);
+            office_addr.setText("考勤地点:" + poi.name);
+            latitude = poi.location.latitude;
+            longitude = poi.location.longitude;
+            unoffice_mm.setText(setDistance());
+        }
+    }
+
+    @Override
+    public void onClick(View view) {
+        Intent intent = null;
+        switch (view.getId()) {
+            case R.id.seting:
+                intent = new Intent(ct, AlarmaActivity.class);
+                startActivity(intent);
+                break;
+            case R.id.back:
+                ct.finish();
+                break;
+            case R.id.signin_btn:
+                //TODO 判断是否可以签到
+                if (isPlay()) {
+                    CodeUtil.getInstance().getCode(ct, "CardLog", new CodeUtil.OnCodeLinstener() {
+                        @Override
+                        public void callBack(String code) {
+                            doSignin(code);
+                        }
+                    });
+                }
+                break;
+            case R.id.title:
+                showPopMenu();
+                break;
+            case R.id.unoffice_mm:
+                intent = new Intent(ct, LocationMapActivity.class);
+                startActivityForResult(intent, 0x14);
+                break;
+
+        }
+    }
+
+    @Override
+    protected void onCreateView(Bundle savedInstanceState, boolean createView) {
+        ViewUtils.inject(getmRootView());
+        init();
+        initView();
+        listener();
+    }
+
+    private void listener() {
+        seting.setOnClickListener(this);
+        back.setOnClickListener(this);
+        signin_btn.setOnClickListener(this);
+        title.setOnClickListener(this);
+        unoffice_mm.setOnClickListener(this);
+    }
+
+    private void init() {
+        longitude = MyApplication.getInstance().getBdLocationHelper().getLongitude();
+        latitude = MyApplication.getInstance().getBdLocationHelper().getLatitude();
+    }
+
+    private void initView() {
+        longitude = MyApplication.getInstance().getBdLocationHelper().getLongitude();
+        latitude = MyApplication.getInstance().getBdLocationHelper().getLatitude();
+        title.setText(TimeUtils.day_long_2_str(System.currentTimeMillis()) + "  " + TimeUtils.getWeek(System.currentTimeMillis()));
+        listview.setLayoutManager(new LinearLayoutManager(ct));
+        adapter = new SigninAdapter(ct);
+        listview.setAdapter(adapter);
+        office_addr.setText("考勤地点:" + MyApplication.getInstance().getBdLocationHelper().getName());
+        loadNetData(System.currentTimeMillis());//获取打卡班次信息
+    }
+
+    private void showPopMenu() {
+        //显示选择日期窗口
+        for (int i = 0; i < timeList.length; i++)
+            timeList[i] = TimeUtils.day_long_2_str(System.currentTimeMillis() - (DAY_TIME * i)) + "  " + TimeUtils.getWeek(System.currentTimeMillis() - (DAY_TIME * i));
+        title.setText(TimeUtils.day_long_2_str(System.currentTimeMillis()) + "  " + TimeUtils.getWeek(System.currentTimeMillis()));
+        if (builder == null) {
+            builder = new AlertDialog.Builder(ct);
+            builder.setItems(timeList, new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialogInterface, int i) {
+                    isToday = i == 0 ? true : false;
+                    title.setText(timeList[i]);
+                    if (adapter != null && adapter.getBeans() != null && adapter.getBeans().size() > 0)
+                        adapter.getBeans().clear();
+                    loadNetData(System.currentTimeMillis() - (DAY_TIME * i));
+                }
+            });
+        }
+        builder.show();
+    }
+
+    private boolean isPlay() {
+        if (companyDistance == -1) {
+            Crouton.makeText(ct, "您当前账号没有设置打卡地址信息,请联系管理员");
+            return false;
+        }
+        if (companyDistance < distance) {
+            Crouton.makeText(ct, "您当前位置距离考勤地点太远,请移往目标或重新定位");
+            return false;
+        }
+        if (!isToday) {
+            Crouton.makeText(ct, "当前所在日期无法签到");
+            return false;
+        }
+        ArrayList<Bean> beans = getDataByAdapter();
+        String time = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");
+        for (Bean e : beans) {
+            if (!StringUtils.isEmpty(e.getStartSignin()) && !StringUtils.isEmpty(e.getEndSignnin()) && time.compareTo(e.getStartSignin()) > 0 && time.compareTo(e.getEndTime()) < 0) {
+                return true;
+            }
+        }
+        Crouton.makeText(ct, "您不在打卡允许范围内,请稍后重试或联系管理员");
+        return false;
+    }
+
+    /**
+     * setData
+     */
+    private String setDistance() {
+        String dis = BaiduMapUtil.getInstence().getDistance(companyX, companyY, latitude, longitude);
+        String re = "";
+        try {
+            if (!StringUtils.isEmpty(dis)) {
+                distance = (int) Double.parseDouble(dis);
+                re = "" + Html.fromHtml("<font color=\'#858585\'>距离考勤地点: " + (distance == -1 ? -1 : distance) + "米    " + "</font><font color=\'#f02387\'><U>地点微调</U></font>");
+            }
+        } catch (ClassCastException e) {
+            e.printStackTrace();
+        }
+        return re;
+    }
+
+    //签到成功
+    private void signinOK() {
+        ArrayList<Bean> beans = getDataByAdapter();
+        String time = TimeUtils.long2str(System.currentTimeMillis(), "HH:mm");
+        for (int i = 0; i < beans.size(); i++) {
+            Bean b = beans.get(i);
+            if (!StringUtils.isEmpty(b.startSignin) && !StringUtils.isEmpty(b.endSignnin) && time.compareTo(b.startSignin) > 0 && time.compareTo(b.endSignnin) < 0) {
+                beans.get(i).getSigninList().add(time);
+            }
+        }
+        setDataForAdapter(beans);
+    }
+
+    //前后90分钟,isU--是否是上班
+    private String getEndSignin(String signin, boolean isU) {
+        String time = TimeUtils.s_long_2_str(System.currentTimeMillis()) + " " + signin + ":00";
+        long sigTime = TimeUtils.f_str_2_long(time);
+        long minTime = 0;
+        if (isU)
+            minTime = sigTime - 90 * 60 * 1000;
+        else
+            minTime = sigTime + 90 * 60 * 1000;
+        if (!TimeUtils.s_long_2_str(sigTime).equals(TimeUtils.s_long_2_str(minTime))) {
+            //不同一天
+            if (isU)
+                return "00:00";
+            else
+                return "23:59";
+        }
+        return TimeUtils.long2str(minTime, "HH:mm");
+    }
+
+    //获取打卡时间列表去除年月日和秒
+    private String clearDay(String time) {
+        return TimeUtils.long2str(TimeUtils.f_str_2_long(time), "HH:mm");
+    }
+
+
+    //处理数据,用户无排班时候
+    public void setDataByNoDegree(JSONObject object) {
+        ArrayList<Bean> beans = new ArrayList<>();
+        Bean b = null;
+        //上午
+        b = new Bean();
+        b.startTime = object.containsKey("as_amstarttime") ? object.getString("as_amstarttime") : "08:30";
+        b.startSignin = getEndSignin(b.startTime, true);
+        b.endTime = object.containsKey("as_amendtime") ? object.getString("as_amendtime") : "12:00";
+        b.endSignnin = getEndSignin(b.endTime, false);
+        beans.add(b);
+        //下午
+        b = new Bean();
+        b.startTime = object.containsKey("as_pmstarttime") ? object.getString("as_pmstarttime") : "13:30";
+        b.startSignin = getEndSignin(b.startTime, true);
+        b.endTime = object.containsKey("as_pmendtime") ? object.getString("as_pmendtime") : "18:00";
+        b.endSignnin = getEndSignin(b.endTime, false);
+        beans.add(b);
+        setDataForAdapter(beans);
+    }
+
+    private void bindClass(ArrayList<Bean> beans, JSONObject object) {
+        Bean b = new Bean();//上班
+        if (!object.containsKey("wd_onduty") || object.getString("wd_onduty") == null) return;
+        b.startTime = object.containsKey("wd_onduty") ? object.getString("wd_onduty") : "00:00";
+        b.startSignin = object.containsKey("wd_onbeg") ? object.getString("wd_onbeg") : "00:00";
+        b.endTime = object.containsKey("wd_offduty") ? object.getString("wd_offduty") : "00:00";
+        b.endSignnin = object.containsKey("wd_offend") ? object.getString("wd_offend") : "00:00";
+        beans.add(0, b);
+    }
+
+    //处理数据,用户有排班时候
+    public void setDataByDegree(JSONObject object) {
+        ArrayList<Bean> beans = new ArrayList<>();
+        //获取打卡地点及距离
+        if (object.containsKey("Class3"))
+            bindClass(beans, object.getJSONObject("Class3"));
+        if (object.containsKey("Class2"))
+            bindClass(beans, object.getJSONObject("Class2"));
+        if (object.containsKey("Class1"))
+            bindClass(beans, object.getJSONObject("Class1"));
+//        switch (num) {
+//            case 3:
+//                b = new Bean();//上班
+//                b.startTime = object.containsKey("wd_ondutythree") ? object.getString("wd_ondutythree") : "08:30";
+//                b.startSignin = object.containsKey("wd_onbeg3") ? object.getString("wd_onbeg3") : "07:00";
+//                b.endTime = object.containsKey("wd_offdutythree") ? object.getString("wd_offdutythree") : "11:30";
+//                b.endSignnin = object.containsKey("wd_offend3") ? object.getString("wd_offend3") : "12:00";
+//                beans.add(0, b);
+//            case 2:
+//                b = new Bean();
+//                b.startTime = object.containsKey("wd_ondutytwo") ? object.getString("wd_ondutytwo") : "--:--";
+//                b.startSignin = object.containsKey("wd_onbeg2") ? object.getString("wd_onbeg2") : "07:00";
+//                b.endTime = object.containsKey("wd_offdutytwo") ? object.getString("wd_offdutytwo") : "--:--";
+//                b.endSignnin = object.containsKey("wd_offend2") ? object.getString("wd_offend2") : "07:00";
+//                beans.add(0, b);
+//            case 1:
+//                b = new Bean();
+//                b.startTime = object.containsKey("wd_ondutyone") ? object.getString("wd_ondutyone") : "--:--";
+//                b.startSignin = object.containsKey("wd_onbeg1") ? object.getString("wd_onbeg1") : "07:00";
+//                b.endTime = object.containsKey("wd_offdutyone") ? object.getString("wd_offdutyone") : "--:--";
+//                b.endSignnin = object.containsKey("wd_offend1") ? object.getString("wd_offend1") : "07:00";
+//                beans.add(0, b);
+//                break;
+//        }//添加上班签到时间完成
+        setDataForAdapter(beans);
+    }
+
+    //处理数据,获取到用户签到列表
+    public void setDataByLogs(JSONArray array) {
+        ArrayList<Bean> beans = getDataByAdapter();
+        String[] logTime = new String[array.size()];
+        for (int i = 0; i < array.size(); i++) {//获取打卡记录中的打卡时间
+            logTime[i] = clearDay(array.getJSONObject(i).containsKey("cl_time") ? (array.getJSONObject(i).getString("cl_time") == null ? " " : array.getJSONObject(i).getString("cl_time")) : " ");
+        }
+        Arrays.sort(logTime);//排序时间数组
+        Bean b = null;
+        //TODO 待优化算法处理
+        for (int i = 0; i < beans.size(); i++) {
+            b = beans.get(i);
+            for (String e : logTime) {
+                if (!StringUtils.isEmpty(b.startSignin) && !StringUtils.isEmpty(b.endSignnin) && e.compareTo(b.startSignin) > 0 && e.compareTo(b.endSignnin) < 0) {
+                    beans.get(i).signinList.add(e);
+                }
+            }
+        }
+        setDataForAdapter(beans);
+    }
+
+    //从适配器中获取数据
+    private ArrayList<Bean> getDataByAdapter() {
+        return (adapter == null ? new ArrayList<Bean>() : (adapter.getBeans() == null ? new ArrayList<Bean>() : adapter.getBeans()));
+    }
+
+    //在设置完数据以后放到适配器中
+    private void setDataForAdapter(ArrayList<Bean> beans) {
+        if (adapter == null) {
+            adapter = new SigninAdapter(ct);
+            adapter.setBeans(beans);
+            listview.setAdapter(adapter);
+        } else {
+            adapter.setBeans(beans);
+        }
+        adapter.notifyDataSetChanged();
+    }
+
+
+    /**
+     * loadDatat
+     *
+     * @param time
+     */
+    //获取打卡时间
+    private void loadNetData(long time) {
+        selectTime = time;
+        //获取网络数据
+        String url = "mobile/getWorkDate.action";
+        int date = TimeUtils.int_long_2_str(time);
+        final Map<String, Object> param = new HashMap<>();
+        param.put("date", date);
+        loadNet(url, param, 0x11);
+    }
+
+    //获取打卡记录 date:yyyy-MM-dd
+    private void loadLog(String date) {
+        //获取网络数据
+        if (StringUtils.isEmpty(code)) {
+            code = CommonUtil.getSharedPreferences(ct, "erp_username");
+        }
+        String url = "mobile/common/list.action";
+        final Map<String, Object> param = new HashMap<>();
+        param.put("currentMaster", CommonUtil.getSharedPreferences(ct, "erp_master"));
+        param.put("page", 1);
+        param.put("pageSize", 1000);
+        param.put("condition", "cl_emcode='" + code + "' and to_char(cl_time,'yyyy-MM-dd')='" + date + "'");
+        param.put("caller", "CardLog");
+        loadNet(url, param, 0x12);
+    }
+
+    //签到
+    private void doSignin(String code) {
+        signin_btn.setFocusable(false);
+        String url = "mobile/saveCardLog.action";
+        final Map<String, Object> param = new HashMap<>();
+        SigninBean bean = new SigninBean();
+        bean.setCl_code(code);
+        bean.setCl_address(office_addr.getText().toString());
+        bean.setCl_distance(distance);
+        bean.setCl_emcode(CommonUtil.getSharedPreferences(ct, "erp_username"));
+        bean.setCl_time(TimeUtils.f_long_2_str(System.currentTimeMillis()));
+        bean.setCl_location(office_addr.getText() == null ? "" : office_addr.getText().toString());
+        bean.setCl_emname(MyApplication.getInstance().mLoginUser.getNickName());
+        bean.setCl_phone(MyApplication.getInstance().mLoginUser.getTelephone());
+        String formStore = FlexJsonUtil.toJson(bean);
+        param.put("caller", "CardLog");
+        param.put("formStore", formStore);
+        loadNet(url, param, 0x13);
+    }
+
+    //请求合并,抽取共同代码
+    private void loadNet(String urlCheche, Map<String, Object> param, int what) {
+        ct.progressDialog.show();
+        String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + urlCheche;
+        if (StringUtils.isEmpty(code)) {
+            code = CommonUtil.getSharedPreferences(ct, "erp_username");
+        }
+        param.put("emcode", code);
+        param.put("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"));
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        ViewUtil.httpSendRequest(ct, url, param, handler, headers, what, null, null, "get");
+    }
+
+
+    public class Bean {
+        String startTime;//上班时间
+        String endTime;//
+        String startSignin;
+        String endSignnin;
+        ArrayList<String> signinList = new ArrayList<>();
+
+        public String getStartTime() {
+            return startTime;
+        }
+
+        public void setStartTime(String startTime) {
+            this.startTime = startTime;
+        }
+
+        public String getEndTime() {
+            return endTime;
+        }
+
+        public void setEndTime(String endTime) {
+            this.endTime = endTime;
+        }
+
+        public String getStartSignin() {
+            return startSignin;
+        }
+
+        public void setStartSignin(String startSignin) {
+            this.startSignin = startSignin;
+        }
+
+        public String getEndSignnin() {
+            return endSignnin;
+        }
+
+        public void setEndSignnin(String endSignnin) {
+            this.endSignnin = endSignnin;
+        }
+
+        public ArrayList<String> getSigninList() {
+            return signinList;
+        }
+
+        public void setSigninList(ArrayList<String> signinList) {
+            this.signinList = signinList;
+        }
+    }
+}

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

@@ -205,7 +205,6 @@ public class ViewUtil {
                                       final int what, final Message message, final Bundle bundle,
                                       final String request) {
         new Thread(new Runnable() {
-
             @Override
             public void run() {
                 boolean isNetHas = true;
@@ -215,14 +214,12 @@ public class ViewUtil {
                     Log.i("result", "result:" + result);
                     if (result != null) {
                         if (bundle == null || message == null) {
-
                             Bundle bundle = new Bundle();
                             Message message = new Message();
                             bundle.putString("result", result);
                             message.setData(bundle);
                             message.what = what;
                             handler.sendMessage(message);
-
                         } else {
                             bundle.putString("result", result);
                             message.setData(bundle);
@@ -383,7 +380,7 @@ public class ViewUtil {
         if (ct == null) ct = MyApplication.getInstance();
         Map<String, Object> dataMap = FlexJsonUtil.fromJson(result);
         try {
-            Log.i("Arison", "ChangeStatusERP:" + dataMap.get("sessionId").toString() );
+            Log.i("Arison", "ChangeStatusERP:" + dataMap.get("sessionId").toString());
             CommonUtil.setSharedPreferences(ct, "sessionId",
                     dataMap.get("sessionId").toString());
             CommonUtil.setSharedPreferences(ct, "erp_username",
@@ -466,9 +463,9 @@ public class ViewUtil {
         for (int j = 0; j < erpEntities.size(); j++) {
             items[j] = erpEntities.get(j).getName();
         }
-        if (CommonUtil.isDialogShowing(loginERPDialog)){
+        if (CommonUtil.isDialogShowing(loginERPDialog)) {
             return;
-        }else {
+        } else {
             loginERPDialog = new MaterialDialog.Builder(ct)
                     .title("选择登录的UAS账套")
                     .items(items)
@@ -617,6 +614,7 @@ public class ViewUtil {
         return false;
     }
 
+
     /**
      * @author Administrator
      * @功能:封装网络请求 httpclient4.3
@@ -644,7 +642,7 @@ public class ViewUtil {
                         Log.i("result", "url:" + url);
                         Log.i("result", "parm:" + params.toString());
                         Log.i("result", "statusCode:" + result.getStatusCode());
-                        LogUtil.prinlnLongMsg("result",result.getResponseText());
+                        LogUtil.prinlnLongMsg("result", result.getResponseText());
                         Log.i("result", "http 响应-----------------------------------------");
                         if (result.getStatusCode() == 200) {
                             if (bundle == null || message == null) {
@@ -672,7 +670,6 @@ public class ViewUtil {
                             if (result.getStatusCode() == 404) {
                                 exception = "404系统错误";
                             }
-                            Log.i("Http", "非200响应:" + result.getResponseText());
                             Bundle bundle = new Bundle();
                             Message message = new Message();
                             bundle.putString("result", exception);
@@ -698,6 +695,8 @@ public class ViewUtil {
                 }
             }
         }).start();
+
+
     }
 
     public static HttpUtil.Response httpSendTask(

+ 55 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/LoginERPUilt.java

@@ -0,0 +1,55 @@
+package com.xzjmyk.pm.activity.ui.erp.util;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Created by gongpengming on 2016/9/5.
+ */
+public class LoginERPUilt {
+    private static LoginERPUilt instance;
+    private LoginListener listener = null;
+    private Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            if (msg.what == 0x11) {
+                if (listener == null) return;
+                listener.result(true);
+            }
+        }
+    };
+    private LoginERPUilt() {
+    }
+    public static LoginERPUilt getInstance() {
+        if (instance == null) {
+            synchronized (LoginERPUilt.class) {
+                instance = new LoginERPUilt();
+            }
+        }
+        return instance;
+    }
+
+
+    // 登录ERP gongpengming
+    public void LoginERPTask(Context ct, LoginListener listener) {
+        this.listener = listener;
+        String url = Constants.getAppBaseUrl(ct) + "mobile/login.action";
+        String master = CommonUtil.getSharedPreferences(ct, "erp_master");
+        String phone = CommonUtil.getSharedPreferences(ct, "user_phone");
+        String password = CommonUtil.getSharedPreferences(ct, "user_password");
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("username", phone);
+        params.put("password", password);
+        params.put("master", master);
+        com.xzjmyk.pm.activity.ui.erp.net.ViewUtil.startNetThread(url, params, handler, 0x11, null, null, "post");
+    }
+
+    public interface LoginListener {
+        void result(boolean isLogin);
+    }
+}

+ 56 - 10
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/ViewUtil.java

@@ -8,8 +8,10 @@ import android.util.Log;
 
 import com.afollestad.materialdialogs.MaterialDialog;
 import com.alibaba.fastjson.JSON;
+import com.xzjmyk.pm.activity.MyApplication;
 import com.xzjmyk.pm.activity.ui.erp.net.HttpUtil;
 
+import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -18,6 +20,17 @@ import java.util.Map;
  */
 public class ViewUtil {
 
+    //TODO 待采用更好的方式处理 定义的属性太多了
+    private static boolean isNetByHandler = false;//判断是否是经过重登录后的请求
+    private static String url;
+    private static Context ct;
+    private static Handler h;
+    private static Map<String, Object> params;
+    private static LinkedHashMap<String, Object> headers;
+    private static int what;
+    private static Message message;
+    private static Bundle bundle;
+    private static String request;
     public static HttpUtil.Response httpSendTask(
             String url,
             Map<String, Object> params,
@@ -26,10 +39,10 @@ public class ViewUtil {
         HttpUtil.Response response = null;
         try {
             if (method.equals("get")) {
-                response = HttpUtil.sendGetRequest(url, params, headers,false);
+                response = HttpUtil.sendGetRequest(url, params, headers, false);
             }
             if (method.equals("post")) {
-                response = HttpUtil.sendGetRequest(url, params, headers,false);
+                response = HttpUtil.sendGetRequest(url, params, headers, false);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -37,10 +50,46 @@ public class ViewUtil {
         return response;
     }
 
+    private   Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            if (msg.what == 500) {//重登陆
+                LoginERPTask();
+            } else if (msg.what == 0x11) {
+                //判断登陆成功
+                if (msg.getData() != null && com.xzjmyk.pm.activity.util.StringUtils.isEmpty(msg.getData().getString("result"))) {
+                    JsonValidator jva = new JsonValidator();
+                    String json = msg.getData().getString("result");
+                    if (jva.validate(json)) {
+                        if (JSON.parseObject(json).containsKey("success") && JSON.parseObject(json).getBoolean("success")) {
+                            isNetByHandler = true;
+                            httpSendRequest(ct, url, params, handler, headers, what, message, bundle, request);
+                        }
+                    }
+                }
+            }
+        }
+    };
+
+    // 登录ERP gongpengming
+    public void LoginERPTask() {
+        Context ct = MyApplication.getInstance();
+        String url = Constants.getAppBaseUrl(ct) + "mobile/login.action";
+        String master = CommonUtil.getSharedPreferences(ct, "erp_master");
+        String phone = CommonUtil.getSharedPreferences(ct, "user_phone");
+        String password = CommonUtil.getSharedPreferences(ct, "user_password");
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("username", phone);
+        params.put("password", password);
+        params.put("master", master);
+        com.xzjmyk.pm.activity.ui.erp.net.ViewUtil.startNetThread(url, params, handler, 0x11, null, null, "post");
+    }
+
     /**
      * @author Administrator
      * @功能:封装网络请求 httpclient4.3
      */
+    @Deprecated
     public static void httpSendRequest(
             final Context ct,
             final String url,
@@ -51,15 +100,14 @@ public class ViewUtil {
             final Message message,
             final Bundle bundle,
             final String request) {
-            new Thread(new Runnable() {
+        new Thread(new Runnable() {
             @Override
             public void run() {
                 boolean isNetHas = Constants.isNetworkConnected(ct);
                 if (isNetHas) {
-                    Log.i("result:","url="+url);
+                    Log.i("result:", "url=" + url);
                     HttpUtil.Response result = httpSendTask(url, params, headers, request);
                     if (result != null) {
-
                         prinltResponseInfo(result, url, params);
                         if (result.getStatusCode() == 200) {
                             if (bundle == null || message == null) {
@@ -83,11 +131,12 @@ public class ViewUtil {
                                 } else {
                                     exception = "500系统错误";
                                 }
+
                             }
                             if (result.getStatusCode() == 404) {
                                 exception = "404系统错误";
                             }
-                            Log.i("Http", "非200响应:" + result.getResponseText());
+
                             Bundle bundle = new Bundle();
                             Message message = new Message();
                             bundle.putString("result", exception);
@@ -118,13 +167,12 @@ public class ViewUtil {
     }
 
     private static void prinltResponseInfo(HttpUtil.Response result, String url, Map<String, Object> params) {
-
         Log.i("result", "http 请求-----------------------------------------");
         Log.i("result", "result:" + result);
         Log.i("result", "url:" + url);
         Log.i("result", "parm:" + params.toString());
         Log.i("result", "statusCode:" + result.getStatusCode());
-        LogUtil.prinlnLongMsg("result",result.getResponseText());
+        LogUtil.prinlnLongMsg("result", result.getResponseText());
         Log.i("result", "http 响应-----------------------------------------");
     }
 
@@ -147,6 +195,4 @@ public class ViewUtil {
     }
 
 
-
-
 }

+ 49 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/view/CalendarPopup.java

@@ -0,0 +1,49 @@
+package com.xzjmyk.pm.activity.ui.erp.view;
+
+import android.content.Context;
+
+/**
+ * Created by gongpengming on 2016/9/5.
+ */
+public class CalendarPopup {
+
+    private CalendarPopup(Context ct) {
+
+    }
+
+    public class Builder {
+        Context ct;
+
+        public Builder(Context ct) {
+            this.ct = ct;
+        }
+
+        public CalendarPopup builder() {
+            return new CalendarPopup(ct);
+        }
+
+        /**
+         * 设置开始时间
+         *
+         * @param data yyyy-HH-mm
+         * @return
+         */
+        public Builder setStartData(String data) {
+
+            return this;
+        }
+
+        /**
+         * 设置日期停止时间时间
+         *
+         * @param data yyyy-HH-mm
+         * @return
+         */
+        public Builder setEndData(String data) {
+            return this;
+        }
+
+    }
+
+
+}

+ 5 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/util/BaiduMapUtil.java

@@ -181,10 +181,10 @@ public class BaiduMapUtil {
 
     /**
      * 结束获取周围位置信息
-     * <p>
-     * <p>
-     * <p>
-     * <p>
+     * <p/>
+     * <p/>
+     * <p/>
+     * <p/>
      * 开始定位功能
      */
 
@@ -208,8 +208,7 @@ public class BaiduMapUtil {
 
     private LocationClientOption initLocation() {
         LocationClientOption option = new LocationClientOption();
-        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy
-        );//可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
+        option.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);//可选,默认高精度,设置定位模式,高精度,低功耗,仅设备
         option.setCoorType("bd09ll");//可选,默认gcj02,设置返回的定位结果坐标系
         int span = 0;
         option.setScanSpan(span);//可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的

+ 5 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/CalendarView.java

@@ -16,7 +16,7 @@ import java.util.Date;
  * 日历控件 功能:获得点选的日期区间
  * update by:Bitliker 2016/07/11
  */
-public class    CalendarView extends View implements View.OnTouchListener {
+public class CalendarView extends View implements View.OnTouchListener {
     private final static String TAG = "anCalendar";
     private Date selectedStartDate;
     private Date selectedEndDate;
@@ -207,7 +207,10 @@ public class    CalendarView extends View implements View.OnTouchListener {
     private void drawCellText(Canvas canvas, int index, String text, int color) {
         int x = getXByIndex(index);
         int y = getYByIndex(index);
-        surface.datePaint.setColor(color);
+        if (downDate != null && downIndex == index)
+            surface.datePaint.setColor(0xFFFFFF);
+        else
+            surface.datePaint.setColor(color);
         float cellY = surface.monthHeight + surface.weekHeight + (y - 1)
                 * surface.cellHeight + //当前日期框最上方
                 surface.cellHeight * 3 / 4f;

+ 838 - 915
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Crouton.java

@@ -38,6 +38,9 @@ import android.widget.ImageView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.ui.base.BaseActivity;
+
 /*
  * Based on an article by Cyril Mottier (http://android.cyrilmottier.com/?p=773) <br>
  */
@@ -52,516 +55,345 @@ import android.widget.TextView;
  * {@link Activity#onDestroy()} to avoid {@link Context} leaks.
  */
 public final class Crouton {
-  private static final String NULL_PARAMETERS_ARE_NOT_ACCEPTED = "Null parameters are not accepted";
-  private static final int IMAGE_ID = 0x100;
-  private static final int TEXT_ID = 0x101;
-  private final CharSequence text;
-  private final Style style;
-  private Configuration configuration = null;
-  private final View customView;
-
-  private OnClickListener onClickListener;
-
-  private Activity activity;
-  private ViewGroup viewGroup;
-  private FrameLayout croutonView;
-  private Animation inAnimation;
-  private Animation outAnimation;
-  private LifecycleCallback lifecycleCallback = null;
-
-  /**
-   * Creates the {@link Crouton}.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   */
-  private Crouton(Activity activity, CharSequence text, Style style) {
-    if ((activity == null) || (text == null) || (style == null)) {
-      throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+    private static final String NULL_PARAMETERS_ARE_NOT_ACCEPTED = "Null parameters are not accepted";
+    private static final int IMAGE_ID = 0x100;
+    private static final int TEXT_ID = 0x101;
+    private final CharSequence text;
+    private final Style style;
+    private Configuration configuration = null;
+    private final View customView;
+
+    private OnClickListener onClickListener;
+
+    private Activity activity;
+    private ViewGroup viewGroup;
+    private FrameLayout croutonView;
+    private Animation inAnimation;
+    private Animation outAnimation;
+    private LifecycleCallback lifecycleCallback = null;
+
+    /**
+     * Creates the {@link Crouton}.
+     *
+     * @param activity The {@link Activity} that the {@link Crouton} should be attached
+     *                 to.
+     * @param text     The text you want to display.
+     * @param style    The style that this {@link Crouton} should be created with.
+     */
+    private Crouton(Activity activity, CharSequence text, Style style) {
+        if ((activity == null) || (text == null) || (style == null)) {
+            throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+        }
+
+        this.activity = activity;
+        this.viewGroup = null;
+        this.text = text;
+        this.style = style;
+        this.customView = null;
     }
 
-    this.activity = activity;
-    this.viewGroup = null;
-    this.text = text;
-    this.style = style;
-    this.customView = null;
-  }
-
-  /**
-   * Creates the {@link Crouton}.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  private Crouton(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
-    if ((activity == null) || (text == null) || (style == null)) {
-      throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+    /**
+     * Creates the {@link Crouton}.
+     *
+     * @param activity  The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text      The text you want to display.
+     * @param style     The style that this {@link Crouton} should be created with.
+     * @param viewGroup The {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    private Crouton(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
+        if ((activity == null) || (text == null) || (style == null)) {
+            throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+        }
+
+        this.activity = activity;
+        this.text = text;
+        this.style = style;
+        this.viewGroup = viewGroup;
+        this.customView = null;
     }
 
-    this.activity = activity;
-    this.text = text;
-    this.style = style;
-    this.viewGroup = viewGroup;
-    this.customView = null;
-  }
-
-  /**
-   * Creates the {@link Crouton}.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param customView
-   *     The custom {@link View} to display
-   */
-  private Crouton(Activity activity, View customView) {
-    if ((activity == null) || (customView == null)) {
-      throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+    /**
+     * Creates the {@link Crouton}.
+     *
+     * @param activity   The {@link Activity} that the {@link Crouton} should be attached
+     *                   to.
+     * @param customView The custom {@link View} to display
+     */
+    private Crouton(Activity activity, View customView) {
+        if ((activity == null) || (customView == null)) {
+            throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+        }
+
+        this.activity = activity;
+        this.viewGroup = null;
+        this.customView = customView;
+        this.style = new Style.Builder().build();
+        this.text = null;
     }
 
-    this.activity = activity;
-    this.viewGroup = null;
-    this.customView = customView;
-    this.style = new Style.Builder().build();
-    this.text = null;
-  }
-
-  /**
-   * Creates the {@link Crouton}.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  private Crouton(Activity activity, View customView, ViewGroup viewGroup) {
-    this(activity, customView, viewGroup, Configuration.DEFAULT);
-  }
+    /**
+     * Creates the {@link Crouton}.
+     *
+     * @param activity   The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView The custom {@link View} to display
+     * @param viewGroup  The {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    private Crouton(Activity activity, View customView, ViewGroup viewGroup) {
+        this(activity, customView, viewGroup, Configuration.DEFAULT);
+    }
 
-  /**
-   * Creates the {@link Crouton}.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   * @param configuration
-   *     The {@link Configuration} for this {@link Crouton}.
-   */
-  private Crouton(final Activity activity, final View customView, final ViewGroup viewGroup,
-                  final Configuration configuration) {
-    if ((activity == null) || (customView == null)) {
-      throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
-    }
-
-    this.activity = activity;
-    this.customView = customView;
-    this.viewGroup = viewGroup;
-    this.style = new Style.Builder().build();
-    this.text = null;
-    this.configuration = configuration;
-  }
+    /**
+     * Creates the {@link Crouton}.
+     *
+     * @param activity      The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView    The custom {@link View} to display
+     * @param viewGroup     The {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @param configuration The {@link Configuration} for this {@link Crouton}.
+     */
+    private Crouton(final Activity activity, final View customView, final ViewGroup viewGroup,
+                    final Configuration configuration) {
+        if ((activity == null) || (customView == null)) {
+            throw new IllegalArgumentException(NULL_PARAMETERS_ARE_NOT_ACCEPTED);
+        }
+
+        this.activity = activity;
+        this.customView = customView;
+        this.viewGroup = viewGroup;
+        this.style = new Style.Builder().build();
+        this.text = null;
+        this.configuration = configuration;
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, Style style) {
-    return new Crouton(activity, text, style);
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given
+     * activity.
+     *
+     * @param activity The {@link Activity} that the {@link Crouton} should be attached
+     *                 to.
+     * @param text     The text you want to display.
+     * @param style    The style that this {@link Crouton} should be created with.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, Style style) {
+        return new Crouton(activity, text, style);
+    }
 
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param text
-   * @param color
-   * @param time
-   * @return
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, int color, int time){
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return new Crouton(activity, text, customColor).setConfiguration(customConfiguration);
-  }
+    public static void makeText(Context ct, String message) {
+        makeText((BaseActivity) ct, message, ct.getResources().getColor(R.color.light_green), 1000).show();
+    }
 
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param text
-   * @param color
-   * @param time
-   * @return
-   */
-  public static Crouton makeText(Activity activity,int hight, CharSequence text, int color, int time){
-    Style customColor = new Style.Builder().setBackgroundColorValue(color)
-            .setHeight(
-                    (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
-                            hight,
-                            activity.getResources().getDisplayMetrics())
-            ).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return new Crouton(activity, text, customColor).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
-    return new Crouton(activity, text, style, viewGroup);
-  }
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param text
-   * @param color
-   * @param time
-   * @return
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, int color, int time, ViewGroup viewGroup){
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return new Crouton(activity, text, customColor,viewGroup).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, Style style, int viewGroupResId) {
-    return new Crouton(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId));
-  }
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param text
-   * @param color
-   * @param time
-   * @return
-   */
-  public static Crouton makeText(Activity activity, CharSequence text, int color, int time, int viewGroupResId) {
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return new Crouton(activity, text, customColor, (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, Style style) {
-    return makeText(activity, activity.getString(textResourceId), style);
-  }
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param text
+     * @param color
+     * @param time
+     * @return
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, int color, int time) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return new Crouton(activity, text, customColor).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param textResourceId
-   * @param color
-   * @param time
-   * @return
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, int color, int time) {
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return makeText(activity, activity.getString(textResourceId), customColor).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) {
-    return makeText(activity, activity.getString(textResourceId), style, viewGroup);
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given
+     * activity.
+     *
+     * @param activity  The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text      The text you want to display.
+     * @param style     The style that this {@link Crouton} should be created with.
+     * @param viewGroup The {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
+        return new Crouton(activity, text, style, viewGroup);
+    }
 
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param textResourceId
-   * @param color
-   * @param time
-   * @param viewGroup
-   * @return
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, int color, int time, ViewGroup viewGroup) {
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return makeText(activity, activity.getString(textResourceId), customColor, viewGroup).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, Style style, int viewGroupResId) {
-    return makeText(activity, activity.getString(textResourceId), style,
-            (ViewGroup) activity.findViewById(viewGroupResId));
-  }
 
-  /**
-   * 自定义设置背景色,延时时间
-   * @param activity
-   * @param textResourceId
-   * @param color
-   * @param time
-   * @param viewGroupResId
-   * @return
-   */
-  public static Crouton makeText(Activity activity, int textResourceId, int color, int time, int viewGroupResId) {
-    Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
-    Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
-    return makeText(activity, activity.getString(textResourceId), customColor,
-            (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(customConfiguration);
-  }
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param customView
-   *     The custom {@link View} to display
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton make(Activity activity, View customView) {
-    return new Crouton(activity, customView);
-  }
+    /**
+     * 自定义设置背景色,延时时间
+     * @param activity
+     * @param text
+     * @param color
+     * @param time
+     * @return
+     */
+    public static Crouton makeText(Activity activity,int height, CharSequence text, int color, int time){
+        Style customColor = new Style.Builder().setBackgroundColorValue(color)
+                .setHeight(
+                        (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+                                height,
+                                activity.getResources().getDisplayMetrics())
+                ).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return new Crouton(activity, text, customColor).setConfiguration(customConfiguration);
+    }
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param text
+     * @param color
+     * @param time
+     * @return
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, int color, int time, ViewGroup viewGroup) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return new Crouton(activity, text, customColor, viewGroup).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton make(Activity activity, View customView, ViewGroup viewGroup) {
-    return new Crouton(activity, customView, viewGroup);
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given
+     * activity.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text           The text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, Style style, int viewGroupResId) {
+        return new Crouton(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId));
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton make(Activity activity, View customView, int viewGroupResId) {
-    return new Crouton(activity, customView, (ViewGroup) activity.findViewById(viewGroupResId));
-  }
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param text
+     * @param color
+     * @param time
+     * @return
+     */
+    public static Crouton makeText(Activity activity, CharSequence text, int color, int time, int viewGroupResId) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return new Crouton(activity, text, customColor, (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   * @param configuration
-   *     The configuration for this crouton.
-   *
-   * @return The created {@link Crouton}.
-   */
-  public static Crouton make(Activity activity, View customView, int viewGroupResId,
-                             final Configuration configuration) {
-    return new Crouton(activity, customView, (ViewGroup) activity.findViewById(viewGroupResId), configuration);
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity       The {@link Activity} that the {@link Crouton} should be attached
+     *                       to.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, Style style) {
+        return makeText(activity, activity.getString(textResourceId), style);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should
-   *     be attached to.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   */
-  public static void showText(Activity activity, CharSequence text, Style style) {
-    makeText(activity, text, style).show();
-  }
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param textResourceId
+     * @param color
+     * @param time
+     * @return
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, int color, int time) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return makeText(activity, activity.getString(textResourceId), customColor).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void showText(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
-    makeText(activity, text, style, viewGroup).show();
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroup      The {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) {
+        return makeText(activity, activity.getString(textResourceId), style, viewGroup);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void showText(Activity activity, CharSequence text, Style style, int viewGroupResId) {
-    makeText(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId)).show();
-  }
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param textResourceId
+     * @param color
+     * @param time
+     * @param viewGroup
+     * @return
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, int color, int time, ViewGroup viewGroup) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return makeText(activity, activity.getString(textResourceId), customColor, viewGroup).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param text
-   *     The text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   * @param configuration
-   *     The configuration for this Crouton.
-   */
-  public static void showText(Activity activity, CharSequence text, Style style, int viewGroupResId,
-                              final Configuration configuration) {
-    makeText(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(configuration)
-        .show();
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, Style style, int viewGroupResId) {
+        return makeText(activity, activity.getString(textResourceId), style,
+                (ViewGroup) activity.findViewById(viewGroupResId));
+    }
 
+    /**
+     * 自定义设置背景色,延时时间
+     *
+     * @param activity
+     * @param textResourceId
+     * @param color
+     * @param time
+     * @param viewGroupResId
+     * @return
+     */
+    public static Crouton makeText(Activity activity, int textResourceId, int color, int time, int viewGroupResId) {
+        Style customColor = new Style.Builder().setBackgroundColorValue(color).build();
+        Configuration customConfiguration = new Configuration.Builder().setDuration(time).build();
+        return makeText(activity, activity.getString(textResourceId), customColor,
+                (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(customConfiguration);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should
-   *     be attached to.
-   * @param customView
-   *     The custom {@link View} to display
-   */
-  public static void show(Activity activity, View customView) {
-    make(activity, customView).show();
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity   The {@link Activity} that the {@link Crouton} should be attached
+     *                   to.
+     * @param customView The custom {@link View} to display
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton make(Activity activity, View customView) {
+        return new Crouton(activity, customView);
+    }
 
-  /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param customView
-   *     The custom {@link View} to display
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void show(Activity activity, View customView, ViewGroup viewGroup) {
-    make(activity, customView, viewGroup).show();
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity   The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView The custom {@link View} to display
+     * @param viewGroup  The {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton make(Activity activity, View customView, ViewGroup viewGroup) {
+        return new Crouton(activity, customView, viewGroup);
+    }
 
   /**
-   * Creates a {@link Crouton} with provided text and style for a given activity
-   * and displays it directly.
+   * Creates a {@link Crouton} with provided text-resource and style for a given
+   * activity.
    *
    * @param activity
    *     The {@link Activity} that represents the context in which the Crouton should exist.
@@ -569,508 +401,599 @@ public final class Crouton {
    *     The custom {@link View} to display
    * @param viewGroupResId
    *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void show(Activity activity, View customView, int viewGroupResId) {
-    make(activity, customView, viewGroupResId).show();
-  }
-
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that the {@link Crouton} should be attached
-   *     to.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   */
-  public static void showText(Activity activity, int textResourceId, Style style) {
-    showText(activity, activity.getString(textResourceId), style);
-  }
-
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroup
-   *     The {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void showText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) {
-    showText(activity, activity.getString(textResourceId), style, viewGroup);
-  }
-
-  /**
-   * Creates a {@link Crouton} with provided text-resource and style for a given
-   * activity and displays it directly.
-   *
-   * @param activity
-   *     The {@link Activity} that represents the context in which the Crouton should exist.
-   * @param textResourceId
-   *     The resource id of the text you want to display.
-   * @param style
-   *     The style that this {@link Crouton} should be created with.
-   * @param viewGroupResId
-   *     The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
-   */
-  public static void showText(Activity activity, int textResourceId, Style style, int viewGroupResId) {
-    showText(activity, activity.getString(textResourceId), style, viewGroupResId);
-  }
-
-  /**
-   * Allows hiding of a previously displayed {@link Crouton}.
    *
-   * @param crouton
-   *     The {@link Crouton} you want to hide.
-   */
-  public static void hide(Crouton crouton) {
-    crouton.hide();
-  }
-
-  /**
-   * Cancels all queued {@link Crouton}s. If there is a {@link Crouton}
-   * displayed currently, it will be the last one displayed.
-   */
-  public static void cancelAllCroutons() {
-    Manager.getInstance().clearCroutonQueue();
-  }
-
-  /**
-   * Clears (and removes from {@link Activity}'s content view, if necessary) all
-   * croutons for the provided activity
-   *
-   * @param activity
-   *     - The {@link Activity} to clear the croutons for.
-   */
-  public static void clearCroutonsForActivity(Activity activity) {
-    Manager.getInstance().clearCroutonsForActivity(activity);
-  }
-
-  /**
-   * Cancels a {@link Crouton} immediately.
-   */
-  public void cancel() {
-    Manager manager = Manager.getInstance();
-    manager.removeCroutonImmediately(this);
-  }
-
-  /**
-   * Displays the {@link Crouton}. If there's another {@link Crouton} visible at
-   * the time, this {@link Crouton} will be displayed afterwards.
+   * @return The created {@link Crouton}.
    */
-  public void show() {
-    Manager.getInstance().add(this);
+  public static Crouton make(Activity activity, View customView, int viewGroupResId) {
+    return new Crouton(activity, customView, (ViewGroup) activity.findViewById(viewGroupResId));
   }
 
-  public Animation getInAnimation() {
-    if ((null == this.inAnimation) && (null != this.activity)) {
-      if (getConfiguration().inAnimationResId > 0) {
-        this.inAnimation = AnimationUtils.loadAnimation(getActivity(), getConfiguration().inAnimationResId);
-      } else {
-        measureCroutonView();
-        this.inAnimation = DefaultAnimationsBuilder.buildDefaultSlideInDownAnimation(getView());
-      }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView     The custom {@link View} to display
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @param configuration  The configuration for this crouton.
+     * @return The created {@link Crouton}.
+     */
+    public static Crouton make(Activity activity, View customView, int viewGroupResId,
+                               final Configuration configuration) {
+        return new Crouton(activity, customView, (ViewGroup) activity.findViewById(viewGroupResId), configuration);
     }
 
-    return inAnimation;
-  }
-
-  public Animation getOutAnimation() {
-    if ((null == this.outAnimation) && (null != this.activity)) {
-      if (getConfiguration().outAnimationResId > 0) {
-        this.outAnimation = AnimationUtils.loadAnimation(getActivity(), getConfiguration().outAnimationResId);
-      } else {
-        this.outAnimation = DefaultAnimationsBuilder.buildDefaultSlideOutUpAnimation(getView());
-      }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity The {@link Activity} that the {@link Crouton} should
+     *                 be attached to.
+     * @param text     The text you want to display.
+     * @param style    The style that this {@link Crouton} should be created with.
+     */
+    public static void showText(Activity activity, CharSequence text, Style style) {
+        makeText(activity, text, style).show();
     }
 
-    return outAnimation;
-  }
-
-  /**
-   * @param lifecycleCallback
-   *     Callback object for notable events in the life of a Crouton.
-   */
-  public void setLifecycleCallback(LifecycleCallback lifecycleCallback) {
-    this.lifecycleCallback = lifecycleCallback;
-  }
-
-  /**
-   * Removes this {@link Crouton}.
-   *
-   * @since 1.9
-   */
-  public void hide() {
-    Manager.getInstance().removeCrouton(this);
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity  The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text      The text you want to display.
+     * @param style     The style that this {@link Crouton} should be created with.
+     * @param viewGroup The {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void showText(Activity activity, CharSequence text, Style style, ViewGroup viewGroup) {
+        makeText(activity, text, style, viewGroup).show();
+    }
 
-  /**
-   * Allows setting of an {@link OnClickListener} directly to a {@link Crouton} without having to use a custom view.
-   *
-   * @param onClickListener
-   *     The {@link OnClickListener} to set.
-   *
-   * @return this {@link Crouton}.
-   */
-  public Crouton setOnClickListener(OnClickListener onClickListener) {
-    this.onClickListener = onClickListener;
-    return this;
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text           The text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void showText(Activity activity, CharSequence text, Style style, int viewGroupResId) {
+        makeText(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId)).show();
+    }
 
-  /**
-   * Set the {@link Configuration} on this {@link Crouton}, prior to showing it.
-   *
-   * @param configuration
-   *     a {@link Configuration} built using the {@link Configuration.Builder}.
-   *
-   * @return this {@link Crouton}.
-   */
-  public Crouton setConfiguration(final Configuration configuration) {
-    this.configuration = configuration;
-    return this;
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param text           The text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     * @param configuration  The configuration for this Crouton.
+     */
+    public static void showText(Activity activity, CharSequence text, Style style, int viewGroupResId,
+                                final Configuration configuration) {
+        makeText(activity, text, style, (ViewGroup) activity.findViewById(viewGroupResId)).setConfiguration(configuration)
+                .show();
+    }
 
-  @Override
-  public String toString() {
-    return "Crouton{" +
-        "text=" + text +
-        ", style=" + style +
-        ", configuration=" + configuration +
-        ", customView=" + customView +
-        ", onClickListener=" + onClickListener +
-        ", activity=" + activity +
-        ", viewGroup=" + viewGroup +
-        ", croutonView=" + croutonView +
-        ", inAnimation=" + inAnimation +
-        ", outAnimation=" + outAnimation +
-        ", lifecycleCallback=" + lifecycleCallback +
-        '}';
-  }
 
-  /**
-   * Convenience method to get the license text for embedding within your application.
-   *
-   * @return The license text.
-   */
-  public static String getLicenseText() {
-    return "This application uses the Crouton library.\n\n" +
-        "Copyright 2012 - 2013 Benjamin Weiss \n" +
-        "\n" +
-        "Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
-        "you may not use this file except in compliance with the License.\n" +
-        "You may obtain a copy of the License at\n" +
-        "\n" +
-        "   http://www.apache.org/licenses/LICENSE-2.0\n" +
-        "\n" +
-        "Unless required by applicable law or agreed to in writing, software\n" +
-        "distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
-        "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
-        "See the License for the specific language governing permissions and\n" +
-        "limitations under the License.";
-  }
-
-  //////////////////////////////////////////////////////////////////////////////////////
-  // You have reached the internal API of Crouton.
-  // If you do not plan to develop for Crouton there is nothing of interest below here.
-  //////////////////////////////////////////////////////////////////////////////////////
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity   The {@link Activity} that the {@link Crouton} should
+     *                   be attached to.
+     * @param customView The custom {@link View} to display
+     */
+    public static void show(Activity activity, View customView) {
+        make(activity, customView).show();
+    }
 
-  /**
-   * @return <code>true</code> if the {@link Crouton} is being displayed, else
-   * <code>false</code>.
-   */
-  boolean isShowing() {
-    return (null != activity) && (isCroutonViewNotNull() || isCustomViewNotNull());
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity   The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView The custom {@link View} to display
+     * @param viewGroup  The {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void show(Activity activity, View customView, ViewGroup viewGroup) {
+        make(activity, customView, viewGroup).show();
+    }
 
-  private boolean isCroutonViewNotNull() {
-    return (null != croutonView) && (null != croutonView.getParent());
-  }
+    /**
+     * Creates a {@link Crouton} with provided text and style for a given activity
+     * and displays it directly.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param customView     The custom {@link View} to display
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void show(Activity activity, View customView, int viewGroupResId) {
+        make(activity, customView, viewGroupResId).show();
+    }
 
-  private boolean isCustomViewNotNull() {
-    return (null != customView) && (null != customView.getParent());
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity and displays it directly.
+     *
+     * @param activity       The {@link Activity} that the {@link Crouton} should be attached
+     *                       to.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     */
+    public static void showText(Activity activity, int textResourceId, Style style) {
+        showText(activity, activity.getString(textResourceId), style);
+    }
 
-  /**
-   * Removes the activity reference this {@link Crouton} is holding
-   */
-  void detachActivity() {
-    activity = null;
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity and displays it directly.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroup      The {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void showText(Activity activity, int textResourceId, Style style, ViewGroup viewGroup) {
+        showText(activity, activity.getString(textResourceId), style, viewGroup);
+    }
 
-  /**
-   * Removes the viewGroup reference this {@link Crouton} is holding
-   */
-  void detachViewGroup() {
-    viewGroup = null;
-  }
+    /**
+     * Creates a {@link Crouton} with provided text-resource and style for a given
+     * activity and displays it directly.
+     *
+     * @param activity       The {@link Activity} that represents the context in which the Crouton should exist.
+     * @param textResourceId The resource id of the text you want to display.
+     * @param style          The style that this {@link Crouton} should be created with.
+     * @param viewGroupResId The resource id of the {@link ViewGroup} that this {@link Crouton} should be added to.
+     */
+    public static void showText(Activity activity, int textResourceId, Style style, int viewGroupResId) {
+        showText(activity, activity.getString(textResourceId), style, viewGroupResId);
+    }
 
-  /**
-   * Removes the lifecycleCallback reference this {@link Crouton} is holding
-   */
-  void detachLifecycleCallback() {
-    lifecycleCallback = null;
-  }
+    /**
+     * Allows hiding of a previously displayed {@link Crouton}.
+     *
+     * @param crouton The {@link Crouton} you want to hide.
+     */
+    public static void hide(Crouton crouton) {
+        crouton.hide();
+    }
 
-  /**
-   * @return the lifecycleCallback
-   */
-  LifecycleCallback getLifecycleCallback() {
-    return lifecycleCallback;
-  }
+    /**
+     * Cancels all queued {@link Crouton}s. If there is a {@link Crouton}
+     * displayed currently, it will be the last one displayed.
+     */
+    public static void cancelAllCroutons() {
+        Manager.getInstance().clearCroutonQueue();
+    }
 
-  /**
-   * @return the style
-   */
-  Style getStyle() {
-    return style;
-  }
+    /**
+     * Clears (and removes from {@link Activity}'s content view, if necessary) all
+     * croutons for the provided activity
+     *
+     * @param activity - The {@link Activity} to clear the croutons for.
+     */
+    public static void clearCroutonsForActivity(Activity activity) {
+        Manager.getInstance().clearCroutonsForActivity(activity);
+    }
 
-  /**
-   * @return this croutons configuration
-   */
-  Configuration getConfiguration() {
-    if (null == configuration) {
-      configuration = getStyle().configuration;
+    /**
+     * Cancels a {@link Crouton} immediately.
+     */
+    public void cancel() {
+        Manager manager = Manager.getInstance();
+        manager.removeCroutonImmediately(this);
     }
-    return configuration;
-  }
 
-  /**
-   * @return the activity
-   */
-  Activity getActivity() {
-    return activity;
-  }
+    /**
+     * Displays the {@link Crouton}. If there's another {@link Crouton} visible at
+     * the time, this {@link Crouton} will be displayed afterwards.
+     */
+    public void show() {
+        Manager.getInstance().add(this);
+    }
 
-  /**
-   * @return the viewGroup
-   */
-  ViewGroup getViewGroup() {
-    return viewGroup;
-  }
+    public Animation getInAnimation() {
+        if ((null == this.inAnimation) && (null != this.activity)) {
+            if (getConfiguration().inAnimationResId > 0) {
+                this.inAnimation = AnimationUtils.loadAnimation(getActivity(), getConfiguration().inAnimationResId);
+            } else {
+                measureCroutonView();
+                this.inAnimation = DefaultAnimationsBuilder.buildDefaultSlideInDownAnimation(getView());
+            }
+        }
+
+        return inAnimation;
+    }
 
-  /**
-   * @return the text
-   */
-  CharSequence getText() {
-    return text;
-  }
+    public Animation getOutAnimation() {
+        if ((null == this.outAnimation) && (null != this.activity)) {
+            if (getConfiguration().outAnimationResId > 0) {
+                this.outAnimation = AnimationUtils.loadAnimation(getActivity(), getConfiguration().outAnimationResId);
+            } else {
+                this.outAnimation = DefaultAnimationsBuilder.buildDefaultSlideOutUpAnimation(getView());
+            }
+        }
 
-  /**
-   * @return the view
-   */
-  View getView() {
-    // return the custom view if one exists
-    if (null != this.customView) {
-      return this.customView;
+        return outAnimation;
     }
 
-    // if already setup return the view
-    if (null == this.croutonView) {
-      initializeCroutonView();
+    /**
+     * @param lifecycleCallback Callback object for notable events in the life of a Crouton.
+     */
+    public void setLifecycleCallback(LifecycleCallback lifecycleCallback) {
+        this.lifecycleCallback = lifecycleCallback;
     }
 
-    return croutonView;
-  }
-
-  private void measureCroutonView() {
-    View view = getView();
-    int widthSpec;
-    if (null != viewGroup) {
-      widthSpec = View.MeasureSpec.makeMeasureSpec(viewGroup.getMeasuredWidth(), View.MeasureSpec.AT_MOST);
-    } else {
-      widthSpec = View.MeasureSpec.makeMeasureSpec(activity.getWindow().getDecorView().getMeasuredWidth(),
-          View.MeasureSpec.AT_MOST);
+    /**
+     * Removes this {@link Crouton}.
+     *
+     * @since 1.9
+     */
+    public void hide() {
+        Manager.getInstance().removeCrouton(this);
     }
 
-    view.measure(widthSpec, View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
-  }
+    /**
+     * Allows setting of an {@link OnClickListener} directly to a {@link Crouton} without having to use a custom view.
+     *
+     * @param onClickListener The {@link OnClickListener} to set.
+     * @return this {@link Crouton}.
+     */
+    public Crouton setOnClickListener(OnClickListener onClickListener) {
+        this.onClickListener = onClickListener;
+        return this;
+    }
 
-  private void initializeCroutonView() {
-    Resources resources = this.activity.getResources();
+    /**
+     * Set the {@link Configuration} on this {@link Crouton}, prior to showing it.
+     *
+     * @param configuration a {@link Configuration} built using the {@link Configuration.Builder}.
+     * @return this {@link Crouton}.
+     */
+    public Crouton setConfiguration(final Configuration configuration) {
+        this.configuration = configuration;
+        return this;
+    }
 
-    this.croutonView = initializeCroutonViewGroup(resources);
+    @Override
+    public String toString() {
+        return "Crouton{" +
+                "text=" + text +
+                ", style=" + style +
+                ", configuration=" + configuration +
+                ", customView=" + customView +
+                ", onClickListener=" + onClickListener +
+                ", activity=" + activity +
+                ", viewGroup=" + viewGroup +
+                ", croutonView=" + croutonView +
+                ", inAnimation=" + inAnimation +
+                ", outAnimation=" + outAnimation +
+                ", lifecycleCallback=" + lifecycleCallback +
+                '}';
+    }
 
-    // create content view
-    RelativeLayout contentView = initializeContentView(resources);
-    this.croutonView.addView(contentView);
-  }
+    /**
+     * Convenience method to get the license text for embedding within your application.
+     *
+     * @return The license text.
+     */
+    public static String getLicenseText() {
+        return "This application uses the Crouton library.\n\n" +
+                "Copyright 2012 - 2013 Benjamin Weiss \n" +
+                "\n" +
+                "Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
+                "you may not use this file except in compliance with the License.\n" +
+                "You may obtain a copy of the License at\n" +
+                "\n" +
+                "   http://www.apache.org/licenses/LICENSE-2.0\n" +
+                "\n" +
+                "Unless required by applicable law or agreed to in writing, software\n" +
+                "distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
+                "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
+                "See the License for the specific language governing permissions and\n" +
+                "limitations under the License.";
+    }
 
-  private FrameLayout initializeCroutonViewGroup(Resources resources) {
-    FrameLayout croutonView = new FrameLayout(this.activity);
+    //////////////////////////////////////////////////////////////////////////////////////
+    // You have reached the internal API of Crouton.
+    // If you do not plan to develop for Crouton there is nothing of interest below here.
+    //////////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * @return <code>true</code> if the {@link Crouton} is being displayed, else
+     * <code>false</code>.
+     */
+    boolean isShowing() {
+        return (null != activity) && (isCroutonViewNotNull() || isCustomViewNotNull());
+    }
 
-    if (null != onClickListener) {
-      croutonView.setOnClickListener(onClickListener);
+    private boolean isCroutonViewNotNull() {
+        return (null != croutonView) && (null != croutonView.getParent());
     }
 
-    final int height;
-    if (this.style.heightDimensionResId > 0) {
-      height = resources.getDimensionPixelSize(this.style.heightDimensionResId);
-    } else {
-      height = this.style.heightInPixels;
+    private boolean isCustomViewNotNull() {
+        return (null != customView) && (null != customView.getParent());
     }
 
-    final int width;
-    if (this.style.widthDimensionResId > 0) {
-      width = resources.getDimensionPixelSize(this.style.widthDimensionResId);
-    } else {
-      width = this.style.widthInPixels;
+    /**
+     * Removes the activity reference this {@link Crouton} is holding
+     */
+    void detachActivity() {
+        activity = null;
     }
 
-    croutonView.setLayoutParams(
-        new FrameLayout.LayoutParams(width != 0 ? width : FrameLayout.LayoutParams.MATCH_PARENT, height));
+    /**
+     * Removes the viewGroup reference this {@link Crouton} is holding
+     */
+    void detachViewGroup() {
+        viewGroup = null;
+    }
 
-    // set background
-    if (this.style.backgroundColorValue != Style.NOT_SET) {
-      croutonView.setBackgroundColor(this.style.backgroundColorValue);
-    } else {
-      croutonView.setBackgroundColor(resources.getColor(this.style.backgroundColorResourceId));
+    /**
+     * Removes the lifecycleCallback reference this {@link Crouton} is holding
+     */
+    void detachLifecycleCallback() {
+        lifecycleCallback = null;
     }
 
-    // set the background drawable if set. This will override the background
-    // color.
-    if (this.style.backgroundDrawableResourceId != 0) {
-      Bitmap background = BitmapFactory.decodeResource(resources, this.style.backgroundDrawableResourceId);
-      BitmapDrawable drawable = new BitmapDrawable(resources, background);
-      if (this.style.isTileEnabled) {
-        drawable.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
-      }
-      croutonView.setBackgroundDrawable(drawable);
+    /**
+     * @return the lifecycleCallback
+     */
+    LifecycleCallback getLifecycleCallback() {
+        return lifecycleCallback;
     }
-    return croutonView;
-  }
 
-  private RelativeLayout initializeContentView(final Resources resources) {
-    RelativeLayout contentView = new RelativeLayout(this.activity);
-    contentView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
-        RelativeLayout.LayoutParams.MATCH_PARENT));
+    /**
+     * @return the style
+     */
+    Style getStyle() {
+        return style;
+    }
 
-    // set padding
-    int padding = this.style.paddingInPixels;
+    /**
+     * @return this croutons configuration
+     */
+    Configuration getConfiguration() {
+        if (null == configuration) {
+            configuration = getStyle().configuration;
+        }
+        return configuration;
+    }
 
-    // if a padding dimension has been set, this will overwrite any padding
-    // in pixels
-    if (this.style.paddingDimensionResId > 0) {
-      padding = resources.getDimensionPixelSize(this.style.paddingDimensionResId);
+    /**
+     * @return the activity
+     */
+    Activity getActivity() {
+        return activity;
     }
-    contentView.setPadding(padding, padding, padding, padding);
 
-    // only setup image if one is requested
-    ImageView image = null;
-    if ((null != this.style.imageDrawable) || (0 != this.style.imageResId)) {
-      image = initializeImageView();
-      contentView.addView(image, image.getLayoutParams());
+    /**
+     * @return the viewGroup
+     */
+    ViewGroup getViewGroup() {
+        return viewGroup;
     }
 
-    TextView text = initializeTextView(resources);
+    /**
+     * @return the text
+     */
+    CharSequence getText() {
+        return text;
+    }
 
-    RelativeLayout.LayoutParams textParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
-        RelativeLayout.LayoutParams.WRAP_CONTENT);
-    if (null != image) {
-      textParams.addRule(RelativeLayout.RIGHT_OF, image.getId());
+    /**
+     * @return the view
+     */
+    View getView() {
+        // return the custom view if one exists
+        if (null != this.customView) {
+            return this.customView;
+        }
+
+        // if already setup return the view
+        if (null == this.croutonView) {
+            initializeCroutonView();
+        }
+
+        return croutonView;
     }
 
-    if ((this.style.gravity & Gravity.CENTER) != 0) {
-      textParams.addRule(RelativeLayout.CENTER_IN_PARENT);
-    } else if ((this.style.gravity & Gravity.CENTER_VERTICAL) != 0) {
-      textParams.addRule(RelativeLayout.CENTER_VERTICAL);
-    } else if ((this.style.gravity & Gravity.CENTER_HORIZONTAL) != 0) {
-      textParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
+    private void measureCroutonView() {
+        View view = getView();
+        int widthSpec;
+        if (null != viewGroup) {
+            widthSpec = View.MeasureSpec.makeMeasureSpec(viewGroup.getMeasuredWidth(), View.MeasureSpec.AT_MOST);
+        } else {
+            widthSpec = View.MeasureSpec.makeMeasureSpec(activity.getWindow().getDecorView().getMeasuredWidth(),
+                    View.MeasureSpec.AT_MOST);
+        }
+
+        view.measure(widthSpec, View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
     }
 
-    contentView.addView(text, textParams);
-    return contentView;
-  }
+    private void initializeCroutonView() {
+        Resources resources = this.activity.getResources();
 
-  private TextView initializeTextView(final Resources resources) {
-    TextView text = new TextView(this.activity);
-    text.setId(TEXT_ID);
-    if (this.style.fontName != null) {
-      setTextWithCustomFont(text, this.style.fontName);
-    } else if (this.style.fontNameResId != 0) {
-      setTextWithCustomFont(text, resources.getString(this.style.fontNameResId));
-    } else {
-      text.setText(this.text);
-    }
-    text.setTypeface(Typeface.DEFAULT_BOLD);
-    text.setGravity(this.style.gravity);
+        this.croutonView = initializeCroutonViewGroup(resources);
 
-    // set the text color if set
-    if (this.style.textColorValue != Style.NOT_SET) {
-      text.setTextColor(this.style.textColorValue);
-    } else if (this.style.textColorResourceId != 0) {
-      text.setTextColor(resources.getColor(this.style.textColorResourceId));
+        // create content view
+        RelativeLayout contentView = initializeContentView(resources);
+        this.croutonView.addView(contentView);
     }
 
-    // Set the text size. If the user has set a text size and text
-    // appearance, the text size in the text appearance
-    // will override this.
-    if (this.style.textSize != 0) {
-      text.setTextSize(TypedValue.COMPLEX_UNIT_SP, this.style.textSize);
+    private FrameLayout initializeCroutonViewGroup(Resources resources) {
+        FrameLayout croutonView = new FrameLayout(this.activity);
+
+        if (null != onClickListener) {
+            croutonView.setOnClickListener(onClickListener);
+        }
+
+        final int height;
+        if (this.style.heightDimensionResId > 0) {
+            height = resources.getDimensionPixelSize(this.style.heightDimensionResId);
+        } else {
+            height = this.style.heightInPixels;
+        }
+
+        final int width;
+        if (this.style.widthDimensionResId > 0) {
+            width = resources.getDimensionPixelSize(this.style.widthDimensionResId);
+        } else {
+            width = this.style.widthInPixels;
+        }
+
+        croutonView.setLayoutParams(
+                new FrameLayout.LayoutParams(width != 0 ? width : FrameLayout.LayoutParams.MATCH_PARENT, height));
+
+        // set background
+        if (this.style.backgroundColorValue != Style.NOT_SET) {
+            croutonView.setBackgroundColor(this.style.backgroundColorValue);
+        } else {
+            croutonView.setBackgroundColor(resources.getColor(this.style.backgroundColorResourceId));
+        }
+
+        // set the background drawable if set. This will override the background
+        // color.
+        if (this.style.backgroundDrawableResourceId != 0) {
+            Bitmap background = BitmapFactory.decodeResource(resources, this.style.backgroundDrawableResourceId);
+            BitmapDrawable drawable = new BitmapDrawable(resources, background);
+            if (this.style.isTileEnabled) {
+                drawable.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
+            }
+            croutonView.setBackgroundDrawable(drawable);
+        }
+        return croutonView;
     }
 
-    // Setup the shadow if requested
-    if (this.style.textShadowColorResId != 0) {
-      initializeTextViewShadow(resources, text);
+    private RelativeLayout initializeContentView(final Resources resources) {
+        RelativeLayout contentView = new RelativeLayout(this.activity);
+        contentView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
+                RelativeLayout.LayoutParams.MATCH_PARENT));
+
+        // set padding
+        int padding = this.style.paddingInPixels;
+
+        // if a padding dimension has been set, this will overwrite any padding
+        // in pixels
+        if (this.style.paddingDimensionResId > 0) {
+            padding = resources.getDimensionPixelSize(this.style.paddingDimensionResId);
+        }
+        contentView.setPadding(padding, padding, padding, padding);
+
+        // only setup image if one is requested
+        ImageView image = null;
+        if ((null != this.style.imageDrawable) || (0 != this.style.imageResId)) {
+            image = initializeImageView();
+            contentView.addView(image, image.getLayoutParams());
+        }
+
+        TextView text = initializeTextView(resources);
+
+        RelativeLayout.LayoutParams textParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
+                RelativeLayout.LayoutParams.WRAP_CONTENT);
+        if (null != image) {
+            textParams.addRule(RelativeLayout.RIGHT_OF, image.getId());
+        }
+
+        if ((this.style.gravity & Gravity.CENTER) != 0) {
+            textParams.addRule(RelativeLayout.CENTER_IN_PARENT);
+        } else if ((this.style.gravity & Gravity.CENTER_VERTICAL) != 0) {
+            textParams.addRule(RelativeLayout.CENTER_VERTICAL);
+        } else if ((this.style.gravity & Gravity.CENTER_HORIZONTAL) != 0) {
+            textParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
+        }
+
+        contentView.addView(text, textParams);
+        return contentView;
     }
 
-    // Set the text appearance
-    if (this.style.textAppearanceResId != 0) {
-      text.setTextAppearance(this.activity, this.style.textAppearanceResId);
+    private TextView initializeTextView(final Resources resources) {
+        TextView text = new TextView(this.activity);
+        text.setId(TEXT_ID);
+        if (this.style.fontName != null) {
+            setTextWithCustomFont(text, this.style.fontName);
+        } else if (this.style.fontNameResId != 0) {
+            setTextWithCustomFont(text, resources.getString(this.style.fontNameResId));
+        } else {
+            text.setText(this.text);
+        }
+        text.setTypeface(Typeface.DEFAULT_BOLD);
+        text.setGravity(this.style.gravity);
+
+        // set the text color if set
+        if (this.style.textColorValue != Style.NOT_SET) {
+            text.setTextColor(this.style.textColorValue);
+        } else if (this.style.textColorResourceId != 0) {
+            text.setTextColor(resources.getColor(this.style.textColorResourceId));
+        }
+
+        // Set the text size. If the user has set a text size and text
+        // appearance, the text size in the text appearance
+        // will override this.
+        if (this.style.textSize != 0) {
+            text.setTextSize(TypedValue.COMPLEX_UNIT_SP, this.style.textSize);
+        }
+
+        // Setup the shadow if requested
+        if (this.style.textShadowColorResId != 0) {
+            initializeTextViewShadow(resources, text);
+        }
+
+        // Set the text appearance
+        if (this.style.textAppearanceResId != 0) {
+            text.setTextAppearance(this.activity, this.style.textAppearanceResId);
+        }
+        return text;
     }
-    return text;
-  }
 
-  private void setTextWithCustomFont(TextView text, String fontName) {
-    if (this.text != null) {
-      SpannableString s = new SpannableString(this.text);
-      s.setSpan(new TypefaceSpan(text.getContext(), fontName), 0, s.length(),
-          Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
-      text.setText(s);
+    private void setTextWithCustomFont(TextView text, String fontName) {
+        if (this.text != null) {
+            SpannableString s = new SpannableString(this.text);
+            s.setSpan(new TypefaceSpan(text.getContext(), fontName), 0, s.length(),
+                    Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+            text.setText(s);
+        }
     }
-  }
-
-  private void initializeTextViewShadow(final Resources resources, final TextView text) {
-    int textShadowColor = resources.getColor(this.style.textShadowColorResId);
-    float textShadowRadius = this.style.textShadowRadius;
-    float textShadowDx = this.style.textShadowDx;
-    float textShadowDy = this.style.textShadowDy;
-    text.setShadowLayer(textShadowRadius, textShadowDx, textShadowDy, textShadowColor);
-  }
-
-  private ImageView initializeImageView() {
-    ImageView image;
-    image = new ImageView(this.activity);
-    image.setId(IMAGE_ID);
-    image.setAdjustViewBounds(true);
-    image.setScaleType(this.style.imageScaleType);
 
-    // set the image drawable if not null
-    if (null != this.style.imageDrawable) {
-      image.setImageDrawable(this.style.imageDrawable);
+    private void initializeTextViewShadow(final Resources resources, final TextView text) {
+        int textShadowColor = resources.getColor(this.style.textShadowColorResId);
+        float textShadowRadius = this.style.textShadowRadius;
+        float textShadowDx = this.style.textShadowDx;
+        float textShadowDy = this.style.textShadowDy;
+        text.setShadowLayer(textShadowRadius, textShadowDx, textShadowDy, textShadowColor);
     }
 
-    // set the image resource if not 0. This will overwrite the drawable
-    // if both are set
-    if (this.style.imageResId != 0) {
-      image.setImageResource(this.style.imageResId);
+    private ImageView initializeImageView() {
+        ImageView image;
+        image = new ImageView(this.activity);
+        image.setId(IMAGE_ID);
+        image.setAdjustViewBounds(true);
+        image.setScaleType(this.style.imageScaleType);
+
+        // set the image drawable if not null
+        if (null != this.style.imageDrawable) {
+            image.setImageDrawable(this.style.imageDrawable);
+        }
+
+        // set the image resource if not 0. This will overwrite the drawable
+        // if both are set
+        if (this.style.imageResId != 0) {
+            image.setImageResource(this.style.imageResId);
+        }
+
+        RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(
+                RelativeLayout.LayoutParams.WRAP_CONTENT,
+                RelativeLayout.LayoutParams.WRAP_CONTENT);
+        imageParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
+        imageParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
+
+        image.setLayoutParams(imageParams);
+
+        return image;
     }
-
-    RelativeLayout.LayoutParams imageParams = new RelativeLayout.LayoutParams(
-        RelativeLayout.LayoutParams.WRAP_CONTENT,
-        RelativeLayout.LayoutParams.WRAP_CONTENT);
-    imageParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
-    imageParams.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
-
-    image.setLayoutParams(imageParams);
-
-    return image;
-  }
 }

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


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


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


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


BIN
WeiChat/src/main/res/drawable-xhdpi/end_meeting.png


BIN
WeiChat/src/main/res/drawable-xhdpi/end_meeting_pass.png


BIN
WeiChat/src/main/res/drawable-xhdpi/signin.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/end_meeting.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/end_meeting_pass.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/ic_metting_people.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/signin.png


+ 5 - 0
WeiChat/src/main/res/drawable/endmeeting.xml

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

+ 19 - 8
WeiChat/src/main/res/layout/activity_add_meeting.xml

@@ -22,18 +22,20 @@
                 android:text="会议名称"
                 android:textColor="@color/text_main"
                 android:textSize="@dimen/text_main" />
+
             <TextView
                 style="@style/form_relative_left_text"
                 android:layout_marginLeft="5dp"
                 android:layout_toRightOf="@+id/name_tag"
                 android:text="*"
                 android:textColor="@color/red" />
+
             <EditText
                 android:id="@+id/name_et"
                 style="@style/add_meet_tv"
+                android:layout_marginLeft="20dp"
                 android:layout_toRightOf="@+id/name_tag"
                 android:hint="请输入"
-                android:layout_marginLeft="20dp"
                 android:inputType="text" />
         </RelativeLayout>
 
@@ -53,18 +55,20 @@
                 android:text="开始时间"
                 android:textColor="@color/text_main"
                 android:textSize="@dimen/text_main" />
+
             <TextView
                 style="@style/form_relative_left_text"
                 android:layout_marginLeft="5dp"
                 android:layout_toRightOf="@+id/start_tag"
                 android:text="*"
                 android:textColor="@color/red" />
+
             <TextView
                 android:id="@+id/start_tv"
                 style="@style/add_meet_tv"
+                android:layout_marginLeft="20dp"
                 android:layout_toRightOf="@id/start_tag"
                 android:drawableRight="@drawable/oa_next"
-                android:layout_marginLeft="20dp"
                 android:hint="请选择" />
         </RelativeLayout>
 
@@ -83,18 +87,20 @@
                 android:text="结束时间"
                 android:textColor="@color/text_main"
                 android:textSize="@dimen/text_main" />
+
             <TextView
                 style="@style/form_relative_left_text"
                 android:layout_marginLeft="5dp"
                 android:layout_toRightOf="@+id/end_tag"
                 android:text="*"
                 android:textColor="@color/red" />
+
             <TextView
                 android:id="@+id/end_tv"
                 style="@style/add_meet_tv"
+                android:layout_marginLeft="20dp"
                 android:layout_toRightOf="@id/end_tag"
                 android:drawableRight="@drawable/oa_next"
-                android:layout_marginLeft="20dp"
                 android:hint="请选择" />
         </RelativeLayout>
 
@@ -113,17 +119,19 @@
                 android:text="会议地点"
                 android:textColor="@color/text_main"
                 android:textSize="@dimen/text_main" />
+
             <TextView
                 style="@style/form_relative_left_text"
                 android:layout_marginLeft="5dp"
                 android:layout_toRightOf="@+id/location_tag"
                 android:text="*"
                 android:textColor="@color/red" />
+
             <EditText
                 android:id="@+id/location_et"
                 style="@style/add_meet_tv"
-                android:layout_toRightOf="@id/location_tag"
                 android:layout_marginLeft="20dp"
+                android:layout_toRightOf="@id/location_tag"
                 android:hint="请输入" />
         </RelativeLayout>
 
@@ -159,18 +167,20 @@
                 android:text="参会人员"
                 android:textColor="@color/text_main"
                 android:textSize="@dimen/text_main" />
+
             <TextView
                 style="@style/form_relative_left_text"
                 android:layout_marginLeft="5dp"
                 android:layout_toRightOf="@+id/users_tag"
                 android:text="*"
                 android:textColor="@color/red" />
+
             <TextView
                 android:id="@+id/users_tv"
                 style="@style/add_meet_tv"
+                android:layout_marginLeft="20dp"
                 android:layout_toRightOf="@+id/users_tag"
                 android:drawableRight="@drawable/oa_next"
-                android:layout_marginLeft="20dp"
                 android:hint="请选择" />
         </RelativeLayout>
 
@@ -222,9 +232,9 @@
             <TextView
                 android:id="@+id/tag_et"
                 style="@style/add_meet_tv"
+                android:layout_marginLeft="20dp"
                 android:layout_toRightOf="@+id/tag_tag"
                 android:drawableRight="@drawable/oa_next"
-                android:layout_marginLeft="20dp"
                 android:hint="请选择" />
         </RelativeLayout>
 
@@ -247,8 +257,8 @@
             <EditText
                 android:id="@+id/about_et"
                 style="@style/add_meet_tv"
-                android:layout_toRightOf="@id/about_tag"
                 android:layout_marginLeft="20dp"
+                android:layout_toRightOf="@id/about_tag"
                 android:hint="请输入" />
         </RelativeLayout>
 
@@ -280,6 +290,7 @@
             style="@style/from_button_base_bule"
             android:layout_marginBottom="30dp"
             android:layout_marginTop="20dp"
-            android:text="保  存" />
+            android:text="保  存"
+            android:visibility="gone" />
     </LinearLayout>
 </ScrollView>

+ 2 - 1
WeiChat/src/main/res/layout/activity_business_add.xml

@@ -146,7 +146,8 @@
             <RelativeLayout
                 android:id="@+id/ry_business_phone"
                 style="@style/form_relative_customer"
-                android:background="@color/item_color2">
+                android:background="@color/item_color2"
+                android:visibility="gone">
 
 
                 <TextView

+ 14 - 8
WeiChat/src/main/res/layout/activity_meet_details.xml

@@ -74,7 +74,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginTop="10dp"
-            android:text="crm、OA导论"
             android:textColor="@color/text_main"
             android:textSize="@dimen/text_main" />
 
@@ -288,11 +287,18 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
-        android:layout_below="@+id/meet_about"
-        android:background="@color/white"
-        android:clickable="true"
-        android:gravity="center"
-        android:padding="20dp"
-        android:text="结束会议"
-        android:textColor="@color/text_main" />
+        android:background="@drawable/endmeeting"/>
+
+    <!--<TextView-->
+        <!--android:id="@+id/end_meet_tv"-->
+        <!--android:layout_width="match_parent"-->
+        <!--android:layout_height="wrap_content"-->
+        <!--android:layout_alignParentBottom="true"-->
+        <!--android:layout_below="@+id/meet_about"-->
+        <!--android:background="@color/white"-->
+        <!--android:clickable="true"-->
+        <!--android:gravity="center"-->
+        <!--android:padding="20dp"-->
+        <!--android:text="结束会议"-->
+        <!--android:textColor="@color/text_main" />-->
 </RelativeLayout>

+ 10 - 2
WeiChat/src/main/res/layout/activity_oa.xml

@@ -147,7 +147,7 @@
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="50dp"
+            android:layout_height="40dp"
             android:orientation="horizontal">
 
             <TextView
@@ -159,6 +159,12 @@
                 android:text="下属工作日历"
                 android:textSize="16dp" />
 
+            <View
+                android:layout_width="2px"
+                android:layout_height="match_parent"
+                android:layout_margin="5dp"
+                android:background="@color/default_shadow_color" />
+
             <TextView
                 android:id="@+id/my_log"
                 android:layout_width="0dp"
@@ -259,10 +265,12 @@
             android:layout_width="match_parent"
             android:layout_height="10dp"
             android:background="@color/white" />
+
         <com.xzjmyk.pm.activity.view.CalendarView
             android:id="@+id/oa_picker"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
+            android:layout_height="wrap_content" />
+
         <View
             android:layout_width="match_parent"
             android:layout_height="10dp"

+ 71 - 0
WeiChat/src/main/res/layout/calender_popup.xml

@@ -0,0 +1,71 @@
+<?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="200dp"
+    android:background="@color/white"
+    android:gravity="center_vertical"
+    android:orientation="horizontal"
+    android:padding="5dp">
+
+    <ListView
+        android:id="@+id/list_yeas"
+        style="@style/style_calender"
+        android:layout_weight="1" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+
+        android:text="年"
+        android:textSize="20dp" />
+
+    <ListView
+        android:id="@+id/list_month"
+        style="@style/style_calender"
+        android:layout_weight="1" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:text="月"
+        android:textSize="20dp" />
+
+    <ListView
+        android:id="@+id/list_day"
+        style="@style/style_calender"
+        android:layout_weight="1" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:text="日"
+        android:textSize="20dp" />
+
+    <ListView
+        android:id="@+id/list_hh"
+        style="@style/style_calender"
+        android:layout_weight="1" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:text="时"
+        android:textSize="20dp" />
+
+    <ListView
+        android:id="@+id/list_mm"
+        style="@style/style_calender"
+        android:layout_weight="1" />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:text="分"
+        android:textSize="20dp" />
+
+
+</LinearLayout>

+ 99 - 0
WeiChat/src/main/res/layout/fragment_click_signin.xml

@@ -0,0 +1,99 @@
+<?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="match_parent"
+    android:background="@color/oa_main">
+
+    <RelativeLayout
+        android:id="@+id/top"
+        android:layout_width="match_parent"
+        android:layout_height="?attr/actionBarSize"
+        android:background="@color/antionbarcolor">
+
+        <ImageView
+            android:id="@+id/back"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:padding="10dp"
+            android:src="@drawable/back" />
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:drawableRight="@drawable/down"
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_main" />
+
+        <ImageView
+            android:id="@+id/seting"
+            android:layout_width="40dp"
+            android:layout_height="match_parent"
+            android:layout_alignParentRight="true"
+            android:padding="8dp"
+            android:src="@drawable/setting" />
+    </RelativeLayout>
+
+    <LinearLayout
+        android:id="@+id/oa_range_addr_rl"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_marginBottom="8dp"
+        android:orientation="vertical"
+        android:padding="5dp">
+
+        <TextView
+            android:id="@+id/office_addr"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:drawableLeft="@drawable/oa_signin"
+            android:gravity="center_horizontal"
+            android:text="考勤地点:"
+            android:drawablePadding="10dp"
+            android:textColor="@color/text_hine" />
+
+        <TextView
+            android:id="@+id/unoffice_mm"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="地点微调"
+            android:textColor="@color/cadetblue" />
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/signin_btn"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_above="@+id/oa_range_addr_rl"
+        android:layout_centerHorizontal="true"
+        android:layout_marginBottom="8dp"
+        android:clickable="true"
+        android:gravity="center"
+        android:src="@drawable/signin_btn" />
+    <View
+        android:layout_width="2px"
+        android:layout_height="match_parent"
+        android:layout_above="@+id/signin_btn"
+        android:layout_below="@+id/top"
+        android:layout_centerHorizontal="true"
+        android:background="@color/item_line" />
+    <ListView
+        android:id="@+id/listview"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/signin_btn"
+        android:layout_below="@id/top"
+        android:layout_marginTop="5dp"
+        android:clickable="false"
+        android:divider="@null"
+        android:dividerHeight="0dp"
+        android:focusable="false"
+        android:longClickable="false"
+        android:minHeight="100dp" />
+
+
+</RelativeLayout>

+ 3 - 3
WeiChat/src/main/res/layout/fragment_outoffice.xml

@@ -56,7 +56,7 @@
             android:layout_alignBottom="@+id/tv"
             android:layout_marginLeft="5dp"
             android:layout_toRightOf="@+id/tv"
-            android:text="0 "
+            android:text=" 0"
             android:textColor="@color/mainList2"
             android:textSize="25dp" />
 
@@ -138,8 +138,8 @@
             android:layout_alignLeft="@id/date_tv"
             android:layout_alignTop="@id/tag_img2"
             android:layout_below="@+id/date_tv"
-            android:textColor="@color/text_main"
             android:gravity="center_vertical"
+            android:textColor="@color/text_main"
             android:textSize="@dimen/text_main" />
 
         <TextView
@@ -180,7 +180,7 @@
         android:layout_centerHorizontal="true"
         android:layout_gravity="center"
         android:layout_marginTop="100dp"
-        android:background="@drawable/signin_btn"
+        android:background="@drawable/signin"
         android:textColor="@color/white"
         android:textSize="20sp" />
 </LinearLayout>

+ 7 - 5
WeiChat/src/main/res/layout/fragment_signin.xml

@@ -8,7 +8,7 @@
         android:id="@+id/top"
         android:layout_width="match_parent"
         android:layout_height="?attr/actionBarSize"
-        android:background="@color/antionbarcolor">
+        android:background="#7292f8">
 
         <ImageView
             android:id="@+id/back"
@@ -50,9 +50,9 @@
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
             android:drawableLeft="@drawable/oa_signin"
+            android:drawablePadding="10dp"
             android:gravity="center_horizontal"
             android:text="考勤地点:"
-            android:drawablePadding="10dp"
             android:textColor="@color/text_hine" />
 
         <TextView
@@ -66,14 +66,15 @@
 
     <ImageView
         android:id="@+id/signin_btn"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:layout_width="100dp"
+        android:layout_height="100dp"
         android:layout_above="@+id/oa_range_addr_rl"
         android:layout_centerHorizontal="true"
         android:layout_marginBottom="8dp"
         android:clickable="true"
         android:gravity="center"
         android:src="@drawable/signin_btn" />
+
     <View
         android:layout_width="2px"
         android:layout_height="match_parent"
@@ -81,7 +82,8 @@
         android:layout_below="@+id/top"
         android:layout_centerHorizontal="true"
         android:background="@color/item_line" />
-    <ListView
+
+    <android.support.v7.widget.RecyclerView
         android:id="@+id/listview"
         android:layout_width="match_parent"
         android:layout_height="match_parent"

+ 4 - 0
WeiChat/src/main/res/layout/item_signin_list.xml

@@ -68,6 +68,8 @@
         android:layout_marginLeft="10dp"
         android:layout_toRightOf="@+id/point"
         android:background="@drawable/oa_no_criterion"
+        android:paddingLeft="5dp"
+        android:paddingRight="5dp"
         android:textColor="@color/white"
         android:textSize="@dimen/text_hine" />
 
@@ -131,6 +133,8 @@
         android:layout_marginLeft="10dp"
         android:layout_toRightOf="@+id/point2"
         android:background="@drawable/oa_no_criterion"
+        android:paddingLeft="5dp"
+        android:paddingRight="5dp"
         android:textColor="@color/white"
         android:textSize="@dimen/text_hine" />
 </RelativeLayout>

+ 16 - 12
WeiChat/src/main/res/layout/view_empty.xml

@@ -4,9 +4,11 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
+
     <RelativeLayout
-        android:layout_width="match_parent" 
+        android:layout_width="match_parent"
         android:layout_height="match_parent">
+
         <TextView
             android:id="@+id/textViewMessage"
             android:layout_width="wrap_content"
@@ -17,17 +19,19 @@
             android:text="@string/empty_message"
             android:textAppearance="?android:attr/textAppearanceMedium"
             android:textColor="@color/gray_light" />
-       <Button
-        android:id="@+id/buttonEmpty"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="16dp"
-        android:layout_below="@+id/textViewMessage"
-        android:layout_centerHorizontal="true"
-        android:visibility="gone"
-        android:text="@string/empty_button" />
+
+        <Button
+            android:id="@+id/buttonEmpty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/textViewMessage"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="16dp"
+            android:text="@string/empty_button"
+            android:visibility="gone" />
     </RelativeLayout>
-    <TextView 
+
+    <TextView
         android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
+        android:layout_height="wrap_content" />
 </RelativeLayout>

+ 51 - 3
WeiChat/src/main/res/values-v14/styles.xml

@@ -4,7 +4,7 @@
     <style name="AppTheme" parent="AppBaseTheme">
         <!-- All customizations that are NOT specific to a particular API-level can go here. -->
     </style>
-    
+
     <style name="AppBaseThemeBule" parent="Theme.AppCompat.Light.DarkActionBar">
         <item name="android:buttonStyle">@android:style/Widget.Button</item>
         <item name="android:windowAnimationStyle">@style/IMAnimationStyle</item>
@@ -22,10 +22,32 @@
     <style name="CrmThemeBlue" parent="AppBaseThemeBule">
         <item name="actionBarStyle">@style/CRM_Ttile_Bule</item>
     </style>
+
+    <style name="CrmThemeCustomer" parent="AppBaseThemeBule">
+        <item name="actionBarStyle">@style/CRM_Ttile_Customer</item>
+    </style>
+
+    <style name="CrmThemeVisit" parent="AppBaseThemeBule">
+        <item name="actionBarStyle">@style/CRM_Ttile_Visit</item>
+    </style>
+
+    <style name="CrmThemeRank" parent="AppBaseThemeBule">
+        <item name="actionBarStyle">@style/CRM_Ttile_Rank</item>
+    </style>
+
+    <style name="OAThemeOutOffice" parent="AppBaseThemeBule">
+        <item name="actionBarStyle">@style/OATheme_OutOffice</item>
+    </style>
+
+    <style name="OAThemeMeet" parent="AppBaseThemeBule">
+        <item name="actionBarStyle">@style/OATheme_Meet</item>
+    </style>
+
+
     <style name="CrmThemeTask" parent="AppBaseThemeBule">
         <item name="actionBarStyle">@style/CRM_Ttile_Task</item>
     </style>
-   
+
     <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
         <item name="android:buttonStyle">@android:style/Widget.Button</item>
         <item name="android:windowAnimationStyle">@style/IMAnimationStyle</item>
@@ -49,7 +71,33 @@
         <item name="android:background">@color/crm_title_task</item>
         <item name="background">@color/crm_title_task</item>
     </style>
-    
+
+    <style name="CRM_Ttile_Visit" parent="IMActionBar">
+        <item name="android:background">@color/titleVisit</item>
+        <item name="background">@color/titleVisit</item>
+    </style>
+
+    <style name="CRM_Ttile_Customer" parent="IMActionBar">
+        <item name="android:background">@color/titleCustomer</item>
+        <item name="background">@color/titleCustomer</item>
+    </style>
+
+    <style name="CRM_Ttile_Rank" parent="IMActionBar">
+        <item name="android:background">@color/titleRank</item>
+        <item name="background">@color/titleRank</item>
+    </style>
+
+    <style name="OATheme_OutOffice" parent="IMActionBar">
+        <item name="android:background">@color/oa_outoffice</item>
+        <item name="background">@color/oa_outoffice</item>
+    </style>
+
+    <style name="OATheme_Meet" parent="IMActionBar">
+        <item name="android:background">@color/meeting</item>
+        <item name="background">@color/meeting</item>
+    </style>
+
+
     <style name="IMActionBar" parent="Widget.AppCompat.ActionBar">
         <item name="android:actionBarSize">11dp</item>
         <item name="android:icon">@drawable/action_bar_divider</item>

+ 11 - 2
WeiChat/src/main/res/values/colors.xml

@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-   <color name="crm_title_task">#91B43D</color>
+    <color name="crm_title_task">#D0A233</color>
     <!--by gongpengming-->
+    <color name="oa_outoffice">#39cea7</color>
+    <color name="meeting">#d79147</color>
+    <color name="subscrip_text">#60a0a0a0</color>
     <color name="subscrip_text">#809b9797</color>
     <color name="item_color1">#30a0a0a0</color>
     <color name="pop_bg">#aeaeae</color>
@@ -222,8 +225,14 @@
     <color name="green">#008000</color> <!-- 绿色 -->
     <color name="darkgreen">#006400</color> <!-- 暗绿色 -->
     <color name="blue">#0000FF</color> <!-- 蓝色 -->
+    <!--标题栏颜色-->
     <color name="titleBlue">#3C97D7</color> <!-- 青蓝色 -->
-  
+    <color name="titleCustomer">#DF8339</color>
+    <color name="titleVisit">#6FB660</color>
+    <color name="titleTask">#D0A233</color>
+    <color name="titleRank">#D0A233</color>
+
+
     <color name="mediumblue">#0000CD</color> <!-- 中兰色 -->
     <color name="darkblue">#00008B</color> <!-- 暗蓝色 -->
     <color name="navy">#000080</color> <!-- 海军色 -->

+ 10 - 1
WeiChat/src/main/res/values/gpm_values.xml

@@ -107,7 +107,16 @@
             <item name="android:textColor">@color/text_hine</item>  
             <item name="android:textStyle">italic</item>  
     </style>
-    <!--end Style-->
+
+    <style name="style_calender">  
+        <item name="android:layout_width">0dp</item>
+
+        <item name="android:layout_height">match_parent</item>
+        <item name="android:divider">@null</item>
+        <item name="android:dividerHeight">0dp</item>
+        <item name="android:scrollbars">none</item>
+        <item name="android:scrollbarSize">0dp</item>
+    </style><!--end Style-->
 
     <dimen name="drawable_padding">5dp</dimen>
 </resources>

+ 2 - 2
WeiChat/src/main/res/values/strings.xml

@@ -5,8 +5,8 @@
         <item>商机失效</item>
         <item>继续跟进</item>
         <item>转移</item>
-        <item>转为预录入客户</item>
-        <item>转为已有客户</item>
+        <item>转为客户</item>
+        <item>关联已有客户</item>
     </string-array>
 
     <string name="crm_sale_num">****元  (第**名)</string>