Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/developer' into developer

# Conflicts:
#	WeiChat/src/main/java/com/xzjmyk/pm/activity/BdLocationHelper.java
#	WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Crouton.java
Bitliker 9 gadi atpakaļ
vecāks
revīzija
0c8b3c536a
38 mainītis faili ar 1088 papildinājumiem un 762 dzēšanām
  1. 1 0
      WeiChat/build.gradle
  2. BIN
      WeiChat/libs/bugly_crash_release.jar
  3. BIN
      WeiChat/libs/okhttp-3.4.1.jar
  4. 31 18
      WeiChat/src/main/AndroidManifest.xml
  5. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/MyApplication.java
  6. 3 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/base/BaseActivity.java
  7. 7 5
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/ExtraLeaveActivity.java
  8. 8 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/LeaveActivity.java
  9. 3 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/NoticeMenuActivity.java
  10. 12 8
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/TravelActivity.java
  11. 22 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WorkExtraActivity.java
  12. 21 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessAddActivity.java
  13. 9 6
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailActivty.java
  14. 57 28
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java
  15. 8 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessLessActivity.java
  16. 7 5
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessTransferActivity.java
  17. 57 54
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/ClientActivity.java
  18. 22 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/CustomerAddActivity.java
  19. 21 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportAddActivity.java
  20. 18 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/VisitReportPlanActivity.java
  21. 9 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/OAActivity.java
  22. 3 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/adapter/HListViewOneAdapter.java
  23. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBManager.java
  24. 13 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/CommonUtil.java
  25. 2 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java
  26. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/SubscriptionActivity.java
  27. 16 12
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Crouton.java
  28. 536 478
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Style.java
  29. 8 0
      WeiChat/src/main/res/drawable/selector_popup_btn.xml
  30. 1 1
      WeiChat/src/main/res/layout/activity_business.xml
  31. 6 4
      WeiChat/src/main/res/layout/activity_client.xml
  32. 3 2
      WeiChat/src/main/res/layout/bigimage_subscription.xml
  33. 120 111
      WeiChat/src/main/res/layout/item_business_detail.xml
  34. 2 2
      WeiChat/src/main/res/layout/popupwindow_subscribe_menu.xml
  35. 25 1
      WeiChat/src/main/res/values-v14/styles.xml
  36. 7 1
      WeiChat/src/main/res/values/colors.xml
  37. 7 4
      WeiChat/src/main/res/values/styles.xml
  38. 20 0
      gradle.properties

+ 1 - 0
WeiChat/build.gradle

@@ -94,4 +94,5 @@ dependencies {
     compile 'me.gujun.android.taggroup:library:1.4@aar'
     compile 'com.umeng.analytics:analytics:latest.integration'
     compile 'com.android.support:multidex:1.0.1'
+  
 }

BIN
WeiChat/libs/bugly_crash_release.jar


BIN
WeiChat/libs/okhttp-3.4.1.jar


+ 31 - 18
WeiChat/src/main/AndroidManifest.xml

@@ -2,14 +2,14 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     package="com.xzjmyk.pm.activity"
-    android:versionCode="46"
-    android:versionName="4.6">
+    android:versionCode="51"
+    android:versionName="5.1">
     <uses-sdk
         android:minSdkVersion="11"
-        android:targetSdkVersion="23" />
+        android:targetSdkVersion="22" 
+        />
     <!-- 拨打电话 -->
     <uses-permission android:name="android.permission.CALL_PHONE" />
-
     <uses-feature android:name="android.hardware.camera" />
     <uses-feature android:name="android.hardware.camera.autofocus" />
     <uses-feature android:name="android.hardware.microphone" />
@@ -56,7 +56,6 @@
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <!-- 百度自动更新 -->
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.READ_PHONE_STATE" />
     <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <uses-permission android:name="android.permission.INTERNET" />
@@ -64,6 +63,7 @@
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
 
     <application
+        android:largeHeap="true"
         android:name=".MyApplication"
         android:allowBackup="true"
         android:icon="@drawable/uuu"
@@ -75,7 +75,6 @@
         <meta-data
             android:name="UMENG_CHANNEL"
             android:value="baidu" />
-
         <!-- 启动页面 -->
         <activity
             android:name=".ui.SplashActivity"
@@ -410,17 +409,24 @@
         <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" />
@@ -438,11 +444,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"
@@ -463,7 +473,8 @@
             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"
@@ -511,13 +522,15 @@
         <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="会议任务" />
         <activity
             android:name=".ui.erp.activity.oa.OAListActivity"
             android:label="外勤签到列表" />
+
     </application>
 
 </manifest>

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/MyApplication.java

@@ -33,7 +33,6 @@ import com.xzjmyk.pm.activity.volley.FastVolley;
 import org.apache.http.cookie.Cookie;
 
 import java.io.File;
-import java.util.List;
 
 public class MyApplication extends Application {
     /**
@@ -55,6 +54,7 @@ public class MyApplication extends Application {
     public void onCreate() {
         super.onCreate();
         INSTANCE = this;
+//        CrashReport.initCrashReport(getApplicationContext(), "900050585", false);
         PreferenceUtils.putBoolean(this, Constants.IS_NOTIFICATION, false);//不进行通知
         new Handler().postDelayed(new Runnable() {
             @Override

+ 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);

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

@@ -355,15 +355,17 @@ public class ExtraLeaveActivity extends BaseActivity implements OnClickListener
 		et_extra_time.setKeyListener(null);
 		et_extra_resaon.setKeyListener(null);
 		et_extra_encode.setKeyListener(null);
-		
-		et_extra_encode.setText(CommonUtil.getSharedPreferences(this, "erp_emname"));
 		et_leader_no.setKeyListener(null);
 		et_extra_deparment.setKeyListener(null);
-		
+		et_extra_date.setFocusable(false);
+		et_extra_time.setFocusable(false);
+		et_extra_resaon.setFocusable(false);
+		et_extra_encode.setFocusable(false);
+		et_leader_no.setFocusable(false);
+		et_extra_deparment.setFocusable(false);
+		et_extra_encode.setText(CommonUtil.getSharedPreferences(this, "erp_emname"));
 		et_extra_encode.setOnClickListener(this);
-
 		et_leader_no.setOnClickListener(this);
-
 		et_extra_date.setOnClickListener(this);
 		et_extra_resaon.setOnClickListener(this);
 		et_extra_time.setOnClickListener(this);

+ 8 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/LeaveActivity.java

@@ -545,6 +545,14 @@ public class LeaveActivity extends BaseActivity implements OnClickListener {
         et_leave_category.setKeyListener(null);
         et_leave_man.setKeyListener(null);
         et_leave_mankind.setKeyListener(null);
+
+        tv_start_time.setFocusable(false);
+        tv_end_time.setFocusable(false);
+        et_leave_type.setFocusable(false);
+        et_leave_category.setFocusable(false);
+        et_leave_man.setFocusable(false);
+        et_leave_mankind.setFocusable(false);
+        
         et_leave_man.setText(CommonUtil.getSharedPreferences(this, "erp_emname"));
 
 

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

@@ -2,7 +2,6 @@ package com.xzjmyk.pm.activity.ui.erp.activity;
 
 import android.content.Intent;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MenuItem;
 import android.view.View;
@@ -18,6 +17,9 @@ import com.xzjmyk.pm.activity.view.PullToRefreshSlideListView;
 
 import java.util.ArrayList;
 
+/**
+ * 通知公告页面
+ */
 public class NoticeMenuActivity extends BaseActivity {
     private ArrayList<Bean> beans;
     public static final int NEWS_REC = 0x01, GONGGAO_REC = 0x03, NOTICES_REC = 0x02;

+ 12 - 8
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/TravelActivity.java

@@ -292,29 +292,33 @@ public class TravelActivity extends BaseActivity implements OnClickListener {
 		ct=this;
         progressDialog=CustomProgressDialog.createDialog(this);
 		getSupportActionBar().setTitle("出差申请");
-		et_trave_type.setOnClickListener(this);
-		et_extra_sign.setOnClickListener(this);
+	
 		et_trave_type.setKeyListener(null);
 		et_extra_sign.setKeyListener(null);
 		et_extra_deparment.setKeyListener(null);
-
+		et_trave_linkman.setKeyListener(null);
 		et_extra_endtime.setKeyListener(null);
 		et_extra_starttime.setKeyListener(null);
 
+		et_trave_type.setFocusable(false);
+		et_extra_sign.setFocusable(false);
+		et_extra_deparment.setFocusable(false);
+		et_trave_linkman.setFocusable(false);
+		et_extra_endtime.setFocusable(false);
+		et_extra_starttime.setFocusable(false);
+		
+
 		et_extra_endtime.setOnClickListener(this);
 		et_extra_starttime.setOnClickListener(this);
-		et_trave_linkman.setKeyListener(null);
 		et_trave_linkman.setOnClickListener(this);
-
 		bt_save.setOnClickListener(this);
 		bt_commit.setOnClickListener(this);
 		bt_add.setOnClickListener(this);
 		bt_update.setOnClickListener(this);
 		bt_uncommit.setOnClickListener(this);
-
-
+		et_trave_type.setOnClickListener(this);
+		et_extra_sign.setOnClickListener(this);
 		et_trave_linkman.setText(CommonUtil.getSharedPreferences(this, "erp_emname"));
-
 	}
 
 	protected void initDataFromServer(List<TravelEntity> leaveEntities,

+ 22 - 6
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WorkExtraActivity.java

@@ -198,7 +198,8 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
                             bt_commit.setChecked(false);
                             bt_update.setTextColor(getResources().getColor(
                                     R.color.black));
-                            bt_update.setEnabled(true);          bt_update.setChecked(false);
+                            bt_update.setEnabled(true);
+                            bt_update.setChecked(false);
                             bt_uncommit.setTextColor(getResources().getColor(
                                     R.color.gray));
                             bt_uncommit.setEnabled(false);
@@ -359,6 +360,7 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         setContentView(R.layout.act_extra_work);
         ViewUtils.inject(this);
         ct = this;
+        getSupportActionBar().setTitle("加班申请");
         progressDialog = new CustomProgressDialog(ct).createDialog(this);
         et_extra_type.setKeyListener(null);
         et_extra_no.setKeyListener(null);
@@ -367,6 +369,16 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         et_extra_starttime.setKeyListener(null);
         et_extra_isallday.setKeyListener(null);
         et_extra_type.setKeyListener(null);
+        et_extra_mankind.setKeyListener(null);
+
+        et_extra_type.setFocusable(false);
+        et_extra_no.setFocusable(false);
+        et_extra_company.setFocusable(false);
+        et_extra_endtime.setFocusable(false);
+        et_extra_starttime.setFocusable(false);
+        et_extra_isallday.setFocusable(false);
+        et_extra_type.setFocusable(false);
+        et_extra_mankind.setFocusable(false);
 
         et_extra_company.setOnClickListener(this);
         et_extra_company.setText(CommonUtil.getSharedPreferences(this, "erp_emname"));
@@ -382,8 +394,8 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         bt_uncommit.setOnClickListener(this);
         bt_update.setOnClickListener(this);
         et_extra_type.setOnClickListener(this);
-        getSupportActionBar().setTitle("加班申请");
-        et_extra_mankind.setOnKeyListener(null);
+
+
         et_extra_mankind.setOnClickListener(this);
     }
 
@@ -444,11 +456,11 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
                 break;
             case R.id.bt_add:   //新增
                 httpAdd();
-            if (bt_add.isEnabled()){
+                if (bt_add.isEnabled()) {
 
-            }else {
+                } else {
 
-            }
+                }
                 break;
             case R.id.bt_commit://提交
                 httpCommit();
@@ -760,6 +772,7 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         bt_update.setEnabled(false);
         bt_update.setChecked(true);
     }
+
     public void editnoclik() {
         et_extra_company.setEnabled(false);
         et_extra_type.setEnabled(false);
@@ -770,6 +783,7 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         et_extra_starttime.setEnabled(false);
         et_extra_remark.setEnabled(false);
     }
+
     public void editclik() {
         et_extra_company.setEnabled(true);
         et_extra_type.setEnabled(true);
@@ -780,6 +794,7 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         et_extra_starttime.setEnabled(true);
         et_extra_remark.setEnabled(true);
     }
+
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         switch (requestCode) {
@@ -795,6 +810,7 @@ public class WorkExtraActivity extends BaseActivity implements OnClickListener {
         }
         super.onActivityResult(requestCode, resultCode, data);
     }
+
     public void loadDataForServer(String field, int what) {
         Log.i("leave", "what=" + what);
         String url = Constants.getAppBaseUrl(ct) + "mobile/common/getCombo.action";

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

@@ -20,11 +20,15 @@ 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.ui.erp.util.Constants;
+import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
 import com.xzjmyk.pm.activity.ui.erp.view.SingleDialog;
 import com.xzjmyk.pm.activity.util.DateFormatUtil;
 import com.xzjmyk.pm.activity.util.ToastUtil;
 import com.xzjmyk.pm.activity.view.wheel.DatePicker;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -77,7 +81,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);
@@ -111,12 +115,13 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
     }
 
     private void initData() {
+        CommonUtil.getCommonId(this,"BUSINESSCHANCE_SEQ",mHandler,GET_BC_ID);
         getCodeByNet();
     }
 
     private void initView() {
         ViewUtils.inject(this);
-        getSupportActionBar().setTitle("建商机");
+        getSupportActionBar().setTitle("建商机");
         et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
     }
 
