fix: 优化人脸采集日志及提示界面交互
- LoginByFaceActivity: 新增人脸采集关键节点调试日志 - PlcSettingActivity: 添加点击提示区域关闭提示布局功能,格式化代码 - activity_plc_setting.xml: 给提示 TextView 添加 id,字体调整为 32sp Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e1e4bc5123
commit
e8735db27b
@@ -221,6 +221,7 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
|
|||||||
private fun isFitData(userFaceInfo: UserFaceInfo?): Boolean {
|
private fun isFitData(userFaceInfo: UserFaceInfo?): Boolean {
|
||||||
if (userFaceInfo == null) return false
|
if (userFaceInfo == null) return false
|
||||||
val headBmp = userFaceInfo.headBmp
|
val headBmp = userFaceInfo.headBmp
|
||||||
|
loadLogInfo("collectFace,isFitData:w=${headBmp?.width},height=${headBmp?.height}")
|
||||||
if (headBmp == null) return false
|
if (headBmp == null) return false
|
||||||
// if (headBmp.width <= 200 || headBmp.height <= 200) {
|
// if (headBmp.width <= 200 || headBmp.height <= 200) {
|
||||||
// loadLogInfo("collectFace,isFitData:拿到人脸提取特征数据照片过小-----------")
|
// loadLogInfo("collectFace,isFitData:拿到人脸提取特征数据照片过小-----------")
|
||||||
@@ -234,9 +235,12 @@ class LoginByFaceActivity : BaseActivity<ActivityLoginFaceBinding>(),
|
|||||||
recognizeViewModel.prepareRegister()
|
recognizeViewModel.prepareRegister()
|
||||||
recognizeViewModel.setOnRegisterFinishedCallback { facePreviewInfo, userFaceInfo ->
|
recognizeViewModel.setOnRegisterFinishedCallback { facePreviewInfo, userFaceInfo ->
|
||||||
registerHandler?.setCallback {
|
registerHandler?.setCallback {
|
||||||
|
loadLogInfo("collectFace,registerHandler?.setCallback")
|
||||||
if (!isCollectFace || !isCollecting.get()) {
|
if (!isCollectFace || !isCollecting.get()) {
|
||||||
|
loadLogInfo("collectFace,isCollectFace=${isCollectFace},isCollecting=${isCollecting.get()}")
|
||||||
return@setCallback
|
return@setCallback
|
||||||
}
|
}
|
||||||
|
loadLogInfo("collectFace,userFaceInfo==null:${userFaceInfo==null}")
|
||||||
if (this.userFaceInfo == null && isFitData(userFaceInfo)) {
|
if (this.userFaceInfo == null && isFitData(userFaceInfo)) {
|
||||||
val headBmp = userFaceInfo.headBmp ?: run {
|
val headBmp = userFaceInfo.headBmp ?: run {
|
||||||
loadLogInfo("collectFace,isFitData:headBmp 为 null,跳过")
|
loadLogInfo("collectFace,isFitData:headBmp 为 null,跳过")
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ class PlcSettingActivity : BaseActivity<ActivityPlcSettingBinding>() {
|
|||||||
})
|
})
|
||||||
}).show()
|
}).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
binding.tvTips.clickWithDebounce {
|
||||||
|
binding.layoutTips.visibility = android.view.View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== 连接控制 ====================
|
// ==================== 连接控制 ====================
|
||||||
@@ -204,18 +208,19 @@ class PlcSettingActivity : BaseActivity<ActivityPlcSettingBinding>() {
|
|||||||
PlcHelper.getInstance(this).platformUp(object : PlcCallback<String> {
|
PlcHelper.getInstance(this).platformUp(object : PlcCallback<String> {
|
||||||
override fun onSuccess(result: String) {
|
override fun onSuccess(result: String) {
|
||||||
// 平台上升完成,继续执行返回营业
|
// 平台上升完成,继续执行返回营业
|
||||||
PlcHelper.getInstance(this@PlcSettingActivity).backToBusiness(object : PlcCallback<String> {
|
PlcHelper.getInstance(this@PlcSettingActivity)
|
||||||
override fun onSuccess(result: String) {
|
.backToBusiness(object : PlcCallback<String> {
|
||||||
hideWaitingDialog()
|
override fun onSuccess(result: String) {
|
||||||
ToastUtils.showToast("平台复位成功")
|
hideWaitingDialog()
|
||||||
finish()
|
ToastUtils.showToast("平台复位成功")
|
||||||
}
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onError(message: String) {
|
override fun onError(message: String) {
|
||||||
hideWaitingDialog()
|
hideWaitingDialog()
|
||||||
ToastUtils.showToast("返回营业失败:$message")
|
ToastUtils.showToast("返回营业失败:$message")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(message: String) {
|
override fun onError(message: String) {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
android:src="@mipmap/img_error_tips"
|
android:src="@mipmap/img_error_tips"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
<TextView
|
<TextView android:id="@+id/tv_tips"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
android:layout_marginBottom="144dp"
|
android:layout_marginBottom="144dp"
|
||||||
android:text="暂无餐盘 请联系管理人员"
|
android:text="暂无餐盘 请联系管理人员"
|
||||||
android:textColor="#fff0c8b4"
|
android:textColor="#fff0c8b4"
|
||||||
android:textSize="20sp" />
|
android:textSize="32sp" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
|||||||
Reference in New Issue
Block a user