Browse Source

提交类型 处理bug
提交内容 处理打卡地址微调的时候没有保存到地址的bug

Bitliker 7 years ago
parent
commit
4ab91ea914
88 changed files with 844 additions and 3540 deletions
  1. 5 1
      WeiChat/build.gradle
  2. 3 3
      WeiChat/version.properties
  3. 5 0
      app_core/common/src/main/java/com/core/app/Constants.java
  4. 1 7
      app_core/common/src/main/java/com/core/net/http/HttpUtil.java
  5. 2 1
      app_core/common/src/main/java/com/core/utils/CommonUtil.java
  6. 8 6
      app_core/common/src/main/res/layout/action_data_inquiry_list.xml
  7. 1 1
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/Subscription2Activity.java
  8. 3 1
      app_modular/apputils/src/main/java/com/modular/apputils/activity/SelectNetAcitivty.java
  9. 2 2
      app_modular/apputils/src/main/java/com/modular/apputils/widget/VeriftyDialog.java
  10. 32 25
      app_modular/appworks/src/main/AndroidManifest.xml
  11. 12 5
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/DataFormDetailActivity.java
  12. 185 16
      app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessMainActivity.java
  13. 405 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/CompanyBusinessListActivity.java
  14. 33 12
      app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryDetailActivity.java
  15. 1 0
      app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryDetailActivity.java
  16. 4 1
      app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryListActivity.java
  17. 52 0
      app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2bBusinessListAdapter.java
  18. 5 2
      app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/activity/DataInquiryListActivity.java
  19. 1 0
      app_modular/appworks/src/main/java/com/uas/appworks/model/bean/B2BBusinessListBean.java
  20. BIN
      app_modular/appworks/src/main/res/drawable-hdpi/ic_b2b_header_company.png
  21. BIN
      app_modular/appworks/src/main/res/drawable-xhdpi/ic_b2b_header_company.png
  22. BIN
      app_modular/appworks/src/main/res/drawable-xxhdpi/ic_b2b_header_company.png
  23. 41 0
      app_modular/appworks/src/main/res/layout/activity_b2b_business_main.xml
  24. 28 0
      app_modular/appworks/src/main/res/layout/activity_company_business_list.xml
  25. 9 9
      app_modular/appworks/src/main/res/layout/layout_list_public_inquiry.xml
  26. 1 0
      app_modular/appworks/src/main/res/values-en/strings.xml
  27. 1 0
      app_modular/appworks/src/main/res/values-zh-rCN/strings.xml
  28. 1 0
      app_modular/appworks/src/main/res/values-zh-rTW/strings.xml
  29. 1 0
      app_modular/appworks/src/main/res/values/strings.xml
  30. 0 2
      app_modular/faceplatform-release/build.gradle
  31. BIN
      app_modular/faceplatform-release/faceplatform-release.aar
  32. 0 1
      app_modular/faceplatform-ui/.gitignore
  33. 0 30
      app_modular/faceplatform-ui/build.gradle
  34. BIN
      app_modular/faceplatform-ui/libs/ast.jar
  35. 0 17
      app_modular/faceplatform-ui/proguard-rules.pro
  36. 0 15
      app_modular/faceplatform-ui/src/main/AndroidManifest.xml
  37. 0 464
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceDetectActivity.java
  38. 0 495
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceLivenessActivity.java
  39. 0 243
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceVeriftyActivity.java
  40. 0 246
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceVeriftyLiveActivity.java
  41. 0 189
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/config/FaceConfig.java
  42. 0 54
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/model/FaceVerify.java
  43. 0 89
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/Base64.java
  44. 0 123
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/BrightnessTools.java
  45. 0 25
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/CameraUtils.java
  46. 0 130
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/DeviceUuidFactory.java
  47. 0 50
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/EncryptUtils.java
  48. 0 68
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/VolumeUtils.java
  49. 0 237
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/FaceDetectRoundView.java
  50. 0 20
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/FaceRoundView.java
  51. 0 86
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/WaveHelper.java
  52. 0 334
      app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/WaveView.java
  53. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/arm64-v8a/libFaceSDK.so
  54. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/arm64-v8a/libidl_license.so
  55. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/armeabi-v7a/libFaceSDK.so
  56. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/armeabi-v7a/libidl_license.so
  57. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/x86/libFaceSDK.so
  58. BIN
      app_modular/faceplatform-ui/src/main/jniLibs/x86/libidl_license.so
  59. 0 25
      app_modular/faceplatform-ui/src/main/res/drawable/bg_tips.xml
  60. 0 22
      app_modular/faceplatform-ui/src/main/res/drawable/bg_tips_no.xml
  61. 0 11
      app_modular/faceplatform-ui/src/main/res/drawable/round_top_transparent_bg.xml
  62. 0 107
      app_modular/faceplatform-ui/src/main/res/layout/activity_face_detect.xml
  63. 0 96
      app_modular/faceplatform-ui/src/main/res/layout/activity_face_detect_v3100.xml
  64. 0 107
      app_modular/faceplatform-ui/src/main/res/layout/activity_face_liveness.xml
  65. 0 95
      app_modular/faceplatform-ui/src/main/res/layout/activity_face_liveness_v3100.xml
  66. 0 40
      app_modular/faceplatform-ui/src/main/res/layout/activity_face_verifty.xml
  67. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/bg_face_round.png
  68. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_bottom_uu.png
  69. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_close.png
  70. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_disable_sound.png
  71. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_enable_sound.png
  72. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_bottom_uu.png
  73. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_close_ext.png
  74. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_disable_sound_ext.png
  75. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_enable_sound_ext.png
  76. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_success.png
  77. BIN
      app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_warning.png
  78. BIN
      app_modular/faceplatform-ui/src/main/res/raw/detect_face_in.mp3
  79. BIN
      app_modular/faceplatform-ui/src/main/res/raw/face_good.mp3
  80. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_eye.mp3
  81. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_head_down.mp3
  82. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_head_left.mp3
  83. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_head_left_right.mp3
  84. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_head_right.mp3
  85. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_head_up.mp3
  86. BIN
      app_modular/faceplatform-ui/src/main/res/raw/liveness_mouth.mp3
  87. 0 25
      app_modular/faceplatform-ui/src/main/res/values/strings.xml
  88. 2 2
      settings.gradle

+ 5 - 1
WeiChat/build.gradle

@@ -145,7 +145,11 @@ android {
         }
     }*/
 }
-
+repositories {
+    flatDir {
+        dirs 'libs', project(':faceplatform-ui').file('libs')
+    }
+}
 dependencies {
     compile fileTree(include: ['*.jar'], dir: 'libs')
     testCompile deps.junit

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Tue Jul 03 17:57:21 CST 2018
+#Wed Jul 04 11:24:14 CST 2018
 debugName=502
-versionName=638
+versionName=634
 debugCode=502
-versionCode=179
+versionCode=175

+ 5 - 0
app_core/common/src/main/java/com/core/app/Constants.java

@@ -523,11 +523,16 @@ public class Constants {
         String STATE_PUBLIC_INQUIRY_TODO = "public_todo";
         String STATE_PUBLIC_INQUIRY_INVALID = "public_invalid";
 
+        String STATE_COMPANY_BUSINESS_DONE = "company_done";
+        String STATE_COMPANY_BUSINESS_TODO = "company_todo";
+        String STATE_COMPANY_BUSINESS_INVALID = "company_invalid";
+
         String GET_LOCAL_ENUU = "get_local_enuu";
 
         int RESULT_PURCHASE_ORDER = 111;
         int RESULT_CUSTOMER_INQUIRY = 112;
         int RESULT_PUBLIC_INQUIRY = 113;
+        int RESULT_COMPANY_BUSINESS = 114;
 
         /*邀请注册*/
         String INVITE_REGISTER_LIST_STATE = "invite_register_list_state";

+ 1 - 7
app_core/common/src/main/java/com/core/net/http/HttpUtil.java

@@ -1,6 +1,5 @@
 package com.core.net.http;
 
-import android.os.Looper;
 import android.util.Log;
 
 import com.common.LogUtil;
@@ -34,8 +33,6 @@ import java.net.SocketTimeoutException;
 import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -45,9 +42,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-
 import static com.loopj.android.http.RequestParams.APPLICATION_JSON;
 
 
@@ -127,7 +121,7 @@ public class HttpUtil {
                 for (Entry<String, Object> entry : entrys) {
                     if (entry.getValue() != null)
                         nvps.add(new BasicNameValuePair(entry.getKey(),
-                                URLDecoder.decode(URLEncoder.encode(entry.getValue().toString().replaceAll("%", ""), "utf-8"), "utf-8")));
+                                URLDecoder.decode(URLEncoder.encode(entry.getValue().toString(), "utf-8"), "utf-8")));
                     else
                         nvps.add(new BasicNameValuePair(entry.getKey(), URLDecoder.decode("", "utf-8")));
                 }

+ 2 - 1
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -106,7 +106,7 @@ public class CommonUtil {
         }
         String baseUrl = getSharedPreferences(ct, "erp_baseurl");
 //        if (BaseConfig.isDebug()){
-//            baseUrl="http://192.168.253.41:8080/ERP/";
+//            baseUrl="http://192.168.253.35:8080/ERP/";
 //        }
 //        baseUrl = "http://192.168.253.41:8080/ERP/";
 
@@ -131,6 +131,7 @@ public class CommonUtil {
      * @param context
      * @return
      */
+
     public static String getAccountToken(Context context) {
         if (context == null) {
             return "";

+ 8 - 6
app_core/common/src/main/res/layout/action_data_inquiry_list.xml

@@ -3,15 +3,17 @@
     android:id="@+id/top"
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:paddingRight="@dimen/paddingMin"
-    android:layout_height="?attr/actionBarSize">
+    android:layout_height="?attr/actionBarSize"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
+    android:paddingRight="@dimen/paddingMin">
 
     <ImageView
         android:id="@+id/back"
         android:layout_width="24dp"
         android:layout_height="24dp"
         android:layout_centerVertical="true"
-        android:src="@drawable/ic_baseutil_back"/>
+        android:src="@drawable/ic_baseutil_back" />
 
     <ImageView
         android:id="@+id/data_inquiry_filter_iv"
@@ -19,7 +21,7 @@
         android:layout_height="match_parent"
         android:layout_alignParentRight="true"
         android:layout_centerVertical="true"
-        android:src="@drawable/ic_advanced_filter"/>
+        android:src="@drawable/ic_advanced_filter" />
 
     <RelativeLayout
         android:layout_width="match_parent"
@@ -43,7 +45,7 @@
             android:paddingRight="26dp"
             android:textColor="@color/dark_grey"
             android:textColorHint="@color/grey"
-            android:textSize="14sp"/>
+            android:textSize="14sp" />
 
         <ImageView
             android:id="@+id/data_inquiry_voice_iv"
@@ -54,7 +56,7 @@
             android:layout_centerVertical="true"
             android:layout_marginRight="6dp"
             android:background="@drawable/btn_yuyin_nor"
-            android:visibility="visible"/>
+            android:visibility="visible" />
     </RelativeLayout>
 
 

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/Subscription2Activity.java

@@ -94,7 +94,7 @@ public class Subscription2Activity extends BaseActivity {
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-//        getMenuInflater().inflate(R.menu.menu_manage_subscribe, menu);
+        getMenuInflater().inflate(R.menu.menu_manage_subscribe, menu);
         return super.onCreateOptionsMenu(menu);
     }
 

+ 3 - 1
app_modular/apputils/src/main/java/com/modular/apputils/activity/SelectNetAcitivty.java

@@ -64,6 +64,7 @@ public class SelectNetAcitivty extends OABaseActivity {
 
     private PullToRefreshListView refreshListView;
     private EmptyLayout mEmptyLayout;
+    private int groupId;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -133,6 +134,7 @@ public class SelectNetAcitivty extends OABaseActivity {
             dataForm = intent.getBooleanExtra("dataForm", false);
             corekey = intent.getStringExtra("corekey");
             isDevice = intent.getBooleanExtra("isDevice", false);
+            groupId=intent.getIntExtra("groupId",0);
         }
         VoiceSearchView voiceSearchView = (VoiceSearchView) findViewById(R.id.voiceSearchView);
         refreshListView = (PullToRefreshListView) findViewById(R.id.refreshListView);
@@ -357,7 +359,7 @@ public class SelectNetAcitivty extends OABaseActivity {
                 public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                     if (mAdapter != null) {
                         Bean model = mAdapter.getModels((int) l);
-                        setResult(90, new Intent().putExtra("data", model.json));
+                        setResult(90, new Intent().putExtra("data", model.json).putExtra("groupId",groupId));
                         finish();
 
                     }

+ 2 - 2
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/VeriftyDialog.java → app_modular/apputils/src/main/java/com/modular/apputils/widget/VeriftyDialog.java

@@ -1,4 +1,4 @@
-package com.baidu.idl.face.platform.ui.widget;
+package com.modular.apputils.widget;
 
 import android.app.Dialog;
 import android.content.Context;
@@ -13,7 +13,7 @@ import android.view.ViewGroup;
 import android.view.Window;
 import android.widget.TextView;
 
-import com.baidu.idl.face.platform.ui.R;
+import com.modular.apputils.R;
 
 import java.io.Serializable;
 

+ 32 - 25
app_modular/appworks/src/main/AndroidManifest.xml

@@ -17,7 +17,7 @@
             </intent-filter>
         </activity>
         <activity
-            android:name=".OA.erp.activity.WorkDailyShowActivity"/>
+            android:name=".OA.erp.activity.WorkDailyShowActivity" />
         <activity android:name=".OA.platform.activity.PlatDailyShowActivity" />
         <activity android:name=".OA.platform.activity.PlatWDdetailyActivity" />
         <activity
@@ -65,15 +65,16 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".OA.erp.activity.form.WorkLogsActivity"
+        <activity
+            android:name=".OA.erp.activity.form.WorkLogsActivity"
             android:label="打卡记录"
-            android:theme="@style/MainBaseTheme"/>
+            android:theme="@style/MainBaseTheme" />
         <activity
             android:name=".OA.erp.activity.TeamsAttShowActivity"
             android:label="@string/sign_teams_rank" />
         <activity
             android:name=".OA.erp.activity.MeetDetailsActivity"
-            android:label="@string/meet_detail"/>
+            android:label="@string/meet_detail" />
         <activity
             android:name=".OA.erp.activity.DetailTaskActivity"
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
@@ -91,7 +92,7 @@
         </activity>
         <activity
             android:name=".OA.erp.activity.MeetingActivity"
-            android:label="@string/meet_manage"/>
+            android:label="@string/meet_manage" />
         <activity
             android:name=".OA.erp.activity.SaveMeetActivity"
             android:label="@string/meet_details" />
@@ -109,7 +110,7 @@
             </intent-filter>
         </activity>
         <activity
-            android:name=".CRM.erp.activity.BusinessDetailActivty"/>
+            android:name=".CRM.erp.activity.BusinessDetailActivty" />
         <activity
             android:name=".CRM.erp.activity.BusinessDetailInfoActivity" />
         <activity
@@ -182,8 +183,8 @@
             android:label="@string/change_mobile" />
         <activity
             android:name=".OA.erp.activity.MissionSetActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/activity_mission_set" />
+            android:label="@string/activity_mission_set"
+            android:theme="@style/MainBaseTheme" />
         <activity
             android:name=".OA.erp.activity.MissionActivity"
             android:label="@string/activity_mission_plan">
@@ -221,8 +222,8 @@
             android:configChanges="keyboardHidden|orientation"
             android:hardwareAccelerated="false"
             android:label="@string/charitable"
-            android:theme="@style/MainBaseTheme"
             android:screenOrientation="portrait"
+            android:theme="@style/MainBaseTheme"
             android:windowSoftInputMode="stateUnspecified|adjustNothing">
             <intent-filter>
                 <action android:name="com.modular.work.CharitableActivity" />
@@ -330,8 +331,8 @@
         <!--设备管理-->
         <activity
             android:name=".CRM.erp.activity.DeviceManageActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/title_device_manage">
+            android:label="@string/title_device_manage"
+            android:theme="@style/MainBaseTheme">
             <intent-filter>
                 <action android:name="com.modular.work.DeviceManageActivity" />
 
@@ -340,8 +341,8 @@
         </activity>
         <activity
             android:name=".CRM.erp.activity.DeviceMatchActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/text_device_query_match">
+            android:label="@string/text_device_query_match"
+            android:theme="@style/MainBaseTheme">
             <intent-filter>
                 <action android:name="com.modular.work.DeviceMatchActivity" />
 
@@ -353,30 +354,30 @@
             android:label="@string/text_scan_device" />
         <activity
             android:name=".CRM.erp.activity.DeviceCycleCountActivity"
-            android:theme="@style/MainBaseTheme"
             android:label="@string/title_device_manage"
+            android:theme="@style/MainBaseTheme"
             android:windowSoftInputMode="adjustPan" />
         <activity
             android:name=".CRM.erp.activity.DeviceCycleCountInfoActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/text_cycle_count" />
+            android:label="@string/text_cycle_count"
+            android:theme="@style/MainBaseTheme" />
         <activity
             android:name=".CRM.erp.activity.DeviceDataFormAddActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/title_device_manage" />
+            android:label="@string/title_device_manage"
+            android:theme="@style/MainBaseTheme" />
         <activity
             android:name=".CRM.erp.activity.DeviceCycleCountDetailsActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/title_device_manage" />
+            android:label="@string/title_device_manage"
+            android:theme="@style/MainBaseTheme" />
         <activity
             android:name=".CRM.erp.activity.DeviceCycleCountAddActivity"
-            android:theme="@style/MainBaseTheme"
             android:label="@string/text_cycle_count_add"
+            android:theme="@style/MainBaseTheme"
             />
         <activity
             android:name=".OA.platform.activity.BusinessTravelActivity"
-            android:theme="@style/MainBaseTheme"
-            android:label="@string/business_services">
+            android:label="@string/business_services"
+            android:theme="@style/MainBaseTheme">
             <intent-filter>
                 <action android:name="com.modular.work.BusinessTravelActivity" />
 
@@ -438,13 +439,19 @@
         </activity>
         <activity
             android:name=".OA.platform.activity.PurchaseDetailsActivity"
-            android:theme="@style/MainBaseTheme"
-            android:launchMode="singleTask">
+            android:launchMode="singleTask"
+            android:theme="@style/MainBaseTheme">
             <intent-filter>
                 <action android:name="com.modular.work.platform.activity.PurchaseDetailsActivity" />
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
+
+        <activity
+            android:name=".activity.CompanyBusinessListActivity"
+            android:hardwareAccelerated="true"
+            android:theme="@style/StyledBlueIndicators"
+            android:windowSoftInputMode="adjustPan|stateHidden" />
         <!--B2B商务end-->
 
         <!--邀请注册-->

+ 12 - 5
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/form/DataFormDetailActivity.java

@@ -1143,12 +1143,14 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
                                 isLeave = true;
                             }
                             if (data.getType().equals("SF")) {
+                                LogUtil.d(TAG,"GroupId:"+data.getGroupId());
                                 startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
                                                 .putExtra("fieldKey", data.getField())
                                                 .putExtra("caller", caller)
-                                                .putExtra("isDevice", true)
+                                                .putExtra("isDevice", false)
                                                 .putExtra("device", data.getName().equals("设备编号"))
                                                 .putExtra("isForm", true)
+                                                .putExtra("groupId",data.getGroupId())
                                         , 90);
                                 isLeave = true;
                             } else if (data.getType().equals("MF")) {
@@ -1536,9 +1538,10 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
 
         if (90 == requestCode && data != null) {
             String json = data.getStringExtra("data");
-            LogUtil.d("DataFormDetailActivity", "json=" + json);
+            int groupId=data.getIntExtra("groupId",0);
+            LogUtil.d("DataFormDetailActivity", "json=" + json+" groupId:"+groupId);
             try {
-                paseSelectDbFind(JSON.parseObject(json));
+                paseSelectDbFind(JSON.parseObject(json),groupId);
             } catch (Exception e) {
                 e.printStackTrace();
             }
@@ -1556,8 +1559,12 @@ public class DataFormDetailActivity extends BaseActivity implements View.OnClick
         super.onDestroy();
     }
 
-    private void paseSelectDbFind(JSONObject object) throws Exception {
-        List<Data> tempLists = mAdapter.getmListData().get(0).getDatas();
+    private void paseSelectDbFind(JSONObject object ,int groupId) throws Exception {
+        List<Data> tempLists = mAdapter.getmListData().get(groupId).getDatas();
+        LogUtil.d(TAG,"object:"+object.toJSONString());
+        LogUtil.d(TAG,"tempLists1:"+JSON.toJSONString(tempLists));
+        LogUtil.d(TAG,"tempLists2:"+JSON.toJSONString(mDatas.get(0).getDatas()));
+        LogUtil.prinlnLongMsg(TAG,"tempLists3:"+JSON.toJSONString(mDatas));
         if (!ListUtils.isEmpty(tempLists) && object != null && !object.isEmpty()) {
             for (Data e : tempLists) {
                 if (object.containsKey(e.getField())) {

+ 185 - 16
app_modular/appworks/src/main/java/com/uas/appworks/activity/B2BBusinessMainActivity.java

@@ -57,14 +57,21 @@ import java.util.Map;
  */
 
 public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter> implements View.OnClickListener, HttpCallback {
-    private static final int OBTAIN_PURCHASE_ORDER_LIST = 0x01, OBTAIN_CUSTOMER_INQUIRY_LIST = 0x02, OBTAIN_PUBLIC_INQUIRY_LIST = 0x03, REQUEST_PURCHASE_DETAIL = 0x04, REQUEST_CUSTOMER_DETAIL = 0x05, REQUEST_PUBLIC_DETAIL = 0x06;
+    private static final int OBTAIN_PURCHASE_ORDER_LIST = 0x01,
+            OBTAIN_CUSTOMER_INQUIRY_LIST = 0x02,
+            OBTAIN_PUBLIC_INQUIRY_LIST = 0x03,
+            OBTAIN_COMPANY_BUSINESS_LIST = 0x04,
+            REQUEST_PURCHASE_DETAIL = 0x11,
+            REQUEST_CUSTOMER_DETAIL = 0x12,
+            REQUEST_PUBLIC_DETAIL = 0x13,
+            REQUEST_COMPANY_DETAIL = 0x14;
 
     private RefreshLayout mRefreshLayout;
     private ImageView mBackImageView;
     private DrawableCenterTextView mCompanyNameTextView;
     private LinearLayout mPurchaseOrderIv, mCustomerInquiryIv, mPublicInquiryIv;
-    private TextView mPurchaseOrderAllTv, mCustomerInquiryAllTv, mPublicInquiryAllTv, mAccountSureTextView, mAccountCancelTextView;
-    private RecyclerView mPurchaseOrderRv, mCustomerInquiryRv, mPublicInquiryRv, mAccountRecyclerView;
+    private TextView mPurchaseOrderAllTv, mCustomerInquiryAllTv, mPublicInquiryAllTv, mCompanyBusinessAllTv, mAccountSureTextView, mAccountCancelTextView;
+    private RecyclerView mPurchaseOrderRv, mCustomerInquiryRv, mPublicInquiryRv, mCompanyBusinessRv, mAccountRecyclerView;
     private MaterialDialog mAccountDialog;
     private Banner mHeaderBanner;
 
@@ -72,9 +79,9 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
     private SpanUtils mSpanUtils;
     private List<B2BCompanyBean> mB2BCompanyBeans;
     private B2BAccountAdapter mB2BAccountAdapter;
-    private List<B2BBusinessListBean> mPurchaseOrderBeans, mCustomerInquiryBeans, mPublicInquiryBeans;
-    private B2bBusinessListAdapter mPurchaseOrderAdapter, mCustomerInquiryAdapter, mPublicInquiryAdapter;
-    private boolean isPurchaseSuccess, isCustomerSuccess, isPublicSuccess;
+    private List<B2BBusinessListBean> mPurchaseOrderBeans, mCustomerInquiryBeans, mPublicInquiryBeans, mCompanyBusinessBeans;
+    private B2bBusinessListAdapter mPurchaseOrderAdapter, mCustomerInquiryAdapter, mPublicInquiryAdapter, mCompanyBusinessAdapter;
+    private boolean isPurchaseSuccess, isCustomerSuccess, isPublicSuccess, isCompanySuccess;
     private int mSelectPosition = -1;
 
     @Override
@@ -120,13 +127,15 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
         mCustomerInquiryRv = $(R.id.b2b_business_main_customer_inquiry_rv);
         mPublicInquiryAllTv = $(R.id.b2b_business_main_public_inquiry_all_tv);
         mPublicInquiryRv = $(R.id.b2b_business_main_public_inquiry_rv);
+        mCompanyBusinessAllTv = $(R.id.b2b_business_main_company_business_all_tv);
+        mCompanyBusinessRv = $(R.id.b2b_business_main_company_business_rv);
+
         mHeaderBanner = $(R.id.b2b_business_main_header_banner);
         mHeaderBanner.setImageLoader(new ImageLoader() {
             @Override
             public void displayImage(Context context, Object path, ImageView imageView) {
                 imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
                 Glide.with(context).load(path).into(imageView);
-//                imageView.setImageResource((Integer) path);
             }
         });
 
@@ -146,24 +155,27 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
 
         mPurchaseOrderRv.setLayoutManager(new LinearLayoutManager(mContext));
         mPurchaseOrderRv.setNestedScrollingEnabled(false);
-//        mPurchaseOrderRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
         mPurchaseOrderBeans = new ArrayList<>();
         mPurchaseOrderAdapter = new B2bBusinessListAdapter(mContext, mPurchaseOrderBeans);
         mPurchaseOrderRv.setAdapter(mPurchaseOrderAdapter);
 
         mCustomerInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
         mCustomerInquiryRv.setNestedScrollingEnabled(false);
-//        mCustomerInquiryRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
         mCustomerInquiryBeans = new ArrayList<>();
         mCustomerInquiryAdapter = new B2bBusinessListAdapter(mContext, mCustomerInquiryBeans);
         mCustomerInquiryRv.setAdapter(mCustomerInquiryAdapter);
 
         mPublicInquiryRv.setLayoutManager(new LinearLayoutManager(mContext));
         mPublicInquiryRv.setNestedScrollingEnabled(false);
-//        mPublicInquiryRv.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
         mPublicInquiryBeans = new ArrayList<>();
         mPublicInquiryAdapter = new B2bBusinessListAdapter(mContext, mPublicInquiryBeans);
         mPublicInquiryRv.setAdapter(mPublicInquiryAdapter);
+
+        mCompanyBusinessRv.setLayoutManager(new LinearLayoutManager(mContext));
+        mCompanyBusinessRv.setNestedScrollingEnabled(false);
+        mCompanyBusinessBeans = new ArrayList<>();
+        mCompanyBusinessAdapter = new B2bBusinessListAdapter(mContext, mCompanyBusinessBeans);
+        mCompanyBusinessRv.setAdapter(mCompanyBusinessAdapter);
     }
 
     @Override
@@ -181,6 +193,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
         mCustomerInquiryAllTv.setOnClickListener(this);
         mPublicInquiryIv.setOnClickListener(this);
         mPublicInquiryAllTv.setOnClickListener(this);
+        mCompanyBusinessAllTv.setOnClickListener(this);
         mAccountSureTextView.setOnClickListener(this);
         mAccountCancelTextView.setOnClickListener(this);
 
@@ -197,6 +210,9 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                     case 2:
                         startActivity(PublicInquiryListActivity.class);
                         break;
+                    case 3:
+                        startActivity(CompanyBusinessListActivity.class);
+                        break;
                     default:
                         break;
                 }
@@ -210,9 +226,11 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                     isPurchaseSuccess = false;
                     isCustomerSuccess = false;
                     isPublicSuccess = false;
+                    isCompanySuccess = false;
                     getListData(OBTAIN_PURCHASE_ORDER_LIST);
                     getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
                     getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+                    getListData(OBTAIN_COMPANY_BUSINESS_LIST);
                 } else {
                     toast(R.string.networks_out);
                     mRefreshLayout.finishRefresh(500, false);
@@ -269,6 +287,29 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                 }
             }
         });
+
+        mCompanyBusinessAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, final int position) {
+                mSelectPosition = position;
+                Intent intent = new Intent();
+                String billState = mCompanyBusinessBeans.get(position).getBillState();
+                if (Constants.FLAG.STATE_COMPANY_BUSINESS_DONE.equals(billState)) {
+                    intent.setClass(mContext, PublicInquiryDetailActivity.class);
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mCompanyBusinessBeans.get(position).getId());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mCompanyBusinessBeans.get(position).getBillState());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mCompanyBusinessBeans.get(position).getJsonData());
+                    startActivity(intent);
+                } else if (Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(billState)
+                        || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(billState)) {
+                    intent.setClass(mContext, CustomerInquiryDetailActivity.class);
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mCompanyBusinessBeans.get(position).getId());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mCompanyBusinessBeans.get(position).getBillState());
+                    intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mCompanyBusinessBeans.get(position).getJsonData());
+                    startActivityForResult(intent, REQUEST_COMPANY_DETAIL);
+                }
+            }
+        });
     }
 
     @Override