@@ -176,6 +181,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
     private static final int LOAD_BUSINESS = 3;
     private static final int LOAD_JIEDUAN = 4;
     private static final int LOAD_MANGENJIN = 5;
+    private static final int GET_BC_ID = 6;
     private JSONArray jsons;
     
     private Handler mHandler = new Handler() {
@@ -262,6 +268,17 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     ToastMessage(msg.getData().getString("result"));
                     break;
+                case GET_BC_ID:
+                    String resultStr = msg.getData().getString("result");
+                    try {
+                        JSONObject resultJsonObject = new JSONObject(resultStr);
+                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
+                            mBcId = resultJsonObject.getInt("id");
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    break;
             }
         }
     };
@@ -302,8 +319,10 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
         }else{
             enterCode=CommonUtil.getSharedPreferences(ct,"erp_username");
         }
+        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" +

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

@@ -156,7 +156,7 @@ public class BusinessDetailActivty extends BaseActivity {
             getSupportActionBar().setTitle("商机跟进");
             ll_top_state.setVisibility(View.VISIBLE);
         } else if (type == 1) {
-            getSupportActionBar().setTitle("抢商机");
+            getSupportActionBar().setTitle("抢商机");
             ll_top_state.setVisibility(View.GONE);
         } else if (type == 2) {
             getSupportActionBar().setTitle("商机分配");
@@ -387,15 +387,18 @@ public class BusinessDetailActivty extends BaseActivity {
                 case BUSINESS_QIANG:
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
                     progressDialog.dismiss();
-                    ToastMessage("抢商机成功!");
+                    Crouton.makeText(BusinessDetailActivty.this,45,"成功抢得此商机,\n" +
+                            "请到商机跟进中查看商机!\n",
+                            getResources().getColor(R.color.light_green),
+                            5000).show();
                     sendHttpResquest(Constants.HTTP_SUCCESS_INIT, page = 1);
-//                    startActivity(new Intent(ct, BusinessActivity.class));
-//                    finish();
                     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"));

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

@@ -22,6 +22,7 @@ import android.widget.TextView;
 import com.afollestad.materialdialogs.GravityEnum;
 import com.afollestad.materialdialogs.MaterialDialog;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.lidroid.xutils.ViewUtils;
 import com.lidroid.xutils.view.annotation.ViewInject;
@@ -57,8 +58,8 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
     private Button bt_manage_date;
     @ViewInject(R.id.bt_zhuanyi)
     private Button bt_zhuanyi;
- 
-    
+
+
     @ViewInject(R.id.bt_manage_go)
     private Button bt_manage_go;
     @ViewInject(R.id.crm_ll_followup)
@@ -80,27 +81,27 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
     @ViewInject(R.id.bc_code)
     private TextView bc_code;
     @ViewInject(R.id.bc_description)
-    private TextView  bc_description;
+    private TextView bc_description;
     @ViewInject(R.id.bc_nichehouse)
     private TextView bc_nichehouse;
     @ViewInject(R.id.bc_type)
-    private TextView  bc_type;
+    private TextView bc_type;
     @ViewInject(R.id.bc_currentprocess)
-    private TextView  bc_currentprocess;
+    private TextView bc_currentprocess;
     @ViewInject(R.id.bc_lastdate)
-    private TextView  bc_lastdate;
+    private TextView bc_lastdate;
     @ViewInject(R.id.bc_doman)
-    private TextView  bc_doman;
+    private TextView bc_doman;
     @ViewInject(R.id.bc_custname)
-    private TextView  bc_custname;
+    private TextView bc_custname;
     @ViewInject(R.id.bc_address)
-    private TextView        bc_address;
+    private TextView bc_address;
     @ViewInject(R.id.bc_contact)
     private TextView bc_contact;
     @ViewInject(R.id.bc_position)
-    private TextView       bc_position;
+    private TextView bc_position;
     @ViewInject(R.id.bt_tel)
-    private TextView  bt_tel;
+    private TextView bt_tel;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -168,16 +169,13 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                 showPopupWindow(v.findViewById(R.id.bt_manage_go));
                 break;
             case R.id.bt_manage_date:
-                Intent intent = new Intent(ct, TaskAddActivity.class);
-                intent.putExtra("type", 1);
-                intent.putExtra("data", bt_code);
-                startActivityForResult(intent, 0x11);
+                isEnableClick(bt_code,5);
                 break;
             case R.id.bt_qiang:
                 progressDialog.show();
                 String url = Constants.getAppBaseUrl(ct) + "mobile/crm/ifoverrecv.action";
-                Map<String,Object> stringMap = new HashMap<String, Object>();
-                stringMap.put("emcode",CommonUtil.getSharedPreferences(ct, "erp_username"));
+                Map<String, Object> stringMap = new HashMap<String, Object>();
+                stringMap.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
 
                 LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
                 headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
@@ -338,7 +336,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                         bc_lastdate.setText(root.getString("bc_lastdate"));
                         bc_recorder.setText(root.getString("bc_recorder"));
                         bc_remark.setText(root.getString("bc_remark"));
-                        
+
                         bc_doman.setText(root.getString("bc_doman"));
                         bc_code.setText(root.getString("bc_code"));
                         bc_address.setText(root.getString("bc_address"));
@@ -348,7 +346,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                         bc_description.setText(root.getString("bc_description"));
                         bc_currentprocess.setText(root.getString("bc_currentprocess"));
                         bc_type.setText(root.getString("bc_type"));
-                        
+
                         bt_doman = root.getString("bc_doman");
                         bt_code = root.getString("bc_code");
                         bt_process = root.getString("bc_currentprocess");
@@ -356,10 +354,17 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                     break;
                 case BUSINESS_QIANG:
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
-                    // ViewUtil.ToastMessage(ct, msg.getData().getString("result"));
                     progressDialog.dismiss();
-                    ToastMessage("抢商机成功!");
-                    finish();
+                    Crouton.makeText(activity,45,"成功抢得此商机,\n" +
+                                    "请到商机跟进中查看商机!\n",
+                            getResources().getColor(R.color.light_green),
+                            5000).show();
+                   new Handler().postDelayed(new Runnable() {
+                      @Override
+                      public void run() {
+                          finish();
+                      }
+                  },5000);
 //                    startActivity(new Intent(ct, BusinessDetailActivty.class).putExtra("bt_type",1));
                     break;
                 case BUSINESS_FENPEI:
@@ -377,15 +382,28 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
                 case CAN_QIANG_NOT:
                     JSONObject result = JSON.parseObject(msg.getData().getString("result"));
                     String isok = result.getString("isok");
-                    if ("0".equals(isok)){
+                    if ("0".equals(isok)) {
                         Log.i("qiang", isok);
                         sendHttpBusinessQiang(BUSINESS_QIANG, bt_code, bt_doman);
-                    }else if ("1".equals(isok)){
-                        Log.i("qiang",isok);
+                    } else if ("1".equals(isok)) {
+                        Log.i("qiang", isok);
                         progressDialog.dismiss();
                         Crouton.makeText(BusinessDetailInfoActivity.this, "您已超出最大获取商机数!", 0xffff4444, 2000).show();
                     }
-
+                case 5:
+                     result = JSON.parseObject(msg.getData().getString("result"));
+                    JSONArray items=result.getJSONArray("result");
+                    if (items!=null){
+                        if (items.size()>0){
+                            Crouton.makeText(BusinessDetailInfoActivity.this, "不能重复添加到日程!", 0xffff4444, 2000).show();
+                        }else{
+                            Intent intent = new Intent(ct, TaskAddActivity.class);
+                            intent.putExtra("type", 1);
+                            intent.putExtra("data", bt_code);
+                            startActivityForResult(intent, 0x11);
+                        }
+                    }
+                    break;
                 case Constants.APP_SOCKETIMEOUTEXCEPTION:
                     progressDialog.dismiss();
                     Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
@@ -397,7 +415,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
 
     private void jumpToStateActivity() {
         Intent intent = new Intent();
-        intent.setClass(BusinessDetailInfoActivity.this,BusinessStateActivity.class);
+        intent.setClass(BusinessDetailInfoActivity.this, BusinessStateActivity.class);
         startActivity(intent);
     }
 
@@ -406,7 +424,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
         String url = Constants.getAppBaseUrl(ct) + "mobile/common/getPanel.action";
         Map<String, Object> params = new HashMap<>();
         params.put("caller", "BusinessChance");
-        if (type==0)formCondition="bc_id"+formCondition;
+        if (type == 0) formCondition = "bc_id" + formCondition;
         params.put("formCondition", formCondition);
         params.put("gridCondition", gridCondition);
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
@@ -442,6 +460,17 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
 
     }
 
+    public void isEnableClick(String bt_code,int what){
+        String url = Constants.getAppBaseUrl(ct) + "mobile/crm/getSchedule.action";
+        progressDialog.show();
+        Map<String, Object> params = new HashMap<>();
+        params.put("bccode", bt_code);
+        params.put("emname", MyApplication.getInstance().mLoginUser.getNickName());
+        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");
+    }
+    
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         switch (requestCode) {

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

@@ -180,7 +180,7 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
         ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, what, null, null, "post");
     }
 
-    private void sendHttpResquest(int what, String type) {
+    private void sendHttpResquest(int what, String typeStr) {
         progressDialog.show();
         String remark = et_remark.getText().toString();
         String gridSore = "{\n" +
@@ -189,13 +189,18 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
                 "\"bcd_leader\":\"" + tv_leader.getText().toString() + "\",\n" +
                 "\"bcd_date\":\"" + tv_date.getText().toString() + "\",\n" +
                 "\"bcd_bsname\":\"" + process + "\",\n" +
-                "\"bcd_type\":\"" + type + "\",\n" +
+                "\"bcd_type\":\"" + typeStr + "\",\n" +
                 "\"bcd_man\":\"" + MyApplication.getInstance().mLoginUser.getNickName()+ "\"" + (this.type == 1 ? ",\n\"bcd_code\":\"" + bcd_code + "\"\n" : "") +
                 "}";
         String url = Constants.getAppBaseUrl(ct) + "mobile/crm/updatebusinessChanceData.action";
         Map<String, Object> params = new HashMap<>();
         params.put("gridStore", gridSore);
-        params.put("caller", "BusinessChance");
+        if (type==1){
+            params.put("caller", "BusinessChanceData");//BusinessChance
+        }else{
+            params.put("caller", "BusinessChanceData");
+        }
+       
         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");

+ 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");

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

@@ -461,11 +461,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();
@@ -532,23 +537,23 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                             if (sales.size() != 2) {
                                 //__元/第__名   第一名:__金额:__元
                                 CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
-                                        "¥__" + "/NO."+"__",
-                                        new String[]{"__"},ct.getResources().getColor(R.color.yellow_home)
+                                         "NO."+"__"+"\n¥__",
+                                        new String[]{"__"},ct.getResources().getColor(R.color.gray)
                                         );
                                 CommonUtil.textAarrySpanForStyle(tv_rank_sale_right,
                                         "NO.1:" + sales.getJSONArray(0).getString(1)
-                                                + "/¥:" + sales.getJSONArray(0).getIntValue(0) + ""
-                                ,new String[]{sales.getJSONArray(0).getString(1),
-                                        String.valueOf(sales.getJSONArray(0).getIntValue(0))},
-                                        ct.getResources().getColor(R.color.yellow_home));
+                                                + "\n¥" + sales.getJSONArray(0).get(0) + ""
+                                        , new String[]{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(sales.getJSONArray(1).getIntValue(0) + "元/第1名");
+                                tv_rank_sale_left.setText("NO.1\n"+"¥"+sales.getJSONArray(1).get(0));
                                 tv_rank_sale_right.setText("NO._:" + sales.getJSONArray(0).getString(1)
-                                        + "¥:" + sales.getJSONArray(1).getIntValue(0) + "");
-                                sales.getJSONArray(1).getIntValue(0);//自己  元
+                                        + "\n¥" + sales.getJSONArray(1).get(0) + "");
+                                sales.getJSONArray(1).get(0);//自己  元
                                 sales.getJSONArray(1).getString(1);//自己
                             }
                         }
@@ -559,65 +564,61 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                         if (visits.size() != 2) {
                             //名称 拜访次数,拜访个数,排名
                             CommonUtil.textAarrySpanForStyle(tv_rank_visit_left,
-                                    "__" + "个/" +
                                            /* visits.getJSONArray(0).getIntValue(1) + "次/第"*/
-                                           "NO."+ "__" ,
+                                           "NO."+ "__" +"\n__" + "个",
                                     new String[]{"__"
                                           /*  , String.valueOf(visits.getJSONArray(0).getIntValue(1))*/
                                             , "__"
-                                    }, ct.getResources().getColor(R.color.yellow_home));
+                                    }, ct.getResources().getColor(R.color.black));
                             CommonUtil.textAarrySpanForStyle(tv_rank_visit_right,
                                     "NO.1:" + visits.getJSONArray(0).getString(0)
-                                            + "/" + visits.getJSONArray(0).getIntValue(2)
-                                            + "个/" + visits.getJSONArray(0).getIntValue(1) + " 次"
+                                            + "\n" + visits.getJSONArray(0).getIntValue(2)
+                                            + "个"
+//                                            + visits.getJSONArray(0).getIntValue(1) + " 次"
                                     , new String[]{visits.getJSONArray(0).getString(0)
-                                            , String.valueOf(visits.getJSONArray(0).getIntValue(2))
-                                            , String.valueOf(visits.getJSONArray(0).getIntValue(1))},
-                                    ct.getResources().getColor(R.color.yellow_home));
+                                            , String.valueOf(visits.getJSONArray(0).getIntValue(2))},
+                                    ct.getResources().getColor(R.color.gray));
                         } else {
-                            tv_rank_visit_left.setText(visits.getJSONArray(1).getIntValue(2) + "个/" +
-                                    visits.getJSONArray(1).getIntValue(1) + "次/第"
-                                    + visits.getJSONArray(1).getIntValue(3) + "名");
-                            tv_rank_visit_right.setText("第一名:" + visits.getJSONArray(1).getString(0)
-                                    + "拜访:" + visits.getJSONArray(1).getIntValue(2)
-                                    + "个/" + visits.getJSONArray(1).getIntValue(1) + "次");
+                            tv_rank_visit_left.setText("NO." + visits.getJSONArray(1).getIntValue(3)+
+                                    "\n"+visits.getJSONArray(1).getIntValue(2) + "个");
+                            tv_rank_visit_right.setText("NO.1:" + visits.getJSONArray(1).getString(0)
+                                    + "\n" +visits.getJSONArray(1).getIntValue(2)
+                                    + "个");
                            
                         }
                     }else{
                         CommonUtil.textAarrySpanForStyle(tv_rank_visit_left,
-                                "__" + "个/" +
-                                        "__" + "次/第"
-                                        + "__"  + "名",
+                                "NO.__" + "\n__个",
                                 new String[]{"__"}
-                                , ct.getResources().getColor(R.color.yellow_home));
+                                , ct.getResources().getColor(R.color.gray));
                         CommonUtil.textAarrySpanForStyle(tv_rank_visit_right,
-                                "第一名:" + "__"
-                                        + "拜访:" +  "__"
-                                        + "个/" +  "__" + "次"
+                                "NO1:" + "__"
+                                       + "\n__"
+                                        + "个"
                                 , new String[]{ "__"},
-                                ct.getResources().getColor(R.color.yellow_home));
+                                ct.getResources().getColor(R.color.gray));
                     }
 
                     if (profits != null&&!profits.isEmpty()) {
                         if (profits.size() == 2) {
-                            tv_rank_rirun_left.setText("__" + "元/第"+"__"+"名");
-                            tv_rank_rirun_right.setText("第一名:" + profits.getJSONArray(1).getString(1)
-                                    + "金额:" + profits.getJSONArray(1).getIntValue(0) + "元");
-                            profits.getJSONArray(1).getIntValue(0);//第一名  元
+                            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);//第一名  元
                         } else {
                             CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
-                                    "¥"+"__"+ " /NO.__",
+                                    "NO.__"+"\n¥"+"__",
                                     new String[]{
-                                            "__","__"},ct.getResources().getColor(R.color.yellow_home));
+                                            "__","__"},ct.getResources().getColor(R.color.gray));
                             CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,
                                     "NO.1:" + profits.getJSONArray(0).getString(1)
