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; } }