@@ -285,6 +326,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
         headerImages.add(R.drawable.ic_b2b_header_purchase);
         headerImages.add(R.drawable.ic_b2b_header_customer);
         headerImages.add(R.drawable.ic_b2b_header_public);
+        headerImages.add(R.drawable.ic_b2b_header_company);
         mHeaderBanner.setImages(headerImages);
         mHeaderBanner.start();
 
@@ -293,6 +335,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
             getListData(OBTAIN_PURCHASE_ORDER_LIST);
             getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
             getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+            getListData(OBTAIN_COMPANY_BUSINESS_LIST);
         } else {
             toast(R.string.networks_out);
         }
@@ -314,6 +357,10 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
 //                url = "inquiry/public/mobile";
                 url = "inquiry/public/mobile/v2";
                 break;
+            case OBTAIN_COMPANY_BUSINESS_LIST:
+                host = Constants.API_INQUIRY;
+                url = "inquiry/sale/enremind";
+                break;
         }
         showLoading(null);
 
@@ -324,6 +371,16 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
         params.put("page", 1);
         params.put("size", 3);
 
+        //企业商机参数
+        try {
+            params.put("enuu", Long.parseLong(mB2BCompanyBean.getEnuu()));
+        } catch (Exception e) {
+            params.put("enuu", mB2BCompanyBean.getEnuu());
+        }
+        params.put("useruu", CommonUtil.getUseruuLong(this));
+        params.put("pageNumber", 1);
+        params.put("pageSize", 3);
+
         HttpRequest.getInstance().sendRequest(host,
                 new HttpParams.Builder()
                         .url(url)
@@ -378,6 +435,16 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                 b2BBusinessListBean.setJsonData(null);
             }
             mPublicInquiryAdapter.notifyDataSetChanged();
+        } else if (requestCode == REQUEST_COMPANY_DETAIL
+                && resultCode == Constants.FLAG.RESULT_COMPANY_BUSINESS && data != null) {
+            String newId = data.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ID);
+            B2BBusinessListBean b2BBusinessListBean = mCompanyBusinessBeans.get(mSelectPosition);
+            if (b2BBusinessListBean != null) {
+                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_DONE);
+                b2BBusinessListBean.setId(newId);
+                b2BBusinessListBean.setJsonData(null);
+            }
+            mCompanyBusinessAdapter.notifyDataSetChanged();
         }
     }
 
@@ -391,7 +458,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
             switch (flag) {
                 case OBTAIN_PURCHASE_ORDER_LIST:
                     isPurchaseSuccess = true;
-                    if (isCustomerSuccess && isPublicSuccess) {
+                    if (isCustomerSuccess && isPublicSuccess && isCompanySuccess) {
                         hideLoading();
                     }
                     if (contentArray == null || contentArray.size() == 0) {
@@ -404,7 +471,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                     break;
                 case OBTAIN_CUSTOMER_INQUIRY_LIST:
                     isCustomerSuccess = true;
-                    if (isPurchaseSuccess && isPublicSuccess) {
+                    if (isPurchaseSuccess && isPublicSuccess && isCompanySuccess) {
                         hideLoading();
                     }
                     if (contentArray == null || contentArray.size() == 0) {
@@ -417,7 +484,7 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                     break;
                 case OBTAIN_PUBLIC_INQUIRY_LIST:
                     isPublicSuccess = true;
-                    if (isCustomerSuccess && isPurchaseSuccess) {
+                    if (isCustomerSuccess && isPurchaseSuccess && isCompanySuccess) {
                         hideLoading();
                     }
                     if (contentArray == null || contentArray.size() == 0) {
@@ -428,6 +495,19 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                     mPublicInquiryBeans.clear();
                     analisisPublicInquiry(contentArray);
                     break;
+                case OBTAIN_COMPANY_BUSINESS_LIST:
+                    isCompanySuccess = true;
+                    if (isCustomerSuccess && isPurchaseSuccess && isPublicSuccess) {
+                        hideLoading();
+                    }
+                    if (contentArray == null || contentArray.size() == 0) {
+                        mCompanyBusinessBeans.clear();
+                        mCompanyBusinessAdapter.notifyDataSetChanged();
+                        return;
+                    }
+                    mCompanyBusinessBeans.clear();
+                    analisisCompanyBusiness(contentArray);
+                    break;
                 default:
                     break;
             }
@@ -437,6 +517,85 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
 
     }
 
+    private void analisisCompanyBusiness(JSONArray contentArray) {
+        for (int i = 0; i < contentArray.size(); i++) {
+            JSONObject contentObject = contentArray.getJSONObject(i);
+            if (contentObject != null) {
+                B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
+                b2BBusinessListBean.setItemType(B2BBusinessListBean.COMPANY_BUSINESS_LIST);
+
+                int quoted = JSONUtil.getInt(contentObject, "quoted");
+                if (TextUtils.isEmpty(contentObject.getString("quoted"))) {
+                    b2BBusinessListBean.setJsonData(contentObject.toString());
+                    quoted = 1;
+                }
+
+                if (TextUtils.isEmpty(contentObject.getString("quteId"))) {
+                    b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
+                } else {
+                    b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "quteId"));
+                }
+
+                long date = contentObject.getLongValue("date");
+                if (date != 0) {
+                    b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str(date, DateFormatUtil.YMD));
+                }
+
+                String needquantity = JSONUtil.getText(contentObject, "needquantity");
+                b2BBusinessListBean.setProductAmount(needquantity);
+
+                JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+                JSONObject productObject = contentObject.getJSONObject("product");
+
+                if (productObject != null) {
+                    b2BBusinessListBean.setProductName(JSONUtil.getText(productObject, "title"));
+                    b2BBusinessListBean.setProductModel(JSONUtil.getText(productObject, "code"));
+                    b2BBusinessListBean.setProductSpecification(JSONUtil.getText(productObject, "spec"));
+                    b2BBusinessListBean.setProductBrand(JSONUtil.getText(productObject, "brand"));
+                }
+                if (inquiryObject != null) {
+                    JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+                    if (enterpriseObject != null) {
+                        b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterpriseObject, "enName"));
+                    }
+
+                    long endDate = inquiryObject.getLongValue("endDate");
+                    if (endDate != 0) {
+                        b2BBusinessListBean.setExpiryDate(DateFormatUtil.long2Str(endDate, DateFormatUtil.YMD));
+                    }
+                }
+                String invalid = JSONUtil.getText(contentObject, "invalid");
+                String overdue = JSONUtil.getText(contentObject, "overdue");
+                String status = JSONUtil.getText(contentObject, "status");
+                long remainingTime = JSONUtil.getLong(contentObject, "remainingTime");//剩余时间
+
+                if (remainingTime <= 0) {
+                    b2BBusinessListBean.setRemainTime(0);
+                } else {
+                    b2BBusinessListBean.setRemainTime((int) Math.ceil((float) remainingTime / (1000 * 60 * 60 * 24)));
+                }
+
+                if (quoted == 1) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_DONE);
+                } else {
+                    b2BBusinessListBean.setJsonData(contentObject.toString());
+                    if ("1".equals(overdue) || remainingTime <= 0) {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID);
+                    } else {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_TODO);
+                    }
+                }
+                /*if ("1".equals(invalid) || "1".equals(overdue) || "201".equals(status)) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE);
+                } else {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO);
+                }*/
+                mCompanyBusinessBeans.add(b2BBusinessListBean);
+            }
+        }
+        mCompanyBusinessAdapter.notifyDataSetChanged();
+    }
+
     private void analisisPublicInquiry(JSONArray contentArray) {
         for (int i = 0; i < contentArray.size(); i++) {
             JSONObject contentObject = contentArray.getJSONObject(i);
@@ -651,19 +810,25 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
             switch (flag) {
                 case OBTAIN_PURCHASE_ORDER_LIST:
                     isPurchaseSuccess = true;
-                    if (isCustomerSuccess && isPublicSuccess) {
+                    if (isCustomerSuccess && isPublicSuccess && isCompanySuccess) {
                         hideLoading();
                     }
                     break;
                 case OBTAIN_CUSTOMER_INQUIRY_LIST:
                     isCustomerSuccess = true;
-                    if (isPurchaseSuccess && isPublicSuccess) {
+                    if (isPurchaseSuccess && isPublicSuccess && isCompanySuccess) {
                         hideLoading();
                     }
                     break;
                 case OBTAIN_PUBLIC_INQUIRY_LIST:
                     isPublicSuccess = true;
-                    if (isCustomerSuccess && isPurchaseSuccess) {
+                    if (isCustomerSuccess && isPurchaseSuccess && isCompanySuccess) {
+                        hideLoading();
+                    }
+                    break;
+                case OBTAIN_COMPANY_BUSINESS_LIST:
+                    isPublicSuccess = true;
+                    if (isCustomerSuccess && isPurchaseSuccess && isPublicSuccess) {
                         hideLoading();
                     }
                     break;
@@ -692,6 +857,8 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
         } else if (i == R.id.b2b_business_main_public_inquiry_iv
                 || i == R.id.b2b_business_main_public_inquiry_all_tv) {
             startActivity(PublicInquiryListActivity.class);
+        } else if (i == R.id.b2b_business_main_company_business_all_tv) {
+            startActivity(CompanyBusinessListActivity.class);
         } else if (i == R.id.b2b_change_account_sure_tv) {
             if (CommonUtil.isNetWorkConnected(mContext)) {
                 for (B2BCompanyBean b2BCompanyBean : mB2BCompanyBeans) {
@@ -709,10 +876,12 @@ public class B2BBusinessMainActivity extends BaseMVPActivity<WorkPlatPresenter>
                 isPurchaseSuccess = false;
                 isCustomerSuccess = false;
                 isPublicSuccess = false;
+                isCompanySuccess = false;
                 showLoading(null);
                 getListData(OBTAIN_PURCHASE_ORDER_LIST);
                 getListData(OBTAIN_CUSTOMER_INQUIRY_LIST);
                 getListData(OBTAIN_PUBLIC_INQUIRY_LIST);
+                getListData(OBTAIN_COMPANY_BUSINESS_LIST);
             } else {
                 toast(R.string.networks_out);
             }

+ 405 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/CompanyBusinessListActivity.java

@@ -0,0 +1,405 @@
+package com.uas.appworks.activity;
+
+import android.content.Intent;
+import android.support.v7.app.ActionBar;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.common.LogUtil;
+import com.common.data.DateFormatUtil;
+import com.common.data.JSONUtil;
+import com.core.app.Constants;
+import com.core.base.activity.BaseMVPActivity;
+import com.core.base.presenter.SimplePresenter;
+import com.core.utils.CommonUtil;
+import com.core.widget.SearchActionView;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
+import com.me.network.app.http.HttpRequest;
+import com.me.network.app.http.Method;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.uas.appworks.R;
+import com.uas.appworks.adapter.B2bBusinessListAdapter;
+import com.uas.appworks.model.bean.B2BBusinessListBean;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author RaoMeng
+ * @describe 公司商机列表页面
+ * @date 2018/6/20 9:31
+ */
+public class CompanyBusinessListActivity extends BaseMVPActivity<SimplePresenter> implements HttpCallback {
+    private static final int OBTAIN_B2B_LIST = 0x01;
+    private static final int REQUEST_COMPANY_DETAIL = 0x11;
+
+    private RecyclerView mRecyclerView;
+    private B2bBusinessListAdapter mB2BBusinessListAdapter;
+    private List<B2BBusinessListBean> mB2BBusinessListBeans;
+    private RefreshLayout mRefreshLayout;
+    private int mPageIndex = 1, mPageSize = 20;
+    private String mListUrl, mEnuu, mKeyWord = "";
+    private int mSelectPosition = -1;
+    private SearchActionView mSearchActionView;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.activity_company_business_list;
+    }
+
+    @Override
+    protected void initView() {
+        setTitle("");
+        mSearchActionView = new SearchActionView(mContext);
+        ActionBar bar = this.getSupportActionBar();
+        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        bar.setCustomView(mSearchActionView);
+        mSearchActionView.setSearchHint(getString(R.string.str_company_business_list));
+
+        mEnuu = CommonUtil.getSharedPreferences(mContext, Constants.CACHE.B2B_BUSINESS_ENUU);
+        mRecyclerView = $(R.id.b2b_list_rv);
+        mRefreshLayout = $(R.id.b2b_list_refreshlayout);
+        mRefreshLayout.setEnableAutoLoadmore(true);
+        mRefreshLayout.setEnableLoadmoreWhenContentNotFull(true);
+
+        mB2BBusinessListBeans = new ArrayList<>();
+        mB2BBusinessListAdapter = new B2bBusinessListAdapter(mContext, mB2BBusinessListBeans);
+
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+        mRecyclerView.setNestedScrollingEnabled(false);
+//        mRecyclerView.addItemDecoration(new RecycleViewDivider(mContext, LinearLayout.HORIZONTAL, 1, getResources().getColor(R.color.gray_light)));
+        mRecyclerView.setAdapter(mB2BBusinessListAdapter);
+    }
+
+    @Override
+    protected SimplePresenter initPresenter() {
+        return null;
+    }
+
+    @Override
+    protected void initEvent() {
+        mSearchActionView.setOnEnterActionListener(new SearchActionView.OnEnterActionListener() {
+            @Override
+            public void onEnterAction() {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    getListData(1, mKeyWord);
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnVoiceCompleteListener(new SearchActionView.OnVoiceCompleteListener() {
+            @Override
+            public void onVoiceComplete(String text) {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mKeyWord = mSearchActionView.getText();
+                    getListData(1, mKeyWord);
+                } else {
+                    toast(R.string.networks_out);
+                }
+            }
+        });
+
+        mSearchActionView.setOnTextChangedListener(new SearchActionView.OnTextChangedListener() {
+            @Override
+            public void onTextChanged(String text) {
+                if (TextUtils.isEmpty(text) && !TextUtils.isEmpty(mKeyWord)) {
+                    if (CommonUtil.isNetWorkConnected(mContext)) {
+                        mKeyWord = "";
+                        getListData(1, mKeyWord);
+                    }
+                }
+            }
+        });
+
+        mB2BBusinessListAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, final int position) {
+                mSelectPosition = position;
+                final List<B2BBusinessListBean> data = mB2BBusinessListAdapter.getData();
+                Intent intent = null;
+                switch (data.get(position).getItemType()) {
+                    case B2BBusinessListBean.COMPANY_BUSINESS_LIST:
+                        intent = new Intent();
+                        String billState = data.get(position).getBillState();
+                        if (Constants.FLAG.STATE_COMPANY_BUSINESS_DONE.equals(billState)) {
+                            intent.setClass(mContext, PublicInquiryDetailActivity.class);
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mB2BBusinessListBeans.get(position).getId());
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mB2BBusinessListBeans.get(position).getBillState());
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mB2BBusinessListBeans.get(position).getJsonData());
+                            startActivity(intent);
+                        } else if (Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(billState)
+                                || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(billState)) {
+                            intent.setClass(mContext, CustomerInquiryDetailActivity.class);
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, mB2BBusinessListBeans.get(position).getId());
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_STATE, mB2BBusinessListBeans.get(position).getBillState());
+                            intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_JSON, mB2BBusinessListBeans.get(position).getJsonData());
+                            startActivityForResult(intent, REQUEST_COMPANY_DETAIL);
+                        }
+                        break;
+                    default:
+                        break;
+                }
+            }
+        });
+
+        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mRefreshLayout.resetNoMoreData();
+                    mPageIndex = 1;
+                    getListData(mPageIndex, mKeyWord);
+                } else {
+                    toast(R.string.networks_out);
+                    mRefreshLayout.finishRefresh(500, false);
+                }
+            }
+        });
+
+        mRefreshLayout.setOnLoadmoreListener(new OnLoadmoreListener() {
+            @Override
+            public void onLoadmore(RefreshLayout refreshLayout) {
+                if (CommonUtil.isNetWorkConnected(mContext)) {
+                    mPageIndex++;
+                    getListData(mPageIndex, mKeyWord);
+                } else {
+                    toast(R.string.networks_out);
+                    mRefreshLayout.finishLoadmore(500, false);
+                }
+            }
+        });
+    }
+
+    @Override
+    protected void initData() {
+        mListUrl = "inquiry/sale/enremind";
+
+        if (CommonUtil.isNetWorkConnected(mContext)) {
+            getListData(1, "");
+        } else {
+            mB2BBusinessListAdapter.setEmptyView(R.layout.view_net_error, (ViewGroup) mRecyclerView.getParent());
+        }
+    }
+
+    @Override
+    public boolean needNavigation() {
+        return false;
+    }
+
+    public void getListData(int pageIndex, String keyWord) {
+        showLoading(null);
+
+        mPageIndex = pageIndex;
+        mKeyWord = keyWord;
+
+        Map<String, Object> params = new HashMap<>();
+        try {
+            params.put("enuu", Long.parseLong(mEnuu));
+        } catch (Exception e) {
+            params.put("enuu", mEnuu);
+        }
+        params.put("useruu", CommonUtil.getUseruuLong(this));
+        params.put("pageNumber", mPageIndex);
+        params.put("pageSize", mPageSize);
+        if (!TextUtils.isEmpty(mKeyWord)) {
+            params.put("keyword", mKeyWord);
+        }
+
+        LogUtil.d("b2blistparams", params.toString());
+        String host = Constants.API_INQUIRY;
+
+        HttpRequest.getInstance().sendRequest(host,
+                new HttpParams.Builder()
+                        .url(mListUrl)
+                        .flag(OBTAIN_B2B_LIST)
+                        .method(Method.GET)
+                        .setHeaders(new HashMap<String, Object>())
+                        .setParams(params)
+                        .build(), this);
+    }
+
+    @Override
+    public void onSuccess(int flag, Object o) throws Exception {
+        try {
+            String result = o.toString();
+            LogUtil.prinlnLongMsg("b2blistlogsuccess", result);
+            switch (flag) {
+                case OBTAIN_B2B_LIST:
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONArray contentArray = resultObject.getJSONArray("content");
+                    if (contentArray == null || contentArray.size() == 0) {
+                        if (mPageIndex == 1) {
+                            hideLoading();
+                            mB2BBusinessListBeans.clear();
+                            mB2BBusinessListAdapter.notifyDataSetChanged();
+                            mB2BBusinessListAdapter.setEmptyView(R.layout.view_public_inquiry_empty, (ViewGroup) mRecyclerView.getParent());
+                        } else {
+                            if (mRefreshLayout != null && mRefreshLayout.isLoading()) {
+                                mRefreshLayout.finishLoadmoreWithNoMoreData();
+                            }
+                            progressDialog.dismiss();
+                        }
+                        return;
+                    }
+                    if (mPageIndex == 1) {
+                        mB2BBusinessListBeans.clear();
+                    }
+                    if (contentArray.size() < mPageSize && mPageIndex > 1 && mRefreshLayout != null && mRefreshLayout.isLoading()) {
+                        mRefreshLayout.finishLoadmoreWithNoMoreData();
+                    }
+                    hideLoading();
+                    analisisCompanyBusiness(contentArray);
+                    break;
+                default:
+                    break;
+            }
+        } catch (Exception e) {
+
+        }
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) throws Exception {
+        try {
+            hideLoading();
+            if (flag == OBTAIN_B2B_LIST && mPageIndex > 1) {
+                mPageIndex--;
+            }
+            if (!CommonUtil.isRepeatClick(2000)) {
+                toast(failStr);
+            }
+        } catch (Exception e) {
+
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        B2BBusinessListBean b2BBusinessListBean = mB2BBusinessListBeans.get(mSelectPosition);
+        if (b2BBusinessListBean != null) {
+            if (requestCode == REQUEST_COMPANY_DETAIL
+                    && resultCode == Constants.FLAG.RESULT_COMPANY_BUSINESS && data != null) {
+                String newId = data.getStringExtra(Constants.FLAG.EXTRA_B2B_LIST_ID);
+                b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_DONE);
+                b2BBusinessListBean.setId(newId);
+                b2BBusinessListBean.setJsonData(null);
+            }
+            mB2BBusinessListAdapter.notifyDataSetChanged();
+        }
+
+    }
+
+    private void analisisCompanyBusiness(JSONArray contentArray) {
+        for (int i = 0; i < contentArray.size(); i++) {
+            JSONObject contentObject = contentArray.getJSONObject(i);
+            if (contentObject != null) {
+                B2BBusinessListBean b2BBusinessListBean = new B2BBusinessListBean();
+                b2BBusinessListBean.setItemType(B2BBusinessListBean.COMPANY_BUSINESS_LIST);
+
+                int quoted = JSONUtil.getInt(contentObject, "quoted");
+                if (TextUtils.isEmpty(contentObject.getString("quoted"))) {
+                    b2BBusinessListBean.setJsonData(contentObject.toString());
+                    quoted = 1;
+                }
+
+                if (TextUtils.isEmpty(contentObject.getString("quteId"))) {
+                    b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "id"));
+                } else {
+                    b2BBusinessListBean.setId(JSONUtil.getText(contentObject, "quteId"));
+                }
+
+                long date = contentObject.getLongValue("date");
+                if (date != 0) {
+                    b2BBusinessListBean.setBillDate(DateFormatUtil.long2Str(date, DateFormatUtil.YMD));
+                }
+
+                String needquantity = JSONUtil.getText(contentObject, "needquantity");
+                b2BBusinessListBean.setProductAmount(needquantity);
+
+                JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
+                JSONObject productObject = contentObject.getJSONObject("product");
+
+                if (productObject != null) {
+                    b2BBusinessListBean.setProductName(JSONUtil.getText(productObject, "title"));
+                    b2BBusinessListBean.setProductModel(JSONUtil.getText(productObject, "code"));
+                    b2BBusinessListBean.setProductSpecification(JSONUtil.getText(productObject, "spec"));
+                    b2BBusinessListBean.setProductBrand(JSONUtil.getText(productObject, "brand"));
+                }
+                if (inquiryObject != null) {
+                    JSONObject enterpriseObject = inquiryObject.getJSONObject("enterprise");
+                    if (enterpriseObject != null) {
+                        b2BBusinessListBean.setCompanyName(JSONUtil.getText(enterpriseObject, "enName"));
+                    }
+
+                    long endDate = inquiryObject.getLongValue("endDate");
+                    if (endDate != 0) {
+                        b2BBusinessListBean.setExpiryDate(DateFormatUtil.long2Str(endDate, DateFormatUtil.YMD));
+                    }
+                }
+                String invalid = JSONUtil.getText(contentObject, "invalid");
+                String overdue = JSONUtil.getText(contentObject, "overdue");
+                String status = JSONUtil.getText(contentObject, "status");
+                long remainingTime = JSONUtil.getLong(contentObject, "remainingTime");//剩余时间
+
+                if (remainingTime <= 0) {
+                    b2BBusinessListBean.setRemainTime(0);
+                } else {
+                    b2BBusinessListBean.setRemainTime((int) Math.ceil((float) remainingTime / (1000 * 60 * 60 * 24)));
+                }
+
+                if (quoted == 1) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_DONE);
+                } else {
+                    b2BBusinessListBean.setJsonData(contentObject.toString());
+                    if ("1".equals(overdue) || remainingTime <= 0) {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID);
+                    } else {
+                        b2BBusinessListBean.setBillState(Constants.FLAG.STATE_COMPANY_BUSINESS_TODO);
+                    }
+                }
+                /*if ("1".equals(invalid) || "1".equals(overdue) || "201".equals(status)) {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE);
+                } else {
+                    b2BBusinessListBean.setBillState(Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO);
+                }*/
+                mB2BBusinessListBeans.add(b2BBusinessListBean);
+            }
+        }
+        mB2BBusinessListAdapter.notifyDataSetChanged();
+    }
+
+    @Override
+    public void showLoading(String loadStr) {
+        if (mRefreshLayout != null && !mRefreshLayout.isRefreshing() && !mRefreshLayout.isLoading()) {
+            progressDialog.show();
+        }
+    }
+
+    @Override
+    public void hideLoading() {
+        if (mRefreshLayout != null && mRefreshLayout.isRefreshing()) {
+            mRefreshLayout.finishRefresh(0);
+        }
+        if (mRefreshLayout != null && mRefreshLayout.isLoading()) {
+            mRefreshLayout.finishLoadmore(0);
+        }
+        progressDialog.dismiss();
+    }
+
+}