-                                            + "/¥" + profits.getJSONArray(0).getIntValue(0) + " "
+                                            + "\n¥" + profits.getJSONArray(0).get(0) + " "
                                     , new String[]{
                                             profits.getJSONArray(0).getString(1),
-                                            String.valueOf(profits.getJSONArray(0).getIntValue(0))
-                                    }, ct.getResources().getColor(R.color.yellow_home));
+                                            String.valueOf(profits.getJSONArray(0).get(0))
+                                    }, ct.getResources().getColor(R.color.gray));
                             
                         }
                     }
@@ -625,23 +626,23 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
 
                     if (receivables != null&&!receivables.isEmpty()) {
                         if (receivables.size() == 2) {
-                            tv_rank_income_left.setText(receivables.getJSONArray(1).getIntValue(0) + "元/第1名");
-                            tv_rank_income_right.setText("第一名:" + receivables.getJSONArray(1).getString(1)
-                                    + "金额:" + receivables.getJSONArray(1).getIntValue(0) + "元");
-                            receivables.getJSONArray(1).getIntValue(0);//第一名  元
+                            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).getIntValue(2);//第一名  元
+                            receivables.getJSONArray(1).get(2);//第一名  元
                         } else {
                             CommonUtil.textSpanForStyle(tv_rank_income_left,
-                                    "¥"+"__" + "/NO.__"
+                                    "NO.__"+"\n¥"+"__"
                                     , "__",
-                                    ct.getResources().getColor(R.color.yellow_home));
+                                    ct.getResources().getColor(R.color.gray));
                             CommonUtil.textAarrySpanForStyle(tv_rank_income_right,
                                     "NO.1:" + receivables.getJSONArray(0).getString(1)
-                                            + "/Y:" + receivables.getJSONArray(0).getIntValue(0) + " "
+                                            + "\n¥:" + receivables.getJSONArray(0).get(0) + " "
                                     , new String[]{receivables.getJSONArray(0).getString(1),
-                                            String.valueOf(receivables.getJSONArray(0).getIntValue(0))},
-                                    ct.getResources().getColor(R.color.yellow_home));
+                                            String.valueOf(receivables.getJSONArray(0).get(0))},
+                                    ct.getResources().getColor(R.color.gray));
                         }
                     }
                     break;
@@ -798,9 +799,11 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
                     if (array!=null){
                         if (array.size()>0){
                             //显示下属面板
+                            Log.i("raomeng",msg.getData().getString("result"));
                             ll_subordinate.setVisibility(View.VISIBLE);
                         }else{
                             //隐藏下属面板
+                            Log.i("raomeng",msg.getData().getString("result"));
                             ll_subordinate.setVisibility(View.GONE);
                         }
                     }

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

@@ -25,6 +25,9 @@ import com.xzjmyk.pm.activity.ui.erp.util.Constants;
 import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
 import com.xzjmyk.pm.activity.ui.erp.view.SingleDialog;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -83,7 +86,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
 
     private List<String> mLists = new ArrayList<String>();
     private String et_cu_sellercode;
-
+    private int mCuId;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -128,9 +131,11 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
             if (type == 1) {
                 ll_infomal.setVisibility(View.VISIBLE);
                 getSupportActionBar().setTitle("客户录入");
+                CommonUtil.getCommonId(this,"PRECUSTOMER_SEQ",mHandler,GET_CU_ID);
             } else {
                 ll_infomal.setVisibility(View.GONE);
                 getSupportActionBar().setTitle("客户预录入");
+                CommonUtil.getCommonId(this,"CUSTOMER_SEQ",mHandler,GET_CU_ID);
             }
         }
     }
