From e35eb5ac7fda54a3cd146fa0faf20af187190919 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 26 Nov 2022 10:57:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84=E5=9B=9E?= =?UTF-8?q?=E6=8A=A5=E7=9A=84=E9=97=AA=E9=80=80=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/faceunity/FaceManager.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java b/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java index 82786f636..9cbef67ef 100644 --- a/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java +++ b/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java @@ -118,8 +118,12 @@ public class FaceManager implements SensorEventListener { if ("FilterViewHolder_".equals(key)) { for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) { if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) { - faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes()); - Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")); + try { + faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes()); + Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")); + } catch (Exception e) { + e.printStackTrace(); + } break; } } @@ -127,8 +131,12 @@ public class FaceManager implements SensorEventListener { String name = key.replace("BeautySkinViewHolder_", ""); for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) { if (bean.getKey().equals(name)) { - faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); - Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key)); + try { + faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); + Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key)); + } catch (Exception e) { + e.printStackTrace(); + } break; } } @@ -136,8 +144,12 @@ public class FaceManager implements SensorEventListener { String name = key.replace("BeautyShapeViewHolder_", ""); for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) { if (bean.getKey().equals(name)) { - faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); - Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key)); + try { + faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); + Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key)); + } catch (Exception e) { + e.printStackTrace(); + } break; } }