+ 33 - 12
app_modular/appworks/src/main/java/com/uas/appworks/activity/CustomerInquiryDetailActivity.java

@@ -163,10 +163,12 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
                         initEditable(false, View.GONE);
                         break;
                     case Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO:
+                    case Constants.FLAG.STATE_COMPANY_BUSINESS_TODO:
                         setTitle(R.string.str_wait_quoted);
                         initEditable(true, View.VISIBLE);
                         break;
                     case Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID:
+                    case Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID:
                         setTitle(R.string.str_finished);
                         initEditable(false, View.GONE);
                     default:
@@ -216,7 +218,9 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
             String url = "mobile/sale/inquiry/" + mId + "/info";
             int flag = CUSTOMER_INQUIRY_DETAIL;
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 host = Constants.API_INQUIRY;
                 url = "inquiry/sale/publicInquiry/detail";
                 flag = PUBLIC_INQUIRY_DETAIL;
@@ -251,13 +255,15 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
 
             String userTel = "", userName = "", material = "", productCode = "", productName = "", productCmpcode = "", productBrand = "", productSpec = "";
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 userTel = JSONUtil.getText(detailObject, "userTel");
                 userName = JSONUtil.getText(detailObject, "userName");
-            } else if (recorderUser != null) {
-                userTel = JSONUtil.getText(recorderUser, "userTel");//客户联系电话
+            } else if (enterpriseObject != null) {
+                userTel = JSONUtil.getText(enterpriseObject, "enTel");//客户联系电话
             }
+
             String billNum = JSONUtil.getText(inquiryObject, "code");//单据
 
             if (productObject != null) {
@@ -290,14 +296,18 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
             mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer), customer, "", "客户", "", 0, null));
             mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer_address), customerAddress, "", "客户地址", "", 0, null));
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.public_inquiry_contact), userName, "", "联系人", "", 0, null));
             }
             mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_customer_phone), userTel, "", "联系电话", "", 0, null));
             mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_bill_num), billNum, "", "单据", "", 0, null));
 
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 if (!TextUtils.isEmpty(productCode)) {
                     mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_product_code), productCode, "", "产品编号", "", 0, null));
                 }
@@ -334,12 +344,16 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
                 mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_environment), environment, "", "环保要求", "", 0, null));
             }
             if (!(Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_DONE.equals(mState))) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState))) {
                 mB2BDetailListBeans.add(createB2BDetailListBean(B2BDetailListBean.TYPE_DETAIL_TEXT, getString(R.string.customer_inquiry_price_type), priceType, "", "价格类型", "", 0, null));
             }
 
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 List<String> options = new ArrayList<>();
                 options.add("RMB");
                 options.add("USD");
@@ -516,7 +530,9 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
             String url = "mobile/sale/inquiry/items/" + mId + "/reply";
             String host = new ApiPlatform().getBaseUrl();
             if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
-                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)) {
+                    || Constants.FLAG.STATE_PUBLIC_INQUIRY_INVALID.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID.equals(mState)) {
                 url = "inquiry/sale/mobile/quote";
                 host = Constants.API_INQUIRY;
             }
@@ -539,7 +555,8 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
             setTitle(R.string.str_quoted_price);
             toast(getString(R.string.quote_success));
             String publicId = "";
-            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+            if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)
+                    || Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)) {
                 initEditable(false, View.GONE);
                 if (JSONUtil.validate(result)) {
                     JSONObject publicObject = JSON.parseObject(result);
@@ -547,7 +564,11 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
                 }
                 Intent intent = getIntent();
                 intent.putExtra(Constants.FLAG.EXTRA_B2B_LIST_ID, publicId);
-                setResult(Constants.FLAG.RESULT_PUBLIC_INQUIRY, intent);
+                if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
+                    setResult(Constants.FLAG.RESULT_PUBLIC_INQUIRY, intent);
+                } else if (Constants.FLAG.STATE_COMPANY_BUSINESS_TODO.equals(mState)) {
+                    setResult(Constants.FLAG.RESULT_COMPANY_BUSINESS, intent);
+                }
             } else {
                 setResult(Constants.FLAG.RESULT_CUSTOMER_INQUIRY);
             }

+ 1 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryDetailActivity.java

@@ -117,6 +117,7 @@ public class PublicInquiryDetailActivity extends BaseMVPActivity<WorkPlatPresent
         } else {
             showLoading(null);
 
+
             Map<String, Object> params = new HashMap<>();
             params.put("en_uu", mEnuu);
             params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());

+ 4 - 1
app_modular/appworks/src/main/java/com/uas/appworks/activity/PublicInquiryListActivity.java

@@ -42,12 +42,15 @@ public class PublicInquiryListActivity extends BaseMVPActivity<WorkPlatPresenter
     protected int getLayout() {
         return R.layout.activity_tab_viewpager;
     }
+
     @Override
     public boolean needNavigation() {
         return false;
     }
+
     @Override
-    protected void initView() { setTitle("");
+    protected void initView() {
+        setTitle("");
         mSearchActionView = new SearchActionView(mContext);
         ActionBar bar = this.getSupportActionBar();
         bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

+ 52 - 0
app_modular/appworks/src/main/java/com/uas/appworks/adapter/B2bBusinessListAdapter.java

@@ -28,6 +28,7 @@ public class B2bBusinessListAdapter extends BaseMultiItemQuickAdapter<B2BBusines
         addItemType(B2BBusinessListBean.PURCHASE_ORDER_LIST, R.layout.layout_list_purchase_order);
         addItemType(B2BBusinessListBean.CUSTOMER_INQUIRY_LIST, R.layout.layout_list_customer_inquiry);
         addItemType(B2BBusinessListBean.PUBLIC_INQUIRY_LIST, R.layout.layout_list_public_inquiry);
+        addItemType(B2BBusinessListBean.COMPANY_BUSINESS_LIST, R.layout.layout_list_public_inquiry);
     }
 
     @Override
@@ -43,10 +44,61 @@ public class B2bBusinessListAdapter extends BaseMultiItemQuickAdapter<B2BBusines
                 case B2BBusinessListBean.PUBLIC_INQUIRY_LIST:
                     bindPublicInquiry(baseViewHolder, b2BBusinessListBean);
                     break;
+                case B2BBusinessListBean.COMPANY_BUSINESS_LIST:
+                    bindCompanyBusiness(baseViewHolder, b2BBusinessListBean);
+                    break;
             }
         }
     }
 
