Compare commits

..

1470 Commits

Author SHA1 Message Date
18401019693
c20312b982 6.5.4礼物冠名 2023-08-18 18:43:47 +08:00
18401019693
643568f63b 6.5.4礼物冠名 2023-08-18 18:08:15 +08:00
18401019693
f03ba293b5 6.5.4礼物冠名 2023-08-18 17:43:13 +08:00
a2f954b28a Merge remote-tracking branch 'origin/master' 2023-08-18 14:48:41 +08:00
d4549793d1 调整头像相关 2023-08-18 14:48:33 +08:00
18401019693
5da8855948 6.5.4礼物冠名 2023-08-18 14:17:46 +08:00
18401019693
348dca8474 6.5.4礼物冠名 2023-08-18 13:49:20 +08:00
18401019693
5afed0ee43 6.5.4礼物冠名 2023-08-18 11:04:21 +08:00
18401019693
d065726274 6.5.4礼物冠名 2023-08-17 18:20:53 +08:00
18401019693
8f9d558043 6.5.4礼物冠名 2023-08-17 18:15:25 +08:00
c594364574 调整关注逻辑 2023-08-17 17:17:06 +08:00
18401019693
68140c8a3a 6.5.4礼物冠名 2023-08-17 15:38:59 +08:00
5a4001c858 调整退出粉丝团逻辑 2023-08-17 13:45:40 +08:00
18401019693
d5953bd651 6.5.4礼物冠名 2023-08-17 13:19:04 +08:00
18401019693
17a2f5e091 6.5.4礼物冠名 2023-08-16 20:01:46 +08:00
18401019693
b2297b062e 6.5.4礼物冠名 2023-08-16 18:17:26 +08:00
b53472de28 調整文案 2023-08-16 17:32:29 +08:00
18401019693
9bce235817 6.5.4礼物冠名 2023-08-16 16:23:28 +08:00
18401019693
60ce5572cf 6.5.4礼物冠名 2023-08-16 15:37:07 +08:00
18401019693
3761cad653 6.5.4礼物冠名 2023-08-16 14:50:50 +08:00
18401019693
2a276503b5 6.5.4礼物冠名 2023-08-16 13:31:56 +08:00
fd0ad36a58 补充英文 2023-08-15 14:07:33 +08:00
41c8783b53 调整一处英文UI下字数过长问题 2023-08-15 14:00:36 +08:00
18401019693
7226add482 6.5.4礼物冠名 2023-08-15 11:29:39 +08:00
09e5f9b984 Merge remote-tracking branch 'origin/master' 2023-08-15 10:37:25 +08:00
83ee1f94df 修复一处闪退bug 2023-08-15 10:37:06 +08:00
18401019693
7e1b054a98 6.5.4礼物冠名 2023-08-14 21:05:15 +08:00
18401019693
9e0c437af5 6.5.4礼物冠名 2023-08-14 19:55:58 +08:00
18401019693
ad26ae7db8 6.5.4礼物冠名 2023-08-14 19:16:02 +08:00
18401019693
84230e517e 6.5.4礼物冠名 2023-08-14 18:40:25 +08:00
9818a1af74 新增关注的code提示 2023-08-14 18:05:55 +08:00
f91ba79c5c 新增关注的code提示 2023-08-14 17:54:27 +08:00
18401019693
0ea9ffc2e8 6.5.4礼物冠名 2023-08-14 17:40:52 +08:00
18401019693
defb5fdd02 6.5.4礼物冠名 2023-08-14 15:50:35 +08:00
b443fdd683 调整页面英文UI 2023-08-14 14:58:13 +08:00
18401019693
c11c66f56f 6.5.4礼物冠名 2023-08-14 13:47:09 +08:00
18401019693
a618bee6b7 6.5.4礼物冠名 2023-08-14 11:18:33 +08:00
399bedb874 调整购买守护页面英文UI 2023-08-14 10:57:38 +08:00
18401019693
3b6e2d47f4 6.5.4礼物冠名 2023-08-14 10:31:01 +08:00
18401019693
96daf73a5c 6.5.4礼物冠名 2023-08-14 10:16:06 +08:00
18401019693
55cbd0ff5b 6.5.4礼物冠名 2023-08-11 14:37:35 +08:00
18401019693
a3ab9ff03e 6.5.4礼物冠名 2023-08-11 14:19:15 +08:00
18401019693
92ed82ea2a 6.5.4礼物冠名 2023-08-11 13:59:54 +08:00
18401019693
6d262d0c94 6.5.4礼物冠名 2023-08-11 09:42:18 +08:00
18401019693
ce1174a88c 6.5.4礼物冠名 2023-08-10 17:40:57 +08:00
18401019693
2406e9bede 6.5.4礼物冠名 2023-08-10 17:38:06 +08:00
9b3a011499 修复英文say hi下格式问题#131 2023-08-10 17:25:53 +08:00
18401019693
7859e7cb29 6.5.4礼物冠名 2023-08-10 17:16:14 +08:00
18401019693
1fd36e3ba0 6.5.4礼物冠名 2023-08-10 17:04:26 +08:00
ec3722b7d0 新增粉丝团任务红点提示 2023-08-10 16:53:00 +08:00
18401019693
35917a5848 6.5.4礼物冠名 2023-08-10 15:40:13 +08:00
18401019693
7ea6bb570d 6.5.4礼物冠名 2023-08-10 14:20:40 +08:00
18401019693
43f95260e6 6.5.4礼物冠名 2023-08-10 13:51:49 +08:00
18142669586
54a4c0b590 Merge remote-tracking branch 'origin/master' 2023-08-10 11:15:31 +08:00
18142669586
2057a3575f 修改融云结束连麦还有对方画面的问题 2023-08-10 11:15:06 +08:00
18401019693
aa809ebaf4 6.5.4礼物冠名 2023-08-10 10:03:01 +08:00
18401019693
dffa71e346 6.5.4礼物冠名 2023-08-09 18:11:42 +08:00
18401019693
fea46aab1f 6.5.4礼物冠名 2023-08-09 17:05:51 +08:00
18401019693
e032e0807b 6.5.4礼物冠名 2023-08-09 14:38:33 +08:00
18401019693
24ed313f60 6.5.4礼物冠名 2023-08-09 14:15:03 +08:00
18142669586
02b70d559d Merge remote-tracking branch 'origin/master' 2023-08-09 14:14:11 +08:00
18142669586
7a26e81f67 修改融云合流不成功的问题,退出画面有问题 2023-08-09 14:13:52 +08:00
d07439efcf update 主播端点礼物墙按钮置灰 2023-08-09 13:53:16 +08:00
18401019693
7bca817633 6.5.4礼物冠名 2023-08-09 13:31:31 +08:00
18401019693
bad2b3689a 6.5.4礼物冠名 2023-08-09 11:01:28 +08:00
3cc9b90151 update 简繁 2023-08-09 10:24:13 +08:00
18401019693
e32e6f95b0 6.5.4礼物冠名 2023-08-08 17:09:35 +08:00
18401019693
2162645da1 6.5.4礼物冠名 2023-08-08 16:12:07 +08:00
18401019693
af17c85366 6.5.4礼物冠名 2023-08-08 16:08:43 +08:00
18401019693
20c00e2896 6.5.4礼物冠名 2023-08-08 15:37:11 +08:00
18401019693
44b95cb1c6 6.5.4礼物冠名 2023-08-08 14:50:13 +08:00
40e744a533 修复粉丝团包裹为空时会关掉对话框的情况 2023-08-08 13:32:42 +08:00
18401019693
82ccd2d89c 6.5.4礼物冠名 2023-08-08 11:37:19 +08:00
18401019693
994bd2a3aa 6.5.4礼物冠名 2023-08-08 09:34:15 +08:00
3ab91a74d1 修复礼物栏自定义数量过长导致的闪退问题 2023-08-07 18:26:45 +08:00
18142669586
d899975495 修改融云合流不成功的问题 2023-08-07 18:06:46 +08:00
dbbe753492 调整【围观】为繁体 2023-08-07 17:05:33 +08:00
18401019693
017320ac09 6.5.4礼物冠名 2023-08-07 16:29:02 +08:00
7ce0bb3a7c 修复#93测试问题 2023-08-07 15:18:34 +08:00
18401019693
a78d5b4aba 6.5.4礼物冠名 2023-08-07 14:50:29 +08:00
37fd1e9f47 调整粉丝团入场英文翻译 2023-08-07 14:39:35 +08:00
18401019693
97ad28ba62 6.5.4礼物冠名 2023-08-07 13:36:59 +08:00
3304e8f673 update 粉丝团 2023-08-05 18:04:36 +08:00
e7daabe588 Merge branch 'dev_6.5.4' 2023-08-05 16:53:13 +08:00
d912ad6119 update 粉丝团 2023-08-05 16:52:48 +08:00
18401019693
dfeb1c246b 6.5.4礼物冠名 2023-08-05 15:22:49 +08:00
18401019693
9588619b73 6.5.4礼物冠名 2023-08-04 16:54:28 +08:00
18401019693
6ba71508ca 6.5.4礼物冠名 2023-08-04 16:28:43 +08:00
c8f443c105 Merge branch 'master' into dev_6.5.4_tmp 2023-08-04 16:15:25 +08:00
18401019693
ebcfddf450 6.5.4礼物冠名 2023-08-04 16:14:36 +08:00
e43fb5e479 Merge branch 'master' into dev_6.5.4_tmp 2023-08-04 16:13:14 +08:00
18401019693
0c096dcafc 6.5.4礼物冠名 2023-08-04 15:59:20 +08:00
18401019693
545c69ff8b 6.5.4礼物冠名 2023-08-04 15:50:32 +08:00
bf8d88608d Merge branch 'master' into dev_6.5.4_tmp
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
#	common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java
#	common/src/main/res/values-en-rUS/string.xml
#	common/src/main/res/values-zh-rHK/strings.xml
#	common/src/main/res/values-zh-rTW/strings.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
#	live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
2023-08-04 15:41:11 +08:00
18401019693
45c256cbbb 6.5.4礼物冠名 2023-08-04 15:18:06 +08:00
18401019693
fb1d6c0688 6.5.4礼物冠名 2023-08-04 14:58:26 +08:00
fe921e25bb update 粉丝团 2023-08-04 14:25:49 +08:00
18401019693
d5ca010ec7 6.5.4礼物冠名 2023-08-04 13:57:36 +08:00
18401019693
04259472a1 Merge remote-tracking branch 'origin/dev_gift_6.5.4' 2023-08-04 10:19:18 +08:00
18401019693
d6032a0a0a 6.5.4礼物冠名 2023-08-04 10:18:05 +08:00
18401019693
4a7790d968 6.5.4礼物冠名 2023-08-04 10:11:03 +08:00
18401019693
49810407ce 6.5.4礼物冠名 2023-08-04 09:47:42 +08:00
18401019693
fa086dc5cb 6.5.4礼物冠名 2023-08-03 17:54:14 +08:00
18401019693
3f8d6ed4af 6.5.4礼物冠名 2023-08-03 16:08:43 +08:00
18401019693
986902886a 6.5.4礼物冠名 2023-08-03 14:29:04 +08:00
18401019693
8ed7595aec 6.5.4礼物冠名 2023-08-02 17:47:00 +08:00
18401019693
b78fef6adc 6.5.4礼物冠名 2023-08-02 16:55:36 +08:00
fae0d01dc2 update 粉丝团 2023-08-02 15:48:51 +08:00
9a8bc0505d 修复#248问题 2023-08-02 15:08:11 +08:00
e31fa0310c 修复#250问题 2023-08-02 14:43:20 +08:00
2705342e18 修复#249问题 2023-08-02 14:39:56 +08:00
1bdf3a2ba3 修复#246问题 2023-08-02 14:20:47 +08:00
18401019693
5afa3bd30b 6.5.4礼物冠名 2023-08-02 13:23:37 +08:00
18401019693
54458bd0c0 6.5.4礼物冠名 2023-07-31 18:25:32 +08:00
c53b9a6064 update 粉丝团相关 2023-07-31 16:28:42 +08:00
92d4130c45 update 粉丝团相关 2023-07-28 10:01:41 +08:00
18401019693
a353e51ba8 6.5.4礼物栏优化 2023-07-25 15:25:01 +08:00
18401019693
0646f245b6 6.5.4礼物栏优化 2023-07-25 14:08:52 +08:00
7e3ca79a01 调整随机PK弹框UI 2023-07-21 14:19:20 +08:00
dfeb3a78c1 修复英文模式下,购买是守护文案超长问题 2023-07-21 13:34:31 +08:00
e32d450ca1 修复随机PK文案在英文模式下过长问题 2023-07-21 09:45:11 +08:00
f29766731c 修复#232问题 2023-07-20 18:12:09 +08:00
736592b4e1 新增头像选择界面 2023-07-19 18:30:32 +08:00
3108c898c2 Merge branch 'dev_6.5.4_头像优化' into dev_6.5.4_联系方式 2023-07-19 15:35:48 +08:00
dd2f3db16a 新增头像选择界面 2023-07-19 15:35:30 +08:00
8af231e526 新增头像选择界面 2023-07-19 13:07:27 +08:00
fdbbc3b224 修復紅點檢測 2023-07-19 10:25:11 +08:00
1e4b0bb536 补充信箱角标点亮和防抖 2023-07-18 18:09:27 +08:00
4729f93515 新增获取联系方式的弹框新样式 2023-07-18 15:40:15 +08:00
18401019693
3376a57f9d 6.5.4版本更新-“@”功能优化 2023-07-18 13:48:37 +08:00
18401019693
410fcb5895 修改json的版本号 2023-07-17 16:56:29 +08:00
18401019693
9b62ab6011 修改json的版本号 2023-07-17 16:42:51 +08:00
18401019693
62aa1d63df 修改json的版本号 2023-07-17 16:15:04 +08:00
18142669586
034f2dba5d Merge remote-tracking branch 'origin/master'
# Conflicts:
#	app/src/main/AndroidManifest.xml
#	config.gradle
2023-07-17 16:11:17 +08:00
18142669586
aee1d6cad4 修改上架 2023-07-17 16:10:29 +08:00
9b01ae4d82 修改用户协议地址 2023-07-17 15:18:47 +08:00
16f23519b1 移除百度语言残留内容 2023-07-17 13:35:59 +08:00
9bfed0bc7b 移除腾讯地图残留配置和代码 2023-07-17 10:16:24 +08:00
18401019693
bc0ed26377 修复 2023-07-14 13:13:25 +08:00
18401019693
0d14ce5aee 修复 2023-07-14 11:14:10 +08:00
18142669586
4a7423a5b9 修改全服 2023-07-14 10:43:14 +08:00
18401019693
0a4425d705 修复 2023-07-14 10:18:50 +08:00
d4c2ef71cb 新增主播可导出日志功能 2023-07-13 10:39:33 +08:00
18401019693
7184b147d9 修复 2023-07-12 15:32:44 +08:00
39e9670cff 6.5.3 432 2023-07-12 15:05:39 +08:00
18401019693
7d7535935a 修复 2023-07-12 14:58:34 +08:00
18401019693
dd657e9918 修复 2023-07-12 13:50:00 +08:00
09cef4ade6 6.5.3 更新发送红包说明图片 2023-07-12 13:11:19 +08:00
7038681f8c 6.5.3 2023-07-11 17:57:55 +08:00
6cf68838f8 修改红包样式和文案 2023-07-11 17:25:51 +08:00
c3a08974d1 修改发红包样式 2023-07-11 14:14:33 +08:00
18401019693
20c25a51ef 修复 2023-07-11 11:44:02 +08:00
18401019693
9dfb772224 修复 2023-07-11 11:43:12 +08:00
18401019693
f5f68f16b7 Merge remote-tracking branch 'origin/master' 2023-07-11 11:34:47 +08:00
18401019693
7672cea263 修复 2023-07-11 11:34:40 +08:00
0a02b39c12 根据产品需求修改英文翻译
根据产品需求修改UI样式
2023-07-11 10:51:03 +08:00
18401019693
e786ae16c2 修复 2023-07-11 10:13:29 +08:00
18401019693
1d447b0a90 修复 2023-07-10 16:36:48 +08:00
18401019693
4918f9ba20 修复 2023-07-08 15:52:18 +08:00
18401019693
124b18dcb0 修复 2023-07-08 15:15:40 +08:00
18401019693
f55e9c0cfe 修复 2023-07-08 13:40:50 +08:00
18401019693
84c43f74bc 修复 2023-07-07 16:14:28 +08:00
18401019693
674346b6de 修复 2023-07-07 16:01:29 +08:00
18401019693
64f40d52da 修复 2023-07-07 10:34:25 +08:00
18401019693
75e342975c 修复 2023-07-07 10:15:11 +08:00
18401019693
dd4172fc3d 修复 2023-07-07 09:51:29 +08:00
6b7a98dbc3 修复#220问题 2023-07-06 17:59:00 +08:00
640dea5c53 修复#218问题 2023-07-06 17:47:03 +08:00
a907897239 修复#217问题 2023-07-06 17:45:23 +08:00
3807ff8916 修复红包出现在联系方式选项里 2023-07-06 17:00:02 +08:00
36b85c15f5 修复飘屏弹幕被禁言没提示问题 2023-07-06 16:44:07 +08:00
3e91068866 按测试反馈修改红包详情UI逻辑和新增礼物显示 2023-07-06 15:13:33 +08:00
18401019693
4d61c7e176 添加翻译 2023-07-06 10:17:14 +08:00
18401019693
c6d9dbc118 添加翻译 2023-07-06 10:02:18 +08:00
6743ec3cf6 调整红包查看手气的UI 2023-07-06 10:02:04 +08:00
18401019693
addab80997 添加翻译 2023-07-05 18:15:18 +08:00
18401019693
9081ba4cd6 添加翻译 2023-07-05 17:47:50 +08:00
18401019693
12bedd630e 修复问题 2023-07-05 17:07:11 +08:00
18401019693
003c7f9e12 修复问题 2023-07-05 16:19:30 +08:00
18401019693
9089e96856 修复问题 2023-07-05 13:29:46 +08:00
60c14f720d 修复【钻石不够的情况下,也成功发起红包】 2023-07-04 17:15:25 +08:00
18401019693
c139b03417 修复问题 2023-07-04 17:02:05 +08:00
b3fb6e62ae Merge remote-tracking branch 'origin/master' 2023-07-04 16:37:34 +08:00
613185db40 修复红包记录样式问题 2023-07-04 16:36:46 +08:00
18401019693
291492f2d0 修复问题 2023-07-04 16:29:34 +08:00
18401019693
cbe91c84e9 红包全服通知 2023-07-04 16:02:45 +08:00
f417e4ead8 修复部分机型开播异常问题 2023-07-04 13:03:19 +08:00
18401019693
08bc6d554a Merge remote-tracking branch 'origin/dev_red_packet'
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
#	common/src/main/res/values/strings.xml
2023-07-03 17:57:35 +08:00
18401019693
895a1c6951 红包中奖列表 2023-07-03 17:48:02 +08:00
b9f1474362 【绑定账号】和【忘记密码】页面手机号码栏新增国家名字提示 2023-07-03 16:43:55 +08:00
18401019693
58508ca0ae 红包中奖列表 2023-07-03 13:05:29 +08:00
18401019693
5736265388 展示红包,领取红包接口逻辑对接 2023-06-30 16:03:37 +08:00
18401019693
e68d20252a 创建接口,红包展示接口 2023-06-30 10:17:33 +08:00
44b4b06592 退出直播间时移除加载错误的提示 2023-06-29 15:09:46 +08:00
fb7551f7d0 Merge branch 'master' into 6.5.3 2023-06-29 14:09:33 +08:00
18401019693
40455fffc9 红包打开创建领取的样式逻辑构建 2023-06-29 10:15:24 +08:00
195035c456 update 更换插件包下载地址 2023-06-28 18:22:30 +08:00
492003ff01 update 调整禁言对话框的文案 2023-06-28 17:37:30 +08:00
17c2e7f795 update 插件化判断代码 2023-06-28 17:37:10 +08:00
1a3d66553c 修复【直播间-多次点击用户名称,弹出多个主页资料框窗口】问题 2023-06-28 17:36:22 +08:00
710cddd3a7 Merge branch 'dev_6.5.3_红包' into 6.5.3 2023-06-28 16:49:23 +08:00
da7ebb2663 add 新增红包专区
add 新增红包专区进去是只有发放红包的直播间
add 新增首页红包浮窗
add 新增红包记录
2023-06-28 16:44:42 +08:00
6a6696f355 fix 修复测试服ios发消息安卓端收不到问题 2023-06-28 16:43:26 +08:00
368b002db6 update 直播间超时进入的提示 2023-06-27 14:19:34 +08:00
501a7b482b update 红包专区 2023-06-27 13:54:18 +08:00
18401019693
279575d80b 红包直播间展示样式构建 2023-06-26 18:04:58 +08:00
3bf594d0b5 update 红包记录列表 2023-06-26 14:57:11 +08:00
5f33fa38f6 update 禁言弹框ui标题 2023-06-26 10:24:19 +08:00
e0312eedd1 update 禁言弹框ui标题 2023-06-26 10:17:45 +08:00
69d8feb9a9 update 红包 2023-06-26 10:12:38 +08:00
500588c842 update 红包 2023-06-26 10:09:37 +08:00
0a70da82f0 Merge branch '6.5.3' into dev_6.5.3_红包 2023-06-25 17:02:33 +08:00
abbb8c524c 新增被禁言的提示 2023-06-25 16:19:55 +08:00
1334d173cf update 红包详情入口 2023-06-25 16:09:47 +08:00
f3ff37aea7 Merge branch 'fix_webview' into 6.5.3 2023-06-25 15:50:04 +08:00
9741be743c 新增直播播放器报错时提示
新增观众端看异常下播直播间提示
2023-06-25 14:18:40 +08:00
f54054283c 调整混淆清单 2023-06-25 13:50:48 +08:00
fd06243c22 优化下载直播插件流程 2023-06-25 11:31:19 +08:00
cef94a248e Merge branch 'dev_proguard' into 6.5.3 2023-06-25 09:53:43 +08:00
beb566b294 新增期间禁言功能 2023-06-25 09:51:29 +08:00
18401019693
6889828c00 消息中心新增【系统消息】类型 2023-06-20 17:46:31 +08:00
9c57f0bd96 修复webView显示问题 2023-06-17 17:22:11 +08:00
a1c96cfd0f 调整直播间分享链接 2023-06-16 15:30:21 +08:00
18401019693
1198a8f1d8 送礼交互优化 2023-06-15 15:27:46 +08:00
a255d1f2b5 update 2023-06-15 13:41:57 +08:00
53ce1c703e update 2023-06-14 17:59:08 +08:00
3f9e95ce7d 新增插件模块管理 2023-06-14 13:41:12 +08:00
18401019693
8e07d4523f 修改完善资料和礼物点击 2023-06-12 13:25:59 +08:00
29ddc54303 Merge branch 'master' into dev_proguard 2023-06-12 10:50:27 +08:00
ae9c050ae6 Merge remote-tracking branch 'origin/master' 2023-06-08 17:02:32 +08:00
7b61e8c562 修复Ranking.getAnchorRankData多次调用问题 2023-06-08 17:02:20 +08:00
18142669586
23a396864f 修改全服 2023-06-08 17:02:11 +08:00
af8052f65b 修复Ranking.getAnchorRankData多次调用问题 2023-06-08 15:21:24 +08:00
6603a2dbb5 修复Ranking.getAnchorRankData多次调用问题 2023-06-08 14:33:44 +08:00
f3a0b4d145 修复Ranking.getAnchorRankData多次调用问题 2023-06-08 14:20:15 +08:00
0c99324904 Merge remote-tracking branch 'origin/master' 2023-06-08 11:13:55 +08:00
8d077e8062 修复PK结束时会隐藏投票问题 2023-06-08 11:13:38 +08:00
18401019693
3aaafdbbbe 修改完善资料和礼物点击 2023-06-08 10:12:37 +08:00
18401019693
f4016089a1 修改完善资料和礼物点击 2023-06-06 15:28:00 +08:00
c53757c64b 调整WebView 2023-06-06 14:41:53 +08:00
c8c4352284 Merge branch 'master' into dev_proguard 2023-06-05 16:42:18 +08:00
18401019693
cd2e176f0a Merge branch 'dev_6.5.3' 2023-06-05 14:09:42 +08:00
e6d92ffc86 调整投票ui 2023-06-05 13:24:13 +08:00
ea0a3375e4 修复非粉丝通过送礼打开的粉丝团url不正确问题 2023-06-05 11:42:56 +08:00
18401019693
06357088c1 修改礼物类型 2023-06-05 10:36:27 +08:00
18401019693
fa24d226ee 6.5.2 2023-06-03 18:30:08 +08:00
18401019693
7eb8153744 6.5.2 2023-06-03 18:02:49 +08:00
18401019693
35f16bdcae 修改盲盒问题 2023-06-03 15:20:18 +08:00
18401019693
aacd8b8735 修改盲盒问题 2023-06-03 14:35:39 +08:00
9926997fd7 Merge remote-tracking branch 'origin/master' 2023-06-03 14:13:47 +08:00
b02cbd7831 Home.getConfig接口新增对1000错误码的处理 2023-06-03 14:13:29 +08:00
18401019693
4150eeed64 修改盲盒问题 2023-06-03 13:51:19 +08:00
18142669586
6e595ff1e4 Merge remote-tracking branch 'origin/master' 2023-06-03 11:48:37 +08:00
18142669586
fbc50229e8 修改关播页面英文显示问题 2023-06-03 11:45:57 +08:00
1edb07d76c 调整投票主播二次点击关闭按钮后直接关闭浮窗 2023-06-03 11:45:23 +08:00
9641d90f32 Merge remote-tracking branch 'origin/master' 2023-06-03 11:33:13 +08:00
3095438a5c 调整排行榜榜单样式
调整排行榜神秘人隐藏关注按钮导致整体UI下降
2023-06-03 11:08:17 +08:00
18401019693
067bbc70c5 修改盲盒问题 2023-06-03 10:35:52 +08:00
7201fd37f3 修复排行榜神秘人ui错乱问题 2023-06-02 18:00:28 +08:00
18401019693
0bab58d507 修改盲盒问题 2023-06-02 13:52:29 +08:00
18401019693
f1ac21fe87 Merge remote-tracking branch 'origin/master' 2023-06-02 13:13:14 +08:00
18401019693
f4b5cdfed3 修改直播间展示ID 2023-06-02 13:13:07 +08:00
9021659770 修复在进入直播间瞬间关播的“抱歉出错了”提示 2023-06-02 11:31:25 +08:00
e04d277560 修复修改投票中英文导致的界面语言混乱问题 2023-06-02 11:17:08 +08:00
18142669586
a7a9a28c09 Merge remote-tracking branch 'origin/master' 2023-06-02 10:27:48 +08:00
18142669586
bbd394044f 修改关播页面英文显示问题 2023-06-02 10:27:36 +08:00
18401019693
49df393781 Merge remote-tracking branch 'origin/master' 2023-06-02 10:04:40 +08:00
18401019693
f0a8c17401 修改盲盒连宋 2023-06-02 10:04:32 +08:00
a01ddd310b 新增投票观众端的中英文切换 2023-06-02 09:56:24 +08:00
18401019693
26ec74932f 修改盲盒蒙版 2023-06-01 18:16:58 +08:00
18401019693
3aa85ca9bb 直播间房间号加ID 2023-06-01 15:56:06 +08:00
18401019693
a67c2b4009 修改榜单头像框问题 2023-06-01 15:39:24 +08:00
9486a1a572 修复下播页面关注按钮在英文状态下自动换行问题 2023-06-01 15:12:17 +08:00
c1aa8188ce 修复机器人自动打招呼条数超过20条问题 #74 2023-06-01 14:58:42 +08:00
18401019693
a83e3e0511 添加中英文翻译 2023-06-01 13:56:05 +08:00
18401019693
3488da27f0 盲盒加判断是不是本人 2023-06-01 10:26:08 +08:00
56845de59d 修复在线客服页面输入法会挡住输入框的问题 2023-05-31 16:51:00 +08:00
18401019693
282790ead5 Merge remote-tracking branch 'origin/master' 2023-05-31 13:59:28 +08:00
18401019693
db165cc05d 盲盒礼物开箱动画 2023-05-31 13:22:14 +08:00
49313ca326 修复PK滑动直播间可能画面错乱问题 2023-05-29 15:25:15 +08:00
18401019693
b0008405e2 Merge branch 'master' into dev_blind_box 2023-05-29 11:35:17 +08:00
18401019693
9c32c6af25 添加盲盒礼物蒙版 2023-05-29 11:34:34 +08:00
baa2ec127f 调整播放器在停止播放时把play2也一并停止 2023-05-29 11:25:30 +08:00
18401019693
c3b5f17f44 Merge branch 'master' into dev_blind_box
# Conflicts:
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
2023-05-27 18:25:14 +08:00
18401019693
c28a91b128 修复榜单头像框问题 2023-05-27 17:22:13 +08:00
18401019693
f064864d76 修改榜单神秘人 2023-05-27 15:17:31 +08:00
18401019693
66290323d8 盲盒全服通知逻辑 2023-05-27 11:40:09 +08:00
9526a14ca2 调整聊天区高度 2023-05-27 11:24:28 +08:00
27715cda2c 新增投票创建失败时的提示语 2023-05-26 14:24:29 +08:00
65bfc77376 修复直播结束数据界面,直播时长未对齐问题 2023-05-25 14:34:39 +08:00
99618a2779 新增IM消息:endPK,用于显示最终单人PK数据 2023-05-25 14:25:57 +08:00
1b637b7a77 修復开屏动态聚焦banner有图片溢出问题 2023-05-25 14:18:00 +08:00
6ee678bd74 开播频道屏蔽【男神】 2023-05-25 13:41:39 +08:00
18401019693
b4dc035a1b 盲盒礼物具体业务逻辑的构建,IM消息的构建 2023-05-25 13:40:49 +08:00
18401019693
1f7aef91a8 礼物盲盒基本逻辑 2023-05-24 14:50:39 +08:00
18401019693
3e72b4a9eb 修改设置页面防抖问题,登录loading加载问题 2023-05-22 16:57:12 +08:00
18401019693
4f103dadc9 修改防抖点击问题 2023-05-22 16:48:55 +08:00
18401019693
055d002a34 Merge remote-tracking branch 'origin/master' 2023-05-19 13:33:17 +08:00
18401019693
426f7450a2 修复心愿单问题 2023-05-19 13:33:09 +08:00
73a71dabc6 Merge remote-tracking branch 'origin/master' 2023-05-19 10:43:11 +08:00
435dc1c4fb 调整投票UI 2023-05-19 10:36:06 +08:00
18401019693
f347d283a0 修复心愿单问题 2023-05-19 10:36:03 +08:00
a6754eb503 补充资源 2023-05-18 15:38:55 +08:00
070312ff53 投票修复测试回报问题 2023-05-18 15:02:11 +08:00
bd8cf94171 调整投票隐藏按钮触控范围 2023-05-18 11:21:53 +08:00
98bb182d56 调整投票展示效果 2023-05-18 10:52:59 +08:00
3454b6f924 调整投票展示效果 2023-05-18 10:31:52 +08:00
5af061c26f update 2023-05-17 17:37:34 +08:00
83a240fcb8 update 2023-05-17 16:57:11 +08:00
17decb63fa Merge remote-tracking branch 'origin/master'
# Conflicts:
#	common/src/main/res/values-en-rUS/string.xml
#	common/src/main/res/values-zh-rHK/strings.xml
#	common/src/main/res/values-zh-rTW/strings.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
2023-05-17 16:48:02 +08:00
18401019693
dbe861c608 中英文资源文件 2023-05-17 16:40:50 +08:00
c1c8921f59 Merge branch 'dev_6.5.2'
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
#	common/src/main/res/values-en-rUS/string.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
#	live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
2023-05-17 16:20:10 +08:00
82b3b23470 提交主播投票功能 2023-05-17 16:14:50 +08:00
18401019693
e28c6228ad 清晰度选择提示弹窗问题修复 2023-05-17 16:14:42 +08:00
df0f5f31e0 提交主播投票功能 2023-05-17 15:12:51 +08:00
18401019693
2a6af7c165 清晰度选择提示弹窗问题修复 2023-05-17 13:36:15 +08:00
18401019693
8611817a6a 修改礼物界面的切换逻辑 2023-05-17 13:26:15 +08:00
18401019693
e4c48f948d 完善个人资料,修改getBaseInfos接口返回缓存问题 2023-05-13 17:30:19 +08:00
46e37b14e4 修复从【我的】-【獎勵中心】進去无法唤起邀请对话框的问题 2023-05-13 15:35:08 +08:00
0d86d142c9 修复从侧边栏任务进去的邀请任务无法唤起邀请对话框的问题 2023-05-13 14:47:35 +08:00
18401019693
96cbadac2c 完善个人资料,修改getBaseInfos接口返回缓存问题 2023-05-11 15:05:33 +08:00
18401019693
f8356b1283 完善个人资料,修改getBaseInfos接口返回缓存问题 2023-05-11 14:57:36 +08:00
18401019693
576d39461a 完善个人资料,离开修改页面提示弹窗,完成领取弹窗 2023-05-11 14:34:39 +08:00
18401019693
8410439a90 完善个人资料,选择性别弹窗构建 2023-05-11 10:26:05 +08:00
18401019693
73b075b2a7 完善个人资料,编辑页面调整,领取奖励页面构建 2023-05-10 15:30:36 +08:00
a6b5c102d2 新增【非贵族,守护,粉丝牌送礼交互优化】功能 2023-05-10 14:31:15 +08:00
18401019693
229c8e72cf 完善个人资料,我的页面修改,红点提示逻辑 2023-05-10 13:09:46 +08:00
18401019693
f99bef4ac8 完善个人资料, 2023-05-09 17:37:20 +08:00
34c569ecb5 update config 2023-05-09 14:40:38 +08:00
a041450766 update config 2023-05-09 10:09:03 +08:00
b5673025be fix修复line支付无法唤起app的问题 2023-05-08 14:05:43 +08:00
f0ddd98942 fix修复line支付无法唤起app的问题 2023-05-08 14:04:43 +08:00
e9488df780 update 2023-05-08 13:29:24 +08:00
18401019693
e67287e7d3 修改密码房退出页面问题 2023-04-27 17:00:22 +08:00
18401019693
4b8dd546ce 修改密码房退出页面问题 2023-04-27 11:05:06 +08:00
18401019693
319a23bf2d 修改,中英文问题(聊天框的中英文修改) 2023-04-26 10:16:11 +08:00
611f1da9b8 fix banner顺序不对的问题 2023-04-25 16:45:01 +08:00
1953b5a776 update 调整say关注边距(陈浩反馈) 2023-04-25 15:51:02 +08:00
18401019693
43deb95435 修改,中英文问题(聊天框的中英文修改) 2023-04-25 15:24:57 +08:00
5a9535e81d update 调整登录页登录按钮的位置 2023-04-25 10:00:57 +08:00
18401019693
097528f97a 修改,中英文问题(默认加载系统语言) 2023-04-24 17:31:28 +08:00
abe71808fb Merge remote-tracking branch 'origin/master' 2023-04-24 17:00:56 +08:00
59508a45cb 修复粉丝徽章帮助按钮点击没反应问题 2023-04-24 17:00:43 +08:00
18401019693
11bc23418e 注销账号功能添加 2023-04-24 16:03:20 +08:00
18401019693
5a5164f72b 注销账号功能添加 2023-04-20 17:59:51 +08:00
18401019693
381ca84525 注销账号功能添加 2023-04-20 16:46:10 +08:00
79a709a76f update 开屏过度动画接口开关 2023-04-20 15:10:57 +08:00
18401019693
5dcdd3fc5f 多语言切换 2023-04-19 16:38:56 +08:00
1dce512d27 update 2023-04-19 14:17:01 +08:00
840129651d update 2023-04-19 14:13:11 +08:00
59c19d996e Merge remote-tracking branch 'origin/master' 2023-04-19 14:08:07 +08:00
703bafa013 修复侧边栏UI在英文状态下显示不全的问题 2023-04-19 14:07:56 +08:00
18401019693
9e6e25fb9e 多语言切换 2023-04-19 14:02:45 +08:00
bddf8c71ae 移除调试代码 2023-04-19 13:55:18 +08:00
47c3282861 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	common/src/main/res/values-zh-rHK/strings.xml
#	common/src/main/res/values-zh-rTW/strings.xml
#	common/src/main/res/values-zh/strings.xml
#	common/src/main/res/values/strings.xml
#	main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java
2023-04-19 10:58:02 +08:00
181ff4274c 新增字号设置 2023-04-19 10:54:22 +08:00
18401019693
dc5633bcb9 多语言切换 2023-04-19 10:16:56 +08:00
369f3f2cae 开屏图片转Banner特效 2023-04-18 16:31:31 +08:00
18401019693
293c9dcf9e 多语言切换 2023-04-18 14:51:26 +08:00
18401019693
d0e2278df7 多语言切换 2023-04-18 13:45:21 +08:00
f913248fa1 暂存方案1 2023-04-18 11:03:07 +08:00
18401019693
098ef7aa36 多语言切换 2023-04-18 10:30:55 +08:00
18401019693
bfbbe54308 多语言切换 2023-04-17 16:30:12 +08:00
18401019693
32e3584fef 修改侧边栏跳转问题 2023-04-14 16:09:02 +08:00
18142669586
90c7483dbc 修改关注点击问题 2023-04-14 13:41:52 +08:00
18401019693
e38262826d 关注ui修改,多人pk倒计时问题 2023-04-14 10:59:06 +08:00
18401019693
cbb1531356 心愿单位置移动 2023-04-14 10:46:13 +08:00
18401019693
0ed37aee11 心愿单位置移动 2023-04-14 10:40:14 +08:00
18401019693
c23ed7defb 心愿单位置移动 2023-04-13 18:25:19 +08:00
18401019693
06e077146b 心愿单位置移动 2023-04-13 17:57:40 +08:00
10588e4810 Merge remote-tracking branch 'origin/master' 2023-04-13 17:23:41 +08:00
4b7469d9d4 调整女神说banner布局 2023-04-13 17:23:29 +08:00
18142669586
eb21a17475 修改连麦样试 2023-04-13 17:22:05 +08:00
18142669586
974546697b Merge remote-tracking branch 'origin/master' 2023-04-13 16:45:07 +08:00
18142669586
8507fc1bb7 修改连麦样试 2023-04-13 16:44:41 +08:00
18401019693
bb4f8bb98e 心愿单设置加限制 2023-04-13 16:44:40 +08:00
4a4cc179bf 修复单人PK结算后新进来竖屏直播间,画面异常问题 2023-04-13 16:26:57 +08:00
18142669586
db8dc2a781 修改连麦样试 2023-04-13 15:57:11 +08:00
18401019693
4ae1b12be0 心愿单设置加限制 2023-04-13 15:45:51 +08:00
18401019693
06289b44d9 心愿单设置加限制 2023-04-13 13:08:58 +08:00
18401019693
32fa77be39 心愿单逻辑修改,ui修改 2023-04-13 13:04:12 +08:00
18142669586
9869a2376c 修改toat样试 2023-04-13 11:42:15 +08:00
af4176bcb7 移除ACache读取后最后一个换行符 2023-04-13 10:43:07 +08:00
499b73295d 修复人气票没传liveuid和stream问题 2023-04-13 10:07:42 +08:00
bec764a329 修复从直播间个人中心进去的分享按钮没反应问题 2023-04-12 15:26:57 +08:00
58c988a83a 修复ACache读多行文本未换行问题 2023-04-12 13:15:33 +08:00
18401019693
0506d82165 修改热度加成逻辑展示方式 2023-04-11 16:17:26 +08:00
cfc72f7441 根据需求调整送过一次联系方式礼物后,以后点击联系方式都是直接打开信件详情 2023-04-11 14:37:39 +08:00
18401019693
b305ba925b 修改热度加成逻辑展示方式 2023-04-11 14:14:42 +08:00
e99b18eec6 调整女神说ui 2023-04-10 18:22:37 +08:00
18401019693
38b080f082 6.5.0 2023-04-10 16:07:18 +08:00
18142669586
605f10d0ac 英文包 2023-04-10 15:37:19 +08:00
18142669586
f7480c6e43 修改中英文 2023-04-10 13:44:39 +08:00
ceef0f1e57 修改联系方式 2023-04-10 13:37:57 +08:00
18401019693
19c0c8c6e7 修改生成心愿单 2023-04-10 13:30:47 +08:00
d50c56bbb2 update 2023-04-10 13:07:08 +08:00
8ce65ced30 调整分享附带文案 2023-04-10 11:57:35 +08:00
18401019693
80e93f9981 关注消息修改 2023-04-10 11:54:25 +08:00
a34e90753c Merge remote-tracking branch 'origin/master' 2023-04-10 11:45:41 +08:00
a53da7a2b8 修复通过头像跳转到其他PK直播间,再上下滑回来会依旧保持PK倒计时状态 2023-04-10 11:45:15 +08:00
18401019693
bdd6124300 关注消息修改 2023-04-10 11:42:22 +08:00
47c3f59f74 修复通过头像跳转到其他PK直播间,再上下滑回来会依旧保持PK倒计时状态 2023-04-10 11:33:14 +08:00
76f94895fe 调整直播间UI 2023-04-10 11:14:53 +08:00
e0eea59539 调整直播间UI 2023-04-10 11:07:35 +08:00
18401019693
917d237b6d 关注消息修改 2023-04-10 10:45:07 +08:00
508f1a52ae 调整直播间UI 2023-04-10 10:22:32 +08:00
18401019693
4429dc7a4c 小助手消息修改 2023-04-10 10:05:48 +08:00
18401019693
296a6d24bb 心愿单修改 2023-04-10 09:57:24 +08:00
18142669586
6c19f0efc4 心愿单审核和贵族购买 2023-04-08 18:21:53 +08:00
18401019693
6f7a9a9310 心愿单修改 2023-04-08 18:11:35 +08:00
66e011f2d3 修复女神说主播端不隐藏的问题 2023-04-08 17:33:52 +08:00
18142669586
9e7909ec70 Merge remote-tracking branch 'origin/master' 2023-04-08 17:29:36 +08:00
18142669586
8ae58e9c14 心愿单审核和贵族购买 2023-04-08 17:27:26 +08:00
18401019693
2ce527cee8 心愿单修改 2023-04-08 17:26:39 +08:00
18401019693
28ef982b74 心愿单修改 2023-04-08 16:42:43 +08:00
b44524b25f 修复女神说不隐藏的问题 2023-04-08 16:27:33 +08:00
f76d649233 调整联系方式浮标UI 2023-04-08 16:20:43 +08:00
90fee86c19 修复信息红点显示错误问题 2023-04-08 16:11:41 +08:00
9707898af9 调整直播间UI
修复心愿单浮窗一堆问题
2023-04-08 15:45:47 +08:00
18401019693
9c3fbe0506 心愿单修改 2023-04-08 15:10:16 +08:00
a8178c51a0 调整直播间UI
修复进入直播间快速退出导致的闪退问题
2023-04-08 14:57:22 +08:00
18142669586
2b62d018b5 Merge remote-tracking branch 'origin/master' 2023-04-08 14:14:19 +08:00
18142669586
f7cf72f15f 修改聊天框长度 2023-04-08 14:14:06 +08:00
18401019693
b3d4d2b8f9 xiu gai xinyuan dan 2023-04-08 13:36:12 +08:00
18401019693
8cbbd4015f xiu gai xinyuan dan 2023-04-07 17:34:39 +08:00
51bf55fdeb 修复主播端开播热度值没背景 2023-04-07 16:46:20 +08:00
18401019693
18a5f46133 高等级飘屏修改 2023-04-07 16:44:02 +08:00
f201e0978e 修复主播端开播后点击屏幕无效问题 2023-04-07 16:23:10 +08:00
18401019693
63c2891650 心愿单修改, 2023-04-07 16:07:08 +08:00
af164f549f 修复开播后点击屏幕闪退问题
调整女神说背景固定大小
2023-04-07 16:01:59 +08:00
33034ce4d6 调整心愿单浮标大小
修复注册默认值没香港标识
调整小助手图片位置
2023-04-07 15:37:51 +08:00
18401019693
9d38ff7c8f 心愿单修改, 2023-04-07 15:28:19 +08:00
16caf60f77 更换心愿单浮标背景图
优化分享字符过多显示不全问题
优化女神说浮窗字数过多超过背景图问题
2023-04-07 14:45:12 +08:00
f3bca96ee8 Merge remote-tracking branch 'origin/master' 2023-04-07 14:43:57 +08:00
18142669586
b0ed276e23 修改新人任务的展示 2023-04-07 14:42:07 +08:00
906ff6cfa6 调整观众端点联系方式送礼界面恢复分类tab 2023-04-07 14:02:41 +08:00
6427311cec 修复单人PK发起方会重复两次倒计时问题 2023-04-07 13:58:18 +08:00
181f081706 修复单人PK会丢失结束连麦按钮问题 2023-04-07 11:34:24 +08:00
14490cacfa 修复多人PK不会隐藏女神说和联系方式的问题 2023-04-07 10:57:24 +08:00
6ff83dabff 调整信件top ui 2023-04-07 10:26:46 +08:00
a6d81ef666 移除测试用toast 2023-04-07 09:48:31 +08:00
11679a62a0 Merge remote-tracking branch 'origin/master' 2023-04-06 14:29:41 +08:00
36410ddcaa 调整女神说6字改回4字 2023-04-06 14:29:12 +08:00
18401019693
3bf6518e25 心愿单修改, 2023-04-06 14:20:46 +08:00
18142669586
028f2794bf Merge remote-tracking branch 'origin/master' 2023-04-06 13:32:18 +08:00
18142669586
1c198a44cf 页面修改 2023-04-06 13:31:52 +08:00
1fba3bd53e 调整邀请框的【复制】按钮位置和添加边框 2023-04-06 11:02:30 +08:00
fd15428ed9 新增主播联系方式详情页 2023-04-06 10:34:45 +08:00
18401019693
a5fd14cc0e 去除心愿单礼物贵族和守护的金额 2023-04-03 18:02:29 +08:00
18401019693
3c7a2d3964 心愿单增加礼物金额 2023-04-03 17:57:47 +08:00
18401019693
325d7254f0 视图资源文件修改,心愿单上传数据修改 2023-04-03 15:39:12 +08:00
18401019693
153d5ff159 修改心愿单生成 2023-04-03 15:29:21 +08:00
a86cf97d74 Merge remote-tracking branch 'origin/master' 2023-04-03 15:16:51 +08:00
192587f758 新增通过后端获取国家地区信息接口在注册时自动填写号码编号 2023-04-03 15:15:50 +08:00
18142669586
5697a19f91 Merge remote-tracking branch 'origin/master' 2023-04-03 15:10:13 +08:00
18142669586
1fa1874241 分享邀请码注册绑定 2023-04-03 15:07:48 +08:00
c43b581157 调整联系方式选项 2023-04-03 14:48:35 +08:00
ba5a80fb1d 改回联系方式礼物接口,仅显示热门分类下的礼物 2023-04-03 14:19:22 +08:00
73c8db8fb4 新增通过后端获取国家地区信息接口
调整送联系方式礼物时,不选择其他礼物
调整联系方式礼物接口
调整在模拟器超大分辨率模式下,信箱ui异常问题
2023-04-03 13:28:35 +08:00
18401019693
f55e1b9c05 修改 2023-04-02 17:29:14 +08:00
18401019693
e5a07613aa 修改随机pk轮播背景展示问题 2023-04-02 17:22:10 +08:00
ed46eb30a8 更新功能翻译资源 2023-04-02 17:22:05 +08:00
18401019693
971fceebcd 修改随机pk轮播背景展示问题 2023-04-02 16:37:05 +08:00
18401019693
329bd63229 新增功能翻译资源 2023-04-02 16:31:11 +08:00
18401019693
d320373b07 侧边栏修改,新增播放设置 2023-04-02 14:22:30 +08:00
326bb5ae7f 修复PK倒计时偶尔会提前结束问题(设置倒计时默认值为100解决)
修复PK【开始/结束】不会【隐藏/显示】女神说和联系方式浮窗
2023-04-01 18:29:12 +08:00
18401019693
95c39cca9d 心愿单直播间轮播入口(没有设置就隐藏) 2023-04-01 15:51:52 +08:00
18401019693
849677e50e 心愿单直播间轮播入口 2023-04-01 14:45:48 +08:00
c4ae047a4b 移除分享的结果的Toast 2023-04-01 11:33:20 +08:00
5657d5a00b 修正侧边栏【分享】按钮的文字 2023-04-01 11:22:51 +08:00
4b6b477351 Merge remote-tracking branch 'origin/master' 2023-04-01 11:18:17 +08:00
d035018ada 移除调试代码 2023-04-01 11:18:04 +08:00
e301e7bfce Merge branch 'dev_share'
# Conflicts:
#	main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
2023-04-01 11:15:18 +08:00
97ad5c2d92 update 调整女神说布局大小 2023-04-01 11:14:24 +08:00
43e7713f6b update 兼容女神说接口变动 2023-04-01 09:51:26 +08:00
18142669586
cfce501d45 分享邀请码注册绑定 2023-04-01 09:44:13 +08:00
18401019693
b2f35fdc16 修复豪气榜神秘人问题 2023-03-31 17:52:00 +08:00
87afe9297d 移除调试内容 2023-03-31 17:32:52 +08:00
48f1d42739 Merge branch 'dev_use_discounts'
# Conflicts:
#	common/src/main/res/values/strings.xml
2023-03-31 17:27:24 +08:00
9eed92302d add 购买守护使用优惠卷 2023-03-31 17:26:28 +08:00
18401019693
f12f6a9130 心愿单完成 2023-03-31 16:44:22 +08:00
ef757a8adc update 分享支持社区分享按钮 2023-03-31 15:09:18 +08:00
0177a1314d update 购买守护优惠卷 2023-03-31 14:40:43 +08:00
26cb58463a update 直播間分享 2023-03-31 13:34:57 +08:00
18401019693
d1d8054c01 心愿单的重置提示 2023-03-30 17:43:42 +08:00
18401019693
2db89365bb 季心愿单的设置与展示 2023-03-30 16:46:02 +08:00
18401019693
87ba382e81 月心愿单的设置与展示 2023-03-30 16:36:53 +08:00
18401019693
55290a71aa 周心愿单的设置与展示 2023-03-30 16:28:06 +08:00
18401019693
5095de3c43 日心愿单重置 2023-03-30 16:17:25 +08:00
18401019693
70a91fedf3 心愿单添加部分功能实现 2023-03-30 14:16:50 +08:00
ef8f87d100 Merge branch 'master' into dev_share 2023-03-30 11:47:44 +08:00
6d83c6f8ae Merge branch 'dev_6.5.0_anchor_call_me'
# Conflicts:
#	common/src/main/java/com/yunbao/common/manager/IMLoginManager.java
#	common/src/main/res/values/strings.xml
#	live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
2023-03-30 11:31:32 +08:00
ce2048b9a5 update 女神说主播端显示
update 联系方式改成svga
update PK时隐藏女神说和联系方式
2023-03-30 11:23:11 +08:00
c22da60b82 update 联系方式 2023-03-29 13:39:09 +08:00
c78bb79633 update 联系方式
update 女神说
2023-03-29 13:32:15 +08:00
3a980d22fd Merge branch 'dev_6.5.0_anchor_say' into dev_6.5.0_anchor_call_me
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
#	main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
2023-03-28 11:01:58 +08:00
2b56eff39a update 联系方式 2023-03-27 16:16:23 +08:00
18401019693
9472ccf6c8 修改整蛊界面 2023-03-27 16:00:23 +08:00
18401019693
59d384a81c 修改右下角任务浮标,星级挑战修改 2023-03-27 15:30:30 +08:00
18401019693
c02f24fdcd 修改礼物图标 2023-03-27 15:29:43 +08:00
18401019693
86c5334ab4 高等级入场提示 2023-03-27 14:22:29 +08:00
6ef8c3778b update 女神说 2023-03-27 11:09:03 +08:00
0c6eac2936 新增设置联系方式相关UI 2023-03-24 10:52:44 +08:00
18401019693
62e2b93bd5 修改特权页面背景 2023-03-23 17:43:44 +08:00
18401019693
d80bc3bd27 默认气泡的修改 2023-03-23 17:28:34 +08:00
18401019693
085f19c3ca 修改直播间聊天界面(横竖屏聊天框高度,关注消息修改)直播间头部布局样式修改 2023-03-23 16:36:16 +08:00
f4d23c57df 新增女神说相关UI 2023-03-23 14:26:52 +08:00
18401019693
95429402c7 修改礼物界面样式 2023-03-22 18:20:34 +08:00
18401019693
1da79d6f48 礼物界面,直播间下部按钮布局样式的更改 2023-03-22 18:16:40 +08:00
18401019693
926bd1a22e 直播间聊天内容等级样式更改 2023-03-22 16:57:50 +08:00
18401019693
554bfa137a 消息气泡位置,关注消息默认消息,样式更改 2023-03-22 16:55:51 +08:00
9e5a61f66c update 2023-03-21 18:20:11 +08:00
18401019693
be608fd90b 修改直播间聊天字体背景样式 2023-03-21 17:42:34 +08:00
c9e53b4dfd Merge branch 'master' into dev_share
# Conflicts:
#	app/src/main/java/com/shayu/phonelive/NeverCrashUtils.java
#	config.gradle
#	main/src/main/java/com/yunbao/main/activity/TestActivity.java
2023-03-21 15:00:53 +08:00
c2aba5da4b 优化:调整直播间聊天输入框点击发送后不隐藏软键盘和聊天框 2023-03-21 10:05:02 +08:00
18401019693
420118b652 修改界面的中英文 2023-03-17 15:12:18 +08:00
18401019693
076008ce89 修改界面的中英文 2023-03-17 14:52:55 +08:00
18401019693
8455d1253c 修改界面的中英文 2023-03-17 10:19:35 +08:00
07f8f46f1f 修复:部分用户无法上麦问题
优化:日志上报逻辑
2023-03-17 09:50:26 +08:00
18401019693
8b46c57482 修复推特登录问题 2023-03-15 18:12:01 +08:00
18401019693
db834caf00 Merge branch 'net_error' 2023-03-15 18:11:49 +08:00
5c1eef1419 移除一个toast 2023-03-15 18:11:07 +08:00
fe29d307a9 修复连麦时可能出现50007问题,出现该错误时尝试离开房间后重试加入 2023-03-15 15:49:56 +08:00
18401019693
b8fea6366c 修复推特登录问题 2023-03-14 16:20:23 +08:00
06dddb5273 修复无法唤起推特APP登录 2023-03-14 16:18:40 +08:00
d774296db9 Merge remote-tracking branch 'origin/master' 2023-03-10 16:01:06 +08:00
18401019693
077cc7fd80 修改网络报错提示 2023-03-10 16:00:06 +08:00
18401019693
fdf9d0aea2 多人PK问题修复 2023-03-10 15:48:34 +08:00
92c38dc0dc Merge remote-tracking branch 'origin/master' 2023-03-10 11:24:10 +08:00
18401019693
d8c4b9dd04 多人PK问题修复 2023-03-10 11:06:08 +08:00
18401019693
342b2e9139 多人PK问题修复 2023-03-10 11:05:19 +08:00
88ea48b6ca 新增debug日志控制,方便调出日志用于分析问题 2023-03-09 10:26:10 +08:00
18401019693
0726c5dc1c 多人PK热度加成问题,主播,用户 2023-03-04 16:42:25 +08:00
18401019693
046adc9340 修改多人Pk界面样式 2023-03-04 16:01:27 +08:00
18401019693
46fa2419d3 修改多人Pk界面样式 2023-03-04 15:32:41 +08:00
18401019693
5c5114f808 修改多人Pk界面样式 2023-03-04 15:04:49 +08:00
18401019693
7f2f7ea4d8 修改多人Pk界面样式 2023-03-04 14:31:09 +08:00
a89c441555 修复密码登录界面按物理返回按钮时会回到桌面的问题 2023-03-04 13:56:50 +08:00
a1762bc791 修复密码登录界面点返回按钮时会回到桌面的问题
优化尝试重连im时检测到登录信息失效后返回到登录界面
2023-03-04 13:40:58 +08:00
34432e5ccf 移除闪退提示 2023-03-01 17:17:22 +08:00
18401019693
46f20c9663 修改主播协议的指向 2023-02-28 17:33:25 +08:00
18142669586
e0753ebb29 7.0弹出提示 2023-02-28 16:55:31 +08:00
18142669586
d7d24904bf 單人PK卡0分 優化計算中 2023-02-28 16:54:20 +08:00
18142669586
abbc2fc4ee 單人PK卡0分 優化計算中 2023-02-28 16:46:52 +08:00
07f0f39978 Merge remote-tracking branch 'origin/master' 2023-02-28 15:50:33 +08:00
8d932a09e1 修复与苹果端PK结束后,对方头像依旧存在的问题 2023-02-28 15:50:20 +08:00
18401019693
34c855fc8f di ban ben 2023-02-28 15:19:22 +08:00
18401019693
824d431a63 添加主播消息空页面 2023-02-28 13:06:48 +08:00
af63c4c8ac Merge remote-tracking branch 'origin/master' 2023-02-28 09:37:44 +08:00
18401019693
16ba71493e Android7及7以下默认关闭动画特效 2023-02-27 18:14:44 +08:00
94f8ee7f3b 调整日志格式 2023-02-27 16:33:40 +08:00
e7c97f2b55 移除debug入口 2023-02-27 11:35:22 +08:00
18401019693
a7e6efa0dc Merge branch 'live_anchor_6.4.8' 2023-02-27 11:12:45 +08:00
18401019693
ea9807dcdc 主播协议, 2023-02-24 14:22:49 +08:00
fdd30aa52a 修复多人连麦第三位麦克风位置不正确的问题 2023-02-23 16:54:01 +08:00
18401019693
ba23f720eb 修改社区没办法送礼问题 2023-02-23 14:20:05 +08:00
05ede89cba 修复和助手端进行PK时,助手结束PK,手机端依旧残留结束连麦按钮 2023-02-22 16:26:55 +08:00
d6eddeb130 更新主播任务 2023-02-22 13:50:40 +08:00
bf4710470f 直播数据对接接口 2023-02-21 16:29:50 +08:00
5d2a246916 直播任务对接接口 2023-02-21 13:46:08 +08:00
cca8f43f61 直播任务对接接口 2023-02-20 17:16:37 +08:00
18401019693
1d66a9b7fb 主播用户协议 2023-02-20 16:43:36 +08:00
18401019693
c1c4a7a38b 添加直播任务和直播数据入口 2023-02-18 15:01:16 +08:00
18401019693
b8a91a85e4 Merge remote-tracking branch 'origin/dev_6.4.9' into live_anchor_6.4.8 2023-02-18 14:34:48 +08:00
18401019693
7cb7258210 直播计时功能添加 2023-02-18 13:57:37 +08:00
18401019693
8d823f7a07 主播消息中心功能构建 2023-02-18 13:21:59 +08:00
6d458d0c7f 更新string 2023-02-18 11:09:27 +08:00
eaed7e448b 新增主播数据弹窗 2023-02-18 11:05:06 +08:00
b2f779f58a 新增主播数据弹窗 2023-02-18 11:03:49 +08:00
79ded6bff4 新增主播任务对话框模块 2023-02-17 17:14:01 +08:00
18401019693
d86e16c9f5 修改注册页面选择国家区号功能,添加国家名称 2023-02-15 15:57:53 +08:00
f2cff3b93f 移除闪退测试入口 2023-02-15 14:05:16 +08:00
18401019693
e97a4e607c 添加多人PK名称点击 2023-02-14 15:04:58 +08:00
4d86317ec8 修复发生闪退时会回到社区且连不上IM的问题 2023-02-14 14:42:58 +08:00
d36ece4c54 新增测试闪退入口:在首页长按排行榜图标触发空指针 2023-02-13 16:28:11 +08:00
11cf971514 移除全局异常捕获后杀死进程功能 2023-02-13 16:25:04 +08:00
60da453114 移除全局异常捕获后杀死进程 2023-02-13 16:05:20 +08:00
18401019693
3d5ac05d36 去除非必要提示影响用户体验感 2023-02-13 15:09:54 +08:00
a50a7140fd update Share 2023-02-13 11:21:40 +08:00
18401019693
d3268e57bc 修改,关闭直播间滑动以后为你推荐无法切换直播间问题 2023-02-09 16:21:19 +08:00
18401019693
3549c25cca 修改登录空指针问题
Fatal Exception: java.lang.RuntimeException
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
2023-02-09 14:15:05 +08:00
18401019693
859f54b1e1 修改登录空指针问题 2023-02-09 14:14:02 +08:00
15b232f52a update Share 2023-02-09 10:04:13 +08:00
3c80038bef update Share 2023-02-08 16:01:35 +08:00
a808cd13c0 修复直播间PK时滑动到下一个PK直播间,会残留pk条观众头像问题 2023-02-07 17:04:51 +08:00
ce8088059a 暂存测试几个用intent打开分享的平台 2023-02-07 15:45:42 +08:00
18401019693
cd0067d77b 修改多人PK结束PK送礼仍然展示PK结束画面问题 2023-02-07 14:19:10 +08:00
18401019693
894e264fb3 修改多人PK结束PK送礼仍然展示PK结束画面问题 2023-02-06 18:12:16 +08:00
5dd5b2e0ea 修复直播间PK时通过右上角角标-对方首页(web)-跳转直播间,会残留pk条观众头像问题 2023-02-06 16:28:39 +08:00
d14939c893 create ShareUtil 2023-02-06 15:57:56 +08:00
18401019693
8f58c485c8 用户端多人PK 修改结束后PK问题不结束问题 2023-02-04 16:53:29 +08:00
18401019693
11e809a978 用户端多人PK 2023-02-03 17:42:19 +08:00
18401019693
20aa6002f8 主播端多人PK 代码补提交 2023-02-03 16:40:41 +08:00
18401019693
ffcb0e8790 主播端多人PK 代码补提交 2023-02-03 16:23:31 +08:00
18401019693
3de7160538 主播端多人PK 2023-02-03 16:22:48 +08:00
18401019693
1e595ec526 主播强制关播功能添加 2023-02-02 15:27:41 +08:00
344bbcdfc8 修复与PC端连麦画面会拉升放大的问题 2023-01-29 16:48:29 +08:00
c1aeaa0e1b 修复LiveGiftDialogFragment一处空指针异常问题 2023-01-29 10:55:54 +08:00
e108494bd5 修复获取系统未读消息时userInfo为空导致的获取不到uid导致的闪退问题 2023-01-29 10:43:36 +08:00
bc0e698a77 修复【我的】UserBean.getSlide可能为空导致的闪退问题 2023-01-29 10:41:48 +08:00
b82c87d5d6 修复用户名片渲染用户等级时所使用的Activity被销毁导致的闪退问题 2023-01-29 10:12:05 +08:00
80fe5271f6 修复UserBean的is_bind为空导致【编辑资料】时闪退问题 2023-01-29 09:52:01 +08:00
944d703e36 修复UserBean的is_bind为空导致【编辑资料】时闪退问题 2023-01-29 09:49:04 +08:00
911869ed9f 修复通过【为你推荐】方式进入直播间会有上个直播间残留画面的问题 2023-01-15 09:56:51 +08:00
543336af99 直播间loading动画从10秒改成15秒 2023-01-14 14:51:59 +08:00
5d7cff6707 新增播放定时器,播放后10秒未播放就重新加载播放 2023-01-14 14:30:34 +08:00
1bbab7ac9e 修复滑动直播间到同一个主播时,会黑屏的问题 2023-01-14 13:19:23 +08:00
18142669586
16592aaecb Merge remote-tracking branch 'origin/master' 2023-01-13 17:36:30 +08:00
18142669586
3de9ff57c3 客服页面打不开问题 2023-01-13 17:36:06 +08:00
e932238fc2 修复GoogleFragment.java的url为空导致在输出日志时导致的空指针闪退问题 2023-01-13 09:46:06 +08:00
18401019693
df436bbe1e Merge remote-tracking branch 'origin/master' 2023-01-12 15:09:57 +08:00
18401019693
49bd97f646 上传分支 2023-01-12 15:09:48 +08:00
731f941298 修复幸运百分百活动在英文系统下会闪退问题呢(字符串转义问题) 2023-01-12 13:39:18 +08:00
18401019693
c21df55c06 修复:全服礼物通知,点围观无反应问题 2023-01-12 11:15:47 +08:00
9acbc60db2 随机PK文案调整【120分钟】→【10分钟】 2023-01-12 11:05:24 +08:00
5f2dda021a 新增直播播放缓冲超过2秒就刷新播放流 2023-01-11 18:06:51 +08:00
1244010c3d 修复整蛊设置金币总是为默认值1000 2023-01-11 17:19:37 +08:00
7226d54277 修复连麦用户端默认用小流导致画面模糊的问题 2023-01-11 15:02:19 +08:00
eaafcdd444 修复连麦下麦时会画面卡住的问题 2023-01-11 11:34:15 +08:00
9f9c02b7e7 修复重复切换分辨率会同时播放问题 2023-01-10 17:59:53 +08:00
18401019693
7bffdda6b9 修复:直播结束滚动问题 2023-01-10 17:50:03 +08:00
50d01ccd92 移除调试代码 2023-01-10 17:47:42 +08:00
18401019693
420573736d 修复:直播结束滚动问题 2023-01-10 17:22:15 +08:00
18401019693
aca98cb7e6 修复:直播结束滚动问题 2023-01-10 17:05:21 +08:00
18401019693
f26fb83fec 修复:送礼全服通知展示多个礼物名字问题 2023-01-10 17:04:56 +08:00
1ad9effe91 修复授权相册权限后打开发布动态会闪退问题 2023-01-10 16:57:25 +08:00
418d306d72 修复点系统通知时弹出了画质选项框 2023-01-10 16:33:41 +08:00
3606815a41 优化播放抛错时重新播放
优化滑动直播间时可能出现上一个直播间画面的问题
2023-01-10 16:12:17 +08:00
518e57ee44 优化已经在多人PK时不再切换默认流分辨率 2023-01-10 15:35:15 +08:00
872245c9c9 兼容幸运百分百活动 2023-01-10 15:34:40 +08:00
749f756d58 兼容幸运百分百活动 2023-01-10 13:32:08 +08:00
18142669586
a22dfb6214 單人PK卡0分 優化計算中 2023-01-10 13:27:13 +08:00
18401019693
652e569e2b 修改主播端发布远端流分辨率问题 2023-01-10 11:02:22 +08:00
d480986485 调整延迟200毫秒隐藏loading 2023-01-10 10:34:55 +08:00
2e6efc69e8 调整播放器3 2023-01-09 22:36:51 +08:00
e2761049e5 修复美颜失效问题 2023-01-09 21:29:46 +08:00
ee6a4288b0 调整播放器 2023-01-09 20:30:34 +08:00
7070f5c1b4 调整播放器拉升问题5 2023-01-09 18:30:53 +08:00
cc4cc2f746 调整播放器拉升问题5 2023-01-09 16:20:54 +08:00
93e2a8af02 调整播放器拉升问题4 2023-01-09 15:26:43 +08:00
207811c41d 修復在手机直播的直播间PK时切换分辨率会拉升问题 2023-01-09 14:47:23 +08:00
18401019693
8730a6396f 料体消息添加动画效果 2023-01-09 14:38:32 +08:00
05ff51bd48 Merge remote-tracking branch 'origin/master' 2023-01-09 13:54:18 +08:00
1904eeb3ba 移除Toast提示分辨率信息 2023-01-09 13:54:05 +08:00
18401019693
70126171c6 料体消息添加动画效果 2023-01-09 13:52:34 +08:00
18401019693
ee084d6f33 pk倒计时修复 2023-01-09 13:41:51 +08:00
bacf4fd32f 调整视频播放器3 2023-01-09 13:26:32 +08:00
18401019693
eaae58db31 pk倒计时修复 2023-01-09 10:56:49 +08:00
18401019693
13146595bf 修改直播间聊天删除问题 2023-01-09 10:23:21 +08:00
b3083cdd18 新增保存用户选择分辨率的设置 2023-01-08 21:49:07 +08:00
cf85870810 调整播放器默认流不拼接参数 2023-01-08 18:08:00 +08:00
182e46799a 修复PK时画面异常问题(分辨率未切到4:3)
优化播放器加载速度2
2023-01-08 17:17:31 +08:00
27bd65d3da 调整进直播间loading界面与播放器绑定,播放器准备完成后再隐藏。
优化播放器加载速度1
2023-01-08 15:50:40 +08:00
18401019693
9fcc04cef2 修改直播间聊天记录重叠问题 2023-01-08 14:42:01 +08:00
a1f07b8c20 调整观众端选择分辨率 2023-01-08 14:21:52 +08:00
18401019693
65efa88d4a 软件更新进度问题 2023-01-08 14:09:01 +08:00
01a2d66585 调整聊天室滑动动画效果速度 2023-01-07 17:13:27 +08:00
098e9bf6ba Merge remote-tracking branch 'origin/master' 2023-01-07 16:54:16 +08:00
ddf56963bb 调整PK天梯图标大小 2023-01-07 16:54:05 +08:00
18401019693
eadcaf826b xiu改直播间聊天列表滚动问题,修改热度加成列表等级问题 2023-01-07 16:46:11 +08:00
18401019693
36248eaeef 修改直播间聊天列表 2023-01-07 15:39:26 +08:00
04496c3888 Merge remote-tracking branch 'origin/master' 2023-01-07 15:36:03 +08:00
494aa6b52d 修复直播间画面变形问题 2023-01-07 15:35:53 +08:00
18401019693
4bb51506e3 修改直播间聊天列表 2023-01-07 15:19:33 +08:00
18401019693
112bec58df 修改热度加成问题 2023-01-07 14:53:12 +08:00
0b7a3cc50e 修复直播聊天室抽搐问题 2023-01-07 14:43:35 +08:00
9f517199fe 优化天梯PK连胜标识大小 2023-01-07 14:24:57 +08:00
2393a53466 修复因为更换渲染层导致在切换分辨率时会黑屏的问题 2023-01-07 10:13:34 +08:00
80993c7d2d 更换直播间视频渲染层以修复部分机型和模拟器滑动视频时白屏问题 2023-01-07 09:54:37 +08:00
8c0a23d39a Merge remote-tracking branch 'origin/master' 2023-01-06 15:53:27 +08:00
a0949f0903 暂时取消观众端监测卡顿自动切换分辨率问题 2023-01-06 15:53:09 +08:00
18401019693
42052b7465 软件更新问题更改 2023-01-06 15:49:00 +08:00
a37a92e211 优化PK时点击礼物弹窗隐藏【开通贵族】按钮 2023-01-06 15:04:27 +08:00
18401019693
c3ddc62b95 修改主播端选择分辨率的方法,接口新增参数 2023-01-06 10:03:37 +08:00
18401019693
0a3409f98a 修改主播端选择分辨率的方法,接口新增参数 2023-01-06 09:58:24 +08:00
18401019693
d26a687385 修改主播端选择分辨率的方法,接口新增参数 2023-01-05 18:13:43 +08:00
2f413e260e 调整修改清晰度提示弹窗改回Toast 2023-01-05 17:55:58 +08:00
6fcb194995 调整修改清晰度提示弹窗为黑底白字的而不是Toast 2023-01-05 17:48:10 +08:00
7cea6b4f8d 新增观众端点击未启用清晰度时的提示 2023-01-05 17:28:21 +08:00
16d02c6936 修复直播间观众端视频变形问题 2023-01-05 14:13:56 +08:00
289c93d824 修复直播间滑动未清空靓号标识和靓号背景问题 2023-01-04 17:22:39 +08:00
8f99d68b6f Merge remote-tracking branch 'origin/master' 2023-01-03 16:22:32 +08:00
e0d7137727 修复主播端开播设置clarityType失效问题 2023-01-03 16:22:20 +08:00
18401019693
7a9ed22ec9 新增主页面APk更新功能,区分强制非强制 2023-01-03 16:17:48 +08:00
18401019693
af58ec755d 新增APk内置更新功能 2023-01-03 15:11:20 +08:00
4ad2020b57 修复观众端选择分辨率时会显示主播端相关的提示语 2023-01-03 14:35:13 +08:00
1db24dae4b 优化观众端选择分辨率弹框的代码可读性 2023-01-03 14:26:52 +08:00
76055543c3 调整画质选择UI逻辑 2023-01-03 11:35:34 +08:00
a1d95d6a94 Merge remote-tracking branch 'origin/master' 2023-01-03 10:16:36 +08:00
2143e3eb77 修复魅力榜返回icon不见的问题 2023-01-03 09:42:33 +08:00
18401019693
4a0901ea93 修複踢人邏輯,增加翻譯 2022-12-30 17:24:46 +08:00
18142669586
488bee514d 單人PK卡0分 優化計算中 2022-12-30 16:36:40 +08:00
18142669586
bafea09e44 Merge remote-tracking branch 'origin/master' 2022-12-30 14:58:12 +08:00
18142669586
54923304dc 單人PK卡0分 優化計算中 2022-12-30 14:57:47 +08:00
18401019693
8b357233c2 開播設置,修改開播接口新增分辨率設置參數,網絡內存檢測和提示信息 2022-12-30 14:47:25 +08:00
06b5f99930 调整分辨率参数
移除调试用代码
2022-12-29 18:27:24 +08:00
0b5598346e 新增获取上传网速的方法 2022-12-29 17:55:41 +08:00
18401019693
d81e6b9f04 開播設置,修改開播接口新增分辨率設置參數 2022-12-29 17:04:23 +08:00
87e3dddac5 修复下播后随即PK没有自动取消匹配 2022-12-29 16:34:35 +08:00
55f3ac577b Merge branch 'dev_play_model_exo' 2022-12-29 16:20:51 +08:00
0c053a028e update 清晰度切换 2022-12-29 16:20:39 +08:00
df36529619 Merge remote-tracking branch 'origin/master' 2022-12-29 16:17:14 +08:00
7555510d94 update 清晰度切换 2022-12-29 16:16:08 +08:00
18142669586
2e986db686 單人PK卡0分 優化計算中 2022-12-29 16:12:41 +08:00
660853d5be update 清晰度切换 2022-12-29 15:59:32 +08:00
956bef4b90 update 清晰度切换 2022-12-29 15:59:03 +08:00
18142669586
43c22fca7c 主播PK名字头像新增 2022-12-29 15:17:34 +08:00
5db84c1e61 update 清晰度切换 2022-12-29 13:13:05 +08:00
00c3e0cb77 Merge branch 'master' into dev_play_model_exo 2022-12-29 11:02:12 +08:00
f4b6c46075 Merge remote-tracking branch 'origin/master' 2022-12-29 11:01:44 +08:00
181bb5b445 update 清晰度切换 2022-12-29 11:01:23 +08:00
18401019693
90f58054fa 机器人自动发消息设置页面修改,机器人求关注新增发送消息类型,直播间开播清晰度设置 2022-12-28 18:21:00 +08:00
137dbc72d8 update 2022-12-28 17:51:35 +08:00
18401019693
a7cef3c6f8 机器人自动打招呼 2022-12-27 14:41:17 +08:00
339d460c0f 修复直播聊天室还是会卡不会自动滚动问题 2022-12-27 13:52:01 +08:00
c8ba78f39b 修复直播聊天室还是会卡不会自动滚动问题 2022-12-27 10:17:47 +08:00
18401019693
d31af73479 PK结束消失PK条 2022-12-27 10:03:05 +08:00
18401019693
874800c19d 机器人自动发言 2022-12-24 14:45:20 +08:00
18401019693
404d45893f 机器人自动发言 2022-12-24 14:23:40 +08:00
ed6e95f380 update 2022-12-24 13:41:54 +08:00
c4cfa0becd 调整直播间聊天室动画效果 2022-12-24 11:08:09 +08:00
18401019693
a069562bbe 机器人自动发言 2022-12-24 10:20:51 +08:00
18401019693
9158424a25 机器人自动发言 2022-12-23 18:28:39 +08:00
7488143037 修复聊天室消息大于99消息会混乱的问题 2022-12-23 14:59:05 +08:00
99938f6ed6 修复聊天室消息大于99消息会混乱的问题 2022-12-23 14:57:59 +08:00
18401019693
1bde99f6c9 机器人自动发言 2022-12-23 14:39:24 +08:00
18401019693
e3a9a037ba 直播间机器人 2022-12-23 11:16:02 +08:00
b1d342f791 Merge branch 'dev_robot' 2022-12-22 09:59:20 +08:00
7639a70887 update 机器人 2022-12-22 09:58:43 +08:00
f690cf0b62 修复APP刚启动还没用创建Activity时受到推送通知并试图弹出权限申请对话框时,context为空导致的闪退问题 2022-12-21 16:01:59 +08:00
4dcb12eb4f 更新机器人API 2022-12-21 14:50:58 +08:00
18401019693
af5d8dbf19 修复:直播间内遮盖问题 2022-12-20 15:45:24 +08:00
9cd1638d55 修复GoogleFragment缺少默认构造方法导致在恢复数据的时候闪退问题 2022-12-20 10:59:58 +08:00
dd1570c10e 修复登录时getRandJoinAnchor接口返回info为空导致的空指针闪退问题 2022-12-20 10:55:12 +08:00
3af7ca5d94 修复登录时getRandJoinAnchor接口返回info为空导致的空指针闪退问题 2022-12-20 10:06:48 +08:00
2d2cc21e15 预设机器人设置UI 2022-12-19 17:32:42 +08:00
f872029c9d 新增机器人设置的API 2022-12-19 17:06:59 +08:00
6198489dd4 修复一处可能的空指针错误 2022-12-19 16:05:35 +08:00
cce8e43c24 修复一处可能的空指针错误 2022-12-19 16:05:29 +08:00
cae0599307 优化直播间聊天消息动画效果 2022-12-19 15:32:09 +08:00
18401019693
2c6e88500a 修复:修改关播接口上传参数 2022-12-16 16:22:15 +08:00
efc20c644a 修复直播间长期不动会自动停止滚动的问题 2022-12-16 15:40:37 +08:00
bdc43baaa8 修复直播间长期不动会自动停止滚动的问题 2022-12-16 15:40:03 +08:00
dc529b6640 修复直播间长期不动会自动停止滚动的问题 2022-12-16 13:57:00 +08:00
18401019693
488cc192b2 修复:修改更新Apk逻辑,(雷电模拟器卡死问题) 2022-12-16 13:54:07 +08:00
18401019693
269f6c64a9 修复:修改进入PK房退出以后闪退问题 2022-12-15 16:23:33 +08:00
18401019693
51186169ca 需求:修改空指针问题 2022-12-15 16:07:43 +08:00
18401019693
325e57d1d5 需求:修改登录页面 2022-12-15 15:47:39 +08:00
862ec98fa3 Merge remote-tracking branch 'origin/master' 2022-12-14 18:12:10 +08:00
b827f7bfa6 修复主播可以自己点整蛊拯救的问题
调整整蛊设置
2022-12-14 18:11:41 +08:00
18401019693
786dfb54a3 Merge remote-tracking branch 'origin/master' 2022-12-14 18:10:34 +08:00
18401019693
a373738d70 修复:修复直播间滚动Loading问题 2022-12-14 18:10:21 +08:00
6929276512 移除DEBUG位置 2022-12-14 17:40:52 +08:00
64c33f5709 调整整蛊的UI位置 2022-12-14 17:33:22 +08:00
7330e1ae2b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	config.gradle
2022-12-14 17:32:42 +08:00
f359c9994d 修复PK过程中可以再次打开PK对话框的问题 2022-12-14 17:25:03 +08:00
d49b60a1e1 修复直播间不显示靓号问题 2022-12-14 17:13:25 +08:00
18401019693
ee2cebdc41 修复:修复主播关播数据不展示问题 2022-12-14 17:08:09 +08:00
1407ecc2f2 修复随机PK天梯赛不出现的问题 2022-12-14 16:45:43 +08:00
18401019693
606fc64262 修复:修改主播播放时长位置 2022-12-14 16:31:43 +08:00
a5516ebfb3 移除一处debug位置 2022-12-14 15:35:20 +08:00
dd7214a945 Merge remote-tracking branch 'origin/master' 2022-12-14 14:44:06 +08:00
a20571e050 修复一处Glide的Contexts可能为空的问题 2022-12-14 14:43:28 +08:00
8f7adb3079 修复禁言IM消息过来时,uid可能为空的问题 2022-12-14 14:36:28 +08:00
adcf005e62 修复MainActivity初始化initTXIM时,登录信息失效导致getUid为空的问题 2022-12-14 14:18:25 +08:00
18401019693
8cff0195ad 修复:观看直播时,在直播间内主播Pk不展示对方主播头像问题 2022-12-14 14:08:38 +08:00
98940d7554 修复聊天室添加粉丝徽章,bitmap被回收的问题 2022-12-14 13:57:46 +08:00
4a8c29365c 修复CrashSaveBean的activities数组可能为空的问题 2022-12-14 13:44:22 +08:00
b641a65117 修复IMLoginManager的userInfo可能为空的问题 2022-12-14 13:42:36 +08:00
18401019693
d747407d6b 修复单人PK坐席头像展示问题 2022-12-14 13:08:03 +08:00
f302155912 update Pk补充注释 2022-12-14 11:37:00 +08:00
18401019693
3d60814538 修复单人PK坐席头像展示问题 2022-12-14 11:02:46 +08:00
1293368d59 fix:移除主播端飘屏弹幕选项 2022-12-13 18:11:57 +08:00
18401019693
d1e1f5f4e8 修复:上下滑动直播间,Pk头像展示在不PK得房间的情况 2022-12-13 16:56:06 +08:00
18401019693
b804c20ba0 修复:单人PK,PK条主播端和用户端展示问题 2022-12-13 16:23:13 +08:00
e030db04b9 fix:移除toast 2022-12-13 16:21:57 +08:00
0fcadde670 fix:修复天梯赛连胜标识通过PK-小头像-主页-跳转方式换房间不会被清空的问题 2022-12-13 16:00:17 +08:00
e522d04ead fix:修复开播后没有排位赛图标的问题 2022-12-13 14:35:51 +08:00
18401019693
ce0061e86e 修复:我的页面我的等修改只想新页面,优化:修改加入直播间报错 2022-12-13 14:30:21 +08:00
7ed4043a1f Merge remote-tracking branch 'origin/master' 2022-12-13 13:38:22 +08:00
18401019693
0b97d7bbaf 修复:多人Pk结束动画问题 2022-12-13 13:30:50 +08:00
5317f6d88f fix:修复首页ViewPager.setCurrentItem(int)为null导致的闪退问题 2022-12-13 13:23:00 +08:00
092b2ac519 udpate 移除隨機PK測試用代碼 2022-12-13 11:29:32 +08:00
c9725875b3 fix:整蠱添加禮物新增一些限制提示 2022-12-13 11:24:31 +08:00
6c33ac15f8 fix:修复主播开播返回不会弹出确认框
fix:修复主播点离开后,主播端没有离开遮罩图
2022-12-13 10:28:11 +08:00
af91783b9f Merge remote-tracking branch 'origin/master' 2022-12-12 18:30:48 +08:00
5755aa5232 update 多人PK也用新UI 2022-12-12 18:30:20 +08:00
ddc246e11c update 多人PK也用新UI 2022-12-12 18:18:36 +08:00
18401019693
869ad9adf7 修复:多人Pk结束动画问题 2022-12-12 18:16:53 +08:00
5356d91fef update 多人PK也用新UI 2022-12-12 17:45:15 +08:00
18401019693
f024283e80 修复:人Pk状态展示不正常 2022-12-12 17:00:51 +08:00
49167f332d update 隨機/自由PK 2022-12-12 16:30:32 +08:00
ea69f4bcb7 Merge remote-tracking branch 'origin/master' 2022-12-12 15:14:15 +08:00
18401019693
eaf973b927 修复单人PK胜利状态展示不对问题 2022-12-12 15:02:59 +08:00
fdbf5aee04 Merge branch 'dev_prank'
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
#	common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java
2022-12-12 14:14:06 +08:00
e4c490577d update 整蛊 2022-12-12 14:11:05 +08:00
18401019693
b5247df69b 完成全服通知功能 2022-12-12 14:10:09 +08:00
d39ee17cc4 update 整蛊 2022-12-12 13:45:41 +08:00
07da7acacd update 整蛊 2022-12-10 18:28:40 +08:00
18401019693
28add09f32 修复:消息中心接受到多人PK问题 2022-12-10 17:53:49 +08:00
18401019693
9d69610713 修复:pk一次后,重新发起pk报50002错误 2022-12-10 17:39:11 +08:00
18401019693
32969a58db 修复:单人pk时间结束后,用户端由半屏自动变全屏 2022-12-10 17:38:33 +08:00
b188613035 Merge branch 'dev_random_pk' 2022-12-10 17:30:48 +08:00
308d5acc21 update 整蛊 2022-12-10 17:30:11 +08:00
18401019693
284b9784d6 多人Pk功能撤回 2022-12-10 16:20:13 +08:00
26f02065df update 随机PK 新增请求连麦超时管理 2022-12-10 16:08:04 +08:00
eef852c283 Merge branch 'dev_random_pk' 2022-12-10 15:03:00 +08:00
e0287899f8 update 随机PK RTC控制器新增超时管理 2022-12-10 15:01:24 +08:00
ae020b105a update 随机PK 修复返回uid为空时未进行下一轮PK问题 2022-12-10 15:00:48 +08:00
62c3cdcb30 update 随机PK 修复对方主播正在PK时不会继续调用next接口 2022-12-10 14:59:51 +08:00
01c657fdcb update 随机PK 修复对方主播正在PK时不会继续调用next接口 2022-12-10 14:59:21 +08:00
3a75e24601 update 随机PK 补充拒绝PK后的对话框 2022-12-10 14:58:50 +08:00
e28c393f88 update 随机PK 移除测试延迟代码 2022-12-10 14:58:01 +08:00
bfe8034b24 update 自由PK 注释 2022-12-10 14:55:21 +08:00
c056dfe246 update 自由PK 2022-12-10 14:55:03 +08:00
a7cf09de1e update 自由PK 2022-12-10 14:51:49 +08:00
7c4c22d69e 优化随机PK前先检测是否开启了连麦功能 2022-12-10 14:48:35 +08:00
3747f214b1 *新增长按随机PK【开始匹配】按钮可输入指定UIDPk的测试模式 2022-12-10 14:47:37 +08:00
18401019693
503fb0d7f1 单人Pk问题主播端修复修复 2022-12-10 14:47:29 +08:00
18401019693
6b0500b5ff 降低融云sdk 2022-12-10 13:41:38 +08:00
ae8c6cc23d update 单人PK 恢复PK计时不动的问题 2022-12-10 11:12:58 +08:00
ad028c69d0 update 自由PK 次数用完了提示用户
update 自由PK 调整UI
2022-12-09 17:51:15 +08:00
03b3398bce update 随机PK 修复对方主播正在PK时不会继续调用next接口 2022-12-09 17:35:39 +08:00
4a84283000 update 随机PK 调整拒绝PK回报服务器的时机 2022-12-09 17:19:50 +08:00
c49c560e8d update 随机PK 补充拒绝PK后的对话框 2022-12-09 17:08:12 +08:00
8d3ac7761f update 随机PK 移除测试延迟代码 2022-12-09 16:58:20 +08:00
a1d9b1f75b update 自由PK 注释 2022-12-09 16:47:00 +08:00
18401019693
afed0c8833 修改用户端多人PK视频顺序 2022-12-09 16:40:42 +08:00
415ed2fc9b update 自由PK 2022-12-09 16:39:41 +08:00
8e45e17768 update 自由PK 2022-12-09 14:13:47 +08:00
18401019693
576a30d1be 修改多人PK主播名称大小 2022-12-09 14:01:46 +08:00
18401019693
e380c8dcbc yh端多人Pk合流完成,Pk结束完成 2022-12-09 13:48:10 +08:00
5e9f23286e 优化随机PK前先检测是否开启了连麦功能 2022-12-09 10:15:20 +08:00
1bbc78fb32 *新增长按随机PK【开始匹配】按钮可输入指定UIDPk的测试模式 2022-12-09 09:50:47 +08:00
b56368412c Merge branch 'dev_random_pk'
# Conflicts:
#	common/src/main/res/values/strings.xml
#	config.gradle
#	live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java
#	live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java
#	live/src/main/java/com/yunbao/live/socket/SocketRyClient.java
2022-12-09 09:30:17 +08:00
4ad75a11a8 update 随机PK 2022-12-08 18:14:13 +08:00
3fa259c5b9 优化:调整天梯赛左右下角连胜字样大小
update 随机PK
2022-12-08 17:45:21 +08:00
18401019693
4cd4939c58 zb端多人Pk合流完成,Pk结束完成 2022-12-08 17:29:29 +08:00
b20141de02 update 整蛊 2022-12-08 14:42:33 +08:00
9eff246f06 update 随机PK&自由PK 2022-12-08 13:32:26 +08:00
285a33ff9a update 随机PK拒绝对话框 2022-12-08 11:34:31 +08:00
18401019693
7ebd935eba 多人Pk开播 2022-12-07 17:59:10 +08:00
f62a093092 update 自由PK 2022-12-07 16:10:22 +08:00
28b4a36800 完成随机PK模块 2022-12-07 15:36:23 +08:00
ec59fce097 修复新人特惠弹窗高度为1的问题 2022-12-06 17:53:17 +08:00
e134ef8d54 update 随机PK 2022-12-06 17:40:44 +08:00
29ddc68870 优化:WebViewActivity.java 兼容三按键导航栏 2022-12-06 16:58:30 +08:00
9ead9a6fb8 Merge branch 'master' into dev_random_pk
# Conflicts:
#	live/src/main/res/values/strings.xml
2022-12-05 17:46:57 +08:00
2a2672587c 关闭leakcanary 2022-12-05 17:44:49 +08:00
98122c25d8 优化LiveUserMoreDialogFragment.activity强引用导致的内存泄漏 2022-12-05 17:41:42 +08:00
84c89d7530 优化观众LiveRoomViewHolder强引用Context导致的内存泄漏 2022-12-05 17:41:42 +08:00
4268816539 优化观众直播间Activity强引用导致的内存泄漏 2022-12-05 17:41:42 +08:00
721172d48a 优化观众直播间PortraitLiveManager的强引用导致的内存泄漏 2022-12-05 17:41:42 +08:00
3e7942dbd4 优化观众直播间PortraitLiveManager的强引用导致的内存泄漏 2022-12-05 17:41:42 +08:00
17d18eff98 修复PPortraitLiveManager一处内存泄漏 2022-12-05 17:41:42 +08:00
0d422177ac 修复一处内存泄漏 2022-12-05 17:41:42 +08:00
6336eab32a 移除AliPay代码 2022-12-05 17:41:42 +08:00
f91a3f3fc1 优化对话框可能闪退的BUG 2022-12-05 17:41:41 +08:00
a489a6d00d 移除AliPay代码 2022-12-05 14:18:17 +08:00
8d8cff8d1b 修复直播间滑动列表数组下标溢出BUG 2022-12-05 10:30:15 +08:00
18142669586
5f487f74bd 修复多人连麦问题 2022-12-02 17:09:20 +08:00
857206e3da 修改连麦视频高度异常问题 2022-12-01 19:22:40 +08:00
18401019693
4ebe56913a 直播横竖屏问题修改 2022-12-01 19:13:52 +08:00
18401019693
efcc2591c2 直播横竖屏问题修改 2022-12-01 19:04:46 +08:00
18401019693
455b330b7d 关播时间问题 2022-12-01 18:53:12 +08:00
18401019693
ed2879e263 关播时间问题 2022-12-01 18:45:03 +08:00
3b1c5ac1ec 补充守护icon注释 2022-12-01 18:06:30 +08:00
18401019693
d243ffb380 修复守护问题 2022-12-01 17:56:21 +08:00
6bdd81038b Merge remote-tracking branch 'origin/master' 2022-12-01 17:29:12 +08:00
1eff58aca1 优化PK排位赛固定高度 2022-12-01 17:29:01 +08:00
18401019693
fa6eda5936 融云失败回调添加直播结束调用 2022-12-01 17:28:49 +08:00
18401019693
72f7e00dd5 修复退出直播间问题 2022-12-01 17:25:41 +08:00
707e083684 Merge remote-tracking branch 'origin/master' 2022-12-01 16:59:08 +08:00
8b4f88c766 新增开屏图 2022-12-01 16:58:05 +08:00
18401019693
ae3ac93248 主播,是否在播 2022-12-01 16:45:20 +08:00
18142669586
f43ccea32a 版本更新問題 2022-12-01 16:15:16 +08:00
18401019693
73684b9962 在线用户弹窗粉丝牌修改,我的等级页面边距修改 2022-12-01 14:51:29 +08:00
18401019693
80a1508dfc 修复手机开播Pk界面问题,直播间聊天滚动至底部优化 2022-12-01 13:34:25 +08:00
0b1393615c 修复PK结束后对方头像没隐藏问题 2022-12-01 13:19:57 +08:00
18401019693
4481b102ef 侧边栏任务领取问题修复 2022-11-30 19:05:00 +08:00
cab59a5f4a Merge remote-tracking branch 'origin/master' 2022-11-30 18:56:48 +08:00
9f6cd3fd6f 修复直播间多人PK滑动到下一个直播间依旧有PK条的问题 2022-11-30 18:56:16 +08:00
18401019693
4c5730d3bf 直播间聊天滚动问题 2022-11-30 18:50:14 +08:00
18401019693
1222aa9819 Merge remote-tracking branch 'origin/master' 2022-11-30 18:43:12 +08:00
18401019693
e58915edb6 直播间聊天滚动问题 2022-11-30 18:43:02 +08:00
18142669586
4d4c251ebd Merge remote-tracking branch 'origin/master' 2022-11-30 18:41:34 +08:00
18142669586
6a416aaba1 多人pk问题 2022-11-30 18:41:10 +08:00
bbb25cde50 Merge remote-tracking branch 'origin/master' 2022-11-30 18:40:46 +08:00
210749ebd3 移除多人连麦下麦黑屏问题 2022-11-30 18:34:18 +08:00
637fedcbe6 移除多人连麦列表一直刷新问题 2022-11-30 18:33:55 +08:00
18401019693
70b05b85d7 直播间闪烁问题 2022-11-30 17:37:20 +08:00
9a1cefdb70 移除主播未创建连麦房的【连麦房间不存在】Toast提示 2022-11-30 16:38:08 +08:00
6ca8fb0c29 新增下麦后100毫秒后检测播放器是否在播放,如果未播放则强制播放purl 2022-11-30 16:37:58 +08:00
18401019693
8e7de87c6b 侧边栏数据请求前移 2022-11-30 15:46:38 +08:00
cb55c09624 修复连麦时通过返回键触发弹窗后,直播间恢复允许滑动问题 2022-11-30 13:50:44 +08:00
18401019693
a41a58dc26 主播聊天问题修复 2022-11-30 13:20:23 +08:00
f257c2b5a9 修复多人连麦下麦后播放器横竖屏切换异常 2022-11-30 13:15:40 +08:00
18401019693
f5bd17f832 直播间聊天复用 2022-11-30 10:43:27 +08:00
1b7296c13b 修复滑动直播间观众列表头像装饰未清除问题 2022-11-30 10:24:00 +08:00
a965a83653 优化在连麦中禁止直播间滑动 2022-11-30 10:18:54 +08:00
18401019693
5cc521d93c 新增搜索主播等级标志, 2022-11-30 09:44:37 +08:00
6f2a893a4e 新增连麦头像框 2022-11-29 17:45:36 +08:00
1548b6f252 修复测试反馈的问题:上下滑动直播间会带着PK提示 2022-11-29 17:45:08 +08:00
18401019693
0c6b62ed1a 系统Im消息展示不出来问题修复 2022-11-29 16:39:09 +08:00
18401019693
1fcb3d312c 直播间头部展示上一个直播间数据问题,配合H5调整网页加载问题 2022-11-29 15:39:56 +08:00
35b24c261e 修复测试反馈的问题:用户名片点贵族跳转没用 2022-11-29 15:32:55 +08:00
e5c5a2e5f5 修复测试反馈的问题:滑动直播间数据没刷新 2022-11-29 15:25:27 +08:00
9934d53390 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java
2022-11-29 14:44:34 +08:00
030fdb6ad0 修复【在连麦中可以通过全屏广播跳转】 2022-11-29 14:37:50 +08:00
18401019693
cf4948a3e2 悬浮窗视频调整,主播离开下滑直播间离开画面不消失问题修复 2022-11-29 14:34:23 +08:00
afd4cb6e41 修复【在线观众列表,不应该显示粉丝牌】 2022-11-29 14:07:24 +08:00
596c9f9962 修复【在线观众列表,先点粉丝再点日榜周榜,粉丝牌没有消失。】 2022-11-29 14:02:22 +08:00
020bbf322d 修复【关注主播后赠送粉丝牌后进不去粉丝团任务界面,需要重进直播间才可以。】 2022-11-29 13:54:43 +08:00
05b1a9bc74 修复第一次进直播间购买守护显示为空的问题 2022-11-29 13:09:54 +08:00
7f001ba887 修复多人连麦回到桌面再返回直播间丢失连麦图标问题 2022-11-29 11:38:35 +08:00
18401019693
744de267dd 优化新人任务的判断逻辑,贵族通知切换直播间的逻辑优化 2022-11-29 10:18:48 +08:00
18401019693
af26dc24c7 直播间错误下滑 2022-11-28 18:10:37 +08:00
18401019693
e9fa533e5a 修复多次调用检查直播间接口问题 2022-11-28 18:09:20 +08:00
3bd4301cda 修复直播间@列表 userlistModels为空导致的问题 2022-11-28 16:36:52 +08:00
23be58c4e8 修复IM消息获取getUserBean.getId()为空导致的问题 2022-11-28 16:36:51 +08:00
718d4a5d2f 修复星级挑战data.getImageUrl()为空导致的问题 2022-11-28 16:29:21 +08:00
733678532a 修复首页Banner进直播间没有弹新人特惠问题 2022-11-28 15:57:50 +08:00
6fb29bbf60 修复推送通知权限提示框非activity导致的闪图问题 2022-11-28 15:27:28 +08:00
ecbfa57276 Merge remote-tracking branch 'origin/master' 2022-11-28 14:55:55 +08:00
fc59a6f182 修复从个人名片跳转到他直播间不会关闭个人名片的问题 2022-11-28 14:55:47 +08:00
83039d7b29 修复连麦小窗再进直播间会闪退问题 2022-11-28 14:52:39 +08:00
18401019693
e405965298 修复多次调用检查直播间接口问题 2022-11-28 14:42:24 +08:00
18401019693
e6766dc5eb 修复直播间滚动,横竖屏展示错误问题 2022-11-28 14:36:29 +08:00
fe027e53db 优化主播连麦邀请/同意时提示体验 2022-11-28 10:59:11 +08:00
18401019693
546d9b5728 第十次接口合并,手机开播横屏展示修复 2022-11-28 10:46:49 +08:00
7008ccc505 优化主播连麦邀请/同意时提示体验 2022-11-28 10:25:26 +08:00
1fc8977f99 补充连麦API注释 2022-11-28 10:12:18 +08:00
4acba02c6a 补充更多跳转直播间前连麦检测 2022-11-28 10:10:21 +08:00
18401019693
491427feba 合并接口第九次上传,直播間切換直播 2022-11-26 17:41:58 +08:00
18401019693
249d251708 合并接口第八次上传,直播間切換直播 2022-11-26 17:12:02 +08:00
18401019693
96eee88c82 合并接口第七次次上传,跳轉統一性 2022-11-26 17:01:40 +08:00
18401019693
7005895d90 合并接口第liu次次上传 2022-11-26 16:52:11 +08:00
18401019693
3bdee09402 合并接口第五次次上传 2022-11-26 16:12:22 +08:00
2843131151 修复连麦看观众列表json转换丢失数据问题 2022-11-26 14:36:50 +08:00
a8d4d64174 Merge remote-tracking branch 'origin/master' 2022-11-26 11:38:07 +08:00
1853acd5eb 补充直播间加载配位赛接口 2022-11-26 11:37:32 +08:00
18401019693
03a4054ee5 合并接口第四次上传 2022-11-26 11:37:03 +08:00
fe66792935 Merge remote-tracking branch 'origin/master' 2022-11-26 11:08:25 +08:00
18401019693
082c9d7d12 合并接口第三次上传 2022-11-26 11:07:56 +08:00
e35eb5ac7f 修复一处回报的闪退异常 2022-11-26 10:57:31 +08:00
18401019693
5e631652a9 合并接口第er次上传 2022-11-25 17:58:15 +08:00
4eb9adad78 调整检测连麦对话框位置
修复一处闪退问题
2022-11-25 17:48:47 +08:00
4a9a8c3ec3 Merge remote-tracking branch 'origin/master' 2022-11-25 16:28:19 +08:00
18401019693
450047aae2 合并接口第一次上传 2022-11-25 16:26:56 +08:00
eb65c0e101 优化主播下播时也同步关掉连麦房 2022-11-25 15:31:14 +08:00
6bd29ec63e 调整在线列表-守护-空列表时的图片显示 2022-11-25 14:55:56 +08:00
f0231be306 调整购买守护界面守护全年的文本颜色 2022-11-25 14:26:38 +08:00
b12547cd88 补充多人连麦文案
修复主播发起邀请时会在私聊里显示私聊im代码
2022-11-25 13:49:14 +08:00
ed6b531b8d update 随机PK 2022-11-24 18:08:45 +08:00
47b9487e13 调整连麦主播邀请用户时,用户的弹框样式 2022-11-24 17:08:38 +08:00
ec40f8fa0d 补充下麦时调用融云接口 2022-11-24 16:35:33 +08:00
86a0a19fec 修复一处闪退问题
新增统一连麦状态管理类
修复连麦过程中可以通过回到桌面-重进APP,从而可以进入其他直播间问题(方案:连麦中点击其他直播间先询问是否退出连麦)
2022-11-24 16:27:02 +08:00
e0b69be2d4 update 随机Pk 2022-11-24 15:34:51 +08:00
a2ad006a7e 修复心愿单高度异常问题 2022-11-24 13:45:59 +08:00
9b17c1225a update 随机Pk 2022-11-24 13:34:09 +08:00
18401019693
32881d3f35 修复主播发动态身份判断问题 2022-11-24 10:40:27 +08:00
e8367b8f1a 调整直播间观众列表贵族icon不居中问题 2022-11-23 18:12:05 +08:00
fc1bada607 修复部分弹框没有动画效果 2022-11-23 18:01:33 +08:00
1eca5b0309 Merge remote-tracking branch 'origin/master' 2022-11-23 17:41:44 +08:00
08906e028a 修复三按键导航模式下,首页Banner进去可能网页底部显示不全的问题 2022-11-23 17:41:34 +08:00
18401019693
6e36e15ef3 删除埋点(adjust-android) 2022-11-23 17:16:45 +08:00
d71fe7d92e 调整直播准备界面-选择频道UI 2022-11-23 16:55:08 +08:00
72ca2b7b04 修复美颜滤镜的bar显示导致对话框抖动问题 2022-11-23 16:49:01 +08:00
5768ff5518 调整个人名片UI 2022-11-23 16:33:39 +08:00
8a03b194b2 update 随机PK 2022-11-23 16:07:57 +08:00
0d18a135ec Merge remote-tracking branch 'origin/master' 2022-11-23 15:21:54 +08:00
91fdef55c7 更新多人连麦主播端部分代码注释
限制多人连麦直播端仅允许同意/邀请三人
2022-11-23 15:21:44 +08:00
18401019693
4d437be248 修改直播间切换送礼列表不停止问题 2022-11-23 15:04:04 +08:00
d42835231e 调整多人连麦踢人后刷新列表 2022-11-23 14:42:00 +08:00
3d117dbcb4 Merge remote-tracking branch 'origin/master' 2022-11-23 14:14:34 +08:00
202aedbcf3 新增多人连麦主播端 2022-11-23 14:14:02 +08:00
18401019693
14a4bc4343 修改直播间图标间距和贵族大小 2022-11-23 14:08:04 +08:00
18401019693
011322dd8e 贵族开通全服通知 2022-11-23 13:42:55 +08:00
18401019693
0d219e4b6d act进入退出动画 2022-11-22 18:15:25 +08:00
18401019693
1972144384 贵族点击 2022-11-22 17:12:15 +08:00
18401019693
08e7e6b461 礼物弹窗更改 2022-11-22 14:57:13 +08:00
dbba33f085 修复重进直播间不显示PK提示的问题 2022-11-22 14:28:29 +08:00
4a637d0a69 创建随机PK分支 2022-11-21 15:39:12 +08:00
18401019693
a9d323354b Js接口整合后续更改 2022-11-21 15:22:54 +08:00
18401019693
4cd1c22d01 6.4.5 307 2022-11-18 18:15:22 +08:00
18401019693
55ff7a1649 6.4.5 306 2022-11-18 17:43:27 +08:00
18401019693
3deb3693b3 测试更改 2022-11-18 17:40:37 +08:00
009efc2c86 屏蔽点击版本号分享日志的功能 2022-11-18 17:02:55 +08:00
40b37b49f9 修复聊天框内容变宽的问题 2022-11-18 16:39:09 +08:00
a3ad9a17c7 修复主播用户名片点击粉丝团/守护席跳转的是当前直播间的粉丝团/守护席 2022-11-18 16:33:07 +08:00
18401019693
2c13c3dce1 测试更改 2022-11-18 15:59:15 +08:00
18401019693
859d884941 测试更改 2022-11-18 15:49:24 +08:00
4a28abf5b7 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	main/src/main/java/com/yunbao/main/activity/MainActivity.java
2022-11-18 15:30:42 +08:00
527bb0f1d9 调整通知权限的弹出位置 2022-11-18 15:29:10 +08:00
0429e7ca36 修改直播间左上角靓字 2022-11-18 15:25:56 +08:00
18401019693
e8f13d7590 测试更改 2022-11-18 15:18:50 +08:00
7eb3e567f6 调整个人卡片UI 2022-11-18 15:14:32 +08:00
17ec4753b6 调整PK位置 2022-11-18 14:43:26 +08:00
2371ef1dee 调整个人名片卡主播显示主播等级底图 2022-11-18 14:42:12 +08:00
c99d139940 修复首页排行榜需要点击两次才能关注的问题
修复首页排行榜top3点击直播进个人中心问题
2022-11-18 14:38:54 +08:00
e0a2f7c798 调整天梯赛点击事件 2022-11-18 13:52:06 +08:00
a12524dc9c Merge remote-tracking branch 'origin/master' 2022-11-18 13:45:21 +08:00
18401019693
c08cf6ea57 测试更改 2022-11-18 13:42:02 +08:00
20746185e0 调整直播间礼物弹框高度 2022-11-18 13:12:01 +08:00
54cf0e213f 修复一处观众端接受PK IM消息导致闪退问题 2022-11-18 11:22:55 +08:00
18401019693
6654fe0434 测试更改 2022-11-18 10:34:51 +08:00
324917672c 调整排行榜点击正在直播的主播直接跳到直播间 2022-11-17 18:26:29 +08:00
d0a373123a Merge remote-tracking branch 'origin/master' 2022-11-17 17:54:39 +08:00
86b7ad6d92 修复通知栏布局显示不全的问题 2022-11-17 17:54:31 +08:00
c949667b94 修复排行榜没有位置时依旧显示钻石图标的问题 2022-11-17 17:32:51 +08:00
a61a41a068 新增检测通知权限弹窗 2022-11-17 17:21:05 +08:00
06d241c66c 修复首页排行榜闪退问题 2022-11-17 17:20:26 +08:00
62ed0ae78e 调整天梯赛大小 2022-11-17 17:12:41 +08:00
1ee335abf2 调整用户卡片的主播判断 2022-11-17 16:55:04 +08:00
18401019693
05ee59618b 测试更改 2022-11-17 16:03:17 +08:00
18401019693
fffa7cdabd 测试更改 2022-11-17 16:01:56 +08:00
b8ec25c94e 调整用户卡片齿轮出现的权限 2022-11-17 15:30:01 +08:00
38029f7268 调整用户卡片齿轮出现的权限 2022-11-17 15:21:57 +08:00
d2fdccadf2 调整用户卡片齿轮位置 2022-11-17 14:23:06 +08:00
18401019693
b1d06a4f1a 网页加载错误显示错误网址问题 2022-11-17 13:28:07 +08:00
18401019693
ecf3a94b64 网页加载错误显示错误网址问题 2022-11-17 13:26:01 +08:00
18401019693
99b9af2980 网页加载错误显示错误网址问题 2022-11-17 11:48:01 +08:00
18401019693
267d07f3a5 网页加载错误显示错误网址问题 2022-11-17 11:37:35 +08:00
977bfa910c 调整用户信息卡片 2022-11-16 18:28:12 +08:00
fe3c9c1563 Merge remote-tracking branch 'origin/master' 2022-11-16 18:26:50 +08:00
18401019693
8c11818b49 侧边栏修改,直播关播页面BUg修改 2022-11-16 18:16:20 +08:00
ee0d8dd1a0 Merge remote-tracking branch 'origin/master' 2022-11-16 17:25:21 +08:00
18401019693
1d50f8e4f5 侧边栏修改,直播关播页面BUg修改 2022-11-16 17:22:34 +08:00
e8f9884365 修复一处登录时空指针错误 2022-11-16 17:08:10 +08:00
38f6f2f451 修复滑动后Banner只剩下心愿单问题 2022-11-16 17:02:46 +08:00
a664ff7464 调整天梯排位赛UI位置
新增排位赛轮播点击事件
2022-11-16 16:31:48 +08:00
a4ab6df974 调整直播间重制UI 2022-11-16 16:12:57 +08:00
dc8f32062c 修复滑动直播间,部分UI未还原问题 2022-11-16 15:50:04 +08:00
0a090301df Merge branch 'dev_pkrank' 2022-11-16 15:03:51 +08:00
d53d250e6f 调整PK排位赛判断 2022-11-16 15:03:25 +08:00
18401019693
897a47bee7 侧边栏修改 2022-11-16 14:30:11 +08:00
0f457efce6 调整仅接口返回有top图片时才认为是排位赛并显示UI 2022-11-16 14:07:07 +08:00
7842c1b838 调整PK排位赛中,连胜大于等于3场才显示连胜字样 2022-11-16 13:47:05 +08:00
02a5ceaacc Merge remote-tracking branch 'origin/master' 2022-11-16 13:38:43 +08:00
6b1c223acd 修复打包后PK中屏蔽暂时离开失效问题 2022-11-16 13:38:27 +08:00
18401019693
09a9e023d3 侧边栏修改 2022-11-16 13:16:46 +08:00
9b37374066 新增PK TOP 2022-11-16 11:27:44 +08:00
45257e8fe1 Merge branch 'master' into dev_pkrank
# Conflicts:
#	common/src/main/java/com/yunbao/common/http/PDLiveApi.java
2022-11-16 11:22:35 +08:00
18401019693
85971339d4 侧边栏修改 2022-11-15 16:03:41 +08:00
18401019693
383e8c0859 悬浮窗修改 2022-11-15 13:54:28 +08:00
749ac197de 新增PK TOP 2022-11-15 11:35:03 +08:00
d20210f291 创建PK排位赛分支 2022-11-15 09:53:15 +08:00
18401019693
da3398f1f9 侧边栏修改 2022-11-14 16:54:42 +08:00
81763110d7 Merge remote-tracking branch 'origin/master' 2022-11-14 15:38:34 +08:00
6ac610e1aa Merge branch 'dev_room'
# Conflicts:
#	live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java
2022-11-14 15:27:55 +08:00
18401019693
362cc3814e 领取任务奖励逻辑 2022-11-14 15:20:12 +08:00
37dfa05a25 调整靓号icon 2022-11-14 13:57:28 +08:00
18401019693
2df205218c 用户等级和粉丝团的更改 2022-11-14 11:44:10 +08:00
18401019693
cceb697739 充值逻辑 2022-11-12 18:00:00 +08:00
7d63869d44 调整 隐藏我的-我的等级,webview的title 2022-11-12 17:52:01 +08:00
3b1cecf8a3 Merge remote-tracking branch 'origin/master' 2022-11-12 17:09:20 +08:00
e52ec4a2b8 调整日志收集 2022-11-12 17:08:58 +08:00
18401019693
ed300eec30 Js调用原生整改 2022-11-12 17:08:48 +08:00
8455c360fc 调整日志收集的参数 2022-11-12 16:56:02 +08:00
059bfaf1d9 调整日志收集的参数 2022-11-12 16:44:06 +08:00
18401019693
9f0b6897f1 Js调用原生整改,主播踢人不退出房间问题修改 2022-11-12 16:05:04 +08:00
2119d75e5b 补充个人名片主播端踢人选项 2022-11-12 15:48:45 +08:00
af39c4bac0 调整日志输出格式
调整个人名片-工会大小
2022-11-12 15:09:49 +08:00
93ac837148 调整礼物支付默认跳转页面为【钻石】 2022-11-12 13:44:28 +08:00
c4f3d10419 补充日志分享为打包压缩文件 2022-11-12 13:35:29 +08:00
3f9cf21b8f 全量日志采集系统改为保存三天内的 2022-11-12 11:32:11 +08:00
e9a8a4dc02 Merge remote-tracking branch 'origin/master' 2022-11-12 09:58:35 +08:00
18401019693
84f352a7fb Js调用原生整改 2022-11-11 18:32:35 +08:00
834170e272 新增全量日志采集系统 2022-11-11 17:47:28 +08:00
042f53e134 tmp 2022-11-11 15:04:02 +08:00
0b041bad7b 修复多人PK接收方次数用完依旧会加入的问题 2022-11-11 14:04:58 +08:00
fe124dad0c 调整支付页面H5可缩放 2022-11-11 11:39:49 +08:00
18401019693
7fe7178b27 小菜单的展开 2022-11-11 11:38:46 +08:00
18401019693
9dcc23960e 小菜单的展开 2022-11-11 09:53:10 +08:00
18401019693
140e5740e6 任务 2022-11-10 17:04:06 +08:00
18401019693
752fae680c 趣味活动 2022-11-10 16:41:27 +08:00
e2f8e52583 修复一处PK中的空指针问题 2022-11-10 15:14:17 +08:00
4d573767f7 Merge remote-tracking branch 'origin/master' 2022-11-10 15:04:59 +08:00
56475e729c 禁止PK过程中主播点离开按钮 2022-11-10 15:04:42 +08:00
8f0a1a09a6 修复关闭小窗时部分机型闪退问题 2022-11-10 14:55:27 +08:00
18401019693
c6b8b61b1e 权益 2022-11-10 14:40:06 +08:00
862295ff03 修复热度加gif不播放问题 2022-11-10 14:30:54 +08:00
18401019693
d13e42e33d 猜你喜欢 2022-11-10 13:48:08 +08:00
134cdf2e2a 调整个人名片 2022-11-10 13:22:40 +08:00
44a05ea0d5 调整个人名片 2022-11-10 11:17:04 +08:00
7f34c50b71 Merge remote-tracking branch 'origin/master' 2022-11-10 11:12:22 +08:00
18401019693
77682d310a 语音听写修改 2022-11-10 10:56:51 +08:00
2b0846f939 Merge remote-tracking branch 'origin/master' 2022-11-09 18:30:59 +08:00
18401019693
0b6c188e0a 侧边栏:侧边栏界面完成,文字消息更改 2022-11-09 18:27:41 +08:00
f51f440b43 Merge remote-tracking branch 'origin/master' 2022-11-09 17:42:55 +08:00
18401019693
f74a01efc0 侧边栏:权益 2022-11-09 17:02:02 +08:00
6dafa64e0b Merge remote-tracking branch 'origin/master' 2022-11-09 16:19:07 +08:00
18401019693
60453c756c 侧边栏:趣味游戏 2022-11-09 16:04:48 +08:00
18401019693
350f17915a 侧边栏:任务中心 2022-11-09 15:26:59 +08:00
ffcb847b02 Merge remote-tracking branch 'origin/master' 2022-11-09 15:09:52 +08:00
8eae2c29ae 修复:直播准备页面切换摄像头可能失效问题
修复:直播准备页面美颜-美肤可能无效问题
2022-11-09 15:09:37 +08:00
18401019693
5e55a5b94c 侧边栏:充值送好礼 2022-11-09 14:02:39 +08:00
1eee54fef1 修复:多人PK次数已用完再接受PK邀请会闪退问题 2022-11-09 13:43:04 +08:00
24f691d4b8 补充JS跳转方法 2022-11-09 13:12:05 +08:00
1fc417ec25 Merge branch 'dev_userCard'
# Conflicts:
#	main/src/main/java/com/yunbao/main/activity/MainActivity.java
2022-11-09 11:01:45 +08:00
71713e5b37 完成新个人名片
完成直播间主播靓号标识
2022-11-09 11:00:49 +08:00
18401019693
ef4c377990 侧边栏 2022-11-09 09:47:04 +08:00
88e27df986 调整融云推流参数 2022-11-09 09:44:18 +08:00
628d9c7a1b Merge remote-tracking branch 'origin/master' 2022-11-08 17:41:31 +08:00
18401019693
7836c57479 Merge remote-tracking branch 'origin/master' 2022-11-08 17:40:53 +08:00
18401019693
939675fe58 文字等级 2022-11-08 17:40:42 +08:00
5ed5b15737 udpate 2022-11-08 16:50:37 +08:00
783685942c 调整推流设置 2022-11-08 16:11:14 +08:00
30c09b0e26 修复开播后直播准备界面还存在的问题 2022-11-08 14:07:17 +08:00
96f21643b4 update 2022-11-08 13:53:24 +08:00
977067eda5 Merge remote-tracking branch 'origin/master' 2022-11-08 13:28:05 +08:00
3e7279b4de 修复直播设置密码房无反应问题 2022-11-08 13:27:56 +08:00
34dd3ca883 update 2022-11-08 13:17:35 +08:00
18401019693
d0d36ef207 语音转文字,上拉加载 2022-11-08 13:12:08 +08:00
a66a32038c update 2022-11-08 11:38:20 +08:00
80d5bf3007 修复主播端开播Banner没活动问题 2022-11-08 11:03:06 +08:00
cb39253785 优化主播端更新心愿单刷新banner 2022-11-08 10:57:06 +08:00
3ec3350c97 Merge remote-tracking branch 'origin/master' 2022-11-08 10:16:40 +08:00
7a01f62490 优化room为空时开播的提示 2022-11-08 10:15:55 +08:00
4a6bb9fd56 修复美颜卡住问题 2022-11-08 10:12:57 +08:00
40532a0972 update 个人名片 2022-11-07 17:39:52 +08:00
18401019693
e059d9bbb2 手机开播问题修复 2022-11-07 17:33:42 +08:00
ab953b4785 update 2022-11-07 16:48:16 +08:00
18401019693
6e38ef2962 发送和进入房间错误弹出 2022-11-07 14:51:44 +08:00
18401019693
6656aebff9 悬浮窗和开播离开 2022-11-04 14:58:40 +08:00
50b598d8a1 移除主播直播间观众列表与守护列表的购买界面 2022-11-03 17:28:50 +08:00
cf08f8197b 主播直播间新增右下角Banner 2022-11-03 16:06:18 +08:00
62f1912a7a 新增获取内存大小 2022-11-03 15:19:42 +08:00
eae7f3d1a0 排行榜圆角 2022-11-03 14:55:10 +08:00
b3e9836d7c Merge remote-tracking branch 'origin/master' 2022-11-03 14:47:24 +08:00
c3c91ba9a2 修复滑动直播间不显示离开图 2022-11-03 14:47:06 +08:00
18401019693
1075f7252a 修改主题颜色 2022-11-03 14:45:51 +08:00
302435c068 修复开播时可能的空指针错误 2022-11-03 10:39:18 +08:00
41fb743bda 调整排行榜图标大小,隐藏性别图标 2022-11-03 10:18:33 +08:00
18401019693
823075c0ad Merge branch 'change_live' 2022-11-02 18:12:34 +08:00
18401019693
c57486b69c 修改用户等级 2022-11-02 18:11:38 +08:00
8b3b0ce2ea 补充排行榜颜色 2022-11-02 17:19:45 +08:00
e3f9f21287 Merge branch 'dev_rank_test' 2022-11-02 16:54:40 +08:00
b10d9ada46 首页排行榜改成可伸缩的模式 2022-11-02 16:53:28 +08:00
b48ceea571 完成排行榜页面 2022-11-02 14:27:38 +08:00
18401019693
0f2fbeb114 修改粉丝团 2022-11-02 14:20:25 +08:00
1623743b26 update 2022-11-02 13:25:09 +08:00
703f542abf update 2022-11-01 18:27:49 +08:00
a2de293e10 update 2022-11-01 18:18:58 +08:00
18401019693
a50abb5b2c 主播等级 2022-11-01 16:38:38 +08:00
18401019693
2102acd9e5 测试修改 2022-11-01 16:10:58 +08:00
18401019693
b8ee197e52 红点通知 2022-11-01 14:52:44 +08:00
18401019693
ba81a46e2f 红点通知 2022-11-01 14:51:39 +08:00
18401019693
6841f47ac3 修改主播等级 2022-11-01 14:46:06 +08:00
a2fef0990a Merge branch '6.4.4_fix_wish'
# Conflicts:
#	config.gradle
2022-11-01 11:28:38 +08:00
9e411ecd71 修复送礼主播会闪退问题(心愿单id冲突) 2022-11-01 11:26:49 +08:00
8d14c06284 播放前移除播放尾帧 2022-11-01 11:00:17 +08:00
8b3f8d783e 修复自动消息重复发送的问题 2022-10-31 17:53:31 +08:00
b5ebc085b4 还原成腾讯播放器 2022-10-31 17:53:09 +08:00
7e169e882d 直播间内存优化稳定到0.7G左右 2022-10-31 16:41:28 +08:00
50f83939cc test 2022-10-31 15:55:52 +08:00
f856188a68 改为EXOPlayer 2022-10-31 15:48:42 +08:00
7e9b794c7f AbsActivity新增低内存回调
DeviceUtils新增获取当前应用是否处于低内存判断方法
2022-10-31 14:59:14 +08:00
18401019693
e70a5e09f6 悬浮窗问题 2022-10-31 10:22:00 +08:00
3e8db9ec7e Merge remote-tracking branch 'origin/master' 2022-10-31 10:16:18 +08:00
34f70bb4cd 修复一处闪退bug 2022-10-31 10:16:10 +08:00
18401019693
12f78dc3b8 添加版本号 2022-10-31 10:06:26 +08:00
89a54276b3 优化反馈收集类名 2022-10-31 10:02:45 +08:00
73fb523ddc 修改礼物弹框高度 2022-10-31 10:00:49 +08:00
18401019693
574d93d608 分支创建 2022-10-31 09:41:41 +08:00
09687fb318 幸运天使点击气泡弹名牌框 2022-10-29 16:54:17 +08:00
18401019693
64bfc37bd7 关播页面 2022-10-29 16:13:47 +08:00
18401019693
a632e48d38 关播页面 2022-10-29 15:58:14 +08:00
18401019693
5570d29f32 关播页面 2022-10-29 15:51:50 +08:00
18401019693
c440b58981 关播页面 2022-10-29 15:08:44 +08:00
18401019693
6efd2898d7 关播页面 2022-10-29 14:31:53 +08:00
18401019693
a7c48675af 修改图片 2022-10-29 13:49:14 +08:00
18401019693
7e9d2917b6 修改图片 2022-10-29 13:44:48 +08:00
18401019693
cb118e4a9f 测试修改 2022-10-28 18:09:52 +08:00
18401019693
6e582829b2 测试修改 2022-10-28 18:06:05 +08:00
30902825d6 恢复新人特惠代码,从banner进直播间需要打开新人特惠 2022-10-28 17:51:59 +08:00
a4c56c7e28 替换美颜key 2022-10-28 17:26:49 +08:00
26db1514d8 修复直播间-用户-头像-跳直播间会卡主的问题 2022-10-28 17:06:20 +08:00
40cd824389 Merge remote-tracking branch 'origin/master' 2022-10-28 16:03:27 +08:00
fd687ab2d5 修复Banner连点多开问题 2022-10-28 16:03:12 +08:00
18401019693
bab377a202 测试修改 2022-10-28 15:59:56 +08:00
f1554f8201 修复心愿单Banner连点多开问题 2022-10-28 15:50:10 +08:00
81933f0ad7 修复活动Banner加载框不消失的问题 2022-10-28 15:45:05 +08:00
18401019693
a16ae482a8 测试修改 2022-10-28 15:03:50 +08:00
18401019693
b688e671c1 测试修改 2022-10-28 15:00:56 +08:00
476caa4be3 修复心愿单链接 2022-10-28 14:26:03 +08:00
d04a44044c 修复活动tab没带活动id 2022-10-28 13:55:51 +08:00
b394a8f9b5 修复firebase反馈的空指针问题 2022-10-28 13:50:34 +08:00
07ae094bed 修复firebase反馈的空指针问题 2022-10-28 13:12:39 +08:00
18401019693
4be0148324 测试修改 2022-10-28 11:14:02 +08:00
025c8d74aa 修复firebase反馈的MainActivity.forward空指针问题 2022-10-28 10:51:48 +08:00
f60aeaa35e 修复firebase反馈的SocketRyClient.mSocketHandler空指针问题 2022-10-28 10:44:25 +08:00
bf8e6de236 补充反馈参数 2022-10-27 18:30:00 +08:00
2c74fb78d9 补充幸运天使的房间号id参数 2022-10-27 18:06:08 +08:00
78c4c455a8 补充反馈日志 2022-10-27 17:56:27 +08:00
135f8f5be3 调整底栏跳活动id 2022-10-27 17:22:20 +08:00
32832654ef 修复活动banner快速点击会多次打开的问题 2022-10-27 16:54:41 +08:00
92ec8a3044 修复活动banner快速点击会多次打开的问题 2022-10-27 16:52:06 +08:00
cccde7a3f8 重新调整活动Banner逻辑 2022-10-27 16:29:22 +08:00
6efcb75c31 修复首页周星榜svga会消失的问题
修复Firebase可能没uid的问题
新增其他事件统计
2022-10-27 15:28:43 +08:00
18401019693
2e2e5c7ec0 测试修改 2022-10-27 15:20:46 +08:00
18401019693
c8ab6ffa15 测试修改 2022-10-27 14:55:55 +08:00
18401019693
8b180ce664 测试修改 2022-10-27 14:48:07 +08:00
fb0e35196c 更新融云sdk 2022-10-27 14:13:15 +08:00
92233e1298 Merge remote-tracking branch 'origin/master' 2022-10-27 10:37:12 +08:00
18401019693
2891c3bf14 直播间UI调整,修改悬浮 2022-10-27 10:36:25 +08:00
0f236f743d 修复几处PendingIntent的Flag闪退问题 2022-10-27 10:34:15 +08:00
1d8cdf250d 调整趣味游戏tab选中线颜色 2022-10-27 10:19:50 +08:00
875fa33625 新增趣玩游戏对话框 2022-10-27 10:05:32 +08:00
9c629937da 调整Banner点击事件 2022-10-26 17:26:26 +08:00
38d2e0df57 新增直播间轮播Banner
调整身份特权弹窗
2022-10-26 16:34:53 +08:00
18401019693
c725be7bbc 直播间UI调整,修改悬浮 2022-10-26 16:16:55 +08:00
18401019693
787d50c5b4 直播间UI调整,修改悬浮 2022-10-26 15:28:03 +08:00
18401019693
af7a8965a7 直播间UI调整 2022-10-26 14:45:39 +08:00
18142669586
d8d29dd2ad 新增更新区分潘多拉和pd,拉黑不感兴趣首页消失,谷歌支付页面修改 2022-10-26 13:40:17 +08:00
22225eece6 调整AppContext只在主线程中初始化
新增crashlytics的控制开关
2022-10-26 11:34:50 +08:00
dad3f85864 Merge remote-tracking branch 'origin/master' 2022-10-26 11:33:43 +08:00
c83db0ec77 新增幸运女神通知 2022-10-26 11:33:32 +08:00
18401019693
0b601738f7 直播间UI调整 2022-10-26 10:39:54 +08:00
2eba951ad1 Merge remote-tracking branch 'origin/master' 2022-10-25 17:11:22 +08:00
0d6bf8adaa 修复直播间侧边栏Banner点击后加载弹窗不会消失的问题 2022-10-25 17:11:14 +08:00
bc87e143c8 修复直播间侧边栏Banner点击后加载弹窗不会消失的问题 2022-10-25 17:10:29 +08:00
18401019693
92dfe89213 界面修改 2022-10-25 17:10:20 +08:00
18401019693
b0ba5b7d57 权限判断 2022-10-25 16:10:50 +08:00
18401019693
1959a7933b 添加30秒倒计时 2022-10-25 15:50:49 +08:00
18401019693
1ce5ac2c5f 语音转文字 2022-10-25 15:29:21 +08:00
003f6622b9 修复切换滤镜-其他-滤镜时,不会恢复拖动条的问题 2022-10-25 15:09:27 +08:00
18401019693
7e00a5e71e 语音转文字 2022-10-25 14:41:08 +08:00
18401019693
172b37ece2 语音转文字 2022-10-25 14:05:33 +08:00
b4e048bf74 根据需求修改美颜UI 2022-10-25 11:24:42 +08:00
a0bff8a019 Merge remote-tracking branch 'origin/master' 2022-10-24 18:26:42 +08:00
5db1021ecc 补充FirebaseCrashlytics控制开关 2022-10-24 18:26:31 +08:00
18401019693
7fabc4f1b6 语音转文字 2022-10-24 18:18:39 +08:00
6b7fd4d53e 新增firebase-crashlytics 2022-10-24 17:55:43 +08:00
18401019693
ab6e578336 删除不必要文件,修改设置页面 2022-10-24 10:58:56 +08:00
18401019693
e0861ff7eb 星级挑战修改,聊天修改 2022-10-22 17:42:17 +08:00
f9fd849ce0 补充异常日志内容 2022-10-22 17:18:02 +08:00
18401019693
60a132489a 悬浮窗修改 2022-10-22 16:27:12 +08:00
a82d3984fa 补充异常日志内容 2022-10-22 15:59:00 +08:00
ed97955d90 修复一处闪退问题 2022-10-22 15:00:21 +08:00
3be5f8b0cd Merge remote-tracking branch 'origin/master' 2022-10-22 14:50:18 +08:00
d2977fae85 移除调试代码 2022-10-22 14:49:37 +08:00
be0f81e059 Merge branch 'dev_20221020' 2022-10-22 14:48:25 +08:00
18401019693
099cc0d83d 讯飞sdk替换,页面修改 2022-10-22 14:43:01 +08:00
18401019693
90e249e2d7 根据后端需求修改上报日志接口参数 2022-10-22 14:40:35 +08:00
38a269ae1c 新增捕获并上传异常日志的功能 2022-10-22 13:23:57 +08:00
77f5d89f28 Merge remote-tracking branch 'origin/master' 2022-10-22 13:15:53 +08:00
18401019693
1ecad0f89f 设定页面修改 2022-10-22 11:23:24 +08:00
18401019693
c2d2687441 设定页面修改 2022-10-22 10:04:05 +08:00
f51237f04a 修复一处闪退问题 2022-10-22 09:48:18 +08:00
18401019693
5f27031620 设置页面修改 2022-10-21 18:28:50 +08:00
18401019693
e0a398a9fd 直播内播放修改 2022-10-21 16:01:03 +08:00
18401019693
05d4b29991 直播内播放 2022-10-21 15:52:53 +08:00
dedb30d297 修复聊天框名牌混乱问题 2022-10-21 14:40:31 +08:00
c9743f28a3 Merge remote-tracking branch 'origin/master' 2022-10-21 13:44:57 +08:00
512708284c 调整签到提示对话框高度 2022-10-21 13:44:29 +08:00
18142669586
d4d101843b Merge remote-tracking branch 'origin/master' 2022-10-21 13:23:33 +08:00
18142669586
11aeb95fd7 谷歌包强制不获取推广码 2022-10-21 13:23:16 +08:00
99e07bf861 调整签到提示文本高度 2022-10-21 11:19:16 +08:00
be735d9ca6 压缩资源文件 2022-10-21 09:33:06 +08:00
3dd9f3f551 新增启动直播准备间时就加载上次美颜参数 2022-10-20 17:58:10 +08:00
18401019693
f25f61b78c 语音听写 2022-10-20 17:49:04 +08:00
461a23a790 Merge branch 'master' into dev_20221020 2022-10-20 17:40:57 +08:00
3c6b4d13a9 Merge remote-tracking branch 'origin/master' 2022-10-20 15:36:04 +08:00
231ffcac84 修复一处空指针闪退问题 2022-10-20 15:35:49 +08:00
18401019693
845be4d795 按需求修改 2022-10-20 15:10:18 +08:00
6f40ff969d 移除调试代码 2022-10-20 14:23:34 +08:00
5559dd7eb2 Merge branch 'master' into dev_20221020 2022-10-20 12:17:14 +08:00
18401019693
5ec6a14ba1 修改悬浮窗样式,添加悬浮设置 2022-10-20 11:42:30 +08:00
1e2d146e74 Merge branch 'master' into dev_20221020 2022-10-20 11:34:23 +08:00
18401019693
217c5f3115 修改悬浮窗样式,添加悬浮设置 2022-10-20 11:33:56 +08:00
18401019693
a09cbf4776 修改悬浮窗样式,添加悬浮设置 2022-10-20 11:32:33 +08:00
4330ee9d57 Merge branch 'master' into dev_20221020 2022-10-20 11:30:05 +08:00
18401019693
ad785f2b39 修改悬浮窗样式,添加悬浮设置 2022-10-20 11:29:37 +08:00
1501858a7d Merge branch 'master' into dev_20221020 2022-10-20 11:23:53 +08:00
18401019693
a49db975b1 修改悬浮窗样式,添加悬浮设置 2022-10-20 11:22:31 +08:00
79aadad668 Merge branch 'master' into dev_20221020
# Conflicts:
#	settings.gradle
2022-10-20 11:17:52 +08:00
e4ba0b7f80 fix 移除旧美颜初始化代码 2022-10-20 11:16:03 +08:00
ca03a8f23e 排除美颜so
压缩图片资源
2022-10-20 10:49:08 +08:00
18401019693
4b5f3a9560 修改悬浮窗样式,添加悬浮设置 2022-10-20 10:48:58 +08:00
97fc07db0c 调整选择了风格推荐的话,则不允许使用其他功能
替换风格推荐icon
2022-10-19 17:28:15 +08:00
28137615df fix:直播间侧边推荐Banner多次点击可能导致重复进入直播间问题 2022-10-19 16:36:09 +08:00
00dfd38be5 重新启用美颜sdk
调整美颜sdk只使用美颜功能
2022-10-19 16:19:50 +08:00
99d32c03b2 fix:直播间侧边推荐banner点击跳转后未打开新人签到对话框 2022-10-18 18:24:19 +08:00
18401019693
80f23f4cc3 修改悬浮窗样式 2022-10-18 17:23:13 +08:00
18401019693
234756149c 修改悬浮窗样式 2022-10-18 17:08:41 +08:00
ec1656fbbd update:调整下载策略,如检测到直播播放器卡顿(fps为0)则暂停所有下载所有任务,当fps大于0则认为正常网络而继续下载,从而确保优先播放 2022-10-18 16:45:49 +08:00
18401019693
baa596158d 修改活动导致星级出现展示不出来的问题 2022-10-18 15:12:25 +08:00
18401019693
94c5f4b809 修改线上问题 2022-10-18 14:06:05 +08:00
18401019693
91743ecd3d 修改测试问题 2022-10-18 13:11:14 +08:00
0d12df93ab Merge remote-tracking branch 'origin/master' 2022-10-17 17:46:45 +08:00
4070c7717b add:直播间私信悬浮窗默认隐藏,随接口判断是否显示 2022-10-17 17:46:30 +08:00
18401019693
5bf95c28d2 直播结束,悬浮窗 2022-10-17 16:00:27 +08:00
09f74c3881 fix:修复一处内存泄漏问题 2022-10-17 15:10:03 +08:00
18401019693
5f44473c49 直播结束,悬浮窗 2022-10-17 14:58:36 +08:00
18401019693
842ef05dc7 直播结束,悬浮窗 2022-10-17 14:48:19 +08:00
814e45952c fix:直播准备间心愿单未自动下载礼物的问题 2022-10-17 10:57:35 +08:00
18401019693
0eb6b68b5c 直播结束,悬浮窗 2022-10-17 10:45:33 +08:00
18401019693
47b6f9b45f 直播结束,悬浮窗 2022-10-17 10:13:17 +08:00
780f9a3328 fix:修复滑动直播间无法再次点亮问题 2022-10-14 15:55:24 +08:00
fd038da6d7 fix:修复Banner重复点击会进入两次直播间的问题 2022-10-14 10:35:24 +08:00
9503f4a6c7 fix:礼物返回为null的问题 2022-10-13 20:42:54 +08:00
18401019693
b8ff6d56ae 修复测试问题 2022-10-13 18:29:23 +08:00
e352db3ced Merge remote-tracking branch 'origin/master' 2022-10-13 16:08:05 +08:00
2cbc018764 更新gradle脚本 2022-10-13 16:07:52 +08:00
18401019693
9e02ad5119 修复测试问题 2022-10-13 13:52:01 +08:00
18401019693
2d122a93b7 6.4.3版本 2022-10-13 13:05:21 +08:00
18401019693
8d0af1a06e 连麦 2022-10-13 11:10:29 +08:00
db1940c571 补充心动svga地址 2022-10-12 17:54:35 +08:00
b8e742cd08 调整界面UI透明度 2022-10-12 17:30:12 +08:00
eb2aa91612 调整新人签到弹框 2022-10-12 17:03:26 +08:00
fa4042bf42 Merge remote-tracking branch 'origin/master' 2022-10-12 16:38:01 +08:00
9de86e545b 调整礼物UI
新增新人签到弹框
2022-10-12 16:37:52 +08:00
18401019693
b9977a3d90 星级挑战成功 2022-10-12 16:34:54 +08:00
99308f5ac5 Merge remote-tracking branch 'origin/master' 2022-10-12 16:05:42 +08:00
d86e68060c 调整礼物UI
新增新人签到弹框
2022-10-12 16:05:33 +08:00
18401019693
9212ed34cc 星级挑战成功 2022-10-12 14:44:21 +08:00
18401019693
62dc81d971 星级挑战成功 2022-10-12 13:37:42 +08:00
6d4e4f8566 调整礼物弹框文本 2022-10-12 13:23:11 +08:00
18401019693
88107b7ab5 星级挑战成功 2022-10-12 11:52:45 +08:00
db81f4556a 调整礼物UI 贵族名字位置 2022-10-12 11:22:50 +08:00
18401019693
5b4912815a 机器人Im消息 2022-10-12 10:05:30 +08:00
20916313dd 新人特惠补充URL问号判断 2022-10-12 09:55:48 +08:00
18401019693
c118a7c999 机器人Im消息 2022-10-11 18:31:10 +08:00
310fe91a19 调整弱网下,礼物加载动画失败后取消 2022-10-11 18:03:32 +08:00
1a8e7ecae9 调整.9图缓存策略 2022-10-11 17:56:15 +08:00
18401019693
447f8537f1 dian9图问题直播间聊天列表优化 2022-10-11 17:26:49 +08:00
7e35cc8e3c 调整礼物UI高度 2022-10-11 16:38:59 +08:00
18401019693
3689a3a29d 修改活动UI重叠问题 2022-10-11 16:22:53 +08:00
18401019693
ca0dd85b8d 修改问题 2022-10-11 15:59:48 +08:00
18401019693
0a25585c8e 老用户回归,星级Im消息修改 2022-10-11 15:36:17 +08:00
18401019693
9b1e182fbd 老用户回归 2022-10-11 14:44:40 +08:00
f2a3f55e52 新增Banner进入直播间直接唤起新人特惠
修复新人特惠URL为null时依旧打开弹框
调整新人特惠红点入口
调整用户手动下载svga如网络失败时的操作
2022-10-11 14:11:12 +08:00
18401019693
127490ca91 测试修改 2022-10-11 13:37:44 +08:00
18401019693
11d0afde56 测试修改 2022-10-11 10:59:19 +08:00
18401019693
0a6471163c 测试修改 2022-10-11 10:26:35 +08:00
18401019693
8aefa10ef8 测试修改 2022-10-10 18:03:13 +08:00
c0fa59ce64 修复:模拟器首次进入直播间卡顿问题 2022-10-10 17:33:53 +08:00
18401019693
ce7433226d 星级挑战 2022-10-10 17:22:04 +08:00
d1e40abe2e 修复:聊天获取AtUserId为空的空指针错误 2022-10-10 17:11:35 +08:00
8f37f3cc6d 更新SVGA库:新增获取动画持续时间方法 2022-10-10 16:10:15 +08:00
f202fdd08d update 2022-10-10 14:57:26 +08:00
89c29fa442 Merge remote-tracking branch 'origin/master' 2022-10-10 13:44:41 +08:00
1435848f2a 调整礼物包裹UI 2022-10-10 13:44:31 +08:00
18401019693
5f9e27aa8a @消息逻辑补充 2022-10-10 13:38:51 +08:00
06bc518372 补充礼物包裹的下载 2022-10-10 11:41:13 +08:00
18401019693
ee7374d816 @消息逻辑补充 2022-10-10 11:34:29 +08:00
5060d647fb 根据文档修改新礼物UI
移除主界面预下载所有礼物svga入口
获取直播间状态后开始下载所有礼物svga
GiftCacheUtil改为单例并支持顺序下载所有礼物及插队下载
预处理新人特惠红点显示/隐藏接口
获取svga播放时间统一由SVGAViewUtils处理
2022-10-10 11:00:46 +08:00
3a87583340 Merge remote-tracking branch 'origin/master' 2022-10-10 10:58:27 +08:00
18401019693
a6004941ad @消息界面删除逻辑补充 2022-10-08 18:26:05 +08:00
18401019693
e2095f6e46 @消息界面删除逻辑补充 2022-10-08 18:24:05 +08:00
18401019693
8cf76a13e0 @消息界面删除逻辑 2022-10-08 18:09:37 +08:00
bc553a1b1d Merge remote-tracking branch 'origin/master'
# Conflicts:
#	common/src/main/res/values/strings.xml
2022-10-08 11:10:12 +08:00
18401019693
80655a8662 @消息界面 2022-10-08 10:01:58 +08:00
18142669586
a1633e3456 新增注册第三方注册的来源字段 2022-10-07 16:58:49 +08:00
340217e922 优化直播间加载.9图改为由Glide管理Bitmap 2022-10-06 18:15:34 +08:00
f10316bf57 Merge remote-tracking branch 'origin/master' 2022-10-06 18:12:39 +08:00
18401019693
b279bb1083 新消息补充 2022-10-06 17:58:46 +08:00
d7d980860c Merge remote-tracking branch 'origin/master' 2022-10-06 17:43:43 +08:00
18401019693
575d870dcc 新消息 2022-10-06 17:35:31 +08:00
2f97839619 优化视觉:第三方登录点击后弹出loading
更新svga库
2022-10-06 17:34:45 +08:00
92e435f6b6 更新FacebookSDK版本
修复Facebook登录成功后无反应问题
第三方登录新增三秒内不允许重复点击功能
2022-10-06 14:08:12 +08:00
5c349902dd Merge remote-tracking branch 'origin/master' 2022-10-06 13:28:27 +08:00
18401019693
72dd63355e 直播间滑动设置 2022-10-06 13:06:46 +08:00
dd97d35851 退出Activity时清理bitmap
退出LiveActivity时,清理SVGA
新增检测到触发未捕获异常闪退时,直接退出不再重新加载
优化一处LiveActivity所持有的静态view,防止内存泄漏
更新SVGAPlayer库
2022-10-06 11:43:06 +08:00
18401019693
39b4a52ade 直播后台播放 2022-09-30 14:23:15 +08:00
18401019693
dea52ee452 更改图标大小 2022-09-30 10:47:58 +08:00
18401019693
b7129bcbfa TOKEN失效 2022-09-29 16:26:10 +08:00
1f0a95ad0f 优化点击进入直播间的速度 2022-09-29 15:58:57 +08:00
18401019693
81f701e915 连麦问题解决 2022-09-29 15:06:55 +08:00
18401019693
b8d9e3a3c3 6.4.2打包提版 2022-09-28 18:27:29 +08:00
18401019693
c7b81a5185 6.4.2打包提版 2022-09-28 18:04:21 +08:00
18142669586
a066d3f4ff Merge remote-tracking branch 'origin/master' 2022-09-28 16:26:13 +08:00
18142669586
45d9b914a9 1 2022-09-28 16:25:57 +08:00
18401019693
6aaadb6e9a 测试修改 2022-09-28 16:25:56 +08:00
18401019693
3953b0c285 测试修改 2022-09-28 16:06:59 +08:00
3a259290f8 Merge remote-tracking branch 'origin/master' 2022-09-28 15:09:01 +08:00
05c490672d 修复主播直播节目周星榜和心愿单无法点击的问题 2022-09-28 15:08:50 +08:00
18401019693
b9c6b4afec 修改测试问题 2022-09-28 15:07:41 +08:00
18401019693
e2a151a5af 贡献榜神秘人修改 2022-09-28 14:42:15 +08:00
18401019693
93e25f58f5 直播间神秘人修改 2022-09-28 14:33:10 +08:00
c9895781d5 Merge remote-tracking branch 'origin/master' 2022-09-28 14:08:14 +08:00
c45cc7a990 取消Banner和开盘图片的裁切
修复主播直播间合集名字、图标错误
调整直播准备间文案
调整直播准备心愿单列表
调整直播间遮罩
调整进场动画svga动画
修复观众及个人中心头像svga闪烁和消失问题
2022-09-28 14:08:05 +08:00
18401019693
62ff407cab 直播间内隐身修改 2022-09-28 14:07:41 +08:00
18401019693
8d98c6b5cc google支付修改 2022-09-28 13:43:53 +08:00
18401019693
0d473bdd9f 搜索进直播间 2022-09-28 11:45:55 +08:00
18401019693
039134b7d2 进直播间无图标问题 2022-09-28 11:15:32 +08:00
51c6ed3456 调整Glide设置高宽的方法
隐藏直播间右侧贵族头条之类的view
取消首页进入密码房输入密码,不然会弹两次密码输入框
密码输入框响应取消按钮
2022-09-27 17:38:12 +08:00
18401019693
79a4c560df 隐藏聊天界面 2022-09-27 16:35:43 +08:00
18142669586
cadbf53086 Merge remote-tracking branch 'origin/master' 2022-09-27 14:53:40 +08:00
18142669586
9e527d6a5d 1 2022-09-27 14:53:31 +08:00
18142669586
2490c6bdd1 1 2022-09-27 14:53:01 +08:00
18401019693
44c6e5e4cd 密码房逻辑更改 2022-09-27 11:04:30 +08:00
25252b013b 恢复momo美颜
调整进场svga动画填充类型
2022-09-26 17:59:54 +08:00
683f1d5835 恢复momo美颜
调整进场svga动画填充类型
2022-09-26 17:55:49 +08:00
ec730e850a 恢复momo美颜
调整进场svga动画填充类型
2022-09-26 17:18:07 +08:00
59256c9cf7 隐藏主播连麦入口 2022-09-26 15:15:41 +08:00
18401019693
20bd0d884c 新增修改字体颜色的js接口 2022-09-26 12:00:04 +08:00
18401019693
9509ac721e 悬浮进入密码房时的提示 2022-09-26 10:53:02 +08:00
18401019693
874ee86a10 修改主播不展示全服喇叭,超皇文字增加容错 2022-09-23 17:49:10 +08:00
f0941ffd26 预览界面调整美颜时隐藏其他UI 2022-09-23 17:01:47 +08:00
2fdc4001f4 美颜UI调整 2022-09-23 13:19:07 +08:00
04f0953cfa 美颜补充对比键功能 2022-09-23 10:43:34 +08:00
7033f5e707 修复一处空指针错误
提交图片优化版本:直播间滑动3分钟,内存占用:3G → 1.5G
2022-09-22 16:33:03 +08:00
7f423a9ae2 Merge branch 'master' into dev_test 2022-09-22 15:27:41 +08:00
a9302d3e54 移除FaceUnity的日志输出 2022-09-22 15:25:48 +08:00
18142669586
f52e10b96f 谷歌敏感权限和新的更新包逻辑 2022-09-22 15:21:15 +08:00
ff7bfc040d Merge branch 'dev_Memory' into dev_test
# Conflicts:
#	app/src/main/java/com/shayu/phonelive/AppContext.java
#	common/src/main/java/com/yunbao/common/glide/ImgLoader.java
#	dependencies.gradle
#	live/src/main/java/com/yunbao/live/adapter/UserMoreInfoAdapter.java
#	live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java
#	main/src/main/java/com/yunbao/main/activity/ZhuangBanActivity.java
#	main/src/main/java/com/yunbao/main/adapter/MainListAdapter.java
2022-09-22 14:43:57 +08:00
24e07db6e1 修复一处设置密码房时的闪退问题 2022-09-22 14:23:31 +08:00
fa12ce88d7 update 2022-09-22 13:57:15 +08:00
e749e1a7d5 Merge remote-tracking branch 'origin/master' 2022-09-22 13:50:54 +08:00
c0d0fed83a 解决冲突 2022-09-22 13:50:46 +08:00
18401019693
aaa453c903 推荐加跳转直播间 2022-09-22 13:41:14 +08:00
0b0967f84d Merge branch 'dev_FaceUnity'
# Conflicts:
#	live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
#	live/src/main/res/layout/view_live_room.xml
2022-09-22 13:41:13 +08:00
1e98de9931 补充注释及移除部分未用到代码 2022-09-22 13:35:45 +08:00
18401019693
ab2991a999 网页标题兼容,周星榜图片样式裁剪,推荐卡加标签 2022-09-22 13:30:24 +08:00
d2bb4e4375 update 2022-09-22 13:02:53 +08:00
18401019693
6bc3019b02 指导员背景文字改动 2022-09-22 10:39:34 +08:00
80c5609bb7 update 2022-09-22 00:02:45 +08:00
e29ecd2845 update 2022-09-21 18:31:07 +08:00
18401019693
82ccf66d80 超皇字体颜色 2022-09-21 18:02:40 +08:00
18401019693
f8826d0239 网页标题整改 2022-09-21 16:28:00 +08:00
18401019693
362dff002f 隱身榜單修改 2022-09-21 15:08:56 +08:00
18401019693
a5826b2dc3 新增h5功能全服喇叭修改 2022-09-21 14:55:24 +08:00
18401019693
83aed0bedb 新增h5功能 2022-09-21 14:13:59 +08:00
bdaa51dbb6 update ui 2022-09-20 22:21:38 +08:00
02206dc289 完成美颜UI 90% 2022-09-20 18:30:17 +08:00
d1d31da6be 完成美颜UI 90% 2022-09-20 18:29:05 +08:00
18401019693
d77721a0bc 修改問題 2022-09-20 15:07:05 +08:00
18401019693
567e403151 修改問題 2022-09-20 14:55:32 +08:00
18401019693
1cdf065839 心愿单背景去除 2022-09-20 10:57:28 +08:00
18401019693
a555019561 直播间开通贵族结束 2022-09-19 18:20:29 +08:00
18401019693
86735ab81f 直播间开通贵族结束 2022-09-19 17:59:15 +08:00
18401019693
1935ac14f0 直播间开通贵族结束 2022-09-19 17:07:59 +08:00
18401019693
f531fd4d0e 隐身榜单的更改 2022-09-19 16:22:57 +08:00
c634d29e79 补充美颜模型和美颜配置 2022-09-19 15:43:06 +08:00
18401019693
0de802bf3c 贵族开通的动画横幅 2022-09-19 15:35:37 +08:00
18142669586
8b4d25bbeb Merge remote-tracking branch 'origin/master' 2022-09-19 13:52:22 +08:00
18142669586
8c75b80535 谷歌敏感权限 2022-09-19 13:51:59 +08:00
18401019693
6fef3ee243 直播间推荐气泡文字 2022-09-19 13:43:18 +08:00
8ef917ebb6 补充美颜模型和美颜配置 2022-09-17 18:21:53 +08:00
333e4fc1e6 新接入FaceUnity美颜SDK 2022-09-17 16:54:58 +08:00
18401019693
c95fd2d49c 直播间聊天列表展示不全问题修复 2022-09-17 14:33:55 +08:00
18401019693
fc0c734261 直播间贡献榜添加隐身 2022-09-16 18:03:33 +08:00
18401019693
0cafd76035 首页贡献榜添加隐身 2022-09-16 17:27:41 +08:00
18401019693
bebf19215e 首页贡献榜添加隐身 2022-09-16 17:04:45 +08:00
18142669586
5e581dd65e Merge remote-tracking branch 'origin/master' 2022-09-16 14:21:50 +08:00
18142669586
3225cf5d5f 首页皇帝推荐边框 2022-09-16 14:21:21 +08:00
18401019693
1c16a673fd 直播间开通贵族 2022-09-16 11:03:46 +08:00
18401019693
bf9d573727 直播间开通贵族 2022-09-16 11:02:54 +08:00
882c5ff95c 主播直播中点击小时榜不跳转 2022-09-15 18:30:54 +08:00
c6770c1d51 Merge remote-tracking branch 'origin/master' 2022-09-15 16:11:28 +08:00
18142669586
01ea24c66c 修复版本号有一些用户无上报的问题 2022-09-15 16:10:08 +08:00
56d790082a Merge branch 'dev_new_anchor' 2022-09-15 16:06:36 +08:00
e7a8cd781b 改版主播工具栏界面 2022-09-15 16:00:50 +08:00
18142669586
264d000111 Merge remote-tracking branch 'origin/master' 2022-09-15 15:53:14 +08:00
18142669586
ada42b1981 修改充值的webview兼容性 2022-09-15 15:52:20 +08:00
e455f1c3a0 改版主播直播界面 2022-09-15 14:12:56 +08:00
3e776b63c4 改版主播直播界面 2022-09-15 14:11:29 +08:00
7ef6c95c63 改版直播准备间UI
修复心愿单多出一个的BUG
2022-09-15 11:20:20 +08:00
18401019693
0af40fa7e5 全站喇叭 2022-09-15 10:40:15 +08:00
18401019693
169bf74f31 全站喇叭 2022-09-14 18:29:14 +08:00
18401019693
ad1599ccce 全站喇叭 2022-09-14 18:05:42 +08:00
18401019693
5bd0f455bb 待提交 2022-09-14 16:34:26 +08:00
18069a726d 销毁开播Activity时清理静态ViewHolder 2022-09-13 18:27:05 +08:00
c1c7c71f4a 移除一处调试用Toast 2022-09-13 17:42:09 +08:00
211874b3ae 调整直播间背景毛玻璃值,因为重设了背景大小 2022-09-13 17:38:35 +08:00
7d72a65f89 替换优化后SVGA库
调整部分图片加载大小:如小图标没必要加载原图,设为32x32即可
更新kotlin和gradle依赖版本
2022-09-13 17:15:33 +08:00
dd39064ca5 update 2022-09-09 15:20:59 +08:00
89ed3f5121 update 2022-09-09 13:36:01 +08:00
2705 changed files with 164122 additions and 12822 deletions

1
FaceUnity/.gitignore vendored Normal file
View File

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

73
FaceUnity/build.gradle Normal file
View File

@@ -0,0 +1,73 @@
apply plugin: 'com.android.library'
apply plugin: 'img-optimizer'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so"
pickFirst "lib/armeabi-v7a/libyuvutils.so"
pickFirst "lib/armeabi/libyuvtools.so"
pickFirst "lib/arm64-v8a/libyuvtools.so"
pickFirst "lib/armeabi-v7a/libyuvtools.so"
exclude "lib/arm64-v8a/libmmcv_api_handgesture.so"
exclude "lib/arm64-v8a/libmmcv_api_express.so"
exclude "lib/arm64-v8a/libMediaEncoder.so"
exclude "lib/arm64-v8a/libarcore_sdk_c.so"
exclude "lib/arm64-v8a/libmediadecoder.so"
exclude "lib/arm64-v8a/libMediaMuxer.so"
exclude "lib/arm64-v8a/libarcore_sdk_jni.so"
exclude "lib/arm64-v8a/libMediaUtils.so"
exclude "lib/arm64-v8a/libcosmosffmpeg.so"
}
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
manifestPlaceholders = rootProject.ext.manifestPlaceholders
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
aaptOptions {
cruncherEnabled = false
useNewCruncher = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs', '../libs'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.dependencies["appcompat-androidx"]
implementation rootProject.ext.dependencies["recyclerview-androidx"]
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//common
implementation project(path: ':common')
implementation 'com.faceunity:core:8.3.1'
implementation 'com.faceunity:model:8.3.1'
//implementation 'com.faceunity:nama:8.3.1' //底层库-标准版
}

View File

21
FaceUnity/proguard-rules.pro vendored Normal file
View File

@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# 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 *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -0,0 +1,26 @@
package com.yunbao.faceunity;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.yunbao.faceunity.test", appContext.getPackageName());
}
}

View File

@@ -0,0 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.yunbao.faceunity"
>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:icon="@mipmap/ico_home_animoji"
android:allowBackup="true">
</application>
</manifest>

View File

@@ -0,0 +1,301 @@
package com.yunbao.faceunity;
import static android.content.Context.SENSOR_SERVICE;
import android.content.Context;
import android.hardware.Camera;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Environment;
import android.util.Log;
import com.faceunity.core.entity.FURenderOutputData;
import com.faceunity.core.enumeration.CameraFacingEnum;
import com.faceunity.core.enumeration.FUAIProcessorEnum;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.enumeration.FUInputTextureEnum;
import com.faceunity.core.enumeration.FUTransformMatrixEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.utils.CameraUtils;
import com.yunbao.faceunity.data.FaceBeautyDataFactory;
import com.yunbao.faceunity.data.FaceUnityDataFactory;
import com.yunbao.faceunity.entity.FaceBeautyBean;
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
import com.yunbao.faceunity.listener.FURendererListener;
import com.yunbao.faceunity.ui.FaceUnityView;
import com.yunbao.faceunity.utils.CSVUtils;
import com.yunbao.faceunity.utils.FURenderer;
import com.yunbao.faceunity.utils.FaceSPUtils;
import com.yunbao.faceunity.utils.FaceUnityData;
import com.yunbao.faceunity.utils.net.OkHttpUtils;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCVideoOutputFrameListener;
import cn.rongcloud.rtc.base.RCRTCVideoFrame;
/**
* 美颜模块管理类
*/
public class FaceManager implements SensorEventListener {
private static boolean isInit = false;
private static final String TAG = FaceManager.class.getSimpleName();
private FaceUnityDataFactory mFaceUnityDataFactory;
private FaceManager.FaceStatusChanged faceStatusChanged;
private boolean pauseFace = false;
/**
* 初始化美颜模块在AppContext中调用
*/
public static void initFaceUnity(Context context) {
if (isInit) {
return;
}
FaceUnityData.mApplication = context;
OkHttpUtils.getInstance().init(context, false);
FURenderer.getInstance().setup(context);
isInit = true;
}
private FURenderer mFURenderer;
/**
* 配置美颜SDK
*/
public void initFURender(Context context) {
initFaceUnity(context);
mFURenderer = FURenderer.getInstance();
mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE);
mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT);
mFURenderer.setInputBufferMatrix(FUTransformMatrixEnum.CCROT90_FLIPHORIZONTAL);
mFURenderer.setInputTextureMatrix(FUTransformMatrixEnum.CCROT90_FLIPHORIZONTAL);
mFURenderer.setOutputMatrix(FUTransformMatrixEnum.CCROT270);
mFURenderer.setInputOrientation(CameraUtils.INSTANCE.getCameraOrientation(Camera.CameraInfo.CAMERA_FACING_FRONT));
mFURenderer.setMarkFPSEnable(true);
mFaceUnityDataFactory = FaceUnityDataFactory.getInstance();
SensorManager mSensorManager = (SensorManager) context.getSystemService(SENSOR_SERVICE);
Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
mSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL);
}
/**
* 注册长按对比键事件
*
* @param faceUnityView
*/
public void setFaceUnityView(FaceUnityView faceUnityView) {
faceUnityView.setIFaceUnityInter(new FaceUnityView.IFaceUnityInter() {
@Override
public void onPause() {
pauseFace = true;
}
@Override
public void onStart() {
pauseFace = false;
}
});
}
public void loadConfig() {
initFaceBeauty();
}
public void initFaceBeauty() {
FaceBeautyDataFactory faceBeautyDataFactory;
faceBeautyDataFactory = new FaceBeautyDataFactory();
Map<String, ?> configMap = FaceSPUtils.getInstance().getAll();
for (String key : configMap.keySet()) {
if ("FilterViewHolder_".equals(key)) {
for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) {
if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) {
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;
}
}
} else if (key.startsWith("BeautySkinViewHolder_")) {
String name = key.replace("BeautySkinViewHolder_", "");
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
if (bean.getKey().equals(name)) {
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;
}
}
} else if (key.startsWith("BeautyShapeViewHolder")) {
String name = key.replace("BeautyShapeViewHolder_", "");
for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) {
if (bean.getKey().equals(name)) {
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;
}
}
}
}
}
/**
* 监听人脸识别个数
*/
public void setFaceStatusChanged(FaceStatusChanged faceStatusChanged) {
this.faceStatusChanged = faceStatusChanged;
}
private boolean mIsFirstFrame = true;
private CSVUtils mCSVUtils;
private int mSkippedFrames = CAMERA_SWITCH_SKIP_FRAME;
// 相机切换跳过 5 帧,如果还有问题,可以增加帧数
private static final int CAMERA_SWITCH_SKIP_FRAME = 0;
private volatile boolean mSkip;
/**
* 渲染融云视频帧
*/
public void drawRongFrame(Context context) {
RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(new IRCRTCVideoOutputFrameListener() {
@Override
public RCRTCVideoFrame processVideoFrame(RCRTCVideoFrame callVideoFrame) {
//Log.i(TAG, "processVideoFrame: egl context " + EGL14.eglGetCurrentContext());
if (pauseFace) {
return callVideoFrame;
}
int width = callVideoFrame.getWidth();
int height = callVideoFrame.getHeight();
if (mIsFirstFrame) {
mIsFirstFrame = false;
//initCsvUtil(context);
mFURenderer.prepareRenderer(mFURendererListener);
}
//long start = System.nanoTime();
mFURenderer.setInputOrientation(callVideoFrame.getRotation());
FURenderOutputData data = mFURenderer.onDrawFrameInputWithReturn(callVideoFrame.getData(), width, height);
/* long time = System.nanoTime() - start;
if (mCSVUtils != null) {
mCSVUtils.writeCsv(null, time);
}*/
if (mSkippedFrames > 0 || mSkip) {
--mSkippedFrames;
return callVideoFrame;
}
if (data != null && data.getImage() != null && data.getImage().getBuffer() != null) {
callVideoFrame.setData(data.getImage().getBuffer());
}
return callVideoFrame;
}
});
}
/**
* 记录渲染工具调试用在processVideoFrame里使用
*/
private void initCsvUtil(Context context) {
mCSVUtils = new CSVUtils(context);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss", Locale.getDefault());
String dateStrDir = format.format(new Date(System.currentTimeMillis()));
dateStrDir = dateStrDir.replaceAll("-", "").replaceAll("_", "");
SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.getDefault());
String dateStrFile = df.format(new Date());
String filePath = Environment.getExternalStoragePublicDirectory("") + dateStrDir + File.separator + "excel-" + dateStrFile + ".csv";
Log.d("CSV", "initLog: CSV file path:" + filePath);
StringBuilder headerInfo = new StringBuilder();
headerInfo.append("version").append(FURenderer.getInstance().getVersion()).append(CSVUtils.COMMA)
.append("机型:").append(android.os.Build.MANUFACTURER).append(android.os.Build.MODEL)
.append("处理方式Texture").append(CSVUtils.COMMA);
mCSVUtils.initHeader(filePath, headerInfo);
}
private FURendererListener mFURendererListener = new FURendererListener() {
@Override
public void onPrepare() {
mFaceUnityDataFactory.bindCurrentRenderer();
//Log.e(TAG, "mFURendererListener: onPrepare: ");
}
@Override
public void onTrackStatusChanged(FUAIProcessorEnum type, int status) {
Log.e(TAG, "onTrackStatusChanged: 人脸数: " + status);
if (faceStatusChanged != null) {
faceStatusChanged.onFaceChanged(status);
}
}
@Override
public void onFpsChanged(double fps, double callTime) {
final String FPS = String.format(Locale.getDefault(), "%.2f", fps);
// Log.d(TAG, "onFpsChanged FPS: " + FPS + ", callTime: " + String.format("%.2f", callTime));
}
@Override
public void onRelease() {
// RongCallClient.getInstance().unregisterVideoFrameObserver();
}
};
@Override
public void onSensorChanged(SensorEvent sensorEvent) {
}
@Override
public void onAccuracyChanged(Sensor sensor, int i) {
}
/**
* 离开渲染界面时注销融云监听器,不然会绿屏
*/
public void onClose() {
RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(null);
}
/**
* 释放资源
*/
public void release() {
mFURenderer.release();
try {
for (FUAITypeEnum value : FUAITypeEnum.values()) {
FUAIKit.getInstance().releaseAIProcessor(value);
}
} catch (Exception e) {
e.printStackTrace();
}
isInit = false;
}
public interface FaceStatusChanged {
void onFaceChanged(int num);
}
}

View File

@@ -0,0 +1,258 @@
package com.yunbao.faceunity.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.adapters.vh.AnimViewHolder;
import com.yunbao.faceunity.adapters.vh.AnimojiViewHolder;
import com.yunbao.faceunity.adapters.vh.BaseViewHolder;
import com.yunbao.faceunity.adapters.vh.BeautyBodyViewHolder;
import com.yunbao.faceunity.adapters.vh.BeautyShapeViewHolder;
import com.yunbao.faceunity.adapters.vh.BeautySkinViewHolder;
import com.yunbao.faceunity.adapters.vh.BigHeadViewHolder;
import com.yunbao.faceunity.adapters.vh.FilterViewHolder;
import com.yunbao.faceunity.adapters.vh.FineStickerViewHolder;
import com.yunbao.faceunity.adapters.vh.MakeupCustomItemViewHolder;
import com.yunbao.faceunity.adapters.vh.MakeupViewHolder;
import com.yunbao.faceunity.adapters.vh.StickerViewHolder;
import com.yunbao.faceunity.adapters.vh.StyleViewHolder;
import com.yunbao.faceunity.data.AnimojiDataFactory;
import com.yunbao.faceunity.data.BodyBeautyDataFactory;
import com.yunbao.faceunity.data.FaceBeautyDataFactory;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.data.FineStickerDataFactory;
import com.yunbao.faceunity.data.MakeupDataFactory;
import com.yunbao.faceunity.data.PropDataFactory;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.PropBean;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.FaceSPUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 美颜配置适配器
*/
public class ContainerRecyclerAdapter extends RecyclerView.Adapter<BaseViewHolder> {
private Context mContext;
private List<? extends BaseBean> list;
public int selectPosition = -1;
private FaceBeautyDataFactory faceBeautyDataFactory;//美颜工厂
private MakeupDataFactory makeupDataFactory;//美妆工厂
private BodyBeautyDataFactory bodyBeautyDataFactory;//美体工厂
private PropDataFactory propDataFactory;//道具业务工厂道具贴图、AR面具、搞笑大头、表情识别、哈哈镜、手势识别
private AnimojiDataFactory animojiDataFactory;//Animoji工厂
private FineStickerDataFactory fineStickerDataFactory;//精品贴图
private DiscreteSeekBar seekBar;
private float seekY = 0;
public ContainerRecyclerAdapter(Context mContext) {
this.mContext = mContext;
initDataFactory();
}
public void setSeekBar(DiscreteSeekBar seekBar) {
this.seekBar = seekBar;
}
public DiscreteSeekBar getSeekBar() {
return seekBar;
}
public void showSeekBar() {
if (seekBar.getVisibility() == View.VISIBLE) {
return;
}
seekBar.setVisibility(View.VISIBLE);
if (seekY == 0) {
seekY = seekBar.getY() - DpUtil.dp2px(20);
}
seekBar.setY(seekY);
}
public void hideSeekBar() {
if (seekBar.getVisibility() == View.INVISIBLE) {
return;
}
seekBar.setOnProgressChangeListener(null);
seekBar.setVisibility(View.INVISIBLE);
}
private void initDataFactory() {
faceBeautyDataFactory = new FaceBeautyDataFactory(new FaceBeautyDataFactory.FaceBeautyListener() {
@Override
public void onFilterSelected(int res) {
}
@Override
public void onFaceBeautyEnable(boolean enable) {
}
});
propDataFactory = new PropDataFactory(new PropDataFactory.PropListener() {
@Override
public void onItemSelected(PropBean bean) {
}
}, 0, 0);
animojiDataFactory = new AnimojiDataFactory(0, 0);
makeupDataFactory = new MakeupDataFactory(0);
bodyBeautyDataFactory = new BodyBeautyDataFactory();
bodyBeautyDataFactory.bindCurrentRenderer();
}
public void setList(ArrayList<? extends BaseBean> list) {
this.list = list;
this.selectPosition = -1;
hideSeekBar();
}
public int getSelectPosition() {
return selectPosition;
}
public void setSelectPosition(int selectPosition) {
this.selectPosition = selectPosition;
notifyDataSetChanged();
}
public FaceBeautyDataFactory getFaceBeautyDataFactory() {
return faceBeautyDataFactory;
}
public MakeupDataFactory getMakeupDataFactory() {
return makeupDataFactory;
}
public BodyBeautyDataFactory getBodyBeautyDataFactory() {
return bodyBeautyDataFactory;
}
public PropDataFactory getPropDataFactory() {
return propDataFactory;
}
public AnimojiDataFactory getAnimojiDataFactory() {
return animojiDataFactory;
}
BaseViewHolder vh = null;
@NonNull
@Override
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater from = LayoutInflater.from(mContext);
switch (viewType) {
case FaceParam.FACE_BEAUTY_SKIN:
vh = new BeautySkinViewHolder(from.inflate(R.layout.list_item_face_config, parent, false));
break;
case FaceParam.FACE_BEAUTY_SHAPE:
vh = new BeautyShapeViewHolder(from.inflate(R.layout.list_item_face_config, parent, false));
break;
case FaceParam.FACE_BEAUTY_BODY:
vh = new BeautyBodyViewHolder(from.inflate(R.layout.list_item_face_config, parent, false));
break;
case FaceParam.FACE_BEAUTY_FILTER:
vh = new FilterViewHolder(from.inflate(R.layout.list_item_face_config_filter, parent, false));
break;
case FaceParam.FACE_MAKEUP:
vh = new MakeupViewHolder(from.inflate(R.layout.list_item_face_config_filter, parent, false));
break;
case FaceParam.FACE_BEAUTY_STYLE:
vh = new StyleViewHolder(from.inflate(R.layout.list_item_face_config_style, parent, false));
break;
case FaceParam.FACE_ANIMOJI:
vh = new AnimojiViewHolder(from.inflate(R.layout.list_item_face_config_big_head, parent, false));
break;
case FaceParam.FACE_ANIM:
vh = new AnimViewHolder(from.inflate(R.layout.list_item_face_config_big_head, parent, false));
break;
case FaceParam.FACE_STICKER:
vh = new StickerViewHolder(from.inflate(R.layout.list_item_face_config_big_head, parent, false));
break;
case FaceParam.FACE_BIG_HEAD:
vh = new BigHeadViewHolder(from.inflate(R.layout.list_item_face_config_big_head, parent, false));
break;
case FaceParam.FACE_FINE_STICKER:
case FaceParam.FACE_FINE_STICKER_MIDDLE:
case FaceParam.FACE_FINE_STICKER_HIGH:
case FaceParam.FACE_FINE_STICKER_GAME:
vh = new FineStickerViewHolder(from.inflate(R.layout.list_item_face_config_fine_sticker, parent, false));
break;
case FaceParam.FACE_MAKEUP_TYPE_FOUNDATION:
case FaceParam.FACE_MAKEUP_TYPE_LIP_STICK:
case FaceParam.FACE_MAKEUP_TYPE_BLUSHER:
case FaceParam.FACE_MAKEUP_TYPE_EYE_BROW:
case FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW:
case FaceParam.FACE_MAKEUP_TYPE_EYE_LINER:
case FaceParam.FACE_MAKEUP_TYPE_EYE_LASH:
case FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT:
case FaceParam.FACE_MAKEUP_TYPE_SHADOW:
case FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL:
vh = new MakeupCustomItemViewHolder(from.inflate(R.layout.list_item_face_config_filter, parent, false));
break;
default:
vh = new BeautySkinViewHolder(LayoutInflater.from(mContext).inflate(R.layout.list_item_face_config, parent, false));
}
vh.adapter = this;
return vh;
}
@Override
public int getItemViewType(int position) {
return list.get(position).getBeanType();
}
@Override
public int getItemCount() {
return list.size();
}
@Override
public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
holder.setData(list.get(position));
}
/**
* 保存配置
*/
public void save(String key, String data) {
FaceSPUtils.getInstance().saveString(key, data);
}
/**
* 读取配置
*/
public String getString(String key) {
return FaceSPUtils.getInstance().getString(key);
}
/**
* 删除配置
*/
public void del(String key) {
FaceSPUtils.getInstance().del(key);
}
/**
* 恢复默认设置
*/
public void reset() {
if (vh != null) {
vh.reset(list);
}
}
}

View File

@@ -0,0 +1,77 @@
package com.yunbao.faceunity.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.adapter.OnItemClickListener;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.MenuGroupBean;
import java.util.List;
/**
* 主菜单适配器
*/
public class MenuGroupRecyclerAdapter extends RecyclerView.Adapter<MenuGroupRecyclerAdapter.Vh> {
private Context context;
private List<MenuGroupBean> list;
private OnItemClickListener onItemClickListener;
public MenuGroupRecyclerAdapter(Context context) {
this.context = context;
}
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
public void setList(List<MenuGroupBean> list) {
this.list = list;
}
@NonNull
@Override
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new Vh(LayoutInflater.from(context).inflate(R.layout.list_item_menu_group, parent, false));
}
@Override
public void onBindViewHolder(@NonNull Vh holder, int position) {
holder.setData(list.get(position));
}
@Override
public int getItemCount() {
return list.size();
}
protected class Vh extends RecyclerView.ViewHolder {
ImageView icon;
TextView title;
public Vh(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.item_icon);
title = itemView.findViewById(R.id.item_text);
itemView.setOnClickListener(v -> {
if (onItemClickListener != null) {
onItemClickListener.onItemClick(getAdapterPosition());
}
});
}
public void setData(MenuGroupBean menuGroupBean) {
icon.setImageResource(menuGroupBean.getIconId());
title.setText(menuGroupBean.getTitleId());
}
}
}

View File

@@ -0,0 +1,55 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.AnimationFilterBean;
import com.yunbao.faceunity.entity.BaseBean;
import java.util.List;
/**
* 动画滤镜 *暂无权限
*/
public class AnimViewHolder extends BaseViewHolder {
ImageView icon;
public AnimViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
TextView title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.GONE);
icon.setBackgroundResource(R.drawable.bg_control_square_selector);
itemView.setOnClickListener(v -> {
adapter.getAnimojiDataFactory().onFilterSelected((AnimationFilterBean) itemView.getTag());
setSelectPosition(getAdapterPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
icon.setSelected(getAdapterPosition() == getSelectPosition());
}
@Override
public boolean loadData() {
return false;
}
@Override
public void saveData() {
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,75 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.AnimojiBean;
import com.yunbao.faceunity.entity.BaseBean;
import java.util.List;
/**
* Animoji
*/
public class AnimojiViewHolder extends BaseViewHolder {
ImageView icon;
TextView title;
public AnimojiViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.GONE);
itemView.setOnClickListener(v -> {
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) itemView.getTag());
setSelectPosition(getLayoutPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
int adapterPosition = getAdapterPosition();
int selectPosition = getSelectPosition();
if (loadData()) {
return;
}
icon.setSelected(adapterPosition == selectPosition);
}
@Override
public boolean loadData() {
String data = adapter.getString(getName(this));
if (data == null) {
return false;
}
if (!data.equals(String.valueOf(getLayoutPosition()))) {
return false;
}
icon.setSelected(true);
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) itemView.getTag());
return false;
}
@Override
public void saveData() {
adapter.save(getName(this), String.valueOf(getLayoutPosition()));
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.save(getName(this),"0");
adapter.getAnimojiDataFactory().onAnimojiSelected((AnimojiBean) list.get(0));
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,53 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.faceunity.adapters.ContainerRecyclerAdapter;
import com.yunbao.faceunity.entity.BaseBean;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseViewHolder extends RecyclerView.ViewHolder {
public ContainerRecyclerAdapter adapter;
public int getSelectPosition() {
return adapter.selectPosition;
}
public void setSelectPosition(int selectPosition) {
adapter.selectPosition = selectPosition;
adapter.notifyDataSetChanged();
}
public BaseViewHolder(@NonNull View itemView) {
super(itemView);
}
public String getName(Object obj){
return obj.getClass().getSimpleName()+"_";
}
public abstract void setData(BaseBean data);
/**
* 读取配置
* @return 是否有保存的配置
*/
public abstract boolean loadData();
/**
* 保存配置
*/
public abstract void saveData();
/**
* 恢复默认配置
*/
public abstract void reset(List<? extends BaseBean> list);
}

View File

@@ -0,0 +1,93 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.BodyBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.SeekBarUtils;
import java.util.List;
/**
* 美体
*/
public class BeautyBodyViewHolder extends BaseViewHolder {
private ImageView icon;
private TextView title;
private TextView value;
private DiscreteSeekBar seekBar;
public BeautyBodyViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.item_icon);
title = itemView.findViewById(R.id.item_title);
value = itemView.findViewById(R.id.item_value);
seekBar = itemView.findViewById(R.id.item_seekBar);
seekBar.setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener() {
@Override
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
super.onProgressChanged(seekBar, value, fromUser);
BodyBeautyBean bean = (BodyBeautyBean) itemView.getTag();
double toValue = SeekBarUtils.Companion.seekToValue(bean.getModelAttributeData().getMaxRange(), value, seekBar.getMin());
BeautyBodyViewHolder.this.value.setText(String.format("%.1f", toValue));
adapter.getBodyBeautyDataFactory().updateParamIntensity(bean.getKey(), toValue);
saveData();
}
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if (loadData()) {
return;
}
ModelAttributeData attributeData = data.getModelAttributeData();
value.setText(attributeData.getDefault() + "");
SeekBarUtils.Companion.seekToSeekBar(seekBar,
attributeData.getDefault(),
attributeData.getStand(),
attributeData.getMaxRange());
}
@Override
public boolean loadData() {
BodyBeautyBean bean = (BodyBeautyBean) itemView.getTag();
String val = adapter.getString(getName(this) + bean.getKey());
if (val == null) {
return false;
}
ModelAttributeData attributeData = bean.getModelAttributeData();
value.setText(val);
SeekBarUtils.Companion.seekToSeekBar(seekBar,
Double.parseDouble(val),
attributeData.getStand(),
attributeData.getMaxRange());
return true;
}
@Override
public void saveData() {
BodyBeautyBean bean = (BodyBeautyBean) itemView.getTag();
String key = getName(this) + bean.getKey();
adapter.save(key, (String) value.getText());
}
@Override
public void reset(List<? extends BaseBean> list) {
String name = getName(this);
for (BaseBean bean : list) {
adapter.del(name + bean.getKey());
}
adapter.notifyDataSetChanged();
}
}

View File

@@ -0,0 +1,95 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FaceBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.SeekBarUtils;
import java.util.List;
/**
* 美型
*/
public class BeautyShapeViewHolder extends BaseViewHolder {
private ImageView icon;
private TextView title;
private TextView value;
private DiscreteSeekBar seekBar;
public BeautyShapeViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.item_icon);
title = itemView.findViewById(R.id.item_title);
value = itemView.findViewById(R.id.item_value);
seekBar = itemView.findViewById(R.id.item_seekBar);
seekBar.setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener() {
@Override
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
super.onProgressChanged(seekBar, value, fromUser);
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
double toValue = SeekBarUtils.Companion.seekToValue(bean.getModelAttributeData().getMaxRange(), value, seekBar.getMin());
BeautyShapeViewHolder.this.value.setTag(String.format("%.1f", toValue));
BeautyShapeViewHolder.this.value.setText(value+"");
adapter.getFaceBeautyDataFactory().updateParamIntensity(bean.getKey(), toValue);
saveData();
}
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if(loadData()){
return;
}
ModelAttributeData attributeData = data.getModelAttributeData();
value.setText(attributeData.getDefault() + "");
SeekBarUtils.Companion.seekToSeekBar(seekBar,
attributeData.getDefault(),
attributeData.getStand(),
attributeData.getMaxRange());
}
@Override
public boolean loadData() {
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
String val = adapter.getString(getName(this) + bean.getKey());
if(val==null) {
return false;
}
ModelAttributeData attributeData = bean.getModelAttributeData();
value.setText(val);
SeekBarUtils.Companion.seekToSeekBar(seekBar,
Double.parseDouble(val),
attributeData.getStand(),
attributeData.getMaxRange());
return true;
}
@Override
public void saveData() {
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
adapter.save(getName(this)+bean.getKey(), (String) value.getTag());
}
@Override
public void reset(List<? extends BaseBean> list) {
String name = getName(this);
for (BaseBean bean : list) {
adapter.del(name+bean.getKey());
}
adapter.notifyDataSetChanged();
}
}

View File

@@ -0,0 +1,95 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FaceBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.SeekBarUtils;
import java.util.List;
/**
* 美肤
*/
public class BeautySkinViewHolder extends BaseViewHolder{
private ImageView icon;
private TextView title;
private TextView value;
private DiscreteSeekBar seekBar;
public BeautySkinViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.item_icon);
title = itemView.findViewById(R.id.item_title);
value = itemView.findViewById(R.id.item_value);
seekBar = itemView.findViewById(R.id.item_seekBar);
seekBar.setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener(){
@Override
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
super.onProgressChanged(seekBar, value, fromUser);
FaceBeautyBean bean = (FaceBeautyBean) itemView.getTag();
double toValue = SeekBarUtils.Companion.seekToValue(bean.getModelAttributeData().getMaxRange(), value, seekBar.getMin());
BeautySkinViewHolder.this.value.setTag(String.format("%.1f",toValue));
BeautySkinViewHolder.this.value.setText(value+"");
adapter.getFaceBeautyDataFactory().updateParamIntensity(bean.getKey(),toValue);
saveData();
}
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if(loadData()){
return;
}
ModelAttributeData attributeData = data.getModelAttributeData();
value.setText(attributeData.getDefault() + "");
SeekBarUtils.Companion.seekToSeekBar(seekBar,
attributeData.getDefault(),
attributeData.getStand(),
attributeData.getMaxRange());
}
@Override
public boolean loadData() {
BaseBean data = (FaceBeautyBean) itemView.getTag();
ModelAttributeData attributeData = data.getModelAttributeData();
String key = getName(this)+data.getKey();
String val=adapter.getString(key);
if (val==null){
return false;
}
value.setText(val);
SeekBarUtils.Companion.seekToSeekBar(seekBar,
Double.parseDouble(val),
attributeData.getStand(),
attributeData.getMaxRange()
);
return true;
}
@Override
public void saveData() {
String key = ((FaceBeautyBean)itemView.getTag()).getKey();
String val= (String) value.getTag();
adapter.save(getName(this)+key,val);
}
@Override
public void reset(List<? extends BaseBean> list) {
for (BaseBean bean : list) {
adapter.del(getName(this)+bean.getKey());
}
adapter.notifyDataSetChanged();
}
}

View File

@@ -0,0 +1,79 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.PropBean;
import java.util.List;
/**
* 大头
*/
public class BigHeadViewHolder extends BaseViewHolder {
ImageView icon;
public BigHeadViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
TextView title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.GONE);
itemView.setOnClickListener(v -> {
PropBean bean = (PropBean) itemView.getTag();
adapter.getPropDataFactory().setPropType(FunctionEnum.BIG_HEAD);
adapter.getPropDataFactory().onItemSelected(bean);
setSelectPosition(getAdapterPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
if(loadData()){
return;
}
if (getAdapterPosition() == 0) {
icon.setBackgroundResource(R.drawable.bg_control_oval2_selector);
}
icon.setSelected(getSelectPosition() == getAdapterPosition());
}
@Override
public boolean loadData() {
PropBean bean = (PropBean) itemView.getTag();
String val = adapter.getString(getName(this));
if(val==null){
return false;
}
if(!val.equals(bean.getKey())){
return false;
}
icon.setSelected(true);
adapter.getPropDataFactory().setPropType(FunctionEnum.BIG_HEAD);
adapter.getPropDataFactory().onItemSelected(bean);
return true;
}
@Override
public void saveData() {
PropBean bean = (PropBean) itemView.getTag();
adapter.save(getName(this),bean.getKey());
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.save(getName(this),list.get(0).getKey());
adapter.getPropDataFactory().setPropType(FunctionEnum.BIG_HEAD);
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,113 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.SeekBarUtils;
import java.util.List;
/**
* 滤镜
*/
public class FilterViewHolder extends BaseViewHolder {
private ImageView icon;
private TextView title;
private String KEY_VAL;
public FilterViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
title = itemView.findViewById(R.id.tv_control);
itemView.setOnClickListener(view -> {
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
setSelectPosition(getAdapterPosition());
saveData();
if("origin".equals(bean.getKey())){
adapter.hideSeekBar();
return;
}
adapter.showSeekBar();
adapter.getSeekBar().setMax(100);
adapter.getSeekBar().setTag(bean);
adapter.getSeekBar().setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener(){
@Override
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
super.onProgressChanged(seekBar, value, fromUser);
KEY_VAL=getName(FilterViewHolder.this)+((BaseBean)seekBar.getTag()).getKey()+"_val";
double toValue = SeekBarUtils.Companion.seekToValue(1, value, seekBar.getMin());
adapter.getFaceBeautyDataFactory().updateFilterIntensity(toValue);
adapter.save(KEY_VAL,value+"");
}
});
if(adapter.getString(KEY_VAL)==null) {
adapter.getSeekBar().setProgress((int) (bean.getIntensity() * 100));
}else{
adapter.getSeekBar().setProgress(Integer.parseInt(adapter.getString(KEY_VAL)));
}
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if (loadData()) {
return;
}
icon.setSelected(getSelectPosition() == getAdapterPosition());
title.setSelected(getSelectPosition() == getAdapterPosition());
}
@Override
public boolean loadData() {
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
KEY_VAL=getName(FilterViewHolder.this)+bean.getKey()+"_val";
String val = adapter.getString(getName(this));
if (val == null) {
return false;
}
if (!val.equals(bean.getKey())) {
return false;
}
if(!"origin".equals(bean.getKey())){
adapter.showSeekBar();
}
icon.setSelected(true);
title.setSelected(true);
if(adapter.getString(KEY_VAL)!=null) {
bean.setIntensity(Double.parseDouble(adapter.getString(KEY_VAL))/100);
}
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
return true;
}
@Override
public void saveData() {
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) itemView.getTag();
adapter.save(getName(this), bean.getKey());
}
@Override
public void reset(List<? extends BaseBean> list) {
FaceBeautyFilterBean bean = (FaceBeautyFilterBean) list.get(0);
for (BaseBean baseBean : list) {
String key=getName(this)+baseBean.getKey()+"_val";
adapter.save(key,"40");
}
adapter.hideSeekBar();
adapter.save(getName(this),bean.getKey());
adapter.getFaceBeautyDataFactory().onFilterSelected(bean.getKey(), bean.getIntensity(), bean.getDesRes());
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,99 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.data.FineStickerDataFactory;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.net.FineStickerEntity;
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
import java.util.List;
/**
* 精品贴纸
*/
public class FineStickerViewHolder extends BaseViewHolder implements StickerDownloadHelper.Callback {
ImageView icon;
public FineStickerViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
TextView title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.GONE);
itemView.setOnClickListener(view -> {
FineStickerDataFactory.getInstance().downloadSticker((FineStickerEntity.DocsBean) itemView.getTag());
setSelectPosition(getAdapterPosition());
saveData();
});
FineStickerDataFactory.getInstance().addCallback(this);
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
if (data.getImageUrl().isEmpty()) {
icon.setImageResource(R.mipmap.icon_control_none);
} else {
ImgLoader.display(icon.getContext(), data.getImageUrl(), icon);
}
if (loadData()) {
return;
}
icon.setSelected(getSelectPosition() == getAdapterPosition());
}
@Override
public boolean loadData() {
FineStickerEntity.DocsBean bean = (FineStickerEntity.DocsBean) itemView.getTag();
String val = adapter.getString(getName(this) + bean.getKey());
if(val==null){
return false;
}
if(!val.equals(bean.getKey())){
return false;
}
FineStickerDataFactory.getInstance().downloadSticker(bean);
icon.setSelected(true);
return true;
}
@Override
public void saveData() {
FineStickerEntity.DocsBean bean = (FineStickerEntity.DocsBean) itemView.getTag();
adapter.save(getName(this), bean.getKey());
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.save(getName(this),list.get(0).getKey());
itemView.callOnClick();
adapter.setSelectPosition(0);
}
@Override
public void onGetTags(String[] tags) {
}
@Override
public void onGetList(String tag, FineStickerEntity fineSticker) {
}
@Override
public void onDownload(FineStickerEntity.DocsBean entity) {
FineStickerDataFactory.getInstance().onItemSelected(entity);
}
@Override
public void onDownloadError(FineStickerEntity.DocsBean entity, String msg) {
ToastUtil.show("下载失败 = " + msg);
}
}

View File

@@ -0,0 +1,161 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.MakeupCustomBean;
import com.yunbao.faceunity.repo.MakeupSource;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import java.util.List;
/**
* 美妆 - 自定义
*/
public class MakeupCustomItemViewHolder extends BaseViewHolder {
private ImageView icon;
private TextView title;
public MakeupCustomItemViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.INVISIBLE);
itemView.setOnClickListener(new View.OnClickListener() {
private String key = null;
@Override
public void onClick(View v) {
adapter.showSeekBar();
MakeupCustomBean bean = (MakeupCustomBean) itemView.getTag();
key = getMakeupKey(bean.getBeanType());
if (key == null) {
return;
}
adapter.getMakeupDataFactory().enterCustomMakeup();
adapter.getMakeupDataFactory().onCustomBeanSelected(key, getAdapterPosition());
adapter.getMakeupDataFactory().bindCurrentRenderer();
setSelectPosition(getAdapterPosition());
double intensity = adapter.getMakeupDataFactory().getCurrentCustomIntensity(key, adapter.getMakeupDataFactory().getCurrentCustomItemIndex(key));
adapter.getSeekBar().setProgress((int) (intensity * 100));
adapter.getSeekBar().setOnProgressChangeListener(new DiscreteSeekBar.OnSimpleProgressChangeListener() {
@Override
public void onProgressChanged(DiscreteSeekBar seekBar, int value, boolean fromUser) {
super.onProgressChanged(seekBar, value, fromUser);
float valueF = (float) (1.0 * (value - seekBar.getMin()) / 100);
int current = adapter.getMakeupDataFactory().getCurrentCustomItemIndex(key);
adapter.getMakeupDataFactory().updateCustomItemIntensity(key, current, valueF);
saveData();
}
});
saveData();
}
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageDrawable(data.getImageDrawable());
if (loadData()) {
return;
}
if (getSelectPosition() == getAdapterPosition()) {
icon.setSelected(true);
return;
}
icon.setSelected(false);
}
@Override
public boolean loadData() {
MakeupCustomBean bean = (MakeupCustomBean) itemView.getTag();
String model = adapter.getString(getName(this));
String val = adapter.getString(getName(this) + bean.getKey() + "_val");
if (model == null || val == null) {
return false;
}
if(!model.equals(bean.getKey())){
return false;
}
icon.setSelected(true);
String key = getMakeupKey(bean.getBeanType());
if (key == null) {
return false;
}
adapter.getMakeupDataFactory().enterCustomMakeup();
adapter.getMakeupDataFactory().onCustomBeanSelected(key, getAdapterPosition());
adapter.getMakeupDataFactory().bindCurrentRenderer();
adapter.getSeekBar().setProgress(Integer.parseInt(val));
float valueF = (float) (1.0 * (Integer.parseInt(val) - adapter.getSeekBar().getMin()) / 100);
int current = adapter.getMakeupDataFactory().getCurrentCustomItemIndex(key);
adapter.getMakeupDataFactory().updateCustomItemIntensity(key, current, valueF);
return true;
}
@Override
public void saveData() {
MakeupCustomBean bean = (MakeupCustomBean) itemView.getTag();
String key=getMakeupKey(bean.getBeanType());
if(key==null){
return;
}
adapter.save(getName(this), key);
adapter.save(getName(this) + bean.getKey() + "_val", adapter.getSeekBar().getProgress() + "");
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.save(getName(this),list.get(0).getKey());
for (BaseBean bean : list) {
adapter.del(getName(this) + bean.getKey() + "_val");
}
adapter.setSelectPosition(0);
}
public String getMakeupKey(int beanType) {
String key = null;
switch (beanType) {
case FaceParam.FACE_MAKEUP_TYPE_FOUNDATION:
key = MakeupSource.FACE_MAKEUP_TYPE_FOUNDATION;
break;
case FaceParam.FACE_MAKEUP_TYPE_LIP_STICK:
key = MakeupSource.FACE_MAKEUP_TYPE_LIP_STICK;
break;
case FaceParam.FACE_MAKEUP_TYPE_BLUSHER:
key = MakeupSource.FACE_MAKEUP_TYPE_BLUSHER;
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_BROW:
key = MakeupSource.FACE_MAKEUP_TYPE_EYE_BROW;
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW:
key = MakeupSource.FACE_MAKEUP_TYPE_EYE_SHADOW;
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_LINER:
key = MakeupSource.FACE_MAKEUP_TYPE_EYE_LINER;
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_LASH:
key = MakeupSource.FACE_MAKEUP_TYPE_EYE_LASH;
break;
case FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT:
key = MakeupSource.FACE_MAKEUP_TYPE_HIGH_LIGHT;
break;
case FaceParam.FACE_MAKEUP_TYPE_SHADOW:
key = MakeupSource.FACE_MAKEUP_TYPE_SHADOW;
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL:
key = MakeupSource.FACE_MAKEUP_TYPE_EYE_PUPIL;
break;
}
return key;
}
}

View File

@@ -0,0 +1,82 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.MakeupCombinationBean;
import com.yunbao.faceunity.utils.FaceSPUtils;
import java.util.List;
/**
* 美妆
*/
public class MakeupViewHolder extends BaseViewHolder {
private ImageView icon;
private TextView title;
public MakeupViewHolder(@NonNull View itemView) {
super(itemView);
icon = itemView.findViewById(R.id.iv_control);
title = itemView.findViewById(R.id.tv_control);
itemView.setOnClickListener(v -> {
adapter.getMakeupDataFactory().onMakeupCombinationSelected((MakeupCombinationBean) itemView.getTag());
setSelectPosition(getAdapterPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if(loadData()){
return;
}
if (getSelectPosition() == getAdapterPosition()) {
icon.setSelected(true);
title.setSelected(true);
return;
}
icon.setSelected(false);
title.setSelected(false);
}
@Override
public boolean loadData() {
MakeupCombinationBean bean = (MakeupCombinationBean) itemView.getTag();
String val = adapter.getString(getName(this));
if(val==null){
return false;
}
if(!val.equals(bean.getKey())){
return false;
}
icon.setSelected(true);
title.setSelected(true);
adapter.getMakeupDataFactory().onMakeupCombinationSelected(bean);
return true;
}
@Override
public void saveData() {
MakeupCombinationBean bean = (MakeupCombinationBean) itemView.getTag();
adapter.save(getName(this),bean.getKey());
}
@Override
public void reset(List<? extends BaseBean>list) {
adapter.save(getName(this),list.get(0).getKey());
FaceSPUtils.getInstance().delStart("MakeupCustomItemViewHolder");
adapter.getMakeupDataFactory().onMakeupCombinationSelected((MakeupCombinationBean) list.get(0));
adapter.getMakeupDataFactory().clearAll();
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,78 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.PropBean;
import java.util.List;
/**
* 普通贴纸
*/
public class StickerViewHolder extends BaseViewHolder{
ImageView icon;
public StickerViewHolder(@NonNull View itemView) {
super(itemView);
icon =itemView.findViewById(R.id.iv_control);
TextView title = itemView.findViewById(R.id.tv_control);
title.setVisibility(View.GONE);
itemView.setOnClickListener(v -> {
PropBean bean= (PropBean) itemView.getTag();
adapter.getPropDataFactory().setPropType(FunctionEnum.STICKER);
adapter.getPropDataFactory().onItemSelected(bean);
setSelectPosition(getAdapterPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
if(loadData()){
return;
}
if(getAdapterPosition()==0){
icon.setBackgroundResource(R.drawable.bg_control_oval2_selector);
}
icon.setSelected(getSelectPosition() == getAdapterPosition());
}
@Override
public boolean loadData() {
PropBean bean= (PropBean) itemView.getTag();
String val = adapter.getString(getName(this));
if(val==null){
return false;
}
if(!val.equals(bean.getKey())){
return false;
}
icon.setSelected(true);
adapter.getPropDataFactory().setPropType(FunctionEnum.STICKER);
adapter.getPropDataFactory().onItemSelected(bean);
return true;
}
@Override
public void saveData() {
PropBean bean= (PropBean) itemView.getTag();
adapter.save(getName(this),bean.getKey());
}
@Override
public void reset(List<? extends BaseBean> list) {
adapter.save(getName(this),list.get(0).getKey());
adapter.getPropDataFactory().setPropType(FunctionEnum.STICKER);
adapter.getPropDataFactory().onItemSelected((PropBean) list.get(0));
adapter.setSelectPosition(0);
}
}

View File

@@ -0,0 +1,76 @@
package com.yunbao.faceunity.adapters.vh;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BaseBean;
import java.util.List;
/**
* 风格推荐
*/
public class StyleViewHolder extends BaseViewHolder{
private ImageView icon;
private TextView title;
public StyleViewHolder(@NonNull View itemView) {
super(itemView);
icon=itemView.findViewById(R.id.iv_control);
title=itemView.findViewById(R.id.tv_control);
itemView.setOnClickListener(v -> {
BaseBean bean= (BaseBean) itemView.getTag();
adapter.getFaceBeautyDataFactory().onStyleSelected(bean.getKey());
setSelectPosition(getAdapterPosition());
saveData();
});
}
@Override
public void setData(BaseBean data) {
itemView.setTag(data);
icon.setImageResource(data.getImageRes());
title.setText(data.getDesRes());
if(loadData()){
return;
}
icon.setSelected(getSelectPosition()==getAdapterPosition());
title.setSelected(getSelectPosition()==getAdapterPosition());
}
@Override
public boolean loadData() {
BaseBean bean= (BaseBean) itemView.getTag();
String val = adapter.getString(getName(this));
if(val==null){
icon.setSelected(false);
title.setSelected(false);
return true;
}
if(!val.equals(bean.getKey())){
return false;
}
icon.setSelected(true);
title.setSelected(true);
adapter.getFaceBeautyDataFactory().onStyleSelected(bean.getKey());
return true;
}
@Override
public void saveData() {
BaseBean bean= (BaseBean) itemView.getTag();
adapter.save(getName(this),bean.getKey());
}
@Override
public void reset(List<? extends BaseBean> list) {
// adapter.save(getName(this),list.get(0).getKey());
adapter.setSelectPosition(0);
adapter.del(getName(this));
adapter.getFaceBeautyDataFactory().onStyleSelected(null);
}
}

View File

@@ -0,0 +1,35 @@
package com.yunbao.faceunity.checkbox;
import android.content.Context;
import android.graphics.drawable.StateListDrawable;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatCheckBox;
/**
* 解决 RadioButton 在 Android4.4 调用setButtonDrawable(null) 和 XML 设置 android:button="@null"无效的问题
*
* @author Richie on 2020.05.18
*/
public class CheckBoxCompat extends AppCompatCheckBox {
public CheckBoxCompat(Context context) {
super(context);
init();
}
public CheckBoxCompat(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CheckBoxCompat(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
setButtonDrawable(new StateListDrawable());
}
}

View File

@@ -0,0 +1,278 @@
package com.yunbao.faceunity.checkbox;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import androidx.annotation.IdRes;
/**
* Created by tujh on 2018/4/17.
*/
public class CheckGroup extends LinearLayout {
private static final String LOG_TAG = CheckGroup.class.getSimpleName();
// holds the checked id; the selection is empty by default
private int mCheckedId = View.NO_ID;
// tracks children radio buttons checked state
private CompoundButton.OnCheckedChangeListener mChildOnCheckedChangeListener;
// when true, mOnCheckedChangeListener discards events
private boolean mProtectFromCheckedChange = false;
private OnCheckedChangeListener mOnCheckedChangeListener;
private PassThroughHierarchyChangeListener mPassThroughListener;
private OnDispatchActionUpListener mOnDispatchActionUpListener;
/**
* {@inheritDoc}
*/
public CheckGroup(Context context) {
super(context);
setOrientation(VERTICAL);
init();
}
/**
* {@inheritDoc}
*/
public CheckGroup(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
private void init() {
mChildOnCheckedChangeListener = new CheckedStateTracker();
mPassThroughListener = new PassThroughHierarchyChangeListener();
super.setOnHierarchyChangeListener(mPassThroughListener);
}
public void setOnDispatchActionUpListener(OnDispatchActionUpListener onDispatchActionUpListener) {
mOnDispatchActionUpListener = onDispatchActionUpListener;
}
/**
* {@inheritDoc}
*/
@Override
public void setOnHierarchyChangeListener(OnHierarchyChangeListener listener) {
// the user listener is delegated to our pass-through listener
mPassThroughListener.mOnHierarchyChangeListener = listener;
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_UP) {
if (mOnDispatchActionUpListener != null) {
mOnDispatchActionUpListener.onDispatchActionUp((int) ev.getX());
}
}
return super.dispatchTouchEvent(ev);
}
/**
* {@inheritDoc}
*/
@Override
protected void onFinishInflate() {
super.onFinishInflate();
// checks the appropriate radio button as requested in the XML file
if (mCheckedId != View.NO_ID) {
mProtectFromCheckedChange = true;
setCheckedStateForView(mCheckedId, true);
mProtectFromCheckedChange = false;
setCheckedId(mCheckedId);
}
}
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
if (child instanceof CheckBox) {
final CheckBox button = (CheckBox) child;
if (button.isChecked()) {
mProtectFromCheckedChange = true;
if (mCheckedId != View.NO_ID) {
setCheckedStateForView(mCheckedId, false);
}
mProtectFromCheckedChange = false;
setCheckedId(button.getId());
}
}
super.addView(child, index, params);
}
/**
* <p>Sets the selection to the radio button whose identifier is passed in
* parameter. Using View.NO_ID as the selection identifier clears the selection;
* such an operation is equivalent to invoking {@link #clearCheck()}.</p>
*
* @param id the unique id of the radio button to select in this group
* @see #getCheckedCheckBoxId()
* @see #clearCheck()
*/
public void check(@IdRes int id) {
// don't even bother
if (id != View.NO_ID && (id == mCheckedId)) {
return;
}
if (mCheckedId != View.NO_ID) {
setCheckedStateForView(mCheckedId, false);
}
if (id != View.NO_ID) {
setCheckedStateForView(id, true);
}
setCheckedId(id);
}
private void setCheckedId(@IdRes int id) {
mCheckedId = id;
if (mOnCheckedChangeListener != null) {
mOnCheckedChangeListener.onCheckedChanged(this, mCheckedId);
}
}
private void setCheckedStateForView(int viewId, boolean checked) {
View checkedView = findViewById(viewId);
if (checkedView != null && checkedView instanceof CheckBox) {
((CheckBox) checkedView).setChecked(checked);
}
}
/**
* <p>Returns the identifier of the selected radio button in this group.
* Upon empty selection, the returned value is View.NO_ID.</p>
*
* @return the unique id of the selected radio button in this group
* @attr ref android.R.styleable#CheckGroup_checkedButton
* @see #check(int)
* @see #clearCheck()
*/
@IdRes
public int getCheckedCheckBoxId() {
return mCheckedId;
}
/**
* <p>Clears the selection. When the selection is cleared, no radio button
* in this group is selected and {@link #getCheckedCheckBoxId()} returns
* null.</p>
*
* @see #check(int)
* @see #getCheckedCheckBoxId()
*/
public void clearCheck() {
check(View.NO_ID);
}
/**
* <p>Register a callback to be invoked when the checked radio button
* changes in this group.</p>
*
* @param listener the callback to call on checked state change
*/
public void setOnCheckedChangeListener(OnCheckedChangeListener listener) {
mOnCheckedChangeListener = listener;
}
@Override
public CharSequence getAccessibilityClassName() {
return CheckGroup.class.getName();
}
/**
* <p>Interface definition for a callback to be invoked when the checked
* radio button changed in this group.</p>
*/
public interface OnCheckedChangeListener {
/**
* <p>Called when the checked radio button has changed. When the
* selection is cleared, checkedId is View.NO_ID.</p>
*
* @param group the group in which the checked radio button has changed
* @param checkedId the unique identifier of the newly checked radio button
*/
public void onCheckedChanged(CheckGroup group, @IdRes int checkedId);
}
private class CheckedStateTracker implements CompoundButton.OnCheckedChangeListener {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// prevents from infinite recursion
if (mProtectFromCheckedChange) {
return;
}
int id = buttonView.getId();
mProtectFromCheckedChange = true;
if (mCheckedId != View.NO_ID && mCheckedId != id) {
setCheckedStateForView(mCheckedId, false);
}
mProtectFromCheckedChange = false;
setCheckedId(isChecked ? id : View.NO_ID);
}
}
/**
* <p>A pass-through listener acts upon the events and dispatches them
* to another listener. This allows the table layout to set its own internal
* hierarchy change listener without preventing the user to setup his.</p>
*/
private class PassThroughHierarchyChangeListener implements
OnHierarchyChangeListener {
private OnHierarchyChangeListener mOnHierarchyChangeListener;
/**
* {@inheritDoc}
*/
@Override
public void onChildViewAdded(View parent, View child) {
if (parent == CheckGroup.this && child instanceof CheckBox) {
int id = child.getId();
// generates an id if it's missing
if (id == View.NO_ID) {
id = View.generateViewId();
child.setId(id);
}
((CheckBox) child).setOnCheckedChangeListener(
mChildOnCheckedChangeListener);
}
if (mOnHierarchyChangeListener != null) {
mOnHierarchyChangeListener.onChildViewAdded(parent, child);
}
}
/**
* {@inheritDoc}
*/
@Override
public void onChildViewRemoved(View parent, View child) {
if (parent == CheckGroup.this && child instanceof CheckBox) {
((CheckBox) child).setOnCheckedChangeListener(null);
}
if (mOnHierarchyChangeListener != null) {
mOnHierarchyChangeListener.onChildViewRemoved(parent, child);
}
}
}
public interface OnDispatchActionUpListener {
/**
* 分发 action up 事件时回调
*
* @param x
*/
void onDispatchActionUp(int x);
}
}

View File

@@ -0,0 +1,168 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.animationFilter.AnimationFilter;
import com.faceunity.core.model.antialiasing.Antialiasing;
import com.faceunity.core.model.prop.Prop;
import com.faceunity.core.model.prop.PropContainer;
import com.faceunity.core.model.prop.animoji.Animoji;
import com.yunbao.faceunity.entity.AnimationFilterBean;
import com.yunbao.faceunity.entity.AnimojiBean;
import com.yunbao.faceunity.infe.AbstractAnimojiDataFactory;
import com.yunbao.faceunity.repo.AnimojiSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
/**
* DESCAnimoji业务工厂
* Created on 2021/3/3
*/
public class AnimojiDataFactory extends AbstractAnimojiDataFactory {
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
private FUAIKit mFUAIKit = FUAIKit.getInstance();
/*3D抗锯齿*/
public final Antialiasing antialiasing;
/*动漫滤镜模型*/
public final AnimationFilter animationFilter;
/*当前选中贴图模型*/
private Prop currentAnimoji;
/*当前选中下标*/
private int currentAnimojiIndex;
/*当前滤镜下标*/
private int currentFilterIndex;
/*Animoji数据*/
private ArrayList<AnimojiBean> animojiBeans;
/*Animoji滤镜数据*/
private ArrayList<AnimationFilterBean> animationFilterBeans;
/**
* 构造 AnimojiDataFactory
*
* @param animojiIndex 贴图下标
* @param filterIndex 滤镜下标
*/
public AnimojiDataFactory(int animojiIndex, int filterIndex) {
antialiasing = new Antialiasing(new FUBundleData(FaceUnityConfig.BUNDLE_ANTI_ALIASING));
animationFilter = new AnimationFilter(new FUBundleData(FaceUnityConfig.BUNDLE_ANIMATION_FILTER));
currentAnimojiIndex = animojiIndex;
currentFilterIndex = filterIndex;
animojiBeans = AnimojiSource.buildAnimojis();
animationFilterBeans = AnimojiSource.buildFilters();
bindCurrentRenderer();
}
/**
* 动漫贴图列表
*
* @return
*/
@Override
public ArrayList<AnimojiBean> getAnimojis() {
return animojiBeans;
}
/**
* 动漫滤镜列表
*
* @return
*/
@Override
public ArrayList<AnimationFilterBean> getFilters() {
return animationFilterBeans;
}
/**
* 当前选中动漫贴图下标
*
* @return
*/
@Override
public int getCurrentAnimojiIndex() {
return currentAnimojiIndex;
}
/**
* 设置当前选中动漫贴图下标
*
* @return
*/
@Override
public void setCurrentAnimojiIndex(int currentAnimojiIndex) {
this.currentAnimojiIndex = currentAnimojiIndex;
}
/**
* 当前选中滤镜下标
*
* @return
*/
@Override
public int getCurrentFilterIndex() {
return currentFilterIndex;
}
/**
* 设置当前选中动漫贴图下标
*
* @return
*/
@Override
public void setCurrentFilterIndex(int currentFilterIndex) {
this.currentFilterIndex = currentFilterIndex;
}
/**
* 设置选中贴图
*
* @param bean
*/
@Override
public void onAnimojiSelected(AnimojiBean bean) {
PropContainer propContainer = mFURenderKit.getPropContainer();
String path = bean.getPath();
Prop prop = null;
if (path != null && path.trim().length() > 0) {
prop = new Animoji(new FUBundleData(path));
}
propContainer.replaceProp(currentAnimoji, prop);
currentAnimoji = prop;
}
/**
* 设置选中滤镜
*
* @param data
*/
@Override
public void onFilterSelected(AnimationFilterBean data) {
animationFilter.setStyle(data.getStyle());
}
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFUAIKit.loadAIProcessor(FaceUnityConfig.BUNDLE_AI_TONGUE, FUAITypeEnum.FUAITYPE_TONGUETRACKING);
mFUAIKit.setMaxFaces(4);
mFURenderKit.setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
mFURenderKit.setAntialiasing(antialiasing);
mFURenderKit.setAnimationFilter(animationFilter);
animationFilter.setStyle(animationFilterBeans.get(currentFilterIndex).getStyle());
onAnimojiSelected(animojiBeans.get(currentAnimojiIndex));
}
/**
* 结束需要释放AI驱动
*/
public void releaseAIProcessor() {
mFUAIKit.releaseAIProcessor(FUAITypeEnum.FUAITYPE_TONGUETRACKING);
}
}

View File

@@ -0,0 +1,158 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.avatar.model.Avatar;
import com.faceunity.core.avatar.model.Scene;
import com.faceunity.core.avatar.scene.ProcessorConfig;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUCoordinate3DData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.faceunity.FUSceneKit;
import com.faceunity.core.model.antialiasing.Antialiasing;
import com.yunbao.faceunity.entity.AvatarBean;
import com.yunbao.faceunity.infe.AbstractAvatarDataFactory;
import com.yunbao.faceunity.repo.AvatarSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
/**
* DESC
* Created on 2021/3/30
*/
public class AvatarDataFactory extends AbstractAvatarDataFactory {
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
private FUAIKit mFUAIKit = FUAIKit.getInstance();
/*3D抗锯齿*/
public final Antialiasing antialiasing;
/* 人物队列 */
private ArrayList<AvatarBean> members;
/* 当前选中人物下标 */
private int currentMemberIndex;
/* 驱动类型是否为全身 */
private Boolean isHumanTrackSceneFull;
/* 场景 */
private Scene sceneModel;
/* 男孩对象 */
private Avatar boyAvatarModel;
/* 女孩对象 */
private Avatar girlAvatarModel;
/*当前对象*/
private Avatar currentAvatarModel;
public AvatarDataFactory(int index, boolean isFull) {
isHumanTrackSceneFull = isFull;
currentMemberIndex = index;
members = AvatarSource.buildMembers();
antialiasing = new Antialiasing(new FUBundleData(FaceUnityConfig.BUNDLE_ANTI_ALIASING));
boyAvatarModel = AvatarSource.buildBoyData(isFull);
girlAvatarModel = AvatarSource.buildGirlData(isFull);
if (index == 0) {
currentAvatarModel = girlAvatarModel;
} else if (index == 1) {
currentAvatarModel = boyAvatarModel;
}
sceneModel = AvatarSource.buildSceneModel(currentAvatarModel);
AvatarSource.setSceneBackGround(sceneModel, true);
}
/**
* 获取人物队列
*
* @return
*/
@Override
public ArrayList<AvatarBean> getMembers() {
return members;
}
/**
* 获取当前选中人物下标
*
* @return
*/
@Override
public int getCurrentMemberIndex() {
return currentMemberIndex;
}
/**
* 设置当前人物选中下标
*
* @param index
*/
@Override
public void setCurrentMemberIndex(int index) {
currentMemberIndex = index;
}
/**
* 获取当前驱动类型
*
* @return
*/
@Override
public boolean isHumanTrackSceneFull() {
return isHumanTrackSceneFull;
}
/**
* 设置当前驱动类型
*
* @param isFull
*/
@Override
public void setHumanTrackSceneFull(boolean isFull) {
isHumanTrackSceneFull = isFull;
sceneModel.processorConfig.setTrackScene(isFull ? ProcessorConfig.TrackScene.SceneFull : ProcessorConfig.TrackScene.SceneHalf);
if (isFull) {
boyAvatarModel.transForm.setPosition(new FUCoordinate3DData(0.0, 58.14, -618.94));
girlAvatarModel.transForm.setPosition(new FUCoordinate3DData(0.0, 58.14, -618.94));
} else {
boyAvatarModel.transForm.setPosition(new FUCoordinate3DData(0.0, 11.76, -183.89));
girlAvatarModel.transForm.setPosition(new FUCoordinate3DData(0.0, 11.76, -183.89));
}
}
/**
* 人物切换
*
* @param bean
*/
@Override
public void onMemberSelected(AvatarBean bean) {
if (mAvatarChoiceListener != null)
mAvatarChoiceListener.choiceAvatar(bean);
sceneModel.replaceAvatar(currentAvatarModel, bean.getDes().equals(AvatarSource.GIRL) ? girlAvatarModel : boyAvatarModel);
currentAvatarModel = bean.getDes().equals(AvatarSource.GIRL) ? girlAvatarModel : boyAvatarModel;
}
public void bindCurrentRenderer() {
mFUAIKit.loadAIProcessor(FaceUnityConfig.getAIHumanBundle(), FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
mFUAIKit.setMaxFaces(1);
mFURenderKit.setAntialiasing(antialiasing);
FUSceneKit.getInstance().addSceneGL(sceneModel);
FUSceneKit.getInstance().setCurrentSceneGL(sceneModel);
setHumanTrackSceneFull(isHumanTrackSceneFull);
}
public AvatarChoiceListener mAvatarChoiceListener;
public interface AvatarChoiceListener {
void choiceAvatar(AvatarBean avatarBean);
}
public void setAvatarChoiceListener(AvatarChoiceListener avatarChoiceListener) {
this.mAvatarChoiceListener = avatarChoiceListener;
}
}

View File

@@ -0,0 +1,347 @@
package com.yunbao.faceunity.data;
import androidx.annotation.NonNull;
import com.faceunity.core.controller.bgSegGreen.BgSegGreenParam;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.bgSegGreen.BgSegGreen;
import com.yunbao.faceunity.entity.BgSegGreenBackgroundBean;
import com.yunbao.faceunity.entity.BgSegGreenBean;
import com.yunbao.faceunity.entity.BgSegGreenSafeAreaBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.infe.AbstractBgSegGreenDataFactory;
import com.yunbao.faceunity.repo.BgSegGreenSource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Objects;
/**
* DESC绿幕抠像业务工厂
* Created on 2021/3/4
*/
public class BgSegGreenDataFactory extends AbstractBgSegGreenDataFactory {
public interface BgSegGreenListener {
/**
* 取色状态回调
*
* @param isSelected 是否选中
* @param color 默认颜色
*/
void onColorPickerStateChanged(boolean isSelected, int color);
/**
* 切换背景道具
*
* @param bean
*/
void onBackgroundSelected(BgSegGreenBackgroundBean bean);
/**
* 添加自定义安全区域图片
*/
void onSafeAreaAdd();
/**
* 切换安全区域图片
*
* @param bean
*/
void onSafeAreaSelected(BgSegGreenSafeAreaBean bean);
}
/*渲染控制器*/
private final FURenderKit mFURenderKit = FURenderKit.getInstance();
/*绿幕抠像特效模型*/
private final BgSegGreen mBgSegGreen;
/*绿幕抠像背景列表*/
private final ArrayList<BgSegGreenBackgroundBean> mBgSegGreenBackgroundBeans;
/* 绿幕抠像当前背景下标 */
private int mCurrentBackgroundIndex;
/*绿幕抠像安全区域列表*/
private ArrayList<BgSegGreenSafeAreaBean> mBgSegGreenSafeAreaBeans;
/* 绿幕抠像当前安全区域下标 */
private int mCurrentSafeAreaIndex;
/* 回调 */
private final BgSegGreenListener mBgSegGreenListener;
/**
* 构造绿幕抠像
*
* @param listener 回调
* @param index 背景下标
*/
public BgSegGreenDataFactory(BgSegGreenListener listener, int index) {
mBgSegGreenListener = listener;
mBgSegGreen = BgSegGreenSource.buildBgSegGreen();
mBgSegGreenBackgroundBeans = BgSegGreenSource.buildBgSegGreenBackground();
mBgSegGreenSafeAreaBeans = BgSegGreenSource.buildBgSegGreenSafeArea();
mCurrentBackgroundIndex = index;
mCurrentSafeAreaIndex = 1;
}
/**
* 获取绿幕抠像当前背景下标
*
* @return
*/
@Override
public int getBackgroundIndex() {
return mCurrentBackgroundIndex;
}
/**
* 设置绿幕抠像当前背景下标
*
* @param backgroundIndex
*/
@Override
public void setBackgroundIndex(int backgroundIndex) {
this.mCurrentBackgroundIndex = backgroundIndex;
}
/**
* 获取绿幕抠像当前安全区域下标
*
* @return
*/
@Override
public int getBgSafeAreaIndex() {
return mCurrentSafeAreaIndex;
}
/**
* 设置绿幕抠像安全区域下标
*
* @param currentSafeAreaIndex
*/
@Override
public void setBgSafeAreaIndex(int currentSafeAreaIndex) {
this.mCurrentSafeAreaIndex = currentSafeAreaIndex;
}
/**
* 更新安全区UI
*/
public boolean updateSafeAreaBeansAndIndex() {
ArrayList<BgSegGreenSafeAreaBean> bgSegGreenSafeAreaBeans = BgSegGreenSource.buildBgSegGreenSafeArea();
if (!bgSegGreenSafeAreaBeans.equals(mBgSegGreenSafeAreaBeans)) {
//需要刷新数据
//比对数据 1、数据增加 or 自定义数据修改 -> 当前应该选中的角标
if (bgSegGreenSafeAreaBeans.size() > mBgSegGreenSafeAreaBeans.size()) {
//数据增加
if (mCurrentSafeAreaIndex > 2) {
mCurrentSafeAreaIndex++;
}
}
mBgSegGreenSafeAreaBeans = bgSegGreenSafeAreaBeans;
return true;
}
return false;
}
/**
* 获取绿幕抠像项目数据扩展模型
*
* @return
*/
@Override
public HashMap<String, ModelAttributeData> getModelAttributeRange() {
return BgSegGreenSource.buildModelAttributeRange();
}
/**
* 获取绿幕抠像功能列表
*
* @return
*/
@Override
public ArrayList<BgSegGreenBean> getBgSegGreenActions() {
return BgSegGreenSource.buildBgSegGreenAction();
}
/**
* 获取绿幕抠像安全区域功能列表
*
* @return
*/
@Override
public ArrayList<BgSegGreenSafeAreaBean> getBgSegGreenSafeAreas() {
return mBgSegGreenSafeAreaBeans;
}
/**
* 获取绿幕抠像背景列表
*
* @return
*/
@Override
public ArrayList<BgSegGreenBackgroundBean> getBgSegGreenBackgrounds() {
return mBgSegGreenBackgroundBeans;
}
/**
* 背景图片变更
*
* @param data BgSegGreenBackgroundBean
*/
@Override
public void onBackgroundSelected(BgSegGreenBackgroundBean data) {
mBgSegGreenListener.onBackgroundSelected(data);
}
/**
* 自定义安全区域
*/
@Override
public void onSafeAreaAdd() {
mBgSegGreenListener.onSafeAreaAdd();
}
/**
* 安全区域变更
*
* @param data BgSegGreenBackgroundBean
*/
@Override
public void onSafeAreaSelected(BgSegGreenSafeAreaBean data) {
mBgSegGreenListener.onSafeAreaSelected(data);
}
@Override
public boolean isUseTemplate() {
return getCurrentBgSegGreenModel().isUseTemplate() == 1.0;
}
/**
* 取色锚点颜色变更
*
* @param array DoubleArray
*/
@Override
public void onColorRGBChanged(double[] array) {
mBgSegGreen.setColorRGB(new FUColorRGBData(array[0], array[1], array[2]));
mBgSegGreen.setEnable(true);
}
/**
* 绿幕开关
*
* @param enable Boolean
*/
@Override
public void onBgSegGreenEnableChanged(boolean enable) {
mBgSegGreen.setEnable(enable);
}
/**
* 根据名称标识获取对应的值
*
* @param key String 标识
* @return Double 值
*/
@Override
public double getParamIntensity(@NonNull String key) {
if (bgSegGreenGetMapping.containsKey(key)) {
return bgSegGreenGetMapping.get(key).getValue();
}
return 0.0;
}
/**
* 根据名称标识更新对应的值
*
* @param key String 标识
* @return Double 值
*/
@Override
public void updateParamIntensity(@NonNull String key, double value) {
if (bgSegGreenSetMapping.containsKey(key)) {
Objects.requireNonNull(bgSegGreenSetMapping.get(key)).setValue(value);
}
}
/**
* 调用取色器功能状态变更
*
* @param selected
* @param color
*/
@Override
public void onColorPickerStateChanged(boolean selected, int color) {
mBgSegGreenListener.onColorPickerStateChanged(selected, color);
}
//region 业务映射
/**
* 参数设置
*/
interface BgSegGreenSetParam {
void setValue(double value);
}
/**
* 模型参数获取
*/
interface BgSegGreenGetParam {
double getValue();
}
/**
* 获取当前绿幕对象
*
* @return
*/
private BgSegGreen getCurrentBgSegGreenModel() {
return mBgSegGreen;
}
/* 模型映射 */
private final HashMap<String, BgSegGreenSetParam> bgSegGreenSetMapping = new HashMap<String, BgSegGreenSetParam>() {
{
put(BgSegGreenParam.SIMILARITY, value -> getCurrentBgSegGreenModel().setSimilarity(value));
put(BgSegGreenParam.SMOOTHNESS, value -> getCurrentBgSegGreenModel().setSmoothness(value));
put(BgSegGreenParam.TRANSPARENCY, value -> getCurrentBgSegGreenModel().setTransparency(value));
}
};
/*模型映射获取模型值*/
private final HashMap<String, BgSegGreenGetParam> bgSegGreenGetMapping = new HashMap<String, BgSegGreenGetParam>() {
{
put(BgSegGreenParam.SIMILARITY, () -> getCurrentBgSegGreenModel().getSimilarity());
put(BgSegGreenParam.SMOOTHNESS, () -> getCurrentBgSegGreenModel().getSmoothness());
put(BgSegGreenParam.TRANSPARENCY, () -> getCurrentBgSegGreenModel().getTransparency());
}
};
//endregion 业务映射
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
FUAIKit.getInstance().setMaxFaces(1);
mFURenderKit.setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
mFURenderKit.setBgSegGreen(mBgSegGreen);
mBgSegGreenListener.onBackgroundSelected(mBgSegGreenBackgroundBeans.get(mCurrentBackgroundIndex));
mBgSegGreenListener.onSafeAreaSelected(mBgSegGreenSafeAreaBeans.get(mCurrentSafeAreaIndex));
}
}

View File

@@ -0,0 +1,160 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.controller.bodyBeauty.BodyBeautyParam;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.bodyBeauty.BodyBeauty;
import com.yunbao.faceunity.entity.BodyBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.infe.AbstractBodyBeautyDataFactory;
import com.yunbao.faceunity.repo.BodyBeautySource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC美体业务工厂
* Created on 2021/3/2
*/
public class BodyBeautyDataFactory extends AbstractBodyBeautyDataFactory {
interface BodyBeautySetParamInterface {
void setValue(double value);
}
interface BodyBeautyGetParamInterface {
double getValue();
}
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
private FUAIKit mFUAIKit = FUAIKit.getInstance();
/*美体数据模型*/
public final BodyBeauty bodyBeauty;
public BodyBeautyDataFactory() {
bodyBeauty = new BodyBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_BODY_BEAUTY));
}
/**
* 获取美体属性列表
*
* @return
*/
@Override
public ArrayList<BodyBeautyBean> getBodyBeautyParam() {
return BodyBeautySource.buildBodyBeauty();
}
/**
* 获取美体扩展参数
*
* @return
*/
@Override
public HashMap<String, ModelAttributeData> getModelAttributeRange() {
return BodyBeautySource.buildModelAttributeRange();
}
/**
* 获取模型参数
*
* @param key 名称标识
* @return
*/
@Override
public double getParamIntensity(String key) {
if (bodyBeautyGetMapping.containsKey(key)) {
return bodyBeautyGetMapping.get(key).getValue();
}
return 0.0;
}
/**
* 设置属性参数
*
* @param key 名称标识
* @param value 结果值
*/
@Override
public void updateParamIntensity(String key, double value) {
if (bodyBeautySetMapping.containsKey(key)) {
bodyBeautySetMapping.get(key).setValue(value);
}
}
@Override
public void enableBodyBeauty(boolean enable) {
if (mFURenderKit.getBodyBeauty() != null) {
mFURenderKit.getBodyBeauty().setEnable(enable);
}
}
/**
* 获取当前模型
*
* @return
*/
private BodyBeauty getCurrentBodyBeautyModel() {
return bodyBeauty;
}
/*模型映射设置模型值*/
private final HashMap<String, BodyBeautySetParamInterface> bodyBeautySetMapping = new HashMap<String, BodyBeautySetParamInterface>() {
{
put(BodyBeautyParam.BODY_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setBodySlimIntensity(value));
put(BodyBeautyParam.LEG_STRETCH_INTENSITY, value -> getCurrentBodyBeautyModel().setLegStretchIntensity(value));
put(BodyBeautyParam.WAIST_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setWaistSlimIntensity(value));
put(BodyBeautyParam.SHOULDER_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setShoulderSlimIntensity(value));
put(BodyBeautyParam.HIP_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setHipSlimIntensity(value));
put(BodyBeautyParam.HEAD_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setHeadSlimIntensity(value));
put(BodyBeautyParam.LEG_SLIM_INTENSITY, value -> getCurrentBodyBeautyModel().setLegSlimIntensity(value));
}
};
/*模型映射获取模型值*/
HashMap<String, BodyBeautyGetParamInterface> bodyBeautyGetMapping = new HashMap<String, BodyBeautyGetParamInterface>() {
{
put(BodyBeautyParam.BODY_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getBodySlimIntensity());
put(BodyBeautyParam.LEG_STRETCH_INTENSITY, ()->getCurrentBodyBeautyModel().getLegStretchIntensity());
put(BodyBeautyParam.WAIST_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getWaistSlimIntensity());
put(BodyBeautyParam.SHOULDER_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getShoulderSlimIntensity());
put(BodyBeautyParam.HIP_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getHipSlimIntensity());
put(BodyBeautyParam.HEAD_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getHeadSlimIntensity());
put(BodyBeautyParam.LEG_SLIM_INTENSITY, ()->getCurrentBodyBeautyModel().getLegSlimIntensity());
}
};
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFUAIKit.loadAIProcessor(FaceUnityConfig.getAIHumanBundle(), FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
mFUAIKit.setMaxFaces(1);
mFURenderKit.setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
mFURenderKit.setBodyBeauty(bodyBeauty);
}
/**
* 结束需要释放AI驱动
*/
public void releaseAIProcessor() {
mFUAIKit.releaseAIProcessor(FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
}
}

View File

@@ -0,0 +1,101 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.model.facebeauty.FaceBeautyBlurTypeEnum;
import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
import java.io.Serializable;
import java.util.HashMap;
/**
* 保存到磁盘的对象
* 该例只保存特效demo展示出来的美颜功能
*/
public class FaceBeautyData implements Serializable {
/* 美肤 */
/* 磨皮类型 */
public int blurType = FaceBeautyBlurTypeEnum.FineSkin;
/* 磨皮程度 */
public double blurIntensity = 0.0;
/* 美白程度 */
public double colorIntensity = 0.0;
/* 红润程度 */
public double redIntensity = 0.0;
/* 锐化程度 */
public double sharpenIntensity = 0.0;
/* 亮眼程度 */
public double eyeBrightIntensity = 0.0;
/* 美牙程度 */
public double toothIntensity = 0.0;
/* 去黑眼圈强度*/
public double removePouchIntensity = 0.0;
/* 去法令纹强度*/
public double removeLawPatternIntensity = 0.0;
/*美型*/
/* 瘦脸程度 */
public double cheekThinningIntensity = 0.0;
/* V脸程度 */
public double cheekVIntensity = 0.0;
/* 窄脸程度 */
public double cheekNarrowIntensity = 0.0;
/* 短脸程度 */
public double cheekShortIntensity = 0.0;
/* 小脸程度 */
public double cheekSmallIntensity = 0.0;
/* 瘦颧骨 */
public double cheekBonesIntensity = 0.0;
/* 瘦下颌骨 */
public double lowerJawIntensity = 0.0;
/* 大眼程度 */
public double eyeEnlargingIntensity = 0.0;
/* 圆眼程度 */
public double eyeCircleIntensity = 0.0;
/* 下巴调整程度 */
public double chinIntensity = 0.5;
/* 额头调整程度 */
public double forHeadIntensity = 0.5;
/* 瘦鼻程度 */
public double noseIntensity = 0.0;
/* 嘴巴调整程度 */
public double mouthIntensity = 0.5;
/* 开眼角强度 */
public double canthusIntensity = 0.0;
/* 眼睛间距 */
public double eyeSpaceIntensity = 0.5;
/* 眼睛角度 */
public double eyeRotateIntensity = 0.5;
/* 鼻子长度 */
public double longNoseIntensity = 0.5;
/* 调节人中 */
public double philtrumIntensity = 0.5;
/* 微笑嘴角强度 */
public double smileIntensity = 0.0;
/* 眉毛上下 */
public double browHeightIntensity = 0.5;
/* 眉毛间距 */
public double browSpaceIntensity = 0.5;
/* 眼睑 */
public double eyeLidIntensity = 0.0;
/* 眼睛高度 */
public double eyeHeightIntensity = 0.5;
/* 眉毛粗细 */
public double browThickIntensity = 0.5;
/* 嘴巴厚度 */
public double lipThickIntensity = 0.5;
/* 五官立体 */
public double faceThreeIntensity = 0.5;
/* 风格推荐 */
/* 是否开启风格推荐 */
/* 风格推荐类型 */
public int styleTypeIndex = -1;
//所有滤镜
public HashMap<String,Double> filterMap = new HashMap<>();
/* 滤镜相关 */
/* 滤镜名称 */
public String filterName = FaceBeautyFilterEnum.ORIGIN;
/* 滤镜程度 */
public double filterIntensity = 0.0f;
}

View File

@@ -0,0 +1,470 @@
package com.yunbao.faceunity.data;
import androidx.annotation.NonNull;
import com.faceunity.core.controller.facebeauty.FaceBeautyParam;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.facebeauty.FaceBeauty;
import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
import com.faceunity.core.model.prop.expression.ExpressionRecognition;
import com.yunbao.faceunity.entity.FaceBeautyBean;
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
import com.yunbao.faceunity.entity.FaceBeautyStyleBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.infe.AbstractFaceBeautyDataFactory;
import com.yunbao.faceunity.repo.FaceBeautySource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC美颜业务工厂
* Created on 2021/3/1
*/
public class FaceBeautyDataFactory extends AbstractFaceBeautyDataFactory {
public interface FaceBeautyListener {
/**
* 风格切换
*
* @param res
*/
void onFilterSelected(int res);
/**
* 美颜开关
*
* @param enable
*/
void onFaceBeautyEnable(boolean enable);
}
interface FaceBeautySetParamInterface {
/**
* 设置属性值
*
* @param value
*/
void setValue(double value);
}
interface FaceBeautyGetParamInterface {
/**
* 获取属性值
*
* @return
*/
double getValue();
}
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
/*推荐风格标识*/
private static int currentStyleIndex = -1;
/*美颜缓存数据模型 用于普通美颜*/
public static final FaceBeauty defaultFaceBeauty = FaceBeautySource.getDefaultFaceBeauty();
/*当前生效美颜数据模型 普通 or 风格的*/
public static FaceBeauty faceBeauty = defaultFaceBeauty;
/*默认滤镜选中下标*/
private int currentFilterIndex = 0;
/*业务回调*/
private final FaceBeautyListener mFaceBeautyListener;
public FaceBeautyDataFactory(FaceBeautyListener listener) {
mFaceBeautyListener = listener;
}
public FaceBeautyDataFactory(){
mFaceBeautyListener=new FaceBeautyListener() {
@Override
public void onFilterSelected(int res) {
}
@Override
public void onFaceBeautyEnable(boolean enable) {
}
};
}
/**
* 获取美肤参数列表
*
* @return
*/
@NonNull
@Override
public ArrayList<FaceBeautyBean> getSkinBeauty() {
return FaceBeautySource.buildSkinParams();
}
/**
* 获取美型参数列表
*
* @return
*/
@NonNull
@Override
public ArrayList<FaceBeautyBean> getShapeBeauty() {
return FaceBeautySource.buildShapeParams();
}
/**
* 获取美型参数列表
*
* @return
*/
@NonNull
@Override
public ArrayList<FaceBeautyBean> getShapeBeautySubItem() {
return FaceBeautySource.buildFaceShapeSubItemParams();
}
/**
* 获取美肤、美型扩展参数
*
* @return
*/
@NonNull
@Override
public HashMap<String, ModelAttributeData> getModelAttributeRange() {
return FaceBeautySource.buildModelAttributeRange();
}
/**
* 获取滤镜参数列表
*
* @return
*/
@NonNull
@Override
public ArrayList<FaceBeautyFilterBean> getBeautyFilters() {
ArrayList<FaceBeautyFilterBean> filterBeans = FaceBeautySource.buildFilters();
for (int i = 0; i < filterBeans.size(); i++) {
if (filterBeans.get(i).getKey().equals(defaultFaceBeauty.getFilterName())) {
filterBeans.get(i).setIntensity(defaultFaceBeauty.getFilterIntensity());
currentFilterIndex = i;
}
}
return filterBeans;
}
/**
* 获取当前滤镜下标
*
* @return
*/
@Override
public int getCurrentFilterIndex() {
return currentFilterIndex;
}
/**
* 设置当前滤镜下标
*
* @param currentFilterIndex
*/
@Override
public void setCurrentFilterIndex(int currentFilterIndex) {
this.currentFilterIndex = currentFilterIndex;
}
/**
* 获取推荐风格列表
*
* @return
*/
@NonNull
@Override
public ArrayList<FaceBeautyStyleBean> getBeautyStyles() {
return FaceBeautySource.buildStylesParams();
}
/**
* 获取当前风格推荐标识
*
* @return
*/
@Override
public int getCurrentStyleIndex() {
return currentStyleIndex;
}
/**
* 设置风格推荐标识
*
* @param styleIndex
*/
@Override
public void setCurrentStyleIndex(int styleIndex) {
currentStyleIndex = styleIndex;
}
/**
* 设置风格推荐标识 来自于硬盘
*
* @param styleIndex
*/
public static void setDiskCurrentStyleIndex(int styleIndex) {
currentStyleIndex = styleIndex;
}
/**
* 美颜开关设置
*
* @param enable
*/
@Override
public void enableFaceBeauty(boolean enable) {
mFaceBeautyListener.onFaceBeautyEnable(enable);
}
/**
* 获取模型参数
*
* @param key 名称标识
* @return 属性值
*/
@Override
public double getParamIntensity(@NonNull String key) {
if (faceBeautyGetMapping.containsKey(key)) {
return faceBeautyGetMapping.get(key).getValue();
}
return 0.0;
}
/**
* 设置模型参数
*
* @param key 名称标识
* @param value 属性值
*/
@Override
public void updateParamIntensity(@NonNull String key, double value) {
if (faceBeautySetMapping.containsKey(key)) {
faceBeautySetMapping.get(key).setValue(value);
}
}
/**
* 将所有效果制空
*/
@Override
public void resetParamIntensity() {
if (faceBeauty != defaultFaceBeauty) {
faceBeauty = defaultFaceBeauty;
FURenderKit.getInstance().setFaceBeauty(faceBeauty);
}
ArrayList<FaceBeautyBean> skinBeauty = getSkinBeauty();
ArrayList<FaceBeautyBean> shapeBeauty = getShapeBeauty();
HashMap<String, ModelAttributeData> modelAttributeRange = getModelAttributeRange();
//还原美肤
for (FaceBeautyBean faceBeautyBean : skinBeauty) {
String key = faceBeautyBean.getKey();
ModelAttributeData modelAttributeData = modelAttributeRange.get(key);
updateParamIntensity(key, modelAttributeData.getStand());
}
//还原美型
for (FaceBeautyBean faceBeautyBean : shapeBeauty) {
String key = faceBeautyBean.getKey();
ModelAttributeData modelAttributeData = modelAttributeRange.get(key);
updateParamIntensity(key, modelAttributeData.getStand());
}
//还原滤镜
defaultFaceBeauty.setFilterName(FaceBeautyFilterEnum.ORIGIN);
defaultFaceBeauty.setFilterIntensity(0.0);
setCurrentFilterIndex(0);
//设置风格角标
setCurrentStyleIndex(-1);
}
@Override
public String getCurrentOneHotFaceShape() {
return CurrentFaceShapeUIValue.currentFaceShape == null ? FaceBeautyParam.CHEEK_V_INTENSITY : CurrentFaceShapeUIValue.currentFaceShape;
}
@Override
public void setCurrentOneHotFaceShape(String faceShape) {
CurrentFaceShapeUIValue.currentFaceShape = faceShape;
}
/**
* 设置当前脸型的UI值
*/
public void setCurrentFaceShapeUIValue(HashMap<String, Double> hashMap) {
CurrentFaceShapeUIValue.currentFaceShapeValue.clear();
CurrentFaceShapeUIValue.currentFaceShapeValue.putAll(hashMap);
}
/**
* 获取当前脸型的UI值
*/
public HashMap<String, Double> getCurrentFaceShapeUIValue() {
return CurrentFaceShapeUIValue.currentFaceShapeValue;
}
/**
* 切换滤镜
*
* @param name 滤镜名称标识
* @param intensity 滤镜强度
* @param resID 滤镜名称
*/
@Override
public void onFilterSelected(@NonNull String name, double intensity, int resID) {
defaultFaceBeauty.setFilterName(name);
defaultFaceBeauty.setFilterIntensity(intensity);
mFaceBeautyListener.onFilterSelected(resID);
}
/**
* 更换滤镜强度
*
* @param intensity 滤镜强度
*/
@Override
public void updateFilterIntensity(double intensity) {
defaultFaceBeauty.setFilterIntensity(intensity);
}
/**
* 设置推荐风格
*
* @param name 风格key
*/
@Override
public void onStyleSelected(String name) {
if (name == null) {
faceBeauty = defaultFaceBeauty;
FURenderKit.getInstance().setFaceBeauty(faceBeauty);
} else {
Runnable runnable = FaceBeautySource.styleParams.get(name);
if (runnable != null) {
runnable.run();
}
}
}
/*模型映射设置模型值*/
private final HashMap<String, FaceBeautySetParamInterface> faceBeautySetMapping = new HashMap<String, FaceBeautySetParamInterface>() {{
put(FaceBeautyParam.COLOR_INTENSITY, defaultFaceBeauty::setColorIntensity);
put(FaceBeautyParam.BLUR_INTENSITY, defaultFaceBeauty::setBlurIntensity);
put(FaceBeautyParam.RED_INTENSITY, defaultFaceBeauty::setRedIntensity);
put(FaceBeautyParam.SHARPEN_INTENSITY, defaultFaceBeauty::setSharpenIntensity);
put(FaceBeautyParam.EYE_BRIGHT_INTENSITY, defaultFaceBeauty::setEyeBrightIntensity);
put(FaceBeautyParam.TOOTH_WHITEN_INTENSITY, defaultFaceBeauty::setToothIntensity);
put(FaceBeautyParam.REMOVE_POUCH_INTENSITY, defaultFaceBeauty::setRemovePouchIntensity);
put(FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, defaultFaceBeauty::setRemoveLawPatternIntensity);
/*美型*/
put(FaceBeautyParam.FACE_SHAPE_INTENSITY, defaultFaceBeauty::setSharpenIntensity);
put(FaceBeautyParam.CHEEK_THINNING_INTENSITY, defaultFaceBeauty::setCheekThinningIntensity);
put(FaceBeautyParam.CHEEK_V_INTENSITY, defaultFaceBeauty::setCheekVIntensity);
put(FaceBeautyParam.CHEEK_LONG_INTENSITY, defaultFaceBeauty::setCheekLongIntensity);
put(FaceBeautyParam.CHEEK_CIRCLE_INTENSITY, defaultFaceBeauty::setCheekCircleIntensity);
put(FaceBeautyParam.CHEEK_NARROW_INTENSITY, defaultFaceBeauty::setCheekNarrowIntensity);
put(FaceBeautyParam.CHEEK_SHORT_INTENSITY, defaultFaceBeauty::setCheekShortIntensity);
put(FaceBeautyParam.CHEEK_SMALL_INTENSITY, defaultFaceBeauty::setCheekSmallIntensity);
put(FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, defaultFaceBeauty::setCheekBonesIntensity);
put(FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, defaultFaceBeauty::setLowerJawIntensity);
put(FaceBeautyParam.EYE_ENLARGING_INTENSITY, defaultFaceBeauty::setEyeEnlargingIntensity);
put(FaceBeautyParam.EYE_CIRCLE_INTENSITY, defaultFaceBeauty::setEyeCircleIntensity);
put(FaceBeautyParam.BROW_HEIGHT_INTENSITY, defaultFaceBeauty::setBrowHeightIntensity);
put(FaceBeautyParam.BROW_SPACE_INTENSITY, defaultFaceBeauty::setBrowSpaceIntensity);
put(FaceBeautyParam.CHIN_INTENSITY, defaultFaceBeauty::setChinIntensity);
put(FaceBeautyParam.FOREHEAD_INTENSITY, defaultFaceBeauty::setForHeadIntensity);
put(FaceBeautyParam.NOSE_INTENSITY, defaultFaceBeauty::setNoseIntensity);
put(FaceBeautyParam.MOUTH_INTENSITY, defaultFaceBeauty::setMouthIntensity);
put(FaceBeautyParam.CANTHUS_INTENSITY, defaultFaceBeauty::setCanthusIntensity);
put(FaceBeautyParam.EYE_SPACE_INTENSITY, defaultFaceBeauty::setEyeSpaceIntensity);
put(FaceBeautyParam.EYE_ROTATE_INTENSITY, defaultFaceBeauty::setEyeRotateIntensity);
put(FaceBeautyParam.LONG_NOSE_INTENSITY, defaultFaceBeauty::setLongNoseIntensity);
put(FaceBeautyParam.PHILTRUM_INTENSITY, defaultFaceBeauty::setPhiltrumIntensity);
put(FaceBeautyParam.SMILE_INTENSITY, defaultFaceBeauty::setSmileIntensity);
}};
/*模型映射获取模型值*/
HashMap<String, FaceBeautyGetParamInterface> faceBeautyGetMapping = new HashMap<String, FaceBeautyGetParamInterface>() {
{
put(FaceBeautyParam.COLOR_INTENSITY, defaultFaceBeauty::getColorIntensity);
put(FaceBeautyParam.BLUR_INTENSITY, defaultFaceBeauty::getBlurIntensity);
put(FaceBeautyParam.RED_INTENSITY, defaultFaceBeauty::getRedIntensity);
put(FaceBeautyParam.SHARPEN_INTENSITY, defaultFaceBeauty::getSharpenIntensity);
put(FaceBeautyParam.EYE_BRIGHT_INTENSITY, defaultFaceBeauty::getEyeBrightIntensity);
put(FaceBeautyParam.TOOTH_WHITEN_INTENSITY, defaultFaceBeauty::getToothIntensity);
put(FaceBeautyParam.REMOVE_POUCH_INTENSITY, defaultFaceBeauty::getRemovePouchIntensity);
put(FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, defaultFaceBeauty::getRemoveLawPatternIntensity);
/*美型*/
put(FaceBeautyParam.FACE_SHAPE_INTENSITY, defaultFaceBeauty::getSharpenIntensity);
put(FaceBeautyParam.CHEEK_THINNING_INTENSITY, defaultFaceBeauty::getCheekThinningIntensity);
put(FaceBeautyParam.CHEEK_V_INTENSITY, defaultFaceBeauty::getCheekVIntensity);
put(FaceBeautyParam.CHEEK_LONG_INTENSITY, defaultFaceBeauty::getCheekLongIntensity);
put(FaceBeautyParam.CHEEK_CIRCLE_INTENSITY, defaultFaceBeauty::getCheekCircleIntensity);
put(FaceBeautyParam.CHEEK_NARROW_INTENSITY, defaultFaceBeauty::getCheekNarrowIntensity);
put(FaceBeautyParam.CHEEK_SHORT_INTENSITY, defaultFaceBeauty::getCheekShortIntensity);
put(FaceBeautyParam.CHEEK_SMALL_INTENSITY, defaultFaceBeauty::getCheekSmallIntensity);
put(FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, defaultFaceBeauty::getCheekBonesIntensity);
put(FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, defaultFaceBeauty::getLowerJawIntensity);
put(FaceBeautyParam.EYE_ENLARGING_INTENSITY, defaultFaceBeauty::getEyeEnlargingIntensity);
put(FaceBeautyParam.EYE_CIRCLE_INTENSITY, defaultFaceBeauty::getEyeCircleIntensity);
put(FaceBeautyParam.BROW_HEIGHT_INTENSITY, defaultFaceBeauty::getBrowHeightIntensity);
put(FaceBeautyParam.BROW_SPACE_INTENSITY, defaultFaceBeauty::getBrowSpaceIntensity);
put(FaceBeautyParam.CHIN_INTENSITY, defaultFaceBeauty::getChinIntensity);
put(FaceBeautyParam.FOREHEAD_INTENSITY, defaultFaceBeauty::getForHeadIntensity);
put(FaceBeautyParam.NOSE_INTENSITY, defaultFaceBeauty::getNoseIntensity);
put(FaceBeautyParam.MOUTH_INTENSITY, defaultFaceBeauty::getMouthIntensity);
put(FaceBeautyParam.CANTHUS_INTENSITY, defaultFaceBeauty::getCanthusIntensity);
put(FaceBeautyParam.EYE_SPACE_INTENSITY, defaultFaceBeauty::getEyeSpaceIntensity);
put(FaceBeautyParam.EYE_ROTATE_INTENSITY, defaultFaceBeauty::getEyeRotateIntensity);
put(FaceBeautyParam.LONG_NOSE_INTENSITY, defaultFaceBeauty::getLongNoseIntensity);
put(FaceBeautyParam.PHILTRUM_INTENSITY, defaultFaceBeauty::getPhiltrumIntensity);
put(FaceBeautyParam.SMILE_INTENSITY, defaultFaceBeauty::getSmileIntensity);
}
};
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFURenderKit.setFaceBeauty(faceBeauty);
FUAIKit.getInstance().setMaxFaces(4);
if (FaceUnityConfig.IS_OPEN_LAND_MARK) {
ExpressionRecognition expressionRecognition = new ExpressionRecognition(new FUBundleData(FaceUnityConfig.BUNDLE_LANDMARKS));
expressionRecognition.setLandmarksType(FUAITypeEnum.FUAITYPE_FACELANDMARKS239);
mFURenderKit.getPropContainer().addProp(expressionRecognition);
}
}
/**
* 用于记录当前脸型的UI值 -> 用于用户下次点入的时候恢复
*/
static class CurrentFaceShapeUIValue {
/* 当前生效的脸型 */
public static String currentFaceShape = FaceBeautyParam.CHEEK_V_INTENSITY;
/* 当前脸型的UI值 */
public static HashMap<String, Double> currentFaceShapeValue = new HashMap<>();
}
}

View File

@@ -0,0 +1,34 @@
package com.yunbao.faceunity.data;
public class FaceParam {
public static final int FACE_BEAUTY=100;//美颜
public static final int FACE_BEAUTY_SKIN=101;//美肤
public static final int FACE_BEAUTY_SHAPE=102;//美型
public static final int FACE_BEAUTY_FILTER=103;//滤镜
public static final int FACE_BEAUTY_STYLE=104;//风格推荐
public static final int FACE_MAKEUP=200;//美妆
public static final int FACE_MAKEUP_TYPE_FOUNDATION=201;//粉底
public static final int FACE_MAKEUP_TYPE_LIP_STICK=202;//口红
public static final int FACE_MAKEUP_TYPE_BLUSHER=203;//腮红
public static final int FACE_MAKEUP_TYPE_EYE_BROW=204;//眉毛
public static final int FACE_MAKEUP_TYPE_EYE_SHADOW=205;//眼影
public static final int FACE_MAKEUP_TYPE_EYE_LINER=206;//眼线
public static final int FACE_MAKEUP_TYPE_EYE_LASH=207;//睫毛
public static final int FACE_MAKEUP_TYPE_HIGH_LIGHT=208;//高光
public static final int FACE_MAKEUP_TYPE_SHADOW=209;//阴影
public static final int FACE_MAKEUP_TYPE_EYE_PUPIL=210;//美瞳
public static final int FACE_BEAUTY_BODY=300;//美体
public static final int FACE_BIG_HEAD=400;//大头
public static final int FACE_ANIMOJI=500;//Animoji
public static final int FACE_STICKER=600;//贴纸
public static final int FACE_FINE_STICKER=700;//精品贴纸
public static final int FACE_FINE_STICKER_MIDDLE=701;//中级道具
public static final int FACE_FINE_STICKER_HIGH=702;//高级道具
public static final int FACE_FINE_STICKER_GAME=703;//游戏道具
public static final int FACE_ANIM=800;//动漫滤镜
// 占位符,以下均未使用
public static final int FACE_ANIM_AR_MASK=900;
public static final int FACE_EXPRESSION_RECOGNITION=1000;
public static final int FACE_FACE_WARP=1100;
public static final int FACE_GESTURE_RECOGNITION=1200;
}

View File

@@ -0,0 +1,159 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.enumeration.FUAIProcessorEnum;
import com.faceunity.core.faceunity.FURenderKit;
import com.yunbao.faceunity.entity.PropBean;
import com.yunbao.faceunity.utils.FURenderer;
/**
* DESC
* Created on 2021/4/25
*/
public class FaceUnityDataFactory {
/**
* 道具数据工厂
*/
public FaceBeautyDataFactory mFaceBeautyDataFactory;
public BodyBeautyDataFactory mBodyBeautyDataFactory;
public MakeupDataFactory mMakeupDataFactory;
public PropDataFactory mPropDataFactory;
private FURenderKit mFURenderKit = FURenderKit.getInstance();
private FURenderer mFURenderer = FURenderer.getInstance();
private static FaceUnityDataFactory sInstance;
public static FaceUnityDataFactory getInstance() {
if (sInstance == null) {
synchronized (FaceUnityDataFactory.class) {
if (sInstance == null) {
sInstance = new FaceUnityDataFactory(0);
}
}
}
return sInstance;
}
public static void release() {
sInstance = null;
}
/**
* 道具加载标识
*/
public int currentFunctionIndex;
private boolean hasFaceBeautyLoaded = false;
private boolean hasBodyBeautyLoaded = false;
private boolean hasMakeupLoaded = false;
private boolean hasPropLoaded = false;
public FaceUnityDataFactory(int index) {
currentFunctionIndex = index;
mFaceBeautyDataFactory = new FaceBeautyDataFactory(new FaceBeautyDataFactory.FaceBeautyListener() {
@Override
public void onFilterSelected(int res) {
}
@Override
public void onFaceBeautyEnable(boolean enable) {
}
});
mBodyBeautyDataFactory = new BodyBeautyDataFactory();
mMakeupDataFactory = new MakeupDataFactory(0);
mPropDataFactory = new PropDataFactory(new PropDataFactory.PropListener() {
@Override
public void onItemSelected(PropBean bean) {
}
},0,0);
}
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
switch (currentFunctionIndex) {
case 0:
mFaceBeautyDataFactory.bindCurrentRenderer();
hasFaceBeautyLoaded = true;
break;
case 1:
mPropDataFactory.bindCurrentRenderer();
hasPropLoaded = true;
break;
case 2:
mMakeupDataFactory.bindCurrentRenderer();
hasMakeupLoaded = true;
break;
case 3:
mBodyBeautyDataFactory.bindCurrentRenderer();
hasBodyBeautyLoaded = true;
break;
}
if (hasFaceBeautyLoaded && currentFunctionIndex != 0) {
mFaceBeautyDataFactory.bindCurrentRenderer();
}
if (hasPropLoaded && currentFunctionIndex != 1) {
mPropDataFactory.bindCurrentRenderer();
}
if (hasMakeupLoaded && currentFunctionIndex != 2) {
mMakeupDataFactory.bindCurrentRenderer();
}
if (hasBodyBeautyLoaded && currentFunctionIndex != 3) {
mBodyBeautyDataFactory.bindCurrentRenderer();
}
if (currentFunctionIndex == 3) {
mFURenderKit.getFUAIController().setMaxFaces(1);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.HUMAN_PROCESSOR);
} else {
mFURenderKit.getFUAIController().setMaxFaces(4);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.FACE_PROCESSOR);
}
}
/**
* 道具功能切换
*/
public void onFunctionSelected(int index) {
currentFunctionIndex = index;
switch (index) {
case 0:
if (!hasFaceBeautyLoaded) {
mFaceBeautyDataFactory.bindCurrentRenderer();
hasFaceBeautyLoaded = true;
}
mFURenderKit.getFUAIController().setMaxFaces(4);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.FACE_PROCESSOR);
break;
case 1:
if (!hasPropLoaded) {
mPropDataFactory.bindCurrentRenderer();
hasPropLoaded = true;
}
mFURenderKit.getFUAIController().setMaxFaces(4);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.FACE_PROCESSOR);
break;
case 2:
if (!hasMakeupLoaded) {
mMakeupDataFactory.bindCurrentRenderer();
hasMakeupLoaded = true;
}
mFURenderKit.getFUAIController().setMaxFaces(4);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.FACE_PROCESSOR);
break;
case 3:
if (!hasBodyBeautyLoaded) {
mBodyBeautyDataFactory.bindCurrentRenderer();
hasBodyBeautyLoaded = true;
}
mFURenderKit.getFUAIController().setMaxFaces(1);
mFURenderer.setAIProcessTrackType(FUAIProcessorEnum.HUMAN_PROCESSOR);
break;
}
}
}

View File

@@ -0,0 +1,405 @@
package com.yunbao.faceunity.data;
import android.util.Log;
import android.view.MotionEvent;
import com.faceunity.core.avatar.model.Avatar;
import com.faceunity.core.avatar.model.Scene;
import com.faceunity.core.avatar.scene.ProcessorConfig;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUTranslationScale;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.faceunity.FUSceneKit;
import com.faceunity.core.model.antialiasing.Antialiasing;
import com.faceunity.core.model.prop.sticker.FineSticker;
import com.faceunity.core.utils.FileUtils;
import com.yunbao.faceunity.entity.net.FineStickerEntity;
import com.yunbao.faceunity.entity.net.FineStickerTagEntity;
import com.yunbao.faceunity.infe.AbstractFineStickerDataFactory;
import com.yunbao.faceunity.repo.AvatarSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
* Created on 2021/3/31 0031 15:28.
* Author: xloger
* Email:phoenix@xloger.com
*/
public class FineStickerDataFactory extends AbstractFineStickerDataFactory {
private static final String TAG = "FineStickerDataFactory";
private static FineStickerDataFactory factory;
public static FineStickerDataFactory getInstance(){
if(factory==null){
factory=new FineStickerDataFactory();
}
return factory;
}
/*渲染控制器*/
private final FURenderKit mFURenderKit = FURenderKit.getInstance();
private FUAIKit mFUAIKit = FUAIKit.getInstance();
/*当前选中道具模型*/
private FineSticker currentProp;
/*菜单视图*/
/*当前选中道具*/
private FineStickerEntity.DocsBean currentSticker;
/*当前道具的类型 普通单bundleavatar 默认为普通单bundle*/
private BundleType mCurrentBundleType = BundleType.NORMAL_SINGLE_BUNDLE;
//avatar相关
/* 场景 */
private Scene mSceneModel;
/* 对象 */
private Avatar mCurrentAvatarModel;
/*3D抗锯齿*/
public Antialiasing antialiasing;
//回调
private List<StickerDownloadHelper.Callback> callbacks;
//avatar用于区分bundle类型的关键字
private final String COMPONENTS_STR = "components";
private final String ANIM_STR = "anim";
private final String INFO = "info.json";
private final String ZIP = ".zip";
private final String AVATAR = "avatar";
private FineStickerDataFactory() {
callbacks=new ArrayList<>();
StickerDownloadHelper.getInstance().setCallback(downloadHelper);
}
/**
* 绑定菜单视图
*
*/
public void bindView() {
}
public void addCallback(StickerDownloadHelper.Callback downloadHelper) {
callbacks.add(downloadHelper);
}
public void removeCallback(StickerDownloadHelper.Callback downloadHelper){
callbacks.remove(downloadHelper);
}
private void removeAllCallback(){
callbacks.clear();
}
public void refuseEvent() {
StickerDownloadHelper.getInstance().setCallback(null);
}
/**
* 切换道具
*
* @param bean
*/
@Override
public void onItemSelected(FineStickerEntity.DocsBean bean) {
currentSticker = bean;
if (bean != null && bean.getTool().getBundle().getUid().endsWith(ZIP)) {
//复合道具
if (AVATAR.equals(bean.getTool().getCategory())) {
//avatar道具
if (mCurrentBundleType == BundleType.NORMAL_SINGLE_BUNDLE) {
//移除旧的道具
mFURenderKit.getPropContainer().removeAllProp();
currentProp = null;
adapterMaxFace();
}
if (bean.getUnZipFilePaths() != null) {
buildAvatarModel(bean);
//当前为 avatar bundle
mCurrentBundleType = BundleType.AVATAR_BUNDLE;
}
}
} else {
//普通道具
if (mCurrentBundleType == BundleType.NORMAL_SINGLE_BUNDLE) {
mFURenderKit.getPropContainer().removeAllProp();
currentProp = null;
if (bean != null && bean.getFilePath() != null && bean.getFilePath().trim().length() > 0) {
adapterMaxFace();
FineSticker prop = adapterBean(bean.getFilePath());
mFURenderKit.getPropContainer().addProp(prop);
currentProp = prop;
}
} else if (mCurrentBundleType == BundleType.AVATAR_BUNDLE) {
//关闭avatar 相关的东西
if (mSceneModel != null && mCurrentAvatarModel != null) {
mSceneModel.removeAvatar(mCurrentAvatarModel);
FUSceneKit.getInstance().removeScene(mSceneModel);
mSceneModel = null;
mCurrentAvatarModel = null;
}
//设置道具
if (bean != null && bean.getFilePath() != null && bean.getFilePath().trim().length() > 0) {
adapterMaxFace();
FineSticker prop = adapterBean(bean.getFilePath());
mFURenderKit.getPropContainer().addProp(prop);
currentProp = prop;
}
}
//当前为普通bundle
mCurrentBundleType = BundleType.NORMAL_SINGLE_BUNDLE;
}
if (mBundleTypeListener != null) {
mBundleTypeListener.bundleType(mCurrentBundleType);
}
}
/**
* 构建avatar -> scene
* @param bean
*/
private void buildAvatarModel(FineStickerEntity.DocsBean bean) {
//启动avatar基本逻辑
if (antialiasing == null)
antialiasing = new Antialiasing(new FUBundleData(FaceUnityConfig.BUNDLE_ANTI_ALIASING));
//3d抗锯齿
mFURenderKit.setAntialiasing(antialiasing);
//判断是avatar 控件 -> 查看是否有json文件
ArrayList<String> unZipFilePaths = bean.getUnZipFilePaths();
int hasJson = unZipFilePaths.indexOf(INFO);
ArrayList<String> strComponents = new ArrayList<>();//组件Bundle
ArrayList<String> strAnimations = new ArrayList<>();//动画Bundle
if (hasJson >= 0) {
//用json的描述赋予每一个bundle自己的职责还可以赋予其他参数
String jsonPath = bean.getFilePath().substring(0,bean.getFilePath().lastIndexOf(".")) + "/" + unZipFilePaths.get(hasJson);
//解析json文件 ->
String json = FileUtils.loadStringFromExternal(jsonPath);
//解析avatar的json文件
try {
JSONObject jsonObject = new JSONObject(json);
JSONArray components = jsonObject.getJSONArray("components");
for(int i =0 ;i < components.length();i++) {
String path = bean.getFilePath().substring(0,bean.getFilePath().lastIndexOf(".")) + "/" + components.get(i);
strComponents.add(path);
}
JSONArray anims = jsonObject.getJSONArray("anims");
for(int i =0 ;i < anims.length();i++) {
String path = bean.getFilePath().substring(0,bean.getFilePath().lastIndexOf(".")) + "/" + anims.get(i);
strAnimations.add(path);
}
} catch (JSONException e) {
e.printStackTrace();
}
} else {
//根据bundle的命名赋予每一个bundle自己的职责
for (String str:unZipFilePaths) {
if (str.startsWith(COMPONENTS_STR)) {
String path = bean.getFilePath().substring(0,bean.getFilePath().lastIndexOf(".")) + "/" + str;
strComponents.add(path);
} else if (str.startsWith(ANIM_STR)){
String path = bean.getFilePath().substring(0,bean.getFilePath().lastIndexOf(".")) + "/" + str;
strAnimations.add(path);
}
}
}
if (mSceneModel == null) {
mCurrentAvatarModel = AvatarSource.buildAvatarData(strComponents,strAnimations);
mSceneModel = AvatarSource.buildSceneModel(mCurrentAvatarModel);
mSceneModel.processorConfig.setTrackScene(ProcessorConfig.TrackScene.SceneFull);
mCurrentAvatarModel.transForm.setTranslationScale(new FUTranslationScale(0.5f, 0f, 0.1f));
} else {
if (mCurrentAvatarModel != null)
mSceneModel.removeAvatar(mCurrentAvatarModel);
mCurrentAvatarModel = AvatarSource.buildAvatarData(strComponents,strAnimations);
mSceneModel.addAvatar(mCurrentAvatarModel);
}
FUSceneKit.getInstance().addScene(mSceneModel);
FUSceneKit.getInstance().setCurrentScene(mSceneModel);
}
/**
* 根据adpater 调整业务模型
* 0维持竖屏
* 1仅限一人
* 2美妆道具
* 3点击事件
* 4翻转
*
* @param path
* @return
*/
private FineSticker adapterBean(String path) {
String adapter = currentSticker.getTool().getAdapter();
if (adapter == null || !adapter.contains("1")) {
mFUAIKit.setMaxFaces(4);
} else {
mFUAIKit.setMaxFaces(1);
}
if (adapter != null && adapter.trim().length() > 0) {
boolean isFlipPoints = adapter.contains("2");
boolean is3DFlipH = adapter.contains("4");
boolean isClick = adapter.contains("3");
return new FineSticker(new FUBundleData(path), isFlipPoints, is3DFlipH, isClick);
} else {
return new FineSticker(new FUBundleData(path));
}
}
/**
* 网络回调
*/
private StickerDownloadHelper.Callback downloadHelper = new StickerDownloadHelper.Callback() {
@Override
public void onGetTags(String[] tags) {
for (StickerDownloadHelper.Callback callback : callbacks) {
callback.onGetTags(tags);
}
}
@Override
public void onGetList(String tag, FineStickerEntity fineSticker) {
for (StickerDownloadHelper.Callback callback : callbacks) {
callback.onGetList(tag, fineSticker);
}
}
@Override
public void onDownload(FineStickerEntity.DocsBean entity) {
for (StickerDownloadHelper.Callback callback : callbacks) {
callback.onDownload(entity);
}
}
@Override
public void onDownloadError(FineStickerEntity.DocsBean entity, String msg) {
for (StickerDownloadHelper.Callback callback : callbacks) {
callback.onDownloadError(entity, msg);
}
}
};
/**
* 获取标签列表
*
* @return
*/
@NotNull
@Override
public List<FineStickerTagEntity> loadTagList() {
String[] tags = StickerDownloadHelper.getInstance().tags();
return formatTag(tags);
}
/**
* 获取标签对应道具列表
*
* @param tag
* @return
*/
@NotNull
@Override
public FineStickerEntity loadStickerList(@NotNull FineStickerTagEntity tag) {
return StickerDownloadHelper.getInstance().tools(tag.getTag());
}
/**
* 下载道具
*
* @param docsBean
*/
@Override
public void downloadSticker(@NotNull FineStickerEntity.DocsBean docsBean) {
try{
StickerDownloadHelper.getInstance().download(docsBean);
} catch (Exception e) {
Log.e(TAG,"downloadSticker",e);
e.printStackTrace();
}
}
/**
* 数据转换
*
* @param tags
* @return
*/
public static List<FineStickerTagEntity> formatTag(String[] tags) {
List<FineStickerTagEntity> tagEntityList = new ArrayList<>(tags.length);
for (int i = 0; i < tags.length; i++) {
tagEntityList.add(new FineStickerTagEntity(tags[i]));
}
return tagEntityList;
}
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFUAIKit.loadAIProcessor(FaceUnityConfig.getAIHumanBundle(), FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
mFUAIKit.loadAIProcessor(FaceUnityConfig.BUNDLE_AI_HAND, FUAITypeEnum.FUAITYPE_HANDGESTURE);
mFURenderKit.setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
mFUAIKit.setMaxFaces(1);
onItemSelected(currentSticker);
}
/**
* 结束需要释放AI驱动
*/
public void releaseAIProcessor() {
mFUAIKit.releaseAIProcessor(FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
mFUAIKit.releaseAIProcessor(FUAITypeEnum.FUAITYPE_HANDGESTURE);
}
private void adapterMaxFace() {
if (currentSticker == null) return;
String adapter = currentSticker.getTool().getAdapter();
if (adapter == null || !adapter.contains("1")) {
mFUAIKit.setMaxFaces(4);
} else {
mFUAIKit.setMaxFaces(1);
}
}
public void onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP && currentProp != null && currentProp.isClick()) {
currentProp.onClick();
}
}
//通过枚举记录每一个bundle的类型
public enum BundleType {
NORMAL_SINGLE_BUNDLE,//普通的单bundle道具
AVATAR_BUNDLE//avatar bundle 一般为多bundle
}
private BundleTypeListener mBundleTypeListener;
public interface BundleTypeListener {
void bundleType(BundleType bundleType);
}
public void setBundleTypeListener (BundleTypeListener bundleTypeListener){
mBundleTypeListener = bundleTypeListener;
}
}

View File

@@ -0,0 +1,127 @@
package com.yunbao.faceunity.data;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.prop.expression.ExpressionRecognition;
import com.yunbao.faceunity.entity.LightMakeupBean;
import com.yunbao.faceunity.infe.AbstractLightMakeupDataFactory;
import com.yunbao.faceunity.repo.FaceBeautySource;
import com.yunbao.faceunity.repo.LightMakeupSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
/**
* DESC轻美妆业务工厂
* Created on 2021/3/3
*/
public class LightMakeupDataFactory extends AbstractLightMakeupDataFactory {
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
/* 轻美妆队列 */
private ArrayList<LightMakeupBean> lightMakeupBeans;
/* 当前轻美妆选中下标 */
private int currentLightMakeupIndex;
public LightMakeupDataFactory(int index) {
currentLightMakeupIndex = index;
lightMakeupBeans = LightMakeupSource.buildLightMakeup();
}
/**
* 获取轻美妆队列
*
* @return
*/
@Override
public ArrayList<LightMakeupBean> getLightMakeUpBeans() {
return lightMakeupBeans;
}
/**
* 获取轻美妆下标
*
* @return
*/
@Override
public int getCurrentLightMakeupIndex() {
return currentLightMakeupIndex;
}
/**
* 设置轻美妆下标
*
* @param currentLightMakeupIndex
*/
@Override
public void setCurrentLightMakeupIndex(int currentLightMakeupIndex) {
this.currentLightMakeupIndex = currentLightMakeupIndex;
}
/**
* 切换轻美妆
*
* @param data
*/
@Override
public void onLightMakeupSelected(LightMakeupBean data) {
if (data.getKey() == null) {
mFURenderKit.setLightMakeup(null);
} else {
Runnable runnable = LightMakeupSource.LightMakeupParams.get(data.getKey());
if (runnable != null) {
runnable.run();
}
onLightMakeupIntensityChanged(data.getIntensity());
}
if (mFURenderKit.getFaceBeauty() != null) {
mFURenderKit.getFaceBeauty().setFilterName(data.getFilterName());
mFURenderKit.getFaceBeauty().setFilterIntensity(data.getFilterIntensity());
}
}
/**
* 修改强度
*
* @param intensity
*/
@Override
public void onLightMakeupIntensityChanged(double intensity) {
if (mFURenderKit.getLightMakeup() != null) {
mFURenderKit.getLightMakeup().setMakeupIntensity(intensity);
}
if (mFURenderKit.getFaceBeauty() != null) {
mFURenderKit.getFaceBeauty().setFilterIntensity(intensity);
}
}
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFURenderKit.setFaceBeauty(FaceBeautySource.clone(FaceBeautyDataFactory.faceBeauty));
FUAIKit.getInstance().setMaxFaces(4);
LightMakeupBean lightMakeupBean = lightMakeupBeans.get(currentLightMakeupIndex);
onLightMakeupSelected(lightMakeupBean);
if (FaceUnityConfig.IS_OPEN_LAND_MARK) {
ExpressionRecognition expressionRecognition = new ExpressionRecognition(new FUBundleData(FaceUnityConfig.BUNDLE_LANDMARKS));
expressionRecognition.setLandmarksType(FUAITypeEnum.FUAITYPE_FACELANDMARKS239);
mFURenderKit.getPropContainer().addProp(expressionRecognition);
}
}
}

View File

@@ -0,0 +1,853 @@
package com.yunbao.faceunity.data;
import static com.yunbao.faceunity.repo.MakeupSource.*;
import androidx.annotation.NonNull;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.makeup.Makeup;
import com.faceunity.core.model.makeup.MakeupLipEnum;
import com.faceunity.core.model.prop.expression.ExpressionRecognition;
import com.faceunity.core.utils.DecimalUtils;
import com.yunbao.faceunity.entity.MakeupCombinationBean;
import com.yunbao.faceunity.entity.MakeupCustomBean;
import com.yunbao.faceunity.entity.MakeupCustomClassBean;
import com.yunbao.faceunity.infe.AbstractMakeupDataFactory;
import com.yunbao.faceunity.repo.FaceBeautySource;
import com.yunbao.faceunity.repo.MakeupSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
/**
* DESC美妆业务工厂
* Created on 2021/3/1
*/
public class MakeupDataFactory extends AbstractMakeupDataFactory {
/*渲染控制器*/
private FURenderKit mFURenderKit = FURenderKit.getInstance();
/*组合妆容列表*/
private ArrayList<MakeupCombinationBean> makeupCombinations;
/*组合妆容当前下标*/
private int currentCombinationIndex;//-1自定义
/*美妆数据模型*/
private Makeup currentMakeup;
/*当前滤镜*/
private String currentFilterName;
/*当前滤镜*/
private Double currentFilterIntensity;
private LinkedHashMap<String, ArrayList<double[]>> mMakeUpColorMap;//美妆颜色表
private HashMap<String, Integer> mCustomIndexMap = new HashMap<>();//key:美妆类别 value:当前美妆子项选中下标 默认0
private HashMap<String, Double> mCustomIntensityMap = new HashMap<>();//key:美妆类别_子项下标 value:当前美妆选中子项的妆容强度 默认1.0
private HashMap<String, Integer> mCustomColorIndexMap = new HashMap<>();//key:美妆类别_子项下标 value:当前美妆选中子项的颜色下标 默认3
public MakeupDataFactory(int index) {
makeupCombinations = MakeupSource.buildCombinations();
mMakeUpColorMap = MakeupSource.buildMakeUpColorMap();
currentCombinationIndex = index;
currentFilterName = makeupCombinations.get(index).getFilterName();
currentFilterIntensity = makeupCombinations.get(index).getFilterIntensity();
currentMakeup = MakeupSource.getMakeupModel(makeupCombinations.get(currentCombinationIndex)); // 当前生效模型
}
//region 组合妆
/**
* 获取当前组合妆容列表
*
* @return
*/
@Override
@NonNull
public ArrayList<MakeupCombinationBean> getMakeupCombinations() {
return makeupCombinations;
}
/**
* 获取当前组合妆容下标
*
* @return
*/
@Override
public int getCurrentCombinationIndex() {
return currentCombinationIndex;
}
/**
* 设置组合妆容下标
*
* @param currentCombinationIndex
*/
@Override
public void setCurrentCombinationIndex(int currentCombinationIndex) {
this.currentCombinationIndex = currentCombinationIndex;
}
/**
* 切换组合妆容
*
* @param bean
*/
@Override
public void onMakeupCombinationSelected(MakeupCombinationBean bean) {
currentFilterName = bean.getFilterName();
currentFilterIntensity = bean.getFilterIntensity();
if (mFURenderKit.getFaceBeauty() != null) {
mFURenderKit.getFaceBeauty().setFilterName(currentFilterName);
mFURenderKit.getFaceBeauty().setFilterIntensity(currentFilterIntensity);
}
currentMakeup = MakeupSource.getMakeupModel(bean);
mFURenderKit.setMakeup(currentMakeup);
if (!currentMakeup.getControlBundle().getPath().equals(FaceUnityConfig.BUNDLE_FACE_MAKEUP))
currentMakeup.setFilterIntensity(currentFilterIntensity);
}
/**
* 切换美妆模型整体强度
*
* @param intensity
*/
@Override
public void updateCombinationIntensity(double intensity) {
currentMakeup.setMakeupIntensity(intensity);
currentFilterIntensity = intensity;
if (mFURenderKit.getFaceBeauty() != null) {
mFURenderKit.getFaceBeauty().setFilterIntensity(currentFilterIntensity);
}
if (!currentMakeup.getControlBundle().getPath().equals(FaceUnityConfig.BUNDLE_FACE_MAKEUP))
currentMakeup.setFilterIntensity(currentFilterIntensity);
}
//endregion 组合妆
//region 子美妆
/**
* 获取子妆类别列表
*
* @return
*/
@Override
public ArrayList<MakeupCustomClassBean> getMakeupCustomClass() {
return MakeupSource.buildCustomClasses();
}
/**
* 获取子妆列表参数
*
* @return
*/
@Override
public LinkedHashMap<String, ArrayList<MakeupCustomBean>> getMakeupCustomItemParams() {
return MakeupSource.buildCustomItemParams(mMakeUpColorMap);
}
/**
* 设置子妆强度
*
* @param key
* @param current
* @param intensity
*/
@Override
public void updateCustomItemIntensity(String key, int current, double intensity) {
if (key.equals(FACE_MAKEUP_TYPE_FOUNDATION)) {
currentMakeup.setFoundationIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_LIP_STICK)) {
currentMakeup.setLipIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_BLUSHER)) {
currentMakeup.setBlusherIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_BROW)) {
currentMakeup.setEyeBrowIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_SHADOW)) {
currentMakeup.setEyeShadowIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LINER)) {
currentMakeup.setEyeLineIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LASH)) {
currentMakeup.setEyeLashIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_HIGH_LIGHT)) {
currentMakeup.setHeightLightIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_SHADOW)) {
currentMakeup.setShadowIntensity(intensity);
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_PUPIL)) {
currentMakeup.setPupilIntensity(intensity);
}
mCustomIntensityMap.put(key + "_" + current, intensity);
}
/**
* 切换子妆单项
*
* @param key 子妆类别
* @param index 选中下标
*/
@Override
public void onCustomBeanSelected(String key, int index) {
String itemDir = FaceUnityConfig.MAKEUP_RESOURCE_ITEM_BUNDLE_DIR;
mCustomIndexMap.put(key, index);
if (key.equals(FACE_MAKEUP_TYPE_FOUNDATION)) {
if (index == 0) {
currentMakeup.setFoundationIntensity(0.0);
} else {
currentMakeup.setFoundationBundle(new FUBundleData(itemDir + "mu_style_foundation_01.bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_FOUNDATION + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_FOUNDATION + "_" + index);
}
currentMakeup.setFoundationIntensity((intensity));
updateCustomColor(key, index + 2);
double[] color = mMakeUpColorMap.get("color_mu_style_foundation_01").get(index + 2);
currentMakeup.setFoundationColor(buildFUColorRGBData(color));
}
} else if (key.equals(FACE_MAKEUP_TYPE_LIP_STICK)) {
if (index == 0) {
currentMakeup.setLipIntensity(0.0);
} else {
currentMakeup.setLipBundle(new FUBundleData(itemDir + "mu_style_lip_0" + index + ".bundle"));
switch (index) {
case 1:
currentMakeup.setLipType(MakeupLipEnum.FOG);
currentMakeup.setEnableTwoLipColor(false);
currentMakeup.setLipHighLightEnable(false);
currentMakeup.setLipHighLightStrength(0.0);
break;
case 2:
currentMakeup.setLipType(MakeupLipEnum.MOIST);
currentMakeup.setEnableTwoLipColor(false);
currentMakeup.setLipHighLightEnable(false);
currentMakeup.setLipHighLightStrength(0.0);
break;
case 3:
currentMakeup.setLipType(MakeupLipEnum.WATER);
currentMakeup.setEnableTwoLipColor(false);
currentMakeup.setLipHighLightEnable(true);
currentMakeup.setLipHighLightStrength(0.8);
break;
case 4:
currentMakeup.setLipType(MakeupLipEnum.PEARL);
currentMakeup.setEnableTwoLipColor(false);
currentMakeup.setLipHighLightEnable(false);
currentMakeup.setLipHighLightStrength(0.0);
break;
case 5:
currentMakeup.setLipType(MakeupLipEnum.FOG);
currentMakeup.setEnableTwoLipColor(true);
currentMakeup.setLipHighLightEnable(false);
currentMakeup.setLipHighLightStrength(0.0);
currentMakeup.setLipColor2(new FUColorRGBData(0.0, 0.0, 0.0, 0.0));
break;
}
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_LIP_STICK + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_LIP_STICK + "_" + index);
}
currentMakeup.setLipIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_LIP_STICK + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_LIP_STICK + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_BLUSHER)) {
if (index == 0) {
currentMakeup.setBlusherIntensity(0.0);
} else {
currentMakeup.setBlusherBundle(new FUBundleData(itemDir + "mu_style_blush_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_BLUSHER + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_BLUSHER + "_" + index);
}
currentMakeup.setBlusherIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_BLUSHER + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_BLUSHER + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_BROW)) {
if (index == 0) {
currentMakeup.setEyeBrowIntensity(0.0);
currentMakeup.setEnableBrowWarp(false);
} else {
currentMakeup.setEnableBrowWarp(false);
currentMakeup.setEyeBrowBundle(new FUBundleData(itemDir + "mu_style_eyebrow_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_BROW + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_BROW + "_" + index);
}
currentMakeup.setEyeBrowIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_EYE_BROW + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_EYE_BROW + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_SHADOW)) {
if (index == 0) {
currentMakeup.setEyeShadowIntensity(0.0);
} else {
currentMakeup.setEyeShadowBundle(new FUBundleData(itemDir + "mu_style_eyeshadow_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + index);
}
currentMakeup.setEyeShadowIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LINER)) {
if (index == 0) {
currentMakeup.setEyeLineIntensity(0.0);
} else {
currentMakeup.setEyeLinerBundle(new FUBundleData(itemDir + "mu_style_eyeliner_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_LINER + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_LINER + "_" + index);
}
currentMakeup.setEyeLineIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_EYE_LINER + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_EYE_LINER + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LASH)) {
if (index == 0) {
currentMakeup.setEyeLashIntensity(0.0);
} else {
currentMakeup.setEyeLashBundle(new FUBundleData(itemDir + "mu_style_eyelash_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_LASH + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_LASH + "_" + index);
}
currentMakeup.setEyeLashIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_EYE_LASH + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_EYE_LASH + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_HIGH_LIGHT)) {
if (index == 0) {
currentMakeup.setHeightLightIntensity(0.0);
} else {
currentMakeup.setHighLightBundle(new FUBundleData(itemDir + "mu_style_highlight_0" + index + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + index);
}
currentMakeup.setHeightLightIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_SHADOW)) {
if (index == 0) {
currentMakeup.setShadowIntensity(0.0);
} else {
currentMakeup.setShadowBundle(new FUBundleData(itemDir + "mu_style_contour_01.bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_SHADOW + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_SHADOW + "_" + index);
}
currentMakeup.setShadowIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_SHADOW + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_SHADOW + "_" + index);
}
updateCustomColor(key, colorIndex);
}
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_PUPIL)) {
if (index == 0) {
currentMakeup.setPupilIntensity(0.0);
} else {
if (index == 1) {
currentMakeup.setPupilBundle(new FUBundleData(itemDir + "mu_style_eyepupil_01.bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index);
}
currentMakeup.setPupilIntensity((intensity));
int colorIndex = 3;
if (mCustomColorIndexMap.containsKey(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index)) {
colorIndex = mCustomColorIndexMap.get(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index);
}
updateCustomColor(key, colorIndex);
} else {
currentMakeup.setPupilBundle(new FUBundleData(itemDir + "mu_style_eyepupil_0" + (index + 1) + ".bundle"));
double intensity = 1.0;
if (mCustomIntensityMap.containsKey(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index)) {
intensity = mCustomIntensityMap.get(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + index);
}
currentMakeup.setPupilIntensity((intensity));
currentMakeup.setPupilColor(buildFUColorRGBData(new double[]{0.0, 0.0, 0.0, 0.0}));
}
}
}
}
/**
* 设置子妆颜色值
*
* @param key 类别关键字
* @param index 颜色下标
*/
@Override
public void updateCustomColor(String key, int index) {
int current = mCustomIndexMap.containsKey(key) ? mCustomIndexMap.get(key) : 0;
if (key.equals(FACE_MAKEUP_TYPE_LIP_STICK)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_LIP_STICK + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_lip_01").get(index);
if (current == 3)
currentMakeup.setLipColorV2(buildFUColorRGBData(color));
else
currentMakeup.setLipColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_BLUSHER)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_BLUSHER + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_blush_0" + current).get(index);
currentMakeup.setBlusherColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_BROW)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_BROW + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_eyebrow_01").get(index);
currentMakeup.setEyeBrowColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_SHADOW)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_eyeshadow_0" + current).get(index);
currentMakeup.setEyeShadowColor(new FUColorRGBData(color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255));
currentMakeup.setEyeShadowColor2(new FUColorRGBData(color[4] * 255, color[5] * 255, color[6] * 255, color[7] * 255));
currentMakeup.setEyeShadowColor3(new FUColorRGBData(color[8] * 255, color[9] * 255, color[10] * 255, color[11] * 255));
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LINER)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_LINER + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_eyeliner_0" + current).get(index);
currentMakeup.setEyeLinerColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_LASH)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_LASH + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_eyelash_0" + current).get(index);
currentMakeup.setEyeLashColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_HIGH_LIGHT)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_highlight_0" + current).get(index);
currentMakeup.setHighLightColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_SHADOW)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_SHADOW + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_contour_01").get(index);
currentMakeup.setShadowColor(buildFUColorRGBData(color));
} else if (key.equals(FACE_MAKEUP_TYPE_EYE_PUPIL)) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + current, index);
double[] color = mMakeUpColorMap.get("color_mu_style_eyepupil_01").get(index);
currentMakeup.setPupilColor(buildFUColorRGBData(color));
}
}
//endregion 子美妆
//region 其他
/**
* 进入自定义美妆,模型分析
*/
@Override
public void enterCustomMakeup() {
mCustomIndexMap.clear();
mCustomColorIndexMap.clear();
mCustomIntensityMap.clear();
double makeupIntensity = currentMakeup.getMakeupIntensity();
/*粉底*/
if (currentMakeup.getFoundationIntensity() != 0.0) {
double intensity = currentMakeup.getFoundationIntensity() * makeupIntensity;
currentMakeup.setFoundationIntensity(intensity);
double[] array = currentMakeup.getFoundationColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_foundation_01");
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(array, list.get(i))) {
mCustomIndexMap.put(FACE_MAKEUP_TYPE_FOUNDATION, i - 2);
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_FOUNDATION + "_" + (i - 2), intensity);
break;
}
}
}
/*口红*/
if (currentMakeup.getLipIntensity() != 0.0) {
double intensity = currentMakeup.getLipIntensity() * makeupIntensity;
currentMakeup.setLipIntensity(intensity);
int current = 0;
switch (currentMakeup.getLipType()) {
case MakeupLipEnum.FOG:
if (currentMakeup.getEnableTwoLipColor()) {
current = 5;
} else {
current = 1;
}
break;
case MakeupLipEnum.MOIST:
current = 3;
break;
case MakeupLipEnum.PEARL:
current = 4;
break;
case MakeupLipEnum.WATER:
current = 2;
break;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_LIP_STICK, current);
if (current != 0) {
double[] colorArray;
if (currentMakeup.getLipType() == MakeupLipEnum.WATER) {
colorArray = currentMakeup.getLipColorV2().toScaleColorArray();
} else {
colorArray = currentMakeup.getLipColor().toScaleColorArray();
}
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_lip_01");
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_LIP_STICK + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_LIP_STICK + "_" + current, intensity);
}
}
/*腮红*/
if (currentMakeup.getBlusherIntensity() != 0.0 && currentMakeup.getBlusherBundle() != null) {
double intensity = currentMakeup.getBlusherIntensity() * makeupIntensity;
currentMakeup.setBlusherIntensity(intensity);
String path = currentMakeup.getBlusherBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_blush_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_blush_02.bundle")) {
current = 2;
} else if (path.endsWith("mu_style_blush_03.bundle")) {
current = 3;
} else if (path.endsWith("mu_style_blush_04.bundle")) {
current = 4;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_BLUSHER, current);
if (current != 0) {
double[] colorArray = currentMakeup.getBlusherColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_blush_0" + current);
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_BLUSHER + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_BLUSHER + "_" + current, intensity);
}
}
/*眉毛*/
if (currentMakeup.getEyeBrowIntensity() != 0.0) {
double intensity = currentMakeup.getEyeBrowIntensity() * makeupIntensity;
currentMakeup.setEyeBrowIntensity(intensity);
int current = 0;
if (currentMakeup.getEyeBrowBundle() != null && currentMakeup.getEyeBrowBundle().getPath() != null) {
String bundlePath = currentMakeup.getEyeBrowBundle().getPath();
int spotIndex = bundlePath.lastIndexOf(".");
String index = bundlePath.substring(spotIndex - 1, spotIndex);
current = Integer.valueOf(index);
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_EYE_BROW, current);
if (current != 0) {
double[] colorArray = currentMakeup.getEyeBrowColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_eyebrow_01");
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_BROW + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_EYE_BROW + "_" + current, intensity);
}
}
/*眼影*/
if (currentMakeup.getEyeShadowIntensity() != 0.0 && currentMakeup.getEyeShadowBundle() != null) {
double intensity = currentMakeup.getEyeShadowIntensity() * makeupIntensity;
currentMakeup.setEyeShadowIntensity(intensity);
String path = currentMakeup.getEyeShadowBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_eyeshadow_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_eyeshadow_02.bundle")) {
current = 2;
} else if (path.endsWith("mu_style_eyeshadow_03.bundle")) {
current = 3;
} else if (path.endsWith("mu_style_eyeshadow_04.bundle")) {
current = 4;
} else if (path.endsWith("mu_style_eyeshadow_05.bundle")) {
current = 5;
} else if (path.endsWith("mu_style_eyeshadow_06.bundle")) {
current = 6;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_EYE_SHADOW, current);
if (current != 0) {
double[] array = new double[12];
double[] color1 = currentMakeup.getEyeShadowColor().toScaleColorArray();
double[] color2 = currentMakeup.getEyeShadowColor2().toScaleColorArray();
double[] color3 = currentMakeup.getEyeShadowColor3().toScaleColorArray();
System.arraycopy(color1, 0, array, 0, color1.length);
System.arraycopy(color2, 0, array, 4, color2.length);
System.arraycopy(color3, 0, array, 8, color3.length);
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_eyeshadow_0" + current);
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(array, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_EYE_SHADOW + "_" + current, intensity);
}
}
/*眼线*/
if (currentMakeup.getEyeLineIntensity() != 0.0 && currentMakeup.getEyeLinerBundle() != null) {
double intensity = currentMakeup.getEyeLineIntensity() * makeupIntensity;
currentMakeup.setEyeLineIntensity(intensity);
String path = currentMakeup.getEyeLinerBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_eyeliner_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_eyeliner_02.bundle")) {
current = 2;
} else if (path.endsWith("mu_style_eyeliner_03.bundle")) {
current = 3;
} else if (path.endsWith("mu_style_eyeliner_04.bundle")) {
current = 4;
} else if (path.endsWith("mu_style_eyeliner_05.bundle")) {
current = 5;
} else if (path.endsWith("mu_style_eyeliner_06.bundle")) {
current = 6;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_EYE_LINER, current);
if (current != 0) {
double[] colorArray = currentMakeup.getEyeLinerColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_eyeliner_0" + current);
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_LINER + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_EYE_LINER + "_" + current, intensity);
}
}
/* 睫毛*/
if (currentMakeup.getEyeLashIntensity() != 0.0 && currentMakeup.getEyeLashBundle() != null) {
double intensity = currentMakeup.getEyeLashIntensity() * makeupIntensity;
currentMakeup.setEyeLashIntensity(intensity);
String path = currentMakeup.getEyeLashBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_eyelash_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_eyelash_02.bundle")) {
current = 2;
} else if (path.endsWith("mu_style_eyelash_03.bundle")) {
current = 3;
} else if (path.endsWith("mu_style_eyelash_04.bundle")) {
current = 4;
} else if (path.endsWith("mu_style_eyelash_05.bundle")) {
current = 5;
} else if (path.endsWith("mu_style_eyelash_06.bundle")) {
current = 6;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_EYE_LASH, current);
if (current != 0) {
double[] colorArray = currentMakeup.getEyeLashColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_eyelash_0" + current);
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_LASH + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_EYE_LASH + "_" + current, intensity);
}
}
/* 高光*/
if (currentMakeup.getHeightLightIntensity() != 0.0 && currentMakeup.getHighLightBundle() != null) {
double intensity = currentMakeup.getHeightLightIntensity() * makeupIntensity;
currentMakeup.setHeightLightIntensity(intensity);
String path = currentMakeup.getHighLightBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_highlight_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_highlight_02.bundle")) {
current = 2;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_HIGH_LIGHT, current);
if (current != 0) {
double[] colorArray = currentMakeup.getHighLightColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_highlight_0" + current);
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_HIGH_LIGHT + "_" + current, intensity);
}
}
/* 阴影*/
if (currentMakeup.getShadowIntensity() != 0.0 && currentMakeup.getShadowBundle() != null) {
double intensity = currentMakeup.getShadowIntensity() * makeupIntensity;
currentMakeup.setShadowIntensity(intensity);
String path = currentMakeup.getShadowBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_contour_01.bundle")) {
current = 1;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_SHADOW, current);
if (current != 0) {
double[] colorArray = currentMakeup.getShadowColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_contour_01");
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_SHADOW + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_SHADOW + "_" + current, intensity);
}
}
/* 美瞳*/
if (currentMakeup.getPupilIntensity() != 0.0 && currentMakeup.getPupilBundle() != null) {
double intensity = currentMakeup.getPupilIntensity() * makeupIntensity;
currentMakeup.setPupilIntensity(intensity);
String path = currentMakeup.getPupilBundle().getPath();
int current = 0;
if (path.endsWith("mu_style_eyepupil_01.bundle")) {
current = 1;
} else if (path.endsWith("mu_style_eyepupil_03.bundle")) {
current = 2;
} else if (path.endsWith("mu_style_eyepupil_04.bundle")) {
current = 3;
} else if (path.endsWith("mu_style_eyepupil_05.bundle")) {
current = 4;
} else if (path.endsWith("mu_style_eyepupil_06.bundle")) {
current = 5;
} else if (path.endsWith("mu_style_eyepupil_07.bundle")) {
current = 6;
} else if (path.endsWith("mu_style_eyepupil_08.bundle")) {
current = 7;
} else if (path.endsWith("mu_style_eyepupil_09.bundle")) {
current = 8;
}
mCustomIndexMap.put(FACE_MAKEUP_TYPE_EYE_PUPIL, current);
if (current != 0) {
double[] colorArray = currentMakeup.getPupilColor().toScaleColorArray();
ArrayList<double[]> list = mMakeUpColorMap.get("color_mu_style_eyepupil_01");
for (int i = 0; i < list.size(); i++) {
if (DecimalUtils.doubleArrayEquals(colorArray, list.get(i))) {
mCustomColorIndexMap.put(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + current, i);
break;
}
}
mCustomIntensityMap.put(FACE_MAKEUP_TYPE_EYE_PUPIL + "_" + current, intensity);
}
}
currentMakeup.setMakeupIntensity(1.0);
}
/**
* 或当单项列表当前下标
*
* @param key
* @return
*/
@Override
public int getCurrentCustomItemIndex(String key) {
if (mCustomIndexMap.containsKey(key)) {
return mCustomIndexMap.get(key);
}
return 0;
}
/**
* 获取当前单项颜色下标
*
* @param key
* @param current
* @return
*/
@Override
public int getCurrentCustomColorIndex(String key, int current) {
if (mCustomColorIndexMap.containsKey(key + "_" + current)) {
return mCustomColorIndexMap.get(key + "_" + current);
}
return 3;
}
/**
* 获取当前单项强度
*
* @param key
* @param current
* @return
*/
@Override
public double getCurrentCustomIntensity(String key, int current) {
if (mCustomIntensityMap.containsKey(key + "_" + current)) {
return mCustomIntensityMap.get(key + "_" + current);
}
return 1.0;
}
//endregion
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
mFURenderKit.setFaceBeauty(FaceBeautySource.clone(FaceBeautyDataFactory.faceBeauty));
mFURenderKit.getFaceBeauty().setFilterName(currentFilterName);
mFURenderKit.getFaceBeauty().setFilterIntensity(currentFilterIntensity);
if (!currentMakeup.getControlBundle().getPath().equals(FaceUnityConfig.BUNDLE_FACE_MAKEUP))
currentMakeup.setFilterIntensity(currentFilterIntensity);
FUAIKit.getInstance().setMaxFaces(4);
mFURenderKit.setMakeup(currentMakeup);
//特殊有一些需要设置图层混合模式的 04双色眼影3第2层眼影的混合模式 == 1 06三色眼影2第3层眼影的混合模式 == 1
if (currentMakeup.getEyeShadowBundle() != null && ("mu_style_eyeshadow_0" + 4).equals(currentMakeup.getEyeShadowBundle().getName()))
currentMakeup.setEyeShadowTexBlend2(1);
else if (currentMakeup.getEyeShadowBundle() != null && ("mu_style_eyeshadow_0" + 6).equals(currentMakeup.getEyeShadowBundle().getName()))
currentMakeup.setEyeShadowTexBlend3(1);
if (FaceUnityConfig.IS_OPEN_LAND_MARK) {
ExpressionRecognition expressionRecognition = new ExpressionRecognition(new FUBundleData(FaceUnityConfig.BUNDLE_LANDMARKS));
expressionRecognition.setLandmarksType(FUAITypeEnum.FUAITYPE_FACELANDMARKS239);
mFURenderKit.getPropContainer().addProp(expressionRecognition);
}
}
public void clearAll(){
currentMakeup = new Makeup(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_MAKEUP));
mFURenderKit.setMakeup(currentMakeup);
}
}

View File

@@ -0,0 +1,173 @@
package com.yunbao.faceunity.data;
import androidx.annotation.NonNull;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.prop.Prop;
import com.faceunity.core.model.prop.arMask.ARMask;
import com.faceunity.core.model.prop.bigHead.BigHead;
import com.faceunity.core.model.prop.expression.ExpressionRecognition;
import com.faceunity.core.model.prop.faceWarp.FaceWarp;
import com.faceunity.core.model.prop.gesture.GestureRecognition;
import com.faceunity.core.model.prop.sticker.Sticker;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.PropBean;
import com.yunbao.faceunity.infe.AbstractPropDataFactory;
import com.yunbao.faceunity.repo.PropSource;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import java.util.ArrayList;
/**
* DESC道具业务工厂道具贴图、AR面具、搞笑大头、表情识别、哈哈镜、手势识别
* Created on 2021/3/2
*/
public class PropDataFactory extends AbstractPropDataFactory {
public interface PropListener {
void onItemSelected(PropBean bean);
}
/*渲染控制器*/
private final FURenderKit mFURenderKit = FURenderKit.getInstance();
/*道具列表*/
private final ArrayList<PropBean> propBeans;
/*默认选中下标*/
private int currentPropIndex;
/*当前道具*/
public Prop currentProp;
/*回调接口*/
private final PropListener mPropListener;
/*道具类型*/
private int propType;
/**
* @param listener 回调接口
* @param type 道具类型
* @param index 默认选中下标
*/
public PropDataFactory(PropListener listener, int type, int index) {
mPropListener = listener;
propType = type;
currentPropIndex = index;
propBeans = PropSource.buildPropBeans(type);
}
/**
* 获取当前选中下标
*
* @return
*/
@Override
public int getCurrentPropIndex() {
return currentPropIndex;
}
/**
* 设置当前选中下标
*
* @param currentPropIndex
*/
@Override
public void setCurrentPropIndex(int currentPropIndex) {
this.currentPropIndex = currentPropIndex;
}
/**
* 获取道具队列
*
* @return
*/
@Override
@NonNull
public ArrayList<PropBean> getPropBeans() {
return propBeans;
}
/**
* 设置效果
*/
@Override
public void onItemSelected(PropBean bean) {
onPropSelected(bean);
mPropListener.onItemSelected(bean);
}
public void setPropType(int propType) {
this.propType = propType;
}
/**
* 其他道具
*
* @param bean
*/
private void onPropSelected(PropBean bean) {
String path = bean.getPath();
if (path == null || path.trim().length() == 0) {
mFURenderKit.getPropContainer().removeAllProp();
currentProp = null;
return;
}
Prop prop = null;
switch (propType) {
case FunctionEnum.STICKER:
prop = new Sticker(new FUBundleData(path));
break;
case FunctionEnum.AR_MASK:
prop = new ARMask(new FUBundleData(path));
break;
case FunctionEnum.BIG_HEAD:
prop = new BigHead(new FUBundleData(path));
break;
case FunctionEnum.EXPRESSION_RECOGNITION:
prop = new ExpressionRecognition(new FUBundleData(path));
break;
case FunctionEnum.FACE_WARP:
prop = new FaceWarp(new FUBundleData(path));
break;
case FunctionEnum.GESTURE_RECOGNITION:
prop = new GestureRecognition(new FUBundleData(path));
break;
}
mFURenderKit.getPropContainer().replaceProp(currentProp, prop);
currentProp = prop;
}
/**
* FURenderKit加载当前特效
*/
public void bindCurrentRenderer() {
if (propType == FunctionEnum.GESTURE_RECOGNITION) {
FUAIKit.getInstance().loadAIProcessor(FaceUnityConfig.BUNDLE_AI_HAND, FUAITypeEnum.FUAITYPE_HANDGESTURE);
}
if (propType == FunctionEnum.BIG_HEAD) {
FUAIKit.getInstance().setMaxFaces(1);
} else {
FUAIKit.getInstance().setMaxFaces(4);
}
mFURenderKit.setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
PropBean propBean = propBeans.get(currentPropIndex);
onItemSelected(propBean);
}
/**
* 结束需要释放AI驱动
*/
public void releaseAIProcessor() {
if (propType == FunctionEnum.GESTURE_RECOGNITION) {
FUAIKit.getInstance().releaseAIProcessor(FUAITypeEnum.FUAITYPE_HANDGESTURE);
}
}
}

View File

@@ -0,0 +1,58 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
public class AnimationFilterBean extends BaseBean {
private int iconId;
private int style=0;
public AnimationFilterBean(int iconId, int style) {
this.iconId = iconId;
this.style = style;
}
public int getStyle() {
return style;
}
public void setStyle(int style) {
this.style = style;
}
public int getIconId() {
return iconId;
}
public void setIconId(int iconId) {
this.iconId = iconId;
}
@NonNull
@Override
public String getKey() {
return style+"";
}
@Override
public int getDesRes() {
return 0;
}
@Override
public int getImageRes() {
return iconId;
}
@Override
public int getBeanType() {
return FaceParam.FACE_ANIM;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
}

View File

@@ -0,0 +1,64 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
/**
* 道具
* @property iconId Int 图标
* @property path String? Animoji 道具路径
* @constructor
*/
public class AnimojiBean extends BaseBean{
private int iconId;
private String path;
public AnimojiBean(int iconId, String path) {
this.iconId = iconId;
this.path = path;
}
public int getIconId() {
return iconId;
}
public void setIconId(int iconId) {
this.iconId = iconId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
@NonNull
@Override
public String getKey() {
return path;
}
@Override
public int getDesRes() {
return 0;
}
@Override
public int getImageRes() {
return iconId;
}
@Override
public int getBeanType() {
return FaceParam.FACE_ANIMOJI;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
}

View File

@@ -0,0 +1,10 @@
package com.yunbao.faceunity.entity
/**
*
* DESC
* Created on 2020/12/4
*
*/
data class AvatarBean(val iconId: Int, val des: String)

View File

@@ -0,0 +1,19 @@
package com.yunbao.faceunity.entity
import android.graphics.drawable.Drawable
abstract class BaseBean {
abstract val key: String
abstract val desRes: Int
abstract val imageRes: Int
abstract val beanType: Int
abstract fun getModelAttributeData(): ModelAttributeData
open fun getImageUrl():String {
return "";
}
open fun getImageDrawable(): Drawable{
return null!!
}
}

View File

@@ -0,0 +1,11 @@
package com.yunbao.faceunity.entity
/**
*
* DESC
* Created on 2020/12/4
*
*/
data class BgSegGreenBackgroundBean(val desRes: Int, val iconRes: Int, val filePath: String? = null)

View File

@@ -0,0 +1,18 @@
package com.yunbao.faceunity.entity
/**
*
* DESC
* Created on 2020/12/4
*
*/
data class BgSegGreenBean(val key: String, val desRes: Int, val closeRes: Int, val openRes: Int, val type: ButtonType) {
enum class ButtonType{
NORMAL1_BUTTON,//普通一号按钮
NORMAL2_BUTTON,//普通二号按钮
BACK_BUTTON,//返回按钮
SWITCH_BUTTON//切换按钮,切换整个按钮功能
}
}

View File

@@ -0,0 +1,32 @@
package com.yunbao.faceunity.entity
/**
*
* DESC
* Created on 2020/12/4
*
*/
data class BgSegGreenSafeAreaBean(val iconRes: Int, val type: ButtonType, val filePath: String? = null,val isAssetFile: Boolean = true) {
constructor(iconRes: Int, type: ButtonType) : this(
iconRes,
type,
null,
true
)
constructor(iconRes: Int, type: ButtonType, filePath :String) : this(
iconRes,
type,
filePath,
true
)
enum class ButtonType{
NORMAL1_BUTTON,//普通一号按钮,普通安全区域按钮
NORMAL2_BUTTON,//普通二号按钮,用于自定义按钮
BACK_BUTTON,//返回按钮
NONE_BUTTON,//不选择按钮
}
}

View File

@@ -0,0 +1,75 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.repo.BodyBeautySource;
import java.util.Objects;
/**
* DESC美体
* Created on 2021/4/26
*/
public class BodyBeautyBean extends BaseBean {
private String key;//名称标识
private int desRes;//描述
private int closeRes;//图片
private int openRes;//图片
public BodyBeautyBean(String key, int desRes, int closeRes, int openRes) {
this.key = key;
this.desRes = desRes;
this.closeRes = closeRes;
this.openRes = openRes;
}
@Override
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getDesRes() {
return desRes;
}
public void setDesRes(int desRes) {
this.desRes = desRes;
}
public int getCloseRes() {
return closeRes;
}
public void setCloseRes(int closeRes) {
this.closeRes = closeRes;
}
public int getOpenRes() {
return openRes;
}
public void setOpenRes(int openRes) {
this.openRes = openRes;
}
@Override
public int getImageRes() {
return closeRes;
}
@Override
public int getBeanType() {
return FaceParam.FACE_BEAUTY_BODY;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return Objects.requireNonNull(BodyBeautySource.buildModelAttributeRange().get(key));
}
}

View File

@@ -0,0 +1,86 @@
package com.yunbao.faceunity.entity
import com.yunbao.faceunity.data.FaceParam
import com.yunbao.faceunity.repo.FaceBeautySource
/**
*
* @property key String 名称标识
* @property desRes Int 描述
* @property closeRes Int 图片
* @property openRes Int 图片
* @property buttonType 按钮类型
* @constructor
*/
data class FaceBeautyBean(
override val key: String,
override val desRes: Int,
val closeRes: Int,
val openRes: Int,
val toastDesRes: Int,
val canUseFunction: Boolean = true,
val buttonType: ButtonType = ButtonType.NORMAL_BUTTON//定义一项按钮功能 普通按钮 返回按钮 子项按钮
, override val beanType: Int
, override val imageRes: Int
) : BaseBean() {
constructor(key: String, desRes: Int, closeRes: Int, openRes: Int) : this(
key,
desRes,
closeRes,
openRes,
0,
true,
ButtonType.NORMAL_BUTTON,
FaceParam.FACE_BEAUTY_SKIN,
closeRes
)
constructor(
key: String,
desRes: Int,
closeRes: Int,
openRes: Int,
toastDesRes: Int,
canUseFunction: Boolean
) : this(
key,
desRes,
closeRes,
openRes,
toastDesRes,
canUseFunction,
ButtonType.NORMAL_BUTTON,
FaceParam.FACE_BEAUTY_SKIN,
closeRes
)
constructor(
key: String,
desRes: Int,
closeRes: Int,
openRes: Int,
toastDesRes: Int,
canUseFunction: Boolean,
type:Int
):this(
key,
desRes,
closeRes,
openRes,
toastDesRes,
canUseFunction,
ButtonType.NORMAL_BUTTON,
type,
closeRes
)
enum class ButtonType {
NORMAL_BUTTON,
BACK_BUTTON,
SUB_ITEM_BUTTON
}
override fun getModelAttributeData(): ModelAttributeData {
return FaceBeautySource.buildModelAttributeRange()?.get(key)!!
}
}

View File

@@ -0,0 +1,79 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
/**
* DESC美颜滤镜
* Created on 2021/4/26
*/
public class FaceBeautyFilterBean extends BaseBean {
private String key;//名称标识
private int imageRes;//图片
private int desRes;//描述
private double intensity = 0.4;//强度
public FaceBeautyFilterBean(String key, int imageRes, int desRes) {
this.key = key;
this.imageRes = imageRes;
this.desRes = desRes;
}
public FaceBeautyFilterBean(String key, int imageRes, int desRes, double intensity) {
this.key = key;
this.imageRes = imageRes;
this.desRes = desRes;
this.intensity = intensity;
}
@Override
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
@Override
public int getImageRes() {
return imageRes;
}
public void setImageRes(int imageRes) {
this.imageRes = imageRes;
}
@Override
public int getDesRes() {
return desRes;
}
public void setDesRes(int desRes) {
this.desRes = desRes;
}
public double getIntensity() {
return intensity;
}
public void setIntensity(double intensity) {
this.intensity = intensity;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
@Override
public int getBeanType() {
return FaceParam.FACE_BEAUTY_FILTER;
}
}

View File

@@ -0,0 +1,21 @@
package com.yunbao.faceunity.entity
/**
* 滤镜
* @property key String 名称标识
* @property imageRes Int 图片
* @property desRes Int 描述
* @constructor
*/
data class FaceBeautyStyleBean(
override val key: String,
override val imageRes: Int,
override val desRes: Int,
override val beanType:Int,
):
BaseBean(){
override fun getModelAttributeData(): ModelAttributeData {
return null!!
}
}

View File

@@ -0,0 +1,25 @@
package com.yunbao.faceunity.entity;
public class FunctionEnum {
public final static int FACE_BEAUTY = 1;
public final static int MAKE_UP = 2;
public final static int STICKER = 3;
public final static int ANIMOJI = 4;
public final static int HAIR_BEAUTY = 5;
public final static int LIGHT_MAKEUP = 6;
public final static int AR_MASK = 7;
public final static int BIG_HEAD = 8;
public final static int POSTER_CHANGE = 9;
public final static int EXPRESSION_RECOGNITION = 10;
public final static int MUSIC_FILTER = 11;
public final static int FACE_WARP = 12;
public final static int BODY_BEAUTY = 13;
public final static int AVATAR = 14;
public final static int ACTION_RECOGNITION = 15;
public final static int PORTRAIT_SEGMENT = 16;
public final static int GESTURE_RECOGNITION = 17;
public final static int BG_SEG_GREEN = 18;
public final static int HUMAN_OUTLINE = 19;
public final static int BG_SEG_CUSTOM = 20;
public final static int FINE_STICKER = 21;
}

View File

@@ -0,0 +1,67 @@
package com.yunbao.faceunity.entity;
public class LightMakeupBean {
int nameRes;
int iconRes;
String key;
double intensity;
String filterName;
double filterIntensity;
public LightMakeupBean(int nameRes, int iconRes, String key, double intensity, String filterName, double filterIntensity) {
this.nameRes = nameRes;
this.iconRes = iconRes;
this.key = key;
this.intensity = intensity;
this.filterName = filterName;
this.filterIntensity = filterIntensity;
}
public int getNameRes() {
return nameRes;
}
public void setNameRes(int nameRes) {
this.nameRes = nameRes;
}
public int getIconRes() {
return iconRes;
}
public void setIconRes(int iconRes) {
this.iconRes = iconRes;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public double getIntensity() {
return intensity;
}
public void setIntensity(double intensity) {
this.intensity = intensity;
}
public String getFilterName() {
return filterName;
}
public void setFilterName(String filterName) {
this.filterName = filterName;
}
public double getFilterIntensity() {
return filterIntensity;
}
public void setFilterIntensity(double filterIntensity) {
this.filterIntensity = filterIntensity;
}
}

View File

@@ -0,0 +1,43 @@
package com.yunbao.faceunity.entity
/**
*
* @property key String 名称标识
* @property type TypeEnum 类型
* @property imageRes Int 图片
* @property desRes Int 描述
* @property bundlePath FUBundleData 资源句柄
* @property jsonPath String 参数配置路径
* @property filterName Double 滤镜
* @property filterIntensity Double 滤镜强度
* @property filterScale Double scale 标准滤镜比率
* @property intensity Double 强度
* @property jsonPathParams Double 参数配置缓存
* @constructor
*/
data class MakeupCombinationBean @JvmOverloads constructor(
override val key: String,
val type: TypeEnum,
override val imageRes: Int,
override val desRes: Int,
val bundlePath: String?,
val jsonPath: String,
val filterName: String,
var filterScale: Double = 1.0,
var filterIntensity: Double = 0.7,
var intensity: Double = 0.7,
var jsonPathParams: LinkedHashMap<String, Any>? = null,
override val beanType: Int
): BaseBean() {
enum class TypeEnum {
TYPE_NONE, //无
TYPE_DAILY,//日常妆,支持自定义
TYPE_THEME_SUB,//主题妆_依附于face_makeup
TYPE_THEME_MAIN,//主题妆_替换face_makeup
}
override fun getModelAttributeData(): ModelAttributeData {
return null!!
}
}

View File

@@ -0,0 +1,90 @@
package com.yunbao.faceunity.entity;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import java.util.ArrayList;
/**
*
* @property nameRes Int 名称
* @property drawable Drawable 图片资源
* @property doubleArray ArrayList<DoubleArray>? 颜色数组
* @constructor
*/
public class MakeupCustomBean extends BaseBean{
private int nameRes;
private Drawable drawable;
private ArrayList<double[]> doubleArray;
private int beanType;
public MakeupCustomBean(int nameRes, Drawable drawable, ArrayList<double[]> doubleArray,int beanType) {
this.nameRes = nameRes;
this.drawable = drawable;
this.doubleArray = doubleArray;
this.beanType=beanType;
}
public MakeupCustomBean(int nameRes, Drawable drawable,int beanType) {
this.nameRes = nameRes;
this.drawable = drawable;
this.beanType=beanType;
}
public int getNameRes() {
return nameRes;
}
public void setNameRes(int nameRes) {
this.nameRes = nameRes;
}
public Drawable getDrawable() {
return drawable;
}
public void setDrawable(Drawable drawable) {
this.drawable = drawable;
}
public ArrayList<double[]> getDoubleArray() {
return doubleArray;
}
public void setDoubleArray(ArrayList<double[]> doubleArray) {
this.doubleArray = doubleArray;
}
@Override
public String getKey() {
return nameRes+"";
}
@Override
public int getDesRes() {
return nameRes;
}
@Override
public int getImageRes() {
return 0;
}
@NonNull
@Override
public Drawable getImageDrawable() {
return drawable;
}
@Override
public int getBeanType() {
return beanType;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
}

View File

@@ -0,0 +1,43 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
public class MakeupCustomClassBean extends BaseBean{
private int nameRes;
private String key;
private int beanType;
public MakeupCustomClassBean(int nameRes, String key, int beanType) {
this.nameRes = nameRes;
this.key = key;
this.beanType = beanType;
}
@Override
public String getKey() {
return key;
}
@Override
public int getDesRes() {
return nameRes;
}
@Override
public int getImageRes() {
return 0;
}
@Override
public int getBeanType() {
return beanType;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
}

View File

@@ -0,0 +1,3 @@
package com.yunbao.faceunity.entity
data class MenuGroupBean(val titleId :Int,val iconId:Int)

View File

@@ -0,0 +1,12 @@
package com.yunbao.faceunity.entity
/**
* 模型单项补充模型
* @property default Double 默认值
* @property stand Double 无变化时候的基准值
* @property minRange Double 范围最小值
* @property maxRange Double 范围最大值
* @constructor
*/
data class ModelAttributeData(val default: Double=0.0, val stand: Double = 0.0, val minRange: Double = 0.0, val maxRange: Double = 1.0)

View File

@@ -0,0 +1,85 @@
package com.yunbao.faceunity.entity;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
/**
* 道具
* @property iconId Int 图标
* @property path String 道具路径
* @property descId Int 道具提示
* @constructor
*/
public class PropBean extends BaseBean {
private int iconId;
private String path;
private int descId;
private int beanType;
public PropBean(int iconId, String path,int beanType) {
this.iconId = iconId;
this.path = path;
this.beanType=beanType;
}
public PropBean(int iconId, String path, int descId,int beanType) {
this.iconId = iconId;
this.path = path;
this.descId = descId;
this.beanType=beanType;
}
public int getIconId() {
return iconId;
}
public void setIconId(int iconId) {
this.iconId = iconId;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public int getDescId() {
return descId;
}
public void setDescId(int descId) {
this.descId = descId;
}
@NonNull
@Override
public String getKey() {
return path;
}
@Override
public int getDesRes() {
return descId;
}
@Override
public int getImageRes() {
return iconId;
}
@Override
public int getBeanType() {
return beanType;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
}

View File

@@ -0,0 +1,18 @@
package com.yunbao.faceunity.entity
/**
* 道具
* @property iconId Int 图标
* @property path String 道具路径
* @property descId Int 道具提示
* @property descId Int 类型 -2 为添加事件 -1为空 其他多道具类型
* @property iconPath 图标路径
* @constructor
*/
data class PropCustomBean @JvmOverloads constructor(
val iconId: Int,
val path: String?,
val type: Int = -1,
val descId: Int = 0,
val iconPath: String? = null
)

View File

@@ -0,0 +1,328 @@
package com.yunbao.faceunity.entity.net;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import java.util.ArrayList;
/**
* @author Qinyu on 2021-03-17
* @description
*/
public class FineStickerEntity {
/**
* count : 2
* docs : [{"_id":"6051a0aa6d670000230030c7","index":1,"tool":{"_id":"5f6ae24e570100009e006547","bundle":{"remark":"优化背景分割提高边缘稳定性需要SDK v6.2.0支持","uid":"0a176380-b33e-11e9-8e6a-35012f229fc1.bundle","size":3872.85,"name":"hez_ztt_fu.bundle"},"icon":{"remark":"v1.0","uid":"167f72e0-e173-11e8-b908-51298abcbcf5.png","size":61.83,"name":"hez_ztt_fu.png","url":"http://tools-manage.oss-cn-hangzhou.aliyuncs.com/167f72e0-e173-11e8-b908-51298abcbcf5.png?OSSAccessKeyId=LTAIZvD3ylHAD1vH&Expires=1616057194&Signature=4aesuhXnenASOXCQwl0logppBM4%3D"}},"platform":"mobile","tag":"中级道具"},{"_id":"6051a2d36d670000230030c8","index":2,"tool":{"_id":"5f6ae24e570100009e006547","bundle":{"remark":"优化背景分割提高边缘稳定性需要SDK v6.2.0支持","uid":"0a176380-b33e-11e9-8e6a-35012f229fc1.bundle","size":3872.85,"name":"hez_ztt_fu.bundle"},"icon":{"remark":"v1.0","uid":"167f72e0-e173-11e8-b908-51298abcbcf5.png","size":61.83,"name":"hez_ztt_fu.png","url":"http://tools-manage.oss-cn-hangzhou.aliyuncs.com/167f72e0-e173-11e8-b908-51298abcbcf5.png?OSSAccessKeyId=LTAIZvD3ylHAD1vH&Expires=1616057194&Signature=4aesuhXnenASOXCQwl0logppBM4%3D"}},"platform":"mobile","tag":"中级道具"}]
*/
private int count;
private ArrayList<DocsBean> docs;
private boolean isOnline; //手动设置
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public ArrayList<DocsBean> getDocs() {
return docs;
}
public void setDocs(ArrayList<DocsBean> docs) {
this.docs = docs;
}
public boolean isOnline() {
return isOnline;
}
public void setOnline(boolean online) {
isOnline = online;
}
public static class DocsBean extends BaseBean {
/**
* _id : 6051a0aa6d670000230030c7
* index : 1
* tool : {"_id":"5f6ae24e570100009e006547","bundle":{"remark":"优化背景分割提高边缘稳定性需要SDK v6.2.0支持","uid":"0a176380-b33e-11e9-8e6a-35012f229fc1.bundle","size":3872.85,"name":"hez_ztt_fu.bundle"},"icon":{"remark":"v1.0","uid":"167f72e0-e173-11e8-b908-51298abcbcf5.png","size":61.83,"name":"hez_ztt_fu.png","url":"http://tools-manage.oss-cn-hangzhou.aliyuncs.com/167f72e0-e173-11e8-b908-51298abcbcf5.png?OSSAccessKeyId=LTAIZvD3ylHAD1vH&Expires=1616057194&Signature=4aesuhXnenASOXCQwl0logppBM4%3D"}}
* platform : mobile
* tag : 中级道具
*/
private String _id;
private int index;
private ToolBean tool;
private String platform;
private String tag;
private String filePath; //原始下载来的文件的存储地址,手动设置
private ArrayList<String> upZipFilePath;//解压的文件位置(绝对路径),手动设置
private boolean isDownloading; //手动设置
// public Effect cast2Effect() {
// return new Effect(tool.bundle.name, 0, filePath, 1, Effect.EFFECT_TYPE_STICKER, 0);
// }
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public ToolBean getTool() {
return tool;
}
public void setTool(ToolBean tool) {
this.tool = tool;
}
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public ArrayList<String> getUnZipFilePaths() {
return upZipFilePath;
}
public void setUpZipFilePaths(ArrayList paths) {
upZipFilePath = paths;
}
public boolean isDownloading() {
return isDownloading;
}
public void setDownloading(boolean downloading) {
isDownloading = downloading;
}
@NonNull
@Override
public String getKey() {
return _id;
}
@Override
public int getDesRes() {
return 0;
}
@Override
public int getImageRes() {
return 0;
}
@Override
public String getImageUrl() {
if(tool==null||tool.getIcon()==null){
return "";
}
return tool.getIcon().getUrl();
}
@Override
public int getBeanType() {
return FaceParam.FACE_FINE_STICKER;
}
@NonNull
@Override
public ModelAttributeData getModelAttributeData() {
return null;
}
public static class ToolBean {
/**
* _id : 5f6ae24e570100009e006547
* bundle : {"remark":"优化背景分割提高边缘稳定性需要SDK v6.2.0支持","uid":"0a176380-b33e-11e9-8e6a-35012f229fc1.bundle","size":3872.85,"name":"hez_ztt_fu.bundle"}
* icon : {"remark":"v1.0","uid":"167f72e0-e173-11e8-b908-51298abcbcf5.png","size":61.83,"name":"hez_ztt_fu.png","url":"http://tools-manage.oss-cn-hangzhou.aliyuncs.com/167f72e0-e173-11e8-b908-51298abcbcf5.png?OSSAccessKeyId=LTAIZvD3ylHAD1vH&Expires=1616057194&Signature=4aesuhXnenASOXCQwl0logppBM4%3D"}
*/
private String _id;
private BundleBean bundle;
private IconBean icon;
private String adapter;
private String category;
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public BundleBean getBundle() {
return bundle;
}
public void setBundle(BundleBean bundle) {
this.bundle = bundle;
}
public IconBean getIcon() {
return icon;
}
public void setIcon(IconBean icon) {
this.icon = icon;
}
public String getAdapter() {
return adapter;
}
public void setAdapter(String adapter) {
this.adapter = adapter;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public static class BundleBean {
/**
* remark : 优化背景分割提高边缘稳定性需要SDK v6.2.0支持
* uid : 0a176380-b33e-11e9-8e6a-35012f229fc1.bundle
* size : 3872.85
* name : hez_ztt_fu.bundle
*/
private String remark;
private String uid;
private double size;
private String name;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public double getSize() {
return size;
}
public void setSize(double size) {
this.size = size;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public static class IconBean {
/**
* remark : v1.0
* uid : 167f72e0-e173-11e8-b908-51298abcbcf5.png
* size : 61.83
* name : hez_ztt_fu.png
* url : http://tools-manage.oss-cn-hangzhou.aliyuncs.com/167f72e0-e173-11e8-b908-51298abcbcf5.png?OSSAccessKeyId=LTAIZvD3ylHAD1vH&Expires=1616057194&Signature=4aesuhXnenASOXCQwl0logppBM4%3D
*/
private String remark;
private String uid;
private double size;
private String name;
private String url;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public double getSize() {
return size;
}
public void setSize(double size) {
this.size = size;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
}
}
}

View File

@@ -0,0 +1,29 @@
package com.yunbao.faceunity.entity.net;
/**
* Created on 2021/3/31 0031 16:12.
* Author: xloger
* Email:phoenix@xloger.com
*/
public class FineStickerTagEntity {
private String tag;
public FineStickerTagEntity(String tag) {
this.tag = tag;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
@Override
public String toString() {
return "FineStickerTagEntity{" +
"tag='" + tag + '\'' +
'}';
}
}

View File

@@ -0,0 +1,31 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.AnimationFilterBean
import com.yunbao.faceunity.entity.AnimojiBean
/**
*
* DESC
* Created on 2020/12/24
*
*/
abstract class AbstractAnimojiDataFactory {
/* 当前选中动漫贴图下标 */
abstract var currentAnimojiIndex: Int
/* 动漫贴图队列 */
abstract val animojis: ArrayList<AnimojiBean>
/* 当前选中滤镜下标 */
abstract var currentFilterIndex: Int
/* 滤镜队列 */
abstract val filters: ArrayList<AnimationFilterBean>
abstract fun onAnimojiSelected(data: AnimojiBean)
abstract fun onFilterSelected(data: AnimationFilterBean)
}

View File

@@ -0,0 +1,35 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.AvatarBean
/**
*
* DESC
* Created on 2021/1/6
*
*/
abstract class AbstractAvatarDataFactory {
/**
* 人物队列
*/
abstract val members: ArrayList<AvatarBean>
/**
* 默认选中人物下标
*/
abstract var currentMemberIndex: Int
/**
* true 全身、 false 半身 驱动切换
*/
abstract var isHumanTrackSceneFull: Boolean
/**
* 当前人物选中
* @param bean AvatarBean
*/
abstract fun onMemberSelected(bean:AvatarBean)
}

View File

@@ -0,0 +1,97 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.BgSegGreenBackgroundBean
import com.yunbao.faceunity.entity.BgSegGreenBean
import com.yunbao.faceunity.entity.BgSegGreenSafeAreaBean
import com.yunbao.faceunity.entity.ModelAttributeData
/**
*
* DESC
* Created on 2020/12/29
*
*/
abstract class AbstractBgSegGreenDataFactory {
/* 绿幕抠像项目数据扩展模型 */
abstract val modelAttributeRange: HashMap<String, ModelAttributeData>
/* 绿幕抠像功能列表 */
abstract val bgSegGreenActions: ArrayList<BgSegGreenBean>
/* 绿幕抠图安全区域功能列表*/
abstract val bgSegGreenSafeAreas: ArrayList<BgSegGreenSafeAreaBean>
/* 安全区域下标 */
abstract var bgSafeAreaIndex: Int
/* 刷新安全区域UI */
abstract fun updateSafeAreaBeansAndIndex() :Boolean
/* 绿幕抠像背景列表 */
abstract val bgSegGreenBackgrounds: ArrayList<BgSegGreenBackgroundBean>
/* 绿幕抠像当前背景下标 */
abstract var backgroundIndex: Int
/**
* 背景图片变更
* @param data BgSegGreenBackgroundBean
*/
abstract fun onBackgroundSelected(data: BgSegGreenBackgroundBean)
/**
* 自定义安全区域
*/
abstract fun onSafeAreaAdd()
/**
* 安全区域变更
* @param data BgSegGreenSafeAreaBean
*/
abstract fun onSafeAreaSelected(data: BgSegGreenSafeAreaBean?)
/**
* 是否开启安全区域总开关
*/
abstract fun isUseTemplate():Boolean
/**
* 取色锚点颜色变更
* @param array DoubleArray
*/
abstract fun onColorRGBChanged(array: DoubleArray)
/**
* 绿幕开关
* @param enable Boolean
*/
abstract fun onBgSegGreenEnableChanged(enable: Boolean)
/**
* 根据名称标识获取对应的值
* @param key String 标识
* @return Double 值
*/
abstract fun getParamIntensity(key: String): Double
/**
* 根据名称标识更新对应的值
* @param key String 标识
* @return Double 值
*/
abstract fun updateParamIntensity(key: String, value: Double)
/**
* 是否调用取色器功能
*
* @param selected
* @param color
*/
abstract fun onColorPickerStateChanged(selected: Boolean, color: Int)
}

View File

@@ -0,0 +1,55 @@
package com.yunbao.faceunity.infe;
import com.yunbao.faceunity.entity.BodyBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC数据构造工厂抽象类
* Created on 2021/4/26
*/
public abstract class AbstractBodyBeautyDataFactory {
/**
* 获取美体参数集合
* @return
*/
public abstract ArrayList<BodyBeautyBean> getBodyBeautyParam();
/**
* 获取美体项目数据扩展模型
* @return
*/
public abstract HashMap<String, ModelAttributeData> getModelAttributeRange();
/**
* 根据名称标识获取对应的值
*
* @param key String 标识
* @return Double 值
*/
public abstract double getParamIntensity(String key);
/**
* 根据名称标识更新对应的值
*
* @param key String 标识
* @return Double 值
*/
public abstract void updateParamIntensity(String key, double value);
/**
* 美体开关
*
* @param enable Boolean
*/
public abstract void enableBodyBeauty(boolean enable);
}

View File

@@ -0,0 +1,105 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.FaceBeautyBean
import com.yunbao.faceunity.entity.FaceBeautyFilterBean
import com.yunbao.faceunity.entity.FaceBeautyStyleBean
import com.yunbao.faceunity.entity.ModelAttributeData
/**
*
* DESC数据构造工厂接口类
* Created on 2020/12/23
*
*/
abstract class AbstractFaceBeautyDataFactory {
/*美肤底部菜单数据*/
abstract val skinBeauty: ArrayList<FaceBeautyBean>
/*美型底部菜单数据*/
abstract val shapeBeauty: ArrayList<FaceBeautyBean>
/*美型脸型子项数据*/
abstract val shapeBeautySubItem: ArrayList<FaceBeautyBean>
/* 滤镜底部菜单数据*/
abstract val beautyFilters: ArrayList<FaceBeautyFilterBean>
/* 风格底部菜单数据*/
abstract val beautyStyles: ArrayList<FaceBeautyStyleBean>
/*系统推荐配置滤镜对应下标*/
abstract var currentFilterIndex: Int
/* 美颜项目数据扩展模型 */
abstract val modelAttributeRange: HashMap<String, ModelAttributeData>
/*系统风格对应下标*/
abstract var currentStyleIndex: Int
/**
* 切换滤镜
* @param name String
* @param intensity Double
*/
abstract fun onFilterSelected(name: String, intensity: Double, resDes: Int)
/**
* 切换风格
* @param name String
*/
abstract fun onStyleSelected(name: String?)
/**
* 更改滤镜强度
* @param intensity Double
*/
abstract fun updateFilterIntensity(intensity: Double)
/**
* 美颜开关
* @param enable Boolean
*/
abstract fun enableFaceBeauty(enable: Boolean)
/**
* 获取单项强度
* @param key String
* @return Double
*/
abstract fun getParamIntensity(key: String): Double
/**
* 获取one hot的脸型
*/
abstract fun getCurrentOneHotFaceShape(): String
/**
* 设置当前one hot的脸型
*/
abstract fun setCurrentOneHotFaceShape(faceShape:String)
/**
* 设置当前脸型的UI值
*/
abstract fun setCurrentFaceShapeUIValue(hashMap:HashMap<String,Double>)
/**
* 获取当前脸型的UI值
*/
abstract fun getCurrentFaceShapeUIValue() :HashMap<String,Double>
/**
* 设置单项强度
* @param key String
* @param value Double
*/
abstract fun updateParamIntensity(key: String, value: Double)
/**
* 将所有效果置空 -> 变成标准值
*/
abstract fun resetParamIntensity()
}

View File

@@ -0,0 +1,22 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.net.FineStickerEntity
import com.yunbao.faceunity.entity.net.FineStickerTagEntity
/**
* Created on 2021/3/31 0031 15:27.
* Author: xloger
* Email:phoenix@xloger.com
*/
abstract class AbstractFineStickerDataFactory {
/*切换道具*/
abstract fun onItemSelected(bean: FineStickerEntity.DocsBean?)
/*获取标签列表*/
abstract fun loadTagList(): List<FineStickerTagEntity>
/*获取道具列表*/
abstract fun loadStickerList(tag: FineStickerTagEntity): FineStickerEntity?
/*下载道具*/
abstract fun downloadSticker(docsBean: FineStickerEntity.DocsBean)
}

View File

@@ -0,0 +1,28 @@
package com.yunbao.faceunity.infe;
import com.yunbao.faceunity.entity.LightMakeupBean;
import java.util.ArrayList;
public abstract class AbstractLightMakeupDataFactory {
private int currentLightMakeupIndex;
private ArrayList<LightMakeupBean> lightMakeUpBeans;
public abstract void onLightMakeupSelected(LightMakeupBean data);
public abstract void onLightMakeupIntensityChanged(double intensity);
public int getCurrentLightMakeupIndex() {
return currentLightMakeupIndex;
}
public void setCurrentLightMakeupIndex(int currentLightMakeupIndex) {
this.currentLightMakeupIndex = currentLightMakeupIndex;
}
public ArrayList<LightMakeupBean> getLightMakeUpBeans() {
return lightMakeUpBeans;
}
public void setLightMakeUpBeans(ArrayList<LightMakeupBean> lightMakeUpBeans) {
this.lightMakeUpBeans = lightMakeUpBeans;
}
}

View File

@@ -0,0 +1,93 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.MakeupCombinationBean
import com.yunbao.faceunity.entity.MakeupCustomBean
import com.yunbao.faceunity.entity.MakeupCustomClassBean
/**
*
* DESC
* Created on 2020/12/22
*
*/
abstract class AbstractMakeupDataFactory {
/* 默认组合妆容下标 */
abstract var currentCombinationIndex: Int
/* 美妆组合妆容配置 */
abstract val makeupCombinations: ArrayList<MakeupCombinationBean>
/**
* 组合妆容选中
* @param bean MakeupCombinationBean
*/
abstract fun onMakeupCombinationSelected(bean: MakeupCombinationBean)
/**
* 设置美妆整体强度
* @param intensity Double
*/
abstract fun updateCombinationIntensity(intensity: Double)
/**
* 进入自定义美妆
*/
abstract fun enterCustomMakeup()
/**
* 设置美妆单项强度
* @param key String 单项key
* @param current Int 单项下标
* @param intensity Double
*/
abstract fun updateCustomItemIntensity(key: String, current: Int, intensity: Double)
/**
* 更换类别单项
* @param key String
* @param index Int
*/
abstract fun onCustomBeanSelected(key: String, index: Int)
/**
* 设置单项颜色
* @param key String
* @param index Int
*/
abstract fun updateCustomColor(key: String, index: Int)
/* 美妆功能菜单 */
abstract val makeupCustomItemParams: LinkedHashMap<String, ArrayList<MakeupCustomBean>>
/* 美妆子项类别 */
abstract val makeupCustomClass: ArrayList<MakeupCustomClassBean>
/**
* 获取美妆单项当前下标
* @param key String
* @return Int
*/
abstract fun getCurrentCustomItemIndex(key: String): Int
/**
* 获取美妆当前选中项颜色下标
* @param key String
* @param current Int
* @return Int
*/
abstract fun getCurrentCustomColorIndex(key: String, current: Int): Int
/**
* 获取美妆当前选中项强度
* @param key String
* @param current Int
* @return Double
*/
abstract fun getCurrentCustomIntensity(key: String, current: Int): Double
}

View File

@@ -0,0 +1,45 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.PropCustomBean
/**
*
* DESC贴图道具
* Created on 2020/12/23
*
*/
abstract class AbstractPropCustomDataFactory {
/**
* 默认选中道具下标
*/
abstract var currentPropIndex: Int
/**
* 道具队列
*/
abstract val propCustomBeans: ArrayList<PropCustomBean>
/**
* 道具选中
* @param bean StickerBean
*/
abstract fun onItemSelected(bean: PropCustomBean)
/**
* 道具选中
*/
abstract fun onAddPropCustomBeanClick()
companion object {
const val TYPE_NONE = -1
const val TYPE_ADD = -99
}
}

View File

@@ -0,0 +1,33 @@
package com.yunbao.faceunity.infe
import com.yunbao.faceunity.entity.PropBean
/**
*
* DESC贴图道具
* Created on 2020/12/23
*
*/
abstract class AbstractPropDataFactory {
/**
* 默认选中道具下标
*/
abstract var currentPropIndex: Int
/**
* 道具队列
*/
abstract val propBeans: ArrayList<PropBean>
/**
* 道具选中
* @param bean StickerBean
*/
abstract fun onItemSelected(bean: PropBean)
}

View File

@@ -0,0 +1,40 @@
package com.yunbao.faceunity.listener;
import com.faceunity.core.enumeration.FUAIProcessorEnum;
/**
* DESCFURenderer状态回调监听
* Created on 2021/4/29
*/
public interface FURendererListener {
/**
* prepare完成回调
*/
void onPrepare();
/**
* 识别到的人脸或人体数量发生变化
*
* @param type 类型
* @param status 数量
*/
void onTrackStatusChanged(FUAIProcessorEnum type, int status);
/**
* 统计每 10 帧的平均数据FPS 和渲染函数调用时间
*
* @param fps FPS
* @param callTime 渲染函数调用时间
*/
void onFpsChanged(double fps, double callTime);
/**
* release完成回调
*/
void onRelease();
}

View File

@@ -0,0 +1,19 @@
package com.yunbao.faceunity.listener;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FUAIKit;
import com.yunbao.faceunity.utils.FaceUnityConfig;
/**
* 模块配置
* @param <T>
*/
public abstract class IFaceModel<T> {
public abstract T Builder();
public void apply() {
FUAIKit.getInstance().loadAIProcessor(FaceUnityConfig.BUNDLE_AI_FACE, FUAITypeEnum.FUAITYPE_FACEPROCESSOR);
FUAIKit.getInstance().faceProcessorSetFaceLandmarkQuality(FaceUnityConfig.DEVICE_LEVEL);
}
public abstract void setEnable(boolean enable);
}

View File

@@ -0,0 +1,59 @@
package com.yunbao.faceunity.repo;
import com.faceunity.core.model.animationFilter.AnimationFilterTypeEnum;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.AnimationFilterBean;
import com.yunbao.faceunity.entity.AnimojiBean;
import java.util.ArrayList;
/**
* DESCAnimoji数据构造
* Created on 2021/3/25
*/
public class AnimojiSource {
/**
* 构造贴图数据
*
* @return
*/
public static ArrayList<AnimojiBean> buildAnimojis() {
ArrayList<AnimojiBean> array = new ArrayList<>();
array.add(new AnimojiBean(R.mipmap.icon_control_delete_all, null));
array.add(new AnimojiBean(R.mipmap.icon_animoji_cartoon_princess, "animoji/cartoon_princess_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_qgirl, "animoji/qgirl_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_kaola, "animoji/kaola_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_wuxia, "animoji/wuxia_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_baihu, "animoji/baihu_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_frog_st, "animoji/frog_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_huangya, "animoji/huangya_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_hetun, "animoji/hetun_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_douniuquan, "animoji/douniuquan_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_hashiqi, "animoji/hashiqi_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_baimao, "animoji/baimao_Animoji.bundle"));
array.add(new AnimojiBean(R.mipmap.icon_animoji_kuloutou, "animoji/kuloutou_Animoji.bundle"));
return array;
}
/**
* 构造滤镜数据
*
* @return
*/
public static ArrayList<AnimationFilterBean> buildFilters() {
ArrayList<AnimationFilterBean> filters = new ArrayList<>();
filters.add(new AnimationFilterBean(R.mipmap.icon_control_delete_all, AnimationFilterTypeEnum.Origin));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_anime, AnimationFilterTypeEnum.Comic));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_portrait_dynamiceffect, AnimationFilterTypeEnum.Portrait));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_sketch, AnimationFilterTypeEnum.Sketch));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_oilpainting, AnimationFilterTypeEnum.Oil));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_sandlpainting, AnimationFilterTypeEnum.Sand));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_penpainting, AnimationFilterTypeEnum.Pen));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_pencilpainting, AnimationFilterTypeEnum.Pencil));
filters.add(new AnimationFilterBean(R.mipmap.icon_cartoon_graffiti, AnimationFilterTypeEnum.Granffiti));
return filters;
}
}

View File

@@ -0,0 +1,160 @@
package com.yunbao.faceunity.repo;
import com.faceunity.core.avatar.avatar.Color;
import com.faceunity.core.avatar.avatar.TransForm;
import com.faceunity.core.avatar.model.Avatar;
import com.faceunity.core.avatar.model.Scene;
import com.faceunity.core.entity.FUAnimationData;
import com.faceunity.core.entity.FUAvatarAnimFilterParams;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.entity.FUCoordinate3DData;
import com.faceunity.core.entity.FUTranslationScale;
import com.faceunity.core.entity.FUVisibleBundleData;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.AvatarBean;
import java.io.File;
import java.util.ArrayList;
/**
* DESCAvatar数据构造
* Created on 2021/3/30
*/
public class AvatarSource {
// Avatar
private static String BUNDLE_AVATAR_CONTROLLER = "graphics" + File.separator + "controller_cpp.bundle";
private static String BUNDLE_AVATAR_CONFIG = "pta" + File.separator + "controller_config.bundle";
private static String BUNDLE_AVATAR_BACKGROUND = "pta" + File.separator + "default_bg.bundle";
public static String BOY = "boy";
public static String GIRL = "girl";
/**
* 构造成员列表
*
* @return
*/
public static ArrayList<AvatarBean> buildMembers() {
ArrayList<AvatarBean> avatarBeans = new ArrayList<>();
avatarBeans.add(new AvatarBean(R.mipmap.icon_avatar_female, GIRL));
avatarBeans.add(new AvatarBean(R.mipmap.icon_avatar_male, BOY));
return avatarBeans;
}
/**
* 构造场景
*
* @param avatar
* @return
*/
public static Scene buildSceneModel(Avatar avatar) {
FUBundleData controlBundle = new FUBundleData(BUNDLE_AVATAR_CONTROLLER);
FUBundleData avatarConfig = new FUBundleData(BUNDLE_AVATAR_CONFIG);
Scene sceneModel = new Scene(controlBundle, avatarConfig);
sceneModel.addAvatar(avatar);
sceneModel.processorConfig.setEnableHumanProcessor(true);
return sceneModel;
}
/**
* 获取男孩对象
*
* @return
*/
public static Avatar buildBoyData(boolean isFull) {
String ptaBoyDir = "pta/boy/";
ArrayList<FUBundleData> components = new ArrayList();
components.add(new FUBundleData(ptaBoyDir + "head.bundle"));
components.add(new FUBundleData(ptaBoyDir + "midBody_male.bundle"));
components.add(new FUBundleData(ptaBoyDir + "male_hair_5.bundle"));
components.add(new FUBundleData(ptaBoyDir + "toushi_7.bundle"));
components.add(new FUBundleData(ptaBoyDir + "peishi_erding_2.bundle"));
components.add(new FUBundleData(ptaBoyDir + "waitao_3.bundle"));
components.add(new FUBundleData(ptaBoyDir + "kuzi_changku_5.bundle"));
components.add(new FUBundleData(ptaBoyDir + "xiezi_tuoxie_2.bundle"));
int[] invisibleList = {2,3,4};
components.add(new FUVisibleBundleData("",invisibleList,""));
ArrayList<FUAnimationData> animations = buildAnimations();
Avatar model = new Avatar(components);
for (FUAnimationData animationData:animations){
model.animation.addAnimation(animationData);
}
model.color.setColor(Color.Skin,new FUColorRGBData(227.0,158.0,132.0));
TransForm avatarTransForm = model.transForm;
avatarTransForm.setInstanceEnableHumanAnimDriver(true);
avatarTransForm.setPosition(isFull ? new FUCoordinate3DData(0.0, 58.14, -618.94) : new FUCoordinate3DData(0.0, 11.76, -183.89));
return model;
}
/**
* 获取女孩对象
*
* @return
*/
public static Avatar buildGirlData(boolean isFull) {
String ptaGirlDir = "pta/girl/";
ArrayList<FUBundleData> components = new ArrayList();
components.add(new FUBundleData(ptaGirlDir + "head.bundle"));
components.add(new FUBundleData(ptaGirlDir + "midBody_female.bundle"));
components.add(new FUBundleData(ptaGirlDir + "female_hair_23.bundle"));
components.add(new FUBundleData(ptaGirlDir + "toushi_5.bundle"));
components.add(new FUBundleData(ptaGirlDir + "taozhuang_12.bundle"));
components.add(new FUBundleData(ptaGirlDir + "facemakeup_3.bundle"));
components.add(new FUBundleData(ptaGirlDir + "xiezi_danxie.bundle"));
int[] invisibleList = {2,3,4};
components.add(new FUVisibleBundleData("",invisibleList,""));
ArrayList<FUAnimationData> animations = buildAnimations();
Avatar model = new Avatar(components );
for (FUAnimationData animationData:animations){
model.animation.addAnimation(animationData);
}
model.color.setColor(Color.Skin,new FUColorRGBData(255.0,202.0,186.0));
TransForm avatarTransForm = model.transForm;
avatarTransForm.setInstanceEnableHumanAnimDriver(true);
avatarTransForm.setPosition(isFull ? new FUCoordinate3DData(0.0, 58.14, -618.94) : new FUCoordinate3DData(0.0, 11.76, -183.89));
return model;
}
/**
* 外部传入组件和动画构建
*
* @param strComponents 组件bundle
* @param strAnimations 动画bundle
* @return
*/
public static Avatar buildAvatarData(ArrayList<String> strComponents, ArrayList<String> strAnimations) {
ArrayList<FUBundleData> components = new ArrayList();
for (String component : strComponents) {
components.add(new FUBundleData(component));
}
Avatar model = new Avatar(components);
for (String animation : strAnimations) {
model.animation.addAnimation(new FUAnimationData(new FUBundleData(animation)));
}
//位置等avatar基本参数构建
TransForm avatarTransForm = model.transForm;
avatarTransForm.setPosition(new FUCoordinate3DData(20, 45, -618.94));
avatarTransForm.setTranslationScale(new FUTranslationScale(0.0f,0.0f,0.0f));
avatarTransForm.setInstanceEnableHumanAnimDriver(true);
model.animation.setHumanProcessorSetAvatarAnimFilterParams(new FUAvatarAnimFilterParams(8, 0.09f, 0.120f));
return model;
}
/**
* 构造动画参数
*
* @return
*/
public static ArrayList<FUAnimationData> buildAnimations() {
String animDir = "pta/gesture/";
ArrayList<FUAnimationData> animations = new ArrayList();
animations.add(new FUAnimationData(new FUBundleData(animDir + "anim_idle.bundle")));
return animations;
}
public static void setSceneBackGround(Scene sceneModel, boolean hasBackGround) {
sceneModel.setBackgroundBundle(hasBackGround ? new FUBundleData(BUNDLE_AVATAR_BACKGROUND) : null);
}
}

View File

@@ -0,0 +1,145 @@
package com.yunbao.faceunity.repo;
import static android.content.Context.MODE_PRIVATE;
import android.content.SharedPreferences;
import com.faceunity.core.controller.bgSegGreen.BgSegGreenParam;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.model.bgSegGreen.BgSegGreen;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BgSegGreenBackgroundBean;
import com.yunbao.faceunity.entity.BgSegGreenBean;
import com.yunbao.faceunity.entity.BgSegGreenSafeAreaBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.FaceUnityData;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC绿幕抠像数据构造
* Created on 2021/3/25
*/
public class BgSegGreenSource {
private static final String GREEN_SAFE_AREA_CUSTOM = "green_safe_area_custom";
private static double SIMILARITY = 0.5;//相似度
private static double SMOOTHNESS = 0.3;//平滑度
private static double TRANSPARENCY = 0.67;//透明度
/**
* 构造绿幕抠像对象
*
* @return
*/
public static BgSegGreen buildBgSegGreen() {
BgSegGreen bgSegGreen = new BgSegGreen(new FUBundleData(FaceUnityConfig.BUNDLE_BG_SEG_GREEN));
bgSegGreen.setSimilarity(BgSegGreenSource.SIMILARITY);
bgSegGreen.setSmoothness(BgSegGreenSource.SMOOTHNESS);
bgSegGreen.setTransparency(BgSegGreenSource.TRANSPARENCY);
return bgSegGreen;
}
/**
* 获取模型属性扩展数据
*
* @return HashMap<String, ModelAttributeData>
*/
public static HashMap<String, ModelAttributeData> buildModelAttributeRange() {
HashMap<String, ModelAttributeData> params = new HashMap<String, ModelAttributeData>();
params.put(BgSegGreenParam.SIMILARITY, new ModelAttributeData(SIMILARITY, 0.0, 0.0, 1.0));
params.put(BgSegGreenParam.SMOOTHNESS, new ModelAttributeData(SMOOTHNESS, 0.0, 0.0, 1.0));
params.put(BgSegGreenParam.TRANSPARENCY, new ModelAttributeData(TRANSPARENCY, 0.0, 0.0, 1.0));
return params;
}
/**
* 绿幕抠像功能列表
*
* @return
*/
public static ArrayList<BgSegGreenBean> buildBgSegGreenAction() {
ArrayList<BgSegGreenBean> actions = new ArrayList<BgSegGreenBean>();
actions.add(new BgSegGreenBean(BgSegGreenParam.RGB_COLOR, R.string.bg_seg_green_key_color, R.drawable.icon_green_color_selector, R.drawable.icon_green_color_selector, BgSegGreenBean.ButtonType.NORMAL2_BUTTON));
actions.add(new BgSegGreenBean(BgSegGreenParam.SIMILARITY, R.string.bg_seg_green_similarity, R.drawable.icon_green_similarityr_close_selector, R.drawable.icon_green_similarityr_open_selector, BgSegGreenBean.ButtonType.NORMAL1_BUTTON));
actions.add(new BgSegGreenBean(BgSegGreenParam.SMOOTHNESS, R.string.bg_seg_green_smooth, R.drawable.icon_green_smooth_close_selector, R.drawable.icon_green_similarityr_open_selector, BgSegGreenBean.ButtonType.NORMAL1_BUTTON));
actions.add(new BgSegGreenBean(BgSegGreenParam.TRANSPARENCY, R.string.bg_seg_green_alpha, R.drawable.icon_green_transparency_close_selector, R.drawable.icon_green_transparency_open_selector, BgSegGreenBean.ButtonType.NORMAL1_BUTTON));
actions.add(new BgSegGreenBean("", R.string.bg_seg_green_safe_area, R.drawable.icon_green_safe_area_close_selector, R.drawable.icon_green_safe_area_open_selector, BgSegGreenBean.ButtonType.SWITCH_BUTTON));
return actions;
}
/**
* 绿幕抠像安全区域功能列表
*
* @return
*/
public static ArrayList<BgSegGreenSafeAreaBean> buildBgSegGreenSafeArea() {
String fileDir = "bg_seg_green" + File.separator + "sample" + File.separator;
ArrayList<BgSegGreenSafeAreaBean> safeAreaBeans = new ArrayList<BgSegGreenSafeAreaBean>();
safeAreaBeans.add(new BgSegGreenSafeAreaBean(R.mipmap.icon_control_return, BgSegGreenSafeAreaBean.ButtonType.BACK_BUTTON));//返回
safeAreaBeans.add(new BgSegGreenSafeAreaBean(R.mipmap.icon_control_none, BgSegGreenSafeAreaBean.ButtonType.NONE_BUTTON));//不选
safeAreaBeans.add(new BgSegGreenSafeAreaBean(R.mipmap.icon_control_square_add, BgSegGreenSafeAreaBean.ButtonType.NORMAL2_BUTTON));//自定义
BgSegGreenSafeAreaBean customerBean = buildSafeAreaCustomBean(getCachePortraitSegment());
if (customerBean != null) {
safeAreaBeans.add(customerBean);
}
safeAreaBeans.add(new BgSegGreenSafeAreaBean(R.mipmap.icon_green_safe_area1, BgSegGreenSafeAreaBean.ButtonType.NORMAL1_BUTTON,fileDir + "safe_area1.jpg"));//区域一
safeAreaBeans.add(new BgSegGreenSafeAreaBean(R.mipmap.icon_green_safe_area2, BgSegGreenSafeAreaBean.ButtonType.NORMAL1_BUTTON,fileDir + "safe_area2.jpg"));//区域二
return safeAreaBeans;
}
/**
* 构造自定义安全区域图片
*
* @param path
* @return
*/
public static BgSegGreenSafeAreaBean buildSafeAreaCustomBean(String path) {
if (path != null && path.trim().length() > 0 && new File(path).exists()) {
saveCachePortraitSegment(path);
return new BgSegGreenSafeAreaBean(0, BgSegGreenSafeAreaBean.ButtonType.NORMAL1_BUTTON, path,false);
}
return null;
}
/**
* 绿幕抠像背景列表
*
* @return
*/
public static ArrayList<BgSegGreenBackgroundBean> buildBgSegGreenBackground() {
ArrayList<BgSegGreenBackgroundBean> backgroundBeans = new ArrayList<>();
String fileDir = "bg_seg_green" + File.separator + "sample" + File.separator;
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.cancel, R.mipmap.icon_control_none, null));
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.bg_seg_green_science, R.mipmap.icon_green_science, fileDir + "science.mp4"));
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.bg_seg_green_beach, R.mipmap.icon_green_bg_beach, fileDir + "beach.mp4"));
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.bg_seg_green_classroom, R.mipmap.icon_green_bg_classroom, fileDir + "classroom.mp4"));
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.bg_seg_green_ink, R.mipmap.icon_green_ink_painting, fileDir + "ink_painting.mp4"));
backgroundBeans.add(new BgSegGreenBackgroundBean(R.string.bg_seg_green_forest, R.mipmap.icon_green_bg_forest, fileDir + "forest.mp4"));
return backgroundBeans;
}
/**
* 缓存自定义安全区域图片
*
* @param path
*/
public static void saveCachePortraitSegment(String path) {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(GREEN_SAFE_AREA_CUSTOM, MODE_PRIVATE);
sp.edit().putString(GREEN_SAFE_AREA_CUSTOM, path).apply();
}
/**
* 获取自定义安全区域图片
*
* @return
*/
public static String getCachePortraitSegment() {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(GREEN_SAFE_AREA_CUSTOM, MODE_PRIVATE);
return sp.getString(GREEN_SAFE_AREA_CUSTOM, "");
}
}

View File

@@ -0,0 +1,56 @@
package com.yunbao.faceunity.repo;
import com.faceunity.core.controller.bodyBeauty.BodyBeautyParam;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.BodyBeautyBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC美体数据构造
* Created on 2021/3/26
*/
public class BodyBeautySource {
public static final String BUNDLE_BODY_BEAUTY = "graphics" + File.separator + "body_slim.bundle";
/**
* 构造美体
*
* @return
*/
public static ArrayList<BodyBeautyBean> buildBodyBeauty() {
ArrayList<BodyBeautyBean> params = new ArrayList<>();
params.add(new BodyBeautyBean(BodyBeautyParam.BODY_SLIM_INTENSITY, R.string.slimming, R.drawable.icon_body_slimming_close_selector, R.drawable.icon_body_slimming_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.LEG_STRETCH_INTENSITY, R.string.long_legs, R.drawable.icon_body_stovepipe_close_selector, R.drawable.icon_body_stovepipe_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.WAIST_SLIM_INTENSITY, R.string.thin_waist, R.drawable.icon_body_waist_close_selector, R.drawable.icon_body_waist_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.SHOULDER_SLIM_INTENSITY, R.string.beautify_shoulder, R.drawable.icon_body_shoulder_close_selector, R.drawable.icon_body_shoulder_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.HIP_SLIM_INTENSITY, R.string.beautify_hip_slim, R.drawable.icon_body_hip_close_selector, R.drawable.icon_body_hip_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.HEAD_SLIM_INTENSITY, R.string.beautify_head_slim, R.drawable.icon_body_little_head_close_selector, R.drawable.icon_body_little_head_open_selector));
params.add(new BodyBeautyBean(BodyBeautyParam.LEG_SLIM_INTENSITY, R.string.beautify_leg_thin_slim, R.drawable.icon_body_thin_leg_close_selector, R.drawable.icon_body_thin_leg_open_selector));
return params;
}
/**
* 获取模型属性扩展数据
*
* @return HashMap<String, ModelAttributeData>
*/
public static HashMap<String, ModelAttributeData> buildModelAttributeRange() {
HashMap<String, ModelAttributeData> params = new HashMap<>();
params.put(BodyBeautyParam.BODY_SLIM_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(BodyBeautyParam.LEG_STRETCH_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(BodyBeautyParam.WAIST_SLIM_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(BodyBeautyParam.SHOULDER_SLIM_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(BodyBeautyParam.HIP_SLIM_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(BodyBeautyParam.HEAD_SLIM_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(BodyBeautyParam.LEG_SLIM_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
return params;
}
}

View File

@@ -0,0 +1,761 @@
package com.yunbao.faceunity.repo;
import com.faceunity.core.controller.facebeauty.FaceBeautyParam;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.enumeration.FUFaceBeautyMultiModePropertyEnum;
import com.faceunity.core.enumeration.FUFaceBeautyPropertyModeEnum;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.facebeauty.FaceBeauty;
import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.data.FaceBeautyData;
import com.yunbao.faceunity.data.FaceBeautyDataFactory;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.entity.FaceBeautyBean;
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
import com.yunbao.faceunity.entity.FaceBeautyStyleBean;
import com.yunbao.faceunity.entity.ModelAttributeData;
import com.yunbao.faceunity.utils.FUUtils;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.FuDeviceUtils;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC美颜数据构造
* Created on 2021/3/27
*/
public class FaceBeautySource {
private static ArrayList<FaceBeautyFilterBean> filters = new ArrayList<>();
private static FaceBeautyData faceBeautyData;
/**
* 获取默认推荐美颜模型
* 一个app生命周期请求一次
*
* @return
*/
public static FaceBeauty getDefaultFaceBeauty() {
FaceBeauty recommendFaceBeauty = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
if (FaceUnityConfig.OPEN_FACE_BEAUTY_TO_FILE)
faceBeautyData = FUUtils.loadFaceBeautyData();
if (faceBeautyData != null) {
//有本地缓存
FaceBeautyDataFactory.setDiskCurrentStyleIndex(faceBeautyData.styleTypeIndex);
FUUtils.setFaceBeauty(faceBeautyData, recommendFaceBeauty);
} else {
//没有本地缓存
recommendFaceBeauty.setFilterName(FaceBeautyFilterEnum.ZIRAN_2);
recommendFaceBeauty.setFilterIntensity(0.4);
/*美肤*/
recommendFaceBeauty.setSharpenIntensity(0.2);
recommendFaceBeauty.setColorIntensity(0.3);
recommendFaceBeauty.setRedIntensity(0.3);
recommendFaceBeauty.setBlurIntensity(4.2);
/*美型*/
recommendFaceBeauty.setFaceShapeIntensity(1.0);
recommendFaceBeauty.setEyeEnlargingIntensity(0.4);
recommendFaceBeauty.setCheekVIntensity(0.5);
recommendFaceBeauty.setNoseIntensity(0.5);
recommendFaceBeauty.setForHeadIntensity(0.3);
recommendFaceBeauty.setMouthIntensity(0.4);
recommendFaceBeauty.setChinIntensity(0.3);
//性能最优策略
if (FaceUnityConfig.DEVICE_LEVEL > FuDeviceUtils.DEVICE_LEVEL_MID) {
setFaceBeautyPropertyMode(recommendFaceBeauty);
}
}
return recommendFaceBeauty;
}
/**
* 高端机的时候开启4个相对吃性能的模式
* 1.祛黑眼圈 MODE2
* 2.祛法令纹 MODE2
* 3.大眼 MODE3
* 4.嘴型 MODE3
*/
private static void setFaceBeautyPropertyMode(FaceBeauty faceBeauty) {
/*
* 多模式属性
* 属性名称|支持模式|默认模式|最早支持版本
* 美白 colorIntensity|MODE1 MODE2|MODE2|MODE2 8.2.0;
* 祛黑眼圈 removePouchIntensity|MODE1 MODE2|MODE2|MODE2 8.2.0;
* 祛法令纹 removeLawPatternIntensity|MODE1 MODE1|MODE2|MODE2 8.2.0;
* 窄脸程度 cheekNarrowIntensity|MODE1 MODE2|MODE2|MODE2 8.0.0;
* 小脸程度 cheekSmallIntensity|MODE1 MODE2|MODE2|MODE2 8.0.0;
* 大眼程度 eyeEnlargingIntensity|MODE1 MODE2 MODE3|MODE3|MODE2 8.0.0;MODE3 8.2.0;
* 额头调整程度 forHeadIntensity|MODE1 MODE2|MODE2|MODE2 8.0.0;
* 瘦鼻程度 noseIntensity|MODE1 MODE2|MODE2|MODE2 8.0.0;
* 嘴巴调整程度 mouthIntensity|MODE1 MODE2 MODE3|MODE3|MODE2 8.0.0;MODE3 8.2.0;
*/
faceBeauty.addPropertyMode(FUFaceBeautyMultiModePropertyEnum.REMOVE_POUCH_INTENSITY, FUFaceBeautyPropertyModeEnum.MODE2);
faceBeauty.addPropertyMode(FUFaceBeautyMultiModePropertyEnum.REMOVE_NASOLABIAL_FOLDS_INTENSITY, FUFaceBeautyPropertyModeEnum.MODE2);
faceBeauty.addPropertyMode(FUFaceBeautyMultiModePropertyEnum.EYE_ENLARGING_INTENSITY, FUFaceBeautyPropertyModeEnum.MODE3);
faceBeauty.addPropertyMode(FUFaceBeautyMultiModePropertyEnum.MOUTH_INTENSITY, FUFaceBeautyPropertyModeEnum.MODE3);
}
/**
* 初始化美肤参数
*
* @return ArrayList<FaceBeautyBean>
*/
public static ArrayList<FaceBeautyBean> buildSkinParams() {
ArrayList<FaceBeautyBean> params = new ArrayList<>();
params.add(new FaceBeautyBean(
FaceBeautyParam.BLUR_INTENSITY
, R.string.beauty_box_heavy_blur_fine
, R.drawable.icon_beauty_skin_buffing_close_selector
, R.drawable.icon_beauty_skin_buffing_open_selector
, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.COLOR_INTENSITY, R.string.beauty_box_color_level,
R.drawable.icon_beauty_skin_color_close_selector, R.drawable.icon_beauty_skin_color_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.RED_INTENSITY, R.string.beauty_box_red_level,
R.drawable.icon_beauty_skin_red_close_selector, R.drawable.icon_beauty_skin_red_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.SHARPEN_INTENSITY, R.string.beauty_box_sharpen,
R.drawable.icon_beauty_skin_sharpen_close_selector, R.drawable.icon_beauty_skin_sharpen_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.EYE_BRIGHT_INTENSITY, R.string.beauty_box_eye_bright,
R.drawable.icon_beauty_skin_eyes_bright_close_selector, R.drawable.icon_beauty_skin_eyes_bright_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.TOOTH_WHITEN_INTENSITY, R.string.beauty_box_tooth_whiten,
R.drawable.icon_beauty_skin_teeth_close_selector, R.drawable.icon_beauty_skin_teeth_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.REMOVE_POUCH_INTENSITY, R.string.beauty_micro_pouch,
R.drawable.icon_beauty_skin_dark_circles_close_selector, R.drawable.icon_beauty_skin_dark_circles_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, R.string.beauty_micro_nasolabial,
R.drawable.icon_beauty_skin_wrinkle_close_selector, R.drawable.icon_beauty_skin_wrinkle_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SKIN)
);
return params;
}
/**
* 初始化美型参数
*
* @return ArrayList<FaceBeautyBean>
*/
public static ArrayList<FaceBeautyBean> buildShapeParams() {
ArrayList<FaceBeautyBean> params = new ArrayList<>();
// params.add(
// new FaceBeautyBean(
// "", R.string.avatar_face_face,
// R.drawable.icon_beauty_shape_face_shape_close_selector, R.drawable.icon_beauty_shape_face_shape_open_selector, FaceBeautyBean.ButtonType.SUB_ITEM_BUTTON
// )
// );
//瘦脸
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHEEK_THINNING_INTENSITY, R.string.beauty_box_cheek_thinning,
R.drawable.icon_beauty_shape_face_cheekthin_close_selector, R.drawable.icon_beauty_shape_face_cheekthin_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
//V脸
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHEEK_V_INTENSITY, R.string.beauty_box_cheek_v,
R.drawable.icon_beauty_shape_face_v_close_selector, R.drawable.icon_beauty_shape_face_v_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
//窄脸
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHEEK_NARROW_INTENSITY, R.string.beauty_box_cheek_narrow,
R.drawable.icon_beauty_shape_face_narrow_close_selector, R.drawable.icon_beauty_shape_face_narrow_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
//小脸 -> 短脸 --使用的参数是以前小脸的
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHEEK_SHORT_INTENSITY, R.string.beauty_box_cheek_short,
R.drawable.icon_beauty_shape_face_short_close_selector, R.drawable.icon_beauty_shape_face_short_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
//小脸 -> 新增
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHEEK_SMALL_INTENSITY, R.string.beauty_box_cheek_small,
R.drawable.icon_beauty_shape_face_little_close_selector, R.drawable.icon_beauty_shape_face_little_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, R.string.beauty_box_cheekbones,
R.drawable.icon_beauty_shape_cheek_bones_close_selector, R.drawable.icon_beauty_shape_cheek_bones_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, R.string.beauty_box_lower_jaw,
R.drawable.icon_beauty_shape_lower_jaw_close_selector, R.drawable.icon_beauty_shape_lower_jaw_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.EYE_ENLARGING_INTENSITY, R.string.beauty_box_eye_enlarge,
R.drawable.icon_beauty_shape_enlarge_eye_close_selector, R.drawable.icon_beauty_shape_enlarge_eye_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.EYE_CIRCLE_INTENSITY, R.string.beauty_box_eye_circle,
R.drawable.icon_beauty_shape_round_eye_close_selector, R.drawable.icon_beauty_shape_round_eye_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.CHIN_INTENSITY, R.string.beauty_box_intensity_chin,
R.drawable.icon_beauty_shape_chin_close_selector, R.drawable.icon_beauty_shape_chin_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.FOREHEAD_INTENSITY, R.string.beauty_box_intensity_forehead,
R.drawable.icon_beauty_shape_forehead_close_selector, R.drawable.icon_beauty_shape_forehead_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.NOSE_INTENSITY, R.string.beauty_box_intensity_nose,
R.drawable.icon_beauty_shape_thin_nose_close_selector, R.drawable.icon_beauty_shape_thin_nose_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.MOUTH_INTENSITY, R.string.beauty_box_intensity_mouth,
R.drawable.icon_beauty_shape_mouth_close_selector, R.drawable.icon_beauty_shape_mouth_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.CANTHUS_INTENSITY, R.string.beauty_micro_canthus,
R.drawable.icon_beauty_shape_open_eyes_close_selector, R.drawable.icon_beauty_shape_open_eyes_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.EYE_SPACE_INTENSITY, R.string.beauty_micro_eye_space,
R.drawable.icon_beauty_shape_distance_close_selector, R.drawable.icon_beauty_shape_distance_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.EYE_ROTATE_INTENSITY, R.string.beauty_micro_eye_rotate,
R.drawable.icon_beauty_shape_angle_close_selector, R.drawable.icon_beauty_shape_angle_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.LONG_NOSE_INTENSITY, R.string.beauty_micro_long_nose,
R.drawable.icon_beauty_shape_proboscis_close_selector, R.drawable.icon_beauty_shape_proboscis_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.PHILTRUM_INTENSITY, R.string.beauty_micro_philtrum,
R.drawable.icon_beauty_shape_shrinking_close_selector, R.drawable.icon_beauty_shape_shrinking_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.SMILE_INTENSITY, R.string.beauty_micro_smile,
R.drawable.icon_beauty_shape_smile_close_selector, R.drawable.icon_beauty_shape_smile_open_selector, 0
, true,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.BROW_HEIGHT_INTENSITY,
R.string.beauty_brow_height,
R.drawable.icon_beauty_shape_brow_height_close_selector,
R.drawable.icon_beauty_shape_brow_height_open_selector,
R.string.brow_height_tips,
FaceUnityConfig.DEVICE_LEVEL > FuDeviceUtils.DEVICE_LEVEL_MID,
FaceParam.FACE_BEAUTY_SHAPE
)
);
params.add(
new FaceBeautyBean(
FaceBeautyParam.BROW_SPACE_INTENSITY, R.string.beauty_brow_space,
R.drawable.icon_beauty_shape_brow_space_close_selector, R.drawable.icon_beauty_shape_brow_space_open_selector,
R.string.brow_space_tips, FaceUnityConfig.DEVICE_LEVEL > FuDeviceUtils.DEVICE_LEVEL_MID,
FaceParam.FACE_BEAUTY_SHAPE
)
);
return params;
}
/**
* 加载脸型子项
*
* @return
*/
public static ArrayList<FaceBeautyBean> buildFaceShapeSubItemParams() {
return buildSubItemParams(FaceBeautyParam.FACE_SHAPE);
}
public static ArrayList<FaceBeautyBean> buildSubItemParams(String key) {
ArrayList<FaceBeautyBean> params = new ArrayList<>();
// if (key != null && !key.isEmpty()) {
// if (key.equals(FaceBeautyParam.FACE_SHAPE)) {
// //返回
// params.add(
// new FaceBeautyBean(
// "", R.string.back,
// R.mipmap.icon_beauty_back, R.mipmap.icon_beauty_back, FaceBeautyBean.ButtonType.BACK_BUTTON
// )
// );
//
// //自然 V脸 -> 自然脸
// params.add(
// new FaceBeautyBean(
// FaceBeautyParam.CHEEK_V_INTENSITY, R.string.beauty_box_cheek_natural,
// R.drawable.icon_beauty_shape_face_natural_close_selector, R.drawable.icon_beauty_shape_face_natural_open_selector
// )
// );
//
// //女神 瘦脸 -> 女神脸
// params.add(
// new FaceBeautyBean(
// FaceBeautyParam.CHEEK_THINNING_INTENSITY, R.string.beauty_box_cheek_goddess,
// R.drawable.icon_beauty_shape_face_goddess_close_selector, R.drawable.icon_beauty_shape_face_goddess_open_selector
// )
// );
//
// //长脸
// params.add(
// new FaceBeautyBean(
// FaceBeautyParam.CHEEK_LONG_INTENSITY, R.string.beauty_box_cheek_long_face,
// R.drawable.icon_beauty_shape_face_long_close_selector, R.drawable.icon_beauty_shape_face_long_open_selector
// )
// );
//
// //圆脸
// params.add(
// new FaceBeautyBean(
// FaceBeautyParam.CHEEK_CIRCLE_INTENSITY, R.string.beauty_box_cheek_round_face,
// R.drawable.icon_beauty_shape_face_round_close_selector, R.drawable.icon_beauty_shape_face_round_open_selector
// )
// );
// }
// }
return params;
}
/**
* 初始化参数扩展列表
*
* @return HashMap<String, ModelAttributeData>
*/
public static HashMap<String, ModelAttributeData> buildModelAttributeRange() {
HashMap<String, ModelAttributeData> params = new HashMap<>();
/*美肤*/
params.put(FaceBeautyParam.COLOR_INTENSITY, new ModelAttributeData(0.3, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.BLUR_INTENSITY, new ModelAttributeData(4.2, 0.0, 0.0, 6.0));
params.put(FaceBeautyParam.RED_INTENSITY, new ModelAttributeData(0.3, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.SHARPEN_INTENSITY, new ModelAttributeData(0.2, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.EYE_BRIGHT_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.TOOTH_WHITEN_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.REMOVE_POUCH_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.REMOVE_NASOLABIAL_FOLDS_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
/*美型*/
params.put(FaceBeautyParam.FACE_SHAPE_INTENSITY, new ModelAttributeData(1.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_THINNING_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_LONG_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_CIRCLE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_V_INTENSITY, new ModelAttributeData(0.5, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_NARROW_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_SHORT_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHEEK_SMALL_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.INTENSITY_CHEEKBONES_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.INTENSITY_LOW_JAW_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.EYE_ENLARGING_INTENSITY, new ModelAttributeData(0.4, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.EYE_CIRCLE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.CHIN_INTENSITY, new ModelAttributeData(0.3, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.FOREHEAD_INTENSITY, new ModelAttributeData(0.3, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.NOSE_INTENSITY, new ModelAttributeData(0.5, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.MOUTH_INTENSITY, new ModelAttributeData(0.4, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.CANTHUS_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.EYE_SPACE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.EYE_ROTATE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.LONG_NOSE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.PHILTRUM_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.SMILE_INTENSITY, new ModelAttributeData(0.0, 0.0, 0.0, 1.0));
params.put(FaceBeautyParam.BROW_HEIGHT_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
params.put(FaceBeautyParam.BROW_SPACE_INTENSITY, new ModelAttributeData(0.5, 0.5, 0.0, 1.0));
return params;
}
/**
* 初始化滤镜参数
*
* @return ArrayList<FaceBeautyFilterBean>
*/
public static ArrayList<FaceBeautyFilterBean> buildFilters() {
if (!filters.isEmpty()) {
return filters;
}
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ORIGIN, R.mipmap.icon_beauty_filter_cancel, R.string.origin, 0.0));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_1, R.mipmap.icon_beauty_filter_natural_1, R.string.ziran_1, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_2, R.mipmap.icon_beauty_filter_natural_2, R.string.ziran_2, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_3, R.mipmap.icon_beauty_filter_natural_3, R.string.ziran_3, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_4, R.mipmap.icon_beauty_filter_natural_4, R.string.ziran_4, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_5, R.mipmap.icon_beauty_filter_natural_5, R.string.ziran_5, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_6, R.mipmap.icon_beauty_filter_natural_6, R.string.ziran_6, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_7, R.mipmap.icon_beauty_filter_natural_7, R.string.ziran_7, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZIRAN_8, R.mipmap.icon_beauty_filter_natural_8, R.string.ziran_8, getDiskFilterValue(FaceBeautyFilterEnum.ZIRAN_8)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_1, R.mipmap.icon_beauty_filter_texture_gray_1, R.string.zhiganhui_1, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_2, R.mipmap.icon_beauty_filter_texture_gray_2, R.string.zhiganhui_2, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_3, R.mipmap.icon_beauty_filter_texture_gray_3, R.string.zhiganhui_3, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_4, R.mipmap.icon_beauty_filter_texture_gray_4, R.string.zhiganhui_4, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_5, R.mipmap.icon_beauty_filter_texture_gray_5, R.string.zhiganhui_5, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_6, R.mipmap.icon_beauty_filter_texture_gray_6, R.string.zhiganhui_6, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_7, R.mipmap.icon_beauty_filter_texture_gray_7, R.string.zhiganhui_7, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.ZHIGANHUI_8, R.mipmap.icon_beauty_filter_texture_gray_8, R.string.zhiganhui_8, getDiskFilterValue(FaceBeautyFilterEnum.ZHIGANHUI_8)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_1, R.mipmap.icon_beauty_filter_peach_1, R.string.mitao_1, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_2, R.mipmap.icon_beauty_filter_peach_2, R.string.mitao_2, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_3, R.mipmap.icon_beauty_filter_peach_3, R.string.mitao_3, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_4, R.mipmap.icon_beauty_filter_peach_4, R.string.mitao_4, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_5, R.mipmap.icon_beauty_filter_peach_5, R.string.mitao_5, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_6, R.mipmap.icon_beauty_filter_peach_6, R.string.mitao_6, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_7, R.mipmap.icon_beauty_filter_peach_7, R.string.mitao_7, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.MITAO_8, R.mipmap.icon_beauty_filter_peach_8, R.string.mitao_8, getDiskFilterValue(FaceBeautyFilterEnum.MITAO_8)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_1, R.mipmap.icon_beauty_filter_bailiang_1, R.string.bailiang_1, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_2, R.mipmap.icon_beauty_filter_bailiang_2, R.string.bailiang_2, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_3, R.mipmap.icon_beauty_filter_bailiang_3, R.string.bailiang_3, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_4, R.mipmap.icon_beauty_filter_bailiang_4, R.string.bailiang_4, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_5, R.mipmap.icon_beauty_filter_bailiang_5, R.string.bailiang_5, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_6, R.mipmap.icon_beauty_filter_bailiang_6, R.string.bailiang_6, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.BAILIANG_7, R.mipmap.icon_beauty_filter_bailiang_7, R.string.bailiang_7, getDiskFilterValue(FaceBeautyFilterEnum.BAILIANG_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_1, R.mipmap.icon_beauty_filter_fennen_1, R.string.fennen_1, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_2, R.mipmap.icon_beauty_filter_fennen_2, R.string.fennen_2, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_3, R.mipmap.icon_beauty_filter_fennen_3, R.string.fennen_3, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_5, R.mipmap.icon_beauty_filter_fennen_5, R.string.fennen_5, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_6, R.mipmap.icon_beauty_filter_fennen_6, R.string.fennen_6, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_7, R.mipmap.icon_beauty_filter_fennen_7, R.string.fennen_7, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.FENNEN_8, R.mipmap.icon_beauty_filter_fennen_8, R.string.fennen_8, getDiskFilterValue(FaceBeautyFilterEnum.FENNEN_8)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_1, R.mipmap.icon_beauty_filter_lengsediao_1, R.string.lengsediao_1, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_2, R.mipmap.icon_beauty_filter_lengsediao_2, R.string.lengsediao_2, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_3, R.mipmap.icon_beauty_filter_lengsediao_3, R.string.lengsediao_3, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_4, R.mipmap.icon_beauty_filter_lengsediao_4, R.string.lengsediao_4, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_7, R.mipmap.icon_beauty_filter_lengsediao_7, R.string.lengsediao_7, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_8, R.mipmap.icon_beauty_filter_lengsediao_8, R.string.lengsediao_8, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_8)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.LENGSEDIAO_11, R.mipmap.icon_beauty_filter_lengsediao_11, R.string.lengsediao_11, getDiskFilterValue(FaceBeautyFilterEnum.LENGSEDIAO_11)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.NUANSEDIAO_1, R.mipmap.icon_beauty_filter_nuansediao_1, R.string.nuansediao_1, getDiskFilterValue(FaceBeautyFilterEnum.NUANSEDIAO_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.NUANSEDIAO_2, R.mipmap.icon_beauty_filter_nuansediao_2, R.string.nuansediao_2, getDiskFilterValue(FaceBeautyFilterEnum.NUANSEDIAO_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_1, R.mipmap.icon_beauty_filter_gexing_1, R.string.gexing_1, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_2, R.mipmap.icon_beauty_filter_gexing_2, R.string.gexing_2, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_3, R.mipmap.icon_beauty_filter_gexing_3, R.string.gexing_3, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_4, R.mipmap.icon_beauty_filter_gexing_4, R.string.gexing_4, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_5, R.mipmap.icon_beauty_filter_gexing_5, R.string.gexing_5, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_5)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_7, R.mipmap.icon_beauty_filter_gexing_7, R.string.gexing_7, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_7)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_10, R.mipmap.icon_beauty_filter_gexing_10, R.string.gexing_10, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_10)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.GEXING_11, R.mipmap.icon_beauty_filter_gexing_11, R.string.gexing_11, getDiskFilterValue(FaceBeautyFilterEnum.GEXING_11)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.XIAOQINGXIN_1, R.mipmap.icon_beauty_filter_xiaoqingxin_1, R.string.xiaoqingxin_1, getDiskFilterValue(FaceBeautyFilterEnum.XIAOQINGXIN_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.XIAOQINGXIN_3, R.mipmap.icon_beauty_filter_xiaoqingxin_3, R.string.xiaoqingxin_3, getDiskFilterValue(FaceBeautyFilterEnum.XIAOQINGXIN_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.XIAOQINGXIN_4, R.mipmap.icon_beauty_filter_xiaoqingxin_4, R.string.xiaoqingxin_4, getDiskFilterValue(FaceBeautyFilterEnum.XIAOQINGXIN_4)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.XIAOQINGXIN_6, R.mipmap.icon_beauty_filter_xiaoqingxin_6, R.string.xiaoqingxin_6, getDiskFilterValue(FaceBeautyFilterEnum.XIAOQINGXIN_6)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.HEIBAI_1, R.mipmap.icon_beauty_filter_heibai_1, R.string.heibai_1, getDiskFilterValue(FaceBeautyFilterEnum.HEIBAI_1)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.HEIBAI_2, R.mipmap.icon_beauty_filter_heibai_2, R.string.heibai_2, getDiskFilterValue(FaceBeautyFilterEnum.HEIBAI_2)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.HEIBAI_3, R.mipmap.icon_beauty_filter_heibai_3, R.string.heibai_3, getDiskFilterValue(FaceBeautyFilterEnum.HEIBAI_3)));
filters.add(new FaceBeautyFilterBean(FaceBeautyFilterEnum.HEIBAI_4, R.mipmap.icon_beauty_filter_heibai_4, R.string.heibai_4, getDiskFilterValue(FaceBeautyFilterEnum.HEIBAI_4)));
return filters;
}
/**
* 从磁盘获取所有项滤镜强度
*
* @param key
* @return
*/
private static double getDiskFilterValue(String key) {
if (faceBeautyData != null) {
return faceBeautyData.filterMap.get(key);
} else {
return 0.4;
}
}
private static final String CONFIG_BIAOZHUN = "biaozhun";
private static final String CONFIG_HUAJIAO = "huajiao";
private static final String CONFIG_KUAISHOU = "kuaishou";
private static final String CONFIG_QINGYAN = "qingyan";
private static final String CONFIG_SHANGTANG = "shangtang";
private static final String CONFIG_YINGKE = "yingke";
private static final String CONFIG_ZIJIETIAODONG = "zijietiaodong";
/**
* 初始化风格推荐
*
* @return ArrayList<FaceBeautyBean>
*/
public static ArrayList<FaceBeautyStyleBean> buildStylesParams() {
ArrayList<FaceBeautyStyleBean> params = new ArrayList<>();
params.add(new FaceBeautyStyleBean(CONFIG_KUAISHOU, R.drawable.icon_beauty_style_1_selector, R.string.beauty_face_style_1,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_QINGYAN, R.drawable.icon_beauty_style_2_selector, R.string.beauty_face_style_2,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_ZIJIETIAODONG, R.drawable.icon_beauty_style_3_selector, R.string.beauty_face_style_3,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_HUAJIAO, R.drawable.icon_beauty_style_4_selector, R.string.beauty_face_style_4,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_YINGKE, R.drawable.icon_beauty_style_5_selector, R.string.beauty_face_style_5,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_SHANGTANG, R.drawable.icon_beauty_style_6_selector, R.string.beauty_face_style_6,FaceParam.FACE_BEAUTY_STYLE));
params.add(new FaceBeautyStyleBean(CONFIG_BIAOZHUN, R.drawable.icon_beauty_style_7_selector, R.string.beauty_face_style_7,FaceParam.FACE_BEAUTY_STYLE));
return params;
}
/**
* 风格对应参数配置
*/
public static HashMap<String, Runnable> styleParams = new HashMap<String, Runnable>() {
{
put(CONFIG_KUAISHOU, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setColorIntensity(0.5);
model.setBlurIntensity(3.6);
model.setEyeBrightIntensity(0.35);
model.setToothIntensity(0.25);
model.setCheekThinningIntensity(0.45);
model.setCheekVIntensity(0.08);
model.setCheekSmallIntensity(0.05);
model.setEyeEnlargingIntensity(0.3);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_QINGYAN, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setFilterName(FaceBeautyFilterEnum.ZIRAN_3);
model.setFilterIntensity(0.3);
model.setColorIntensity(0.4);
model.setRedIntensity(0.2);
model.setBlurIntensity(3.6);
model.setEyeBrightIntensity(0.5);
model.setToothIntensity(0.4);
model.setCheekThinningIntensity(0.3);
model.setNoseIntensity(0.5);
model.setEyeEnlargingIntensity(0.25);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_ZIJIETIAODONG, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setColorIntensity(0.4);
model.setRedIntensity(0.3);
model.setBlurIntensity(2.4);
model.setCheekThinningIntensity(0.3);
model.setCheekSmallIntensity(0.15);
model.setEyeEnlargingIntensity(0.65);
model.setNoseIntensity(0.3);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_HUAJIAO, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setColorIntensity(0.7);
model.setBlurIntensity(3.9);
model.setCheekThinningIntensity(0.3);
model.setCheekSmallIntensity(0.05);
model.setEyeEnlargingIntensity(0.65);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_YINGKE, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setFilterName(FaceBeautyFilterEnum.FENNEN_2);
model.setFilterIntensity(0.5);
model.setColorIntensity(0.6);
model.setBlurIntensity(3.0);
model.setCheekThinningIntensity(0.5);
model.setEyeEnlargingIntensity(0.65);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_SHANGTANG, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setFilterName(FaceBeautyFilterEnum.FENNEN_2);
model.setFilterIntensity(0.8);
model.setColorIntensity(0.7);
model.setBlurIntensity(4.2);
model.setEyeEnlargingIntensity(0.6);
model.setCheekThinningIntensity(0.3);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
put(CONFIG_BIAOZHUN, () -> {
FaceBeauty model = new FaceBeauty(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_BEAUTIFICATION));
model.setFaceShapeIntensity(1.0);
model.setFilterName(FaceBeautyFilterEnum.ZIRAN_5);
model.setFilterIntensity(0.55);
model.setColorIntensity(0.2);
model.setRedIntensity(0.65);
model.setBlurIntensity(3.3);
model.setCheekSmallIntensity(0.05);
model.setCheekThinningIntensity(0.1);
FaceBeautyDataFactory.faceBeauty = model;
FURenderKit.getInstance().setFaceBeauty(FaceBeautyDataFactory.faceBeauty);
});
}
};
/**
* 克隆模型
*
* @param faceBeauty
* @return
*/
public static FaceBeauty clone(FaceBeauty faceBeauty) {
FaceBeauty cloneFaceBeauty = new FaceBeauty(new FUBundleData(faceBeauty.getControlBundle().getPath()));
/*滤镜*/
cloneFaceBeauty.setFilterName(faceBeauty.getFilterName());
cloneFaceBeauty.setFilterIntensity(faceBeauty.getFilterIntensity());
/*美肤*/
cloneFaceBeauty.setBlurIntensity(faceBeauty.getBlurIntensity());
cloneFaceBeauty.setEnableHeavyBlur(faceBeauty.getEnableHeavyBlur());
cloneFaceBeauty.setEnableSkinDetect(faceBeauty.getEnableSkinDetect());
cloneFaceBeauty.setNonSkinBlurIntensity(faceBeauty.getNonSkinBlurIntensity());
cloneFaceBeauty.setBlurType(faceBeauty.getBlurType());
cloneFaceBeauty.setEnableBlurUseMask(faceBeauty.getEnableBlurUseMask());
cloneFaceBeauty.setColorIntensity(faceBeauty.getColorIntensity());
cloneFaceBeauty.setRedIntensity(faceBeauty.getRedIntensity());
cloneFaceBeauty.setSharpenIntensity(faceBeauty.getSharpenIntensity());
cloneFaceBeauty.setEyeBrightIntensity(faceBeauty.getEyeBrightIntensity());
cloneFaceBeauty.setToothIntensity(faceBeauty.getToothIntensity());
cloneFaceBeauty.setRemovePouchIntensity(faceBeauty.getRemovePouchIntensity());
cloneFaceBeauty.setRemoveLawPatternIntensity(faceBeauty.getRemoveLawPatternIntensity());
/*美型*/
cloneFaceBeauty.setFaceShape(faceBeauty.getFaceShape());
cloneFaceBeauty.setFaceShapeIntensity(faceBeauty.getFaceShapeIntensity());
cloneFaceBeauty.setCheekThinningIntensity(faceBeauty.getCheekThinningIntensity());
cloneFaceBeauty.setCheekVIntensity(faceBeauty.getCheekVIntensity());
cloneFaceBeauty.setCheekLongIntensity(faceBeauty.getCheekLongIntensity());
cloneFaceBeauty.setCheekCircleIntensity(faceBeauty.getCheekCircleIntensity());
cloneFaceBeauty.setCheekNarrowIntensity(faceBeauty.getCheekNarrowIntensity());
cloneFaceBeauty.setCheekShortIntensity(faceBeauty.getCheekShortIntensity());
cloneFaceBeauty.setCheekSmallIntensity(faceBeauty.getCheekSmallIntensity());
cloneFaceBeauty.setCheekBonesIntensity(faceBeauty.getCheekBonesIntensity());
cloneFaceBeauty.setLowerJawIntensity(faceBeauty.getLowerJawIntensity());
cloneFaceBeauty.setEyeEnlargingIntensity(faceBeauty.getEyeEnlargingIntensity());
cloneFaceBeauty.setChinIntensity(faceBeauty.getChinIntensity());
cloneFaceBeauty.setForHeadIntensity(faceBeauty.getForHeadIntensity());
cloneFaceBeauty.setNoseIntensity(faceBeauty.getNoseIntensity());
cloneFaceBeauty.setMouthIntensity(faceBeauty.getMouthIntensity());
cloneFaceBeauty.setCanthusIntensity(faceBeauty.getCanthusIntensity());
cloneFaceBeauty.setEyeSpaceIntensity(faceBeauty.getEyeSpaceIntensity());
cloneFaceBeauty.setEyeRotateIntensity(faceBeauty.getEyeRotateIntensity());
cloneFaceBeauty.setLongNoseIntensity(faceBeauty.getLongNoseIntensity());
cloneFaceBeauty.setPhiltrumIntensity(faceBeauty.getPhiltrumIntensity());
cloneFaceBeauty.setSmileIntensity(faceBeauty.getSmileIntensity());
cloneFaceBeauty.setEyeCircleIntensity(faceBeauty.getEyeCircleIntensity());
cloneFaceBeauty.setBrowHeightIntensity(faceBeauty.getBrowHeightIntensity());
cloneFaceBeauty.setBrowSpaceIntensity(faceBeauty.getBrowSpaceIntensity());
cloneFaceBeauty.setChangeFramesIntensity(faceBeauty.getChangeFramesIntensity());
return cloneFaceBeauty;
}
}

View File

@@ -0,0 +1,402 @@
package com.yunbao.faceunity.repo;
import android.content.Context;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
import com.faceunity.core.model.littleMakeup.LightMakeup;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.LightMakeupBean;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.FaceUnityData;
import com.yunbao.faceunity.utils.FileUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC轻美妆数据构造
* Created on 2021/3/27
*/
public class LightMakeupSource {
/**
* 构造轻美妆队列
*
* @return
*/
public static ArrayList<LightMakeupBean> buildLightMakeup() {
ArrayList<LightMakeupBean> makeups = new ArrayList<>();
makeups.add(new LightMakeupBean(R.string.makeup_radio_remove, R.mipmap.icon_control_none, null, 0.0, FaceBeautyFilterEnum.ZIRAN_2, 0.4));
/*桃花*/
makeups.add(new LightMakeupBean(R.string.makeup_peach_blossom, R.mipmap.icon_light_makeup_peachblossom, "taohua", 0.9, FaceBeautyFilterEnum.FENNEN_3, 0.9));
/*西柚*/
makeups.add(new LightMakeupBean(R.string.makeup_grapefruit, R.mipmap.icon_light_makeup_grapefruit, "xiyou", 1.0, FaceBeautyFilterEnum.LENGSEDIAO_4, 1.0));
/*清透*/
makeups.add(new LightMakeupBean(R.string.makeup_clear, R.mipmap.icon_light_makeup_clear, "qingtou", 0.9, FaceBeautyFilterEnum.XIAOQINGXIN_1, 0.9));
/*男友*/
makeups.add(new LightMakeupBean(R.string.makeup_boyfriend, R.mipmap.icon_light_makeup_boyfriend, "nanyou", 1.0, FaceBeautyFilterEnum.XIAOQINGXIN_3, 1.0));
return makeups;
}
/**
* 风格对应参数配置
*/
public static HashMap<String, Runnable> LightMakeupParams = new HashMap<String, Runnable>() {
{
put("taohua", () -> {
LightMakeup lightMakeup = new LightMakeup(new FUBundleData(FaceUnityConfig.BUNDLE_LIGHT_MAKEUP));
lightMakeup.setBlusherTex(LightMakeUpEnum.MAKEUP_BLUSHER_01.path);
lightMakeup.setBlusherIntensity(0.9);
lightMakeup.setEyeShadowTex(LightMakeUpEnum.MAKEUP_EYE_SHADOW_01.path);
lightMakeup.setEyeShadowIntensity(0.9);
lightMakeup.setEyeBrowTex(LightMakeUpEnum.MAKEUP_EYEBROW_01.path);
lightMakeup.setEyeBrowIntensity(0.5);
lightMakeup.setLipColor(LightMakeUpEnum.MAKEUP_LIPSTICK_01.getLipColorRGBData());
lightMakeup.setLipIntensity(0.9);
FURenderKit.getInstance().setLightMakeup(lightMakeup);
});
put("xiyou", () -> {
LightMakeup lightMakeup = new LightMakeup(new FUBundleData(FaceUnityConfig.BUNDLE_LIGHT_MAKEUP));
lightMakeup.setBlusherTex(LightMakeUpEnum.MAKEUP_BLUSHER_23.path);
lightMakeup.setBlusherIntensity(1.0);
lightMakeup.setEyeShadowTex(LightMakeUpEnum.MAKEUP_EYE_SHADOW_21.path);
lightMakeup.setEyeShadowIntensity(0.75);
lightMakeup.setEyeBrowTex(LightMakeUpEnum.MAKEUP_EYEBROW_19.path);
lightMakeup.setEyeBrowIntensity(0.6);
lightMakeup.setLipColor(LightMakeUpEnum.MAKEUP_LIPSTICK_21.getLipColorRGBData());
lightMakeup.setLipIntensity(0.8);
FURenderKit.getInstance().setLightMakeup(lightMakeup);
});
put("qingtou", () -> {
LightMakeup lightMakeup = new LightMakeup(new FUBundleData(FaceUnityConfig.BUNDLE_LIGHT_MAKEUP));
lightMakeup.setBlusherTex(LightMakeUpEnum.MAKEUP_BLUSHER_22.path);
lightMakeup.setBlusherIntensity(0.9);
lightMakeup.setEyeShadowTex(LightMakeUpEnum.MAKEUP_EYE_SHADOW_20.path);
lightMakeup.setEyeShadowIntensity(0.65);
lightMakeup.setEyeBrowTex(LightMakeUpEnum.MAKEUP_EYEBROW_18.path);
lightMakeup.setEyeBrowIntensity(0.45);
lightMakeup.setLipColor(LightMakeUpEnum.MAKEUP_LIPSTICK_20.getLipColorRGBData());
lightMakeup.setLipIntensity(0.8);
FURenderKit.getInstance().setLightMakeup(lightMakeup);
});
put("nanyou", () -> {
LightMakeup lightMakeup = new LightMakeup(new FUBundleData(FaceUnityConfig.BUNDLE_LIGHT_MAKEUP));
lightMakeup.setBlusherTex(LightMakeUpEnum.MAKEUP_BLUSHER_20.path);
lightMakeup.setBlusherIntensity(0.8);
lightMakeup.setEyeShadowTex(LightMakeUpEnum.MAKEUP_EYE_SHADOW_18.path);
lightMakeup.setEyeShadowIntensity(0.9);
lightMakeup.setEyeBrowTex(LightMakeUpEnum.MAKEUP_EYEBROW_16.path);
lightMakeup.setEyeBrowIntensity(0.65);
lightMakeup.setLipColor(LightMakeUpEnum.MAKEUP_LIPSTICK_18.getLipColorRGBData());
lightMakeup.setLipIntensity(1.0);
FURenderKit.getInstance().setLightMakeup(lightMakeup);
});
}
};
//region 轻美妆效果枚举
public enum LightMakeUpEnum {
/**
* 美妆项,前几项是预置的效果
* 排在列表最前方顺序为桃花妆、雀斑妆、朋克妆其中朋克没有腮红3个妆容的眼线、眼睫毛共用1个的
*/
// 腮红
MAKEUP_BLUSHER_01("MAKEUP_BLUSHER_01", "light_makeup/blusher/mu_blush_01.png", R.mipmap.icon_light_makeup_blush_01, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_02("MAKEUP_BLUSHER_02", "light_makeup/blusher/mu_blush_02.png", R.mipmap.icon_light_makeup_blush_02, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_03("MAKEUP_BLUSHER_03", "light_makeup/blusher/mu_blush_03.png", R.mipmap.icon_light_makeup_blush_03, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_04("MAKEUP_BLUSHER_04", "light_makeup/blusher/mu_blush_04.png", R.mipmap.icon_light_makeup_blush_04, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_05("MAKEUP_BLUSHER_05", "light_makeup/blusher/mu_blush_05.png", R.mipmap.icon_light_makeup_blush_05, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_06("MAKEUP_BLUSHER_06", "light_makeup/blusher/mu_blush_06.png", R.mipmap.icon_light_makeup_blush_06, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_07("MAKEUP_BLUSHER_07", "light_makeup/blusher/mu_blush_07.png", R.mipmap.icon_light_makeup_blush_07, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_08("MAKEUP_BLUSHER_08", "light_makeup/blusher/mu_blush_08.png", R.mipmap.icon_light_makeup_blush_08, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_09("MAKEUP_BLUSHER_09", "light_makeup/blusher/mu_blush_09.png", R.mipmap.icon_light_makeup_blush_09, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_10("MAKEUP_BLUSHER_10", "light_makeup/blusher/mu_blush_10.png", R.mipmap.icon_light_makeup_blush_10, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_11("MAKEUP_BLUSHER_11", "light_makeup/blusher/mu_blush_11.png", R.mipmap.icon_light_makeup_blush_11, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_12("MAKEUP_BLUSHER_12", "light_makeup/blusher/mu_blush_12.png", R.mipmap.icon_light_makeup_blush_12, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_13("MAKEUP_BLUSHER_13", "light_makeup/blusher/mu_blush_13.png", R.mipmap.icon_light_makeup_blush_13, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_14("MAKEUP_BLUSHER_14", "light_makeup/blusher/mu_blush_14.png", R.mipmap.icon_light_makeup_blush_14, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_15("MAKEUP_BLUSHER_15", "light_makeup/blusher/mu_blush_15.png", R.mipmap.icon_light_makeup_blush_15, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_16("MAKEUP_BLUSHER_16", "light_makeup/blusher/mu_blush_16.png", R.mipmap.icon_light_makeup_blush_16, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_17("MAKEUP_BLUSHER_17", "light_makeup/blusher/mu_blush_17.png", R.mipmap.icon_light_makeup_blush_17, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_18("MAKEUP_BLUSHER_18", "light_makeup/blusher/mu_blush_18.png", R.mipmap.icon_light_makeup_blush_18, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_19("MAKEUP_BLUSHER_19", "light_makeup/blusher/mu_blush_19.png", R.mipmap.icon_light_makeup_blush_19, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_20("MAKEUP_BLUSHER_20", "light_makeup/blusher/mu_blush_20.png", R.mipmap.icon_light_makeup_blush_20, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_21("MAKEUP_BLUSHER_21", "light_makeup/blusher/mu_blush_21.png", R.mipmap.icon_light_makeup_blush_21, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_22("MAKEUP_BLUSHER_22", "light_makeup/blusher/mu_blush_22.png", R.mipmap.icon_light_makeup_blush_22, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_23("MAKEUP_BLUSHER_23", "light_makeup/blusher/mu_blush_23.png", R.mipmap.icon_light_makeup_blush_23, R.string.makeup_radio_blusher),
MAKEUP_BLUSHER_24("MAKEUP_BLUSHER_24", "light_makeup/blusher/mu_blush_24.png", R.mipmap.icon_light_makeup_blush_24, R.string.makeup_radio_blusher),
// 眉毛
MAKEUP_EYEBROW_01("MAKEUP_EYEBROW_01", "light_makeup/eyebrow/mu_eyebrow_01.png", R.mipmap.icon_light_makeup_eyebrow_01, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_02("MAKEUP_EYEBROW_02", "light_makeup/eyebrow/mu_eyebrow_02.png", R.mipmap.icon_light_makeup_eyebrow_02, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_03("MAKEUP_EYEBROW_03", "light_makeup/eyebrow/mu_eyebrow_03.png", R.mipmap.icon_light_makeup_eyebrow_03, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_04("MAKEUP_EYEBROW_04", "light_makeup/eyebrow/mu_eyebrow_04.png", R.mipmap.icon_light_makeup_eyebrow_04, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_05("MAKEUP_EYEBROW_05", "light_makeup/eyebrow/mu_eyebrow_05.png", R.mipmap.icon_light_makeup_eyebrow_05, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_06("MAKEUP_EYEBROW_06", "light_makeup/eyebrow/mu_eyebrow_06.png", R.mipmap.icon_light_makeup_eyebrow_06, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_07("MAKEUP_EYEBROW_07", "light_makeup/eyebrow/mu_eyebrow_07.png", R.mipmap.icon_light_makeup_eyebrow_07, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_08("MAKEUP_EYEBROW_08", "light_makeup/eyebrow/mu_eyebrow_08.png", R.mipmap.icon_light_makeup_eyebrow_08, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_09("MAKEUP_EYEBROW_09", "light_makeup/eyebrow/mu_eyebrow_09.png", R.mipmap.icon_light_makeup_eyebrow_09, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_10("MAKEUP_EYEBROW_10", "light_makeup/eyebrow/mu_eyebrow_10.png", R.mipmap.icon_light_makeup_eyebrow_10, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_11("MAKEUP_EYEBROW_11", "light_makeup/eyebrow/mu_eyebrow_11.png", R.mipmap.icon_light_makeup_eyebrow_11, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_12("MAKEUP_EYEBROW_12", "light_makeup/eyebrow/mu_eyebrow_12.png", R.mipmap.icon_light_makeup_eyebrow_12, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_13("MAKEUP_EYEBROW_13", "light_makeup/eyebrow/mu_eyebrow_13.png", R.mipmap.icon_light_makeup_eyebrow_13, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_14("MAKEUP_EYEBROW_14", "light_makeup/eyebrow/mu_eyebrow_14.png", R.mipmap.icon_light_makeup_eyebrow_14, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_15("MAKEUP_EYEBROW_15", "light_makeup/eyebrow/mu_eyebrow_15.png", R.mipmap.icon_light_makeup_eyebrow_15, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_16("MAKEUP_EYEBROW_16", "light_makeup/eyebrow/mu_eyebrow_16.png", R.mipmap.icon_light_makeup_eyebrow_16, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_17("MAKEUP_EYEBROW_17", "light_makeup/eyebrow/mu_eyebrow_17.png", R.mipmap.icon_light_makeup_eyebrow_17, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_18("MAKEUP_EYEBROW_18", "light_makeup/eyebrow/mu_eyebrow_18.png", R.mipmap.icon_light_makeup_eyebrow_18, R.string.makeup_radio_eyebrow),
MAKEUP_EYEBROW_19("MAKEUP_EYEBROW_19", "light_makeup/eyebrow/mu_eyebrow_19.png", R.mipmap.icon_light_makeup_eyebrow_19, R.string.makeup_radio_eyebrow),
// 睫毛
MAKEUP_EYELASH_01("MAKEUP_EYELASH_01", "light_makeup/eyelash/mu_eyelash_01.png", R.mipmap.icon_light_makeup_eyelash_01, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_02("MAKEUP_EYELASH_02", "light_makeup/eyelash/mu_eyelash_02.png", R.mipmap.icon_light_makeup_eyelash_02, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_03("MAKEUP_EYELASH_03", "light_makeup/eyelash/mu_eyelash_03.png", R.mipmap.icon_light_makeup_eyelash_03, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_04("MAKEUP_EYELASH_04", "light_makeup/eyelash/mu_eyelash_04.png", R.mipmap.icon_light_makeup_eyelash_04, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_05("MAKEUP_EYELASH_05", "light_makeup/eyelash/mu_eyelash_05.png", R.mipmap.icon_light_makeup_eyelash_05, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_06("MAKEUP_EYELASH_06", "light_makeup/eyelash/mu_eyelash_06.png", R.mipmap.icon_light_makeup_eyelash_06, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_07("MAKEUP_EYELASH_07", "light_makeup/eyelash/mu_eyelash_07.png", R.mipmap.icon_light_makeup_eyelash_07, R.string.makeup_radio_eyelash),
MAKEUP_EYELASH_08("MAKEUP_EYELASH_08", "light_makeup/eyelash/mu_eyelash_08.png", R.mipmap.icon_light_makeup_eyelash_08, R.string.makeup_radio_eyelash),
// 眼线
MAKEUP_EYELINER_01("MAKEUP_EYELINER_01", "light_makeup/eyeliner/mu_eyeliner_01.png", R.mipmap.icon_light_makeup_eyeliner_01, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_02("MAKEUP_EYELINER_02", "light_makeup/eyeliner/mu_eyeliner_02.png", R.mipmap.icon_light_makeup_eyeliner_02, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_03("MAKEUP_EYELINER_03", "light_makeup/eyeliner/mu_eyeliner_03.png", R.mipmap.icon_light_makeup_eyeliner_03, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_04("MAKEUP_EYELINER_04", "light_makeup/eyeliner/mu_eyeliner_04.png", R.mipmap.icon_light_makeup_eyeliner_04, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_05("MAKEUP_EYELINER_05", "light_makeup/eyeliner/mu_eyeliner_05.png", R.mipmap.icon_light_makeup_eyeliner_05, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_06("MAKEUP_EYELINER_06", "light_makeup/eyeliner/mu_eyeliner_06.png", R.mipmap.icon_light_makeup_eyeliner_06, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_07("MAKEUP_EYELINER_07", "light_makeup/eyeliner/mu_eyeliner_07.png", R.mipmap.icon_light_makeup_eyeliner_07, R.string.makeup_radio_eye_liner),
MAKEUP_EYELINER_08("MAKEUP_EYELINER_08", "light_makeup/eyeliner/mu_eyeliner_08.png", R.mipmap.icon_light_makeup_eyeliner_08, R.string.makeup_radio_eye_liner),
// 美瞳
MAKEUP_EYEPUPIL_01("MAKEUP_EYEPUPIL_01", "light_makeup/eyepupil/mu_eyepupil_01.png", R.mipmap.icon_light_makeup_eyepupil_01, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_02("MAKEUP_EYEPUPIL_02", "light_makeup/eyepupil/mu_eyepupil_02.png", R.mipmap.icon_light_makeup_eyepupil_02, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_03("MAKEUP_EYEPUPIL_03", "light_makeup/eyepupil/mu_eyepupil_03.png", R.mipmap.icon_light_makeup_eyepupil_03, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_04("MAKEUP_EYEPUPIL_04", "light_makeup/eyepupil/mu_eyepupil_04.png", R.mipmap.icon_light_makeup_eyepupil_04, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_05("MAKEUP_EYEPUPIL_05", "light_makeup/eyepupil/mu_eyepupil_05.png", R.mipmap.icon_light_makeup_eyepupil_05, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_06("MAKEUP_EYEPUPIL_06", "light_makeup/eyepupil/mu_eyepupil_06.png", R.mipmap.icon_light_makeup_eyepupil_06, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_07("MAKEUP_EYEPUPIL_07", "light_makeup/eyepupil/mu_eyepupil_07.png", R.mipmap.icon_light_makeup_eyepupil_07, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_08("MAKEUP_EYEPUPIL_08", "light_makeup/eyepupil/mu_eyepupil_08.png", R.mipmap.icon_light_makeup_eyepupil_08, R.string.makeup_radio_contact_lens),
MAKEUP_EYEPUPIL_09("MAKEUP_EYEPUPIL_09", "light_makeup/eyepupil/mu_eyepupil_09.png", R.mipmap.icon_light_makeup_eyepupil_09, R.string.makeup_radio_contact_lens),
// 眼影
MAKEUP_EYE_SHADOW_01("MAKEUP_EYESHADOW_01", "light_makeup/eyeshadow/mu_eyeshadow_01.png", R.mipmap.icon_light_makeup_eyeshadow_01, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_02("MAKEUP_EYESHADOW_02", "light_makeup/eyeshadow/mu_eyeshadow_02.png", R.mipmap.icon_light_makeup_eyeshadow_02, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_03("MAKEUP_EYESHADOW_03", "light_makeup/eyeshadow/mu_eyeshadow_03.png", R.mipmap.icon_light_makeup_eyeshadow_03, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_04("MAKEUP_EYESHADOW_04", "light_makeup/eyeshadow/mu_eyeshadow_04.png", R.mipmap.icon_light_makeup_eyeshadow_04, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_05("MAKEUP_EYESHADOW_05", "light_makeup/eyeshadow/mu_eyeshadow_05.png", R.mipmap.icon_light_makeup_eyeshadow_05, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_06("MAKEUP_EYESHADOW_06", "light_makeup/eyeshadow/mu_eyeshadow_06.png", R.mipmap.icon_light_makeup_eyeshadow_06, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_07("MAKEUP_EYESHADOW_07", "light_makeup/eyeshadow/mu_eyeshadow_07.png", R.mipmap.icon_light_makeup_eyeshadow_07, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_08("MAKEUP_EYESHADOW_08", "light_makeup/eyeshadow/mu_eyeshadow_08.png", R.mipmap.icon_light_makeup_eyeshadow_08, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_09("MAKEUP_EYESHADOW_09", "light_makeup/eyeshadow/mu_eyeshadow_09.png", R.mipmap.icon_light_makeup_eyeshadow_09, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_10("MAKEUP_EYESHADOW_10", "light_makeup/eyeshadow/mu_eyeshadow_10.png", R.mipmap.icon_light_makeup_eyeshadow_10, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_11("MAKEUP_EYESHADOW_11", "light_makeup/eyeshadow/mu_eyeshadow_11.png", R.mipmap.icon_light_makeup_eyeshadow_11, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_12("MAKEUP_EYESHADOW_12", "light_makeup/eyeshadow/mu_eyeshadow_12.png", R.mipmap.icon_light_makeup_eyeshadow_12, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_13("MAKEUP_EYESHADOW_13", "light_makeup/eyeshadow/mu_eyeshadow_13.png", R.mipmap.icon_light_makeup_eyeshadow_13, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_14("MAKEUP_EYESHADOW_14", "light_makeup/eyeshadow/mu_eyeshadow_14.png", R.mipmap.icon_light_makeup_eyeshadow_14, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_15("MAKEUP_EYESHADOW_15", "light_makeup/eyeshadow/mu_eyeshadow_15.png", R.mipmap.icon_light_makeup_eyeshadow_15, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_16("MAKEUP_EYESHADOW_16", "light_makeup/eyeshadow/mu_eyeshadow_16.png", R.mipmap.icon_light_makeup_eyeshadow_16, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_17("MAKEUP_EYESHADOW_17", "light_makeup/eyeshadow/mu_eyeshadow_17.png", R.mipmap.icon_light_makeup_eyeshadow_17, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_18("MAKEUP_EYESHADOW_18", "light_makeup/eyeshadow/mu_eyeshadow_18.png", R.mipmap.icon_light_makeup_eyeshadow_18, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_19("MAKEUP_EYESHADOW_19", "light_makeup/eyeshadow/mu_eyeshadow_19.png", R.mipmap.icon_light_makeup_eyeshadow_19, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_20("MAKEUP_EYESHADOW_20", "light_makeup/eyeshadow/mu_eyeshadow_20.png", R.mipmap.icon_light_makeup_eyeshadow_20, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_21("MAKEUP_EYESHADOW_21", "light_makeup/eyeshadow/mu_eyeshadow_21.png", R.mipmap.icon_light_makeup_eyeshadow_21, R.string.makeup_radio_eye_shadow),
MAKEUP_EYE_SHADOW_22("MAKEUP_EYESHADOW_22", "light_makeup/eyeshadow/mu_eyeshadow_22.png", R.mipmap.icon_light_makeup_eyeshadow_22, R.string.makeup_radio_eye_shadow),
// 口红
MAKEUP_LIPSTICK_01("MAKEUP_LIPSTICK_01", "light_makeup/lipstick/mu_lip_01.json", R.mipmap.icon_light_makeup_lip_01, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_02("MAKEUP_LIPSTICK_02", "light_makeup/lipstick/mu_lip_02.json", R.mipmap.icon_light_makeup_lip_02, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_03("MAKEUP_LIPSTICK_03", "light_makeup/lipstick/mu_lip_03.json", R.mipmap.icon_light_makeup_lip_03, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_10("MAKEUP_LIPSTICK_10", "light_makeup/lipstick/mu_lip_10.json", R.mipmap.icon_light_makeup_lip_10, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_11("MAKEUP_LIPSTICK_11", "light_makeup/lipstick/mu_lip_11.json", R.mipmap.icon_light_makeup_lip_12, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_12("MAKEUP_LIPSTICK_12", "light_makeup/lipstick/mu_lip_12.json", R.mipmap.icon_light_makeup_lip_12, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_13("MAKEUP_LIPSTICK_13", "light_makeup/lipstick/mu_lip_13.json", R.mipmap.icon_light_makeup_lip_13, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_14("MAKEUP_LIPSTICK_14", "light_makeup/lipstick/mu_lip_14.json", R.mipmap.icon_light_makeup_lip_14, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_15("MAKEUP_LIPSTICK_15", "light_makeup/lipstick/mu_lip_15.json", R.mipmap.icon_light_makeup_lip_15, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_16("MAKEUP_LIPSTICK_16", "light_makeup/lipstick/mu_lip_16.json", R.mipmap.icon_light_makeup_lip_16, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_17("MAKEUP_LIPSTICK_17", "light_makeup/lipstick/mu_lip_17.json", R.mipmap.icon_light_makeup_lip_17, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_18("MAKEUP_LIPSTICK_18", "light_makeup/lipstick/mu_lip_18.json", R.mipmap.icon_light_makeup_lip_18, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_19("MAKEUP_LIPSTICK_19", "light_makeup/lipstick/mu_lip_19.json", R.mipmap.icon_light_makeup_lip_19, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_20("MAKEUP_LIPSTICK_20", "light_makeup/lipstick/mu_lip_20.json", R.mipmap.icon_light_makeup_lip_20, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_21("MAKEUP_LIPSTICK_21", "light_makeup/lipstick/mu_lip_21.json", R.mipmap.icon_light_makeup_lip_21, R.string.makeup_radio_lipstick),
MAKEUP_LIPSTICK_22("MAKEUP_LIPSTICK_22", "light_makeup/lipstick/mu_lip_22.json", R.mipmap.icon_light_makeup_lip_22, R.string.makeup_radio_lipstick);
private final String key;
private final String path;
private final int iconRes;
private final int strRes;
LightMakeUpEnum(String key, String path, int iconRes, int strRes) {
this.key = key;
this.path = path;
this.iconRes = iconRes;
this.strRes = strRes;
}
/**
* 获取口红颜色
*
* @return
*/
public FUColorRGBData getLipColorRGBData() {
double[] colorArray = loadRgbaColorFromLocal(FaceUnityData.mApplication, path);
if (colorArray != null && colorArray.length == 4) {
return new FUColorRGBData(colorArray[0] * 255, colorArray[1] * 255, colorArray[2] * 255, colorArray[3] * 255);
}
return new FUColorRGBData(0.0, 0.0, 0.0, 0.0);
}
}
//endregion
/**
* 读取 RGBA 颜色数据
*
* @param context
* @param path path
* @return
*/
public static double[] loadRgbaColorFromLocal(Context context, String path) {
InputStream inputStream = FileUtils.readInputStreamByPath(context, path);
if (inputStream != null) {
try {
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes);
JSONObject jsonObject = new JSONObject(new String(bytes));
JSONArray jsonArray = jsonObject.optJSONArray("rgba");
double[] colorArray = new double[jsonArray.length()];
for (int i = 0; i < jsonArray.length(); i++) {
colorArray[i] = jsonArray.optDouble(i);
}
return colorArray;
} catch (IOException | JSONException e) {
e.printStackTrace();
} finally {
try {
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return null;
}
}

View File

@@ -0,0 +1,489 @@
package com.yunbao.faceunity.repo;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import com.faceunity.core.controller.makeup.MakeupParam;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.model.facebeauty.FaceBeautyFilterEnum;
import com.faceunity.core.model.makeup.Makeup;
import com.faceunity.core.utils.FileUtils;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.entity.MakeupCombinationBean;
import com.yunbao.faceunity.entity.MakeupCustomBean;
import com.yunbao.faceunity.entity.MakeupCustomClassBean;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.FaceUnityData;
import com.yunbao.faceunity.entity.MakeupCombinationBean.TypeEnum;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* DESC美妆数据构造
* Created on 2021/3/28
*/
public class MakeupSource {
public static String BUNDLE_FACE_MAKEUP = "graphics" + File.separator + "face_makeup.bundle";
//region 组合妆容
/**
* 构造美妆组合妆容配置
*
* @return ArrayList<MakeupCombinationBean>
*/
public static ArrayList<MakeupCombinationBean> buildCombinations() {
ArrayList<MakeupCombinationBean> combinations = new ArrayList<MakeupCombinationBean>();
String jsonDir = FaceUnityConfig.MAKEUP_RESOURCE_JSON_DIR;
String bundleDir = FaceUnityConfig.MAKEUP_RESOURCE_COMBINATION_BUNDLE_DIR;
combinations.add(new MakeupCombinationBean("origin", TypeEnum.TYPE_NONE, R.mipmap.icon_control_none, R.string.makeup_radio_remove, null, "", FaceBeautyFilterEnum.ZIRAN_2, 1.0,0.0,FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("diadiatu", TypeEnum.TYPE_THEME_MAIN, R.mipmap.icon_makeup_combination_diadiatu, R.string.makeup_combination_diadiatu, bundleDir + "diadiatu.bundle", jsonDir + "diadiatu.json", FaceBeautyFilterEnum.ORIGIN, 0.68,FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("dongling", TypeEnum.TYPE_THEME_MAIN, R.mipmap.icon_makeup_combination_freezing_age, R.string.makeup_combination_dongling, bundleDir + "dongling.bundle", jsonDir + "dongling.json", FaceBeautyFilterEnum.ORIGIN, 0.68,FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("guofeng", TypeEnum.TYPE_THEME_MAIN, R.mipmap.icon_makeup_combination_guo_feng, R.string.makeup_combination_guofeng, bundleDir + "guofeng.bundle", jsonDir + "guofeng.json", FaceBeautyFilterEnum.ORIGIN, 0.6,FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("hunxie", TypeEnum.TYPE_THEME_MAIN, R.mipmap.icon_makeup_combination_mixed_race, R.string.makeup_combination_hunxie, bundleDir + "hunxie.bundle", jsonDir + "hunxie.json", FaceBeautyFilterEnum.ORIGIN, 0.6,FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("jianling", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_age, R.string.makeup_combination_jianling, bundleDir + "jianling.bundle", jsonDir + "jianling.json", FaceBeautyFilterEnum.ZHIGANHUI_1, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("nuandong", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_warm_winter, R.string.makeup_combination_nuandong, bundleDir + "nuandong.bundle", jsonDir + "nuandong.json", FaceBeautyFilterEnum.ZHIGANHUI_2, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("hongfeng", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_red_maple, R.string.makeup_combination_hongfeng, bundleDir + "hongfeng.bundle", jsonDir + "hongfeng.json", FaceBeautyFilterEnum.ZHIGANHUI_3, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("rose", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_rose, R.string.makeup_combination_rose, bundleDir + "rose.bundle", jsonDir + "rose.json", FaceBeautyFilterEnum.ZHIGANHUI_2, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("shaonv", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_girl, R.string.makeup_combination_shaonv, bundleDir + "shaonv.bundle", jsonDir + "shaonv.json", FaceBeautyFilterEnum.ZHIGANHUI_4, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("ziyun", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_purple_rhyme, R.string.makeup_combination_ziyun, bundleDir + "ziyun.bundle", jsonDir + "ziyun.json", FaceBeautyFilterEnum.ZHIGANHUI_1, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("yanshimao", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_bored_cat, R.string.makeup_combination_yanshimao, bundleDir + "yanshimao.bundle", jsonDir + "yanshimao.json", FaceBeautyFilterEnum.ZHIGANHUI_5, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("renyu", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_mermaid, R.string.makeup_combination_renyu, bundleDir + "renyu.bundle", jsonDir + "renyu.json", FaceBeautyFilterEnum.ZHIGANHUI_1, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("chuqiu", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_early_autumn, R.string.makeup_combination_chuqiu, bundleDir + "chuqiu.bundle", jsonDir + "chuqiu.json", FaceBeautyFilterEnum.ZHIGANHUI_6, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("qianzhihe", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_paper_cranes, R.string.makeup_combination_qianzhihe, bundleDir + "qianzhihe.bundle", jsonDir + "qianzhihe.json", FaceBeautyFilterEnum.ZHIGANHUI_2, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("chaomo", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_supermodel, R.string.makeup_combination_chaomo, bundleDir + "chaomo.bundle", jsonDir + "chaomo.json", FaceBeautyFilterEnum.ZHIGANHUI_7, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("chuju", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_daisy, R.string.makeup_combination_chuju, bundleDir + "chuju.bundle", jsonDir + "chuju.json", FaceBeautyFilterEnum.ZHIGANHUI_8, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("gangfeng", TypeEnum.TYPE_THEME_SUB, R.mipmap.icon_makeup_combination_harbour_wind, R.string.makeup_combination_gangfeng, bundleDir + "gangfeng.bundle", jsonDir + "gangfeng.json", FaceBeautyFilterEnum.ZIRAN_8, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("xinggan", TypeEnum.TYPE_DAILY, R.mipmap.icon_makeup_combination_sexy, R.string.makeup_combination_sexy, bundleDir + "xinggan.bundle", jsonDir + "xinggan.json", FaceBeautyFilterEnum.ZIRAN_4, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("tianmei", TypeEnum.TYPE_DAILY, R.mipmap.icon_makeup_combination_sweet, R.string.makeup_combination_sweet, bundleDir + "tianmei.bundle", jsonDir + "tianmei.json", FaceBeautyFilterEnum.ZIRAN_4, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("linjia", TypeEnum.TYPE_DAILY, R.mipmap.icon_makeup_combination_neighbor_girl, R.string.makeup_combination_neighbor, bundleDir + "linjia.bundle", jsonDir + "linjia.json", FaceBeautyFilterEnum.ZIRAN_4, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("oumei", TypeEnum.TYPE_DAILY, R.mipmap.icon_makeup_combination_occident, R.string.makeup_combination_occident, bundleDir + "oumei.bundle", jsonDir + "oumei.json", FaceBeautyFilterEnum.ZIRAN_4, FaceParam.FACE_MAKEUP));
combinations.add(new MakeupCombinationBean("wumei", TypeEnum.TYPE_DAILY, R.mipmap.icon_makeup_combination_charming, R.string.makeup_combination_charming, bundleDir + "wumei.bundle", jsonDir + "wumei.json", FaceBeautyFilterEnum.ZIRAN_4, FaceParam.FACE_MAKEUP));
return combinations;
}
/**
* 构造美妆模型
*
* @return
*/
public static Makeup getMakeupModel(MakeupCombinationBean bean) {
Makeup makeupModel;
if (TypeEnum.TYPE_THEME_MAIN == bean.getType() && bean.getBundlePath() != null && bean.getBundlePath().trim().length() > 0) {
makeupModel = new Makeup(new FUBundleData(bean.getBundlePath()));
//新的组合妆容设置滤镜scale
makeupModel.setCurrentFilterScale(bean.getFilterScale());
} else {
makeupModel = new Makeup(new FUBundleData(FaceUnityConfig.BUNDLE_FACE_MAKEUP));
}
if (bean.getKey().equals("origin")) {
return makeupModel;
}
if ((TypeEnum.TYPE_THEME_SUB == bean.getType() || TypeEnum.TYPE_DAILY == bean.getType()) && bean.getBundlePath() != null && bean.getBundlePath().trim().length() > 0)
makeupModel.setCombinedConfig(new FUBundleData(bean.getBundlePath()));
makeupModel.setMakeupIntensity(bean.getIntensity());
if (bean.getJsonPathParams() == null) {
bean.setJsonPathParams(getLocalParams(bean.getJsonPath()));
}
LinkedHashMap<String, Object> params = bean.getJsonPathParams();
//支持自定义,所以需要知道选中了妆容的哪一些项
for (Map.Entry<String, Object> entry : params.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (value instanceof double[] && ((double[]) value).length > 4) {
int count = ((double[]) value).length / 4;
for (int i = 0; i < count; i++) {
if (i == 0) {
if (makeupSetMapping.containsKey(key)) {
makeupSetMapping.get(key).setValue(makeupModel, value);
}
} else {
if (makeupSetMapping.containsKey(key + (i + 1))) {
makeupSetMapping.get(key + (i + 1)).setValue(makeupModel, value);
}
}
}
} else {
if (makeupSetMapping.containsKey(key)) {
makeupSetMapping.get(key).setValue(makeupModel, value);
}
}
}
return makeupModel;
}
/**
* 读取本地参数配置
*
* @param jsonPath String json文件路径
* @return LinkedHashMap<String, Any>
*/
private static LinkedHashMap<String, Object> getLocalParams(String jsonPath) {
LinkedHashMap<String, Object> map = new LinkedHashMap(32);
map.put(MakeupParam.LIP_INTENSITY, 0.0);
map.put(MakeupParam.EYE_LINER_INTENSITY, 0.0);
map.put(MakeupParam.BLUSHER_INTENSITY, 0.0);
map.put(MakeupParam.PUPIL_INTENSITY, 0.0);
map.put(MakeupParam.EYE_BROW_INTENSITY, 0.0);
map.put(MakeupParam.EYE_SHADOW_INTENSITY, 0.0);
map.put(MakeupParam.EYELASH_INTENSITY, 0.0);
map.put(MakeupParam.FOUNDATION_INTENSITY, 0.0);
map.put(MakeupParam.HIGHLIGHT_INTENSITY, 0.0);
map.put(MakeupParam.SHADOW_INTENSITY, 0.0);
LinkedHashMap<String, Object> jsonParam = FileUtils.INSTANCE.loadParamsFromLocal(FaceUnityData.mApplication, jsonPath);
for (Map.Entry<String, Object> entry : jsonParam.entrySet()) {
if (entry.getKey().startsWith("tex_")) {
if (entry.getValue() instanceof String && ((String) entry.getValue()).contains(".bundle")) {
map.put(entry.getKey(), FaceUnityConfig.MAKEUP_RESOURCE_ITEM_BUNDLE_DIR + entry.getValue());
}
} else {
map.put(entry.getKey(), entry.getValue());
}
}
return map;
}
interface MakeupSetParam {
/**
* 模型属性赋值
*
* @param makeup
* @param value
*/
void setValue(Makeup makeup, Object value);
}
/*美妆映射模型*/
public static HashMap<String, MakeupSetParam> makeupSetMapping = new HashMap<String, MakeupSetParam>() {
{
put(MakeupParam.LIP_TYPE, (makeup, value) -> makeup.setLipType((int) value));
put(MakeupParam.IS_TWO_COLOR, (makeup, value) -> makeup.setEnableTwoLipColor((int) value == 1));
put(MakeupParam.MAKEUP_LIP_HIGH_LIGHT_ENABLE, (makeup, value) -> makeup.setLipHighLightEnable((int) value == 1));
put(MakeupParam.MAKEUP_LIP_HIGH_LIGHT_STRENGTH, (makeup, value) -> makeup.setLipHighLightStrength((double) value));
put(MakeupParam.BROW_WARP, (makeup, value) -> makeup.setEnableBrowWarp((double) value == 1.0));
put(MakeupParam.BROW_WARP_TYPE, (makeup, value) -> makeup.setBrowWarpType((int) value));
/*强度*/
put(MakeupParam.MAKEUP_INTENSITY, (makeup, value) -> makeup.setMakeupIntensity((double) value));
put(MakeupParam.LIP_INTENSITY, (makeup, value) -> makeup.setLipIntensity((double) value));
put(MakeupParam.EYE_LINER_INTENSITY, (makeup, value) -> makeup.setEyeLineIntensity((double) value));
put(MakeupParam.BLUSHER_INTENSITY, (makeup, value) -> makeup.setBlusherIntensity((double) value));
put(MakeupParam.PUPIL_INTENSITY, (makeup, value) -> makeup.setPupilIntensity((double) value));
put(MakeupParam.EYE_BROW_INTENSITY, (makeup, value) -> makeup.setEyeBrowIntensity((double) value));
put(MakeupParam.EYE_SHADOW_INTENSITY, (makeup, value) -> makeup.setEyeShadowIntensity((double) value));
put(MakeupParam.EYELASH_INTENSITY, (makeup, value) -> makeup.setEyeLashIntensity((double) value));
put(MakeupParam.FOUNDATION_INTENSITY, (makeup, value) -> makeup.setFoundationIntensity((double) value));
put(MakeupParam.HIGHLIGHT_INTENSITY, (makeup, value) -> makeup.setHeightLightIntensity((double) value));
put(MakeupParam.SHADOW_INTENSITY, (makeup, value) -> makeup.setShadowIntensity((double) value));
/*子项妆容贴图*/
put(MakeupParam.TEX_LIP, (makeup, value) -> makeup.setLipBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_BROW, (makeup, value) -> makeup.setEyeBrowBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_SHADOW, (makeup, value) -> makeup.setEyeShadowBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_SHADOW2, (makeup, value) -> makeup.setEyeShadowBundle2(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_SHADOW3, (makeup, value) -> makeup.setEyeShadowBundle3(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_SHADOW4, (makeup, value) -> makeup.setEyeShadowBundle4(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_PUPIL, (makeup, value) -> makeup.setPupilBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_LASH, (makeup, value) -> makeup.setEyeLashBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_EYE_LINER, (makeup, value) -> makeup.setEyeLinerBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_BLUSHER, (makeup, value) -> makeup.setBlusherBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_BLUSHER2, (makeup, value) -> makeup.setBlusherBundle2(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_FOUNDATION, (makeup, value) -> makeup.setFoundationBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_HIGH_LIGHT, (makeup, value) -> makeup.setHighLightBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
put(MakeupParam.TEX_SHADOW, (makeup, value) -> makeup.setShadowBundle(((String) value).endsWith(".bundle") ? new FUBundleData((String) value) : null));
/*子项妆容颜色*/
put(MakeupParam.MAKEUP_LIP_COLOR, (makeup, value) -> makeup.setLipColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_LIP_COLOR_V2, (makeup, value) -> makeup.setLipColorV2(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_LIP_COLOR2, (makeup, value) -> makeup.setLipColor2(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_LINER_COLOR, (makeup, value) -> makeup.setEyeLinerColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_LASH_COLOR, (makeup, value) -> makeup.setEyeLashColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_BLUSHER_COLOR, (makeup, value) -> makeup.setBlusherColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_BLUSHER_COLOR2, (makeup, value) -> makeup.setBlusherColor2(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_FOUNDATION_COLOR, (makeup, value) -> makeup.setFoundationColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_HIGH_LIGHT_COLOR, (makeup, value) -> makeup.setHighLightColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_SHADOW_COLOR, (makeup, value) -> makeup.setShadowColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_BROW_COLOR, (makeup, value) -> makeup.setEyeBrowColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_PUPIL_COLOR, (makeup, value) -> makeup.setPupilColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_SHADOW_COLOR, (makeup, value) -> makeup.setEyeShadowColor(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_SHADOW_COLOR2, (makeup, value) -> makeup.setEyeShadowColor2(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_SHADOW_COLOR3, (makeup, value) -> makeup.setEyeShadowColor3(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_SHADOW_COLOR4, (makeup, value) -> makeup.setEyeShadowColor4(buildFUColorRGBData(value)));
put(MakeupParam.MAKEUP_EYE_BROW_COLOR, (makeup, value) -> makeup.setEyeBrowColor(buildFUColorRGBData(value)));
/* 图层混合模式 */
put(MakeupParam.BLEND_TEX_EYE_SHADOW, (makeup, value) -> makeup.setEyeShadowTexBlend((int) value));
put(MakeupParam.BLEND_TEX_EYE_SHADOW2, (makeup, value) -> makeup.setEyeShadowTexBlend2((int) value));
put(MakeupParam.BLEND_TEX_EYE_SHADOW3, (makeup, value) -> makeup.setEyeShadowTexBlend3((int) value));
put(MakeupParam.BLEND_TEX_EYE_SHADOW4, (makeup, value) -> makeup.setEyeShadowTexBlend4((int) value));
put(MakeupParam.BLEND_TEX_EYE_LASH, (makeup, value) -> makeup.setEyeLashTexBlend((int) value));
put(MakeupParam.BLEND_TEX_EYE_LINER, (makeup, value) -> makeup.setEyeLinerTexBlend((int) value));
put(MakeupParam.BLEND_TEX_BLUSHER, (makeup, value) -> makeup.setBlusherTexBlend((int) value));
put(MakeupParam.BLEND_TEX_BLUSHER2, (makeup, value) -> makeup.setBlusherTexBlend2((int) value));
put(MakeupParam.BLEND_TEX_PUPIL, (makeup, value) -> makeup.setPupilTexBlend((int) value));
}
};
/**
* 构造颜色模型
*
* @param object
* @return
*/
public static FUColorRGBData buildFUColorRGBData(Object object) {
if (object instanceof double[]) {
double[] array = (double[]) object;
if (array.length == 4) {
return new FUColorRGBData(array[0] * 255, array[1] * 255, array[2] * 255, array[3] * 255);
}
}
return new FUColorRGBData(0.0, 0.0, 0.0, 0.0);
}
//endregion 组合妆容
// region 子妆容
/* 粉底 */
public static String FACE_MAKEUP_TYPE_FOUNDATION = "FOUNDATION";
/* 口红 */
public static String FACE_MAKEUP_TYPE_LIP_STICK = "STICK";
/* 腮红 */
public static String FACE_MAKEUP_TYPE_BLUSHER = "BLUSHER";
/* 眉毛 */
public static String FACE_MAKEUP_TYPE_EYE_BROW = "EYE_BROW";
/* 眼影 */
public static String FACE_MAKEUP_TYPE_EYE_SHADOW = "EYE_SHADOW";
/* 眼线 */
public static String FACE_MAKEUP_TYPE_EYE_LINER = "EYE_LINER";
/* 睫毛 */
public static String FACE_MAKEUP_TYPE_EYE_LASH = "EYE_LASH";
/* 高光 */
public static String FACE_MAKEUP_TYPE_HIGH_LIGHT = "HIGHLIGHT";
/* 阴影 */
public static String FACE_MAKEUP_TYPE_SHADOW = "SHADOW";
/* 美瞳 */
public static String FACE_MAKEUP_TYPE_EYE_PUPIL = "EYE_PUPIL";
/**
* 构造美妆子项类别
*/
public static ArrayList<MakeupCustomClassBean> buildCustomClasses() {
ArrayList<MakeupCustomClassBean> classes = new ArrayList();
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_foundation, FACE_MAKEUP_TYPE_FOUNDATION,FaceParam.FACE_MAKEUP_TYPE_FOUNDATION));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_lipstick, FACE_MAKEUP_TYPE_LIP_STICK,FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_blusher, FACE_MAKEUP_TYPE_BLUSHER,FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_eyebrow, FACE_MAKEUP_TYPE_EYE_BROW,FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_eye_shadow, FACE_MAKEUP_TYPE_EYE_SHADOW,FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_eye_liner, FACE_MAKEUP_TYPE_EYE_LINER,FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_eyelash, FACE_MAKEUP_TYPE_EYE_LASH,FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_highlight, FACE_MAKEUP_TYPE_HIGH_LIGHT,FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_shadow, FACE_MAKEUP_TYPE_SHADOW,FaceParam.FACE_MAKEUP_TYPE_SHADOW));
classes.add(new MakeupCustomClassBean(R.string.makeup_radio_contact_lens, FACE_MAKEUP_TYPE_EYE_PUPIL,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
return classes;
}
public static LinkedHashMap<String,ArrayList<MakeupCustomBean>> buildCustomItemParams(){
return buildCustomItemParams(MakeupSource.buildMakeUpColorMap());
}
/**
* 美妆单项妆容配置参数
*
* @return LinkedHashMap<String, ArrayList < MakeupCustomBean>>
*/
public static LinkedHashMap<String, ArrayList<MakeupCustomBean>> buildCustomItemParams(LinkedHashMap<String, ArrayList<double[]>> colorMap) {
LinkedHashMap<String, ArrayList<MakeupCustomBean>> mCustomItems = new LinkedHashMap<>();
/*粉底*/
ArrayList<MakeupCustomBean> makeupItems = new ArrayList(6);
makeupItems.add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_FOUNDATION));
ArrayList<double[]> list = colorMap.get("color_mu_style_foundation_01");
for (int i = 3; i < 8; i++) {
double[] colors = list.get(i);
ColorDrawable drawable = new ColorDrawable(Color.argb((int) (colors[3] * 255), (int) (colors[0] * 255), (int) (colors[1] * 255), (int) (colors[2] * 255)));
makeupItems.add(new MakeupCustomBean(0, drawable,FaceParam.FACE_MAKEUP_TYPE_FOUNDATION));
}
mCustomItems.put(FACE_MAKEUP_TYPE_FOUNDATION, makeupItems);
/*口红*/
mCustomItems.put(FACE_MAKEUP_TYPE_LIP_STICK, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
add(new MakeupCustomBean(R.string.makeup_lip_fog, getDrawable(R.mipmap.icon_makeup_lip_fog), colorMap.get("color_mu_style_lip_01"),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
add(new MakeupCustomBean(R.string.makeup_lip_moist1, getDrawable(R.mipmap.icon_makeup_lip_moist), colorMap.get("color_mu_style_lip_01"),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
add(new MakeupCustomBean(R.string.makeup_lip_moist2, getDrawable(R.mipmap.icon_makeup_lip_water), colorMap.get("color_mu_style_lip_01"),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
add(new MakeupCustomBean(R.string.makeup_lip_pearl, getDrawable(R.mipmap.icon_makeup_lip_pearl), colorMap.get("color_mu_style_lip_01"),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
add(new MakeupCustomBean(R.string.makeup_lip_bitelip, getDrawable(R.mipmap.icon_makeup_lip_beitelip), colorMap.get("color_mu_style_lip_01"),FaceParam.FACE_MAKEUP_TYPE_LIP_STICK));
}
});
/*腮红*/
mCustomItems.put(FACE_MAKEUP_TYPE_BLUSHER, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
add(new MakeupCustomBean(R.string.makeup_blusher_apple, getDrawable(R.mipmap.icon_makeup_blush_01), colorMap.get("color_mu_style_blush_01"),FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
add(new MakeupCustomBean(R.string.makeup_blusher_fan, getDrawable(R.mipmap.icon_makeup_blush_02), colorMap.get("color_mu_style_blush_02"),FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
add(new MakeupCustomBean(R.string.makeup_blusher_eye_corner, getDrawable(R.mipmap.icon_makeup_blush_03), colorMap.get("color_mu_style_blush_03"),FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
add(new MakeupCustomBean(R.string.makeup_blusher_slight_drunk, getDrawable(R.mipmap.icon_makeup_blush_04), colorMap.get("color_mu_style_blush_04"),FaceParam.FACE_MAKEUP_TYPE_BLUSHER));
}
});
/*眉毛*/
mCustomItems.put(FACE_MAKEUP_TYPE_EYE_BROW, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
add(new MakeupCustomBean(R.string.makeup_eyebrow_willow, getDrawable(R.mipmap.icon_makeup_eyebrow_01), colorMap.get("color_mu_style_eyebrow_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
add(new MakeupCustomBean(R.string.makeup_eyebrow_wild, getDrawable(R.mipmap.icon_makeup_eyebrow_02), colorMap.get("color_mu_style_eyebrow_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
add(new MakeupCustomBean(R.string.makeup_eyebrow_classical, getDrawable(R.mipmap.icon_makeup_eyebrow_03), colorMap.get("color_mu_style_eyebrow_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
add(new MakeupCustomBean(R.string.makeup_eyebrow_standard, getDrawable(R.mipmap.icon_makeup_eyebrow_04), colorMap.get("color_mu_style_eyebrow_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_BROW));
}
});
/*眼影*/
mCustomItems.put(FACE_MAKEUP_TYPE_EYE_SHADOW, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_single, getDrawable(R.mipmap.icon_makeup_eyeshadow_01), colorMap.get("color_mu_style_eyeshadow_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_double1, getDrawable(R.mipmap.icon_makeup_eyeshadow_02), colorMap.get("color_mu_style_eyeshadow_02"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_double2, getDrawable(R.mipmap.icon_makeup_eyeshadow_03), colorMap.get("color_mu_style_eyeshadow_03"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_double3, getDrawable(R.mipmap.icon_makeup_eyeshadow_04), colorMap.get("color_mu_style_eyeshadow_04"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_triple1, getDrawable(R.mipmap.icon_makeup_eyeshadow_05), colorMap.get("color_mu_style_eyeshadow_05"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_eye_shadow_triple2, getDrawable(R.mipmap.icon_makeup_eyeshadow_06), colorMap.get("color_mu_style_eyeshadow_06"),FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW));
}
});
/*眼线*/
mCustomItems.put(FACE_MAKEUP_TYPE_EYE_LINER, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_cat, getDrawable(R.mipmap.icon_makeup_eyeliner_01), colorMap.get("color_mu_style_eyeliner_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_drooping, getDrawable(R.mipmap.icon_makeup_eyeliner_02), colorMap.get("color_mu_style_eyeliner_02"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_pull_open, getDrawable(R.mipmap.icon_makeup_eyeliner_03), colorMap.get("color_mu_style_eyeliner_03"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_pull_close, getDrawable(R.mipmap.icon_makeup_eyeliner_04), colorMap.get("color_mu_style_eyeliner_04"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_long, getDrawable(R.mipmap.icon_makeup_eyeliner_05), colorMap.get("color_mu_style_eyeliner_05"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
add(new MakeupCustomBean(R.string.makeup_eye_linear_circular, getDrawable(R.mipmap.icon_makeup_eyeliner_06), colorMap.get("color_mu_style_eyeliner_06"),FaceParam.FACE_MAKEUP_TYPE_EYE_LINER));
}
});
/*睫毛*/
mCustomItems.put(FACE_MAKEUP_TYPE_EYE_LASH, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_natural1, getDrawable(R.mipmap.icon_makeup_eyelash_01), colorMap.get("color_mu_style_eyelash_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_natural2, getDrawable(R.mipmap.icon_makeup_eyelash_02), colorMap.get("color_mu_style_eyelash_02"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_thick1, getDrawable(R.mipmap.icon_makeup_eyelash_03), colorMap.get("color_mu_style_eyelash_03"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_thick2, getDrawable(R.mipmap.icon_makeup_eyelash_04), colorMap.get("color_mu_style_eyelash_04"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_exaggerate1, getDrawable(R.mipmap.icon_makeup_eyelash_05), colorMap.get("color_mu_style_eyelash_05"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
add(new MakeupCustomBean(R.string.makeup_eyelash_exaggerate2, getDrawable(R.mipmap.icon_makeup_eyelash_06), colorMap.get("color_mu_style_eyelash_06"),FaceParam.FACE_MAKEUP_TYPE_EYE_LASH));
}
});
/*高光*/
mCustomItems.put(FACE_MAKEUP_TYPE_HIGH_LIGHT, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT));
add(new MakeupCustomBean(R.string.makeup_highlight_one, getDrawable(R.mipmap.icon_makeup_highlight_01), colorMap.get("color_mu_style_highlight_01"),FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT));
add(new MakeupCustomBean(R.string.makeup_highlight_two, getDrawable(R.mipmap.icon_makeup_highlight_02), colorMap.get("color_mu_style_highlight_02"),FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT));
}
});
/*阴影*/
mCustomItems.put(FACE_MAKEUP_TYPE_SHADOW, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_SHADOW));
add(new MakeupCustomBean(R.string.makeup_shadow_one, getDrawable(R.mipmap.icon_makeup_contour_01), colorMap.get("color_mu_style_contour_01"),FaceParam.FACE_MAKEUP_TYPE_SHADOW));
}
});
/*美瞳*/
mCustomItems.put(FACE_MAKEUP_TYPE_EYE_PUPIL, new ArrayList<MakeupCustomBean>() {
{
add(new MakeupCustomBean(R.string.makeup_radio_remove, getDrawable(R.mipmap.icon_control_none),FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_1, getDrawable(R.mipmap.icon_makeup_eyepupil_01), colorMap.get("color_mu_style_eyepupil_01"),FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_2, getDrawable(R.mipmap.icon_makeup_eyepupil_03), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_3, getDrawable(R.mipmap.icon_makeup_eyepupil_04), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_4, getDrawable(R.mipmap.icon_makeup_eyepupil_05), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_5, getDrawable(R.mipmap.icon_makeup_eyepupil_06), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_6, getDrawable(R.mipmap.icon_makeup_eyepupil_07), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_7, getDrawable(R.mipmap.icon_makeup_eyepupil_08), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
add(new MakeupCustomBean(R.string.makeup_pupil_8, getDrawable(R.mipmap.icon_makeup_eyepupil_09), null,FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL));
}
});
return mCustomItems;
}
//endregion 子妆容
//region 其他
/**
* 获取颜色值配置
*
* @return LinkedHashMap<String, ArrayList < DoubleArray>>
*/
public static LinkedHashMap<String, ArrayList<double[]>> buildMakeUpColorMap() {
LinkedHashMap<String, ArrayList<double[]>> makeupColorMap = new LinkedHashMap<>(32);
String colorJson = FileUtils.INSTANCE.loadStringFromLocal(FaceUnityData.mApplication, FaceUnityConfig.MAKEUP_RESOURCE_COLOR_SETUP_JSON);
if (colorJson != null && colorJson.trim().length() > 0) {
try {
JSONObject jsonObject = new JSONObject(colorJson);
Iterator<String> keys = jsonObject.keys();
while (keys.hasNext()) {
String key = keys.next();
ArrayList<double[]> colorList = new ArrayList(12);
// add additional transparent to fit ui
//增加透明色兼容ColorRecycleView展示
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
JSONObject colorObject = jsonObject.optJSONObject(key);
for (int i = 1; i < 6; i++) {
JSONArray jsonArray = colorObject.optJSONArray("color" + i);
int length = jsonArray.length();
double[] colors = new double[length];
for (int j = 0; j < length; j++) {
colors[j] = jsonArray.optDouble(j, 0.0);
}
colorList.add(colors);
}
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
colorList.add(new double[]{0.0, 0.0, 0.0, 0.0});
makeupColorMap.put(key, colorList);
}
} catch (Exception exception) {
exception.printStackTrace();
}
}
return makeupColorMap;
}
/**
* 获取Drawable对象
*
* @param res Int
* @return Drawable
*/
@SuppressLint("UseCompatLoadingForDrawables")
private static Drawable getDrawable(int res) {
return FaceUnityData.mApplication.getResources().getDrawable(res);
}
//endregion
}

View File

@@ -0,0 +1,107 @@
package com.yunbao.faceunity.repo;
import static android.content.Context.MODE_PRIVATE;
import android.content.SharedPreferences;
import com.faceunity.core.entity.FUBundleData;
import com.faceunity.core.entity.FUColorRGBData;
import com.faceunity.core.model.prop.humanOutline.HumanOutline;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.PropCustomBean;
import com.yunbao.faceunity.infe.AbstractPropCustomDataFactory;
import com.yunbao.faceunity.utils.FaceUnityConfig;
import com.yunbao.faceunity.utils.FaceUnityData;
import java.io.File;
import java.util.ArrayList;
/**
* DESC人像分割数据构造
* Created on 2021/3/28
*/
public class PortraitSegmentSource {
private static final String BG_SEG_CUSTOM_FILEPATH = "bg_seg_custom";
/**
* 缓存自定义添加人像
*
* @param path
*/
public static void saveCachePortraitSegment(String path) {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(BG_SEG_CUSTOM_FILEPATH, MODE_PRIVATE);
sp.edit().putString(BG_SEG_CUSTOM_FILEPATH, path).apply();
}
/**
* 获取自定义添加人像
*
* @return
*/
public static String getCachePortraitSegment() {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(BG_SEG_CUSTOM_FILEPATH, MODE_PRIVATE);
return sp.getString(BG_SEG_CUSTOM_FILEPATH, "");
}
/**
* 构造道具队列
*
* @return
*/
public static ArrayList<PropCustomBean> buildPropBeans() {
ArrayList<PropCustomBean> propBeans = new ArrayList<>();
propBeans.add(new PropCustomBean(R.mipmap.icon_control_delete_all, null, AbstractPropCustomDataFactory.TYPE_NONE));
propBeans.add(new PropCustomBean(R.mipmap.icon_control_add, null, AbstractPropCustomDataFactory.TYPE_ADD));
PropCustomBean customBean = buildPropCustomBean(getCachePortraitSegment());
if (customBean != null) {
propBeans.add(customBean);
}
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_human_outline, "effect/segment/human_outline.bundle", FunctionEnum.HUMAN_OUTLINE));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_boyfriend_1, "effect/segment/boyfriend1.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_boyfriend_2, "effect/segment/boyfriend3.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_boyfriend_3, "effect/segment/boyfriend2.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_hez_ztt_fu, "effect/segment/hez_ztt_fu.bundle", FunctionEnum.PORTRAIT_SEGMENT, R.string.hez_ztt_fu));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_gufeng_zh_fu, "effect/segment/gufeng_zh_fu.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_xiandai_ztt_fu, "effect/segment/xiandai_ztt_fu.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_sea_lm_fu, "effect/segment/sea_lm_fu.bundle", FunctionEnum.PORTRAIT_SEGMENT));
propBeans.add(new PropCustomBean(R.mipmap.icon_segment_ice_lm_fu, "effect/segment/ice_lm_fu.bundle", FunctionEnum.PORTRAIT_SEGMENT));
return propBeans;
}
/**
* 构造自定义人像分割
*
* @param path
* @return
*/
public static PropCustomBean buildPropCustomBean(String path) {
if (path != null && path.trim().length() > 0 && new File(path).exists()) {
saveCachePortraitSegment(path);
return new PropCustomBean(0, FaceUnityConfig.BUNDLE_BG_SEG_CUSTOM, FunctionEnum.BG_SEG_CUSTOM, 0, path );
}
return null;
}
/**
* 构造人像分割线模型
*
* @param path
* @return
*/
public static HumanOutline getHumanOutline(String path) {
HumanOutline humanOutline = new HumanOutline(new FUBundleData(path));
humanOutline.setLineSize(2.8);
humanOutline.setLineGap(2.8);
humanOutline.setLineColor(new FUColorRGBData(255.0, 196.0, 0.0));
return humanOutline;
}
}

View File

@@ -0,0 +1,80 @@
package com.yunbao.faceunity.repo;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.PropBean;
import java.util.ArrayList;
/**
* DESC道具数据构造道具贴图、AR面具、搞笑大头、表情识别、哈哈镜、手势识别、游戏
* Created on 2021/3/28
*/
public class PropSource {
public static ArrayList<PropBean> buildPropBeans(int propType) {
ArrayList<PropBean> propBeans = new ArrayList<>();
switch (propType) {
case FunctionEnum.STICKER:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null, FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_cat_sparks, "effect/normal/cat_sparks.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_fu_zh_fenshu, "effect/normal/fu_zh_fenshu.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_sdlr, "effect/normal/sdlr.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_xlong_zh_fu, "effect/normal/xlong_zh_fu.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_newy1, "effect/normal/newy1.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_redribbt, "effect/normal/redribbt.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_daisypig, "effect/normal/daisypig.bundle", FaceParam.FACE_STICKER));
propBeans.add(new PropBean(R.mipmap.icon_sticker_sdlu, "effect/normal/sdlu.bundle", FaceParam.FACE_STICKER));
break;
case FunctionEnum.AR_MASK:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null, FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_bluebird, "effect/ar/bluebird.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_lanhudie, "effect/ar/lanhudie.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_fenhudie, "effect/ar/fenhudie.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_tiger_huang, "effect/ar/tiger_huang.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_tiger_bai, "effect/ar/tiger_bai.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_baozi, "effect/ar/baozi.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_tiger, "effect/ar/tiger.bundle", FaceParam.FACE_ANIM_AR_MASK));
propBeans.add(new PropBean(R.mipmap.icon_ar_xiongmao, "effect/ar/xiongmao.bundle", FaceParam.FACE_ANIM_AR_MASK));
break;
case FunctionEnum.BIG_HEAD:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null, FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head, "effect/big_head/big_head.bundle", FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head_husky_face, "effect/big_head/big_head_facewarp2.bundle", FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head_sausage_mouth, "effect/big_head/big_head_facewarp4.bundle", FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head_blush, "effect/big_head/big_head_facewarp5.bundle", FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head_dark_circles, "effect/big_head/big_head_facewarp6.bundle", FaceParam.FACE_BIG_HEAD));
propBeans.add(new PropBean(R.mipmap.icon_big_head_smiling_head, "effect/big_head/big_head_smile.bundle", R.string.xiaobianzi_zh_fu, FaceParam.FACE_BIG_HEAD));
break;
case FunctionEnum.EXPRESSION_RECOGNITION:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_future_warrior, "effect/expression/future_warrior.bundle", R.string.future_warrior,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_jet_mask, "effect/expression/jet_mask.bundle", R.string.jet_mask,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_sdx2, "effect/expression/sdx2.bundle", R.string.sdx2,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_luhantongkuan_ztt_fu, "effect/expression/luhantongkuan_ztt_fu.bundle", R.string.luhantongkuan_ztt_fu,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_qingqing_ztt_fu, "effect/expression/qingqing_ztt_fu.bundle", R.string.qingqing_ztt_fu,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_xiaobianzi_zh_fu, "effect/expression/xiaobianzi_zh_fu.bundle", R.string.xiaobianzi_zh_fu,FaceParam.FACE_EXPRESSION_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_expression_xiaoxueshen_ztt_fu, "effect/expression/xiaoxueshen_ztt_fu.bundle", R.string.xiaoxueshen_ztt_fu,FaceParam.FACE_EXPRESSION_RECOGNITION));
break;
case FunctionEnum.FACE_WARP:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null,FaceParam.FACE_FACE_WARP));
propBeans.add(new PropBean(R.mipmap.icon_face_warp_2, "effect/facewarp/facewarp2.bundle",FaceParam.FACE_FACE_WARP));
propBeans.add(new PropBean(R.mipmap.icon_face_warp_3, "effect/facewarp/facewarp3.bundle",FaceParam.FACE_FACE_WARP));
propBeans.add(new PropBean(R.mipmap.icon_face_warp_4, "effect/facewarp/facewarp4.bundle",FaceParam.FACE_FACE_WARP));
propBeans.add(new PropBean(R.mipmap.icon_face_warp_5, "effect/facewarp/facewarp5.bundle",FaceParam.FACE_FACE_WARP));
propBeans.add(new PropBean(R.mipmap.icon_face_warp_6, "effect/facewarp/facewarp6.bundle",FaceParam.FACE_FACE_WARP));
break;
case FunctionEnum.GESTURE_RECOGNITION:
propBeans.add(new PropBean(R.mipmap.icon_control_delete_all, null,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_rain, "effect/gesture/ctrl_rain.bundle", R.string.push_hand,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_snow, "effect/gesture/ctrl_snow.bundle", R.string.push_hand,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_flower, "effect/gesture/ctrl_flower.bundle", R.string.push_hand,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_koreaheart, "effect/gesture/ssd_thread_korheart.bundle", R.string.fu_lm_koreaheart,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_six, "effect/gesture/ssd_thread_six.bundle", R.string.ssd_thread_six,FaceParam.FACE_GESTURE_RECOGNITION));
propBeans.add(new PropBean(R.mipmap.icon_gesture_cute, "effect/gesture/ssd_thread_cute.bundle", R.string.ssd_thread_cute,FaceParam.FACE_GESTURE_RECOGNITION));
break;
}
return propBeans;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,196 @@
package com.yunbao.faceunity.seekbar.internal;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.core.view.ViewCompat;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.seekbar.internal.compat.SeekBarCompat;
import com.yunbao.faceunity.seekbar.internal.drawable.MarkerDrawable;
/**
* {@link ViewGroup} to be used as the real indicator.
* <p>
* I've used this to be able to accommodate the TextView
* and the {@link MarkerDrawable}
* with the required positions and offsets
* </p>
*
* @hide
*/
public class Marker extends ViewGroup implements MarkerDrawable.MarkerAnimationListener {
private static final int PADDING_DP = 1;
private static final int ELEVATION_DP = 8;
//The TextView to show the info
private TextView mNumber;
//The max width of this View
private int mWidth;
//some distance between the thumb and our bubble marker.
//This will be added to our measured height
private int mSeparation;
MarkerDrawable mMarkerDrawable;
public Marker(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
super(context, attrs, defStyleAttr);
//as we're reading the parent DiscreteSeekBar attributes, it may wrongly set this view's visibility.
setVisibility(View.VISIBLE);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DiscreteSeekBar,
R.attr.discreteSeekBarStyle, R.style.Widget_DiscreteSeekBar);
int padding = (int) (PADDING_DP * displayMetrics.density) * 2;
int textAppearanceId = a.getResourceId(R.styleable.DiscreteSeekBar_dsb_indicatorTextAppearance,
R.style.Widget_DiscreteIndicatorTextAppearance);
mNumber = new TextView(context);
//Add some padding to this textView so the bubble has some space to breath
mNumber.setPadding(padding, 0, padding, 0);
mNumber.setTextAppearance(context, textAppearanceId);
mNumber.setGravity(Gravity.CENTER);
mNumber.setText(maxValue);
mNumber.setMaxLines(1);
mNumber.setSingleLine(true);
SeekBarCompat.setTextDirection(mNumber, TEXT_DIRECTION_LOCALE);
mNumber.setVisibility(View.INVISIBLE);
//add some padding for the elevation shadow not to be clipped
//I'm sure there are better ways of doing this...
setPadding(padding, padding, padding, padding);
resetSizes(maxValue);
mSeparation = separation;
ColorStateList color = a.getColorStateList(R.styleable.DiscreteSeekBar_dsb_indicatorColor);
mMarkerDrawable = new MarkerDrawable(color, thumbSize);
mMarkerDrawable.setCallback(this);
mMarkerDrawable.setMarkerListener(this);
mMarkerDrawable.setExternalOffset(padding);
//Elevation for anroid 5+
float elevation = a.getDimension(R.styleable.DiscreteSeekBar_dsb_indicatorElevation, ELEVATION_DP * displayMetrics.density);
ViewCompat.setElevation(this, elevation);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompat.setOutlineProvider(this, mMarkerDrawable);
}
a.recycle();
}
public void resetSizes(String maxValue) {
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
//Account for negative numbers... is there any proper way of getting the biggest string between our range????
mNumber.setText("-" + maxValue);
//Do a first forced measure call for the TextView (with the biggest text content),
//to calculate the max width and use always the same.
//this avoids the TextView from shrinking and growing when the text content changes
int wSpec = MeasureSpec.makeMeasureSpec(displayMetrics.widthPixels, MeasureSpec.AT_MOST);
int hSpec = MeasureSpec.makeMeasureSpec(displayMetrics.heightPixels, MeasureSpec.AT_MOST);
mNumber.measure(wSpec, hSpec);
mWidth = Math.max(mNumber.getMeasuredWidth(), mNumber.getMeasuredHeight());
removeView(mNumber);
addView(mNumber, new FrameLayout.LayoutParams(mWidth, mWidth, Gravity.LEFT | Gravity.TOP));
}
@Override
protected void dispatchDraw(Canvas canvas) {
mMarkerDrawable.draw(canvas);
super.dispatchDraw(canvas);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
measureChildren(widthMeasureSpec, heightMeasureSpec);
int widthSize = mWidth + getPaddingLeft() + getPaddingRight();
int heightSize = mWidth + getPaddingTop() + getPaddingBottom();
//This diff is the basic calculation of the difference between
//a square side size and its diagonal
//this helps us account for the visual offset created by MarkerDrawable
//when leaving one of the corners un-rounded
int diff = (int) ((1.41f * mWidth) - mWidth) / 2;
setMeasuredDimension(widthSize, heightSize + diff + mSeparation);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int left = getPaddingLeft();
int top = getPaddingTop();
int right = getWidth() - getPaddingRight();
int bottom = getHeight() - getPaddingBottom();
//the TetView is always layout at the top
mNumber.layout(left, top, left + mWidth, top + mWidth);
//the MarkerDrawable uses the whole view, it will adapt itself...
// or it seems so...
mMarkerDrawable.setBounds(left, top, right, bottom);
}
@Override
protected boolean verifyDrawable(Drawable who) {
return who == mMarkerDrawable || super.verifyDrawable(who);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
//HACK: Sometimes, the animateOpen() call is made before the View is attached
//so the drawable cannot schedule itself to run the animation
//I think we can call it here safely.
//I've seen it happen in android 2.3.7
animateOpen();
}
public void setValue(CharSequence value) {
mNumber.setText(value);
}
public CharSequence getValue() {
return mNumber.getText();
}
public void animateOpen() {
mMarkerDrawable.stop();
mMarkerDrawable.animateToPressed();
}
public void animateClose() {
mMarkerDrawable.stop();
mNumber.setVisibility(View.INVISIBLE);
mMarkerDrawable.animateToNormal();
}
@Override
public void onOpeningComplete() {
mNumber.setVisibility(View.VISIBLE);
if (getParent() instanceof MarkerDrawable.MarkerAnimationListener) {
((MarkerDrawable.MarkerAnimationListener) getParent()).onOpeningComplete();
}
}
@Override
public void onClosingComplete() {
if (getParent() instanceof MarkerDrawable.MarkerAnimationListener) {
((MarkerDrawable.MarkerAnimationListener) getParent()).onClosingComplete();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mMarkerDrawable.stop();
}
public void setColors(int startColor, int endColor) {
mMarkerDrawable.setColors(startColor, endColor);
}
}

View File

@@ -0,0 +1,256 @@
package com.yunbao.faceunity.seekbar.internal;
import android.content.Context;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.IBinder;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import androidx.core.view.GravityCompat;
import com.yunbao.faceunity.seekbar.internal.compat.SeekBarCompat;
import com.yunbao.faceunity.seekbar.internal.drawable.MarkerDrawable;
/**
* Class to manage the floating bubble thing, similar (but quite worse tested than {@link android.widget.PopupWindow}
* <p/>
* <p>
* This will attach a View to the Window (full-width, measured-height, positioned just under the thumb)
* </p>
*
* @hide
* @see #showIndicator(View, Rect)
* @see #dismiss()
* @see #dismissComplete()
* @see Floater
*/
public class PopupIndicator {
private final WindowManager mWindowManager;
private boolean mShowing;
private Floater mPopupView;
//Outside listener for the DiscreteSeekBar to get MarkerDrawable animation events.
//The whole chain of events goes this way:
//MarkerDrawable->Marker->Floater->mListener->DiscreteSeekBar....
//... phew!
private MarkerDrawable.MarkerAnimationListener mListener;
private int[] mDrawingLocation = new int[2];
Point screenSize = new Point();
public PopupIndicator(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
mPopupView = new Floater(context, attrs, defStyleAttr, maxValue, thumbSize, separation);
}
public void updateSizes(String maxValue) {
dismissComplete();
if (mPopupView != null) {
mPopupView.mMarker.resetSizes(maxValue);
}
}
public void setListener(MarkerDrawable.MarkerAnimationListener listener) {
mListener = listener;
}
/**
* We want the Floater to be full-width because the contents will be moved from side to side.
* We may/should change this in the future to use just the PARENT View width and/or pass it in the constructor
*/
private void measureFloater() {
int specWidth = View.MeasureSpec.makeMeasureSpec(screenSize.x, View.MeasureSpec.EXACTLY);
int specHeight = View.MeasureSpec.makeMeasureSpec(screenSize.y, View.MeasureSpec.AT_MOST);
mPopupView.measure(specWidth, specHeight);
}
public void setValue(CharSequence value) {
mPopupView.mMarker.setValue(value);
}
public boolean isShowing() {
return mShowing;
}
public void showIndicator(View parent, Rect touchBounds) {
if (isShowing()) {
mPopupView.mMarker.animateOpen();
return;
}
IBinder windowToken = parent.getWindowToken();
if (windowToken != null) {
WindowManager.LayoutParams p = createPopupLayout(windowToken);
p.gravity = Gravity.TOP | GravityCompat.START;
updateLayoutParamsForPosiion(parent, p, touchBounds.bottom);
mShowing = true;
translateViewIntoPosition(touchBounds.centerX());
invokePopup(p);
}
}
public void move(int x) {
if (!isShowing()) {
return;
}
translateViewIntoPosition(x);
}
public void setColors(int startColor, int endColor) {
mPopupView.setColors(startColor, endColor);
}
/**
* This will start the closing animation of the Marker and call onClosingComplete when finished
*/
public void dismiss() {
mPopupView.mMarker.animateClose();
}
/**
* FORCE the popup window to be removed.
* You typically calls this when the parent view is being removed from the window to avoid a Window Leak
*/
public void dismissComplete() {
if (isShowing()) {
mShowing = false;
try {
mWindowManager.removeViewImmediate(mPopupView);
} finally {
}
}
}
private void updateLayoutParamsForPosiion(View anchor, WindowManager.LayoutParams p, int yOffset) {
DisplayMetrics displayMetrics = anchor.getResources().getDisplayMetrics();
screenSize.set(displayMetrics.widthPixels, displayMetrics.heightPixels);
measureFloater();
int measuredHeight = mPopupView.getMeasuredHeight();
int paddingBottom = mPopupView.mMarker.getPaddingBottom();
anchor.getLocationInWindow(mDrawingLocation);
p.x = 0;
p.y = mDrawingLocation[1] - measuredHeight + yOffset + paddingBottom;
p.width = screenSize.x;
p.height = measuredHeight;
}
private void translateViewIntoPosition(final int x) {
mPopupView.setFloatOffset(x + mDrawingLocation[0]);
}
private void invokePopup(WindowManager.LayoutParams p) {
mWindowManager.addView(mPopupView, p);
mPopupView.mMarker.animateOpen();
}
private WindowManager.LayoutParams createPopupLayout(IBinder token) {
WindowManager.LayoutParams p = new WindowManager.LayoutParams();
p.gravity = Gravity.START | Gravity.TOP;
p.width = ViewGroup.LayoutParams.MATCH_PARENT;
p.height = ViewGroup.LayoutParams.MATCH_PARENT;
p.format = PixelFormat.TRANSLUCENT;
p.flags = computeFlags(p.flags);
p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
p.token = token;
p.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
p.setTitle("DiscreteSeekBar Indicator:" + Integer.toHexString(hashCode()));
return p;
}
/**
* I'm NOT completely sure how all this bitwise things work...
*
* @param curFlags
* @return
*/
private int computeFlags(int curFlags) {
curFlags &= ~(
WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES |
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH |
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
curFlags |= WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES;
curFlags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
curFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
return curFlags;
}
/**
* Small FrameLayout class to hold and move the bubble around when requested
* I wanted to use the {@link Marker} directly
* but doing so would make some things harder to implement
* (like moving the marker around, having the Marker's outline to work, etc)
*/
private class Floater extends FrameLayout implements MarkerDrawable.MarkerAnimationListener {
private Marker mMarker;
private int mOffset;
public Floater(Context context, AttributeSet attrs, int defStyleAttr, String maxValue, int thumbSize, int separation) {
super(context);
mMarker = new Marker(context, attrs, defStyleAttr, maxValue, thumbSize, separation);
addView(mMarker, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP));
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
measureChildren(widthMeasureSpec, heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSie = mMarker.getMeasuredHeight();
setMeasuredDimension(widthSize, heightSie);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int centerDiffX = mMarker.getMeasuredWidth() / 2;
int offset = (mOffset - centerDiffX);
mMarker.layout(offset, 0, offset + mMarker.getMeasuredWidth(), mMarker.getMeasuredHeight());
}
public void setFloatOffset(int x) {
mOffset = x;
int centerDiffX = mMarker.getMeasuredWidth() / 2;
int offset = (x - centerDiffX);
mMarker.offsetLeftAndRight(offset - mMarker.getLeft());
//Without hardware acceleration (or API levels<11), offsetting a view seems to NOT invalidate the proper area.
//We should calc the proper invalidate Rect but this will be for now...
if (!SeekBarCompat.isHardwareAccelerated(this)) {
invalidate();
}
}
@Override
public void onClosingComplete() {
if (mListener != null) {
mListener.onClosingComplete();
}
dismissComplete();
}
@Override
public void onOpeningComplete() {
if (mListener != null) {
mListener.onOpeningComplete();
}
}
public void setColors(int startColor, int endColor) {
mMarker.setColors(startColor, endColor);
}
}
}

View File

@@ -0,0 +1,73 @@
package com.yunbao.faceunity.seekbar.internal.compat;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
/**
* Currently, there's no {@link android.animation.ValueAnimator} compatibility version
* and as we didn't want to throw in external dependencies, we made this small class.
* <p/>
* <p>
* This will work like {@link android.support.v4.view.ViewPropertyAnimatorCompat}, that is,
* not doing anything on API<11 and using the default {@link android.animation.ValueAnimator}
* on API>=11
* </p>
* <p>
* This class is used to provide animation to the {@link DiscreteSeekBar}
* when navigating with the Keypad
* </p>
*
* @hide
*/
public abstract class AnimatorCompat {
public interface AnimationFrameUpdateListener {
public void onAnimationFrame(float currentValue);
}
AnimatorCompat() {
}
public abstract void cancel();
public abstract boolean isRunning();
public abstract void setDuration(int progressAnimationDuration);
public abstract void start();
public static final AnimatorCompat create(float start, float end, AnimationFrameUpdateListener listener) {
return new AnimatorCompatBase(start, end, listener);
}
private static class AnimatorCompatBase extends AnimatorCompat {
private final AnimationFrameUpdateListener mListener;
private final float mEndValue;
public AnimatorCompatBase(float start, float end, AnimationFrameUpdateListener listener) {
mListener = listener;
mEndValue = end;
}
@Override
public void cancel() {
}
@Override
public boolean isRunning() {
return false;
}
@Override
public void setDuration(int progressAnimationDuration) {
}
@Override
public void start() {
mListener.onAnimationFrame(mEndValue);
}
}
}

View File

@@ -0,0 +1,130 @@
package com.yunbao.faceunity.seekbar.internal.compat;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.view.View;
import android.view.ViewParent;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.graphics.drawable.DrawableCompat;
import com.yunbao.faceunity.seekbar.internal.drawable.AlmostRippleDrawable;
import com.yunbao.faceunity.seekbar.internal.drawable.MarkerDrawable;
/**
* Wrapper compatibility class to call some API-Specific methods
* And offer alternate procedures when possible
*
* @hide
*/
public class SeekBarCompat {
/**
* Sets the custom Outline provider on API>=21.
* Does nothing on API<21
*
* @param view
* @param markerDrawable
*/
public static void setOutlineProvider(View view, final MarkerDrawable markerDrawable) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
SeekBarCompatDontCrash.setOutlineProvider(view, markerDrawable);
}
}
/**
* Our DiscreteSeekBar implementation uses a circular drawable on API < 21
* because we don't set it as Background, but draw it ourselves
*
* @param colorStateList
* @return
*/
public static Drawable getRipple(ColorStateList colorStateList) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return SeekBarCompatDontCrash.getRipple(colorStateList);
} else {
return new AlmostRippleDrawable(colorStateList);
}
}
/**
* Sets the color of the seekbar ripple
*
* @param drawable
* @param colorStateList The ColorStateList the track ripple will be changed to
*/
public static void setRippleColor(@NonNull Drawable drawable, ColorStateList colorStateList) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
((RippleDrawable) drawable).setColor(colorStateList);
} else {
((AlmostRippleDrawable) drawable).setColor(colorStateList);
}
}
/**
* As our DiscreteSeekBar implementation uses a circular drawable on API < 21
* we want to use the same method to set its bounds as the Ripple's hotspot bounds.
*
* @param drawable
* @param left
* @param top
* @param right
* @param bottom
*/
public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//We don't want the full size rect, Lollipop ripple would be too big
int size = (right - left) / 8;
DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size);
} else {
drawable.setBounds(left, top, right, bottom);
}
}
/**
* android.support.v4.view.ViewCompat SHOULD include this once and for all!!
* But it doesn't...
*
* @param view
* @param background
*/
@SuppressWarnings("deprecation")
public static void setBackground(View view, Drawable background) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
SeekBarCompatDontCrash.setBackground(view, background);
} else {
view.setBackgroundDrawable(background);
}
}
/**
* Sets the TextView text direction attribute when possible
*
* @param textView
* @param textDirection
* @see TextView#setTextDirection(int)
*/
public static void setTextDirection(TextView textView, int textDirection) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
SeekBarCompatDontCrash.setTextDirection(textView, textDirection);
}
}
public static boolean isInScrollingContainer(ViewParent p) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return SeekBarCompatDontCrash.isInScrollingContainer(p);
}
return false;
}
public static boolean isHardwareAccelerated(View view) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return SeekBarCompatDontCrash.isHardwareAccelerated(view);
}
return false;
}
}

View File

@@ -0,0 +1,59 @@
package com.yunbao.faceunity.seekbar.internal.compat;
import android.annotation.TargetApi;
import android.content.res.ColorStateList;
import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewParent;
import android.widget.TextView;
import com.yunbao.faceunity.seekbar.internal.drawable.MarkerDrawable;
/**
* Wrapper compatibility class to call some API-Specific methods
* And offer alternate procedures when possible
*
* @hide
*/
@TargetApi(21)
class SeekBarCompatDontCrash {
public static void setOutlineProvider(View marker, final MarkerDrawable markerDrawable) {
marker.setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
outline.setConvexPath(markerDrawable.getPath());
}
});
}
public static Drawable getRipple(ColorStateList colorStateList) {
return new RippleDrawable(colorStateList, null, null);
}
public static void setBackground(View view, Drawable background) {
view.setBackground(background);
}
public static void setTextDirection(TextView number, int textDirection) {
number.setTextDirection(textDirection);
}
public static boolean isInScrollingContainer(ViewParent p) {
while (p != null && p instanceof ViewGroup) {
if (((ViewGroup) p).shouldDelayChildPressedState()) {
return true;
}
p = p.getParent();
}
return false;
}
public static boolean isHardwareAccelerated(View view) {
return view.isHardwareAccelerated();
}
}

View File

@@ -0,0 +1,206 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.os.SystemClock;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
public class AlmostRippleDrawable extends StateDrawable implements Animatable {
private static final long FRAME_DURATION = 1000 / 60;
private static final int ANIMATION_DURATION = 250;
private static final float INACTIVE_SCALE = 0f;
private static final float ACTIVE_SCALE = 1f;
private float mCurrentScale = INACTIVE_SCALE;
private Interpolator mInterpolator;
private long mStartTime;
private boolean mReverse = false;
private boolean mRunning = false;
private int mDuration = ANIMATION_DURATION;
private float mAnimationInitialValue;
//We don't use colors just with our drawable state because of animations
private int mPressedColor;
private int mFocusedColor;
private int mDisabledColor;
private int mRippleColor;
private int mRippleBgColor;
public AlmostRippleDrawable(@NonNull ColorStateList tintStateList) {
super(tintStateList);
mInterpolator = new AccelerateDecelerateInterpolator();
setColor(tintStateList);
}
public void setColor(@NonNull ColorStateList tintStateList) {
int defaultColor = tintStateList.getDefaultColor();
mFocusedColor = tintStateList.getColorForState(new int[]{android.R.attr.state_enabled, android.R.attr.state_focused}, defaultColor);
mPressedColor = tintStateList.getColorForState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed}, defaultColor);
mDisabledColor = tintStateList.getColorForState(new int[]{-android.R.attr.state_enabled}, defaultColor);
//The ripple should be partially transparent
mFocusedColor = getModulatedAlphaColor(130, mFocusedColor);
mPressedColor = getModulatedAlphaColor(130, mPressedColor);
mDisabledColor = getModulatedAlphaColor(130, mDisabledColor);
}
private static int getModulatedAlphaColor(int alphaValue, int originalColor) {
int alpha = Color.alpha(originalColor);
int scale = alphaValue + (alphaValue >> 7);
alpha = alpha * scale >> 8;
return Color.argb(alpha, Color.red(originalColor), Color.green(originalColor), Color.blue(originalColor));
}
@Override
public void doDraw(Canvas canvas, Paint paint) {
Rect bounds = getBounds();
int size = Math.min(bounds.width(), bounds.height());
float scale = mCurrentScale;
int rippleColor = mRippleColor;
int bgColor = mRippleBgColor;
float radius = (size / 2);
float radiusAnimated = radius * scale;
if (scale > INACTIVE_SCALE) {
if (bgColor != 0) {
paint.setColor(bgColor);
paint.setAlpha(decreasedAlpha(Color.alpha(bgColor)));
canvas.drawCircle(bounds.centerX(), bounds.centerY(), radius, paint);
}
if (rippleColor != 0) {
paint.setColor(rippleColor);
paint.setAlpha(modulateAlpha(Color.alpha(rippleColor)));
canvas.drawCircle(bounds.centerX(), bounds.centerY(), radiusAnimated, paint);
}
}
}
private int decreasedAlpha(int alpha) {
int scale = 100 + (100 >> 7);
return alpha * scale >> 8;
}
@Override
public boolean setState(int[] stateSet) {
int[] oldState = getState();
boolean oldPressed = false;
for (int i : oldState) {
if (i == android.R.attr.state_pressed) {
oldPressed = true;
}
}
super.setState(stateSet);
boolean focused = false;
boolean pressed = false;
boolean disabled = true;
for (int i : stateSet) {
if (i == android.R.attr.state_focused) {
focused = true;
} else if (i == android.R.attr.state_pressed) {
pressed = true;
} else if (i == android.R.attr.state_enabled) {
disabled = false;
}
}
if (disabled) {
unscheduleSelf(mUpdater);
mRippleColor = mDisabledColor;
mRippleBgColor = 0;
mCurrentScale = ACTIVE_SCALE / 2;
invalidateSelf();
} else {
if (pressed) {
animateToPressed();
mRippleColor = mRippleBgColor = mPressedColor;
} else if (oldPressed) {
mRippleColor = mRippleBgColor = mPressedColor;
animateToNormal();
} else if (focused) {
mRippleColor = mFocusedColor;
mRippleBgColor = 0;
mCurrentScale = ACTIVE_SCALE;
invalidateSelf();
} else {
mRippleColor = 0;
mRippleBgColor = 0;
mCurrentScale = INACTIVE_SCALE;
invalidateSelf();
}
}
return true;
}
public void animateToPressed() {
unscheduleSelf(mUpdater);
if (mCurrentScale < ACTIVE_SCALE) {
mReverse = false;
mRunning = true;
mAnimationInitialValue = mCurrentScale;
float durationFactor = 1f - ((mAnimationInitialValue - INACTIVE_SCALE) / (ACTIVE_SCALE - INACTIVE_SCALE));
mDuration = (int) (ANIMATION_DURATION * durationFactor);
mStartTime = SystemClock.uptimeMillis();
scheduleSelf(mUpdater, mStartTime + FRAME_DURATION);
}
}
public void animateToNormal() {
unscheduleSelf(mUpdater);
if (mCurrentScale > INACTIVE_SCALE) {
mReverse = true;
mRunning = true;
mAnimationInitialValue = mCurrentScale;
float durationFactor = 1f - ((mAnimationInitialValue - ACTIVE_SCALE) / (INACTIVE_SCALE - ACTIVE_SCALE));
mDuration = (int) (ANIMATION_DURATION * durationFactor);
mStartTime = SystemClock.uptimeMillis();
scheduleSelf(mUpdater, mStartTime + FRAME_DURATION);
}
}
private void updateAnimation(float factor) {
float initial = mAnimationInitialValue;
float destination = mReverse ? INACTIVE_SCALE : ACTIVE_SCALE;
mCurrentScale = initial + (destination - initial) * factor;
invalidateSelf();
}
private final Runnable mUpdater = new Runnable() {
@Override
public void run() {
long currentTime = SystemClock.uptimeMillis();
long diff = currentTime - mStartTime;
if (diff < mDuration) {
float interpolation = mInterpolator.getInterpolation((float) diff / (float) mDuration);
scheduleSelf(mUpdater, currentTime + FRAME_DURATION);
updateAnimation(interpolation);
} else {
unscheduleSelf(mUpdater);
mRunning = false;
updateAnimation(1f);
}
}
};
@Override
public void start() {
//No-Op. We control our own animation
}
@Override
public void stop() {
//No-Op. We control our own animation
}
@Override
public boolean isRunning() {
return mRunning;
}
}

View File

@@ -0,0 +1,235 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Animatable;
import android.os.SystemClock;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
/**
* Implementation of {@link StateDrawable} to draw a morphing marker symbol.
* <p>
* It's basically an implementation of an {@link Animatable} Drawable with the following details:
* </p>
* <ul>
* <li>Animates from a circle shape to a "marker" shape just using a RoundRect</li>
* <li>Animates color change from the normal state color to the pressed state color</li>
* <li>Uses a {@link Path} to also serve as Outline for API>=21</li>
* </ul>
*
* @hide
*/
public class MarkerDrawable extends StateDrawable implements Animatable {
private static final long FRAME_DURATION = 1000 / 60;
private static final int ANIMATION_DURATION = 250;
private float mCurrentScale = 0f;
private Interpolator mInterpolator;
private long mStartTime;
private boolean mReverse = false;
private boolean mRunning = false;
private int mDuration = ANIMATION_DURATION;
//size of the actual thumb drawable to use as circle state size
private float mClosedStateSize;
//value to store que current scale when starting an animation and interpolate from it
private float mAnimationInitialValue;
//extra offset directed from the View to account
//for its internal padding between circle state and marker state
private int mExternalOffset;
//colors for interpolation
private int mStartColor;//Color when the Marker is OPEN
private int mEndColor;//Color when the arker is CLOSED
Path mPath = new Path();
RectF mRect = new RectF();
Matrix mMatrix = new Matrix();
private MarkerAnimationListener mMarkerListener;
public MarkerDrawable(@NonNull ColorStateList tintList, int closedSize) {
super(tintList);
mInterpolator = new AccelerateDecelerateInterpolator();
mClosedStateSize = closedSize;
mStartColor = tintList.getColorForState(new int[]{android.R.attr.state_enabled, android.R.attr.state_pressed}, tintList.getDefaultColor());
mEndColor = tintList.getDefaultColor();
}
public void setExternalOffset(int offset) {
mExternalOffset = offset;
}
/**
* The two colors that will be used for the seek thumb.
*
* @param startColor Color used for the seek thumb
* @param endColor Color used for popup indicator
*/
public void setColors(int startColor, int endColor) {
mStartColor = startColor;
mEndColor = endColor;
}
@Override
void doDraw(Canvas canvas, Paint paint) {
if (!mPath.isEmpty()) {
paint.setStyle(Paint.Style.FILL);
int color = blendColors(mStartColor, mEndColor, mCurrentScale);
paint.setColor(color);
canvas.drawPath(mPath, paint);
}
}
public Path getPath() {
return mPath;
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
computePath(bounds);
}
private void computePath(Rect bounds) {
final float currentScale = mCurrentScale;
final Path path = mPath;
final RectF rect = mRect;
final Matrix matrix = mMatrix;
path.reset();
int totalSize = Math.min(bounds.width(), bounds.height());
float initial = mClosedStateSize;
float destination = totalSize;
float currentSize = initial + (destination - initial) * currentScale;
float halfSize = currentSize / 2f;
float inverseScale = 1f - currentScale;
float cornerSize = halfSize * inverseScale;
float[] corners = new float[]{halfSize, halfSize, halfSize, halfSize, halfSize, halfSize, cornerSize, cornerSize};
rect.set(bounds.left, bounds.top, bounds.left + currentSize, bounds.top + currentSize);
path.addRoundRect(rect, corners, Path.Direction.CCW);
matrix.reset();
matrix.postRotate(-45, bounds.left + halfSize, bounds.top + halfSize);
matrix.postTranslate((bounds.width() - currentSize) / 2, 0);
float hDiff = (bounds.bottom - currentSize - mExternalOffset) * inverseScale;
matrix.postTranslate(0, hDiff);
path.transform(matrix);
}
private void updateAnimation(float factor) {
float initial = mAnimationInitialValue;
float destination = mReverse ? 0f : 1f;
mCurrentScale = initial + (destination - initial) * factor;
computePath(getBounds());
invalidateSelf();
}
public void animateToPressed() {
unscheduleSelf(mUpdater);
mReverse = false;
if (mCurrentScale < 1) {
mRunning = true;
mAnimationInitialValue = mCurrentScale;
float durationFactor = 1f - mCurrentScale;
mDuration = (int) (ANIMATION_DURATION * durationFactor);
mStartTime = SystemClock.uptimeMillis();
scheduleSelf(mUpdater, mStartTime + FRAME_DURATION);
} else {
notifyFinishedToListener();
}
}
public void animateToNormal() {
mReverse = true;
unscheduleSelf(mUpdater);
if (mCurrentScale > 0) {
mRunning = true;
mAnimationInitialValue = mCurrentScale;
float durationFactor = 1f - mCurrentScale;
mDuration = ANIMATION_DURATION - (int) (ANIMATION_DURATION * durationFactor);
mStartTime = SystemClock.uptimeMillis();
scheduleSelf(mUpdater, mStartTime + FRAME_DURATION);
} else {
notifyFinishedToListener();
}
}
private final Runnable mUpdater = new Runnable() {
@Override
public void run() {
long currentTime = SystemClock.uptimeMillis();
long diff = currentTime - mStartTime;
if (diff < mDuration) {
float interpolation = mInterpolator.getInterpolation((float) diff / (float) mDuration);
scheduleSelf(mUpdater, currentTime + FRAME_DURATION);
updateAnimation(interpolation);
} else {
unscheduleSelf(mUpdater);
mRunning = false;
updateAnimation(1f);
notifyFinishedToListener();
}
}
};
public void setMarkerListener(MarkerAnimationListener listener) {
mMarkerListener = listener;
}
private void notifyFinishedToListener() {
if (mMarkerListener != null) {
if (mReverse) {
mMarkerListener.onClosingComplete();
} else {
mMarkerListener.onOpeningComplete();
}
}
}
@Override
public void start() {
//No-Op. We control our own animation
}
@Override
public void stop() {
unscheduleSelf(mUpdater);
}
@Override
public boolean isRunning() {
return mRunning;
}
private static int blendColors(int color1, int color2, float factor) {
final float inverseFactor = 1f - factor;
float a = (Color.alpha(color1) * factor) + (Color.alpha(color2) * inverseFactor);
float r = (Color.red(color1) * factor) + (Color.red(color2) * inverseFactor);
float g = (Color.green(color1) * factor) + (Color.green(color2) * inverseFactor);
float b = (Color.blue(color1) * factor) + (Color.blue(color2) * inverseFactor);
return Color.argb((int) a, (int) r, (int) g, (int) b);
}
/**
* A listener interface to porpagate animation events
* This is the "poor's man" AnimatorListener for this Drawable
*/
public interface MarkerAnimationListener {
public void onClosingComplete();
public void onOpeningComplete();
}
}

View File

@@ -0,0 +1,105 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
/**
* A drawable that changes it's Paint color depending on the Drawable State
* <p>
* Subclasses should implement {@link #doDraw(Canvas, Paint)}
* </p>
*
* @hide
*/
public abstract class StateDrawable extends Drawable {
private ColorStateList mTintStateList;
private final Paint mPaint;
private int mCurrentColor;
private int mAlpha = 255;
public StateDrawable(@NonNull ColorStateList tintStateList) {
super();
setColorStateList(tintStateList);
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
@Override
public boolean isStateful() {
return (mTintStateList.isStateful()) || super.isStateful();
}
@Override
public boolean setState(int[] stateSet) {
boolean handled = super.setState(stateSet);
handled = updateTint(stateSet) || handled;
return handled;
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
private boolean updateTint(int[] state) {
final int color = mTintStateList.getColorForState(state, mCurrentColor);
if (color != mCurrentColor) {
mCurrentColor = color;
//We've changed states
invalidateSelf();
return true;
}
return false;
}
@Override
public void draw(Canvas canvas) {
mPaint.setColor(mCurrentColor);
int alpha = modulateAlpha(Color.alpha(mCurrentColor));
mPaint.setAlpha(alpha);
doDraw(canvas, mPaint);
}
public void setColorStateList(@NonNull ColorStateList tintStateList) {
mTintStateList = tintStateList;
mCurrentColor = tintStateList.getDefaultColor();
}
/**
* Subclasses should implement this method to do the actual drawing
*
* @param canvas The current {@link Canvas} to draw into
* @param paint The {@link Paint} preconfigurred with the current
* {@link ColorStateList} color
*/
abstract void doDraw(Canvas canvas, Paint paint);
@Override
public void setAlpha(int alpha) {
mAlpha = alpha;
invalidateSelf();
}
int modulateAlpha(int alpha) {
int scale = mAlpha + (mAlpha >> 7);
return alpha * scale >> 8;
}
@Override
public int getAlpha() {
return mAlpha;
}
@Override
public void setColorFilter(ColorFilter cf) {
mPaint.setColorFilter(cf);
}
}

View File

@@ -0,0 +1,96 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.os.SystemClock;
import androidx.annotation.NonNull;
import com.yunbao.faceunity.seekbar.internal.Marker;
/**
* <h1>HACK</h1>
* <p>
* Special {@link StateDrawable} implementation
* to draw the Thumb circle.
* </p>
* <p>
* It's special because it will stop drawing once the state is pressed/focused BUT only after a small delay.
* </p>
* <p>
* This special delay is meant to help avoiding frame glitches while the {@link Marker} is added to the Window
* </p>
*
* @hide
*/
public class ThumbDrawable extends StateDrawable implements Animatable {
//The current size for this drawable. Must be converted to real DPs
public static final int DEFAULT_SIZE_DP = 12;
private final int mSize;
private boolean mOpen;
private boolean mRunning;
public ThumbDrawable(@NonNull ColorStateList tintStateList, int size) {
super(tintStateList);
mSize = size;
}
@Override
public int getIntrinsicWidth() {
return mSize;
}
@Override
public int getIntrinsicHeight() {
return mSize;
}
@Override
public void doDraw(Canvas canvas, Paint paint) {
if (!mOpen) {
Rect bounds = getBounds();
float radius = (mSize / 2);
canvas.drawCircle(bounds.centerX(), bounds.centerY(), radius, paint);
}
}
public void animateToPressed() {
scheduleSelf(opener, SystemClock.uptimeMillis() + 100);
mRunning = true;
}
public void animateToNormal() {
mOpen = false;
mRunning = false;
unscheduleSelf(opener);
invalidateSelf();
}
private Runnable opener = new Runnable() {
@Override
public void run() {
mOpen = true;
invalidateSelf();
mRunning = false;
}
};
@Override
public void start() {
//NOOP
}
@Override
public void stop() {
animateToNormal();
}
@Override
public boolean isRunning() {
return mRunning;
}
}

View File

@@ -0,0 +1,30 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import androidx.annotation.NonNull;
/**
* Simple {@link StateDrawable} implementation
* to draw circles/ovals
*
* @hide
*/
public class TrackOvalDrawable extends StateDrawable {
private RectF mRectF = new RectF();
public TrackOvalDrawable(@NonNull ColorStateList tintStateList) {
super(tintStateList);
}
@Override
void doDraw(Canvas canvas, Paint paint) {
mRectF.set(getBounds());
canvas.drawOval(mRectF, paint);
}
}

View File

@@ -0,0 +1,26 @@
package com.yunbao.faceunity.seekbar.internal.drawable;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Paint;
import androidx.annotation.NonNull;
/**
* Simple {@link StateDrawable} implementation
* to draw rectangles
*
* @hide
*/
public class TrackRectDrawable extends StateDrawable {
public TrackRectDrawable(@NonNull ColorStateList tintStateList) {
super(tintStateList);
}
@Override
void doDraw(Canvas canvas, Paint paint) {
canvas.drawRect(getBounds(), paint);
}
}

View File

@@ -0,0 +1,479 @@
package com.yunbao.faceunity.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.tabs.TabLayout;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.faceunity.R;
import com.yunbao.faceunity.adapters.ContainerRecyclerAdapter;
import com.yunbao.faceunity.adapters.MenuGroupRecyclerAdapter;
import com.yunbao.faceunity.adapters.vh.StyleViewHolder;
import com.yunbao.faceunity.data.FaceParam;
import com.yunbao.faceunity.data.FineStickerDataFactory;
import com.yunbao.faceunity.entity.BaseBean;
import com.yunbao.faceunity.entity.FunctionEnum;
import com.yunbao.faceunity.entity.MakeupCustomClassBean;
import com.yunbao.faceunity.entity.MenuGroupBean;
import com.yunbao.faceunity.entity.net.FineStickerEntity;
import com.yunbao.faceunity.entity.net.FineStickerTagEntity;
import com.yunbao.faceunity.repo.AnimojiSource;
import com.yunbao.faceunity.repo.BodyBeautySource;
import com.yunbao.faceunity.repo.FaceBeautySource;
import com.yunbao.faceunity.repo.MakeupSource;
import com.yunbao.faceunity.repo.PropSource;
import com.yunbao.faceunity.seekbar.DiscreteSeekBar;
import com.yunbao.faceunity.utils.FaceSPUtils;
import com.yunbao.faceunity.utils.net.StickerDownloadHelper;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* DESC
* Created on 2021/4/26
*/
public class FaceUnityView extends LinearLayout implements StickerDownloadHelper.Callback {
private Context mContext;
private RecyclerView menuGroup;
private RecyclerView containerRecycler;
private ContainerRecyclerAdapter containerAdapter;
private TabLayout tabLayout;
private TextView title;
private LinearLayout menu2, menuDiy, reset, menu2Reset;
private ImageView menu2Back, back, close, contrast;
private DiscreteSeekBar seekBar;
private IFaceUnityInter iFaceUnityInter;
private ConstraintLayout titleLayout;
private static final String TAG = "美颜";
public FaceUnityView(Context context) {
super(context);
mContext = context;
init();
}
public FaceUnityView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
mContext = context;
init();
}
public FaceUnityView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mContext = context;
init();
}
private void init() {
LayoutInflater.from(mContext).inflate(R.layout.layout_faceunity, this);
initView();
FineStickerDataFactory.getInstance().addCallback(this);
}
/**
* 初始化View
*/
private void initView() {
menuGroup = findViewById(R.id.menu_group);
containerRecycler = findViewById(R.id.menu2_container_view);
tabLayout = findViewById(R.id.menu2_tab);
title = findViewById(R.id.menu_title);
menu2 = findViewById(R.id.layout_faceunity_menu2);
back = findViewById(R.id.menu_back);
menu2Back = findViewById(R.id.menu2_back);
close = findViewById(R.id.menu_close);
reset = findViewById(R.id.menu_reset);
menu2Reset = findViewById(R.id.menu2_reset);
menuDiy = findViewById(R.id.menu_diy);
seekBar = findViewById(R.id.item_seekBar);
contrast = findViewById(R.id.item_contrast);
titleLayout = findViewById(R.id.titleLayout);
initMenuGroup();
setContainerRecycler(new ArrayList<>());
initViewClick();
gotoFaceBeauty();
}
/**
* 初始化配置点击事件
*/
private void initViewClick() {
menu2Back.setOnClickListener(v -> {
Object tag = menu2Back.getTag();
if (tag == null) {
goBackMainMenu();
} else if (tag.equals("makeup")) {
title.setText(R.string.home_function_name_makeup);
title.setVisibility(VISIBLE);
menuDiy.setVisibility(VISIBLE);
tabLayout.removeAllTabs();
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCombinations());
menu2Back.setTag(null);
}
});
menuDiy.setOnClickListener(v -> {
menu2Back.setTag("makeup");
changeRecyclerItemCount(5);
menuDiy.setVisibility(GONE);
ArrayList<MakeupCustomClassBean> list = MakeupSource.buildCustomClasses();
setTab(createTabs(list));
});
menu2Reset.setOnClickListener(view -> {
containerAdapter.reset();
});
contrast.setOnTouchListener((v, event) -> {
if (iFaceUnityInter == null) {
return false;
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
iFaceUnityInter.onPause();
} else if (event.getAction() == KeyEvent.ACTION_UP) {
iFaceUnityInter.onStart();
}
return true;
});
}
/**
* 对比接口
*/
public void setIFaceUnityInter(IFaceUnityInter iFaceUnityInter) {
this.iFaceUnityInter = iFaceUnityInter;
}
/**
* 回到默认界面
*/
private void goBackMainMenu() {
setContainerRecycler(new ArrayList<>());
title.setText("美顏特效選擇");
titleLayout.setVisibility(VISIBLE);
title.setVisibility(VISIBLE);
menu2.setVisibility(GONE);
menuGroup.setVisibility(VISIBLE);
menuDiy.setVisibility(GONE);
}
/**
* 目前只需要美颜功能,进入后直奔美颜
*/
private void gotoFaceBeauty() {
LinkedHashMap<Integer, Integer> map = new LinkedHashMap<>();
map.put(R.string.beauty_radio_skin_beauty, FaceParam.FACE_BEAUTY_SKIN);
map.put(R.string.beauty_radio_face_shape, FaceParam.FACE_BEAUTY_SHAPE);
map.put(R.string.beauty_radio_filter, FaceParam.FACE_BEAUTY_FILTER);
map.put(R.string.beauty_radio_style, FaceParam.FACE_BEAUTY_STYLE);
setContainerRecycler(FaceBeautySource.buildSkinParams());
changeRecyclerItemCount(2);
setTab(createTabs(map));
menuGroup.setVisibility(GONE);
titleLayout.setVisibility(GONE);
back.setVisibility(GONE);
menu2Back.setVisibility(GONE);
menu2.setVisibility(VISIBLE);
}
/**
* 配置主菜单
*/
private void initMenuGroup() {
MenuGroupRecyclerAdapter adapter = new MenuGroupRecyclerAdapter(mContext);
menuGroup.setLayoutManager(new GridLayoutManager(mContext, 4));
List<MenuGroupBean> layoutItem = new ArrayList<>();
layoutItem.add(new MenuGroupBean(R.string.home_function_name_beauty, R.mipmap.ico_home_beauty));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_makeup, R.mipmap.ico_home_makeup));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_beauty_body, R.mipmap.ico_home_beauty_body));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_big_head, R.mipmap.ico_home_big_head));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_animoji, R.mipmap.ico_home_animoji));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_sticker, R.mipmap.ico_home_sticker));
layoutItem.add(new MenuGroupBean(R.string.home_function_name_fine_sticker, R.mipmap.ico_home_fine_sticker));
adapter.setList(layoutItem);
adapter.setOnItemClickListener(position -> {
LinkedHashMap<Integer, Integer> map = new LinkedHashMap<>();
title.setVisibility(GONE);
switch (position) {
case 0:
map.put(R.string.beauty_radio_skin_beauty, FaceParam.FACE_BEAUTY_SKIN);
map.put(R.string.beauty_radio_face_shape, FaceParam.FACE_BEAUTY_SHAPE);
map.put(R.string.beauty_radio_filter, FaceParam.FACE_BEAUTY_FILTER);
map.put(R.string.beauty_radio_style, FaceParam.FACE_BEAUTY_STYLE);
setContainerRecycler(FaceBeautySource.buildSkinParams());
break;
case 1:
title.setText(R.string.home_function_name_makeup);
title.setVisibility(VISIBLE);
menuDiy.setVisibility(VISIBLE);
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCombinations());
break;
case 2:
title.setText(R.string.home_function_name_beauty_body);
title.setVisibility(VISIBLE);
changeRecyclerItemCount(2);
setContainerRecycler(BodyBeautySource.buildBodyBeauty());
break;
case 3:
changeRecyclerItemCount(5);
setContainerRecycler(PropSource.buildPropBeans(FunctionEnum.BIG_HEAD));
break;
case 4:
changeRecyclerItemCount(5);
map.put(R.string.animoji_filter, FaceParam.FACE_ANIMOJI);
map.put(R.string.cartoon_filter, FaceParam.FACE_ANIM);
setContainerRecycler(AnimojiSource.buildAnimojis());
break;
case 5:
changeRecyclerItemCount(5);
setContainerRecycler(PropSource.buildPropBeans(FunctionEnum.STICKER));
break;
case 6:
List<FineStickerTagEntity> tagList = FineStickerDataFactory.getInstance().loadTagList();
if (!tagList.isEmpty()) {
setTab(createTabs(tagList));
}
break;
}
setTab(createTabs(map));
menuGroup.setVisibility(GONE);
menu2.setVisibility(VISIBLE);
});
menuGroup.setAdapter(adapter);
}
/**
* 创建Tab
*/
private List<TabLayout.Tab> createTabs(Map<Integer, Integer> map) {
List<TabLayout.Tab> list = new ArrayList<>();
for (Integer key : map.keySet()) {
TabLayout.Tab tab = tabLayout.newTab().setText(key);
tab.setTag(map.get(key));
list.add(tab);
}
return list;
}
/**
* 创建菜单
*/
private List<TabLayout.Tab> createTabs(List<FineStickerTagEntity> tags) {
List<TabLayout.Tab> list = new ArrayList<>();
for (FineStickerTagEntity tag : tags) {
TabLayout.Tab tab;
if (WordUtil.isZh()) {
tab = tabLayout.newTab().setText(tag.getTag().split("/")[0]);
} else {
tab = tabLayout.newTab().setText(tag.getTag().split("/")[1]);
}
tab.setTag(tag);
list.add(tab);
}
return list;
}
/**
* 创建菜单
*/
private List<TabLayout.Tab> createTabs(ArrayList<MakeupCustomClassBean> tags) {
List<TabLayout.Tab> list = new ArrayList<>();
for (MakeupCustomClassBean tag : tags) {
TabLayout.Tab tab;
tab = tabLayout.newTab().setText(tag.getDesRes());
tab.setTag(tag.getBeanType());
list.add(tab);
}
return list;
}
/**
* 设置菜单
*/
private void setTab(List<TabLayout.Tab> tabs) {
tabLayout.removeAllTabs();
for (TabLayout.Tab tab : tabs) {
tabLayout.addTab(tab);
if (tab.getTag() instanceof Integer) {
if (FaceSPUtils.getInstance().getString(StyleViewHolder.class.getSimpleName() + "_") != null && (int) tab.getTag() == FaceParam.FACE_BEAUTY_STYLE) {
ToastUtil.show("请先重置风格推荐");
tab.select();
changeRecyclerItemCount(5);
setContainerRecycler(FaceBeautySource.buildStylesParams());
}
}
}
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
Object tabTag = tab.getTag();
if (tabTag instanceof Integer) {
if (FaceSPUtils.getInstance().getString(StyleViewHolder.class.getSimpleName() + "_") != null && (int) tab.getTag() < FaceParam.FACE_BEAUTY_STYLE) {
ToastUtil.show("请先重置风格推荐");
tabLayout.getTabAt(3).select();
return;
}
switch ((int) tab.getTag()) {
case FaceParam.FACE_BEAUTY_SKIN:
changeRecyclerItemCount(2);
setContainerRecycler(FaceBeautySource.buildSkinParams());
break;
case FaceParam.FACE_BEAUTY_SHAPE:
changeRecyclerItemCount(2);
setContainerRecycler(FaceBeautySource.buildShapeParams());
break;
case FaceParam.FACE_BEAUTY_FILTER:
changeRecyclerItemCount(5);
setContainerRecycler(FaceBeautySource.buildFilters());
break;
case FaceParam.FACE_BEAUTY_STYLE:
changeRecyclerItemCount(5);
setContainerRecycler(FaceBeautySource.buildStylesParams());
break;
case FaceParam.FACE_ANIMOJI:
changeRecyclerItemCount(5);
setContainerRecycler(AnimojiSource.buildAnimojis());
break;
case FaceParam.FACE_ANIM:
changeRecyclerItemCount(5);
setContainerRecycler(AnimojiSource.buildFilters());
break;
case FaceParam.FACE_MAKEUP_TYPE_FOUNDATION:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_FOUNDATION));
break;
case FaceParam.FACE_MAKEUP_TYPE_LIP_STICK:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_LIP_STICK));
break;
case FaceParam.FACE_MAKEUP_TYPE_BLUSHER:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_BLUSHER));
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_BROW:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_EYE_BROW));
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_SHADOW:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_EYE_SHADOW));
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_LINER:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_EYE_LINER));
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_LASH:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_EYE_LASH));
break;
case FaceParam.FACE_MAKEUP_TYPE_HIGH_LIGHT:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_HIGH_LIGHT));
break;
case FaceParam.FACE_MAKEUP_TYPE_SHADOW:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_SHADOW));
break;
case FaceParam.FACE_MAKEUP_TYPE_EYE_PUPIL:
changeRecyclerItemCount(5);
setContainerRecycler(MakeupSource.buildCustomItemParams().get(MakeupSource.FACE_MAKEUP_TYPE_EYE_PUPIL));
break;
default:
setContainerRecycler(new ArrayList<>());
}
} else if (tabTag instanceof FineStickerTagEntity) {
FineStickerTagEntity tag = (FineStickerTagEntity) tabTag;
FineStickerEntity sticker = FineStickerDataFactory.getInstance().loadStickerList(tag);
ArrayList<FineStickerEntity.DocsBean> list = new ArrayList<>();
FineStickerEntity.DocsBean docsBean = new FineStickerEntity.DocsBean();
docsBean.set_id("-1");
list.add(docsBean);
list.addAll(sticker.getDocs());
changeRecyclerItemCount(5);
setContainerRecycler(list);
}
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
}
/**
* 设置美颜选项配置行数图标为5个拖动条为2个
*
* @param count
*/
private void changeRecyclerItemCount(int count) {
containerRecycler.setLayoutManager(new GridLayoutManager(mContext, count));
}
/**
* 设置美颜Recycler内容
*
* @param list
*/
private void setContainerRecycler(ArrayList<? extends BaseBean> list) {
if (containerAdapter == null) {
containerAdapter = new ContainerRecyclerAdapter(mContext);
containerAdapter.setSeekBar(seekBar);
containerRecycler.setLayoutManager(new GridLayoutManager(mContext, 2));
containerRecycler.setAdapter(containerAdapter);
}
// titleLayout.setVisibility(title.getVisibility()==GONE?INVISIBLE:VISIBLE);
// Log.i(TAG, "setContainerRecycler: " + list.size());
containerAdapter.setList(list);
containerAdapter.notifyDataSetChanged();
}
@Override
public void onGetTags(String[] tags) {
List<FineStickerTagEntity> list = FineStickerDataFactory.formatTag(tags);
setTab(createTabs(list));
}
@Override
public void onGetList(String tag, FineStickerEntity fineSticker) {
}
@Override
public void onDownload(FineStickerEntity.DocsBean entity) {
}
@Override
public void onDownloadError(FineStickerEntity.DocsBean entity, String msg) {
}
public interface IFaceUnityInter {
void onPause();
void onStart();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,172 @@
package com.yunbao.faceunity.utils;
import android.content.Context;
import android.os.Build;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
/**
* cpu使用率获取工具类
* Created by lirui on 2017/8/2.
*/
public class CPUInfoUtil {
private long lastTotalCpu = 0;
private long lastProcessCpu = 0;
private final String PackageName;
private volatile boolean isRunningCPU = false;
private volatile double cpuRate = 0;
public CPUInfoUtil(Context context) {
if (Build.VERSION.SDK_INT >= 26) {
final String pn = context.getPackageName();
if (pn.length() <= 16) {
PackageName = pn;
} else {
PackageName = pn.substring(0, 15) + "+";
}
// Log.e(TAG, "CSVUtils PackageName " + PackageName);
isRunningCPU = true;
CPUInfoThread cpuinfothread = new CPUInfoThread();
cpuinfothread.start();
} else {
PackageName = null;
}
}
public double getProcessCpuUsed() {
if (Build.VERSION.SDK_INT >= 26) {
return cpuRate;
} else {
double pcpu = 0;
double tmp = 1.0;
long nowTotalCpu = getTotalCpu();
long nowProcessCpu = getMyProcessCpu();
if (nowTotalCpu != 0 && (nowTotalCpu - lastTotalCpu) != 0) {
// Log.e(TAG, "cpu used nowProcessCpu " + nowProcessCpu + " lastProcessCpu " + lastProcessCpu + " nowTotalCpu " + nowTotalCpu + " lastTotalCpu " + lastTotalCpu);
pcpu = 100 * (tmp * (nowProcessCpu - lastProcessCpu) / (nowTotalCpu - lastTotalCpu));
}
lastProcessCpu = nowProcessCpu;
lastTotalCpu = nowTotalCpu;
return pcpu < 0 ? 0 : pcpu;
}
}
public void close() {
if (Build.VERSION.SDK_INT >= 26) {
isRunningCPU = false;
}
}
private long getTotalCpu() {
String[] cpuInfos = null;
try {
RandomAccessFile reader = null;
reader = new RandomAccessFile("/proc/stat", "r");
String load = reader.readLine();
reader.close();
cpuInfos = load.split(" ");
} catch (IOException e) {
e.printStackTrace();
return 0;
}
long totalCpu = 0;
try {
totalCpu = Long.parseLong(cpuInfos[2])
+ Long.parseLong(cpuInfos[3]) + Long.parseLong(cpuInfos[4])
+ Long.parseLong(cpuInfos[6]) + Long.parseLong(cpuInfos[5])
+ Long.parseLong(cpuInfos[7]) + Long.parseLong(cpuInfos[8]);
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
return 0;
}
return totalCpu;
}
private long getMyProcessCpu() {
String[] cpuInfos = null;
try {
int pid = android.os.Process.myPid();
BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream("/proc/" + pid + "/stat")), 1000);
String load = reader.readLine();
reader.close();
cpuInfos = load.split(" ");
} catch (IOException e) {
e.printStackTrace();
return 0;
}
long appCpuTime = 0;
try {
appCpuTime = Long.parseLong(cpuInfos[13])
+ Long.parseLong(cpuInfos[14]) + Long.parseLong(cpuInfos[15])
+ Long.parseLong(cpuInfos[16]);
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
return 0;
}
return appCpuTime;
}
class CPUInfoThread extends Thread {
private double allCPU = 0;
@Override
public void run() {
String line = null;
InputStream is = null;
try {
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("top -d 1");
is = proc.getInputStream();
// 换成BufferedReader
BufferedReader buf = new BufferedReader(new InputStreamReader(is));
do {
line = buf.readLine();
if (allCPU == 0 && line.contains("user") && line.contains("nice") && line.contains("sys") && line.contains("idle") && line.contains("iow") && line.contains("irq") && line.contains("sirq") && line.contains("host")) {
if (line.indexOf("%cpu ") > 0)
allCPU = Double.parseDouble(line.split("%cpu ")[0]);
if (allCPU == 0) {
String[] s = line.split("%,");
for (String st : s) {
String[] sts = st.split(" ");
if (sts.length > 0)
allCPU += Double.parseDouble(sts[sts.length - 1]);
}
}
}
// 读取到相应pkgName跳出循环或者未找到
if (line == null || line.endsWith(PackageName)) {
// Log.e(TAG, "cpu line : " + line);
String str[] = line.split(" ");
int t = 0;
for (int i = str.length - 1; i > 0; i--) {
if (!str[i].isEmpty() && ++t == 4) {
// Log.e(TAG, "cpu : " + str[i] + " allCPU " + allCPU);
cpuRate = 100 * Double.parseDouble(str[i]) / allCPU;
}
}
continue;
}
} while (isRunningCPU);
if (is != null) {
buf.close();
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,168 @@
package com.yunbao.faceunity.utils;
import android.app.ActivityManager;
import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Process;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* Created by tujh on 2017/11/2.
*/
public class CSVUtils {
public static final String TAG = CSVUtils.class.getSimpleName();
/* 每 100 帧统计一次 */
public static final int FRAME_STEP = 100;
public static final String COMMA = ",";
private OutputStreamWriter mStreamWriter;
private ActivityManager mActivityManager;
private Handler mHandler;
private CPUInfoUtil mCPUInfoUtil;
private int mFrameRate;
private volatile double mCpuUsed;
private volatile double mAverageFps;
private volatile double mAverageRenderTime;
private volatile double mMemory;
private long mSumRenderTimeInNano;
private volatile long mTimestamp;
public CSVUtils(Context context) {
mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
mCPUInfoUtil = new CPUInfoUtil(context);
HandlerThread handlerThread = new HandlerThread(TAG, Process.THREAD_PRIORITY_BACKGROUND);
handlerThread.start();
mHandler = new Handler(handlerThread.getLooper());
}
public void initHeader(String folderName, StringBuilder headerInfo) {
Log.d(TAG, "initHeader() called with: folderName = [" + folderName + "], headerInfo = [" + headerInfo + "]");
StringBuilder stringBuilder = new StringBuilder().append("时间").append(COMMA)
.append("帧率").append(COMMA)
.append("渲染耗时").append(COMMA)
.append("CPU").append(COMMA)
.append("内存").append(COMMA);
if (headerInfo != null) {
stringBuilder.append(headerInfo);
}
stringBuilder.append("\n");
File file = new File(folderName);
File parentFile = file.getParentFile();
if (!parentFile.exists()) {
parentFile.mkdirs();
}
try {
if (!file.exists()) {
file.createNewFile();
}
mStreamWriter = new OutputStreamWriter(new FileOutputStream(file, false), "GBK");
} catch (IOException e) {
Log.e(TAG, "CSVUtils: ", e);
}
flush(stringBuilder);
mTimestamp = System.currentTimeMillis();
}
public void writeCsv(final StringBuilder extraInfo, long renderTimeInNano) {
if (mStreamWriter == null) {
return;
}
mSumRenderTimeInNano += renderTimeInNano;
if (mFrameRate % FRAME_STEP == FRAME_STEP - 1) {
mTimestamp = System.currentTimeMillis();
mAverageFps = FPSUtil.fpsAVG(FRAME_STEP);
mAverageRenderTime = (double) mSumRenderTimeInNano / FRAME_STEP / 1_000_000;
mSumRenderTimeInNano = 0;
mHandler.post(new Runnable() {
@Override
public void run() {
mCpuUsed = mCPUInfoUtil.getProcessCpuUsed();
mMemory = MemoryInfoUtil.getMemory(mActivityManager.getProcessMemoryInfo(new int[]{Process.myPid()}));
String strCPU = String.format(Locale.getDefault(), "%.2f", mCpuUsed);
String strMemory = String.format(Locale.getDefault(), "%.2f", mMemory);
StringBuilder stringBuilder = new StringBuilder();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.getDefault());
stringBuilder.append(dateFormat.format(new Date(mTimestamp))).append(COMMA)
.append(String.format(Locale.getDefault(), "%.2f", mAverageFps)).append(COMMA)
.append(String.format(Locale.getDefault(), "%.2f", mAverageRenderTime)).append(COMMA)
.append(strCPU).append(COMMA)
.append(strMemory).append(COMMA);
if (extraInfo != null) {
stringBuilder.append(extraInfo);
}
stringBuilder.append("\n");
flush(stringBuilder);
}
});
}
mFrameRate++;
}
private void flush(StringBuilder stringBuilder) {
if (mStreamWriter == null) {
return;
}
try {
mStreamWriter.write(stringBuilder.toString());
mStreamWriter.flush();
} catch (IOException e) {
Log.e(TAG, "flush: ", e);
}
}
public void close() {
Log.d(TAG, "close: ");
mHandler.post(new Runnable() {
@Override
public void run() {
if (mStreamWriter != null) {
try {
mStreamWriter.close();
mStreamWriter = null;
} catch (IOException e) {
Log.e(TAG, "close: ", e);
}
}
}
});
mHandler.getLooper().quitSafely();
mHandler = null;
mCPUInfoUtil.close();
}
public double getCpuUsed() {
return mCpuUsed;
}
public double getMemory() {
return mMemory;
}
public double getAverageRenderTime() {
return mAverageRenderTime;
}
public double getAverageFps() {
return mAverageFps;
}
}

View File

@@ -0,0 +1,63 @@
package com.yunbao.faceunity.utils;
/**
* FPS工具类
* Created by tujh on 2018/5/24.
*/
public class FPSUtil {
private static final int NANO_IN_ONE_MILLI_SECOND = 1000000;
private static final int NANO_IN_ONE_SECOND = 1000 * NANO_IN_ONE_MILLI_SECOND;
private static long sLastFrameTimeStamp = 0;
/**
* 每帧都计算
*
* @return
*/
public static double fps() {
long tmp = System.nanoTime();
double fps = ((double) NANO_IN_ONE_SECOND) / (tmp - sLastFrameTimeStamp);
sLastFrameTimeStamp = tmp;
// Log.e(TAG, "FPS : " + fps);
return fps;
}
private static long mStartTime = 0;
/**
* 平均值
*
* @return
*/
public static double fpsAVG(int time) {
long tmp = System.nanoTime();
double fps = ((double) NANO_IN_ONE_SECOND) * time / (tmp - mStartTime);
mStartTime = tmp;
// Log.e(TAG, "FPS : " + fps);
return fps;
}
private long mLimitMinTime = 33333333;
private long mLimitStartTime;
private int mLimitFrameRate;
public void setLimitMinTime(long limitMinTime) {
mLimitMinTime = limitMinTime;
}
public void limit() {
try {
if (mLimitFrameRate == 0 || mLimitFrameRate > 600000) {
mLimitStartTime = System.nanoTime();
mLimitFrameRate = 0;
}
long sleepTime = mLimitMinTime * mLimitFrameRate++ - (System.nanoTime() - mLimitStartTime);
if (sleepTime > 0) {
Thread.sleep(sleepTime / NANO_IN_ONE_MILLI_SECOND, (int) (sleepTime % NANO_IN_ONE_MILLI_SECOND));
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,326 @@
package com.yunbao.faceunity.utils;
import android.content.Context;
import android.hardware.Camera;
import com.faceunity.core.callback.OperateCallback;
import com.faceunity.core.entity.FURenderInputData;
import com.faceunity.core.entity.FURenderOutputData;
import com.faceunity.core.enumeration.CameraFacingEnum;
import com.faceunity.core.enumeration.FUAIProcessorEnum;
import com.faceunity.core.enumeration.FUAITypeEnum;
import com.faceunity.core.faceunity.FURenderConfig;
import com.faceunity.core.faceunity.FURenderKit;
import com.faceunity.core.faceunity.FURenderManager;
import com.faceunity.core.utils.CameraUtils;
import com.faceunity.core.utils.FULogger;
import com.yunbao.faceunity.listener.FURendererListener;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
/**
* DESC
* Created on 2021/4/26
*/
public class FURenderer extends IFURenderer {
private static final String TAG = "FURenderer";
public volatile static FURenderer INSTANCE;
public static FURenderer getInstance() {
if (INSTANCE == null) {
synchronized (FURenderer.class) {
if (INSTANCE == null) {
INSTANCE = new FURenderer();
INSTANCE.mFURenderKit = FURenderKit.getInstance();
}
}
}
return INSTANCE;
}
/**
* 状态回调监听
*/
private FURendererListener mFURendererListener;
/* 特效FURenderKit*/
private FURenderKit mFURenderKit;
/* AI道具*/
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
/* GL 线程 ID */
private Long mGlThreadId = 0L;
/* 任务队列 */
private ArrayList<Runnable> mEventQueue = new ArrayList<>(16);
private final Object queueLock = new Object();
/* 渲染开关标识 */
private volatile boolean mRendererSwitch = false;
/* 清除队列标识 */
private volatile boolean mClearQueue = false;
/* 相机角度-朝向映射 */
private HashMap<Integer, CameraFacingEnum> cameraOrientationMap = new HashMap<>();
/*检测类型*/
private FUAIProcessorEnum aIProcess = FUAIProcessorEnum.FACE_PROCESSOR;
/*检测标识*/
private int aIProcessTrackStatus = -1;
public String getVersion() {
return mFURenderKit.getVersion();
}
/**
* 初始化鉴权
*
* @param context
*/
@Override
public void setup(Context context) {
FURenderManager.setKitDebug(FULogger.LogLevel.INFO);
FURenderManager.setCoreDebug(FULogger.LogLevel.INFO);
FURenderManager.registerFURender(context, Authpack.A(), new OperateCallback() {
@Override
public void onSuccess(int i, @NotNull String s) {
if (i == FURenderConfig.OPERATE_SUCCESS_AUTH) {
mFURenderKit.getFUAIController().loadAIProcessor(BUNDLE_AI_FACE, FUAITypeEnum.FUAITYPE_FACEPROCESSOR);
mFURenderKit.getFUAIController().loadAIProcessor(BUNDLE_AI_HUMAN, FUAITypeEnum.FUAITYPE_HUMAN_PROCESSOR);
mFURenderKit.setReadBackSync(true);
int cameraFrontOrientation = CameraUtils.INSTANCE.getCameraOrientation(Camera.CameraInfo.CAMERA_FACING_FRONT);
int cameraBackOrientation = CameraUtils.INSTANCE.getCameraOrientation(Camera.CameraInfo.CAMERA_FACING_BACK);
cameraOrientationMap.put(cameraFrontOrientation, CameraFacingEnum.CAMERA_FRONT);
cameraOrientationMap.put(cameraBackOrientation, CameraFacingEnum.CAMERA_BACK);
}
}
@Override
public void onFail(int i, @NotNull String s) {
}
});
}
/**
* 开启合成状态
*/
@Override
public void prepareRenderer(FURendererListener mFURendererListener) {
this.mFURendererListener = mFURendererListener;
mRendererSwitch = true;
mClearQueue = false;
queueEvent(() -> mGlThreadId = Thread.currentThread().getId());
mFURendererListener.onPrepare();
}
/**
* 双输入接口,输入 buffer 和 texture必须在具有 GL 环境的线程调用
* 由于省去数据拷贝,性能相对最优,优先推荐使用。
* 缺点是无法保证 buffer 和纹理对齐,可能出现点位和效果对不上的情况。
*
* @param img NV21 buffer
* @param texId 纹理 ID
* @param width 宽
* @param height 高
* @return
*/
@Override
public int onDrawFrameDualInput(byte[] img, int texId, int width, int height) {
prepareDrawFrame();
if (!mRendererSwitch) {
return texId;
}
FURenderInputData inputData = new FURenderInputData(width, height);
if (img != null) {
inputData.setImageBuffer(new FURenderInputData.FUImageBuffer(inputBufferType, img));
}
if (texId != -1) {
inputData.setTexture(new FURenderInputData.FUTexture(inputTextureType, texId));
}
FURenderInputData.FURenderConfig config = inputData.getRenderConfig();
config.setExternalInputType(externalInputType);
config.setInputOrientation(inputOrientation);
config.setDeviceOrientation(deviceOrientation);
config.setInputBufferMatrix(inputBufferMatrix);
config.setInputTextureMatrix(inputTextureMatrix);
config.setOutputMatrix(outputMatrix);
config.setCameraFacing(cameraFacing);
FURenderOutputData outputData = mFURenderKit.renderWithInput(inputData);
if (outputData.getTexture() != null && outputData.getTexture().getTexId() > 0) {
return outputData.getTexture().getTexId();
}
return texId;
}
public FURenderOutputData onDrawFrameInputWithReturn(byte[] img, int width, int height) {
prepareDrawFrame();
if (!mRendererSwitch) {
return null ;
}
FURenderInputData inputData = new FURenderInputData(width, height);
if (img != null) {
inputData.setImageBuffer(new FURenderInputData.FUImageBuffer(inputBufferType, img));
}
FURenderInputData.FURenderConfig config = inputData.getRenderConfig();
config.setExternalInputType(externalInputType);
config.setInputOrientation(inputOrientation);
config.setDeviceOrientation(deviceOrientation);
config.setInputBufferMatrix(inputBufferMatrix);
config.setInputTextureMatrix(inputTextureMatrix);
config.setCameraFacing(cameraFacing);
config.setNeedBufferReturn(true);
config.setOutputMatrix(outputMatrix);
return mFURenderKit.renderWithInput(inputData);
}
/**
* 类似 GLSurfaceView 的 queueEvent 机制,把任务抛到 GL 线程执行。
*
* @param runnable
*/
@Override
public void queueEvent(Runnable runnable) {
if (runnable == null) {
return;
}
if (mGlThreadId == Thread.currentThread().getId()) {
runnable.run();
} else {
synchronized (queueLock) {
mEventQueue.add(runnable);
}
}
}
/**
* 释放资源
*/
@Override
public void release() {
mRendererSwitch = false;
mClearQueue = true;
mGlThreadId = 0L;
synchronized (queueLock) {
mEventQueue.clear();
mClearQueue = false;
mFURenderKit.release();
aIProcessTrackStatus = -1;
if (mFURendererListener != null) {
mFURendererListener.onRelease();
mFURendererListener = null;
}
}
}
/**
* 渲染前置执行
*
* @return
*/
private void prepareDrawFrame() {
benchmarkFPS();
// 执行任务队列中的任务
synchronized (queueLock) {
while (!mEventQueue.isEmpty() && !mClearQueue) {
mEventQueue.remove(0).run();
}
}
// AI检测
trackStatus();
}
/**
* 设置检测类型
*
* @param type
*/
@Override
public void setAIProcessTrackType(FUAIProcessorEnum type) {
aIProcess = type;
aIProcessTrackStatus = -1;
}
/**
* 设置FPS检测
*
* @param enable
*/
@Override
public void setMarkFPSEnable(boolean enable) {
mIsRunBenchmark = enable;
}
@Override
public void setInputOrientation(int inputOrientation) {
if (cameraOrientationMap.containsKey(inputOrientation)) {
setCameraFacing(cameraOrientationMap.get(inputOrientation));
}
super.setInputOrientation(inputOrientation);
}
/**
* AI识别数目检测
*/
private void trackStatus() {
int trackCount;
if (aIProcess == FUAIProcessorEnum.HAND_GESTURE_PROCESSOR) {
trackCount = mFURenderKit.getFUAIController().handProcessorGetNumResults();
} else if (aIProcess == FUAIProcessorEnum.HUMAN_PROCESSOR) {
trackCount = mFURenderKit.getFUAIController().humanProcessorGetNumResults();
} else {
trackCount = mFURenderKit.getFUAIController().isTracking();
}
if (trackCount != aIProcessTrackStatus) {
aIProcessTrackStatus = trackCount;
} else {
return;
}
if (mFURendererListener != null) {
mFURendererListener.onTrackStatusChanged(aIProcess, trackCount);
}
}
//endregion AI识别
//------------------------------FPS 渲染时长回调相关定义------------------------------------
private static final int NANO_IN_ONE_MILLI_SECOND = 1_000_000;
private static final int NANO_IN_ONE_SECOND = 1_000_000_000;
private static final int FRAME_COUNT = 20;
private boolean mIsRunBenchmark = false;
private int mCurrentFrameCount;
private long mLastFrameTimestamp;
private long mSumCallTime;
private long mCallStartTime;
private void benchmarkFPS() {
if (!mIsRunBenchmark) {
return;
}
if (++mCurrentFrameCount == FRAME_COUNT) {
long tmp = System.nanoTime();
double fps = (double) NANO_IN_ONE_SECOND / ((double) (tmp - mLastFrameTimestamp) / FRAME_COUNT);
double renderTime = (double) mSumCallTime / FRAME_COUNT / NANO_IN_ONE_MILLI_SECOND;
mLastFrameTimestamp = tmp;
mSumCallTime = 0;
mCurrentFrameCount = 0;
if (mFURendererListener != null) {
mFURendererListener.onFpsChanged(fps, renderTime);
}
}
}
}

View File

@@ -0,0 +1,271 @@
package com.yunbao.faceunity.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.faceunity.core.model.facebeauty.FaceBeauty;
import com.google.gson.Gson;
import com.yunbao.faceunity.data.FaceBeautyData;
import com.yunbao.faceunity.entity.FaceBeautyFilterBean;
import java.util.ArrayList;
/**
* 将FaceBeauty FaceBeautyData 互相设置
*/
public class FUUtils {
private static final String SP_NAME = "FaceBeauty";
private static final String SP_KEY_NAME = "faceBeautyData";
/**
* 将FaceBeauty 转 FaceBeautyData
*
* @param faceBeautyData
*/
public static void buildFaceBeautyData(FaceBeautyData faceBeautyData, FaceBeauty faceBeauty, ArrayList<FaceBeautyFilterBean> filterList, int styleTypeIndex) {
if (faceBeauty != null) {
/* 美肤 */
/* 磨皮类型 */
faceBeautyData.blurType = faceBeauty.getBlurType();
/* 磨皮程度 */
faceBeautyData.blurIntensity = faceBeauty.getBlurIntensity();
/* 美白程度 */
faceBeautyData.colorIntensity = faceBeauty.getColorIntensity();
/* 红润程度 */
faceBeautyData.redIntensity = faceBeauty.getRedIntensity();
/* 锐化程度 */
faceBeautyData.sharpenIntensity = faceBeauty.getSharpenIntensity();
/* 亮眼程度 */
faceBeautyData.eyeBrightIntensity = faceBeauty.getEyeBrightIntensity();
/* 美牙程度 */
faceBeautyData.toothIntensity = faceBeauty.getToothIntensity();
/* 去黑眼圈强度*/
faceBeautyData.removePouchIntensity = faceBeauty.getRemovePouchIntensity();
/* 去法令纹强度*/
faceBeautyData.removeLawPatternIntensity = faceBeauty.getRemoveLawPatternIntensity();
/* 美型 */
/* 瘦脸程度 */
faceBeautyData.cheekThinningIntensity = faceBeauty.getCheekThinningIntensity();
/* V脸程度 */
faceBeautyData.cheekVIntensity = faceBeauty.getCheekVIntensity();
/* 窄脸程度 */
faceBeautyData.cheekNarrowIntensity = faceBeauty.getCheekNarrowIntensity();
/* 短脸程度 */
faceBeautyData.cheekShortIntensity = faceBeauty.getCheekShortIntensity();
/* 小脸程度 */
faceBeautyData.cheekSmallIntensity = faceBeauty.getCheekSmallIntensity();
/* 瘦颧骨 */
faceBeautyData.cheekBonesIntensity = faceBeauty.getCheekBonesIntensity();
/* 瘦下颌骨 */
faceBeautyData.lowerJawIntensity = faceBeauty.getLowerJawIntensity();
/* 大眼程度 */
faceBeautyData.eyeEnlargingIntensity = faceBeauty.getEyeEnlargingIntensity();
/* 圆眼程度 */
faceBeautyData.eyeCircleIntensity = faceBeauty.getEyeCircleIntensity();
/* 下巴调整程度 */
faceBeautyData.chinIntensity = faceBeauty.getChinIntensity();
/* 额头调整程度 */
faceBeautyData.forHeadIntensity = faceBeauty.getForHeadIntensity();
/* 瘦鼻程度 */
faceBeautyData.noseIntensity = faceBeauty.getNoseIntensity();
/* 嘴巴调整程度 */
faceBeautyData.mouthIntensity = faceBeauty.getMouthIntensity();
/* 开眼角强度 */
faceBeautyData.canthusIntensity = faceBeauty.getCanthusIntensity();
/* 眼睛间距 */
faceBeautyData.eyeSpaceIntensity = faceBeauty.getEyeSpaceIntensity();
/* 眼睛角度 */
faceBeautyData.eyeRotateIntensity = faceBeauty.getEyeRotateIntensity();
/* 鼻子长度 */
faceBeautyData.longNoseIntensity = faceBeauty.getLongNoseIntensity();
/* 调节人中 */
faceBeautyData.philtrumIntensity = faceBeauty.getPhiltrumIntensity();
/* 微笑嘴角强度 */
faceBeautyData.smileIntensity = faceBeauty.getSmileIntensity();
/* 眉毛上下 */
faceBeautyData.browHeightIntensity = faceBeauty.getBrowHeightIntensity();
/* 眉毛间距 */
faceBeautyData.browSpaceIntensity = faceBeauty.getBrowSpaceIntensity();
/* 滤镜相关 */
if (filterList != null) {
for (FaceBeautyFilterBean filterBean:filterList) {
faceBeautyData.filterMap.put(filterBean.getKey(),filterBean.getIntensity());
}
}
/* 滤镜名称 */
faceBeautyData.filterName = faceBeauty.getFilterName();
/* 滤镜强度 */
faceBeautyData.filterIntensity = faceBeauty.getFilterIntensity();
/* 是否开启风格 */
faceBeautyData.styleTypeIndex = styleTypeIndex;
}
}
/**
* 将FaceBeauty 转 FaceBeautyData
*
* @param faceBeautyData
*/
public static boolean setFaceBeauty(FaceBeautyData faceBeautyData ,FaceBeauty faceBeauty) {
if (faceBeautyData == null) {
return false;
}
if (faceBeauty != null) {
/* 如果用户开启了风格推荐 */
//下面是否则
/* 美肤 */
/* 磨皮类型 */
if (faceBeautyData.blurType != faceBeauty.getBlurType())
faceBeauty.setBlurType(faceBeautyData.blurType);
/* 磨皮程度 */
if (faceBeautyData.blurIntensity != faceBeauty.getBlurIntensity())
faceBeauty.setBlurIntensity(faceBeautyData.blurIntensity);
/* 美白程度 */
if (faceBeautyData.colorIntensity != faceBeauty.getColorIntensity())
faceBeauty.setColorIntensity(faceBeautyData.colorIntensity);
/* 红润程度 */
if (faceBeautyData.redIntensity != faceBeauty.getRedIntensity())
faceBeauty.setRedIntensity(faceBeautyData.redIntensity);
/* 锐化程度 */
if (faceBeautyData.sharpenIntensity != faceBeauty.getSharpenIntensity())
faceBeauty.setSharpenIntensity(faceBeautyData.sharpenIntensity);
/* 亮眼程度 */
if (faceBeautyData.eyeBrightIntensity != faceBeauty.getEyeBrightIntensity())
faceBeauty.setEyeBrightIntensity(faceBeautyData.eyeBrightIntensity);
/* 美牙程度 */
if (faceBeautyData.toothIntensity != faceBeauty.getToothIntensity())
faceBeauty.setToothIntensity(faceBeautyData.toothIntensity);
/* 去黑眼圈强度*/
if (faceBeautyData.removePouchIntensity != faceBeauty.getRemovePouchIntensity())
faceBeauty.setRemovePouchIntensity(faceBeautyData.removePouchIntensity);
/* 去法令纹强度*/
if (faceBeautyData.removeLawPatternIntensity != faceBeauty.getRemoveLawPatternIntensity())
faceBeauty.setRemoveLawPatternIntensity(faceBeautyData.removeLawPatternIntensity);
/* 美型 */
/* 瘦脸程度 */
if (faceBeautyData.cheekThinningIntensity != faceBeauty.getCheekThinningIntensity())
faceBeauty.setCheekThinningIntensity(faceBeautyData.cheekThinningIntensity);
/* V脸程度 */
if (faceBeautyData.cheekVIntensity != faceBeauty.getCheekVIntensity())
faceBeauty.setCheekVIntensity(faceBeautyData.cheekVIntensity);
/* 窄脸程度 */
/* V脸程度 */
if (faceBeautyData.cheekNarrowIntensity != faceBeauty.getCheekNarrowIntensity())
faceBeauty.setCheekNarrowIntensity(faceBeautyData.cheekNarrowIntensity);
/* 短脸程度 */
if (faceBeautyData.cheekShortIntensity != faceBeauty.getCheekShortIntensity())
faceBeauty.setCheekShortIntensity(faceBeautyData.cheekShortIntensity);
/* 小脸程度 */
if (faceBeautyData.cheekSmallIntensity != faceBeauty.getCheekSmallIntensity())
faceBeauty.setCheekSmallIntensity(faceBeautyData.cheekSmallIntensity);
/* 瘦颧骨 */
if (faceBeautyData.cheekBonesIntensity != faceBeauty.getCheekBonesIntensity())
faceBeauty.setCheekBonesIntensity(faceBeautyData.cheekBonesIntensity);
/* 瘦下颌骨 */
if (faceBeautyData.lowerJawIntensity != faceBeauty.getLowerJawIntensity())
faceBeauty.setLowerJawIntensity(faceBeautyData.lowerJawIntensity);
/* 大眼程度 */
if (faceBeautyData.eyeEnlargingIntensity != faceBeauty.getEyeEnlargingIntensity())
faceBeauty.setEyeEnlargingIntensity(faceBeautyData.eyeEnlargingIntensity);
/* 圆眼程度 */
if (faceBeautyData.eyeCircleIntensity != faceBeauty.getEyeCircleIntensity())
faceBeauty.setEyeCircleIntensity(faceBeautyData.eyeCircleIntensity);
/* 下巴调整程度 */
if (faceBeautyData.chinIntensity != faceBeauty.getChinIntensity())
faceBeauty.setChinIntensity(faceBeautyData.chinIntensity);
/* 额头调整程度 */
if (faceBeautyData.forHeadIntensity != faceBeauty.getForHeadIntensity())
faceBeauty.setForHeadIntensity(faceBeautyData.forHeadIntensity);
/* 瘦鼻程度 */
if (faceBeautyData.noseIntensity != faceBeauty.getNoseIntensity())
faceBeauty.setNoseIntensity(faceBeautyData.noseIntensity);
/* 嘴巴调整程度 */
if (faceBeautyData.mouthIntensity != faceBeauty.getMouthIntensity())
faceBeauty.setMouthIntensity(faceBeautyData.mouthIntensity);
/* 开眼角强度 */
if (faceBeautyData.canthusIntensity != faceBeauty.getCanthusIntensity())
faceBeauty.setCanthusIntensity(faceBeautyData.canthusIntensity);
/* 眼睛间距 */
if (faceBeautyData.eyeSpaceIntensity != faceBeauty.getEyeSpaceIntensity())
faceBeauty.setEyeSpaceIntensity(faceBeautyData.eyeSpaceIntensity);
/* 眼睛角度 */
if (faceBeautyData.eyeRotateIntensity != faceBeauty.getEyeRotateIntensity())
faceBeauty.setEyeRotateIntensity(faceBeautyData.eyeRotateIntensity);
/* 鼻子长度 */
if (faceBeautyData.longNoseIntensity != faceBeauty.getLongNoseIntensity())
faceBeauty.setLongNoseIntensity(faceBeautyData.longNoseIntensity);
/* 调节人中 */
if (faceBeautyData.philtrumIntensity != faceBeauty.getPhiltrumIntensity())
faceBeauty.setPhiltrumIntensity(faceBeautyData.philtrumIntensity);
/* 微笑嘴角强度 */
if (faceBeautyData.smileIntensity != faceBeauty.getSmileIntensity())
faceBeauty.setSmileIntensity(faceBeautyData.smileIntensity);
/* 眉毛上下 */
if (faceBeautyData.browHeightIntensity != faceBeauty.getBrowHeightIntensity())
faceBeauty.setBrowHeightIntensity(faceBeautyData.browHeightIntensity);
/* 眉毛间距 */
if (faceBeautyData.browSpaceIntensity != faceBeauty.getBrowSpaceIntensity())
faceBeauty.setBrowSpaceIntensity(faceBeautyData.browSpaceIntensity);
/* 滤镜相关 */
/* 滤镜名称 */
if (!faceBeautyData.filterName.equals(faceBeauty.getFilterName()))
faceBeauty.setFilterName(faceBeautyData.filterName);
if (faceBeautyData.filterIntensity != faceBeauty.getFilterIntensity())
faceBeauty.setFilterIntensity(faceBeautyData.filterIntensity);
return true;
}
return false;
}
/**
* 将FaceBeautyData保存到文件
*
* @param faceBeautyData
*/
public static void saveFaceBeautyData2File(FaceBeautyData faceBeautyData, FaceBeauty faceBeauty, ArrayList<FaceBeautyFilterBean> filterList, int styleTypeIndex) {
buildFaceBeautyData(faceBeautyData,faceBeauty,filterList,styleTypeIndex);
saveFaceBeautyData2File(faceBeautyData);
}
/**
* 将FaceBeautyData保存到文件
*
* @param faceBeautyData
*/
public static void saveFaceBeautyData2File(FaceBeautyData faceBeautyData) {
Gson gson = new Gson();
String faceBeautyString = gson.toJson(faceBeautyData);
saveToSp(SP_KEY_NAME, faceBeautyString);
}
/**
* 获取bean对象
*
* @return
*/
public static FaceBeautyData loadFaceBeautyData() {
String faceBeautyData = loadFormSp(SP_KEY_NAME);
if (faceBeautyData != null && !faceBeautyData.isEmpty()) {
Gson gson = new Gson();
FaceBeautyData faceBeautyDataBean = gson.fromJson(faceBeautyData, FaceBeautyData.class);
return faceBeautyDataBean;
}
return null;
}
private static void saveToSp(String key, String value) {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
sp.edit().putString(key, value).apply();
}
private static String loadFormSp(String key) {
SharedPreferences sp = FaceUnityData.mApplication.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
return sp.getString(key, "");
}
}

View File

@@ -0,0 +1,46 @@
package com.yunbao.faceunity.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.yunbao.common.CommonAppContext;
import java.util.Map;
public class FaceSPUtils {
private static FaceSPUtils utils;
private SharedPreferences mSharedPreferences;
private FaceSPUtils(){
mSharedPreferences = CommonAppContext.sInstance.getSharedPreferences("FaceUnityConfig", Context.MODE_PRIVATE);
}
public static FaceSPUtils getInstance(){
if(utils==null){
utils=new FaceSPUtils();
}
return utils;
}
public void saveString(String key,String value){
mSharedPreferences.edit().putString(key,value).apply();
}
public String getString(String key){
return mSharedPreferences.getString(key,null);
}
public boolean saveBool(String key,boolean value){
return mSharedPreferences.getBoolean(key,false);
}
public void del(String key) {
mSharedPreferences.edit().remove(key).apply();
}
public void delStart(String key){
for (String _key : mSharedPreferences.getAll().keySet()) {
if(_key.startsWith(key)){
mSharedPreferences.edit().remove(key).apply();
}
}
}
public Map<String, ?> getAll(){
return mSharedPreferences.getAll();
}
}

View File

@@ -0,0 +1,127 @@
package com.yunbao.faceunity.utils;
import android.app.Application;
import android.os.Environment;
import java.io.File;
/**
* 一些配置参数
* DESC
* Created on 2021/3/1
*/
public class FaceUnityConfig {
/************************** 算法Model ******************************/
// 人脸识别
public static String BUNDLE_AI_FACE = "model" + File.separator + "ai_face_processor_lite.bundle";
// 手势
public static String BUNDLE_AI_HAND = "model" + File.separator + "ai_hand_processor.bundle";
//获取人体bundle
public static String getAIHumanBundle() {
if (FaceUnityConfig.DEVICE_LEVEL > FuDeviceUtils.DEVICE_LEVEL_MID)
return BUNDLE_AI_HUMAN_GPU;
else
return BUNDLE_AI_HUMAN;
}
// 人体
public static String BUNDLE_AI_HUMAN = "model" + File.separator + "ai_human_processor.bundle";
// 人体
public static String BUNDLE_AI_HUMAN_GPU = "model" + File.separator + "ai_human_processor_gpu.bundle";
// 头发
public static String BUNDLE_AI_HAIR_SEG = "model" + File.separator + "ai_hairseg.bundle";
// 舌头
public static String BUNDLE_AI_TONGUE = "graphics" + File.separator + "tongue.bundle";
/************************** 业务道具存储 ******************************/
// 美颜
public static String BUNDLE_FACE_BEAUTIFICATION = "graphics" + File.separator + "face_beautification.bundle";
// 美妆
public static String BUNDLE_FACE_MAKEUP = "graphics" + File.separator + "face_makeup.bundle";
// 美妆根目录
private static String MAKEUP_RESOURCE_DIR = "makeup" + File.separator;
//美妆单项颜色组合文件
public static String MAKEUP_RESOURCE_COLOR_SETUP_JSON = MAKEUP_RESOURCE_DIR + "color_setup.json";
// 美妆参数配置文件目录
public static String MAKEUP_RESOURCE_JSON_DIR = MAKEUP_RESOURCE_DIR + "config_json" + File.separator;
//美妆组合妆句柄文件目录
public static String MAKEUP_RESOURCE_COMBINATION_BUNDLE_DIR = MAKEUP_RESOURCE_DIR + "combination_bundle" + File.separator;//
//美妆妆容单项句柄文件目录
public static String MAKEUP_RESOURCE_ITEM_BUNDLE_DIR = MAKEUP_RESOURCE_DIR + "item_bundle" + File.separator;
// 美体
public static String BUNDLE_BODY_BEAUTY = "graphics" + File.separator + "body_slim.bundle";
//动漫滤镜
public static String BUNDLE_ANIMATION_FILTER = "graphics" + File.separator + "fuzzytoonfilter.bundle";
// 美发正常色
public static String BUNDLE_HAIR_NORMAL = "hair_seg" + File.separator + "hair_normal.bundle";
// 美发渐变色
public static String BUNDLE_HAIR_GRADIENT = "hair_seg" + File.separator + "hair_gradient.bundle";
// 轻美妆
public static String BUNDLE_LIGHT_MAKEUP = "light_makeup" + File.separator + "light_makeup.bundle";
// 海报换脸
public static String BUNDLE_POSTER_CHANGE_FACE = "change_face" + File.separator + "change_face.bundle";
// 绿幕抠像
public static String BUNDLE_BG_SEG_GREEN = "bg_seg_green" + File.separator + "green_screen.bundle";
// 3D抗锯齿
public static String BUNDLE_ANTI_ALIASING = "graphics" + File.separator + "fxaa.bundle";
// 人像分割
public static String BUNDLE_BG_SEG_CUSTOM = "effect" + File.separator + "segment" + File.separator + "bg_segment.bundle";
//mask bundle
public static String BUNDLE_LANDMARKS = "effect" + File.separator + "landmarks.bundle";
//设备等级默认为中级
public static int DEVICE_LEVEL = FuDeviceUtils.DEVICE_LEVEL_HIGH;
//人脸置信度 标准
public static float FACE_CONFIDENCE_SCORE = 0.95f;
//测试使用 -> 是否开启人脸点位,目前仅在美颜,美妆 情况下使用
public static boolean IS_OPEN_LAND_MARK = false;
//设备名称
public static String DEVICE_NAME = "";
//是否开启日志重定向到文件
public static boolean OPEN_FILE_LOG = false;
//TAG
public static final String APP_NAME = "KotlinFaceUnityDemo";
//文件夹路径
public static String OPEN_FILE_PATH = Environment.getExternalStoragePublicDirectory("") + File.separator + "FaceUnity" + File.separator + APP_NAME + File.separator;
//文件夹名称
public static String OPEN_FILE_NAME = "openFile.txt";
//文件大小
public static int OPEN_FILE_MAX_SIZE = 100 * 1024 * 1024;
//文件数量
public static int OPEN_FILES = 100;
//timeProfile是否开启
public static boolean OPEN_TIME_PROFILE_LOG = false;
//timeProfile文件夹路径
public static String OPEN_TIME_PROFILE_PATH = Environment.getExternalStoragePublicDirectory("") + File.separator + "FaceUnity" + File.separator + APP_NAME + File.separator;
//是否开启美颜序列化到磁盘
public static boolean OPEN_FACE_BEAUTY_TO_FILE = true;
//获取缓存路径
public static String cacheFilePath(Application application){
return application.getCacheDir() + File.separator + "attribute";
}
//绿幕背景切换的时候跳过的帧数
public static final int BG_GREEN_FILTER_FRAME = 1;
//测试用是否展示效果还原按钮
public static final boolean IS_SHOW_RESET_BUTTON = false;
}

Some files were not shown because too many files have changed in this diff Show More