@@ -157,6 +162,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
 
     private void saveData() {
         String formStore = "";
+        Log.i("commoncuid",mCuId+"");
         if (type == 1) {
             if (et_cu_code.testValidity() && et_cu_name.testValidity()
                     && tv_cu_address.testValidity() && et_cu_kind.testValidity()
@@ -167,6 +173,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
                     && tv_cu_businesscode.testValidity() && tv_cu_currency.testValidity()
                     && tv_cu_taxrate.testValidity() && tv_cu_nichestep.testValidity()) {
                 formStore = "{\n" +
+                        " \"cu_id\":" + mCuId + ",\n" +
                         " \"cu_code\":\"" + et_cu_code.getText().toString() + "\",\n" +
                         " \"cu_name\":\"" + et_cu_name.getText().toString() + "\",\n" +
                         " \"cu_shortname\":\"" + et_cu_shortname.getText().toString() + "\",\n" +
@@ -199,6 +206,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
                     && tv_cu_contact.testValidity() && tv_cu_degree.testValidity()
                     && tv_cu_mobile.testValidity() && tv_cu_email.testValidity()) {
                 formStore = "{\n" +
+                        " \"cu_id\":" + mCuId + ",\n" +
                         " \"cu_code\":\"" + et_cu_code.getText().toString() + "\",\n" +
                         " \"cu_name\":\"" + et_cu_name.getText().toString() + "\",\n" +
                         " \"cu_shortname\":\"" + et_cu_shortname.getText().toString() + "\",\n" +
@@ -226,7 +234,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
     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) {
@@ -297,6 +305,17 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
                     }
                     showSimpleDialog(tv_cu_currency, "币别");
                     break;
+                case GET_CU_ID:
+                    String resultStr = msg.getData().getString("result");
+                    try {
+                        JSONObject resultJsonObject = new JSONObject(resultStr);
+                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
+                            mCuId = resultJsonObject.getInt("id");
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    break;
             }
         }
     };
@@ -336,7 +355,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");

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

@@ -28,6 +28,9 @@ import com.xzjmyk.pm.activity.util.BaiduMapUtil;
 import com.xzjmyk.pm.activity.util.DateFormatUtil;
 import com.xzjmyk.pm.activity.view.wheel.DateTimePicker;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -62,6 +65,7 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
     private int vp_id = -1;
     private int type = -1;
 
+    private int mVrId;
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -96,6 +100,8 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         tv_address_login.setText(bean.getAddress() == null ? "未填写" : bean.getAddress());
         tv_visit_theme.setText(bean.getName() == null ? "未填写" : bean.getName());
         tv_visit_steps.setText(bean.getNichestep() == null ? "未填写" : bean.getNichestep());
+
+        CommonUtil.getCommonId(this,"VISITRECORD_SEQ",mHandler,GET_VR_ID);
     }
 
     @Override
@@ -122,7 +128,7 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
         return true;
     }
 
-
+    private static final int GET_VR_ID = 62;
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -162,6 +168,17 @@ public class VisitReportAddActivity extends BaseActivity implements View.OnClick
                     }
                     showSimpleDialog(tv_customer_login, "客户列表");
                     break;
+                case GET_VR_ID:
+                    String resultStr = msg.getData().getString("result");
+                    try {
+                        JSONObject resultJsonObject = new JSONObject(resultStr);
+                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
+                            mVrId = resultJsonObject.getInt("id");
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    break;
             }
         }
     };
@@ -181,6 +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_code\":\"" + code
                             + "\",\n" +
                             "\"vr_visittime\":\""
@@ -340,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"));
                             }
                         }
                     }

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

@@ -27,6 +27,9 @@ 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;
+import org.json.JSONObject;
+
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -58,6 +61,7 @@ public class VisitReportPlanActivity extends BaseActivity implements View.OnClic
     @ViewInject(R.id.tv_linksman_login)
     private FormEditText tv_linksman_login;
 
+    private int mVpId;
 
 //    @ViewInject(R.id.tv_visit_login)
 //    private FormEditText tv_visit_login;
@@ -89,6 +93,7 @@ public class VisitReportPlanActivity extends BaseActivity implements View.OnClic
 
 
     private void initData() {
+        CommonUtil.getCommonId(this,"VISITPLAN_SEQ",mHandler,GET_VP_ID);
         getCodeByNet();
     }
 
@@ -112,6 +117,7 @@ public class VisitReportPlanActivity extends BaseActivity implements View.OnClic
     }
 
     private JSONArray array;
+    private static final int GET_VP_ID = 58;
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -147,6 +153,17 @@ public class VisitReportPlanActivity extends BaseActivity implements View.OnClic
                     }
                     showSimpleDialog(tv_customer_login, "客户列表");
                     break;
+                case GET_VP_ID:
+                    String resultStr = msg.getData().getString("result");
+                    try {
+                        JSONObject resultJsonObject = new JSONObject(resultStr);
+                        if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
+                            mVpId = resultJsonObject.getInt("id");
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    break;
             }
         }
     };
@@ -158,6 +175,7 @@ public class VisitReportPlanActivity extends BaseActivity implements View.OnClic
                 && tv_address_login.testValidity() && tv_visit_theme.testValidity()) {
             formStore = "\n" +
                     "{\n" +
+                    " \"vp_id\":" + mVpId + ",\n" +
                     "\"vp_date\":\"" + DateFormatUtil.getStrDate4Date(new Date(), "yyyy-MM-dd") +
                     "\",\n" +
                     "\"vp_code\":\"" + tv_code +

+ 9 - 0
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;
@@ -191,9 +192,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("自动化办公");
@@ -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("客户拜访");
+        
     }
 
     //获取数据

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

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

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBManager.java

@@ -162,7 +162,7 @@ public class DBManager {
         for (int i = 0; i < employeesEntities.size(); i++) {
             EmployeesEntity entity = employeesEntities.get(i);
             sta.bindString(1, String.valueOf(entity.getEM_ID()));
-            sta.bindString(2, entity.getEM_CODE());
+            sta.bindString(2, entity.getEM_CODE()==null?"null":entity.getEM_CODE());
             sta.bindString(3, entity.getEM_NAME());
             sta.bindString(4, entity.getEM_POSITION());
             sta.bindString(5, entity.getEM_DEFAULTORNAME() == null ? "未填写" : entity.getEM_DEFAULTORNAME());

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

@@ -19,6 +19,7 @@ import android.graphics.Typeface;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.os.Build;
+import android.os.Handler;
 import android.text.Spannable;
 import android.text.SpannableStringBuilder;
 import android.text.style.ForegroundColorSpan;
@@ -48,7 +49,10 @@ import com.xzjmyk.pm.activity.xmpp.listener.ChatMessageListener;
 import java.io.UnsupportedEncodingException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Random;
 import java.util.UUID;
 import java.util.regex.Matcher;
@@ -706,4 +710,13 @@ public class CommonUtil {
         }
         return false;
     }
+
+    public static void getCommonId(Context ct,String seq,Handler mHandler,int codeWhat){
+        String url = Constants.getAppBaseUrl(ct) + "/common/getId.action";
+        final Map<String, Object> param = new HashMap<>();
+        param.put("seq", seq);
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, codeWhat, null, null, "post");
+    }
 }

+ 2 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/me/MeFragment.java

@@ -16,6 +16,7 @@ import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 import com.lidroid.xutils.view.annotation.ViewInject;
+//import com.tencent.bugly.crashreport.CrashReport;
 import com.xzjmyk.pm.activity.AppConstant;
 import com.xzjmyk.pm.activity.MyApplication;
 import com.xzjmyk.pm.activity.R;