+    private void bindCompanyBusiness(BaseViewHolder holder, B2BBusinessListBean b2BBusinessListBean) {
+        holder.setText(R.id.list_public_inquiry_company_tv, b2BBusinessListBean.getCompanyName());
+        holder.setText(R.id.list_public_inquiry_bill_date_tv, b2BBusinessListBean.getBillDate());
+        holder.setText(R.id.list_public_inquiry_product_name_tv, b2BBusinessListBean.getProductName());
+        holder.setText(R.id.list_public_inquiry_product_model_tv, b2BBusinessListBean.getProductModel());
+        holder.setText(R.id.list_public_inquiry_product_specification_tv, b2BBusinessListBean.getProductSpecification());
+        holder.setText(R.id.list_public_inquiry_product_amount_tv, b2BBusinessListBean.getProductAmount());
+        holder.setText(R.id.list_public_inquiry_product_brand_tv, b2BBusinessListBean.getProductBrand());
+        holder.setText(R.id.list_public_inquiry_expiry_date_tv, b2BBusinessListBean.getExpiryDate());
+
+        mSpanUtils = new SpanUtils();
+        SpannableStringBuilder stringBuilder = mSpanUtils.append(mContext.getString(R.string.str_remain))
+                .append(b2BBusinessListBean.getRemainTime() + "").setForegroundColor(Color.RED)
+                .setBold().setFontSize(DisplayUtil.sp2px(mContext, 20))
+                .append(mContext.getString(R.string.str_days)).create();
+        if (stringBuilder != null) {
+            holder.setText(R.id.list_public_inquiry_remaintime_tv, stringBuilder);
+        }
+
+        String billState = b2BBusinessListBean.getBillState();
+        if (billState != null) {
+            switch (billState) {
+                case Constants.FLAG.STATE_COMPANY_BUSINESS_TODO:
+                    setCompanyBtn(holder, true, false, false);
+                    break;
+                case Constants.FLAG.STATE_COMPANY_BUSINESS_DONE:
+                    setCompanyBtn(holder, false, true, false);
+                    break;
+                case Constants.FLAG.STATE_COMPANY_BUSINESS_INVALID:
+                    setCompanyBtn(holder, false, false, true);
+                    break;
+                default:
+                    setCompanyBtn(holder, false, false, false);
+                    break;
+            }
+        } else {
+            setCompanyBtn(holder, false, false, false);
+        }
+
+    }
+
+    private void setCompanyBtn(BaseViewHolder holder, boolean b1, boolean b2, boolean b3) {
+        holder.setVisible(R.id.list_public_inquiry_offer_quotation_btn, b1);
+        holder.setVisible(R.id.list_public_inquiry_done_btn, b2);
+        holder.setVisible(R.id.list_public_inquiry_invalid_btn, b3);
+    }
+
+
     private void bindPublicInquiry(BaseViewHolder holder, B2BBusinessListBean b2BBusinessListBean) {
         holder.setText(R.id.list_public_inquiry_company_tv, b2BBusinessListBean.getCompanyName());
         holder.setText(R.id.list_public_inquiry_bill_date_tv, b2BBusinessListBean.getBillDate());

+ 5 - 2
app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/activity/DataInquiryListActivity.java

@@ -1001,10 +1001,10 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
                 } else {
                     mCondition = "";
                     for (int i = 0; i < mfuzzySchemeConditionBeans.size(); i++) {
-                        mCondition = mCondition + "("
+                        mCondition = mCondition + "(upper("
                                 + (TextUtils.isEmpty(mfuzzySchemeConditionBeans.get(i).getTable()) ? "" : (mfuzzySchemeConditionBeans.get(i).getTable() + "."))
                                 + mfuzzySchemeConditionBeans.get(i).getField()
-                                + " like \'%" + searchField + "%\') or ";
+                                + ") like upper(\'%" + searchField + "%\')) or ";
                     }
                     if (mCondition.length() >= 4) {
                         mCondition = mCondition.substring(0, mCondition.length() - 4);
@@ -1049,6 +1049,9 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
         params.put("pageIndex", mPageIndex);
         params.put("pageSize", mPageSize);
         params.put("condition", mCondition);
+        params.put("master", CommonUtil.getMaster());
+        params.put("sessionUser", CommonUtil.getEmcode());
+        params.put("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"));
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         ViewUtil.httpSendRequest(this, url, params, mHandler, headers, GET_DATA_RESULT, null, null, "post");

+ 1 - 0
app_modular/appworks/src/main/java/com/uas/appworks/model/bean/B2BBusinessListBean.java

@@ -12,6 +12,7 @@ public class B2BBusinessListBean implements MultiItemEntity {
     public static final int PURCHASE_ORDER_LIST = 2;//客户采购订单
     public static final int CUSTOMER_INQUIRY_LIST = 3;//客户询价单
     public static final int PUBLIC_INQUIRY_LIST = 4;//公共询价
+    public static final int COMPANY_BUSINESS_LIST = 5;//公司商机
 
     private int mItemType = -1;
     private String mId;//单据id

BIN
app_modular/appworks/src/main/res/drawable-hdpi/ic_b2b_header_company.png


BIN
app_modular/appworks/src/main/res/drawable-xhdpi/ic_b2b_header_company.png


BIN
app_modular/appworks/src/main/res/drawable-xxhdpi/ic_b2b_header_company.png


+ 41 - 0
app_modular/appworks/src/main/res/layout/activity_b2b_business_main.xml

@@ -215,6 +215,47 @@
                     android:overScrollMode="never"
                     android:scrollbars="none" />
 
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="4dp"
+                    android:layout_marginTop="8dp"
+                    android:padding="6dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/str_company_business_list"
+                        android:textColor="@color/black" />
+
+                    <View
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="6dp"
+                        android:layout_marginRight="6dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/shape_horizontal_dotted_line"
+                        android:layerType="software" />
+
+                    <TextView
+                        android:id="@+id/b2b_business_main_company_business_all_tv"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginRight="8dp"
+                        android:drawablePadding="4dp"
+                        android:drawableRight="@drawable/ic_b2b_all_list"
+                        android:text="@string/all"
+                        android:textColor="@color/titleBlue" />
+                </LinearLayout>
+
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/b2b_business_main_company_business_rv"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:overScrollMode="never"
+                    android:scrollbars="none" />
+
                 <LinearLayout
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"

+ 28 - 0
app_modular/appworks/src/main/res/layout/activity_company_business_list.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.scwang.smartrefresh.layout.SmartRefreshLayout
+    android:id="@+id/b2b_list_refreshlayout"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    app:srlFixedHeaderViewId="@+id/tab_viewpager_tab_ll">
+
+    <com.scwang.smartrefresh.layout.header.ClassicsHeader
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        app:srlAccentColor="@android:color/darker_gray" />
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/b2b_list_rv"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#f3f3f3"
+        android:overScrollMode="never"
+        android:scrollbars="none" />
+
+
+    <com.scwang.smartrefresh.layout.footer.ClassicsFooter
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        app:srlAccentColor="@android:color/darker_gray" />
+</com.scwang.smartrefresh.layout.SmartRefreshLayout>

+ 9 - 9
app_modular/appworks/src/main/res/layout/layout_list_public_inquiry.xml

@@ -54,11 +54,10 @@
 
                         <TextView
                             style="@style/b2b_business_item_caption"
-                            android:text="@string/str_product_name"
-                            />
+                            android:text="@string/str_product_brand" />
 
                         <TextView
-                            android:id="@+id/list_public_inquiry_product_name_tv"
+                            android:id="@+id/list_public_inquiry_product_brand_tv"
                             style="@style/b2b_business_item_value"
                             tools:text="2018-01-21" />
                     </LinearLayout>
@@ -71,10 +70,11 @@
 
                         <TextView
                             style="@style/b2b_business_item_caption"
-                            android:text="@string/str_product_model" />
+                            android:text="@string/str_product_name"
+                            />
 
                         <TextView
-                            android:id="@+id/list_public_inquiry_product_model_tv"
+                            android:id="@+id/list_public_inquiry_product_name_tv"
                             style="@style/b2b_business_item_value"
                             tools:text="2018-01-21" />
                     </LinearLayout>
@@ -87,10 +87,10 @@
 
                         <TextView
                             style="@style/b2b_business_item_caption"
-                            android:text="@string/str_product_specification" />
+                            android:text="@string/str_product_model" />
 
                         <TextView
-                            android:id="@+id/list_public_inquiry_product_specification_tv"
+                            android:id="@+id/list_public_inquiry_product_model_tv"
                             style="@style/b2b_business_item_value"
                             tools:text="2018-01-21" />
                     </LinearLayout>
@@ -103,10 +103,10 @@
 
                         <TextView
                             style="@style/b2b_business_item_caption"
-                            android:text="@string/str_product_brand" />
+                            android:text="@string/str_product_specification" />
 
                         <TextView
-                            android:id="@+id/list_public_inquiry_product_brand_tv"
+                            android:id="@+id/list_public_inquiry_product_specification_tv"
                             style="@style/b2b_business_item_value"
                             tools:text="2018-01-21" />
                     </LinearLayout>

+ 1 - 0
app_modular/appworks/src/main/res/values-en/strings.xml

@@ -183,4 +183,5 @@
     <string name="caption_inquiry_date">询价日期:</string>
     <string name="str_remain">剩余</string>
     <string name="str_days">天</string>
+    <string name="str_company_business_list">公司商机</string>
 </resources>

+ 1 - 0
app_modular/appworks/src/main/res/values-zh-rCN/strings.xml

@@ -182,4 +182,5 @@
     <string name="caption_inquiry_date">询价日期:</string>
     <string name="str_remain">剩余</string>
     <string name="str_days">天</string>
+    <string name="str_company_business_list">公司商机</string>
 </resources>

+ 1 - 0
app_modular/appworks/src/main/res/values-zh-rTW/strings.xml

@@ -182,4 +182,5 @@
     <string name="caption_inquiry_date">询价日期:</string>
     <string name="str_remain">剩余</string>
     <string name="str_days">天</string>
+    <string name="str_company_business_list">公司商机</string>
 </resources>

+ 1 - 0
app_modular/appworks/src/main/res/values/strings.xml

@@ -215,6 +215,7 @@
     <string name="caption_inquiry_date">询价日期:</string>
     <string name="str_remain">剩余</string>
     <string name="str_days">天</string>
+    <string name="str_company_business_list">公司商机</string>
 
 
 </resources>

+ 0 - 2
app_modular/faceplatform-release/build.gradle

@@ -1,2 +0,0 @@
-configurations.maybeCreate("default")
-artifacts.add("default", file('faceplatform-release.aar'))

BIN
app_modular/faceplatform-release/faceplatform-release.aar


+ 0 - 1
app_modular/faceplatform-ui/.gitignore

@@ -1 +0,0 @@
-/build

+ 0 - 30
app_modular/faceplatform-ui/build.gradle

@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-apply plugin: 'com.android.library'
-
-android {
-    compileSdkVersion rootProject.ext.android.compileSdkVersion
-    buildToolsVersion rootProject.ext.android.buildToolsVersion
-
-    defaultConfig {
-        minSdkVersion rootProject.ext.android.minSdkVersion
-        targetSdkVersion rootProject.ext.android.targetSdkVersion
-        versionCode 1
-        versionName "1.0"
-    }
-    buildTypes {
-        release {
-            minifyEnabled false
-            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
-        }
-    }
-}
-
-
-
-dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    compile project(':apputils')
-    compile project(path: ':faceplatform-release')
-}

BIN
app_modular/faceplatform-ui/libs/ast.jar


+ 0 - 17
app_modular/faceplatform-ui/proguard-rules.pro

@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/baidu/Documents/android/android_sdk_mac/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# For more details, see
-#   http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific detect_keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-#   public *;
-#}

+ 0 - 15
app_modular/faceplatform-ui/src/main/AndroidManifest.xml

@@ -1,15 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.baidu.idl.face.platform.ui">
-
-    <application android:label="@string/app_name">
-
-
-        <activity
-            android:name=".FaceVeriftyLiveActivity"
-            android:label="刷脸打卡" />
-        <activity
-            android:name=".FaceVeriftyActivity"
-            android:label="刷脸打卡" />
-    </application>
-
-</manifest>

+ 0 - 464
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceDetectActivity.java

@@ -1,464 +0,0 @@
-/**
- * Copyright (C) 2017 Baidu Inc. All rights reserved.
- */
-package com.baidu.idl.face.platform.ui;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.graphics.PixelFormat;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.hardware.Camera;
-import android.media.AudioManager;
-import android.text.TextUtils;
-import android.util.DisplayMetrics;
-import android.view.Display;
-import android.view.Gravity;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.WindowManager;
-import android.widget.FrameLayout;
-import android.widget.TextView;
-
-import com.baidu.aip.face.stat.Ast;
-import com.baidu.idl.face.platform.FaceConfig;
-import com.baidu.idl.face.platform.FaceSDKManager;
-import com.baidu.idl.face.platform.FaceStatusEnum;
-import com.baidu.idl.face.platform.IDetectStrategy;
-import com.baidu.idl.face.platform.IDetectStrategyCallback;
-import com.baidu.idl.face.platform.ui.utils.CameraUtils;
-import com.baidu.idl.face.platform.ui.utils.VolumeUtils;
-import com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView;
-import com.baidu.idl.face.platform.utils.APIUtils;
-import com.baidu.idl.face.platform.utils.CameraPreviewUtils;
-import com.modular.apputils.activity.BaseNetActivity;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * 人脸采集接口
- */
-public abstract class FaceDetectActivity extends BaseNetActivity implements
-        SurfaceHolder.Callback,
-        Camera.PreviewCallback,
-        Camera.ErrorCallback,
-        VolumeUtils.VolumeCallback,
-        IDetectStrategyCallback {
-
-
-    // View
-    protected FrameLayout mFrameLayout;
-    protected SurfaceView mSurfaceView;
-    protected SurfaceHolder mSurfaceHolder;
-    protected TextView mTipsTopView;
-    protected FaceDetectRoundView mFaceDetectRoundView;
-
-
-    // 人脸信息
-    protected FaceConfig mFaceConfig;
-    protected IDetectStrategy mIDetectStrategy;
-    // 显示Size
-    private Rect mPreviewRect = new Rect();
-    protected int mDisplayWidth = 0;
-    protected int mDisplayHeight = 0;
-    protected int mSurfaceWidth = 0;
-    protected int mSurfaceHeight = 0;
-    protected Drawable mTipsIcon;
-    // 状态标识
-    protected volatile boolean mIsEnableSound = true;
-    protected boolean mIsCreateSurface = false;
-    protected volatile boolean mIsCompletion = false;
-    // 相机
-    protected Camera mCamera;
-    protected Camera.Parameters mCameraParam;
-    protected int mCameraId;
-    protected int mPreviewWidth;
-    protected int mPreviewHight;
-    protected int mPreviewDegree;
-    // 监听系统音量广播
-    protected BroadcastReceiver mVolumeReceiver;
-
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.activity_face_verifty;
-    }
-
-    @Override
-    public void preOnCreacte() {
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        Ast.getInstance().init(getApplicationContext(), "3.1.0.0", "facenormal");
-    }
-    @Override
-    protected void init() throws Exception {
-        DisplayMetrics dm = new DisplayMetrics();
-        Display display = this.getWindowManager().getDefaultDisplay();
-        display.getMetrics(dm);
-        mDisplayWidth = dm.widthPixels;
-        mDisplayHeight = dm.heightPixels;
-        com.baidu.idl.face.platform.ui.config.FaceConfig.initializeResId();
-        mFaceConfig = FaceSDKManager.getInstance().getFaceConfig();
-
-        AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
-        int vol = am.getStreamVolume(AudioManager.STREAM_MUSIC);
-        mIsEnableSound = vol > 0 ? mFaceConfig.isSound : false;
-
-        mFrameLayout =findViewById(R.id.liveness_surface_layout);
-        mFaceDetectRoundView = findViewById(R.id.liveness_face_round);
-        mTipsTopView = findViewById(R.id.liveness_top_tips);
-
-
-        mSurfaceView = new SurfaceView(this);
-        mSurfaceHolder = mSurfaceView.getHolder();
-        mSurfaceHolder.setSizeFromLayout();
-        mSurfaceHolder.addCallback(this);
-        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
-
-        int w = mDisplayWidth;
-        int h = mDisplayHeight;
-
-        FrameLayout.LayoutParams cameraFL = new FrameLayout.LayoutParams(
-                (int) (w * FaceDetectRoundView.SURFACE_RATIO), (int) (h * FaceDetectRoundView.SURFACE_RATIO),
-                Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
-
-        mSurfaceView.setLayoutParams(cameraFL);
-        mFrameLayout.addView(mSurfaceView);
-
-
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        setVolumeControlStream(AudioManager.STREAM_MUSIC);
-        mVolumeReceiver = VolumeUtils.registerVolumeReceiver(this, this);
-        if (mTipsTopView != null) {
-            mTipsTopView.setText(R.string.detect_face_in);
-        }
-        startPreview();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        stopPreview();
-    }
-
-    @Override
-    public void onStop() {
-        super.onStop();
-        VolumeUtils.unRegisterVolumeReceiver(this, mVolumeReceiver);
-        mVolumeReceiver = null;
-        if (mIDetectStrategy != null) {
-            mIDetectStrategy.reset();
-        }
-        stopPreview();
-        Ast.getInstance().immediatelyUpload();
-    }
-
-
-    @Override
-    public void volumeChanged() {
-        try {
-//            AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
-//            if (am != null) {
-//                int cv = am.getStreamVolume(AudioManager.STREAM_MUSIC);
-//                mIsEnableSound = cv > 0;
-//
-//                if (mIDetectStrategy != null) {
-//                    mIDetectStrategy.setDetectStrategySoundEnable(mIsEnableSound);
-//                }
-//            }
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    private Camera open() {
-        Camera camera;
-        int numCameras = Camera.getNumberOfCameras();
-        if (numCameras == 0) {
-            return null;
-        }
-
-        int index = 0;
-        while (index < numCameras) {
-            Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
-            Camera.getCameraInfo(index, cameraInfo);
-            if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
-                break;
-            }
-            index++;
-        }
-
-        if (index < numCameras) {
-            camera = Camera.open(index);
-            mCameraId = index;
-        } else {
-            camera = Camera.open(0);
-            mCameraId = 0;
-        }
-        return camera;
-    }
-
-    protected void startPreview() {
-        if (mSurfaceView != null && mSurfaceView.getHolder() != null) {
-            mSurfaceHolder = mSurfaceView.getHolder();
-            mSurfaceHolder.addCallback(this);
-        }
-
-        if (mCamera == null) {
-            try {
-                mCamera = open();
-            } catch (RuntimeException e) {
-                e.printStackTrace();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (mCamera == null) {
-            return;
-        }
-        if (mCameraParam == null) {
-            mCameraParam = mCamera.getParameters();
-        }
-
-        mCameraParam.setPictureFormat(PixelFormat.JPEG);
-        int degree = displayOrientation(this);
-        mCamera.setDisplayOrientation(degree);
-        // 设置后无效,camera.setDisplayOrientation方法有效
-        mCameraParam.set("rotation", degree);
-        mPreviewDegree = degree;
-        if (mIDetectStrategy != null) {
-            mIDetectStrategy.setPreviewDegree(degree);
-        }
-
-        Point point = CameraPreviewUtils.getBestPreview(mCameraParam,
-                new Point(mDisplayWidth, mDisplayHeight));
-        mPreviewWidth = point.x;
-        mPreviewHight = point.y;
-        // Preview 768,432
-        mPreviewRect.set(0, 0, mPreviewHight, mPreviewWidth);
-
-        mCameraParam.setPreviewSize(mPreviewWidth, mPreviewHight);
-        mCamera.setParameters(mCameraParam);
-
-        try {
-            mCamera.setPreviewDisplay(mSurfaceHolder);
-            mCamera.stopPreview();
-            mCamera.setErrorCallback(this);
-            mCamera.setPreviewCallback(this);
-            mCamera.startPreview();
-        } catch (RuntimeException e) {
-            e.printStackTrace();
-            CameraUtils.releaseCamera(mCamera);
-            mCamera = null;
-        } catch (Exception e) {
-            e.printStackTrace();
-            CameraUtils.releaseCamera(mCamera);
-            mCamera = null;
-        }
-
-    }
-
-    protected void stopPreview() {
-        if (mCamera != null) {
-            try {
-                mCamera.setErrorCallback(null);
-                mCamera.setPreviewCallback(null);
-                mCamera.stopPreview();
-            } catch (RuntimeException e) {
-                e.printStackTrace();
-            } catch (Exception e) {
-                e.printStackTrace();
-            } finally {
-                CameraUtils.releaseCamera(mCamera);
-                mCamera = null;
-            }
-        }
-        if (mSurfaceHolder != null) {
-            mSurfaceHolder.removeCallback(this);
-        }
-        if (mIDetectStrategy != null) {
-            mIDetectStrategy = null;
-        }
-    }
-
-    private int displayOrientation(Context context) {
-        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
-        int rotation = windowManager.getDefaultDisplay().getRotation();
-        int degrees = 0;
-        switch (rotation) {
-            case Surface.ROTATION_0:
-                degrees = 0;
-                break;
-            case Surface.ROTATION_90:
-                degrees = 90;
-                break;
-            case Surface.ROTATION_180:
-                degrees = 180;
-                break;
-            case Surface.ROTATION_270:
-                degrees = 270;
-                break;
-            default:
-                degrees = 0;
-                break;
-        }
-        int result = (0 - degrees + 360) % 360;
-        if (APIUtils.hasGingerbread()) {
-            Camera.CameraInfo info = new Camera.CameraInfo();
-            Camera.getCameraInfo(mCameraId, info);
-            if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
-                result = (info.orientation + degrees) % 360;
-                result = (360 - result) % 360;
-            } else {
-                result = (info.orientation - degrees + 360) % 360;
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public void surfaceCreated(SurfaceHolder holder) {
-        mIsCreateSurface = true;
-    }
-
-    @Override
-    public void surfaceChanged(SurfaceHolder holder,
-                               int format,
-                               int width,
-                               int height) {
-        mSurfaceWidth = width;
-        mSurfaceHeight = height;
-        if (holder.getSurface() == null) {
-            return;
-        }
-        startPreview();
-    }
-
-    @Override
-    public void surfaceDestroyed(SurfaceHolder holder) {
-        mIsCreateSurface = false;
-    }
-
-    @Override
-    public void onPreviewFrame(byte[] data, Camera camera) {
-
-        if (mIsCompletion) {
-            return;
-        }
-        if (mIDetectStrategy == null && mFaceDetectRoundView != null && mFaceDetectRoundView.getRound() > 0) {
-            mIDetectStrategy = FaceSDKManager.getInstance().getDetectStrategyModule();
-            mIDetectStrategy.setPreviewDegree(mPreviewDegree);
-            mIDetectStrategy.setDetectStrategySoundEnable(mIsEnableSound);
-
-            Rect detectRect = FaceDetectRoundView.getPreviewDetectRect(mDisplayWidth, mPreviewHight, mPreviewWidth);
-            mIDetectStrategy.setDetectStrategyConfig(mPreviewRect, detectRect, this);
-        }
-        if (mIDetectStrategy != null) {
-            mIDetectStrategy.detectStrategy(data);
-        }
-    }
-
-
-
-    @Override
-    public void onError(int error, Camera camera) {
-    }
-
-    @Override
-    public void onDetectCompletion(FaceStatusEnum status, String message,
-                                   HashMap<String, String> base64ImageMap) {
-        if (mIsCompletion) {
-            return;
-        }
-        onRefreshView(status, message);
-        if (status == FaceStatusEnum.OK) {
-            Ast.getInstance().faceHit();
-            mIsCompletion = true;
-            saveImage(base64ImageMap);
-        }
-    }
-
-    private void onRefreshView(FaceStatusEnum status, String message) {
-        switch (status) {
-            case OK:
-            case Liveness_Completion:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(true);
-                break;
-            case Detect_PitchOutOfUpMaxRange:
-            case Detect_PitchOutOfDownMaxRange:
-            case Detect_PitchOutOfLeftMaxRange:
-            case Detect_PitchOutOfRightMaxRange:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(false);
-                break;
-            case Error_LivenessTimeout:
-            case Error_Timeout:
-            case Error_DetectTimeout:
-                errorTimeOut();
-                onRefreshTipsView(false, message);
-                break;
-            default:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(false);
-        }
-    }
-
-    private void onRefreshTipsView(boolean isAlert, String message) {
-        mFaceDetectRoundView.onRefreshTipsView(message);
-//        if (isAlert) {
-//            if (mTipsIcon == null) {
-//                mTipsIcon = getResources().getDrawable(R.mipmap.ic_warning);
-//                mTipsIcon.setBounds(0, 0, (int) (mTipsIcon.getMinimumWidth() * 0.7f),
-//                        (int) (mTipsIcon.getMinimumHeight() * 0.7f));
-//                mTipsTopView.setCompoundDrawablePadding(15);
-//            }
-//            mTipsTopView.setBackgroundResource(R.drawable.bg_tips);
-//            mTipsTopView.setText(R.string.detect_standard);
-//            mTipsTopView.setCompoundDrawables(mTipsIcon, null, null, null);
-//        } else {
-//            mTipsTopView.setBackgroundResource(R.drawable.bg_tips_no);
-//            mTipsTopView.setCompoundDrawables(null, null, null, null);
-//            if (!TextUtils.isEmpty(message)) {
-//                mTipsTopView.setText(message);
-//            }
-//        }
-    }
-
-
-
-    private void saveImage(HashMap<String, String> imageMap) {
-        Set<Map.Entry<String, String>> sets = imageMap.entrySet();
-        for (Map.Entry<String, String> entry : sets) {
-            String bmpBase64 = entry.getValue();
-            if (!TextUtils.isEmpty(bmpBase64)) {
-                saveBmpBase64Ok(bmpBase64);
-                break;
-            }
-        }
-    }
-
-
-    /**
-     * 重新开启
-     */
-    public void reSetDetect() {
-        mIsCompletion = false;
-        mIDetectStrategy = null;
-        startPreview();
-    }
-
-    public abstract void saveBmpBase64Ok(String bmpBase64);
-
-    public abstract void errorTimeOut();
-
-}
-

+ 0 - 495
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceLivenessActivity.java

@@ -1,495 +0,0 @@
-/**
- * Copyright (C) 2017 Baidu Inc. All rights reserved.
- */
-package com.baidu.idl.face.platform.ui;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.PixelFormat;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.hardware.Camera;
-import android.media.AudioManager;
-import android.text.TextUtils;
-import android.util.DisplayMetrics;
-import android.view.Display;
-import android.view.Gravity;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.WindowManager;
-import android.widget.FrameLayout;
-import android.widget.TextView;
-
-import com.baidu.aip.face.stat.Ast;
-import com.baidu.idl.face.platform.FaceConfig;
-import com.baidu.idl.face.platform.FaceSDKManager;
-import com.baidu.idl.face.platform.FaceStatusEnum;
-import com.baidu.idl.face.platform.ILivenessStrategy;
-import com.baidu.idl.face.platform.ILivenessStrategyCallback;
-import com.baidu.idl.face.platform.ui.utils.CameraUtils;
-import com.baidu.idl.face.platform.ui.utils.VolumeUtils;
-import com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView;
-import com.baidu.idl.face.platform.utils.APIUtils;
-import com.baidu.idl.face.platform.utils.Base64Utils;
-import com.baidu.idl.face.platform.utils.CameraPreviewUtils;
-import com.modular.apputils.activity.BaseNetActivity;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * 活体检测接口
- */
-public abstract class FaceLivenessActivity extends BaseNetActivity implements
-        SurfaceHolder.Callback,
-        Camera.PreviewCallback,
-        Camera.ErrorCallback,
-        VolumeUtils.VolumeCallback,
-        ILivenessStrategyCallback {
-
-    public static final String TAG = FaceLivenessActivity.class.getSimpleName();
-
-    // View
-    protected FrameLayout mFrameLayout;
-    protected SurfaceView mSurfaceView;
-    protected SurfaceHolder mSurfaceHolder;
-    protected TextView mTipsTopView;
-    protected FaceDetectRoundView mFaceDetectRoundView;
-
-    // 人脸信息
-    protected FaceConfig mFaceConfig;
-    protected ILivenessStrategy mILivenessStrategy;
-    // 显示Size
-    private Rect mPreviewRect = new Rect();
-    protected int mDisplayWidth = 0;
-    protected int mDisplayHeight = 0;
-    protected int mSurfaceWidth = 0;
-    protected int mSurfaceHeight = 0;
-    protected Drawable mTipsIcon;
-    // 状态标识
-    protected volatile boolean mIsEnableSound = true;
-    protected boolean mIsCreateSurface = false;
-    protected boolean mIsCompletion = false;
-    // 相机
-    protected Camera mCamera;
-    protected Camera.Parameters mCameraParam;
-    protected int mCameraId;
-    protected int mPreviewWidth;
-    protected int mPreviewHight;
-    protected int mPreviewDegree;
-    // 监听系统音量广播
-    protected BroadcastReceiver mVolumeReceiver;
-
-    @Override
-    public void preOnCreacte() {
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        Ast.getInstance().init(getApplicationContext(), "3.1.0.0", "facenormal");
-    }
-
-    @Override
-    protected int getLayoutId() {
-        return R.layout.activity_face_verifty;
-    }
-
-    @Override
-    protected void init() throws Exception {
-
-        DisplayMetrics dm = new DisplayMetrics();
-        Display display = this.getWindowManager().getDefaultDisplay();
-        display.getMetrics(dm);
-        mDisplayWidth = dm.widthPixels;
-        mDisplayHeight = dm.heightPixels;
-
-        com.baidu.idl.face.platform.ui.config.FaceConfig.initializeResId();
-        mFaceConfig = FaceSDKManager.getInstance().getFaceConfig();
-
-        AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
-        int vol = am.getStreamVolume(AudioManager.STREAM_MUSIC);
-        mIsEnableSound = vol > 0 ? mFaceConfig.isSound : false;
-
-        mFrameLayout = findViewById(R.id.liveness_surface_layout);
-        mFaceDetectRoundView = findViewById(R.id.liveness_face_round);
-        mTipsTopView = findViewById(R.id.liveness_top_tips);
-
-
-        mSurfaceView = new SurfaceView(this);
-        mSurfaceHolder = mSurfaceView.getHolder();
-        mSurfaceHolder.setSizeFromLayout();
-        mSurfaceHolder.addCallback(this);
-        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
-
-        int w = mDisplayWidth;
-        int h = mDisplayHeight;
-
-        FrameLayout.LayoutParams cameraFL = new FrameLayout.LayoutParams(
-                (int) (w * FaceDetectRoundView.SURFACE_RATIO), (int) (h * FaceDetectRoundView.SURFACE_RATIO),
-                Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
-
-        mSurfaceView.setLayoutParams(cameraFL);
-        mFrameLayout.addView(mSurfaceView);
-
-
-    }
-
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        setVolumeControlStream(AudioManager.STREAM_MUSIC);
-        mVolumeReceiver = VolumeUtils.registerVolumeReceiver(this, this);
-        if (mTipsTopView != null) {
-            mTipsTopView.setText(R.string.detect_face_in);
-        }
-        startPreview();
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        stopPreview();
-    }
-
-    @Override
-    public void onStop() {
-        if (mILivenessStrategy != null) {
-            mILivenessStrategy.reset();
-        }
-        VolumeUtils.unRegisterVolumeReceiver(this, mVolumeReceiver);
-        mVolumeReceiver = null;
-        super.onStop();
-        stopPreview();
-        Ast.getInstance().immediatelyUpload();
-    }
-
-    @Override
-    public void finish() {
-        super.finish();
-    }
-
-    @Override
-    public void volumeChanged() {
-        try {
-            AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
-            if (am != null) {
-//                int cv = am.getStreamVolume(AudioManager.STREAM_MUSIC);
-//                mIsEnableSound = cv > 0;
-//                mSoundView.setImageResource(mIsEnableSound
-//                        ? R.mipmap.ic_enable_sound_ext : R.mipmap.ic_disable_sound_ext);
-//                if (mILivenessStrategy != null) {
-//                    mILivenessStrategy.setLivenessStrategySoundEnable(mIsEnableSound);
-//                }
-            }
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    private Camera open() {
-        Camera camera;
-        int numCameras = Camera.getNumberOfCameras();
-        if (numCameras == 0) {
-            return null;
-        }
-
-        int index = 0;
-        while (index < numCameras) {
-            Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
-            Camera.getCameraInfo(index, cameraInfo);
-            if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
-                break;
-            }
-            index++;
-        }
-
-        if (index < numCameras) {
-            camera = Camera.open(index);
-            mCameraId = index;
-        } else {
-            camera = Camera.open(0);
-            mCameraId = 0;
-        }
-        return camera;
-    }
-
-    protected void startPreview() {
-        if (mSurfaceView != null && mSurfaceView.getHolder() != null) {
-            mSurfaceHolder = mSurfaceView.getHolder();
-            mSurfaceHolder.addCallback(this);
-        }
-
-        if (mCamera == null) {
-            try {
-                mCamera = open();
-            } catch (RuntimeException e) {
-                e.printStackTrace();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (mCamera == null) {
-            return;
-        }
-
-        if (mCameraParam == null) {
-            mCameraParam = mCamera.getParameters();
-        }
-
-        mCameraParam.setPictureFormat(PixelFormat.JPEG);
-        int degree = displayOrientation(this);
-        mCamera.setDisplayOrientation(degree);
-        // 设置后无效,camera.setDisplayOrientation方法有效
-        mCameraParam.set("rotation", degree);
-        mPreviewDegree = degree;
-
-        Point point = CameraPreviewUtils.getBestPreview(mCameraParam,
-                new Point(mDisplayWidth, mDisplayHeight));
-
-        mPreviewWidth = point.x;
-        mPreviewHight = point.y;
-        // Preview 768,432
-
-        if (mILivenessStrategy != null) {
-            mILivenessStrategy.setPreviewDegree(degree);
-        }
-
-        mPreviewRect.set(0, 0, mPreviewHight, mPreviewWidth);
-
-        mCameraParam.setPreviewSize(mPreviewWidth, mPreviewHight);
-        mCamera.setParameters(mCameraParam);
-
-        try {
-            mCamera.setPreviewDisplay(mSurfaceHolder);
-            mCamera.stopPreview();
-            mCamera.setErrorCallback(this);
-            mCamera.setPreviewCallback(this);
-            mCamera.startPreview();
-        } catch (RuntimeException e) {
-            e.printStackTrace();
-            CameraUtils.releaseCamera(mCamera);
-            mCamera = null;
-        } catch (Exception e) {
-            e.printStackTrace();
-            CameraUtils.releaseCamera(mCamera);
-            mCamera = null;
-        }
-    }
-
-    protected void stopPreview() {
-        if (mCamera != null) {
-            try {
-                mCamera.setErrorCallback(null);
-                mCamera.setPreviewCallback(null);
-                mCamera.stopPreview();
-            } catch (RuntimeException e) {
-                e.printStackTrace();
-            } catch (Exception e) {
-                e.printStackTrace();
-            } finally {
-                CameraUtils.releaseCamera(mCamera);
-                mCamera = null;
-            }
-        }
-        if (mSurfaceHolder != null) {
-            mSurfaceHolder.removeCallback(this);
-        }
-        if (mILivenessStrategy != null) {
-            mILivenessStrategy = null;
-        }
-    }
-
-    private int displayOrientation(Context context) {
-        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
-        int rotation = windowManager.getDefaultDisplay().getRotation();
-        int degrees = 0;
-        switch (rotation) {
-            case Surface.ROTATION_0:
-                degrees = 0;
-                break;
-            case Surface.ROTATION_90:
-                degrees = 90;
-                break;
-            case Surface.ROTATION_180:
-                degrees = 180;
-                break;
-            case Surface.ROTATION_270:
-                degrees = 270;
-                break;
-            default:
-                degrees = 0;
-                break;
-        }
-        int result = (0 - degrees + 360) % 360;
-        if (APIUtils.hasGingerbread()) {
-            Camera.CameraInfo info = new Camera.CameraInfo();
-            Camera.getCameraInfo(mCameraId, info);
-            if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
-                result = (info.orientation + degrees) % 360;
-                result = (360 - result) % 360;
-            } else {
-                result = (info.orientation - degrees + 360) % 360;
-            }
-        }
-        return result;
-    }
-
-    @Override
-    public void surfaceCreated(SurfaceHolder holder) {
-        mIsCreateSurface = true;
-    }
-
-    @Override
-    public void surfaceChanged(SurfaceHolder holder,
-                               int format,
-                               int width,
-                               int height) {
-        mSurfaceWidth = width;
-        mSurfaceHeight = height;
-        if (holder.getSurface() == null) {
-            return;
-        }
-        startPreview();
-    }
-
-    @Override
-    public void surfaceDestroyed(SurfaceHolder holder) {
-        mIsCreateSurface = false;
-    }
-
-    @Override
-    public void onPreviewFrame(byte[] data, Camera camera) {
-
-        if (mIsCompletion) {
-            return;
-        }
-
-        if (mILivenessStrategy == null) {
-            mILivenessStrategy = FaceSDKManager.getInstance().getLivenessStrategyModule();
-            mILivenessStrategy.setPreviewDegree(mPreviewDegree);
-            mILivenessStrategy.setLivenessStrategySoundEnable(mIsEnableSound);
-
-            Rect detectRect = FaceDetectRoundView.getPreviewDetectRect(
-                    mDisplayWidth, mPreviewHight, mPreviewWidth);
-            mILivenessStrategy.setLivenessStrategyConfig(
-                    mFaceConfig.getLivenessTypeList(), mPreviewRect, detectRect, this);
-        }
-        mILivenessStrategy.livenessStrategy(data);
-    }
-
-    @Override
-    public void onError(int error, Camera camera) {
-    }
-
-    @Override
-    public void onLivenessCompletion(FaceStatusEnum status, String message,
-                                     HashMap<String, String> base64ImageMap) {
-        if (mIsCompletion) {
-            return;
-        }
-
-        onRefreshView(status, message);
-        if (status == FaceStatusEnum.OK) {
-            Ast.getInstance().faceHit();
-            mIsCompletion = true;
-            saveImage(base64ImageMap);
-        }
-    }
-
-    private void onRefreshView(FaceStatusEnum status, String message) {
-        switch (status) {
-            case OK:
-            case Liveness_OK:
-            case Liveness_Completion:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(true);
-                break;
-            case Detect_DataNotReady:
-            case Liveness_Eye:
-            case Liveness_Mouth:
-            case Liveness_HeadUp:
-            case Liveness_HeadDown:
-            case Liveness_HeadLeft:
-            case Liveness_HeadRight:
-            case Liveness_HeadLeftRight:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(false);
-                break;
-            case Detect_PitchOutOfUpMaxRange:
-            case Detect_PitchOutOfDownMaxRange:
-            case Detect_PitchOutOfLeftMaxRange:
-            case Detect_PitchOutOfRightMaxRange:
-                onRefreshTipsView(true, message);
-                mFaceDetectRoundView.onRefreshSuccessView(false);
-                break;
-            case Error_LivenessTimeout:
-            case Error_Timeout:
-            case Error_DetectTimeout:
-                errorTimeOut();
-                onRefreshTipsView(false, message);
-                break;
-            default:
-                onRefreshTipsView(false, message);
-                mFaceDetectRoundView.onRefreshSuccessView(false);
-        }
-    }
-
-
-    //提示信息
-    private void onRefreshTipsView(boolean isAlert, String message) {
-        mFaceDetectRoundView.onRefreshTipsView(message);
-
-        if (isAlert) {
-            if (mTipsIcon == null) {
-                mTipsIcon = getResources().getDrawable(R.mipmap.ic_warning);
-                mTipsIcon.setBounds(0, 0, (int) (mTipsIcon.getMinimumWidth() * 0.7f),
-                        (int) (mTipsIcon.getMinimumHeight() * 0.7f));
-                mTipsTopView.setCompoundDrawablePadding(15);
-            }
-//            mTipsTopView.setBackgroundResource(R.drawable.bg_tips);
-            mTipsTopView.setText(R.string.detect_standard);
-            mTipsTopView.setCompoundDrawables(mTipsIcon, null, null, null);
-        } else {
-//            mTipsTopView.setBackgroundResource(R.drawable.bg_tips_no);
-            mTipsTopView.setCompoundDrawables(null, null, null, null);
-            if (!TextUtils.isEmpty(message)) {
-                mTipsTopView.setText(message);
-            }
-        }
-    }
-
-
-    private void saveImage(HashMap<String, String> imageMap) {
-        Set<Map.Entry<String, String>> sets = imageMap.entrySet();
-        for (Map.Entry<String, String> entry : sets) {
-            String bmpBase64 = entry.getValue();
-            if (!TextUtils.isEmpty(bmpBase64)) {
-                saveBmpBase64Ok(bmpBase64);
-                break;
-            }
-        }
-    }
-
-    private static Bitmap base64ToBitmap(String base64Data) {
-        byte[] bytes = Base64Utils.decode(base64Data, Base64Utils.NO_WRAP);
-        return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
-    }
-
-    /**
-     * 重新开启
-     */
-    public void reSetDetect() {
-        mIsCompletion = false;
-        mILivenessStrategy = null;
-        startPreview();
-    }
-
-    public abstract void saveBmpBase64Ok(String bmpBase64);
-
-    public abstract void errorTimeOut();
-
-}

+ 0 - 243
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceVeriftyActivity.java

@@ -1,243 +0,0 @@
-package com.baidu.idl.face.platform.ui;
-
-import android.text.TextUtils;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baidu.idl.face.platform.ui.config.FaceConfig;
-import com.baidu.idl.face.platform.ui.model.FaceVerify;
-import com.baidu.idl.face.platform.ui.widget.VeriftyDialog;
-import com.common.LogUtil;
-import com.common.data.JSONUtil;
-import com.common.data.ListUtils;
-import com.core.app.MyApplication;
-import com.core.model.User;
-import com.core.utils.CommonUtil;
-import com.me.network.app.http.HttpClient;
-import com.me.network.app.http.Method;
-import com.me.network.app.http.rx.Result2Listener;
-import com.me.network.app.http.rx.ResultSubscriber;
-
-public class FaceVeriftyActivity extends  FaceDetectActivity{
-
-    @Override
-    protected String getBaseUrl() {
-        return "https://aip.baidubce.com/";
-    }
-
-
-    //成功获取到Base64数据
-    @Override
-    public void saveBmpBase64Ok(String bmpBase64) {
-        String master = CommonUtil.getEnuu(ct);
-        String imid = MyApplication.getInstance().getLoginUserId();
-        verify(bmpBase64, master, imid);
-    }
-
-    @Override
-    public void errorTimeOut() {
-        showErrorDialog(getString(R.string.detect_timeout));
-    }
-
-
-    private void showRegisterDialog(final String faceBase64, final String group_id_list, final String user_id) {
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent("您未录入人脸照片,点击\"确认\"录入系统")
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (clickSure) {
-                            String company = CommonUtil.getSharedPreferences(ct, "erp_commpany");
-                            String master = CommonUtil.getSharedPreferences(ct, "Master_ch");
-                            String name = CommonUtil.getName();
-                            User user = MyApplication.getInstance().mLoginUser;
-                            String phone = null;
-                            if (user != null) {
-                                phone = user.getTelephone();
-                            }
-                            String userInfo = company + "_" + master + "_" + phone + "_" + name;//公司名_帐套名_电话_姓名
-                            register(faceBase64, group_id_list, user_id, userInfo);
-                        } else {
-                            setResult(0);
-                            finish();
-                        }
-                    }
-                });
-
-    }
-
-    /**
-     * 验证后返回弹出窗口
-     *
-     * @param message
-     */
-    private void showErrorRegister(final boolean isPass, final String message) {
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent(message)
-                .setShowCancel(false)
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (isPass) {
-                            setResult(clickSure ? RESULT_OK : 0);
-                            finish();
-                        } else {
-                            setResult(0);
-                            finish();
-                        }
-                    }
-                });
-
-    }
-
-
-    //验证和注册错误
-    private void showErrorDialog(String result) {
-        String message = "";
-        if (result.contains("liveness check fail")) {
-            message = "不能拿照片骗我哦";
-        } else {
-            message = result;
-        }
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent(message)
-                .setSureText("再试一次")
-                .setShowCancel(true)
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (clickSure) {
-                            reSetDetect();
-                        } else {
-                            finish();
-                        }
-                    }
-                });
-    }
-
-    /**
-     * 校验身份
-     *
-     * @param faceBase64    脸部信息
-     * @param group_id_list 组Id
-     * @param user_id       用户Id
-     */
-    private void verify(final String faceBase64, final String group_id_list, final String user_id) {
-        showProgress();
-        FaceConfig.loadToken(new FaceConfig.FaceTokenListener() {
-            @Override
-            public void callBack(String accessToken) {
-                LogUtil.i("gong", "accessToken=" + accessToken);
-                httpClient.Api().send(new HttpClient.Builder()
-                        .url("rest/2.0/face/v3/search")
-                        .add("access_token", accessToken)
-                        .header("Content-Type", "application/json")
-                        .add("image", faceBase64)
-                        .add("image_type", "BASE64")
-                        .add("liveness_control", "HIGH")//NORMAL
-                        .add("user_id", user_id)
-                        .isDebug(true)
-                        .add("group_id_list", group_id_list)
-                        .method(Method.POST).build(), new ResultSubscriber<>(new Result2Listener<Object>() {
-                    @Override
-                    public void onResponse(Object o) {
-                        LogUtil.i("gong", "verify onResponse=" + o.toString());
-                        try {
-                            JSONObject object = JSON.parseObject(o.toString());
-                            String error_msg = JSONUtil.getText(object, "error_msg");
-                            if (TextUtils.isEmpty(error_msg) || error_msg.equals("SUCCESS")) {
-                                JSONObject result = JSONUtil.getJSONObject(object, "result");
-                                JSONArray user_list = JSONUtil.getJSONArray(result, "user_list");
-                                if (ListUtils.isEmpty(user_list)) {
-                                    //没有注册时候
-                                    showRegisterDialog(faceBase64, group_id_list, user_id);
-                                } else {
-                                    FaceVerify mFaceVerify = new FaceVerify();
-                                    for (int i = 0; i < user_list.size(); i++) {
-                                        JSONObject userObject = user_list.getJSONObject(i);
-                                        float score = JSONUtil.getFloat(userObject, "score");
-                                        if (mFaceVerify.getScore() < score) {
-                                            mFaceVerify.setScore(score);
-                                            mFaceVerify.setUserId(JSONUtil.getText(userObject, "user_id"));
-                                            mFaceVerify.setUserInfo(JSONUtil.getText(userObject, "user_info"));
-                                            mFaceVerify.setGroupId(JSONUtil.getText(userObject, "group_id"));
-                                            if (mFaceVerify.isPass()) {
-                                                break;
-                                            }
-                                        }
-                                    }
-                                    if (mFaceVerify.isPass()) {
-                                        setResult(RESULT_OK);
-                                        finish();
-                                    } else {
-                                        showErrorDialog("抱歉,没认出你哦");
-                                    }
-                                }
-                            } else {
-                                showErrorDialog(error_msg);
-                            }
-                        } catch (Exception e) {
-                        }
-                        dismissProgress();
-                    }
-
-                    @Override
-                    public void onFailure(Object t) {
-                        dismissProgress();
-                        LogUtil.i("gong", "verify onFailure=" + t.toString());
-                    }
-                }));
-            }
-        });
-    }
-
-    private void register(final String faceBase64, final String group_id, final String user_id, final String user_info) {
-        showProgress();
-        FaceConfig.loadToken(new FaceConfig.FaceTokenListener() {
-            @Override
-            public void callBack(String accessToken) {
-                LogUtil.i("gong", "accessToken=" + accessToken);
-                httpClient.Api().send(new HttpClient.Builder()
-                        .url("rest/2.0/face/v3/faceset/user/add")
-                        .add("access_token", accessToken)
-                        .header("Content-Type", "application/json")
-                        .add("image", faceBase64)
-                        .add("image_type", "BASE64")
-                        .add("quality_control", "HIGH")
-                        .add("liveness_control", "NORMAL")
-                        .add("user_id", user_id)
-                        .add("user_info", user_info)
-                        .isDebug(true)
-                        .add("group_id", group_id)
-                        .method(Method.POST).build(), new ResultSubscriber<>(new Result2Listener<Object>() {
-                    @Override
-                    public void onResponse(Object o) {
-                        LogUtil.i("gong", "verify onResponse=" + o.toString());
-                        try {
-                            JSONObject object = JSON.parseObject(o.toString());
-                            String error_msg = JSONUtil.getText(object, "error_msg");
-                            if (TextUtils.isEmpty(error_msg) || error_msg.equals("SUCCESS")) {
-                                setResult(RESULT_OK);
-                                finish();
-                            } else {
-                                showErrorDialog(error_msg);
-                            }
-                        } catch (Exception e) {
-                        }
-                        dismissProgress();
-                    }
-
-                    @Override
-                    public void onFailure(Object t) {
-                        dismissProgress();
-                        LogUtil.i("gong", "verify onFailure=" + t.toString());
-                    }
-                }));
-            }
-        });
-    }
-}

