ソースを参照

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

# Conflicts:
#	app/src/main/java/com/hanghui/senic/service/usbserialdemo/utile/ConfigManager.java
Shangyp 2 週間 前
コミット
59a2656e3f

+ 2 - 2
app/src/main/java/com/hanghui/senic/baiduface/BaiduFacePreviewActivity.java

@@ -1096,7 +1096,7 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
 
     public void invoke_PersonCard(byte[] secondFeature) {
         AppLogUtils.e(true, TAG, "invoke_PersonCard(), secondFeature=" + secondFeature);
-
+        AppHandler.getHandler().removeCallbacks(mPersonCardTimeoutRunnable);
         //立刻发送人证比对超时的Runnable
         AppHandler.getHandler().postDelayed(mPersonCardTimeoutRunnable, ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneTimeout() * 1000);
 
@@ -1277,6 +1277,6 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
             bdFaceCheckConfig=FaceUtils.getInstance().getBDFaceCheckConfig();
         }
         bdFaceCheckConfig.setFeatureCheckMode(3);
-       // invoke_Resume();
+        AppHandler.getHandler().removeCallbacks(mPersonCardTimeoutRunnable);
     }
 }

+ 17 - 2
app/src/main/java/com/hanghui/senic/baiduface/view/BaiduResultView.java

@@ -324,7 +324,12 @@ public class BaiduResultView  extends LinearLayout {
                 @Override
                 public void run() {
                     setVisibility(View.VISIBLE);
-                    fl_user_info.setVisibility(VISIBLE);
+
+                    setViewVisibility(fl_user_info,ConfigManager.isShowUserInfo());
+                    setViewVisibility(ivPhoto,ConfigManager.isSuccessShowPersenalInfoPhoto);
+                    setViewVisibility(tv_name,ConfigManager.isSuccessShowPersenalInfoName);
+                    setViewVisibility(tv_card,ConfigManager.isSuccessShowPersenalInfoIDCard);
+                    setViewVisibility(tv_phone,ConfigManager.isSuccessShowPersenalInfoPhone);
                     String sucText=   ConfigManager.getAuthenticationBeanListBean().getSucText();
                     if(TextUtils.isEmpty(sucText)){
                         sucText="请通行";
@@ -350,6 +355,12 @@ public class BaiduResultView  extends LinearLayout {
 
     }
 
+    private void setViewVisibility(View view,boolean isVisibility){
+        if(view!=null){
+            view.setVisibility(isVisibility?VISIBLE:INVISIBLE);
+        }
+    }
+
     Handler mHandler =new Handler(Looper.getMainLooper());
 
     public Handler getmHandler() {
@@ -878,7 +889,11 @@ public class BaiduResultView  extends LinearLayout {
                 @Override
                 public void run() {
                     setVisibility(View.VISIBLE);
-                    fl_user_info.setVisibility(VISIBLE);
+                    setViewVisibility(fl_user_info,ConfigManager.isShowUserInfo());
+                    setViewVisibility(ivPhoto,ConfigManager.isSuccessShowPersenalInfoPhoto);
+                    setViewVisibility(tv_name,ConfigManager.isSuccessShowPersenalInfoName);
+                    setViewVisibility(tv_card,ConfigManager.isSuccessShowPersenalInfoIDCard);
+                    setViewVisibility(tv_phone,ConfigManager.isSuccessShowPersenalInfoPhone);
                     String sucText=   ConfigManager.getAuthenticationBeanListBean().getSucText();
                     if(TextUtils.isEmpty(sucText)){
                         sucText="请通行";

+ 3 - 1
app/src/main/java/com/hanghui/senic/controller/QRCodeController.java

@@ -209,7 +209,6 @@ public class QRCodeController extends BaseController {
 
     @Override
     public void destroy() {
-        instance = null ;
         try {
             CommonUtil.getCurrentActivity().unregisterReceiver(QRCodeController.getInstance().mUsbReceiver);
             CommonUtil.getCurrentActivity().unbindService(QRCodeController.getInstance().usbConnection);
@@ -217,7 +216,10 @@ public class QRCodeController extends BaseController {
             CommonUtil.getCurrentActivity().stopService(intent);
         } catch (Exception e) {
             e.printStackTrace();
+        }finally {
+            instance = null ;
         }
+
     }
 
     public void requestOverlayPersmission() {

+ 1 - 0
app/src/main/java/com/hanghui/senic/controller/SerialController.java

@@ -269,6 +269,7 @@ public class SerialController extends BaseController {
             doorSerialPortAddressSerialPort.close();
             doorSerialPortAddressSerialPort = null;
         }
+        instance = null;
     }
 
     //----------------------------------------------------串口发送

+ 10 - 0
app/src/main/java/com/hanghui/senic/service/usbserialdemo/utile/ConfigManager.java

@@ -1581,6 +1581,10 @@ public class ConfigManager {
         if (ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList() ==null ||
                 ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().size() == 0){
             ConfigManager.getAuthenticationBeanListBean().setSuccessShowPersonalInfoList(null);
+            isSuccessShowPersenalInfoName = false;
+            isSuccessShowPersenalInfoPhone = false;
+            isSuccessShowPersenalInfoPhoto = false;
+            isSuccessShowPersenalInfoIDCard = false;
             return;
         }
         for (int i = 0; i < ConfigManager.getAuthenticationBeanListBean().getSuccessShowPersonalInfoList().size(); i++) {
@@ -1596,4 +1600,10 @@ public class ConfigManager {
         }
 
     }
+
+    public static boolean isShowUserInfo(){
+        return isSuccessShowPersenalInfoPhoto ||  isSuccessShowPersenalInfoName
+                ||isSuccessShowPersenalInfoIDCard || isSuccessShowPersenalInfoPhone;
+    }
+
 }

+ 1 - 1
app/src/main/res/layout/layout_baidu_result_view.xml

@@ -14,7 +14,7 @@
         <ImageView
             android:id="@+id/iv_top_bg"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/dp_300"
+            android:layout_height="@dimen/dp_350"
             android:scaleType="fitXY" />
 
         <LinearLayout