@@ -167,6 +168,7 @@ public class MeFragment extends EasyFragment implements View.OnClickListener {
     protected void onCreateView(Bundle savedInstanceState, boolean createView) {
         if (createView) {
             initView();
+//            CrashReport.testJavaCrash();
         }
     }
 

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/SubscriptionActivity.java

@@ -480,7 +480,7 @@ public class SubscriptionActivity extends BaseActivity {
                     isReColor = R.color.red;
                 } else {
                     isRe = "已读";
-                    isReColor = R.color.text_color;
+                    isReColor = R.color.white;
                 }
                 holder.big_isre_tv.setText(isRe);
                 holder.big_isre_tv.setTextColor(getResources().getColor(isReColor));

+ 16 - 12
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Crouton.java

@@ -372,18 +372,22 @@ public final class Crouton {
         return new Crouton(activity, customView, viewGroup);
     }
 
-    /**
-     * 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));
-    }
+  /**
+   * 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));
+  }
 
     /**
      * Creates a {@link Crouton} with provided text-resource and style for a given

+ 536 - 478
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/crouton/Style.java

@@ -15,6 +15,21 @@
  */
 
 package com.xzjmyk.pm.activity.view.crouton;
+/*
+ * Copyright 2012 - 2014 Benjamin Weiss
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 import android.graphics.drawable.Drawable;
 import android.view.Gravity;
@@ -22,544 +37,587 @@ import android.view.ViewGroup.LayoutParams;
 import android.widget.ImageView;
 
 
-/** The style for a {@link Crouton}. */
+/**
+ * The style for a {@link Crouton}.
+ */
 public class Style {
-  
-  public static final int NOT_SET = -1;
-
-  public static final int holoRedLight = 0xffff4444;
-  public static final int holoGreenLight = 0xff99cc00;
-  public static final int holoBlueLight = 0xff33b5e5;
-
-  /** Default style for alerting the user. */
-  public static final Style ALERT;
-  /** Default style for confirming an action. */
-  public static final Style CONFIRM;
-  /** Default style for general information. */
-  public static final Style INFO;
-
-  static {
-    ALERT = new Builder()
-      .setBackgroundColorValue(holoRedLight)
-      .build();
-    CONFIRM = new Builder()
-      .setBackgroundColorValue(holoGreenLight)
-      .build();
-    INFO = new Builder()
-      .setBackgroundColorValue(holoBlueLight)
-      .build();
-  }
-
-  /**
-   * The {@link Configuration} for this {@link Style}.
-   * It can be overridden via {@link Crouton#setConfiguration(Configuration)}.
-   */
-  final Configuration configuration;
-
-  /**
-   * The resource id of the backgroundResourceId.
-   * <p/>
-   * 0 for no backgroundResourceId.
-   */
-  final int backgroundColorResourceId;
-
-  /**
-   * The resource id of the backgroundDrawableResourceId.
-   * <p/>
-   * 0 for no backgroundDrawableResourceId.
-   */
-  final int backgroundDrawableResourceId;
-
-  /**
-   * The backgroundColorResourceValue's e.g. 0xffff4444;
-   * <p/>
-   * NOT_SET for no value.
-   */
-  final int backgroundColorValue;
-
-  /** Whether we should isTileEnabled the backgroundResourceId or not. */
-  final boolean isTileEnabled;
-
-  /**
-   * The text colorResourceId's resource id.
-   * <p/>
-   * 0 sets the text colorResourceId to the system theme default.
-   */
-  final int textColorResourceId;
-
-  /**
-   * The textColorResourceValue's e.g. 0xffff4444;
-   * <p/>
-   * NOT_SET for no value.
-   */
-  final int textColorValue;
-
-  /** The height of the {@link Crouton} in pixels. */
-  final int heightInPixels;
-
-  /** Resource ID for the height of the {@link Crouton}. */
-  final int heightDimensionResId;
-
-  /** The width of the {@link Crouton} in pixels. */
-  final int widthInPixels;
-
-  /** Resource ID for the width of the {@link Crouton}. */
-  final int widthDimensionResId;
-
-  /** The text's gravity as provided by {@link Gravity}. */
-  final int gravity;
-
-  /** An additional image to display in the {@link Crouton}. */
-  final Drawable imageDrawable;
-
-  /** An additional image to display in the {@link Crouton}. */
-  final int imageResId;
-
-  /** The {@link ImageView.ScaleType} for the image to display in the {@link Crouton}. */
-  final ImageView.ScaleType imageScaleType;
-
-  /**
-   * The text size in sp
-   * <p/>
-   * 0 sets the text size to the system theme default
-   */
-  final int textSize;
-
-  /** The text shadow color's resource id */
-  final int textShadowColorResId;
-
-  /** The text shadow radius */
-  final float textShadowRadius;
-
-  /** The text shadow vertical offset */
-  final float textShadowDy;
-
-  /** The text shadow horizontal offset */
-  final float textShadowDx;
-
-  /** The text appearance resource id for the text. */
-  final int textAppearanceResId;
-
-  /** The padding for the crouton view content in pixels */
-  final int paddingInPixels;
-
-  /** The resource id for the padding for the view content */
-  final int paddingDimensionResId;
-
-  /** The file path and font name for the view content */
-  final String fontName;
-
-  /** The file path and font name resource id for the view content */
-  final int fontNameResId;
-
-  private Style(final Builder builder) {
-    this.configuration = builder.configuration;
-    this.backgroundColorResourceId = builder.backgroundColorResourceId;
-    this.backgroundDrawableResourceId = builder.backgroundDrawableResourceId;
-    this.isTileEnabled = builder.isTileEnabled;
-    this.textColorResourceId = builder.textColorResourceId;
-    this.textColorValue = builder.textColorValue;
-    this.heightInPixels = builder.heightInPixels;
-    this.heightDimensionResId = builder.heightDimensionResId;
-    this.widthInPixels = builder.widthInPixels;
-    this.widthDimensionResId = builder.widthDimensionResId;
-    this.gravity = builder.gravity;
-    this.imageDrawable = builder.imageDrawable;
-    this.textSize = builder.textSize;
-    this.textShadowColorResId = builder.textShadowColorResId;
-    this.textShadowRadius = builder.textShadowRadius;
-    this.textShadowDx = builder.textShadowDx;
-    this.textShadowDy = builder.textShadowDy;
-    this.textAppearanceResId = builder.textAppearanceResId;
-    this.imageResId = builder.imageResId;
-    this.imageScaleType = builder.imageScaleType;
-    this.paddingInPixels = builder.paddingInPixels;
-    this.paddingDimensionResId = builder.paddingDimensionResId;
-    this.backgroundColorValue = builder.backgroundColorValue;
-    this.fontName = builder.fontName;
-    this.fontNameResId = builder.fontNameResId;
-  }
-
-  /** Builder for the {@link Style} object. */
-  public static class Builder {
-    private Configuration configuration;
-    private int backgroundColorValue;
-    private int backgroundColorResourceId;
-    private int backgroundDrawableResourceId;
-    private boolean isTileEnabled;
-    private int textColorResourceId;
-    private int textColorValue;
-    private int heightInPixels;
-    private int heightDimensionResId;
-    private int widthInPixels;
-    private int widthDimensionResId;
-    private int gravity;
-    private Drawable imageDrawable;
-    private int textSize;
-    private int textShadowColorResId;
-    private float textShadowRadius;
-    private float textShadowDx;
-    private float textShadowDy;
-    private int textAppearanceResId;
-    private int imageResId;
-    private ImageView.ScaleType imageScaleType;
-    private int paddingInPixels;
-    private int paddingDimensionResId;
-    private String fontName;
-    private int fontNameResId;
-
-    /** Creates a {@link Builder} to build a {@link Style} upon. */
-    public Builder() {
-      configuration = Configuration.DEFAULT;
-      paddingInPixels = 10;
-      backgroundColorResourceId = android.R.color.holo_blue_light;
-      backgroundDrawableResourceId = 0;
-      backgroundColorValue = NOT_SET;
-      isTileEnabled = false;
-      textColorResourceId = android.R.color.white;
-      textColorValue = NOT_SET;
-//      heightInPixels = LayoutParams.WRAP_CONTENT;
-      heightInPixels = 100;
-      widthInPixels = LayoutParams.MATCH_PARENT;
-      gravity = Gravity.CENTER;
-      imageDrawable = null;
-      imageResId = 0;
-      imageScaleType = ImageView.ScaleType.FIT_XY;
-      fontName = null;
-      fontNameResId = 0;
-    }
+
+    public static final int NOT_SET = -1;
+
+    public static final int holoRedLight = 0xffff4444;
+    public static final int holoGreenLight = 0xff99cc00;
+    public static final int holoBlueLight = 0xff33b5e5;
 
     /**
-     * Creates a {@link Builder} to build a {@link Style} upon.
-     *
-     * @param baseStyle
-     *   The base {@link Style} to use for this {@link Style}.
+     * Default style for alerting the user.
      */
-    public Builder(final Style baseStyle) {
-      configuration = baseStyle.configuration;
-      backgroundColorValue = baseStyle.backgroundColorValue;
-      backgroundColorResourceId = baseStyle.backgroundColorResourceId;
-      backgroundDrawableResourceId = baseStyle.backgroundDrawableResourceId;
-      isTileEnabled = baseStyle.isTileEnabled;
-      textColorResourceId = baseStyle.textColorResourceId;
-      textColorValue = baseStyle.textColorValue;
-      heightInPixels = baseStyle.heightInPixels;
-      heightDimensionResId = baseStyle.heightDimensionResId;
-      widthInPixels = baseStyle.widthInPixels;
-      widthDimensionResId = baseStyle.widthDimensionResId;
-      gravity = baseStyle.gravity;
-      imageDrawable = baseStyle.imageDrawable;
-      textSize = baseStyle.textSize;
-      textShadowColorResId = baseStyle.textShadowColorResId;
-      textShadowRadius = baseStyle.textShadowRadius;
-      textShadowDx = baseStyle.textShadowDx;
-      textShadowDy = baseStyle.textShadowDy;
-      textAppearanceResId = baseStyle.textAppearanceResId;
-      imageResId = baseStyle.imageResId;
-      imageScaleType = baseStyle.imageScaleType;
-      paddingInPixels = baseStyle.paddingInPixels;
-      paddingDimensionResId = baseStyle.paddingDimensionResId;
-      fontName = baseStyle.fontName;
-      fontNameResId = baseStyle.fontNameResId;
-    }
+    public static final Style ALERT;
     /**
-     * Set the {@link Configuration} option of the {@link Crouton}.
-     *
-     * @param configuration
-     *   The {@link Configuration}.
-     *
-     * @return the {@link Builder}.
+     * Default style for confirming an action.
      */
-    public Builder setConfiguration(Configuration configuration) {
-      this.configuration = configuration;
-      return this;
-    }
-
+    public static final Style CONFIRM;
     /**
-     * Set the backgroundColorResourceId option of the {@link Crouton}.
-     *
-     * @param backgroundColorResourceId
-     *   The backgroundColorResourceId's resource id.
-     *
-     * @return the {@link Builder}.
+     * Default style for general information.
      */
-    public Builder setBackgroundColor(int backgroundColorResourceId) {
-      this.backgroundColorResourceId = backgroundColorResourceId;
-
-      return this;
+    public static final Style INFO;
+
+    static {
+        ALERT = new Builder()
+                .setBackgroundColorValue(holoRedLight)
+                .build();
+        CONFIRM = new Builder()
+                .setBackgroundColorValue(holoGreenLight)
+                .build();
+        INFO = new Builder()
+                .setBackgroundColorValue(holoBlueLight)
+                .build();
     }
 
     /**
-     * Set the backgroundColorResourceValue option of the {@link Crouton}.
-     *
-     * @param backgroundColorValue
-     *   The backgroundColorResourceValue's e.g. 0xffff4444;
-     *
-     * @return the {@link Builder}.
+     * The {@link Configuration} for this {@link Style}.
+     * It can be overridden via {@link Crouton#setConfiguration(Configuration)}.
      */
-    public Builder setBackgroundColorValue(int backgroundColorValue) {
-      this.backgroundColorValue = backgroundColorValue;
-      return this;
-    }
+    final Configuration configuration;
 
     /**
-     * Set the backgroundDrawableResourceId option for the {@link Crouton}.
-     *
-     * @param backgroundDrawableResourceId
-     *   Resource ID of a backgroundDrawableResourceId image drawable.
-     *
-     * @return the {@link Builder}.
+     * The resource id of the backgroundResourceId.
+     * <p/>
+     * 0 for no backgroundResourceId.
      */
-    public Builder setBackgroundDrawable(int backgroundDrawableResourceId) {
-      this.backgroundDrawableResourceId = backgroundDrawableResourceId;
-
-      return this;
-    }
+    final int backgroundColorResourceId;
 
     /**
-     * Set the heightInPixels option for the {@link Crouton}.
-     *
-     * @param height
-     *   The height of the {@link Crouton} in pixel. Can also be
-     *   {@link LayoutParams#MATCH_PARENT} or
-     *   {@link LayoutParams#WRAP_CONTENT}.
-     *
-     * @return the {@link Builder}.
+     * The resource id of the backgroundDrawableResourceId.
+     * <p/>
+     * 0 for no backgroundDrawableResourceId.
      */
-    public Builder setHeight(int height) {
-      this.heightInPixels = height;
-
-      return this;
-    }
+    final int backgroundDrawableResourceId;
 
     /**
-     * Set the resource id for the height option for the {@link Crouton}.
-     *
-     * @param heightDimensionResId
-     *   Resource ID of a dimension for the height of the {@link Crouton}.
-     *
-     * @return the {@link Builder}.
+     * The backgroundColorResourceValue's e.g. 0xffff4444;
+     * <p/>
+     * NOT_SET for no value.
      */
-    public Builder setHeightDimensionResId(int heightDimensionResId) {
-      this.heightDimensionResId = heightDimensionResId;
-
-      return this;
-    }
+    final int backgroundColorValue;
 
     /**
-     * Set the widthInPixels option for the {@link Crouton}.
-     *
-     * @param width
-     *   The width of the {@link Crouton} in pixel. Can also be
-     *   {@link LayoutParams#MATCH_PARENT} or
-     *   {@link LayoutParams#WRAP_CONTENT}.
-     *
-     * @return the {@link Builder}.
+     * Whether we should isTileEnabled the backgroundResourceId or not.
      */
-    public Builder setWidth(int width) {
-      this.widthInPixels = width;
-
-      return this;
-    }
+    final boolean isTileEnabled;
 
     /**
-     * Set the resource id for the width option for the {@link Crouton}.
-     *
-     * @param widthDimensionResId
-     *   Resource ID of a dimension for the width of the {@link Crouton}.
-     *
-     * @return the {@link Builder}.
+     * The text colorResourceId's resource id.
+     * <p/>
+     * 0 sets the text colorResourceId to the system theme default.
      */
-    public Builder setWidthDimensionResId(int widthDimensionResId) {
-      this.widthDimensionResId = widthDimensionResId;
-
-      return this;
-    }
+    final int textColorResourceId;
 
     /**
-     * Set the isTileEnabled option for the {@link Crouton}.
-     *
-     * @param isTileEnabled
-     *   <code>true</code> if you want the backgroundResourceId to be
-     *   tiled, else <code>false</code>.
-     *
-     * @return the {@link Builder}.
+     * The textColorResourceValue's e.g. 0xffff4444;
+     * <p/>
+     * NOT_SET for no value.
      */
-    public Builder setTileEnabled(boolean isTileEnabled) {
-      this.isTileEnabled = isTileEnabled;
-
-      return this;
-    }
+    final int textColorValue;
 
     /**
-     * Set the textColorResourceId option for the {@link Crouton}.
-     *
-     * @param textColor
-     *   The resource id of the text colorResourceId.
-     *
-     * @return the {@link Builder}.
+     * The height of the {@link Crouton} in pixels.
      */
-    public Builder setTextColor(int textColor) {
-      this.textColorResourceId = textColor;
-
-      return this;
-    }
+    final int heightInPixels;
 
     /**
-     * Set the textColorResourceValue option of the {@link Crouton}.
-     *
-     * @param textColorValue
-     *   The textColorResourceValue's e.g. 0xffff4444;
-     *
-     * @return the {@link Builder}.
+     * Resource ID for the height of the {@link Crouton}.
      */
-    public Builder setTextColorValue(int textColorValue) {
-      this.textColorValue = textColorValue;
-      return this;
-    }
+    final int heightDimensionResId;
 
     /**
-     * Set the gravity option for the {@link Crouton}.
-     *
-     * @param gravity
-     *   The text's gravity as provided by {@link Gravity}.
-     *
-     * @return the {@link Builder}.
+     * The width of the {@link Crouton} in pixels.
      */
-    public Builder setGravity(int gravity) {
-      this.gravity = gravity;
+    final int widthInPixels;
 
-      return this;
-    }
+    /**
+     * Resource ID for the width of the {@link Crouton}.
+     */
+    final int widthDimensionResId;
 
     /**
-     * Set the image option for the {@link Crouton}.
-     *
-     * @param imageDrawable
-     *   An additional image to display in the {@link Crouton}.
-     *
-     * @return the {@link Builder}.
+     * The text's gravity as provided by {@link Gravity}.
      */
-    public Builder setImageDrawable(Drawable imageDrawable) {
-      this.imageDrawable = imageDrawable;
+    final int gravity;
 
-      return this;
-    }
+    /**
+     * An additional image to display in the {@link Crouton}.
+     */
+    final Drawable imageDrawable;
 
     /**
-     * Set the image resource option for the {@link Crouton}.
-     *
-     * @param imageResId
-     *   An additional image to display in the {@link Crouton}.
-     *
-     * @return the {@link Builder}.
+     * An additional image to display in the {@link Crouton}.
      */
-    public Builder setImageResource(int imageResId) {
-      this.imageResId = imageResId;
+    final int imageResId;
 
-      return this;
-    }
+    /**
+     * The {@link ImageView.ScaleType} for the image to display in the {@link Crouton}.
+     */
+    final ImageView.ScaleType imageScaleType;
 
-    /** The text size in sp. */
-    public Builder setTextSize(int textSize) {
-      this.textSize = textSize;
-      return this;
-    }
+    /**
+     * The text size in sp
+     * <p/>
+     * 0 sets the text size to the system theme default
+     */
+    final int textSize;
 
-    /** The text shadow color resource id. */
-    public Builder setTextShadowColor(int textShadowColorResId) {
-      this.textShadowColorResId = textShadowColorResId;
-      return this;
-    }
+    /**
+     * The text shadow color's resource id
+     */
+    final int textShadowColorResId;
 
-    /** The text shadow radius. */
-    public Builder setTextShadowRadius(float textShadowRadius) {
-      this.textShadowRadius = textShadowRadius;
-      return this;
-    }
+    /**
+     * The text shadow radius
+     */
+    final float textShadowRadius;
 
-    /** The text shadow horizontal offset. */
-    public Builder setTextShadowDx(float textShadowDx) {
-      this.textShadowDx = textShadowDx;
-      return this;
-    }
+    /**
+     * The text shadow vertical offset
+     */
+    final float textShadowDy;
 
-    /** The text shadow vertical offset. */
-    public Builder setTextShadowDy(float textShadowDy) {
-      this.textShadowDy = textShadowDy;
-      return this;
-    }
+    /**
+     * The text shadow horizontal offset
+     */
+    final float textShadowDx;
 
-    /** The text appearance resource id for the text. */
-    public Builder setTextAppearance(int textAppearanceResId) {
-      this.textAppearanceResId = textAppearanceResId;
-      return this;
-    }
+    /**
+     * The text appearance resource id for the text.
+     */
+    final int textAppearanceResId;
 
-    /** The {@link ImageView.ScaleType} for the image. */
-    public Builder setImageScaleType(ImageView.ScaleType imageScaleType) {
-      this.imageScaleType = imageScaleType;
-      return this;
-    }
+    /**
+     * The padding for the crouton view content in pixels
+     */
+    final int paddingInPixels;
 
-    /** The padding for the crouton view's content in pixels. */
-    public Builder setPaddingInPixels(int padding) {
-      this.paddingInPixels = padding;
-      return this;
-    }
+    /**
+     * The resource id for the padding for the view content
+     */
+    final int paddingDimensionResId;
 
-    /** The resource id for the padding for the crouton view's content. */
-    public Builder setPaddingDimensionResId(int paddingResId) {
-      this.paddingDimensionResId = paddingResId;
-      return this;
-    }
+    /**
+     * The file path and font name for the view content
+     */
+    final String fontName;
 
-    /** The file path and name of the font for the crouton view's content. */
-    public Builder setFontName(String fontName) {
-      this.fontName = fontName;
-      return this;
+    /**
+     * The file path and font name resource id for the view content
+     */
+    final int fontNameResId;
+
+    private Style(final Builder builder) {
+        this.configuration = builder.configuration;
+        this.backgroundColorResourceId = builder.backgroundColorResourceId;
+        this.backgroundDrawableResourceId = builder.backgroundDrawableResourceId;
+        this.isTileEnabled = builder.isTileEnabled;
+        this.textColorResourceId = builder.textColorResourceId;
+        this.textColorValue = builder.textColorValue;
+        this.heightInPixels = builder.heightInPixels;
+        this.heightDimensionResId = builder.heightDimensionResId;
+        this.widthInPixels = builder.widthInPixels;
+        this.widthDimensionResId = builder.widthDimensionResId;
+        this.gravity = builder.gravity;
+        this.imageDrawable = builder.imageDrawable;
+        this.textSize = builder.textSize;
+        this.textShadowColorResId = builder.textShadowColorResId;
+        this.textShadowRadius = builder.textShadowRadius;
+        this.textShadowDx = builder.textShadowDx;
+        this.textShadowDy = builder.textShadowDy;
+        this.textAppearanceResId = builder.textAppearanceResId;
+        this.imageResId = builder.imageResId;
+        this.imageScaleType = builder.imageScaleType;
+        this.paddingInPixels = builder.paddingInPixels;
+        this.paddingDimensionResId = builder.paddingDimensionResId;
+        this.backgroundColorValue = builder.backgroundColorValue;
+        this.fontName = builder.fontName;
+        this.fontNameResId = builder.fontNameResId;
     }
 
-    /** The resource id for the file path and name of the font for the crouton view's content. */
-    public Builder setFontNameResId(int fontNameResId) {
-      this.fontNameResId = fontNameResId;
-      return this;
+    /**
+     * Builder for the {@link Style} object.
+     */
+    public static class Builder {
+        private Configuration configuration;
+        private int backgroundColorValue;
+        private int backgroundColorResourceId;
+        private int backgroundDrawableResourceId;
+        private boolean isTileEnabled;
+        private int textColorResourceId;
+        private int textColorValue;
+        private int heightInPixels;
+        private int heightDimensionResId;
+        private int widthInPixels;
+        private int widthDimensionResId;
+        private int gravity;
+        private Drawable imageDrawable;
+        private int textSize;
+        private int textShadowColorResId;
+        private float textShadowRadius;
+        private float textShadowDx;
+        private float textShadowDy;
+        private int textAppearanceResId;
+        private int imageResId;
+        private ImageView.ScaleType imageScaleType;
+        private int paddingInPixels;
+        private int paddingDimensionResId;
+        private String fontName;
+        private int fontNameResId;
+
+        /**
+         * Creates a {@link Builder} to build a {@link Style} upon.
+         */
+        public Builder() {
+            configuration = Configuration.DEFAULT;
+            paddingInPixels = 10;
+            backgroundColorResourceId = android.R.color.holo_blue_light;
+            backgroundDrawableResourceId = 0;
+            backgroundColorValue = NOT_SET;
+            isTileEnabled = false;
+            textColorResourceId = android.R.color.white;
+            textColorValue = NOT_SET;
+            heightInPixels = LayoutParams.WRAP_CONTENT;
+            widthInPixels = LayoutParams.MATCH_PARENT;
+            gravity = Gravity.CENTER;
+            imageDrawable = null;
+            imageResId = 0;
+            imageScaleType = ImageView.ScaleType.FIT_XY;
+            fontName = null;
+            fontNameResId = 0;
+        }
+
+        /**
+         * Creates a {@link Builder} to build a {@link Style} upon.
+         *
+         * @param baseStyle The base {@link Style} to use for this {@link Style}.
+         */
+        public Builder(final Style baseStyle) {
+            configuration = baseStyle.configuration;
+            backgroundColorValue = baseStyle.backgroundColorValue;
+            backgroundColorResourceId = baseStyle.backgroundColorResourceId;
+            backgroundDrawableResourceId = baseStyle.backgroundDrawableResourceId;
+            isTileEnabled = baseStyle.isTileEnabled;
+            textColorResourceId = baseStyle.textColorResourceId;
+            textColorValue = baseStyle.textColorValue;
+            heightInPixels = baseStyle.heightInPixels;
+            heightDimensionResId = baseStyle.heightDimensionResId;
+            widthInPixels = baseStyle.widthInPixels;
+            widthDimensionResId = baseStyle.widthDimensionResId;
+            gravity = baseStyle.gravity;
+            imageDrawable = baseStyle.imageDrawable;
+            textSize = baseStyle.textSize;
+            textShadowColorResId = baseStyle.textShadowColorResId;
+            textShadowRadius = baseStyle.textShadowRadius;
+            textShadowDx = baseStyle.textShadowDx;
+            textShadowDy = baseStyle.textShadowDy;
+            textAppearanceResId = baseStyle.textAppearanceResId;
+            imageResId = baseStyle.imageResId;
+            imageScaleType = baseStyle.imageScaleType;
+            paddingInPixels = baseStyle.paddingInPixels;
+            paddingDimensionResId = baseStyle.paddingDimensionResId;
+            fontName = baseStyle.fontName;
+            fontNameResId = baseStyle.fontNameResId;
+        }
+
+        /**
+         * Set the {@link Configuration} option of the {@link Crouton}.
+         *
+         * @param configuration The {@link Configuration}.
+         * @return the {@link Builder}.
+         */
+        public Builder setConfiguration(Configuration configuration) {
+            this.configuration = configuration;
+            return this;
+        }
+
+        /**
+         * Set the backgroundColorResourceId option of the {@link Crouton}.
+         *
+         * @param backgroundColorResourceId The backgroundColorResourceId's resource id.
+         * @return the {@link Builder}.
+         */
+        public Builder setBackgroundColor(int backgroundColorResourceId) {
+            this.backgroundColorResourceId = backgroundColorResourceId;
+
+            return this;
+        }
+
+        /**
+         * Set the backgroundColorResourceValue option of the {@link Crouton}.
+         *
+         * @param backgroundColorValue The backgroundColorResourceValue's e.g. 0xffff4444;
+         * @return the {@link Builder}.
+         */
+        public Builder setBackgroundColorValue(int backgroundColorValue) {
+            this.backgroundColorValue = backgroundColorValue;
+            return this;
+        }
+
+        /**
+         * Set the backgroundDrawableResourceId option for the {@link Crouton}.
+         *
+         * @param backgroundDrawableResourceId Resource ID of a backgroundDrawableResourceId image drawable.
+         * @return the {@link Builder}.
+         */
+        public Builder setBackgroundDrawable(int backgroundDrawableResourceId) {
+            this.backgroundDrawableResourceId = backgroundDrawableResourceId;
+
+            return this;
+        }
+
+        /**
+         * Set the heightInPixels option for the {@link Crouton}.
+         *
+         * @param height The height of the {@link Crouton} in pixel. Can also be
+         *               {@link LayoutParams#MATCH_PARENT} or
+         *               {@link LayoutParams#WRAP_CONTENT}.
+         * @return the {@link Builder}.
+         */
+        public Builder setHeight(int height) {
+            this.heightInPixels = height;
+
+            return this;
+        }
+
+        /**
+         * Set the resource id for the height option for the {@link Crouton}.
+         *
+         * @param heightDimensionResId Resource ID of a dimension for the height of the {@link Crouton}.
+         * @return the {@link Builder}.
+         */
+        public Builder setHeightDimensionResId(int heightDimensionResId) {
+            this.heightDimensionResId = heightDimensionResId;
+
+            return this;
+        }
+
+        /**
+         * Set the widthInPixels option for the {@link Crouton}.
+         *
+         * @param width The width of the {@link Crouton} in pixel. Can also be
+         *              {@link LayoutParams#MATCH_PARENT} or
+         *              {@link LayoutParams#WRAP_CONTENT}.
+         * @return the {@link Builder}.
+         */
+        public Builder setWidth(int width) {
+            this.widthInPixels = width;
+
+            return this;
+        }
+
+        /**
+         * Set the resource id for the width option for the {@link Crouton}.
+         *
+         * @param widthDimensionResId Resource ID of a dimension for the width of the {@link Crouton}.
+         * @return the {@link Builder}.
+         */
+        public Builder setWidthDimensionResId(int widthDimensionResId) {
+            this.widthDimensionResId = widthDimensionResId;
+
+            return this;
+        }
+
+        /**
+         * Set the isTileEnabled option for the {@link Crouton}.
+         *
+         * @param isTileEnabled <code>true</code> if you want the backgroundResourceId to be
+         *                      tiled, else <code>false</code>.
+         * @return the {@link Builder}.
+         */
+        public Builder setTileEnabled(boolean isTileEnabled) {
+            this.isTileEnabled = isTileEnabled;
+
+            return this;
+        }
+
+        /**
+         * Set the textColorResourceId option for the {@link Crouton}.
+         *
+         * @param textColor The resource id of the text colorResourceId.
+         * @return the {@link Builder}.
+         */
+        public Builder setTextColor(int textColor) {
+            this.textColorResourceId = textColor;
+
+            return this;
+        }
+
+        /**
+         * Set the textColorResourceValue option of the {@link Crouton}.
+         *
+         * @param textColorValue The textColorResourceValue's e.g. 0xffff4444;
+         * @return the {@link Builder}.
+         */
+        public Builder setTextColorValue(int textColorValue) {
+            this.textColorValue = textColorValue;
+            return this;
+        }
+
+        /**
+         * Set the gravity option for the {@link Crouton}.
+         *
+         * @param gravity The text's gravity as provided by {@link Gravity}.
+         * @return the {@link Builder}.
+         */
+        public Builder setGravity(int gravity) {
+            this.gravity = gravity;
+
+            return this;
+        }
+
+        /**
+         * Set the image option for the {@link Crouton}.
+         *
+         * @param imageDrawable An additional image to display in the {@link Crouton}.
+         * @return the {@link Builder}.
+         */
+        public Builder setImageDrawable(Drawable imageDrawable) {
+            this.imageDrawable = imageDrawable;
+
+            return this;
+        }
+
+        /**
+         * Set the image resource option for the {@link Crouton}.
+         *
+         * @param imageResId An additional image to display in the {@link Crouton}.
+         * @return the {@link Builder}.
+         */
+        public Builder setImageResource(int imageResId) {
+            this.imageResId = imageResId;
+
+            return this;
+        }
+
+        /**
+         * The text size in sp.
+         */
+        public Builder setTextSize(int textSize) {
+            this.textSize = textSize;
+            return this;
+        }
+
+        /**
+         * The text shadow color resource id.
+         */
+        public Builder setTextShadowColor(int textShadowColorResId) {
+            this.textShadowColorResId = textShadowColorResId;
+            return this;
+        }
+
+        /**
+         * The text shadow radius.
+         */
+        public Builder setTextShadowRadius(float textShadowRadius) {
+            this.textShadowRadius = textShadowRadius;
+            return this;
+        }
+
+        /**
+         * The text shadow horizontal offset.
+         */
+        public Builder setTextShadowDx(float textShadowDx) {
+            this.textShadowDx = textShadowDx;
+            return this;
+        }
+
+        /**
+         * The text shadow vertical offset.
+         */
+        public Builder setTextShadowDy(float textShadowDy) {
+            this.textShadowDy = textShadowDy;
+            return this;
+        }
+
+        /**
+         * The text appearance resource id for the text.
+         */
+        public Builder setTextAppearance(int textAppearanceResId) {
+            this.textAppearanceResId = textAppearanceResId;
+            return this;
+        }
+
+        /**
+         * The {@link android.widget.ImageView.ScaleType} for the image.
+         */
+        public Builder setImageScaleType(ImageView.ScaleType imageScaleType) {
+            this.imageScaleType = imageScaleType;
+            return this;
+        }
+
+        /**
+         * The padding for the crouton view's content in pixels.
+         */
+        public Builder setPaddingInPixels(int padding) {
+            this.paddingInPixels = padding;
+            return this;
+        }
+
+        /**
+         * The resource id for the padding for the crouton view's content.
+         */
+        public Builder setPaddingDimensionResId(int paddingResId) {
+            this.paddingDimensionResId = paddingResId;
+            return this;
+        }
+
+        /**
+         * The file path and name of the font for the crouton view's content.
+         */
+        public Builder setFontName(String fontName) {
+            this.fontName = fontName;
+            return this;
+        }
+
+        /**
+         * The resource id for the file path and name of the font for the crouton view's content.
+         */
+        public Builder setFontNameResId(int fontNameResId) {
+            this.fontNameResId = fontNameResId;
+            return this;
+        }
+
+        /**
+         * @return a configured {@link Style} object.
+         */
+        public Style build() {
+            return new Style(this);
+        }
     }
 
-    /** @return a configured {@link Style} object. */
-    public Style build() {
-      return new Style(this);
+    @Override
+    public String toString() {
+        return "Style{" +
+                "configuration=" + configuration +
+                ", backgroundColorResourceId=" + backgroundColorResourceId +
+                ", backgroundDrawableResourceId=" + backgroundDrawableResourceId +
+                ", backgroundColorValue=" + backgroundColorValue +
+                ", isTileEnabled=" + isTileEnabled +
+                ", textColorResourceId=" + textColorResourceId +
+                ", textColorValue=" + textColorValue +
+                ", heightInPixels=" + heightInPixels +
+                ", heightDimensionResId=" + heightDimensionResId +
+                ", widthInPixels=" + widthInPixels +
+                ", widthDimensionResId=" + widthDimensionResId +
+                ", gravity=" + gravity +
+                ", imageDrawable=" + imageDrawable +
+                ", imageResId=" + imageResId +
+                ", imageScaleType=" + imageScaleType +
+                ", textSize=" + textSize +
+                ", textShadowColorResId=" + textShadowColorResId +
+                ", textShadowRadius=" + textShadowRadius +
+                ", textShadowDy=" + textShadowDy +
+                ", textShadowDx=" + textShadowDx +
+                ", textAppearanceResId=" + textAppearanceResId +
+                ", paddingInPixels=" + paddingInPixels +
+                ", paddingDimensionResId=" + paddingDimensionResId +
+                ", fontName=" + fontName +
+                ", fontNameResId=" + fontNameResId +
+                '}';
     }
-  }
-
-  @Override
-  public String toString() {
-    return "Style{" +
-      "configuration=" + configuration +
-      ", backgroundColorResourceId=" + backgroundColorResourceId +
-      ", backgroundDrawableResourceId=" + backgroundDrawableResourceId +
-      ", backgroundColorValue=" + backgroundColorValue +
-      ", isTileEnabled=" + isTileEnabled +
-      ", textColorResourceId=" + textColorResourceId +
-      ", textColorValue=" + textColorValue +
-      ", heightInPixels=" + heightInPixels +
-      ", heightDimensionResId=" + heightDimensionResId +
-      ", widthInPixels=" + widthInPixels +
-      ", widthDimensionResId=" + widthDimensionResId +
-      ", gravity=" + gravity +
-      ", imageDrawable=" + imageDrawable +
-      ", imageResId=" + imageResId +
-      ", imageScaleType=" + imageScaleType +
-      ", textSize=" + textSize +
-      ", textShadowColorResId=" + textShadowColorResId +
-      ", textShadowRadius=" + textShadowRadius +
-      ", textShadowDy=" + textShadowDy +
-      ", textShadowDx=" + textShadowDx +
-      ", textAppearanceResId=" + textAppearanceResId +
-      ", paddingInPixels=" + paddingInPixels +
-      ", paddingDimensionResId=" + paddingDimensionResId +
-      ", fontName=" + fontName +
-      ", fontNameResId=" + fontNameResId +
-      '}';
-  }
-}
+}

+ 8 - 0
WeiChat/src/main/res/drawable/selector_popup_btn.xml

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

+ 1 - 1
WeiChat/src/main/res/layout/activity_business.xml

@@ -66,7 +66,7 @@
         <Button
             android:id="@+id/bt_qiang"
             style="@style/crm_business_btn"
-            android:text="抢商机" />
+            android:text="抢商机" />
 
         <Button
             android:id="@+id/bt_manage"

+ 6 - 4
WeiChat/src/main/res/layout/activity_client.xml

@@ -449,15 +449,17 @@
                 android:layout_height="wrap_content"
                     android:text="              " />
                 <TextView
-                    android:text="计划销售额/毛利润"
+                    android:text="计划销售额/毛利润\n(万元)"
                     android:layout_weight="1"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
+                    android:layout_height="wrap_content"
+                    android:gravity="center"/>
                 <TextView
-                    android:text="实际销售额/毛利润"
+                    android:text="实际销售额/毛利润\n(万元)"
                     android:layout_weight="1"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content" />
+                    android:layout_height="wrap_content"
+                    android:gravity="center" />
                 </LinearLayout>
             <LinearLayout style="@style/LinearLayout_horizontal"
                 android:padding="8dp"

+ 3 - 2
WeiChat/src/main/res/layout/bigimage_subscription.xml

@@ -56,8 +56,7 @@
     <RelativeLayout
         android:id="@+id/big_rl"
         android:layout_width="match_parent"
-        android:layout_height="130dp"
-        android:visibility="gone">
+        android:layout_height="130dp">
 
         <ImageView
             android:id="@+id/big_img"
@@ -93,6 +92,8 @@
             android:layout_height="wrap_content"
             android:layout_alignParentRight="true"
             android:layout_margin="10dp"
+            android:layout_alignParentBottom="true"
+            android:layout_marginBottom="5dp"
             android:textSize="@dimen/text_hine" />
     </RelativeLayout>
 </FrameLayout>

+ 120 - 111
WeiChat/src/main/res/layout/item_business_detail.xml

@@ -1,116 +1,125 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:descendantFocusability="blocksDescendants"
-    android:layout_height="wrap_content"
-
-    style="@style/crm_ll_card">
-
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:text="商机编号"
-            android:minWidth="90dp"
-            style="@style/TextView_Basic" />
-        <TextView
-            android:id="@+id/tv_crm_business_num"
-            android:text="XXXXXXX"
-            style="@style/TextView_Basic" />
-    </LinearLayout>
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:minWidth="90dp"
-            android:text="商机库"
-            style="@style/TextView_Basic" />
-        <TextView
-            android:id="@+id/tv_crm_business_steps"
-            style="@style/TextView_Basic" />
-    </LinearLayout>
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:minWidth="90dp"
-            android:text="商机名称"
-            style="@style/TextView_Basic" />
-
-        <TextView
-            android:id="@+id/tv_crm_business_name"
-            android:text="XXXXXXX"
-            style="@style/TextView_Basic" />
-    </LinearLayout>
-
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:minWidth="90dp"
-            android:text="商机来源"
-            style="@style/TextView_Basic" />
+<RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <LinearLayout
+        android:descendantFocusability="blocksDescendants"
+        android:layout_height="wrap_content"
+        style="@style/crm_ll_card"
+        android:id="@+id/business_detail_ll">
+
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:text="商机编号"
+                android:minWidth="90dp"
+                style="@style/TextView_Basic" />
+            <TextView
+                android:id="@+id/tv_crm_business_num"
+                android:text="XXXXXXX"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:minWidth="90dp"
+                android:text="商机库"
+                style="@style/TextView_Basic" />
+            <TextView
+                android:id="@+id/tv_crm_business_steps"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:minWidth="90dp"
+                android:text="商机名称"
+                style="@style/TextView_Basic" />
+
+            <TextView
+                android:id="@+id/tv_crm_business_name"
+                android:text="XXXXXXX"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:minWidth="90dp"
+                android:text="商机来源"
+                style="@style/TextView_Basic" />
+
+            <TextView
+                android:id="@+id/tv_crm_business_source"
+                android:text="XXXXXXX"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:minWidth="90dp"
+                android:text="电话"
+                style="@style/TextView_Basic" />
+
+            <TextView
+                android:id="@+id/tv_crm_business_phone"
+                android:text="XXXXXXX"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+
+        <LinearLayout style="@style/crm_ll_sale_item">
+
+            <TextView
+                android:minWidth="90dp"
+                android:text="备注"
+                style="@style/TextView_Basic" />
+
+            <TextView
+                android:id="@+id/tv_crm_business_note"
+                android:text="XXXXXXX"
+                style="@style/TextView_Basic" />
+        </LinearLayout>
+
+        <RelativeLayout
+            style="@style/crm_ll_sale_item"
+            android:layout_gravity="right">
+
+            <TextView
+                android:minWidth="90dp"
+                android:id="@+id/tv_crm_business_datetv"
+                android:text="xx日期"
+                android:layout_gravity="center_vertical"
+                style="@style/TextView_Basic" />
+
+            <TextView
+                android:id="@+id/tv_crm_business_date"
+                android:layout_toRightOf="@+id/tv_crm_business_datetv"
+                android:text="XXXXXXX"
+                android:layout_gravity="center_vertical"
+                style="@style/TextView_Basic" />
+
+            <!--<Button
+                android:id="@+id/bt_business_qiang"
+                android:layout_alignParentRight="true"
+                android:text="抢"
+                android:layout_width="80dp"
+                android:layout_gravity="center_vertical|right"
+                style="@style/crm_business_btn_single"
+                android:focusable="false"
+                android:gravity="center" />-->
+
+        </RelativeLayout>
 
-        <TextView
-            android:id="@+id/tv_crm_business_source"
-            android:text="XXXXXXX"
-            style="@style/TextView_Basic" />
     </LinearLayout>
 
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:minWidth="90dp"
-            android:text="电话"
-            style="@style/TextView_Basic" />
-
-        <TextView
-            android:id="@+id/tv_crm_business_phone"
-            android:text="XXXXXXX"
-            style="@style/TextView_Basic" />
-    </LinearLayout>
-
-    <LinearLayout style="@style/crm_ll_sale_item">
-
-        <TextView
-            android:minWidth="90dp"
-            android:text="备注"
-            style="@style/TextView_Basic" />
-
-        <TextView
-            android:id="@+id/tv_crm_business_note"
-            android:text="XXXXXXX"
-            style="@style/TextView_Basic" />
-    </LinearLayout>
+    <ImageView
+        android:id="@+id/iv_business_qiang"
+        android:layout_width="100dp"
+        android:layout_height="30dp"
+        android:layout_alignParentRight="true"
+        android:src="@drawable/ic_qiang"
+        android:layout_marginBottom="5dp"
+        android:layout_alignBottom="@id/business_detail_ll"/>
+</RelativeLayout>
 
-    <RelativeLayout
-        style="@style/crm_ll_sale_item"
-        android:layout_gravity="right">
-
-        <TextView
-            android:minWidth="90dp"
-            android:id="@+id/tv_crm_business_datetv"
-            android:text="xx日期"
-            android:layout_gravity="center_vertical"
-            style="@style/TextView_Basic" />
-
-        <TextView
-            android:id="@+id/tv_crm_business_date"
-            android:layout_toRightOf="@+id/tv_crm_business_datetv"
-            android:text="XXXXXXX"
-            android:layout_gravity="center_vertical"
-            style="@style/TextView_Basic" />
-
-        <!--<Button
-            android:id="@+id/bt_business_qiang"
-            android:layout_alignParentRight="true"
-            android:text="抢"
-            android:layout_width="80dp"
-            android:layout_gravity="center_vertical|right"
-            style="@style/crm_business_btn_single"
-            android:focusable="false"
-            android:gravity="center" />-->
-        <ImageView
-            android:id="@+id/iv_business_qiang"
-            android:layout_width="100dp"
-            android:layout_height="30dp"
-            android:layout_alignParentRight="true"
-            android:src="@drawable/ic_qiang"/>
-    </RelativeLayout>
-
-</LinearLayout>

+ 2 - 2
WeiChat/src/main/res/layout/popupwindow_subscribe_menu.xml

@@ -10,8 +10,8 @@
         android:id="@+id/subscribe_menu_my"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/transparent"
         android:text="我的订阅"
+        android:background="@drawable/selector_popup_btn"
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:padding="10dp"
@@ -21,8 +21,8 @@
         android:id="@+id/subscribe_menu_add"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/transparent"
         android:text="新增订阅"
+        android:background="@drawable/selector_popup_btn"
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:padding="10dp"

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

@@ -22,10 +22,20 @@
     <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="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 +59,21 @@
         <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="IMActionBar" parent="Widget.AppCompat.ActionBar">
         <item name="android:actionBarSize">11dp</item>
         <item name="android:icon">@drawable/action_bar_divider</item>

+ 7 - 1
WeiChat/src/main/res/values/colors.xml

@@ -1,6 +1,6 @@
 <?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="subscrip_text">#60a0a0a0</color>
     <color name="item_color1">#30a0a0a0</color>
@@ -222,7 +222,13 @@
     <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> <!-- 暗蓝色 -->

+ 7 - 4
WeiChat/src/main/res/values/styles.xml

@@ -611,14 +611,14 @@
     </style>
 
     <style name="crm_card_round_tv">
-        <item name="android:layout_width">50dp</item>
+        <item name="android:layout_width">80dp</item>
         <item name="android:layout_height">50dp</item>
        
         <item name="android:layout_marginLeft">8dp</item>
         <item name="android:layout_marginTop">8dp</item>
         <item name="android:layout_marginBottom">8dp</item>
         <item name="android:layout_marginRight">1dp</item>
-        <item name="android:gravity">center</item>
+        <item name="android:gravity">center_vertical|left</item>
        
     </style>
 
@@ -639,8 +639,9 @@
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_gravity">center_vertical</item>
         <item name="android:layout_marginRight">3dp</item>
+        <item name="android:layout_marginLeft">10dp</item>
         <item name="android:layout_weight">2</item>
-        <item name="android:text">"¥__/NO._"</item>
+        <item name="android:text">"NO._\n¥__"</item>
     </style>
 
     <style name="crm_tv_ranking_right">
@@ -649,7 +650,7 @@
         <item name="android:layout_height">wrap_content</item>
         <item name="android:layout_gravity">center_vertical</item>
         <item name="android:layout_weight">3</item>
-        <item name="android:text">"NO._:__/¥__"</item>
+        <item name="android:text">"NO._:__\n¥__"</item>
     </style>
     <!--crm sale-->
     <style name="crm_ll_sale" parent="LinearLayout_horizontal">
@@ -707,6 +708,8 @@
         <item name="android:layout_height">match_parent</item>
         <item name="android:divider">#00000000</item>
         <item name="android:dividerHeight">20dp</item>
+        <item name="android:headerDividersEnabled">false</item>
+        <item name="android:footerDividersEnabled">true</item>
         <item name="android:scrollbars">none</item>
         <item name="android:listSelector">@android:color/transparent</item>
     </style>

+ 20 - 0
gradle.properties

@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
+android.useDeprecatedNdk=true