+ 0 - 246
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/FaceVeriftyLiveActivity.java

@@ -1,246 +0,0 @@
-package com.baidu.idl.face.platform.ui;
-
-import android.text.TextUtils;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.baidu.idl.face.platform.ui.config.FaceConfig;
-import com.baidu.idl.face.platform.ui.model.FaceVerify;
-import com.baidu.idl.face.platform.ui.widget.VeriftyDialog;
-import com.common.LogUtil;
-import com.common.data.JSONUtil;
-import com.common.data.ListUtils;
-import com.core.app.MyApplication;
-import com.core.model.User;
-import com.core.utils.CommonUtil;
-import com.me.network.app.http.HttpClient;
-import com.me.network.app.http.Method;
-import com.me.network.app.http.rx.Result2Listener;
-import com.me.network.app.http.rx.ResultSubscriber;
-
-public class FaceVeriftyLiveActivity extends FaceLivenessActivity {
-
-
-    @Override
-    protected String getBaseUrl() {
-        return "https://aip.baidubce.com/";
-    }
-
-
-    //成功获取到Base64数据
-    @Override
-    public void saveBmpBase64Ok(String bmpBase64) {
-        String master = CommonUtil.getEnuu(ct);
-        String imid = MyApplication.getInstance().getLoginUserId();
-        verify(bmpBase64, master, imid);
-    }
-
-    @Override
-    public void errorTimeOut() {
-        showErrorDialog(getString(R.string.detect_timeout));
-    }
-
-
-    private void showRegisterDialog(final String faceBase64, final String group_id_list, final String user_id) {
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent("您未录入人脸照片,点击\"确认\"录入系统")
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (clickSure) {
-                            String company = CommonUtil.getSharedPreferences(ct, "erp_commpany");
-                            String master = CommonUtil.getSharedPreferences(ct, "Master_ch");
-                            String name = CommonUtil.getName();
-                            User user = MyApplication.getInstance().mLoginUser;
-                            String phone = null;
-                            if (user != null) {
-                                phone = user.getTelephone();
-                            }
-                            String userInfo = company + "_" + master + "_" + phone + "_" + name;//公司名_帐套名_电话_姓名
-                            register(faceBase64, group_id_list, user_id, userInfo);
-                        } else {
-                            setResult(0);
-                            finish();
-                        }
-                    }
-                });
-
-    }
-
-    /**
-     * 验证后返回弹出窗口
-     *
-     * @param message
-     */
-    private void showErrorRegister(final boolean isPass, final String message) {
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent(message)
-                .setShowCancel(false)
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (isPass) {
-                            setResult(clickSure ? RESULT_OK : 0);
-                            finish();
-                        } else {
-                            setResult(0);
-                            finish();
-                        }
-                    }
-                });
-
-    }
-
-
-    //验证和注册错误
-    private void showErrorDialog(String result) {
-        String message = "";
-        if (result.contains("liveness check fail")) {
-            message = "不能拿照片骗我哦";
-        } else {
-            message = result;
-        }
-        new VeriftyDialog.Builder(this)
-                .setCanceledOnTouchOutside(false)
-                .setContent(message)
-                .setSureText("再试一次")
-                .setShowCancel(true)
-                .build(new VeriftyDialog.OnDialogClickListener() {
-                    @Override
-                    public void result(boolean clickSure) {
-                        if (clickSure) {
-                            reSetDetect();
-                        } else {
-                            finish();
-                        }
-                    }
-                });
-    }
-
-    /**
-     * 校验身份
-     *
-     * @param faceBase64    脸部信息
-     * @param group_id_list 组Id
-     * @param user_id       用户Id
-     */
-    private void verify(final String faceBase64, final String group_id_list, final String user_id) {
-        showProgress();
-        FaceConfig.loadToken(new FaceConfig.FaceTokenListener() {
-            @Override
-            public void callBack(String accessToken) {
-                LogUtil.i("gong", "accessToken=" + accessToken);
-                httpClient.Api().send(new HttpClient.Builder()
-                        .url("rest/2.0/face/v3/search")
-                        .add("access_token", accessToken)
-                        .header("Content-Type", "application/json")
-                        .add("image", faceBase64)
-                        .add("image_type", "BASE64")
-                        .add("liveness_control", "HIGH")
-                        .add("user_id", user_id)
-                        .isDebug(true)
-                        .add("group_id_list", group_id_list)
-                        .method(Method.POST).build(), new ResultSubscriber<>(new Result2Listener<Object>() {
-                    @Override
-                    public void onResponse(Object o) {
-                        LogUtil.i("gong", "verify onResponse=" + o.toString());
-                        try {
-                            JSONObject object = JSON.parseObject(o.toString());
-                            String error_msg = JSONUtil.getText(object, "error_msg");
-                            if (TextUtils.isEmpty(error_msg) || error_msg.equals("SUCCESS")) {
-                                JSONObject result = JSONUtil.getJSONObject(object, "result");
-                                JSONArray user_list = JSONUtil.getJSONArray(result, "user_list");
-                                if (ListUtils.isEmpty(user_list)) {
-                                    //没有注册时候
-                                    showRegisterDialog(faceBase64, group_id_list, user_id);
-                                } else {
-                                    FaceVerify mFaceVerify = new FaceVerify();
-                                    for (int i = 0; i < user_list.size(); i++) {
-                                        JSONObject userObject = user_list.getJSONObject(i);
-                                        float score = JSONUtil.getFloat(userObject, "score");
-                                        if (mFaceVerify.getScore() < score) {
-                                            mFaceVerify.setScore(score);
-                                            mFaceVerify.setUserId(JSONUtil.getText(userObject, "user_id"));
-                                            mFaceVerify.setUserInfo(JSONUtil.getText(userObject, "user_info"));
-                                            mFaceVerify.setGroupId(JSONUtil.getText(userObject, "group_id"));
-                                            if (mFaceVerify.isPass()) {
-                                                break;
-                                            }
-                                        }
-                                    }
-                                    if (mFaceVerify.isPass()) {
-                                        setResult(RESULT_OK);
-                                        finish();
-                                    } else {
-                                        showErrorDialog("抱歉,没认出你哦");
-                                    }
-                                }
-                            } else {
-                                showErrorDialog(error_msg);
-                            }
-                        } catch (Exception e) {
-                        }
-                        dismissProgress();
-                    }
-
-                    @Override
-                    public void onFailure(Object t) {
-                        dismissProgress();
-                        LogUtil.i("gong", "verify onFailure=" + t.toString());
-                    }
-                }));
-            }
-        });
-    }
-
-    private void register(final String faceBase64, final String group_id, final String user_id, final String user_info) {
-        showProgress();
-        FaceConfig.loadToken(new FaceConfig.FaceTokenListener() {
-            @Override
-            public void callBack(String accessToken) {
-                LogUtil.i("gong", "accessToken=" + accessToken);
-                httpClient.Api().send(new HttpClient.Builder()
-                        .url("rest/2.0/face/v3/faceset/user/add")
-                        .add("access_token", accessToken)
-                        .header("Content-Type", "application/json")
-                        .add("image", faceBase64)
-                        .add("image_type", "BASE64")
-                        .add("quality_control", "HIGH")
-                        .add("liveness_control", "HIGH")
-                        .add("user_id", user_id)
-                        .add("user_info", user_info)
-                        .isDebug(true)
-                        .add("group_id", group_id)
-                        .method(Method.POST).build(), new ResultSubscriber<>(new Result2Listener<Object>() {
-                    @Override
-                    public void onResponse(Object o) {
-                        LogUtil.i("gong", "verify onResponse=" + o.toString());
-                        try {
-                            JSONObject object = JSON.parseObject(o.toString());
-                            String error_msg = JSONUtil.getText(object, "error_msg");
-                            if (TextUtils.isEmpty(error_msg) || error_msg.equals("SUCCESS")) {
-                                setResult(RESULT_OK);
-                                finish();
-                            } else {
-                                showErrorDialog(error_msg);
-                            }
-                        } catch (Exception e) {
-                        }
-                        dismissProgress();
-                    }
-
-                    @Override
-                    public void onFailure(Object t) {
-                        dismissProgress();
-                        LogUtil.i("gong", "verify onFailure=" + t.toString());
-                    }
-                }));
-            }
-        });
-    }
-
-
-}

+ 0 - 189
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/config/FaceConfig.java

@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.config;
-
-
-import android.content.Context;
-import android.text.TextUtils;
-
-import com.baidu.idl.face.platform.FaceEnvironment;
-import com.baidu.idl.face.platform.FaceSDKManager;
-import com.baidu.idl.face.platform.FaceStatusEnum;
-import com.baidu.idl.face.platform.LivenessTypeEnum;
-import com.baidu.idl.face.platform.ui.R;
-import com.common.LogUtil;
-import com.common.config.BaseConfig;
-import com.common.data.JSONUtil;
-import com.me.network.app.http.HttpClient;
-import com.me.network.app.http.Method;
-import com.me.network.app.http.rx.Result2Listener;
-import com.me.network.app.http.rx.ResultSubscriber;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class FaceConfig {
-    public static final float VALUE_BRIGHTNESS = 40.0F;
-    public static final float VALUE_BLURNESS = 0.7F;
-    public static final float VALUE_OCCLUSION = 0.6F;
-    public static final int VALUE_HEAD_PITCH = 15;
-    public static final int VALUE_HEAD_YAW = 15;
-    public static final int VALUE_HEAD_ROLL = 15;
-    public static final int VALUE_CROP_FACE_SIZE = 400;
-    public static final int VALUE_MIN_FACE_SIZE = 120;
-    public static final float VALUE_NOT_FACE_THRESHOLD = 0.6F;
-
-    // 为了apiKey,secretKey为您调用百度人脸在线接口的,如注册,识别等。
-    // 为了的安全,建议放在您的服务端,端把人脸传给服务器,在服务端端进行人脸注册、识别放在示例里面是为了您快速看到效果
-    public static String apiKey = "8B4k81ViOG3XWAoG4dDgSB2I";
-    public static String secretKey = "hryH0Lhmmt0yvGSXTveTwcMIRCA7rfIK";
-    public static String licenseID = "UUFaceID-face-android";
-    public static String licenseFileName = "idl-license.face-android";
-    public static String accessToken;
-
-    public static void initFace(Context context) {
-        FaceSDKManager.getInstance().initialize(context, licenseID, licenseFileName);
-        com.baidu.idl.face.platform.FaceConfig config = FaceSDKManager.getInstance().getFaceConfig();
-        // SDK初始化已经设置完默认参数(推荐参数),您也根据实际需求进行数值调整
-        // 设置活体动作,通过设置list LivenessTypeEnum.Eye,LivenessTypeEnum.Mouth,LivenessTypeEnum.HeadUp,
-        // LivenessTypeEnum.HeadDown,LivenessTypeEnum.HeadLeft, LivenessTypeEnum.HeadRight,
-        // LivenessTypeEnum.HeadLeftOrRight
-
-        //活体检测内容
-        List<LivenessTypeEnum> livenessList = new ArrayList<>();
-//        livenessList.add(LivenessTypeEnum.Mouth);//张嘴
-        livenessList.add(LivenessTypeEnum.Eye);//眼
-//        livenessList.add(LivenessTypeEnum.HeadUp);
-//        livenessList.add(LivenessTypeEnum.HeadDown);
-//        livenessList.add(LivenessTypeEnum.HeadLeft);
-//        livenessList.add(LivenessTypeEnum.HeadRight);
-        config.setLivenessTypeList(livenessList);
-        // 设置 活体动作是否随机 boolean
-        config.setLivenessRandom(true);
-        config.setLivenessRandomCount(Math.min(livenessList.size(), 2));
-        // 模糊度范围 (0-1) 推荐小于0.7
-        config.setBlurnessValue(VALUE_BLURNESS);
-        // 光照范围 (0-1) 推荐大于40
-        config.setBrightnessValue(VALUE_BRIGHTNESS);
-        // 裁剪人脸大小
-        config.setCropFaceValue(VALUE_CROP_FACE_SIZE);
-        // 人脸yaw,pitch,row 角度,范围(-45,45),推荐-15-15
-        config.setHeadPitchValue(VALUE_HEAD_PITCH);
-        config.setHeadRollValue(VALUE_HEAD_ROLL);
-        config.setHeadYawValue(VALUE_HEAD_YAW);
-        // 最小检测人脸(在图片人脸能够被检测到最小值)80-200, 越小越耗性能,推荐120-200
-        config.setMinFaceSize(VALUE_MIN_FACE_SIZE);
-        // 人脸置信度(0-1)推荐大于0.6
-        config.setNotFaceValue(VALUE_NOT_FACE_THRESHOLD);
-        // 人脸遮挡范围 (0-1) 推荐小于0.5
-        config.setOcclusionValue(VALUE_OCCLUSION);
-        // 是否进行质量检测
-        config.setCheckFaceQuality(false);
-        // 人脸检测使用线程数
-        config.setFaceDecodeNumberOfThreads(2);
-        // 是否开启提示音
-        config.setSound(false);
-
-        FaceSDKManager.getInstance().setFaceConfig(config);
-
-    }
-
-
-    public static void loadToken(FaceTokenListener mFaceTokenListener) {
-        if (mFaceTokenListener != null) {
-            if (!TextUtils.isEmpty(accessToken)) {
-                mFaceTokenListener.callBack(accessToken);
-            } else {
-                initToken(mFaceTokenListener);
-            }
-        }
-    }
-
-    public static void initToken(final FaceTokenListener mFaceTokenListener) {
-        HttpClient httpClient = new HttpClient.Builder("https://aip.baidubce.com/").isDebug(BaseConfig.isDebug())
-                .connectTimeout(5000)
-                .readTimeout(5000).build();
-        httpClient.Api().get(new HttpClient.Builder()
-                .add("grant_type", "client_credentials")
-                .add("client_id", apiKey)
-                .method(Method.GET)
-                .url("oauth/2.0/token")
-                .add("client_secret", secretKey).build(), new ResultSubscriber<>(new Result2Listener<Object>() {
-            @Override
-            public void onResponse(Object o) {
-                LogUtil.i("gong", "initToken onResponse=" + o.toString());
-                try {
-                    String message = o.toString();
-                    accessToken = JSONUtil.getText(message, "access_token");
-                    if (mFaceTokenListener != null) {
-                        mFaceTokenListener.callBack(accessToken);
-                    }
-                } catch (Exception e) {
-
-                }
-            }
-
-            @Override
-            public void onFailure(Object t) {
-                LogUtil.i("gong", "initToken onFailure=" + t.toString());
-            }
-        }));
-    }
-
-
-    public interface FaceTokenListener {
-        void callBack(String accessToken);
-    }
-
-
-    public static void initializeResId() {
-
-        // Sound Res Id
-        FaceEnvironment.setSoundId(FaceStatusEnum.Detect_NoFace, R.raw.detect_face_in);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Detect_FacePointOut, R.raw.detect_face_in);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_Eye, R.raw.liveness_eye);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_Mouth, R.raw.liveness_mouth);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_HeadUp, R.raw.liveness_head_up);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_HeadDown, R.raw.liveness_head_down);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_HeadLeft, R.raw.liveness_head_left);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_HeadRight, R.raw.liveness_head_right);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_HeadLeftRight, R.raw.liveness_head_left_right);
-        FaceEnvironment.setSoundId(FaceStatusEnum.Liveness_OK, R.raw.face_good);
-        FaceEnvironment.setSoundId(FaceStatusEnum.OK, R.raw.face_good);
-
-        // Tips Res Id
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_NoFace, R.string.detect_no_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_FacePointOut, R.string.detect_face_in);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_PoorIllumintion, R.string.detect_low_light);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_ImageBlured, R.string.detect_keep);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccLeftEye, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccRightEye, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccNose, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccMouth, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccLeftContour, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccRightContour, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_OccChin, R.string.detect_occ_face);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_PitchOutOfUpMaxRange, R.string.detect_head_down);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_PitchOutOfDownMaxRange, R.string.detect_head_up);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_PitchOutOfLeftMaxRange, R.string.detect_head_right);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_PitchOutOfRightMaxRange, R.string.detect_head_left);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_FaceZoomIn, R.string.detect_zoom_in);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Detect_FaceZoomOut, R.string.detect_zoom_out);
-
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_Eye, R.string.liveness_eye);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_Mouth, R.string.liveness_mouth);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_HeadUp, R.string.liveness_head_up);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_HeadDown, R.string.liveness_head_down);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_HeadLeft, R.string.liveness_head_left);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_HeadRight, R.string.liveness_head_right);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_HeadLeftRight, R.string.liveness_head_left_right);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Liveness_OK, R.string.liveness_good);
-        FaceEnvironment.setTipsId(FaceStatusEnum.OK, R.string.liveness_good);
-
-        FaceEnvironment.setTipsId(FaceStatusEnum.Error_Timeout, R.string.detect_timeout);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Error_DetectTimeout, R.string.detect_timeout);
-        FaceEnvironment.setTipsId(FaceStatusEnum.Error_LivenessTimeout, R.string.detect_timeout);
-    }
-
-}

+ 0 - 54
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/model/FaceVerify.java

@@ -1,54 +0,0 @@
-package com.baidu.idl.face.platform.ui.model;
-
-public class FaceVerify {
-    private final int SCORE_PASS = 85;
-
-    private String mpbBase64;
-    private String userId;
-    private String groupId;
-    private String userInfo;
-    private float score;
-
-    public String getMpbBase64() {
-        return mpbBase64;
-    }
-
-    public void setMpbBase64(String mpbBase64) {
-        this.mpbBase64 = mpbBase64;
-    }
-
-    public boolean isPass(){
-        return score>=SCORE_PASS;
-    }
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    public String getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    public String getUserInfo() {
-        return userInfo;
-    }
-
-    public void setUserInfo(String userInfo) {
-        this.userInfo = userInfo;
-    }
-
-    public float getScore() {
-        return score;
-    }
-
-    public void setScore(float score) {
-        this.score = score;
-    }
-}

+ 0 - 89
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/Base64.java

@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-/**
- * Created by wangtianfei01 on 17/4/6.
- */
-
-public class Base64 {
-
-    private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
-            .toCharArray();
-    private static byte[] codes = new byte[256];
-
-    public static char[] encode(byte[] data) {
-        char[] out = new char[((data.length + 2) / 3) * 4];
-        for (int i = 0, index = 0; i < data.length; i += 3, index += 4) {
-            boolean quad = false;
-            boolean trip = false;
-            int val = (0xFF & (int) data[i]);
-            val <<= 8;
-            if ((i + 1) < data.length) {
-                val |= (0xFF & (int) data[i + 1]);
-                trip = true;
-            }
-            val <<= 8;
-            if ((i + 2) < data.length) {
-                val |= (0xFF & (int) data[i + 2]);
-                quad = true;
-            }
-            out[index + 3] = alphabet[(quad ? (val & 0x3F) : 64)];
-            val >>= 6;
-            out[index + 2] = alphabet[(trip ? (val & 0x3F) : 64)];
-            val >>= 6;
-            out[index + 1] = alphabet[val & 0x3F];
-            val >>= 6;
-            out[index + 0] = alphabet[val & 0x3F];
-        }
-        return out;
-    }
-
-    public static byte[] decode(char[] data) {
-        int len = ((data.length + 3) / 4) * 3;
-        if (data.length > 0 && data[data.length - 1] == '=') {
-            --len;
-        }
-        if (data.length > 1 && data[data.length - 2] == '=') {
-            --len;
-        }
-        byte[] out = new byte[len];
-        int shift = 0;
-        int accum = 0;
-        int index = 0;
-        for (int ix = 0; ix < data.length; ix++) {
-            int value = codes[data[ix] & 0xFF];
-            if (value >= 0) {
-                accum <<= 6;
-                shift += 6;
-                accum |= value;
-                if (shift >= 8) {
-                    shift -= 8;
-                    out[index++] = (byte) ((accum >> shift) & 0xff);
-                }
-            }
-        }
-        if (index != out.length) {
-            throw new Error("miscalculated data length!");
-        }
-        return out;
-    }
-
-    static {
-        for (int i = 0; i < 256; i++) {
-            codes[i] = -1;
-        }
-        for (int i = 'A'; i <= 'Z'; i++) {
-            codes[i] = (byte) (i - 'A');
-        }
-        for (int i = 'a'; i <= 'z'; i++) {
-            codes[i] = (byte) (26 + i - 'a');
-        }
-        for (int i = '0'; i <= '9'; i++) {
-            codes[i] = (byte) (52 + i - '0');
-        }
-        codes['+'] = 62;
-        codes['/'] = 63;
-    }
-}

+ 0 - 123
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/BrightnessTools.java

@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-
-import android.app.Activity;
-import android.content.ContentResolver;
-import android.net.Uri;
-import android.provider.Settings;
-import android.provider.Settings.SettingNotFoundException;
-import android.util.Log;
-import android.view.WindowManager;
-
-
-public class BrightnessTools {
-
-    /**
-     * 判断是否开启了自动亮度调节
-     */
-
-    public static boolean isAutoBrightness(ContentResolver aContentResolver) {
-        boolean automicBrightness = false;
-        try {
-            automicBrightness = Settings.System.getInt(aContentResolver,
-                    Settings.System.SCREEN_BRIGHTNESS_MODE) == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
-        } catch (SettingNotFoundException e) {
-            e.printStackTrace();
-        }
-        return automicBrightness;
-    }
-
-    /**
-     * 获取屏幕的亮度
-     *
-     * @param activity
-     * @return
-     */
-    public static int getScreenBrightness(Activity activity) {
-        int nowBrightnessValue = 0;
-        ContentResolver resolver = activity.getContentResolver();
-        try {
-            nowBrightnessValue = Settings.System.getInt(
-                    resolver, Settings.System.SCREEN_BRIGHTNESS);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return nowBrightnessValue;
-    }
-
-    /**
-     * 设置亮度
-     *
-     * @param activity
-     * @param brightness
-     */
-    public static void setBrightness(Activity activity, int brightness) {
-        // Settings.System.putInt(activity.getContentResolver(),
-
-        // Settings.System.SCREEN_BRIGHTNESS_MODE,
-
-        // Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
-
-        WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
-
-        lp.screenBrightness = Float.valueOf(brightness) * (1f / 255f);
-        Log.d("lxy", "set  lp.screenBrightness == " + lp.screenBrightness);
-
-        activity.getWindow().setAttributes(lp);
-    }
-
-    // 那么,能设置了,但是为什么还是会出现,设置了,没反映呢?
-
-    // 嘿嘿,那是因为,开启了自动调节功能了,那如何关闭呢?这才是最重要的:
-
-    /**
-     * 停止自动亮度调节
-     *
-     * @param activity
-     */
-    public static void stopAutoBrightness(Activity activity) {
-
-        Settings.System.putInt(activity.getContentResolver(),
-
-                Settings.System.SCREEN_BRIGHTNESS_MODE,
-
-                Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
-    }
-
-
-    /**
-     * 开启亮度自动调节
-     *
-     * @param activity
-     */
-    public static void startAutoBrightness(Activity activity) {
-
-        Settings.System.putInt(activity.getContentResolver(),
-
-                Settings.System.SCREEN_BRIGHTNESS_MODE,
-
-                Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC);
-    }
-
-    // 至此,应该说操作亮度的差不多都有了,结束!
-    // 哎,本来认为是应该结束了,但是悲剧得是,既然像刚才那样设置的话,只能在当前的activity中有作用,一段退出的时候,会发现毫无作用,悲剧,原来是忘记了保存了。汗!
-
-    /**
-     * 保存亮度设置状态
-     *
-     * @param resolver
-     * @param brightness
-     */
-    public static void saveBrightness(ContentResolver resolver, int brightness) {
-        Uri uri = Settings.System
-                .getUriFor("screen_brightness");
-
-        Settings.System.putInt(resolver, "screen_brightness",
-                brightness);
-        // resolver.registerContentObserver(uri, true, myContentObserver);
-        resolver.notifyChange(uri, null);
-    }
-}

+ 0 - 25
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/CameraUtils.java

@@ -1,25 +0,0 @@
-/**
- * Copyright (C) 2017 Baidu Inc. All rights reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-import android.hardware.Camera;
-
-/**
- * CameraUtils
- */
-public class CameraUtils {
-
-    public static final String TAG = CameraUtils.class.getSimpleName();
-
-    public static void releaseCamera(Camera camera) {
-        try {
-            camera.release();
-        } catch (RuntimeException e2) {
-            e2.printStackTrace();
-        } catch (Exception e1) {
-            e1.printStackTrace();
-        } finally {
-        }
-    }
-}

+ 0 - 130
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/DeviceUuidFactory.java

@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.Environment;
-import android.provider.Settings;
-import android.telephony.TelephonyManager;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.UUID;
-
-/**
- * Created by wangtianfei01 on 17/4/6.
- */
-
-public class DeviceUuidFactory {
-    protected static final String PREFS_FILE = "dev_id.xml";
-    protected static final String DEVICE_UUID_FILE_NAME = ".dev_id.txt";
-    protected static final String PREFS_DEVICE_ID = "dev_id";
-    protected static final String KEY = "cyril'98";
-    protected static UUID uuid;
-
-    public static String init(Context context) {
-        if (uuid == null) {
-            synchronized (DeviceUuidFactory.class) {
-                if (uuid == null) {
-                    final SharedPreferences prefs = context.getSharedPreferences(PREFS_FILE, 0);
-                    final String id = prefs.getString(PREFS_DEVICE_ID, null);
-                    if (id != null) {
-                        uuid = UUID.fromString(id);
-                    } else {
-                        if (recoverDeviceUuidFromSD() != null) {
-                            uuid = UUID.fromString(recoverDeviceUuidFromSD());
-                        } else {
-                            final String androidId =
-                                    Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
-                            try {
-                                if (!"9774d56d682e549c".equals(androidId)) {
-                                    uuid = UUID.nameUUIDFromBytes(androidId.getBytes("utf8"));
-                                    try {
-                                        saveDeviceUuidToSD(EncryptUtils.encryptDES(uuid.toString(), KEY));
-                                    } catch (Exception e) {
-                                        e.printStackTrace();
-                                    }
-                                } else {
-                                    @SuppressLint("MissingPermission") String deviceId = ((TelephonyManager) context
-                                            .getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
-                                    uuid = deviceId != null ? UUID.nameUUIDFromBytes(deviceId.getBytes("utf8")) :
-                                            UUID.randomUUID();
-                                    try {
-                                        saveDeviceUuidToSD(EncryptUtils.encryptDES(uuid.toString(), KEY));
-                                    } catch (Exception e) {
-                                        e.printStackTrace();
-                                    }
-                                }
-                            } catch (UnsupportedEncodingException e) {
-                                throw new RuntimeException(e);
-                            }
-                        }
-                        prefs.edit().putString(PREFS_DEVICE_ID, uuid.toString()).commit();
-                    }
-                }
-            }
-        }
-        return uuid.toString();
-    }
-
-    private static String recoverDeviceUuidFromSD() {
-        try {
-            String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath();
-            File dir = new File(dirPath);
-            File uuidFile = new File(dir, DEVICE_UUID_FILE_NAME);
-            if (!dir.exists() || !uuidFile.exists()) {
-                return null;
-            }
-            FileReader fileReader = new FileReader(uuidFile);
-            StringBuilder sb = new StringBuilder();
-            char[] buffer = new char[100];
-            int readCount;
-            while ((readCount = fileReader.read(buffer)) > 0) {
-                sb.append(buffer, 0, readCount);
-            }
-            // 通过UUID.fromString来检查uuid的格式正确性
-            UUID uuid = UUID.fromString(EncryptUtils.decryptDES(sb.toString(), KEY));
-            return uuid.toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    private static void saveDeviceUuidToSD(String uuid) {
-        String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath();
-        File targetFile = new File(dirPath, DEVICE_UUID_FILE_NAME);
-        if (targetFile != null) {
-            if (targetFile.exists()) {
-                OutputStreamWriter osw;
-                try {
-                    osw = new OutputStreamWriter(new FileOutputStream(targetFile), "utf-8");
-                    try {
-                        osw.write(uuid);
-                        osw.flush();
-                        osw.close();
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                } catch (UnsupportedEncodingException e) {
-                    e.printStackTrace();
-                } catch (FileNotFoundException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-    }
-
-    public static UUID getUuid() {
-        return uuid;
-    }
-}

+ 0 - 50
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/EncryptUtils.java

@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.DESKeySpec;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
-
-/**
- * Created by wangtianfei01 on 17/4/6.
- */
-
-public class EncryptUtils {
-    public static String encryptDES(String encryptString, String encryptKey) throws Exception {
-        // 返回实现指定转换的Cipher对象 "算法/模式/填充"
-        Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
-        // 创建一个DESKeySpec对象,使用8个字节的key作为DES密钥的内容
-        DESKeySpec desKeySpec = new DESKeySpec(encryptKey.getBytes("UTF-8"));
-        // 返回转换指定算法的秘密密钥的SecretKeyFactory对象
-        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
-        // 根据提供的密钥生成SecretKey对象
-        SecretKey secretKey = keyFactory.generateSecret(desKeySpec);
-        // 使用iv中的字节作为iv来构造一个iv ParameterSpec对象。复制该缓冲区的内容来防止后续修改
-        IvParameterSpec iv = new IvParameterSpec(encryptKey.getBytes());
-        // 用密钥和一组算法参数初始化此 Cipher;Cipher:加密、解密、密钥包装或密钥解包,具体取决于 opmode 的值。
-        cipher.init(Cipher.ENCRYPT_MODE, secretKey, iv);
-        // 加密同时解码成字符串返回
-        return new String(Base64.encode(cipher.doFinal(encryptString.getBytes("UTF-8"))));
-    }
-
-    public static String decryptDES(String decodeString, String decodeKey) throws Exception {
-        // 使用指定密钥构造IV
-        IvParameterSpec iv = new IvParameterSpec(decodeKey.getBytes());
-        // 根据给定的字节数组和指定算法构造一个密钥。
-        SecretKeySpec skeySpec = new SecretKeySpec(decodeKey.getBytes(), "DES");
-        // 返回实现指定转换的 Cipher 对象
-        Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
-        // 解密初始化
-        cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
-        // 解码返回
-        byte[] byteMi = Base64.decode(decodeString.toCharArray());
-        byte[] decryptedData = cipher.doFinal(byteMi);
-        return new String(decryptedData);
-    }
-}

+ 0 - 68
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/utils/VolumeUtils.java

@@ -1,68 +0,0 @@
-/**
- * Copyright (C) 2017 Baidu Inc. All rights reserved.
- */
-package com.baidu.idl.face.platform.ui.utils;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.util.Log;
-
-/**
- * VolumeUtils
- * 描述:系统音量监听
- */
-public class VolumeUtils {
-
-    public static final String TAG = VolumeUtils.class.getSimpleName();
-
-    public interface VolumeCallback {
-        void volumeChanged();
-    }
-
-    public static class VolumeReceiver extends BroadcastReceiver {
-
-        private VolumeCallback callback;
-
-        public VolumeReceiver(VolumeCallback cb) {
-            callback = cb;
-        }
-
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            if (intent.getAction().equals("android.media.VOLUME_CHANGED_ACTION")
-                    && callback != null) {
-                Log.e(TAG, "android.media.VOLUME_CHANGED_ACTION");
-                callback.volumeChanged();
-            }
-        }
-    }
-
-    public static BroadcastReceiver registerVolumeReceiver(Context context, VolumeCallback callback) {
-        VolumeReceiver mVolumeReceiver = null;
-        try {
-            mVolumeReceiver = new VolumeReceiver(callback);
-            IntentFilter filter = new IntentFilter();
-            filter.addAction("android.media.VOLUME_CHANGED_ACTION");
-            context.registerReceiver(mVolumeReceiver, filter);
-        } catch (IllegalArgumentException ex1) {
-            ex1.printStackTrace();
-        } catch (Exception ex2) {
-            ex2.printStackTrace();
-        }
-        return mVolumeReceiver;
-    }
-
-    public static void unRegisterVolumeReceiver(Context context, BroadcastReceiver receiver) {
-        try {
-            if (context != null && receiver != null) {
-                context.unregisterReceiver(receiver);
-            }
-        } catch (IllegalArgumentException ex1) {
-            ex1.printStackTrace();
-        } catch (Exception ex2) {
-            ex2.printStackTrace();
-        }
-    }
-}

+ 0 - 237
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/FaceDetectRoundView.java

@@ -1,237 +0,0 @@
-/**
- * Copyright (C) 2017 Baidu Inc. All rights reserved.
- */
-package com.baidu.idl.face.platform.ui.widget;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
-import android.graphics.Rect;
-import android.graphics.RectF;
-import android.graphics.Typeface;
-import android.text.TextUtils;
-import android.util.AttributeSet;
-import android.view.View;
-
-import com.baidu.idl.face.platform.ui.R;
-import com.baidu.idl.face.platform.utils.DensityUtils;
-import com.common.system.DisplayUtil;
-
-/**
- * 人脸检测区域View
- */
-public class FaceDetectRoundView extends View {
-
-    public static final float SURFACE_HEIGHT = 1000f;
-    public static final float SURFACE_RATIO = 0.75f;
-    public static final float WIDTH_SPACE_RATIO = 0.33f;
-    public static final float HEIGHT_RATIO = 0.1f;
-    public static final float HEIGHT_EXT_RATIO = 0.2f;
-    public static final int CIRCLE_SPACE = 2;
-    public static final int PATH_SPACE = 16;
-    public static final int PATH_SMALL_SPACE = 12;
-    public static final int PATH_WIDTH = 6;
-
-    public final int COLOR_BG = Color.parseColor("#FFFFFF");
-    public final int COLOR_RECT = COLOR_BG;
-    public final int COLOR_ROUND = Color.parseColor("#DCDCDC");
-    public final int COLOR_ROUND_PASS = Color.parseColor("#10B0D9");
-
-
-    private Paint mBGPaint;//全局背景
-    private Paint mPathPaint;//扫描区外框,就是那个圈外面的
-    private Paint mFaceRoundPaint;
-
-    private Paint mTextTopPaint;//画上面的提示语
-    private Paint mTextBottomPaint;//画下面的提示语
-    private Paint mTextTipPaint;//画提示语
-    private Paint mArcTipPaint;//画提示语的背景
-
-    private RectF mOvalRect;
-    private Rect mFaceRect;
-    private Rect mFaceDetectRect;
-
-    private float mX;//原点
-    private float mY;//原点
-    private float mR;//半径
-    private boolean mIsSuccess = false;
-
-    private float mTipY;
-    private float mTipX;
-    private String mTipMessage;
-    private float mTopTextX;//
-    private float mTopTextY;//
-    private float mBottomTextX;//
-    private float mBottomTextY;//
-    private final Bitmap mSuccessBitmap;
-
-    public FaceDetectRoundView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        setLayerType(View.LAYER_TYPE_SOFTWARE, null);
-        float pathWidth = DensityUtils.dip2px(context, PATH_WIDTH);
-
-        mBGPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-        mBGPaint.setColor(COLOR_BG);
-        mBGPaint.setStyle(Paint.Style.STROKE);
-        mBGPaint.setAntiAlias(true);
-        mBGPaint.setDither(true);
-
-        mPathPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-        mPathPaint.setColor(COLOR_ROUND);
-        mPathPaint.setStrokeWidth(pathWidth);
-        mPathPaint.setStyle(Paint.Style.STROKE);
-        mPathPaint.setAntiAlias(true);
-        mPathPaint.setDither(true);
-
-
-        mFaceRoundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-        mFaceRoundPaint.setColor(COLOR_ROUND);
-        mFaceRoundPaint.setStyle(Paint.Style.FILL);
-        mFaceRoundPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
-        mFaceRoundPaint.setAntiAlias(true);
-        mFaceRoundPaint.setDither(true);
-
-
-        mTextBottomPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
-        mTextBottomPaint.setColor(Color.parseColor("#FF10B0D9"));
-        mTextBottomPaint.setTextSize(DensityUtils.dip2px(context, 17));
-
-        mTextTopPaint = new Paint(mTextBottomPaint);
-        mTextTopPaint.setColor(Color.parseColor("#FF616161"));
-        mTextTopPaint.setTypeface(Typeface.DEFAULT_BOLD);
-        mTextTopPaint.setTextSize(DensityUtils.dip2px(context, 20));
-
-        mTextTipPaint = new Paint(mTextBottomPaint);
-        mTextTipPaint.setColor(Color.WHITE);
-        mTextTipPaint.setTextSize(DensityUtils.dip2px(context, 12));
-
-        mArcTipPaint = new Paint();
-        mArcTipPaint.setColor(Color.parseColor("#646464"));
-        mArcTipPaint.setColor(Color.BLACK);
-        mArcTipPaint.setAntiAlias(true);//取消锯齿
-        mArcTipPaint.setStyle(Paint.Style.FILL);//设置画圆弧的画笔的属性为描边(空心),个人喜欢叫它描边,叫空心有点会引起歧义
-        mArcTipPaint.setStrokeWidth(pathWidth);
-
-        mSuccessBitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_success);
-
-    }
-
-
-    public void onRefreshTipsView(String message) {
-        mTipMessage=message;
-        if (!TextUtils.isEmpty(message)) {
-            if (mTipY == 0) {
-                float mTipHeight = mTextTipPaint.getFontMetrics().top - mTextTipPaint.getFontMetrics().bottom + DensityUtils.dip2px(getContext(), 10);
-                mTipY = (mY - mR) + mTipHeight + DisplayUtil.dip2px(getContext(), 40);
-            }
-            float mTipWidth = mTextTipPaint.measureText(message);
-            mTipX = mX - mTipWidth / 2;
-            postInvalidate();
-        }
-    }
-
-    public void onRefreshSuccessView(boolean mIsSuccess) {
-        this.mIsSuccess = mIsSuccess;
-        mPathPaint.setColor(mIsSuccess ? COLOR_ROUND_PASS : COLOR_ROUND);
-        postInvalidate();
-    }
-
-    public void processDrawState(boolean isDrawDash) {
-        onRefreshSuccessView(isDrawDash);
-    }
-
-    public float getRound() {
-        return mR;
-    }
-
-    public Rect getFaceRoundRect() {
-        return mFaceRect;
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        float canvasWidth = right - left;
-        float canvasHeight = bottom - top;
-
-        float x = canvasWidth / 2;
-        float y = (canvasHeight / 2) - ((canvasHeight / 2) * HEIGHT_RATIO);
-        float r = (canvasWidth / 2) - ((canvasWidth / 2) * WIDTH_SPACE_RATIO);
-        if (mFaceRect == null) {
-            mFaceRect = new Rect((int) (x - r),
-                    (int) (y - r),
-                    (int) (x + r),
-                    (int) (y + r));
-        }
-        if (mFaceDetectRect == null) {
-            float hr = r + (r * HEIGHT_EXT_RATIO);
-            mFaceDetectRect = new Rect((int) (x - r),
-                    (int) (y - hr),
-                    (int) (x + r),
-                    (int) (y + hr));
-        }
-
-        if (mOvalRect == null) {
-            mOvalRect = new RectF(mX - mR, mY - mR,
-                    mX + mR, mY + mR);
-        }
-
-        mX = x;
-        mY = y;
-        mR = r;
-        mBGPaint.setStrokeWidth((top - bottom) / 2 - mR);
-
-        mTopTextX = mX - mTextTopPaint.measureText("赏个脸呗") / 2;
-        mTopTextY = mY - mR - DensityUtils.dip2px(getContext(), 20);
-        mBottomTextX = mX - mTextBottomPaint.measureText("拿起手机,眨眨眼") / 2;
-        mBottomTextY = mY + mR + DensityUtils.dip2px(getContext(), 40);
-
-
-    }
-
-    @Override
-    public void onDraw(Canvas canvas) {
-        super.onDraw(canvas);
-        //画背景
-//        canvas.drawColor(Color.WHITE);
-//        canvas.drawARGB();
-        canvas.drawPaint(mBGPaint);
-//        canvas.drawCircle(mX, mY, getHeight() / 2, mBGPaint);
-        //画外框
-        canvas.drawCircle(mX, mY, mR - CIRCLE_SPACE + mPathPaint.getStrokeWidth(), mPathPaint);
-        canvas.drawCircle(mX, mY, mR, mFaceRoundPaint);
-
-        //画文字
-        canvas.drawText("赏个脸呗!", mTopTextX, mTopTextY, mTextTopPaint);
-        canvas.drawText("拿起手机,眨眨眼", mBottomTextX, mBottomTextY, mTextBottomPaint);
-
-        //画提示语
-//        canvas.drawArc(new RectF(mX, mY, 200, 200), -90, 120, true, mArcTipPaint);
-        if (!TextUtils.isEmpty(mTipMessage)){
-            canvas.drawText(mTipMessage, mTipX,mTipY,mTextTipPaint);
-        }
-        //画成功标识
-        if (mIsSuccess) {
-            canvas.drawBitmap(mSuccessBitmap, mX - mSuccessBitmap.getWidth() / 2, mY - mSuccessBitmap.getHeight() / 2, mPathPaint);
-        }
-    }
-
-
-    public static Rect getPreviewDetectRect(int w, int pw, int ph) {
-        float round = (w / 2) - ((w / 2) * WIDTH_SPACE_RATIO);
-        float x = pw / 2;
-        float y = (ph / 2) - ((ph / 2) * HEIGHT_RATIO);
-        float r = (pw / 2) > round ? round : (pw / 2);
-        float hr = r + (r * HEIGHT_EXT_RATIO);
-        Rect rect = new Rect((int) (x - r),
-                (int) (y - hr),
-                (int) (x + r),
-                (int) (y + hr));
-        return rect;
-    }
-
-}

+ 0 - 20
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/FaceRoundView.java

@@ -1,20 +0,0 @@
-package com.baidu.idl.face.platform.ui.widget;
-
-import android.content.Context;
-import android.support.annotation.Nullable;
-import android.util.AttributeSet;
-import android.view.View;
-
-public class FaceRoundView extends View {
-    public FaceRoundView(Context context) {
-        super(context);
-    }
-
-    public FaceRoundView(Context context, @Nullable AttributeSet attrs) {
-        super(context, attrs);
-    }
-
-    public FaceRoundView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
-        super(context, attrs, defStyleAttr);
-    }
-}

+ 0 - 86
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/WaveHelper.java

@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.widget;
-
-import android.animation.Animator;
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-import android.animation.ValueAnimator;
-import android.view.animation.DecelerateInterpolator;
-import android.view.animation.LinearInterpolator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 人脸识别登录波纹动画
- *
- * @author liujinhui
- * @date 2017/11/28
- */
-
-public class WaveHelper {
-    private WaveView mWaveView;
-    private AnimatorSet mAnimatorSet;
-
-    /**
-     * 构造
-     *
-     * @param waveView
-     */
-    public WaveHelper(WaveView waveView) {
-        mWaveView = waveView;
-        initAnimation();
-    }
-
-    /**
-     * 动画开始
-     */
-    public void start() {
-        mWaveView.setShowWave(true);
-        if (mAnimatorSet != null) {
-            mAnimatorSet.start();
-        }
-    }
-
-    /**
-     * 动画初始化
-     */
-    private void initAnimation() {
-        List<Animator> animators = new ArrayList<>();
-
-        ObjectAnimator waveShiftAnim = ObjectAnimator.ofFloat(
-                mWaveView, "waveShiftRatio", 0f, 1f);
-        waveShiftAnim.setRepeatCount(ValueAnimator.INFINITE);
-        waveShiftAnim.setDuration(500);
-        waveShiftAnim.setInterpolator(new LinearInterpolator());
-        animators.add(waveShiftAnim);
-
-        ObjectAnimator waterLevelAnim = ObjectAnimator.ofFloat(
-                mWaveView, "waterLevelRatio", 0.25f, 0.25f);
-        waterLevelAnim.setDuration(1000);
-        waterLevelAnim.setInterpolator(new DecelerateInterpolator());
-        animators.add(waterLevelAnim);
-
-        ObjectAnimator amplitudeAnim = ObjectAnimator.ofFloat(
-                mWaveView, "amplitudeRatio", 0.05f, 0.05f);
-        amplitudeAnim.setRepeatCount(ValueAnimator.REVERSE);
-        amplitudeAnim.setRepeatMode(ValueAnimator.REVERSE);
-        amplitudeAnim.setDuration(1000);
-        amplitudeAnim.setInterpolator(new LinearInterpolator());
-        animators.add(amplitudeAnim);
-
-        mAnimatorSet = new AnimatorSet();
-        mAnimatorSet.playTogether(animators);
-    }
-
-    /**
-     * 动画取消
-     */
-    public void cancel() {
-        if (mAnimatorSet != null) {
-            mAnimatorSet.end();
-        }
-    }
-}

+ 0 - 334
app_modular/faceplatform-ui/src/main/java/com/baidu/idl/face/platform/ui/widget/WaveView.java

@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2017 Baidu, Inc. All Rights Reserved.
- */
-package com.baidu.idl.face.platform.ui.widget;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapShader;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Matrix;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.graphics.Shader;
-import android.util.AttributeSet;
-import android.view.View;
-
-/**
- * sin函数绘制人脸识别登录波浪纹
- *
- * @author liujinhui
- * @date 2017/11/28
- */
-
-public class WaveView extends View {
-
-    private static final float DEFAULT_AMPLITUDE_RATIO = 0.05f;
-    private static final float DEFAULT_WATER_LEVEL_RATIO = 0.5f;
-    private static final float DEFAULT_WAVE_LENGTH_RATIO = 1.0f;
-    private static final float DEFAULT_WAVE_SHIFT_RATIO = 0.0f;
-    private static final int DEFAULT_STROKE_WIDTH = 2;
-
-    private static final int DEFAULT_BEHIND_WAVE_COLOR = Color.parseColor("#28FFFFFF");
-    private static final int DEFAULT_FRONT_WAVE_COLOR = Color.parseColor("#3CFFFFFF");
-    private static final ShapeType DEFAULT_WAVE_SHAPE = ShapeType.CIRCLE;
-
-    private boolean mShowWave;
-    private BitmapShader mWaveShader;
-    private Matrix mShaderMatrix;
-    private Paint mViewPaint;
-    private Paint mBorderPaint;
-    private float mDefaultAmplitude;
-    private float mDefaultWaterLevel;
-    private float mDefaultWaveLength;
-    private double mDefaultAngularFrequency;
-    private float mAmplitudeRatio = DEFAULT_AMPLITUDE_RATIO;
-    private float mWaveLengthRatio = DEFAULT_WAVE_LENGTH_RATIO;
-    private float mWaterLevelRatio = DEFAULT_WATER_LEVEL_RATIO;
-    private float mWaveShiftRatio = DEFAULT_WAVE_SHIFT_RATIO;
-
-    private int mBehindWaveColor = DEFAULT_BEHIND_WAVE_COLOR;
-    private int mFrontWaveColor = DEFAULT_FRONT_WAVE_COLOR;
-    private ShapeType mShapeType = DEFAULT_WAVE_SHAPE;
-
-    public enum ShapeType {
-        CIRCLE,
-        SQUARE
-    }
-
-    public WaveView(Context context) {
-        super(context);
-        init();
-    }
-
-    public WaveView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        init();
-    }
-
-    public WaveView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        init();
-    }
-
-    /**
-     * 初始化
-     */
-    private void init() {
-        mShaderMatrix = new Matrix();
-        mViewPaint = new Paint();
-        mViewPaint.setAntiAlias(true);
-    }
-
-    /**
-     * 获取波纹摆动频率 (0-1,默认为0)
-     *
-     * @return
-     */
-    public float getWaveShiftRatio() {
-        return mWaveShiftRatio;
-    }
-
-    /**
-     * 设置波纹水平摆动频率
-     *
-     * @param waveShiftRatio (0-1,默认为0)
-     */
-    public void setWaveShiftRatio(float waveShiftRatio) {
-        if (mWaveShiftRatio != waveShiftRatio) {
-            mWaveShiftRatio = waveShiftRatio;
-            invalidate();
-        }
-    }
-
-    /**
-     * 获取波纹垂直摆动频率(0-1,默认为0.5)
-     *
-     * @return
-     */
-    public float getWaterLevelRatio() {
-        return mWaterLevelRatio;
-    }
-
-    /**
-     * 设置波纹垂直摆动频率 (0-1,默认为0.5)
-     *
-     * @param waterLevelRatio
-     */
-    public void setWaterLevelRatio(float waterLevelRatio) {
-        if (mWaterLevelRatio != waterLevelRatio) {
-            mWaterLevelRatio = waterLevelRatio;
-            invalidate();
-        }
-    }
-
-    /**
-     * 获取波纹振幅频率(0-1之间)
-     *
-     * @return
-     */
-    public float getAmplitudeRatio() {
-        return mAmplitudeRatio;
-    }
-
-    /**
-     * 设置波纹振幅频率(0-1之间)
-     *
-     * @param amplitudeRatio
-     */
-    public void setAmplitudeRatio(float amplitudeRatio) {
-        if (mAmplitudeRatio != amplitudeRatio) {
-            mAmplitudeRatio = amplitudeRatio;
-            invalidate();
-        }
-    }
-
-    /**
-     * 获取波纹水平方向的长度比率(0-1之间)
-     *
-     * @return
-     */
-    public float getWaveLengthRatio() {
-        return mWaveLengthRatio;
-    }
-
-    /**
-     * 设置波纹水平方向的长度比率 (0-1之间)
-     *
-     * @param waveLengthRatio
-     */
-    public void setWaveLengthRatio(float waveLengthRatio) {
-        mWaveLengthRatio = waveLengthRatio;
-    }
-
-    /**
-     * 是否显示
-     *
-     * @return
-     */
-    public boolean isShowWave() {
-        return mShowWave;
-    }
-
-    /**
-     * 设置是否显示
-     *
-     * @param showWave
-     */
-    public void setShowWave(boolean showWave) {
-        mShowWave = showWave;
-    }
-
-    /**
-     * 设置圆形或矩形外框边界
-     *
-     * @param width
-     * @param color
-     */
-    public void setBorder(int width, int color) {
-        if (mBorderPaint == null) {
-            mBorderPaint = new Paint();
-            mBorderPaint.setAntiAlias(true);
-            mBorderPaint.setStyle(Style.STROKE);
-        }
-        mBorderPaint.setColor(color);
-        mBorderPaint.setStrokeWidth(width);
-
-        invalidate();
-    }
-
-    /**
-     * 设置波纹颜色
-     *
-     * @param behindWaveColor
-     * @param frontWaveColor
-     */
-    public void setWaveColor(int behindWaveColor, int frontWaveColor) {
-        mBehindWaveColor = behindWaveColor;
-        mFrontWaveColor = frontWaveColor;
-
-        if (getWidth() > 0 && getHeight() > 0) {
-            mWaveShader = null;
-            createShader();
-            invalidate();
-        }
-    }
-
-    /**
-     * 设置外框样式
-     *
-     * @param shapeType
-     */
-    public void setShapeType(ShapeType shapeType) {
-        mShapeType = shapeType;
-        invalidate();
-    }
-
-    /**
-     * 重载尺寸改变
-     *
-     * @param w
-     * @param h
-     * @param oldw
-     * @param oldh
-     */
-    @Override
-    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
-        super.onSizeChanged(w, h, oldw, oldh);
-
-        createShader();
-    }
-
-    /**
-     * 通过sin函数计算x及y的波动和振幅
-     */
-    private void createShader() {
-        mDefaultAngularFrequency = 2.0f * Math.PI / DEFAULT_WAVE_LENGTH_RATIO / getWidth();
-        mDefaultAmplitude = getHeight() * DEFAULT_AMPLITUDE_RATIO;
-        mDefaultWaterLevel = getHeight() * DEFAULT_WATER_LEVEL_RATIO;
-        mDefaultWaveLength = getWidth();
-
-        Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
-        Canvas canvas = new Canvas(bitmap);
-
-        Paint wavePaint = new Paint();
-        wavePaint.setStrokeWidth(DEFAULT_STROKE_WIDTH);
-        wavePaint.setAntiAlias(true);
-
-        // 通过sin函数计算y
-        final int endX = getWidth() + 1;
-        final int endY = getHeight() + 1;
-        float[] waveY = new float[endX];
-
-        wavePaint.setColor(mBehindWaveColor);
-        for (int beginX = 0; beginX < endX; beginX++) {
-            double wx = beginX * mDefaultAngularFrequency;
-            float beginY = (float) (mDefaultWaterLevel + mDefaultAmplitude * Math.sin(wx));
-            canvas.drawLine(beginX, beginY, beginX, endY, wavePaint);
-
-            waveY[beginX] = beginY;
-        }
-
-        wavePaint.setColor(mFrontWaveColor);
-        final int wave2Shift = (int) (mDefaultWaveLength / 4);
-        for (int beginX = 0; beginX < endX; beginX++) {
-            canvas.drawLine(beginX, waveY[(beginX + wave2Shift) % endX], beginX, endY, wavePaint);
-        }
-
-        mWaveShader = new BitmapShader(bitmap, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP);
-        mViewPaint.setShader(mWaveShader);
-    }
-
-    /**
-     * canvas绘制
-     *
-     * @param canvas
-     */
-    @Override
-    protected void onDraw(Canvas canvas) {
-        if (mShowWave && mWaveShader != null) {
-            if (mViewPaint.getShader() == null) {
-                mViewPaint.setShader(mWaveShader);
-            }
-
-            mShaderMatrix.setScale(
-                    mWaveLengthRatio / DEFAULT_WAVE_LENGTH_RATIO,
-                    mAmplitudeRatio / DEFAULT_AMPLITUDE_RATIO,
-                    0,
-                    mDefaultWaterLevel);
-
-            mShaderMatrix.postTranslate(
-                    mWaveShiftRatio * getWidth(),
-                    (DEFAULT_WATER_LEVEL_RATIO - mWaterLevelRatio) * getHeight());
-
-            mWaveShader.setLocalMatrix(mShaderMatrix);
-
-            float borderWidth = mBorderPaint == null ? 0f : mBorderPaint.getStrokeWidth();
-            switch (mShapeType) {
-                case CIRCLE:
-                    if (borderWidth > 0) {
-                        canvas.drawCircle(getWidth() / 2f, getHeight() / 2f,
-                                (getWidth() - borderWidth) / 2f - 1f, mBorderPaint);
-                    }
-                    float radius = getWidth() / 2f - borderWidth;
-                    canvas.drawCircle(getWidth() / 2f, getHeight() / 2f, radius, mViewPaint);
-                    break;
-                case SQUARE:
-                    if (borderWidth > 0) {
-                        canvas.drawRect(
-                                borderWidth / 2f,
-                                borderWidth / 2f,
-                                getWidth() - borderWidth / 2f - 0.5f,
-                                getHeight() - borderWidth / 2f - 0.5f,
-                                mBorderPaint);
-                    }
-                    canvas.drawRect(borderWidth, borderWidth, getWidth() - borderWidth,
-                            getHeight() - borderWidth, mViewPaint);
-                    break;
-            }
-        } else {
-            mViewPaint.setShader(null);
-        }
-    }
-}

BIN
app_modular/faceplatform-ui/src/main/jniLibs/arm64-v8a/libFaceSDK.so


BIN
app_modular/faceplatform-ui/src/main/jniLibs/arm64-v8a/libidl_license.so


BIN
app_modular/faceplatform-ui/src/main/jniLibs/armeabi-v7a/libFaceSDK.so


BIN
app_modular/faceplatform-ui/src/main/jniLibs/armeabi-v7a/libidl_license.so


BIN
app_modular/faceplatform-ui/src/main/jniLibs/x86/libFaceSDK.so


BIN
app_modular/faceplatform-ui/src/main/jniLibs/x86/libidl_license.so


+ 0 - 25
app_modular/faceplatform-ui/src/main/res/drawable/bg_tips.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true">
-        <shape>
-            <stroke android:width="1dp" android:color="#F6A623" />
-            <corners android:radius="18dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-    <item android:state_focused="true">
-        <shape>
-            <stroke android:width="1dp" android:color="#F6A623" />
-            <corners android:radius="18dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-    <item>
-        <shape>
-            <stroke android:width="1dp" android:color="#F6A623" />
-            <corners android:radius="18dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-</selector>  
-

+ 0 - 22
app_modular/faceplatform-ui/src/main/res/drawable/bg_tips_no.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_pressed="true">
-        <shape>
-            <corners android:radius="15dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-    <item android:state_focused="true">
-        <shape>
-            <corners android:radius="15dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-    <item>
-        <shape>
-            <corners android:radius="15dp" />
-            <solid android:color="#0000" />
-        </shape>
-    </item>
-</selector>  
-

+ 0 - 11
app_modular/faceplatform-ui/src/main/res/drawable/round_top_transparent_bg.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item>
-        <shape>
-            <solid android:color="@color/base_bg" />
-            <corners android:topRightRadius="360dp"
-                android:topLeftRadius="360dp"/>
-            <padding android:bottom="0.5dp" android:left="0.5dp" android:right="0.5dp" android:top="0.5dp" />
-        </shape>
-    </item>
-</selector>

+ 0 - 107
app_modular/faceplatform-ui/src/main/res/layout/activity_face_detect.xml

@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/detect_root_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <FrameLayout
-        android:id="@+id/detect_surface_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <SurfaceView
-            android:id="@+id/detect_surface_view"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" />
-
-        <ImageView
-            android:id="@+id/detect_surface_overlay_image"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_centerHorizontal="true"
-            android:background="@mipmap/bg_face_round" />
-    </FrameLayout>
-
-    <LinearLayout
-        android:id="@+id/detect_surface_overlay_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.8" />
-
-        <TextView
-            android:id="@+id/detect_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_above="@id/detect_surface_overlay_layout"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:gravity="center"
-            android:text="@string/detect_face_in"
-            android:textColor="#00E5EE"
-            android:textSize="16sp" />
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="3"
-            android:orientation="horizontal">
-
-            <View
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="0.05" />
-
-            <ImageView
-                android:id="@+id/detect_surface_overlay"
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_gravity="center_horizontal"
-                android:layout_weight="0.9"
-                android:background="#09ffffff"
-                android:visibility="visible" />
-
-            <View
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="0.05" />
-        </LinearLayout>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1" />
-    </LinearLayout>
-
-    <ImageView
-        android:id="@+id/detect_close"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_close" />
-
-    <ImageView
-        android:id="@+id/detect_sound"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_enable_sound" />
-
-    <HorizontalScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true">
-
-        <LinearLayout
-            android:id="@+id/detect_result_image_layout"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="horizontal"></LinearLayout>
-    </HorizontalScrollView>
-</RelativeLayout>

+ 0 - 96
app_modular/faceplatform-ui/src/main/res/layout/activity_face_detect_v3100.xml

@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/detect_root_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <FrameLayout
-        android:id="@+id/detect_surface_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-
-    <com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
-        android:id="@+id/detect_face_round"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-
-    <LinearLayout
-        android:id="@+id/detect_surface_overlay_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.15" />
-
-        <TextView
-            android:id="@+id/detect_top_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:gravity="center"
-            android:paddingLeft="12dp"
-            android:paddingRight="12dp"
-            android:paddingTop="8dp"
-            android:paddingBottom="8dp"
-            android:text="@string/detect_face_in"
-            android:textColor="#F6A623"
-            android:textSize="18sp" />
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.65" />
-
-        <TextView
-            android:id="@+id/detect_bottom_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="0dp"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:layout_weight="0.36"
-            android:gravity="center|top"
-            android:text=""
-            android:textColor="#D0D0D0"
-            android:textSize="16sp" />
-    </LinearLayout>
-
-    <ImageView
-        android:id="@+id/detect_close"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_margin="20dp"
-        android:visibility="gone"
-        android:src="@mipmap/ic_close_ext" />
-
-    <ImageView
-        android:id="@+id/detect_sound"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_margin="@dimen/padding"
-        android:src="@mipmap/ic_enable_sound_ext" />
-
-    <ImageView
-        android:id="@+id/detect_success_image"
-        android:layout_width="45dp"
-        android:layout_height="45dp"
-        android:src="@mipmap/ic_success"
-        android:visibility="invisible" />
-
-    <HorizontalScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true">
-
-        <LinearLayout
-            android:id="@+id/detect_result_image_layout"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="horizontal"></LinearLayout>
-    </HorizontalScrollView>
-</RelativeLayout>

+ 0 - 107
app_modular/faceplatform-ui/src/main/res/layout/activity_face_liveness.xml

@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/liveness_root_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <FrameLayout
-        android:id="@+id/liveness_surface_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <SurfaceView
-            android:id="@+id/liveness_surface_view"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" />
-
-        <ImageView
-            android:id="@+id/liveness_surface_overlay_image"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_centerHorizontal="true"
-            android:background="@mipmap/bg_face_round" />
-    </FrameLayout>
-
-    <LinearLayout
-        android:id="@+id/liveness_surface_overlay_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.8" />
-
-        <TextView
-            android:id="@+id/liveness_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_above="@id/liveness_surface_overlay_layout"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:gravity="center"
-            android:text="@string/detect_face_in"
-            android:textColor="#00E5EE"
-            android:textSize="16sp" />
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="3"
-            android:orientation="horizontal">
-
-            <View
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="0.05" />
-
-            <ImageView
-                android:id="@+id/liveness_surface_overlay"
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_gravity="center_horizontal"
-                android:layout_weight="0.9"
-                android:background="#09ffffff"
-                android:visibility="invisible" />
-
-            <View
-                android:layout_width="0dp"
-                android:layout_height="match_parent"
-                android:layout_weight="0.05" />
-        </LinearLayout>
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1" />
-    </LinearLayout>
-
-    <ImageView
-        android:id="@+id/liveness_close"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_close" />
-
-    <ImageView
-        android:id="@+id/liveness_sound"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_enable_sound" />
-
-    <HorizontalScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true">
-
-        <LinearLayout
-            android:id="@+id/liveness_result_image_layout"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="horizontal"></LinearLayout>
-    </HorizontalScrollView>
-</RelativeLayout>

+ 0 - 95
app_modular/faceplatform-ui/src/main/res/layout/activity_face_liveness_v3100.xml

@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/liveness_root_layout"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <FrameLayout
-        android:id="@+id/liveness_surface_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"></FrameLayout>
-
-    <com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
-        android:id="@+id/liveness_face_round"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-
-    <LinearLayout
-        android:id="@+id/liveness_surface_overlay_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.15" />
-
-        <TextView
-            android:id="@+id/liveness_top_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:gravity="center"
-            android:paddingBottom="8dp"
-            android:paddingLeft="12dp"
-            android:paddingRight="12dp"
-            android:paddingTop="8dp"
-            android:text="@string/detect_face_in"
-            android:textColor="#F6A623"
-            android:textSize="18sp" />
-
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="0dp"
-            android:layout_weight="0.65" />
-
-        <TextView
-            android:id="@+id/liveness_bottom_tips"
-            android:layout_width="wrap_content"
-            android:layout_height="0dp"
-            android:layout_centerHorizontal="true"
-            android:layout_gravity="center_horizontal"
-            android:layout_weight="0.36"
-            android:gravity="center|top"
-            android:text=""
-            android:textColor="#D0D0D0"
-            android:textSize="16sp" />
-    </LinearLayout>
-
-    <ImageView
-        android:id="@+id/liveness_close"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_close_ext" />
-
-    <ImageView
-        android:id="@+id/liveness_sound"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_margin="20dp"
-        android:src="@mipmap/ic_enable_sound_ext" />
-
-    <ImageView
-        android:id="@+id/liveness_success_image"
-        android:layout_width="45dp"
-        android:layout_height="45dp"
-        android:src="@mipmap/ic_success"
-        android:visibility="visible" />
-
-    <HorizontalScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true">
-
-        <LinearLayout
-            android:id="@+id/liveness_result_image_layout"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="horizontal"></LinearLayout>
-    </HorizontalScrollView>
-</RelativeLayout>

+ 0 - 40
app_modular/faceplatform-ui/src/main/res/layout/activity_face_verifty.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:background="@color/white"
-    android:layout_height="match_parent">
-
-    <FrameLayout
-        android:id="@+id/liveness_surface_layout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" />
-
-    <TextView
-        android:id="@+id/liveness_top_tips"
-        android:layout_width="match_parent"
-        android:layout_height="170dp"
-        android:layout_centerHorizontal="true"
-        android:layout_gravity="center_horizontal"
-        android:gravity="center|bottom"
-        android:padding="8dp"
-        android:visibility="gone"
-        android:text="@string/detect_face_in"
-        android:textColor="@color/white"
-        android:textSize="12sp" />
-
-    <com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
-        android:id="@+id/liveness_face_round"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:visibility="visible" />
-
-
-    <ImageView
-        android:layout_width="match_parent"
-        android:layout_height="18dp"
-        android:layout_alignParentBottom="true"
-        android:layout_marginBottom="20dp"
-        android:src="@mipmap/ic_bottom_uu"/>
-
-
-</RelativeLayout>

BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/bg_face_round.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_bottom_uu.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_close.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_disable_sound.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xhdpi/ic_enable_sound.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_bottom_uu.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_close_ext.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_disable_sound_ext.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_enable_sound_ext.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_success.png


BIN
app_modular/faceplatform-ui/src/main/res/mipmap-xxhdpi/ic_warning.png


BIN
app_modular/faceplatform-ui/src/main/res/raw/detect_face_in.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/face_good.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_eye.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_head_down.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_head_left.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_head_left_right.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_head_right.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_head_up.mp3


BIN
app_modular/faceplatform-ui/src/main/res/raw/liveness_mouth.mp3


+ 0 - 25
app_modular/faceplatform-ui/src/main/res/values/strings.xml

@@ -1,25 +0,0 @@
-<resources>
-    <string name="detect_no_face">未检测到人脸</string>
-    <string name="detect_face_in">把脸移入框内</string>
-    <string name="detect_zoom_in">手机拿近一点</string>
-    <string name="detect_zoom_out">手机拿远一点</string>
-    <string name="detect_head_up">建议略微抬头</string>
-    <string name="detect_head_down">建议略微低头</string>
-    <string name="detect_head_left">建议略微向左转头</string>
-    <string name="detect_head_right">建议略微向右转头</string>
-    <string name="detect_occ_face">脸部有遮挡</string>
-    <string name="detect_low_light">光线再亮些</string>
-    <string name="detect_keep">请保持不动</string>
-    <string name="detect_standard">请正对手机</string>
-    <string name="detect_timeout">检测超时</string>
-    <string name="liveness_eye">眨眨眼</string>
-    <string name="liveness_eye_left">请眨眨左边眼睛</string>
-    <string name="liveness_eye_right">请眨眨右边眼睛</string>
-    <string name="liveness_mouth">张张嘴</string>
-    <string name="liveness_head_left">向左缓慢转头</string>
-    <string name="liveness_head_right">向右缓慢转头</string>
-    <string name="liveness_head_left_right">摇摇头</string>
-    <string name="liveness_head_up">缓慢抬头</string>
-    <string name="liveness_head_down">缓慢低头</string>
-    <string name="liveness_good">非常好</string>
-</resources>

+ 2 - 2
settings.gradle

@@ -19,7 +19,7 @@ include ':apptasks'
 include ':apputils'
 include  ':appmusic'
 include  ':faceplatform-ui'
-include  ':faceplatform-release'
+//include  ':faceplatform-release'
 //第三库模块
 
 include ':lib-zxing'
@@ -53,7 +53,7 @@ project(':apptasks').projectDir = new File('app_modular/apptasks')
 project(':apputils').projectDir = new File('app_modular/apputils')
 project(':appmusic').projectDir = new File('app_modular/appmusic')
 project(':faceplatform-ui').projectDir = new File('app_modular/faceplatform-ui')
-project(':faceplatform-release').projectDir = new File('app_modular/faceplatform-release')
+//project(':faceplatform-release').projectDir = new File('app_modular/faceplatform-release')
 //第三库模块
 
 project(':lib-zxing').projectDir = new File('app_third/lib-zxing')