Compare commits

...

1160 Commits

Author SHA1 Message Date
0d9a4baf32 Merge branch 'hotfix-v4.5.2-252-catalogUI' into 'release'
再次调整新分类-精选UI

See merge request halo/assistant-android!47
2020-12-15 18:07:26 +08:00
lyr
3a9132ff8c 再次调整新分类-精选UI 2020-12-15 18:05:35 +08:00
02a6ec9f7d 版本更新至 4.5.2 2020-12-14 17:15:20 +08:00
c779d775e3 Merge branch 'hotfix-v4.5.1-251-downloadANR' into 'release'
尝试修复安装完成触发的 ANR

See merge request halo/assistant-android!46
2020-12-14 17:12:26 +08:00
3fbcd33f98 尝试修复安装完成触发的 ANR 2020-12-14 17:10:55 +08:00
dbcdd7f3cc Merge branch 'hotfix-v4.5.1-251-catalogUI' into 'release'
微调新分类-精选UI

See merge request halo/assistant-android!45
2020-12-14 14:54:50 +08:00
lyr
69d9854b44 微调新分类-精选UI 2020-12-14 14:32:19 +08:00
5246d6e743 版本更新至 4.5.1 2020-12-10 17:02:46 +08:00
b20d598751 Merge branch 'hotfix-v4.5.0-250-crash' into 'release'
Hotfix v4.5.0 250 crash

See merge request halo/assistant-android!44
2020-12-10 16:58:52 +08:00
85e9799f20 Merge branch 'hotfix-v4.5.0-250-diableMTA' into 'release'
再次屏蔽 MTA

See merge request halo/assistant-android!43
2020-12-10 16:58:01 +08:00
6b533c8d09 再次屏蔽 MTA 2020-12-10 16:54:27 +08:00
2797135db4 尝试修复安装完成应用后的 ANR 2020-12-10 16:15:41 +08:00
7507a027da 修复关闭所有页面后下载完成回调触发闪退的问题 2020-12-10 10:50:42 +08:00
9873ae8946 还原 MTA https://git.ghzs.com/pm/halo-app-issues/-/issues/1092 2020-12-07 14:47:51 +08:00
a5ef80ba33 尝试修复启动前台服务造成的闪退 https://git.ghzs.com/halo/assistant-android/-/issues/7 2020-12-07 11:59:43 +08:00
dfdd12bf18 修复使用强制更新时偶尔无法唤起安装的问题和多线程下载更新的冲突问题 2020-12-04 17:22:48 +08:00
9daf01d9a5 处理包名检测弹窗未检测出不可启动的应用 2020-12-04 14:57:31 +08:00
ee7ed1fed2 光环助手V4.5.0-包名检测弹窗和应用跳转(1203测试1,2) https://git.ghzs.com/pm/halo-app-issues/-/issues/1058 2020-12-03 18:10:24 +08:00
08474a660e Merge branch 'dev' of git.ghzs.com:halo/assistant-android into dev 2020-12-03 11:40:53 +08:00
d8dfe00057 光环助手V4.5.0-包名检测弹窗和应用跳转(改为通用链接) https://git.ghzs.com/pm/halo-app-issues/-/issues/1058 2020-12-03 11:40:29 +08:00
6bd175f72b 停用 MTA 2020-12-02 17:59:21 +08:00
72b6b3042a 正式包脚本支持打推广包 2020-12-02 10:50:15 +08:00
lyr
3317b178ac 修改新分类-二级分类详情页无数据问题 2020-12-02 10:40:50 +08:00
c86e7ba6ee Merge branch 'dev-4.5.0' into dev
# Conflicts:
#	app/src/main/java/com/gh/download/DownloadDataHelper.kt
2020-12-02 09:51:41 +08:00
14c5e4e963 Merge branch 'pack-v4.4.0-221-enableGdtAndTea-product' into dev-4.5.0
# Conflicts:
#	app/build.gradle
2020-12-01 18:26:53 +08:00
6db8179f4d 根据product flavor导入不同库 2020-12-01 17:48:35 +08:00
65c2571329 增加打推广打包的用的 product flavor https://git.ghzs.com/halo/assistant-android/-/issues/25 2020-12-01 16:52:09 +08:00
lyr
4810803988 修改新分类-一级分类item样式 2020-11-30 18:23:29 +08:00
f3f030edb1 Merge branch 'dev-4.5.0' of git.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-30 15:22:09 +08:00
2ac2a3bf48 处理视频全屏闪退问题 2020-11-30 15:21:34 +08:00
cd104e4688 修复搜索列表页面重建时的显示问题 2020-11-30 11:37:11 +08:00
e2de8cfb47 正式环境切换到4.5接口 2020-11-30 09:07:12 +08:00
c9f9451dee 修复进程被杀重建时出现的安装状态异常问题 2020-11-27 17:21:21 +08:00
73c39edd3f 修改分类功能的错误上报文案 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1056 2020-11-27 15:03:01 +08:00
7f739798ab 处理Android11打开[允许安装未知应用]权限后自动解压xapk 2020-11-27 11:39:07 +08:00
e41cf76d26 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-27 10:41:07 +08:00
113d446e47 处理Android11打开[允许安装未知应用]权限后自动解压xapk 2020-11-27 10:41:03 +08:00
lyr
882ac7d67d 优化下载按钮监听器逻辑 2020-11-27 10:00:34 +08:00
d94be8092b 修改获取推荐论坛接口 2020-11-26 21:59:33 +08:00
b9138ae810 未登录状态也可以获取推荐的论坛 2020-11-26 21:44:46 +08:00
715cecd44b 调整 Sentry 的上报内容 2020-11-26 20:22:05 +08:00
dd756fce00 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-26 20:13:57 +08:00
56a003704d 用户搜索取消关注toast提示 2020-11-26 20:13:53 +08:00
50421e0b70 新分类事件上报增加内容 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1056 2020-11-26 18:32:40 +08:00
9f0d00f793 尝试修复后台启动前台服务的闪退 2020-11-26 18:27:35 +08:00
a56fd8ff18 用户搜索关注用户判断是否登录 2020-11-26 17:58:33 +08:00
f86fc7b0e1 【光环助手V4.5.0】论坛搜索功能及部分优化 1126测试反馈 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-26 17:22:27 +08:00
e6197776ca 修改关注论坛排序问题 2020-11-26 16:30:45 +08:00
0415ae261b 光环助手V4.5.0-包名检测弹窗和应用跳转 补充3 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1058 2020-11-26 16:29:52 +08:00
d5313c7f98 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-26 16:08:49 +08:00
360231e01f 光环助手V4.5.0-XAPK 游戏解压增加 引导设置“安装权限” 1126测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1077 2020-11-26 16:08:44 +08:00
lyr
4d86d6f96b Merge remote-tracking branch 'origin/dev-4.5.0' into dev-4.5.0 2020-11-26 15:39:00 +08:00
lyr
dd03daae84 【手机号绑定冲突】页当前用户昵称加敏处理 2020-11-26 15:38:55 +08:00
5d285fd60e 删除无用资源 2020-11-26 15:25:15 +08:00
7d4206bcd8 记录 XAPK 解压异常日志 2020-11-26 14:40:02 +08:00
a816636d9a 修复分类埋点测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1056 2020-11-26 14:39:08 +08:00
c6a5522b35 完成前端优化汇总(12,13) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-26 12:00:39 +08:00
lyr
8b888f0ab4 1.修改新分类UI;2.修复新分类的二级分类详情页列表排序与专题详情页列表排序不一样问题 2020-11-26 11:43:53 +08:00
ef41a3aea5 Merge remote-tracking branch 'origin/dev-4.5.0' into dev-4.5.0 2020-11-26 10:14:31 +08:00
ba2206931f 调整隐私弹窗UI https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1064 2020-11-26 10:14:22 +08:00
ef4b7b28d8 调整论坛首页蒙层引导位置 2020-11-26 10:13:15 +08:00
lyr
4a5f12d341 光环前端优化汇总(2020年11月第1周)20201125测试问题 1 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057#note_78154 2020-11-26 09:45:21 +08:00
ced96f5f70 调整帖子详情标签间距 2020-11-26 09:23:34 +08:00
4180d87b36 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-26 09:10:58 +08:00
2b7f802584 光环前端优化汇总(2020年11月第1周)20201125测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-26 09:10:53 +08:00
lyr
3e9a348019 分类筛选弹窗去掉弹出动画 2020-11-25 18:20:01 +08:00
9725402623 处理链接为空的图片复用问题 2020-11-25 17:17:33 +08:00
9827b04057 修复横向滑动卡片专题的曝光统计问题 2020-11-25 17:04:19 +08:00
b3052485f5 光环助手V4.5.0-XAPK 游戏解压增加 引导设置“安装权限” 1125测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1077 2020-11-25 16:52:04 +08:00
d3dc09d377 修改权限弹窗滚动条 2020-11-25 16:37:19 +08:00
58905c14a8 完成隐私弹窗1124UI调整 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1064 2020-11-25 16:24:32 +08:00
aadbbbf2ea 修改sentry上的bug (4820/4822/4952) 2020-11-25 16:17:15 +08:00
5256a9b267 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-25 15:10:27 +08:00
0ded7b33f2 光环助手V4.5.0-包名检测弹窗和应用跳转1125测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1058 2020-11-25 15:10:17 +08:00
lyr
cdc3158f30 新分类-精选页调整游戏名显示长度 2020-11-25 14:44:15 +08:00
06de179c9e Merge remote-tracking branch 'origin/dev-4.5.0' into dev-4.5.0 2020-11-25 14:30:31 +08:00
f32dc628ef 补充更新下载头 META 的位置 2020-11-25 14:30:19 +08:00
lyr
62e371c928 【手机号绑定冲突】页用户昵称加敏处理 2020-11-25 14:22:31 +08:00
lyr
84bcc481af 光环助手V4.5.0-新分类功能(前端)20201124测试问题 3(1)(2)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1055#note_78011 2020-11-25 11:29:58 +08:00
085ddd4ea6 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-25 11:00:42 +08:00
b3e859678e 【光环助手V4.5.0】论坛搜索功能及部分优化UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-25 11:00:35 +08:00
lyr
7f586fbf13 光环前端优化汇总(2020年11月第1周)10 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-25 09:49:24 +08:00
9dab3dd263 恢复广点通和头条SDK 2020-11-24 18:19:05 +08:00
lyr
3ee30f05f0 Merge remote-tracking branch 'origin/dev-4.5.0' into dev-4.5.0 2020-11-24 18:16:36 +08:00
lyr
69c8c51000 优化新分类模块代码 2020-11-24 18:16:07 +08:00
28742f54bb Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-24 18:13:13 +08:00
f62751423d 【光环助手V4.5.0】论坛搜索功能及部分优化 1124测试反馈 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-24 18:13:08 +08:00
b0b699679e 添加在新页面打开 webview 的 JS 方法 2020-11-24 17:15:35 +08:00
3c55284d86 完成分类功能数据埋点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1056 2020-11-24 17:04:25 +08:00
b6ae508cf0 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-24 16:53:12 +08:00
lyr
c13ee31ece 光环助手V4.5.0-新分类功能(前端)20201123UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1055#note_77773 2020-11-24 16:52:56 +08:00
c87a1ba56e 光环助手V4.5.0-【APP合规】游戏详情页-游戏安装权限提示20201124UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1070 2020-11-24 16:52:55 +08:00
9f07cc7720 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-24 16:25:16 +08:00
7bdfe7cef3 【光环助手V4.5.0】论坛搜索功能及部分优化 UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-24 16:25:11 +08:00
lyr
667126f92c 光环助手V4.5.0-新分类功能(前端)20201123UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1055#note_77773 2020-11-24 16:10:47 +08:00
0409d33d5e Merge branch 'hotfix-v4.3.9-220-update' into dev-4.5.0
# Conflicts:
#	dependencies.gradle
2020-11-24 14:39:45 +08:00
lyr
14e8285c0f 光环前端优化汇总(2020年11月第1周)20201123UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057#note_77765 2020-11-24 14:21:21 +08:00
c7d63f9df1 Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-23 18:28:17 +08:00
e2d9ad07d1 光环助手V4.5.0-XAPK 游戏解压增加 引导设置“安装权限” https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1077 2020-11-23 18:28:12 +08:00
lyr
9287b6ac4c 修改标签页顶部标签列表item背景 2020-11-23 17:51:00 +08:00
lyr
450da5e0db 修改从新分类点击跳转到游戏详情页内容缺失问题 2020-11-23 17:27:26 +08:00
0397092414 版本调整至 4.4.0 2020-11-23 15:33:19 +08:00
ddc515b490 修复更新问题 2020-11-23 15:12:18 +08:00
lyr
a6edde7853 光环前端优化汇总(2020年11月第1周)8(2)① https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-23 14:55:37 +08:00
80282f7bcc 调整包名检测弹窗间距 2020-11-23 10:56:12 +08:00
lyr
664df5cb44 Merge remote-tracking branch 'origin/dev-4.5.0' into dev-4.5.0 2020-11-23 10:28:43 +08:00
lyr
8396a55ed2 新分类相关页面适配ViewBinding 2020-11-23 10:28:03 +08:00
5ee3f597bd 简单包裹游戏列表横向列表的点击闪退 (具体修复后续处理) 2020-11-23 10:26:59 +08:00
9c8bd9f85e 处理更换背景后用户详情页面闪退问题 2020-11-23 10:25:18 +08:00
4321e0a33c 光环前端优化汇总(2020年11月第1周)8(2)②-⑥ https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-23 10:21:58 +08:00
6f75229209 全局处理 activity 的 configChanges 的值(新增density,fontScale,locale) 2020-11-20 17:43:31 +08:00
lyr
d6bd561e58 Merge branch 'feature-issues1055' into dev-4.5.0 2020-11-20 15:05:18 +08:00
c957d7585c 修复xapk下载完成事件被误判为解析包错误问题 2020-11-20 14:50:54 +08:00
lyr
db0e92fd68 完成光环前端优化汇总(2020年11月第1周)8(1)、9、10 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-20 14:38:02 +08:00
992446cf70 去掉无用的权限注册 2020-11-20 11:01:29 +08:00
dcfa52b05a 全局处理 activity 的 configChanges 的值放弃特殊条件时的页面重建(原目的为避免分屏时的页面重建异常) 2020-11-20 10:55:15 +08:00
lyr
2a06c41dca 完成光环前端优化汇总(2020年11月第1周)1-4 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1057 2020-11-20 09:17:03 +08:00
lyr
24214c5d6b 优化"新分类"模块 2020-11-20 09:13:35 +08:00
c839eff88d 视频埋点增加[视频流刷新]事件 2020-11-19 17:47:12 +08:00
663505fdc9 整理复制内容相关代码 2020-11-19 11:17:00 +08:00
641a820ea5 删掉每次检查下载目录都生成的 timestamp.log 文件 2020-11-19 11:14:57 +08:00
lyr
bb3f888f88 完成光环助手V4.5.0-新分类功能(前端)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1055 2020-11-19 09:59:33 +08:00
75bdf6f251 视频埋点增加[提交评论]事件 2020-11-18 18:01:31 +08:00
0cacc15e7d Merge branch 'dev-4.5.0' of gitlab.ghzs.com:halo/assistant-android into dev-4.5.0 2020-11-18 17:09:59 +08:00
e4c2ac0aae 光环助手V4.5.0-包名检测弹窗和应用跳转 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1058 2020-11-18 17:09:54 +08:00
7acf4c5941 补充 Sentry 信息 2020-11-18 14:51:20 +08:00
8b22361213 接入 Sentry 2020-11-18 11:54:19 +08:00
a1dee46436 处理因捕抓查询剩余空间闪退而引起的不能下载应用的问题 2020-11-17 17:47:05 +08:00
49bf8c9e30 修改隐私弹窗文案 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1064 2020-11-17 17:42:15 +08:00
407686ca5b 处理链接为空的图片复用问题 2020-11-17 17:39:22 +08:00
89b7b45ba0 测试修改后的MTA 2020-11-17 17:37:21 +08:00
b00e7a2826 处理合并代码错误 2020-11-17 17:14:30 +08:00
383d6e7700 Merge branch 'feature-bbs-search' into dev-4.5.0
# Conflicts:
#	app/src/main/AndroidManifest.xml
2020-11-16 16:35:23 +08:00
edce98e4c6 光环助手V4.5.0-视频活动优化(第1期)(6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1046 2020-11-16 15:30:00 +08:00
a2c3873c8d 【光环助手V4.5.0】论坛搜索功能及部分优化(帖子搜索) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-16 14:15:52 +08:00
7990353d08 Merge branch 'release' into dev-4.5.0
# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/com/gh/common/exposure/meta/MetaUtil.kt
#	dependencies.gradle
2020-11-16 09:57:33 +08:00
a7b138b2b2 更新依赖库 id 2020-11-13 10:05:52 +08:00
951768e070 暂时屏蔽 MTA 部分代码 2020-11-13 10:04:46 +08:00
69f29fe83b 光环助手V4.5.0-视频投稿数据埋点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1047 2020-11-12 16:42:10 +08:00
88e28b2388 优化获取经 BASE64 编码后 IMEI 的逻辑 2020-11-12 15:52:08 +08:00
538bc6f97c 调整下载 CDN 日志的请求头名称 2020-11-12 15:17:19 +08:00
b1940125f4 Merge branch 'feature-issues1070' into dev-4.5.0 2020-11-12 14:46:26 +08:00
e1f8e293c2 修改查看权限详情不显示问题 2020-11-12 14:45:30 +08:00
0a49f27ed2 去掉 MTA 事件中获取 IMEI 的代码 2020-11-12 14:19:54 +08:00
5dc7badc97 Merge branch 'hotfix-v4.3.8-218-enableMtaOnly' into 'release'
暂时屏蔽广点通和头条推广

See merge request halo/assistant-android!39
2020-11-12 11:52:26 +08:00
d185d39985 暂时屏蔽广点通和头条推广 2020-11-12 11:51:48 +08:00
d9c98d39b5 Merge branch 'feature-issues1070' into dev-4.5.0 2020-11-12 11:39:33 +08:00
6949f2b2ff 光环助手V4.5.0-【APP合规】游戏详情页-游戏安装权限提示 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1070 2020-11-12 11:37:36 +08:00
2141440ec4 Merge branch 'hotfix-v4.3.8-218-bringBackTrackingSdk' into 'release'
重新接入第三方追踪SD,手动去掉了MTA的获取IMEI、IMSI等代码

See merge request halo/assistant-android!38
2020-11-12 11:31:44 +08:00
464c212638 处理 dataBinding 和 viewBinding 的冲突 2020-11-12 11:03:48 +08:00
dbe74b2091 修复游戏搜索页自动搜索失效的问题 2020-11-11 18:18:41 +08:00
ba55a5a61c 【光环助手V4.5.0】论坛推荐规则及部分优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1051 2020-11-11 14:26:36 +08:00
452a94f4a2 Merge branch 'hotfix-v4.3.8-218-bbs' into 'release'
修改评论详情更多操作点击任何一项都会触发删除评论弹窗

See merge request halo/assistant-android!37
2020-11-10 17:42:34 +08:00
310be97fe4 修改评论详情更多操作点击任何一项都会触发删除评论弹窗 2020-11-10 17:28:23 +08:00
2fc45777e4 光环助手V4.5.0】论坛搜索功能及部分优化(用户搜索) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1049 2020-11-10 17:16:46 +08:00
da283fc1f6 帖子作者显示置顶选项 2020-11-10 16:49:49 +08:00
fee4e4635c Merge branch 'feature-issues1068' into 'dev-4.5.0'
完成实名认证文案修改 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1068

See merge request halo/assistant-android!35
2020-11-10 16:35:46 +08:00
ebcd50cdee Merge branch 'feature-issues1069' into 'dev-4.5.0'
完成IMEI权限获取限制 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1069

See merge request halo/assistant-android!34
2020-11-10 16:34:54 +08:00
cd922dd286 完成实名认证文案修改 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1068 2020-11-10 16:32:27 +08:00
97598d7330 【光环助手V4.5.0】论坛-作者增加具体跟帖数据的置顶功能https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1050 2020-11-10 15:02:35 +08:00
0db59a56d0 完成IMEI权限获取限制 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1069 2020-11-10 14:44:59 +08:00
bee3f5957e 更新 AGP 版本 2020-11-10 14:37:33 +08:00
65d4b43c9c Merge branch 'hotfix-v4.3.8-218-lgLibrary' into 'release'
更新依赖库

See merge request halo/assistant-android!33
2020-11-09 17:00:45 +08:00
41f510d333 更新依赖库 2020-11-09 16:58:15 +08:00
64d5af036c 恢复误删的 CDN 日志记录代码 2020-11-09 16:56:07 +08:00
b4c827bddf Merge branch 'feature-issues1064' into 'dev-4.5.0'
完成隐私政策弹窗优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1064

See merge request halo/assistant-android!32
2020-11-09 16:22:52 +08:00
caf3dfa9ee Merge branch 'feature-issues1053' into 'dev-4.5.0'
完成注销账号功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1053

See merge request halo/assistant-android!31
2020-11-09 16:17:28 +08:00
c5c10ab208 版本号升至4.5.0 2020-11-09 16:16:07 +08:00
c2251e1ad6 BASE64转码请求头的IMEI内容 2020-11-09 16:11:39 +08:00
bd6d51dab3 去掉冗余的权限注册 2020-11-09 16:10:50 +08:00
1cf9bfcca3 完成注销账号功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1053 2020-11-09 14:46:50 +08:00
992ec7bfe8 完成隐私政策弹窗优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1064 2020-11-09 11:52:04 +08:00
cc39bfd06c Merge branch 'hotfix-v4.3.8-218-buildError' into 'release'
处理编译错误

See merge request halo/assistant-android!30
2020-11-09 09:47:39 +08:00
15d0ad6f49 Merge branch 'hotfix-v4.3.8-218-crash' into 'release'
1.修复推送页面注册闪退 2.捕抓部分设备获取音量大小时可能的闪退

See merge request halo/assistant-android!29
2020-11-09 09:46:53 +08:00
a2e2379073 1.修复推送页面注册闪退 2.捕抓部分设备获取音量大小时可能的闪退 2020-11-09 09:34:12 +08:00
d2431ed8ff 处理编译错误 2020-11-06 18:31:29 +08:00
80818dee55 重新接入第三方追踪SD,手动去掉了MTA的获取IMEI、IMSI等代码 2020-11-06 18:30:57 +08:00
f2d0916a16 Merge branch 'hotfix-v4.3.8-218-crash' into 'release'
Hotfix v4.3.8 218 crash

See merge request halo/assistant-android!28
2020-11-05 19:17:43 +08:00
2fa84e0ce1 修复修复弹窗关闭,encoded url 跳转和视频流刷新滑动的闪退 2020-11-05 19:17:43 +08:00
lyr
6fcd8397b6 修复"模拟器游戏创建桌面快捷方式时,由于图片过大而闪退"的Bug 2020-11-04 17:34:53 +08:00
3478aaba2f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-11-04 10:24:53 +08:00
1f0b9a95e2 尝试修复后台开启前台服务闪退 https://gitlab.ghzs.com/halo/assistant-android/-/issues/7 2020-11-04 10:15:16 +08:00
5cdc1635ca 正式环境接口改为 4.4 2020-11-03 18:11:18 +08:00
c9f5cfd4aa Merge branch 'hotfix-v4.3.8-218-database-related' into 'release'
捕抓因磁盘空间不足导致的数据库插入异常

See merge request halo/assistant-android!27
2020-11-03 15:17:59 +08:00
d6c1f692be 捕抓因磁盘空间不足导致的数据库插入异常 2020-11-03 15:16:57 +08:00
12e6fb8330 补充遗漏提交的文件 :( 2020-11-03 11:30:33 +08:00
ad857d4500 Merge branch 'hotfix-v4.3.8-218-PackageManager_has_died' into 'release'
尝试处理PackageManager has died异常

See merge request halo/assistant-android!26
2020-11-03 11:02:58 +08:00
43d8d24c1c 尝试处理PackageManager has died异常 2020-11-03 10:44:19 +08:00
a34ee5a753 Merge branch 'hotfix-v4.3.8-218-generic-crash' into 'release'
简单处理常见闪退

See merge request halo/assistant-android!25
2020-11-03 09:16:21 +08:00
ca39f723e1 简单处理常见闪退 2020-11-03 09:15:20 +08:00
3db784509b 更新依赖库 hash 2020-11-02 10:46:50 +08:00
e8f63ea99f 调整 jenkins 打包脚本 2020-11-02 10:46:30 +08:00
97ac4b03a3 处理合并异常 2020-11-02 10:27:30 +08:00
883a948b7b Merge branch 'feature-sdk-free' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/LocalBroadcastReceiver.kt
#	app/src/main/java/com/gh/common/im/ImManager.kt
#	app/src/main/java/com/gh/common/im/ImReceiver.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/desc/GameDetailCustomColumnAdapter.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingCommentItemViewHolder.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt
#	app/src/main/java/com/gh/gamecenter/personalhome/background/PersonalityBackgroundViewModel.kt
#	app/src/main/java/com/gh/gamecenter/user/UserRepository.java
#	app/src/main/java/com/halo/assistant/HaloApp.java
#	dependencies.gradle
2020-11-02 10:03:28 +08:00
ebb279c42f 移除大部分第三方SDK 2020-11-02 09:45:24 +08:00
lyr
261e0cc45a 搜索页-未登录状态点击预约按钮也上传"search_click"点击事件 2020-10-30 15:01:21 +08:00
0357a0a71e 处理跳转模拟器传递meta格式错误 2020-10-30 10:30:04 +08:00
lyr
d87de59427 光环助手V4.4.0-个人主页优化(第2期)-> 1029 UI反馈 -> 第2点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1037#note_74645 2020-10-29 22:37:11 +08:00
lyr
d5ee01a2e1 光环助手V4.4.0-游戏搜索功能强化(第6期)-> 20201028测试问题/搜索快捷按钮交互优化 2020-10-29 22:08:30 +08:00
lyr
3563637919 光环助手V4.4.0-游戏搜索数据 -> 20201029测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1035#note_74631 2020-10-29 21:32:34 +08:00
lyr
d881e08aee 光环助手V4.4.0-我的光环-新增[模拟器游戏] -> 1029测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1031 2020-10-29 21:24:32 +08:00
f5ff838d2f 更换背景默认透明度改为1 2020-10-29 20:57:26 +08:00
52c1b08e59 修复自动搜索曝光统计问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1035 2020-10-29 17:42:44 +08:00
lyr
652972f49d 光环助手V4.4.0-我的光环-新增[模拟器游戏] -> 1028测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1031 2020-10-29 16:16:02 +08:00
0d122cf8ba 光环助手V4.4.0-单机模拟器1028测试(4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1030 2020-10-29 09:27:01 +08:00
lyr
2b115c4058 第一次打开App删除所有模拟器游戏记录 2020-10-28 18:17:52 +08:00
lyr
cfca7db4ef 补充游戏搜索页-"搜索-点击"事件的埋点数据 2020-10-28 15:41:05 +08:00
lyr
5f66c029fb 光环助手V4.4.0-游戏搜索数据 —> 20201028测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1035#note_74338 2020-10-28 14:52:39 +08:00
lyr
8635652fe2 优化"个人主页"代码逻辑 2020-10-28 11:22:57 +08:00
lyr
a890ad532c 光环助手V4.4.0-游戏搜索功能强化(第6期)-> 20201027测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1025#note_74281 2020-10-28 11:18:03 +08:00
lyr
65c9d2be2a 光环助手V4.4.0-我的光环-新增[模拟器游戏] -> 1027测试/201027UI反馈 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1031 2020-10-27 18:22:49 +08:00
9620e26f6a 删除模拟器游戏时上传记录 2020-10-27 16:57:34 +08:00
e4ca1d8406 光环助手V4.4.0-单机模拟器 1027测试(6,7,8,10) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1030 2020-10-27 16:19:00 +08:00
74ebaa592b 修改模拟器下载完成埋点 2020-10-27 11:09:35 +08:00
f9b689efdb 更新 LGLibrary 2020-10-27 10:13:42 +08:00
ed458f08ad debug mode 接入简单的闪退日志显示插件 2020-10-27 10:06:26 +08:00
lyr
9822646acc 光环助手V4.4.0-游戏搜索数据->前端埋点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1035 2020-10-26 18:38:56 +08:00
4259078420 完成光环前端优化汇总(2020年10月第1周)(10,11) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-26 18:21:13 +08:00
3b9db4e964 恢复模拟器游戏保存路径 2020-10-26 18:11:42 +08:00
b7e6cd08fd 修改通知弹窗闪退问题 2020-10-26 16:49:12 +08:00
bba1e6f10c 处理一些闪退异常 2020-10-26 14:23:44 +08:00
3fe2973968 修改模拟器下载日志 2020-10-26 14:15:37 +08:00
b16d33d9fa Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-10-26 09:22:18 +08:00
e1a7ed9049 修改更换背景获取bitmap方式 2020-10-26 09:21:59 +08:00
lyr
11354030e8 光环助手V4.4.0-游戏搜索功能强化(第6期)三 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1025 2020-10-26 09:21:42 +08:00
ee109060fc 更改首页横向自滚动专题的实现 2020-10-23 18:19:49 +08:00
lyr
eebc0c1096 提交遗漏代码 2020-10-23 17:09:28 +08:00
lyr
4ec45e2a27 Merge remote-tracking branch 'origin/dev' into dev 2020-10-23 17:08:10 +08:00
lyr
12143f7f95 优化"模拟器游戏"模块代码逻辑 2020-10-23 17:06:19 +08:00
7025dc45bd 优化获取图片 bitmap 的逻辑 2020-10-23 17:05:13 +08:00
772e7861e2 更换模拟器游戏文件夹名 2020-10-23 15:58:25 +08:00
ff71c9a3e8 优化模拟器下载 2020-10-23 11:50:52 +08:00
b7001cc996 Merge branch 'dev_4.4.0' into dev
# Conflicts:
#	app/src/main/java/com/gh/base/GHActivityLifecycleCallbacksImpl.java
#	app/src/main/java/com/gh/common/util/DownloadObserver.kt
#	app/src/main/java/com/gh/gamecenter/user/UserRepository.java
#	app/src/main/java/com/halo/assistant/HaloApp.java
2020-10-23 10:47:40 +08:00
83658e47f8 特殊渠道隐藏首页视频tab https://gitlab.ghzs.com/pm/issues-Inbox/-/issues/3090 2020-10-23 10:21:05 +08:00
lyr
0699d3ccc4 调整"模拟器游戏"列表-下载按钮UI 2020-10-22 18:19:11 +08:00
f80b998e98 处理当前链接没有下载记录并且文件已经存在下载异常问题 2020-10-22 17:26:04 +08:00
91e84be708 尝试排除分片检测下载进度数据上传的无用数据 2020-10-22 17:07:54 +08:00
f589c286c6 提交LGLibrary 2020-10-22 16:42:20 +08:00
379650a0f5 Merge branch 'emulator' into dev_4.4.0
# Conflicts:
#	app/src/main/java/com/gh/common/util/EntranceUtils.java
#	app/src/main/java/com/gh/common/util/LogUtils.java
#	app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java
#	app/src/main/java/com/halo/assistant/HaloApp.java
#	app/src/main/res/values/colors.xml
2020-10-22 16:12:24 +08:00
3796eb46bd 启动模拟器游戏 2020-10-22 15:46:49 +08:00
c240048c5e 处理延迟初始化视频播放闪退 2020-10-22 14:52:13 +08:00
lyr
2f81c9240d 完善"模拟器游戏"快捷方式的处理逻辑 2020-10-22 10:58:40 +08:00
lyr
da0dc3df97 完成"模拟器游戏"模块UI 2020-10-21 17:45:47 +08:00
d73c0f2044 Merge branch 'emulator' of gitlab.ghzs.com:halo/assistant-android into emulator
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameFragment.kt
2020-10-21 17:18:58 +08:00
a6f9e12082 光环助手V4.4.0-数据统计需求(单机模拟器)(一、1,二) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1033 2020-10-21 17:16:24 +08:00
20f8ba0de5 补充处理部分数据收集代码 2020-10-21 16:53:10 +08:00
f7342a944e 更新 talkingdata SDK 规避频繁获取 IMEI 2020-10-21 16:45:39 +08:00
lyr
1086574b33 "模拟器游戏"空数据页面增加广告位链接 2020-10-21 16:21:41 +08:00
59e30d432d Merge branch 'privacy_free' into dev
# Conflicts:
#	app/src/main/java/com/halo/assistant/HaloApp.java
2020-10-21 15:26:56 +08:00
lyr
58631d540c "模拟器游戏"顶部Tab增加筛选,增加无数据显示页面 2020-10-21 15:25:28 +08:00
lyr
08763aeb2d 上传遗漏代码 2020-10-21 11:36:46 +08:00
lyr
039d0ca06c 去掉多余代码 2020-10-21 11:31:45 +08:00
lyr
f39574c8b3 大致完成"模拟器游戏"模块UI 2020-10-21 11:26:44 +08:00
6067a52fb1 光环助手V4.4.0-数据统计需求(单机模拟器)(二、2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1033 2020-10-21 10:01:36 +08:00
a1298547d1 版本号升级为4.4.0 2020-10-20 18:38:14 +08:00
49d5514a25 回退下载防劫持敏感度调整代码 2020-10-20 15:53:16 +08:00
09c414a02c 降低下载劫持判断的敏感度 2020-10-20 09:26:39 +08:00
6a6378f635 【光环助手V4.4.0】论坛数据埋点需求 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1019 2020-10-20 09:16:34 +08:00
920050efc8 Merge dev_4.4.0 into dev_4.4.0 2020-10-19 18:35:25 +08:00
103ecc10d3 完成游戏下载状态新增"更新中" https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1021 2020-10-19 18:30:05 +08:00
f90e9a8085 视频流支持下载、启动模拟器游戏 2020-10-19 16:46:17 +08:00
caa37ead4b 光环助手V4.4.0-个人主页优化(第2期)(2-⑦、3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1037 2020-10-19 15:07:42 +08:00
d18eeaf346 已下载的模拟器游戏显示在 已安装、玩过的游戏 等位置 2020-10-19 10:35:04 +08:00
lyr
b98d287843 光环助手V4.4.0-个人主页优化(第2期)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1037#note_73008 2020-10-18 16:36:27 +08:00
66fb57f708 记录模拟器游戏下载完成、启动 2020-10-16 18:19:50 +08:00
3911c10827 修复因为线程冲突导致重定向回调无法触发的问题 2020-10-16 17:52:16 +08:00
c29972df50 修复因为线程冲突导致重定向回调无法触发的问题 2020-10-16 17:17:27 +08:00
8001ce2603 大致完成模拟器游戏下载、模拟器下载与安装 2020-10-16 17:16:24 +08:00
b1079e84d8 大致完成模拟器游戏下载、模拟器下载与安装 2020-10-16 17:15:51 +08:00
c6cf8aab1c 修复因延迟获取用户数据造成的下载误报劫持问题 2020-10-16 16:51:21 +08:00
4d7718e3af 修复因延迟获取用户数据造成的闪退 2020-10-16 11:08:25 +08:00
9cdbcd4935 补充延迟操作备忘说明 2020-10-15 16:12:09 +08:00
d396ebda44 延迟一些与隐私政策相关的操作 2020-10-15 16:09:12 +08:00
6ab8bdc422 修复因为延迟收据收集代码而造成的闪退问题 2020-10-15 09:29:20 +08:00
15352bb379 调整隐私弹窗文案 2020-10-15 09:29:19 +08:00
b68536b561 调整隐私弹窗文案 2020-10-15 09:29:19 +08:00
762ee8d300 添加第三方SDK接入声明跳转 2020-10-15 09:29:19 +08:00
8dfda56586 避免用户同意隐私协议前获取IMEI和MAC,缓存IMEI避免频繁获取 2020-10-15 09:29:17 +08:00
93126517b6 模拟器游戏下载记录使用本地数据库保存 2020-10-14 19:53:24 +08:00
04a8f5772c 补充游戏详情大家都在玩的页面路径 2020-10-14 14:53:41 +08:00
9687ddcd54 光环前端优化汇总(2020年10月第1周)(7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-14 09:24:54 +08:00
04c49cbad7 测试环境api更新为v4d4d0 2020-10-13 18:12:08 +08:00
6addea7d73 处理下载网络错误空指针异常 2020-10-13 17:48:49 +08:00
lyr
229eaa0859 光环前端优化汇总(2020年10月第1周)第4/5点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-13 17:48:42 +08:00
3876096f52 处理webview调用更改标题方法报错的问题 2020-10-13 17:24:02 +08:00
bad3ab19c6 修复下载任务因耗时/超时变动引起的状态变更问题 2020-10-13 17:22:29 +08:00
b2100fe0e5 修改模拟器游戏保存路径 2020-10-13 17:18:08 +08:00
5998bb9d4a 光环助手V4.3.0-RELEASE 20201012-1500 测试汇总(3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1034 2020-10-13 09:42:23 +08:00
fefe29a0b8 模拟器下载弹窗(未完) 2020-10-13 09:21:34 +08:00
a16554da21 光环助手V4.3.0-RELEASE 20201012-1500 测试汇总(1,2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1034 2020-10-12 16:33:48 +08:00
6efc1e06bb 下载模拟器游戏 2020-10-12 16:21:11 +08:00
e51439d584 完成光环前端优化汇总(10月第一周第8点删掉七陌客服) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-12 15:52:51 +08:00
907bad48bc 修复横向列表指示线错位的问题 2020-10-12 15:10:33 +08:00
582df7da58 Merge remote-tracking branch 'origin/dev' into dev 2020-10-12 14:21:23 +08:00
28f18a558c 补充JS方法用于更新内嵌WebView标题 2020-10-12 14:21:00 +08:00
lyr
658fb8579c 光环前端优化汇总(2020年10月第1周)第9点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-12 14:14:14 +08:00
45632052e5 Merge remote-tracking branch 'origin/dev' into dev 2020-10-12 10:42:00 +08:00
311211747a 广点通根据帐号细分至渠道 https://gitlab.ghzs.com/pm/yunying/-/issues/1271 2020-10-12 10:40:09 +08:00
010995b16d 曝光下载完成补充 host 和 path 信息 https://gitlab.ghzs.com/stats/stats-issues/-/issues/188 2020-10-12 10:26:48 +08:00
c82e981f4e 尝试修复前台服务闪退 2020-10-12 10:04:43 +08:00
f9803fa244 调整防劫持判断逻辑 https://wiki.ghzs.com/pages/viewpage.action?pageId=2754298 2020-10-12 10:03:17 +08:00
f21d86c8a7 光环前端优化汇总(2020年10月第1周)(3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1028 2020-10-10 16:24:17 +08:00
8db525542e 修复多层嵌套列表因未完全显示而没能统计曝光的问题 2020-09-29 17:36:01 +08:00
lyr
49cf093a44 他人主页-点击个性签名不能跳转到个性签名编辑页 2020-09-29 15:43:18 +08:00
lyr
f2302ffc50 补充方法供网页跳转绑定手机页面 2020-09-29 14:47:27 +08:00
f85685fd52 更新 chucker 版本 2020-09-28 15:06:19 +08:00
a80419e4bd 修复横向大图滑动列表的滑动闪退 2020-09-28 12:53:00 +08:00
0e7b6bb097 回退chucker库 2020-09-28 10:19:35 +08:00
b795df2de8 正式环境切换到4.3.0 2020-09-28 09:47:27 +08:00
e99e8328ab 降低自滚动栏目在MUMU模拟器上的速率 2020-09-28 09:30:51 +08:00
500c77d6ed 修复横向滑动列表会有自然偏移的问题 2020-09-27 22:31:42 +08:00
3c13431bd3 Merge remote-tracking branch 'origin/dev' into dev 2020-09-27 21:37:01 +08:00
d5e426a7f0 调整详情页初始化顺序 2020-09-27 21:36:51 +08:00
8a37e0bdf4 调整自滚动栏目滚动速度 2020-09-27 21:36:07 +08:00
lyr
230eec78c1 光环助手V4.3.0-个人主页优化-2020.09.27ui反馈-2/4/5 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-27 21:35:54 +08:00
8bb74461e6 调整首页专题样式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-27 21:08:27 +08:00
b0d0d3ca45 Merge remote-tracking branch 'origin/dev' into dev 2020-09-27 20:48:57 +08:00
356c9432ec 优化图片加载逻辑 2020-09-27 20:48:49 +08:00
31e14fd47b 上传背景后回到个人主页 2020-09-27 20:47:46 +08:00
c0644dc705 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-27 19:52:55 +08:00
1a43589bb1 光环助手V4.3.0-个人主页优化2020.09.27ui反馈(1,3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-27 19:52:50 +08:00
defd6d9a14 回退图片加载优化 2020-09-27 19:36:36 +08:00
lyr
77b4e8f73d 光环助手V4.3.0-徽章中心优化-测试问题14 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003 2020-09-27 18:37:44 +08:00
61ef40f9b5 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-27 18:29:38 +08:00
13dd5c9892 修改选择挂件逻辑 2020-09-27 18:29:32 +08:00
d20aef7107 优化自滚动栏目的滚动状态 2020-09-27 17:45:46 +08:00
8c9cd6e0ec 调整首页/版块专题样式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/999 2020-09-27 17:42:53 +08:00
lyr
487c2fd0a5 Merge remote-tracking branch 'origin/dev' into dev 2020-09-27 17:14:46 +08:00
lyr
0ffdef080b 光环助手V4.3.0-徽章中心优化-20200925UI测试-图4 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003 2020-09-27 17:14:25 +08:00
ba76dbbd15 修改视频上传UI 2020-09-27 17:13:47 +08:00
7cfe82af47 修复自定义栏目和系统通知图标的复用显示问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-27 15:36:06 +08:00
567977089a Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-27 14:44:36 +08:00
a258fe1d20 调整视频上传UI 2020-09-27 14:44:32 +08:00
lyr
28cf1ab114 光环前端优化汇总-0924测试-游戏评分-评论回复,点赞和取消点赞也需要改成论坛的形式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-27 14:43:02 +08:00
0e49c074ec 调整全局图片加载机制 2020-09-27 11:51:32 +08:00
85249f1d94 调整首页专题样式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-27 11:46:58 +08:00
38bda5ec02 QA增加0923补充MTA事件 2020-09-27 10:26:38 +08:00
0cc24956e0 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-27 09:27:56 +08:00
c17bcd9765 修改视频流下拉刷新成功提示UI 2020-09-27 09:27:51 +08:00
9f1642f577 修复自滚动栏目点击无响应的问题 2020-09-27 09:23:45 +08:00
lyr
9c01f75e8b 光环助手V4.3.0-徽章中心优化-0925测试问题-10/11/12 和 20200925UI测试-图4 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003 2020-09-26 15:16:32 +08:00
a460722ae5 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-25 17:56:43 +08:00
37330c2ab2 增加刷新视频成功动画提示 2020-09-25 17:56:39 +08:00
lyr
5db25f966e 光环助手V4.3.0-个人主页优化0925测试问题10 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-25 17:56:10 +08:00
4749c743e9 光环助手V4.3.0-个人主页优化0925测试问题11 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-25 17:31:20 +08:00
f5b614cc63 发布问题增加防抖机制 2020-09-25 17:30:34 +08:00
34b8b00cb2 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-25 16:19:12 +08:00
6af86d871c 处理快速点击内存泄漏问题 2020-09-25 16:19:07 +08:00
0b7fade38b 优化 gif 加载 2020-09-25 16:07:09 +08:00
lyr
3237834f9a 修改徽章弹窗-动画旋转速度 2020-09-25 16:03:02 +08:00
53e9554f08 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-25 15:55:07 +08:00
70ee3001c2 光环助手V4.3.0-论坛功能优化(第一期)0924测试反馈(1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1002 2020-09-25 15:55:03 +08:00
lyr
d7ae2b2aa4 修改"领取徽章弹窗显示的徽章图片不对"的问题 2020-09-25 14:54:05 +08:00
9c9dbfb105 修改视频流下拉刷新没有清除上个视频的动效 2020-09-25 14:39:10 +08:00
c633c228db 更换论坛tab动效文件 2020-09-25 14:15:18 +08:00
ad82005881 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-25 11:47:13 +08:00
815a0d0600 光环助手V4.3.0-论坛功能优化(第一期)优化/bug(1,2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1002 2020-09-25 11:47:08 +08:00
e02f9db81d 修复专题头图出现额外空白区域的问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-25 11:09:48 +08:00
c422b96da4 Merge remote-tracking branch 'origin/dev' into dev 2020-09-25 11:08:56 +08:00
lyr
40a64996d7 增加个人主页和个性签名的点击范围 2020-09-25 11:00:34 +08:00
cbfca66d51 修复版块加载到底后列表刷新失效的问题 2020-09-25 10:42:54 +08:00
f4a110c94d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-25 10:34:58 +08:00
f601fd2339 光环助手V4.3.0-论坛功能优化(第一期)0904需求测试(1,2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1002 2020-09-25 10:34:53 +08:00
e3217eaf22 调整专题图片显示样式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/999 2020-09-25 10:24:13 +08:00
540515ab41 调整首页/版块的样式间距 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-25 10:07:28 +08:00
lyr
e1c02a6138 完成徽章中心优化-20200924UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003 2020-09-25 09:46:44 +08:00
lyr
a508576785 修改"个人主页没有与我的光环同步显示徽章数量"问题 2020-09-25 09:31:06 +08:00
lyr
84e57d5c91 评论点赞/取消点赞增加Toast 2020-09-25 09:28:19 +08:00
62b1005dbf 光环助手V4.3.0-视频优化与新增功能汇总20200924测试(4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-25 09:03:04 +08:00
04a5450a41 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-24 18:24:46 +08:00
2ac4dd6c5a 光环助手V4.3.0-视频优化与新增功能汇总20200924测试(5,6,7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-24 18:24:41 +08:00
lyr
441a569f30 优化"我的关注"UI 2020-09-24 18:19:23 +08:00
lyr
f319201e74 完成前端优化汇总-0924测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993#note_70940 2020-09-24 17:58:47 +08:00
lyr
47b2fa60d8 完成个人主页-0924测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-24 16:48:43 +08:00
4d15c15b2d 光环助手V4.3.0-个人主页优化0924测试(7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-24 16:14:20 +08:00
3702094d98 使用官方的chucker库 2020-09-24 15:45:19 +08:00
6185ca595d 光环助手V4.3.0-个人主页优化0924测试(1,6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-24 15:00:29 +08:00
358b93029b 光环助手V4.3.0-论坛功能优化(第一期)UI测试汇总 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1002 2020-09-24 14:22:23 +08:00
38044b1d2b 光环助手V4.3.0-视频优化与新增功能汇总 UI测试汇总 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-24 11:38:38 +08:00
lyr
90877738b3 优化个人主页-游戏评论Tab 2020-09-24 09:33:03 +08:00
477613d21f 修改预览图背景没有对齐 2020-09-23 18:23:35 +08:00
lyr
a77ee0fa70 完成徽章中心优化-20200922UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003#note_70670 2020-09-23 18:07:34 +08:00
036fa444c6 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-23 18:05:12 +08:00
d83e1e413f 光环助手V4.3.0-个人主页优化2020.09.23ui反馈(5,7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-23 18:05:07 +08:00
19986099ff 补充新专题样式的MTA点击事件 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1001 2020-09-23 17:57:23 +08:00
lyr
f23dd6a662 完成个人主页-2020.09.23ui反馈问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-23 17:29:18 +08:00
951d306765 修复搜索相关的数据统计问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1015 2020-09-23 17:19:52 +08:00
8adfaa88a3 延迟加载游戏库 2020-09-23 16:37:03 +08:00
lyr
fcb76e71e5 优化个人主页-游戏评论 2020-09-23 15:39:20 +08:00
lyr
2da536f667 登录页UI优化 2020-09-23 15:36:40 +08:00
2034b1c587 类原生系统的通知ICON换为与普通推送通知一样 2020-09-23 15:30:04 +08:00
ea2e169199 完成首页和版块的项目间距调整 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/999, https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-23 15:10:55 +08:00
2cf6c2747c Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-23 15:08:05 +08:00
dd24b6243a 光环助手V4.3.0-引导设置“安装权限” 0922测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1011 2020-09-23 15:07:59 +08:00
lyr
81fc6aa6cb 完成光环前端优化汇总(2020年9月第1周)第8点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993#note_67726 2020-09-23 11:28:25 +08:00
lyr
8e3bcf6b5b 完成光环前端优化汇总(2020年9月第1周)第4点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993#note_67726 2020-09-23 10:00:22 +08:00
8e181c9846 处理帖子删除评论后数据同步问题 2020-09-23 09:46:51 +08:00
lyr
7a737da328 优化个人主页UI以及逻辑 2020-09-22 19:23:00 +08:00
5545c112b7 完成前端优化汇总的5 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-22 18:21:57 +08:00
a6f187d444 光环助手V4.3.0-Q&A管理优化需求 20200922UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/992 2020-09-22 17:46:33 +08:00
3ad72ee1f8 处理帖子列表删除评论后评论数错误问题 2020-09-22 17:32:52 +08:00
2cc100b887 处理消息中心图片不显示问题 2020-09-22 17:15:52 +08:00
761c5dc0bf Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-22 17:08:14 +08:00
80d3f140f4 处理网页中含有地图导致时间冲突问题 2020-09-22 17:08:09 +08:00
b72621ee2b 修复自滚动栏目偶发不能滚动的问题,调整首页/版块专题复用的偏移量 2020-09-22 15:41:28 +08:00
7896f3ee46 增加我的光环查看背景操作 2020-09-22 15:13:04 +08:00
d33c15e47b 删除多余代码 2020-09-22 14:51:05 +08:00
ddcd3f8169 增加帖子评论删除功能 2020-09-22 14:48:27 +08:00
lyr
42f66cd543 个人主页增加礼仪测试通过弹窗 2020-09-22 14:15:45 +08:00
c0efd4a8e4 完成专题功能优化20200919测试问题的(6/7/8/9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-22 12:07:09 +08:00
lyr
a4df780a8b 优化个人主页UI 2020-09-22 11:55:46 +08:00
lyr
e8ac144454 添加分享个人主页网址 2020-09-22 11:10:13 +08:00
lyr
d543181b92 退出登录"我的光环"设置为默认背景 2020-09-22 10:46:23 +08:00
lyr
02cfb7515b 基本完成光环助手V4.3.0-个人主页优化https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1004 2020-09-22 10:40:12 +08:00
4b71e44c51 修改个人主页挂件不显示 2020-09-21 16:39:08 +08:00
68f7e1fa58 用户头像添加挂件 2020-09-21 16:25:00 +08:00
2f66588455 补充插件反馈跳转 urlScheme https://gitlab.ghzs.com/pm/halo-plugin-issues/-/issues/164 2020-09-21 09:34:05 +08:00
f39cf38313 完成首页新增专题以及热门搜索的曝光上报 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1001, https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1015 2020-09-18 18:32:06 +08:00
1141604d20 修改头像挂件控件 2020-09-18 18:23:59 +08:00
6b575f0169 光环助手V4.3.0-Q&A管理优化需求(7,8) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/992 2020-09-18 11:52:30 +08:00
6428179c54 修复测试环境上传大图会闪退的问题 2020-09-18 11:40:03 +08:00
44445e6e34 修复自适应图片的展开问题 2020-09-18 11:18:14 +08:00
fb48316069 添加跳转帮助与反馈页面协议 2020-09-18 11:00:26 +08:00
ea5312d606 处理编译问题 2020-09-18 10:15:32 +08:00
5cb6f9e296 Merge branch 'dev_4.3.0' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java
#	app/src/main/java/com/gh/gamecenter/security/SecurityFragment.kt
#	dependencies.gradle
2020-09-18 10:08:37 +08:00
fdb1d255ba Merge branch 'dev_4.3.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.3.0 2020-09-18 10:03:04 +08:00
153b19c966 跳转使用帮助内容详情 2020-09-18 10:02:59 +08:00
ba79d009e6 优化一般静态图片的加载显示逻辑 2020-09-18 09:56:44 +08:00
47f9c967b1 Merge branch 'dev_4.3.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.3.0
# Conflicts:
#	app/src/main/res/values/colors.xml
2020-09-17 18:10:28 +08:00
97ab6108cf 完成粗略的头像挂件和更换背景页面 2020-09-17 18:08:01 +08:00
8e9da6e1f5 完成游戏专题功能优化的14,15 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-17 16:35:53 +08:00
aca29abde6 完成9月第一周前端优化汇总的5,10 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-17 15:28:59 +08:00
lyr
dac3f7e2d7 分享截图过程中,base64转bitmap后释放base64 2020-09-17 11:27:05 +08:00
lyr
9f9254a835 上传遗漏代码 2020-09-17 10:02:31 +08:00
lyr
58e3ef83e0 上传遗漏资源文件 2020-09-17 09:59:09 +08:00
lyr
76bb5d1052 基本完成"光环助手V4.3.0-徽章中心优化"前端部分https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1003 2020-09-17 09:52:07 +08:00
afff3446c4 修改视频流评论投诉 2020-09-16 14:23:29 +08:00
2fa6e9c549 光环助手V4.3.0-Q&A管理优化需求(5) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/992 2020-09-16 14:20:58 +08:00
cb4bcedba7 去掉游戏详情专区网页地址的timestamp后缀 2020-09-16 10:19:55 +08:00
5dbe10a8a8 完成游戏专题功能优化的样式增加 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-15 15:55:25 +08:00
13ca69c569 光环助手V4.3.0-视频优化与新增功能汇总(4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-15 09:39:56 +08:00
19e18226bd 完成粗糙的首页专题样式增加 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/998 2020-09-14 18:39:01 +08:00
6b51a198c2 光环助手V4.3.0-版块管理功能优化(三) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/999 2020-09-14 17:25:06 +08:00
5ad38457af 光环前端优化汇总(2020年9月第1周)(9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-14 16:42:23 +08:00
ee3043875a 光环助手V4.3.0-引导设置“安装权限” https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1011 2020-09-14 11:40:37 +08:00
92c8a698f3 jenkins脚本去掉中文 2020-09-11 18:11:55 +08:00
41f78c365b 版本号更新至4.3.0 2020-09-11 18:09:40 +08:00
lyr
4b8053beee 光环助手V4.3.0-优化登录功能(第二期)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/1006 2020-09-10 18:09:59 +08:00
lyr
8008266389 手机号绑定冲突页UI优化 2020-09-10 11:06:56 +08:00
1ce04241f6 tinker base 4.2.0-202 2020-09-09 11:31:50 +08:00
a37701f148 调整问题详情、回答详情更多按钮 2020-09-08 17:00:49 +08:00
add1339f4a 调整帖子详情更多按钮 2020-09-08 14:49:51 +08:00
f29b8da6d0 Version code 增至202 2020-09-08 14:28:03 +08:00
de968a4820 调整上报激活数据的时机 2020-09-08 14:26:42 +08:00
859a2a5672 光环前端优化汇总(2020年9月第1周)(2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/993 2020-09-07 17:46:01 +08:00
ddddda10a5 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-07 16:56:33 +08:00
30d6dabe4f 1.处理个人主页闪退问题 2.处理论坛帖子点赞数据同步 2020-09-07 16:56:27 +08:00
7655cc25be 捕抓通知栏闪退 2020-09-07 16:26:37 +08:00
52824e5baa 捕抓帖子详情列表动画异常 2020-09-07 16:11:00 +08:00
014c80cd18 激活信息添加 OAID https://gitlab.ghzs.com/pm/yunying/-/issues/1252 2020-09-07 16:05:56 +08:00
a7a48ccf77 光环助手V4.3.0-视频优化与新增功能汇总 (5,7-9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-07 14:36:20 +08:00
99eddec84a tinker_base 4.2.0-201 2020-09-07 14:12:00 +08:00
6b382ab080 暂时还原游戏库加载逻辑 2020-09-07 11:18:21 +08:00
d492cfdace Version code 升级到 201 2020-09-07 11:08:32 +08:00
256f0af0e9 修复一些闪退问题 2020-09-07 11:05:39 +08:00
58d2290e12 tinker_base 4.2.0-200 2020-09-04 18:27:59 +08:00
547e6da027 临时处理帖子详情状态栏颜色问题 2020-09-04 18:09:29 +08:00
c3e34ba644 应用内拦截光环url补充 m.ghzs666.com 2020-09-04 16:51:23 +08:00
e9583284d0 Merge branch 'dev_fragment' into dev_4.3.0
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/fragment/SearchToolWrapperFragment.java
#	app/src/main/java/com/gh/gamecenter/video/game/GameVideoActivity.kt
2020-09-04 15:25:00 +08:00
b670a9c1c4 光环助手V4.3.0-视频优化与新增功能汇总(10) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/983 2020-09-04 15:12:04 +08:00
077e17c5aa 捕抓分享异常,调整回答评论字数上限 2020-09-04 14:51:27 +08:00
f264875b7d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-04 09:24:28 +08:00
351b8a331c 处理上传视频封面错误问题 2020-09-04 09:24:24 +08:00
479f7c464b 调整游戏详情分享链接 2020-09-03 17:25:48 +08:00
e04a7fc4b9 修复资讯评论闪退问题 2020-09-03 17:19:54 +08:00
595f7747f4 调整帖子详情的评论楼层显示 2020-09-03 16:54:59 +08:00
8c1343fdba 优化帖子详情UI显示 2020-09-03 16:23:19 +08:00
c3717869bd 版规声明跳转至资讯文章详情 2020-09-03 15:34:03 +08:00
1e56dc533d 修改文案 2020-09-03 11:41:30 +08:00
1444531830 视频活动兼容老版本 2020-09-03 11:24:45 +08:00
4e759e446b 处理论坛详情全部列表筛选错误 2020-09-02 18:38:55 +08:00
33d86a7995 处理页面重建后DialogFragment重复创建 2020-09-02 16:28:01 +08:00
ef6c09d27b 优化帖子评论的滚动效果 2020-09-02 16:12:46 +08:00
efc241429c 优化 gif 加载尺寸避免频繁内存回收 2020-09-02 15:51:27 +08:00
07be540ba1 补充错误码 2020-09-02 15:49:53 +08:00
50479d2e87 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-02 15:35:01 +08:00
2934c9dc38 处理ScrollView会自动滚动到焦点位置问题 2020-09-02 15:34:56 +08:00
30a60797e6 修复专题头图的曝光上报问题 2020-09-02 14:23:43 +08:00
53562297d5 修复启动时重复获取镜像地区配置数据的问题 2020-09-02 14:13:55 +08:00
144ee3ea8c 修改视频评论UI 2020-09-02 09:49:56 +08:00
e0c8697e75 延迟加载游戏库 2020-09-01 18:27:06 +08:00
6aba2906f6 完成论坛测试汇总的17~19 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/989 2020-09-01 17:14:28 +08:00
7bb468a1b1 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-01 16:22:05 +08:00
871be728bf 光环助手V4.2.0-论坛与视频测试汇总(正式环境)(8-10,12-16) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/989 2020-09-01 16:22:01 +08:00
bbac0c8d93 修复帖子详情骨架图变形的问题 2020-09-01 15:04:40 +08:00
6b361ed077 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-09-01 11:39:29 +08:00
1cfa54f8e8 分片检测下载进度数据增加 host 字段 2020-09-01 11:39:13 +08:00
80ce5052d9 整理 Fragment 实例化代码 https://gitlab.ghzs.com/halo/assistant-android/-/issues/20 2020-09-01 10:05:20 +08:00
5bd028cbe9 更新正式环境接口 2020-09-01 09:00:04 +08:00
b8f8711ba4 修复专题列表无筛项时曝光上报缺失数据的问题 2020-08-31 18:43:06 +08:00
ec805653bb 大致完成 整理 Fragment 实例化代码 https://gitlab.ghzs.com/halo/assistant-android/-/issues/20 2020-08-31 18:31:55 +08:00
c1f899f0d5 去掉视频详情游戏名称的点后缀 2020-08-31 17:32:27 +08:00
e4fd74da7d 修复APP由自动更新切换为手动更新时的进度跳跃问题 2020-08-31 17:31:38 +08:00
bf9cc93daa 补充方法供网页弹起版本不支持弹窗 2020-08-31 16:01:11 +08:00
3b974268a9 修复视频合集游戏标题的显示问题 2020-08-31 11:56:10 +08:00
822853a4be 完成光环助手V4.2.0-数据统计需求(游戏专题) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/984 2020-08-31 11:49:47 +08:00
f699841427 论坛首页双击回到顶部显示发帖子图标 2020-08-31 10:59:59 +08:00
c700910b15 调整首页卡片分割线高度 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/820 2020-08-31 10:31:57 +08:00
3c8d0cb3ec 补充礼仪考试弹窗MTA统计 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/945 2020-08-31 10:26:16 +08:00
8492c762b5 Merge remote-tracking branch 'origin/dev' into dev 2020-08-31 09:40:46 +08:00
b2d70392bb 补充进入游戏详情触发自动下载游戏的参数 2020-08-31 09:40:30 +08:00
eb9cb08624 更换启动引导图 2020-08-31 09:16:07 +08:00
a4ca2628dc 增加分片检测下载进度数据 https://gitlab.ghzs.com/stats/stats-issues/-/issues/188#note_66919 2020-08-28 18:44:21 +08:00
727d78d0e5 去掉获取地理位置权限 2020-08-28 17:14:44 +08:00
693d8c4385 Merge remote-tracking branch 'origin/dev' into dev 2020-08-27 23:48:38 +08:00
d46e3fac2d 补充跳转首页论坛的urlScheme 2020-08-27 23:48:30 +08:00
7f0ec7f128 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 23:24:38 +08:00
73eb2f6ecb 修改视频上传标签UI 2020-08-27 23:24:34 +08:00
6bd7ced28c 修复帖子详情UI测试0827PM https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-27 23:15:38 +08:00
086c31a7d4 修复礼包页面重复跳转会复用第一个页面数据的问题 2020-08-27 23:09:00 +08:00
3a839f6770 修改系统消息点赞文案 2020-08-27 23:05:28 +08:00
b67c7e2803 修改论坛首页引导UI间距 2020-08-27 22:58:43 +08:00
b7dbf30845 修改论坛详情UI 2020-08-27 22:49:19 +08:00
lyr
ec86970cbe 登录界面顶部栏适配小米型号手机 2020-08-27 21:41:11 +08:00
956755b985 Merge remote-tracking branch 'origin/dev' into dev 2020-08-27 20:47:36 +08:00
fe2779196d 修复详情页点击tab偶尔失效的问题 2020-08-27 20:47:29 +08:00
9eeeba93d0 Merge branches 'dev' and 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 20:46:03 +08:00
d7df019d6d 调整论坛帖子底部按钮 2020-08-27 20:45:58 +08:00
lyr
68bfc26ddc 如果当前登录方式为手机号,在更换绑定手机号后,同步更新登录方式的值为已更换的手机号 2020-08-27 20:33:20 +08:00
94a1cfe4b2 修复帖子点赞通知的跳转问题 2020-08-27 20:13:13 +08:00
936c3b00bb 修改论坛UI问题 2020-08-27 20:04:49 +08:00
b34229e4c4 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 19:53:11 +08:00
b51322b473 视频上传交互优化(第二期)(5,6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/969 2020-08-27 19:53:04 +08:00
e0657ccdcc 优化帖子详情请求出错时的显示 2020-08-27 19:49:21 +08:00
4b67d8b5aa 微调帖子详情页UI 2020-08-27 17:50:46 +08:00
5b8cc49349 完成更新强退时清空下载通知的功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-27 16:58:01 +08:00
612f71e18c 原始回复显示作者标签 2020-08-27 16:55:37 +08:00
6239ccb8ab 删除多余代码 2020-08-27 16:47:12 +08:00
9680bea412 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 16:40:13 +08:00
a21d9096c8 处理论坛点赞错误问题 2020-08-27 16:40:09 +08:00
e6f3ad5cc2 视频上传交互优化(第二期)20200827ui反馈 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/969 2020-08-27 16:39:35 +08:00
c41e996add 修复更新进度跳跃问题 2020-08-27 16:32:29 +08:00
58f230038c 完成更新强退时清空下载通知的功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-27 16:27:05 +08:00
bda41d8a26 修复更新推送0827测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-27 15:49:44 +08:00
e3f41543a4 完成帖子详情测试内容 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-27 15:09:45 +08:00
lyr
78c4d7acef 1.修改"注册方式"判断逻辑;2.优化"账号与安全"模块UI 2020-08-27 14:51:41 +08:00
8c884b6d23 修复礼仪考试20200826测试问题2 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/945 2020-08-27 14:33:32 +08:00
a5f9af2df2 适配活动视频流接口 2020-08-27 14:30:33 +08:00
e2fd6dbf97 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 14:08:46 +08:00
e430b4e2de 视频上传交互优化(第二期)20200827测试(3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/969 2020-08-27 14:08:42 +08:00
caa3f46c5c 初始下载不填加 range 请求头 2020-08-27 11:00:50 +08:00
b2beba4d36 论坛详情UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-27 10:52:51 +08:00
3a9c7fc71d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-27 08:38:41 +08:00
a5f8275f64 修改论坛帖子列表底部按钮错位问题 2020-08-27 08:38:36 +08:00
8fa3f3d832 调整更新推送逻辑 2020-08-26 19:52:38 +08:00
97472b8259 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-26 18:53:04 +08:00
ee07889b30 光环助手V4.2.0-引导设置“通知管理”(第3期)20200825UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/947 2020-08-26 18:52:59 +08:00
8582860116 光环助手V4.2.0-视频详情优化(第二期)20200825UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/970 2020-08-26 18:52:30 +08:00
b8903e7814 完成更新优化0826测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-26 18:10:43 +08:00
b47bcfc2c3 Merge branches 'dev' and 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-26 17:56:55 +08:00
35a987a835 完成光环助手V4.2.0-问答首页优化UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/955 2020-08-26 17:56:49 +08:00
lyr
6f413b27d4 优化"账户与安全"模块代码 2020-08-26 16:09:53 +08:00
92173b4794 游戏详情优化汇总(9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/975 2020-08-26 15:46:51 +08:00
89e79154aa Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-26 15:21:16 +08:00
de9145cd70 视频上传交互优化(第二期)(1-4,9)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/969 2020-08-26 15:21:08 +08:00
8bf509ee2d 完成游戏类型优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/960 2020-08-26 15:00:42 +08:00
d7144265e1 完成更新推送功能优化0826补充及UI调整 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-26 14:30:28 +08:00
cc6c759658 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-25 18:34:32 +08:00
8e5d482f9e 修改通知弹窗不显示问题 2020-08-25 18:34:26 +08:00
5ed8f2499a 完成活动分享数据即时反馈需求 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/982 2020-08-25 18:29:39 +08:00
a8c9bcc1b0 完成礼仪考试功能20200825测试的3 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/945 2020-08-25 18:10:17 +08:00
21aabcc561 完成更新推送优化20200825的1 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-25 18:02:52 +08:00
a2b86a9e21 Merge remote-tracking branch 'origin/dev' into dev 2020-08-25 17:47:29 +08:00
74882f56ee 完成帖子详情20200825测试的(2, 4~10) 2020-08-25 17:47:19 +08:00
1eb9ec1dd3 光环助手V4.2.0-论坛详情功能20200825测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-25 17:44:49 +08:00
9e95c0cc7e Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-25 17:00:34 +08:00
877238d2d5 光环助手V4.2.0-引导设置“通知管理”(第3期)20200825测试2 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/947 2020-08-25 17:00:30 +08:00
lyr
9c6f69b16a 修改绑定手机无法完成问题 2020-08-25 16:53:14 +08:00
64af456182 补充网页JS调用方法 2020-08-25 16:48:32 +08:00
1a84477700 修改视频评论作者标记显示问题 2020-08-25 16:20:29 +08:00
a0b6285596 修改文章标签详情列表不显示 2020-08-25 15:15:29 +08:00
951c139062 修改我的论坛我的帖子列表不显示 2020-08-25 14:23:00 +08:00
99efcd6bbf 光环助手V4.2.0-论坛详情功能20200824测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-25 11:53:24 +08:00
3482f58b1b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/entity/ForumEntity.kt
#	app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt
2020-08-25 10:07:45 +08:00
6b4f751a16 光环助手V4.2.0-论坛详情功能(1,7,10) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-25 10:03:26 +08:00
3be1308230 Merge remote-tracking branch 'origin/dev' into dev 2020-08-24 18:27:53 +08:00
b7710cffa3 微调帖子详情样式 2020-08-24 18:27:44 +08:00
lyr
dc4fe89521 账户与安全页底部增加联系客服文案和相应跳转 2020-08-24 18:20:47 +08:00
c33eb6829a 完成游戏详情优化(7,8) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/975 2020-08-24 17:59:21 +08:00
e1793d57eb Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-24 17:28:30 +08:00
cc4c48f718 修改取消论坛后论坛首页数据刷新问题 2020-08-24 17:28:25 +08:00
aa20ed9744 完成自定义栏目的镜像优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/963 2020-08-24 16:44:48 +08:00
b6d8688a40 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-24 16:32:58 +08:00
d1da2bb7fa 光环助手V4.2.0-问答首页优化20200824测试(2,5,6,7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/955 2020-08-24 16:32:53 +08:00
lyr
7828bce732 新增上传抖音方式登录日志 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/951 2020-08-24 15:38:00 +08:00
026a8d7093 Merge branch 'feature-change-gdt-key' into 'dev'
更换广点通ID https://gitlab.ghzs.com/pm/yunying/-/issues/1249

See merge request halo/assistant-android!24
2020-08-24 14:15:57 +08:00
6a9a29c5ff 更换广点通ID https://gitlab.ghzs.com/pm/yunying/-/issues/1249 2020-08-24 14:14:33 +08:00
lyr
16b4b6cc81 修复专题排行榜滑动卡顿问题 2020-08-24 12:00:20 +08:00
863e570b61 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-24 11:53:47 +08:00
c9e8408804 修改视频评论作者标记显示错误 2020-08-24 11:53:42 +08:00
31984f1737 基本完成论坛帖子详情功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-24 11:31:53 +08:00
ad2a0debdd 论坛列表数据同步 2020-08-24 09:56:30 +08:00
4c45657092 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-22 09:57:19 +08:00
5d7fc94d51 优化论坛首页 2020-08-22 09:57:14 +08:00
641b430fe5 优化帖子详情结构 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-21 18:46:37 +08:00
lyr
e1bb02f4e0 绑定手机号点击"跳过"增加弹窗提示 2020-08-21 18:24:33 +08:00
36fd8cf408 双击论坛tab回到顶部 2020-08-21 15:04:42 +08:00
e48b47b315 处理个人主页论坛列表不显示问题 2020-08-21 14:17:09 +08:00
46935e4cad 补充网页游戏详情用的跳转规则 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/966 2020-08-21 11:45:14 +08:00
b8a6b4baea 处理游戏详情的闪退 2020-08-21 11:42:36 +08:00
8a8f0a95ed 光环助手V4.2.0-视频详情优化(第二期)20200820测试(4,6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/970 2020-08-21 10:32:52 +08:00
cdbefd2d4f 完成部分帖子详情的功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-20 21:01:40 +08:00
7e79b4e328 基本完成礼仪考试APP端功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/945 2020-08-20 19:53:10 +08:00
11dc9f9be0 游戏详情增加论坛Tab 2020-08-20 18:01:27 +08:00
ec255099eb 光环助手V4.2.0-论坛详情功能(9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-20 16:21:49 +08:00
64738dceaf 光环助手V4.2.0-论坛详情功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-20 15:40:08 +08:00
7d518696f0 Merge branch 'dev_4.2.0' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/util/EntranceUtils.java
2020-08-20 10:56:44 +08:00
fcd97b66df 光环助手V4.2.0-论坛详情功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/956 2020-08-20 10:53:26 +08:00
47f5c3b7c1 缩小保存测试路径的长按区域 2020-08-20 10:33:50 +08:00
b64fee9d25 Merge branch 'dev_4.2.0' into 'dev'
Dev 4.2.0

See merge request halo/assistant-android!23
2020-08-20 09:08:19 +08:00
498efdf5ea Merge branch 'dev' into 'dev_4.2.0'
# Conflicts:
#   dependencies.gradle
2020-08-20 09:08:12 +08:00
59d6450ded 更改论坛帖子详情的实现方式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-19 18:41:47 +08:00
7da206af7e 压缩部分原图过大的图片 2020-08-19 18:38:56 +08:00
8bd669e11a 正式环境维持 v4d1 接口 2020-08-19 17:49:12 +08:00
62570aed9e Merge remote-tracking branch 'origin/dev_lyr' into dev_4.2.0
# Conflicts:
#	app/src/main/java/com/gh/common/constant/Constants.java
#	dependencies.gradle
2020-08-19 17:45:17 +08:00
lyr
bfe9c04384 修改登录界面关闭按钮高度 2020-08-19 17:38:15 +08:00
lyr
b27d007d47 1.完成光环助手V4.2.0-优化登录功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/949;2.完成光环助手V4.2.0-新增账户安全功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/948#note_63972 2020-08-19 16:38:04 +08:00
7e50e6570d 光环助手V4.2.0-问答首页优化(15) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/955 2020-08-19 11:32:22 +08:00
336d449889 全局搜索将'文章'替换为'帖子' 2020-08-18 17:46:13 +08:00
3dfea1e6f9 Merge branch 'dev_4.2.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.2.0 2020-08-18 17:11:15 +08:00
3c1780d9b5 视频上传交互优化UI 2020-08-18 17:11:10 +08:00
35ee7cf03d 光环助手V4.2.0-论坛其他优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/968 2020-08-18 17:05:56 +08:00
lyr
72e8c18f9c 1.完成登录界面UI改版;2.增加第三方抖音登录;3.增加账号安全模块 2020-08-18 15:57:02 +08:00
f3f876d213 完成礼仪考试功能的APP UI https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/945 2020-08-18 14:37:45 +08:00
398907db90 完成游戏详情优化汇总(2~5) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/975 2020-08-18 10:18:25 +08:00
5dd251eaa8 完成游戏专题功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/965 2020-08-17 20:47:29 +08:00
2c73e55f43 调整通用列表的显示元素 2020-08-17 17:31:11 +08:00
f4406d7960 调整帖子评论布局 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-17 17:22:10 +08:00
3e0a620ac5 更改帖子详情的实现方式 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-14 18:38:57 +08:00
9ea8c32608 论坛首页优化 2020-08-14 17:51:15 +08:00
e2ea197f9e 光环助手V4.2.0-问答首页优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/955 2020-08-14 17:14:30 +08:00
f92038b5bf 光环助手V4.2.0-视频详情优化(第二期)(9,10) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/970 2020-08-13 18:00:58 +08:00
fa9eee2c4a 修改删除视频评论列表刷新错误 2020-08-13 16:52:58 +08:00
3e62fb61e1 Merge branch 'dev_4.2.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.2.0 2020-08-13 16:22:07 +08:00
5d71e0ccc1 光环助手V4.2.0-视频详情优化(第二期)(1-8) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/970 2020-08-13 16:22:02 +08:00
4699923058 清理测试内容 2020-08-13 16:03:55 +08:00
9206938938 更新版本号 2020-08-13 16:00:50 +08:00
46ac569f70 优化静默更新下载逻辑 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-13 15:43:41 +08:00
b90d1b4f38 处理编译问题 2020-08-13 11:47:10 +08:00
592b7bbc5e 更新 gid 依赖 2020-08-13 11:31:11 +08:00
3ccb8b3772 基本完成更新推送功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-12 22:02:54 +08:00
422abe1b87 基本完成更新推送功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/946 2020-08-12 21:57:46 +08:00
a14f35a4f0 完成启动跳转方法预留 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/966 2020-08-12 17:36:53 +08:00
3bebc92106 恢复误删的包引入 2020-08-12 16:19:24 +08:00
21413cf250 新增跳转 urlScheme https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/966 2020-08-12 15:33:31 +08:00
04a34af370 光环助手V4.2.0-引导设置“通知管理”(第3期)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/947 2020-08-12 10:25:28 +08:00
e1e6924b6e tinker_base 4.1.0-191 2020-08-11 18:30:29 +08:00
fbd3a42e81 完成粗糙的帖子详情框架,细节待补充 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/967 2020-08-11 18:25:43 +08:00
80a2cbb8cd versionCode 改为191 2020-08-11 18:09:08 +08:00
96fc6cc183 论坛首页蒙层引导 2020-08-11 16:22:52 +08:00
b5ff891db1 修复动态页跳转礼包详情的游戏图标显示问题 2020-08-11 16:03:22 +08:00
d2171e7a3b 更换首页论坛tab图标和点击动画 2020-08-11 15:27:50 +08:00
c3a06f57b1 文章标签详情优化 2020-08-11 11:39:15 +08:00
18f41743bf Merge branch 'dev_4.2.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.2.0 2020-08-11 10:50:20 +08:00
fcc647a1f8 修改发帖子、提问页面 2020-08-11 10:50:15 +08:00
e80b198aa5 添加简单的页面快速跳转功能 2020-08-11 10:38:14 +08:00
52efa96e2c 修复游戏图标的列表复用问题 2020-08-11 10:10:56 +08:00
816dd60298 修复游戏图标角标的复用问题 2020-08-10 18:20:11 +08:00
a181292f80 修复游戏图标角标的复用问题 2020-08-10 18:09:55 +08:00
1b946c325c 光环助手V4.2.0-视频详情优化(第二期)8 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/970 2020-08-10 17:33:59 +08:00
befb323721 测试环境api版本升至v4d2d0 2020-08-10 17:33:20 +08:00
e62c0aaaad 论坛详情、板块成员UI 2020-08-10 17:08:36 +08:00
4ecc0c073b 补充GID获取异常的MTA统计 2020-08-10 11:36:47 +08:00
faa41248eb 修改获取Toast默认偏移量和位置闪退 2020-08-10 10:11:55 +08:00
6dca13e80b 论坛详情UI 2020-08-10 09:43:35 +08:00
f3fab1b3f6 tinker-base_4.1.0 2020-08-07 19:21:13 +08:00
5340a41298 fix bug 2020-08-07 14:24:31 +08:00
553ebc137b 选择论坛UI 2020-08-06 18:00:03 +08:00
caf2a379d9 修复xapk解压后安装包路径没有写入数据库的问题 2020-08-06 16:55:51 +08:00
c59b79427c 修复xapk解压后安装包路径没有写入数据库的问题 2020-08-06 16:42:32 +08:00
dd2338021e 论坛首页UI 2020-08-06 15:14:05 +08:00
e54fcca53e xapk解压失败增加MTA统计 2020-08-06 14:55:40 +08:00
ad416c6a5d xapk解压增加备用解决方案 2020-08-06 14:07:06 +08:00
4a65c1a5c8 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-05 15:53:00 +08:00
878529f646 fix 2020-08-05 15:52:47 +08:00
d01bc1e2d1 移除无用的ijkplayer依赖 2020-08-04 15:59:34 +08:00
d63f5f5ab2 调整广点通激活数据的发送时机 2020-08-04 10:01:00 +08:00
ad0fb7a55a 处理游戏图标类型不一致导致的闪退问题 2020-08-03 16:25:57 +08:00
b0258eef77 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-08-03 16:06:33 +08:00
86d4df8ad9 修复新增开服默认选择时间分钟不准问题 2020-08-03 16:06:20 +08:00
bb11d984f9 处理消息中心闪退问题 2020-08-03 14:56:34 +08:00
d3f3d2ca98 下载详细过程埋点更新 https://gitlab.ghzs.com/stats/stats-issues/-/issues/188 2020-07-31 18:19:52 +08:00
0c1e712c79 编辑封面禁止左右滑动(与图片缩放会有冲突)
修复xapk提示存储不足后没有把当前解压线程移除问题
2020-07-31 15:21:33 +08:00
e193a40651 修改预约弹窗号码提示动画的持续时间 2020-07-31 14:47:42 +08:00
03f36476cb Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-31 11:45:13 +08:00
a721637be3 预约弹窗增加号码提示弹出动画 2020-07-31 11:44:58 +08:00
722fb1ad64 调整视频数据UI间隔 2020-07-31 10:32:01 +08:00
52a05c3aa4 这是环境api版本改为v4d1d0 2020-07-31 10:31:30 +08:00
bcbdac6afc Merge remote-tracking branch 'origin/dev' into dev 2020-07-30 22:29:09 +08:00
a9507af3f4 修复镜像游戏的角标问题 2020-07-30 22:29:01 +08:00
68601ca8be 修改预约弹窗点击弹窗以外区域弹窗没有消失问题 2020-07-30 22:17:00 +08:00
a7adc27896 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 21:23:44 +08:00
d19d0eb571 修改预约弹窗的弹出位置 2020-07-30 21:23:30 +08:00
d8e365fe08 修改游戏评论显示异常 2020-07-30 21:12:17 +08:00
b34f61ce0d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 18:10:05 +08:00
1f24d16f95 h5游戏增加关闭按钮开关控制 2020-07-30 18:10:00 +08:00
738074ec00 光环助手V4.1.0-游戏评论功能强化20200730测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/925 2020-07-30 18:09:07 +08:00
c8eee33475 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 17:13:25 +08:00
badf9f9c20 修改编辑封面UI
防止手机登录连续点击获取验证码重复发送问题
2020-07-30 17:13:19 +08:00
0398cc4ffc 修改视频数据总览 2020-07-30 15:59:55 +08:00
b88abf6b9a link为空拦截跳转 2020-07-30 15:37:35 +08:00
a0d193bc52 web跳转视频流添加gameId参数 2020-07-30 15:24:33 +08:00
6ac635f8c6 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 14:38:11 +08:00
30c7d71114 外部跳转增加qq群 2020-07-30 14:38:05 +08:00
0223b3ab22 修复查看图片的bug(0730测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-30 11:57:48 +08:00
c9663662d5 补充遗漏的游戏图标显示优化页面 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-30 11:41:17 +08:00
12bed97638 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 11:11:25 +08:00
a857af970d 修复游戏评分一直显示加载中问题 2020-07-30 11:11:20 +08:00
7da621583f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-30 11:08:38 +08:00
46a32b62c2 光环前端优化汇总(2020年7月第3周)20200729测试问题补充5 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-30 11:08:33 +08:00
45bcc95e7d 游戏详情玩家评论数据同步 2020-07-30 11:07:44 +08:00
7d7bcfaa1d 补充遗漏的游戏图标显示优化页面 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-30 10:45:23 +08:00
3a9a561c77 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2020-07-30 10:08:03 +08:00
e8d344256a 光环助手V4.1.0-视频上传支持剪辑封面(20200729测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/941 2020-07-30 10:07:34 +08:00
1a7c1119bf 微调UI 2020-07-29 17:44:24 +08:00
0b6a2503aa Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-29 17:32:01 +08:00
459b9f65a9 修改封面尝试修复截帧失败问题 2020-07-29 17:31:49 +08:00
6c1ebe531e 更改游戏图标圆角逻辑 2020-07-29 16:47:53 +08:00
604450292b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-29 15:53:31 +08:00
e42361e84a 1.H5游戏跳转到指趣 2.修改web跳转到视频流闪退 2020-07-29 15:53:24 +08:00
a974652f7f 处理自动打包编译时间不对的问题 2020-07-29 14:40:51 +08:00
309ab54e90 微调UI 2020-07-29 14:40:07 +08:00
486d680c26 补充游戏图标显示优化的页面 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-29 14:30:22 +08:00
61a5f3a275 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-29 14:22:08 +08:00
c865417a4b 光环助手V4.1.0-游戏评论功能强化20200729测试问题:4,6,7 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/925 2020-07-29 14:22:03 +08:00
b142feaaae 微调下载管理-游戏下载UI 2020-07-29 14:19:15 +08:00
7380854133 微调UI 2020-07-29 11:29:23 +08:00
8a0f185eda 修改视频上传UI 2020-07-29 10:59:17 +08:00
bd9604a53e 微调UI 2020-07-29 10:13:44 +08:00
1aeab51f94 修复上传视频后视频投稿页面无法及时刷新问题 2020-07-29 09:56:54 +08:00
b16a6fedc6 修改列表分页结束数量限制 2020-07-28 17:54:26 +08:00
b97c381ed4 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-28 17:43:04 +08:00
acb8c723a3 微调UI 2020-07-28 17:42:51 +08:00
4492307e23 处理刷新列表MarkerView会显示问题 2020-07-28 17:42:29 +08:00
e31224b332 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-28 17:13:22 +08:00
6933d6c590 修复预约弹窗键盘弹出延迟问题 2020-07-28 17:13:09 +08:00
3d58841ce5 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-28 16:59:45 +08:00
0654b0a25f 更改评论弹窗动画实现方式 2020-07-28 16:59:41 +08:00
44dde3f91b Merge branch 'video_poster' 2020-07-28 16:27:56 +08:00
abad30595f 光环助手V4.1.0-视频上传支持剪辑封面 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/941 2020-07-28 15:14:51 +08:00
c4df411560 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-28 11:36:14 +08:00
2974fa4562 修改视频数据图表自定义MarkerView 2020-07-28 11:36:10 +08:00
b086b1cb0c 完成接入腾讯企点会话接待组件(0727测试4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/928 2020-07-28 11:24:12 +08:00
22cf026335 删除无用注释 2020-07-28 11:03:48 +08:00
90bd53fe61 修复选择游戏弹窗的闪退问题 2020-07-28 11:03:16 +08:00
9c580a356e 腾讯企点唤起改成应用内 2020-07-28 10:30:05 +08:00
7198c28e6f 补充遗漏的游戏图标角标位置 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-28 10:29:33 +08:00
7bf074fddc 光环助手4.1.0-前端新增视频数据统计20200727测试1,4 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/936 2020-07-28 09:59:46 +08:00
bea1a336e9 视频编辑封面支持线上视频链接截取 2020-07-27 21:10:11 +08:00
97a9e03192 光环助手V4.1.0-视频上传支持剪辑封面(初步完成,后续细节尚需调整) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/941 2020-07-27 18:05:42 +08:00
244d57b6bc 更改判断应用前后台状态的实现逻辑 2020-07-27 17:44:57 +08:00
3cbd484147 更改判断应用前后台状态的实现逻辑 2020-07-27 17:43:56 +08:00
8b81819c30 修改大图触发下拉消失的滑动阈值为大于60度 2020-07-27 16:31:53 +08:00
1873ac5d4e 光环前端优化汇总(2020年7月第3周)0727测试12 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-27 16:29:06 +08:00
cf70c1e7fe 光环助手4.1.0-前端新增视频数据统计20200727UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/936 2020-07-27 15:49:05 +08:00
6f6b26ea4d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-27 15:19:09 +08:00
e2708d9078 对接专区视频流接口 2020-07-27 15:19:05 +08:00
fb5a40c6e4 修复游戏图标的占位图显示问题 2020-07-27 12:03:03 +08:00
e2a10c1410 游戏评论显示折叠评论按钮 2020-07-27 12:01:08 +08:00
5461d3d548 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-27 11:45:26 +08:00
c47365e626 光环助手V4.1.0-游戏评论功能强化 20200725测试问题2,20200727UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/925 2020-07-27 11:45:22 +08:00
3476f8df3a 修复一些闪退问题 2020-07-27 11:14:48 +08:00
f812c1e5c8 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-27 09:24:51 +08:00
391f196005 修改游戏大事件时间转换错误 2020-07-27 09:24:46 +08:00
097dbca26e 修复客服消息列表页复制ID按钮不显示的问题 2020-07-24 18:34:29 +08:00
a147118381 完成游戏图标显示优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-24 16:31:58 +08:00
e6bdde8273 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-24 15:27:27 +08:00
747757faa7 处理视频数据图标显示问题 2020-07-24 15:27:21 +08:00
6f21b9d0ae 腾讯企点改由内部 webview 跳转 2020-07-24 14:47:20 +08:00
e505554aac 修改视频数据图表配置 2020-07-24 11:18:18 +08:00
3323cce890 删除本地导入的videocache 2020-07-24 09:41:22 +08:00
ffd468db1e 格式化视频数据 2020-07-23 18:29:52 +08:00
e98e0d1522 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-23 17:12:07 +08:00
13a4f2014c 光环助手4.1.0-前端新增视频数据统计 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/936 2020-07-23 17:12:01 +08:00
8cbfe6450a Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-23 11:44:09 +08:00
bcc866888e 删除无用代码 2020-07-23 11:44:02 +08:00
60911d5dcb 移除无用的 glide 依赖 2020-07-23 11:15:35 +08:00
7e77d5749e 处理编译问题 2020-07-23 10:36:06 +08:00
6c3be5627d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-23 10:02:41 +08:00
f6a9585700 彻底移除用数据库存储登录信息的代码 2020-07-23 10:02:30 +08:00
06fddb7dcd 完成游戏管理apk包提供海外下载地址 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/930 2020-07-22 18:21:01 +08:00
3a3f9a625b 删除部分测试代码 2020-07-22 17:49:54 +08:00
3702b104fc 光环助手V4.1.0-安装游戏支持解压xapk文件(20200722测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/896 2020-07-22 17:39:46 +08:00
3e023089a1 Merge remote-tracking branch 'origin/dev' into dev 2020-07-22 16:24:37 +08:00
7455674f6b 完成7月第3周优化(3,11,14) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-22 16:24:26 +08:00
c93c0f2fc6 修改列表分页结束数量限制 2020-07-22 16:23:56 +08:00
727f02e571 光环助手V4.1.0-预约游戏自动填写手机号(20200722测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/926 2020-07-22 15:15:25 +08:00
784fae1f5d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-22 14:54:56 +08:00
42ef075912 光环助手V4.1.0-游戏名称点号处理(20200722补充) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/921
修改dev api host
2020-07-22 14:54:44 +08:00
15307c5223 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-22 14:18:38 +08:00
aad3b48883 光环助手V4.1.0-视频详情功能优化20200722测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/935 2020-07-22 14:18:31 +08:00
d65d8f1c4c 删除多余刷新动画图片 2020-07-22 11:46:02 +08:00
c581496975 Merge branch 'refresh' into dev 2020-07-22 11:41:41 +08:00
d5481a8888 修改问答-推荐的下拉刷新动画 2020-07-22 11:24:08 +08:00
e0a61278fc fix import 2020-07-22 10:25:57 +08:00
2c36283833 Merge branch 'dev_4.1.0' into 'dev'
Dev 4.1.0

See merge request halo/assistant-android!21
2020-07-22 10:17:38 +08:00
1b5a8f3a7e Merge branch 'dev' into 'dev_4.1.0'
# Conflicts:
#   app/src/main/java/com/gh/common/DefaultUrlHandler.kt
#   app/src/main/java/com/gh/common/util/ShareUtils.java
#   dependencies.gradle
2020-07-22 10:17:19 +08:00
95c918b4e3 光环助手V4.1.0-游戏大事件功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/938 2020-07-22 09:47:57 +08:00
f32cc1673c 调整查看大图过渡动画 2020-07-21 18:32:32 +08:00
f0fc2f06da Merge branch 'dev_4.1.0' of gitlab.ghzhushou.com:halo/assistant-android into dev_4.1.0 2020-07-21 18:23:58 +08:00
b6c6abaa5b 调整大图动画 2020-07-21 18:23:33 +08:00
6ed67c911c Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 18:14:44 +08:00
1eda223a1e 光环助手V4.1.0-预约游戏自动填写手机号 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/926 2020-07-21 18:14:27 +08:00
316c0c28ab 扩大安利墙列表的部分点击区域 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-21 17:27:18 +08:00
895d4d5cf1 tinker_base 4.0.3 2020-07-21 17:18:49 +08:00
877df95e02 添加安利墙列表的部分点击区域 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-21 17:15:57 +08:00
801f0b95e7 版本改为4.0.3 2020-07-21 17:01:07 +08:00
9019f555b5 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 16:52:00 +08:00
106b03a316 下载文件格式兼容xapk 2020-07-21 16:51:44 +08:00
d8faa554be 优化查看图片交互 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-21 16:44:59 +08:00
93080a74a7 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 15:54:08 +08:00
3ea2ede0cb 视频上传增加视频宽高字段 2020-07-21 15:53:59 +08:00
1242848b6f Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 15:35:50 +08:00
24d44a2c90 光环助手V4.1.0-游戏评论功能强化MTA数据统计 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/925 2020-07-21 15:35:45 +08:00
971779a529 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 15:28:59 +08:00
14f561c237 扩大下载管理删除按钮的点击范围 2020-07-21 15:28:38 +08:00
3a38e746f6 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-21 14:38:05 +08:00
dd3bc9d39d 光环助手V4.1.0-游戏评论功能强化1-5,6(1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/925 2020-07-21 14:38:01 +08:00
39a8062aef 光环后台功能迁移测试汇总0717测试-1 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/923 2020-07-21 14:35:52 +08:00
55b6ccb760 merge xapk branch 2020-07-21 14:35:01 +08:00
a8a55eb9bd 修复首页游戏隐藏评论后还能显示评分问题 2020-07-21 14:30:15 +08:00
3eb73439aa 修改页面loading动画 2020-07-21 11:30:29 +08:00
466e118579 尝试替换SwipeRefreshLayout的下拉动画 2020-07-20 17:58:51 +08:00
b38032074b 按帧导入下拉刷新动画,SwipeRefreshLayout以源码的方式引入到主工程 2020-07-20 17:54:56 +08:00
9ee771e528 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-20 17:04:11 +08:00
9253ed47e6 微信浏览器跳转到app 2020-07-20 17:04:03 +08:00
bc82263286 更改获取 bitmap 的实现 2020-07-20 16:41:46 +08:00
11979240ab Merge branch 'dev_4.0.1_bugfix' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/DefaultUrlHandler.kt
#	dependencies.gradle
#	gradle.properties
2020-07-20 15:57:50 +08:00
255e6182a9 更改评论弹窗点击更多按钮交互方式 2020-07-20 15:41:39 +08:00
f170abb7ea 修复分享内容含 gif 图片时会分享失败的问题 2020-07-20 11:00:44 +08:00
eb80deb413 升级应用版本号为 4.1.0, 正式环境接口退回 4.0.2 (正式环境 4.1.0 API 暂未开启) 2020-07-20 10:58:15 +08:00
10ba5a9ba5 修改注释 2020-07-17 17:15:23 +08:00
94c49cba8b 修复裁剪控件图片过大显示异常问题 2020-07-17 17:13:54 +08:00
354dca8b04 非视频作者也可以删除自己的评论 2020-07-17 16:56:51 +08:00
034488ff34 非视频作者也可以删除自己的评论 2020-07-17 16:53:30 +08:00
59c70e23dd 光环前端优化汇总(2020年7月第3周)(5, 8, 12) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-17 16:04:45 +08:00
7d98a842f1 完成接入腾讯企点会话接待组件 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/928 2020-07-17 14:37:15 +08:00
5f8006dc5a Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-17 11:24:10 +08:00
239bd69580 update LGLibrary version 2020-07-17 11:24:07 +08:00
bc96f102a1 光环前端优化汇总(2020年7月第3周)(2,4,6,7)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/940 2020-07-17 11:19:13 +08:00
e2ef3f4d01 尝试解决登录失效后,无法打开登录界面问题 2020-07-17 10:47:07 +08:00
5c20bbf5e4 光环助手V4.1.0-视频详情功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/935 2020-07-16 18:09:54 +08:00
b07edd256a 增加登录异常MTA事件 2020-07-16 17:15:34 +08:00
1478d37889 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0
# Conflicts:
#	app/src/main/res/values/colors.xml
2020-07-16 16:40:24 +08:00
7151b56de3 光环助手V4.1.0-预约游戏自动填写手机号 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/926 2020-07-16 16:37:55 +08:00
220fd9528b 去掉部分页面游戏图标右上角的礼包角标 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/939 2020-07-16 14:43:10 +08:00
1c26c35571 完成首页轮播图数据调整 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/933 2020-07-16 11:03:35 +08:00
78eb6b7b02 Merge branch 'dev_4.1.0' of gitlab.ghzs.com:halo/assistant-android into dev_4.1.0 2020-07-16 09:11:10 +08:00
9dc9add896 折叠评论UI 2020-07-16 09:11:05 +08:00
2d09f8c008 游戏专区外部跳转 2020-07-16 09:07:14 +08:00
166e1e77ec 完成首页弹窗数据统计 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/881 2020-07-15 18:32:07 +08:00
ea782d002b 光环助手V4.1.0-资讯文章配置的超链接跳转逻辑优化2(1,2,3) 3 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/927 2020-07-15 17:27:10 +08:00
f525a3c46d 接口版本改为v4d1d0 2020-07-15 17:23:22 +08:00
bef6cbb212 tinker_base 4.0.2-183 2020-07-15 17:00:17 +08:00
5e0af8654a 完成新首页轮播图数据上报调整 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/933 2020-07-15 16:56:04 +08:00
032a89e0cd versionCode 改为183 2020-07-15 16:48:28 +08:00
c9afb6df02 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-15 16:30:50 +08:00
b8092447ff 游戏列表默认不显示评分 2020-07-15 16:30:43 +08:00
bff20bea49 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-15 16:29:34 +08:00
87f2d9c85f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2020-07-15 15:04:43 +08:00
154dfc8538 DsBridge原生Api支持无参方法 2020-07-15 15:03:56 +08:00
59c4176983 尝试根据视频帧数获取视频截图 2020-07-15 14:40:10 +08:00
fddcdfb3aa 更改今日头条SDK的初始化位置 2020-07-15 09:41:29 +08:00
cdbf7d39a5 光环助手V4.1.0-资讯文章配置的超链接跳转逻辑优化(1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/927 2020-07-14 17:56:18 +08:00
6a55821d4d 完成一些todo 2020-07-14 10:16:45 +08:00
a305db7b13 tinker_base 4.0.2-182 2020-07-13 17:14:15 +08:00
58b1cd4b12 versionCode 改为182 2020-07-13 16:45:19 +08:00
5e7559e43f 修复一些闪退问题 2020-07-13 16:42:03 +08:00
2a74e35388 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-13 16:41:22 +08:00
5b9bef79da 修复一些闪退问题 2020-07-13 16:01:11 +08:00
e89750c364 光环助手V4.1.0-游戏名称点号处理 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/921 2020-07-13 15:38:06 +08:00
9da6cbf097 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-13 15:23:08 +08:00
f83f719283 光环助手V4.1.0-安装游戏支持解压xapk文件(20200710补充) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/896 2020-07-13 11:16:31 +08:00
4a1c81ffb4 预留方法供网页端确定是否已安装某应用 2020-07-13 09:49:51 +08:00
be26f5168b 增加视频上传urlscheme参数 2020-07-11 21:03:55 +08:00
4e6c75995c tinker_base 4.0.2-bugfix 2020-07-10 17:38:36 +08:00
df693ce0c2 versionCode 改为181 2020-07-10 17:00:55 +08:00
f0236d7ad5 sync submodule 2020-07-10 16:59:18 +08:00
1d3e2b5c16 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-10 16:00:25 +08:00
545d257135 修复一些闪退问题 2020-07-10 16:00:03 +08:00
f5164d2102 修复在模拟器上可能卡启动页的问题 2020-07-10 15:55:58 +08:00
9af83be9a7 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-10 15:40:38 +08:00
49b0b982f5 基本完成Xapk解压安装,还有部分细节可能要调整 2020-07-09 18:31:27 +08:00
ad7543e7bc Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-09 14:56:24 +08:00
1bd0db013b 处理Picasso获取Bitmap有时不显示问题 2020-07-09 14:56:18 +08:00
ef6a2c58ff tinker_base-4.0.2 2020-07-09 10:28:15 +08:00
2aa41661a2 首页横向专题备注默认隐藏 2020-07-09 09:49:24 +08:00
e63a374da1 重新整理Xapk解压部分以及增加取消操作 2020-07-09 09:28:57 +08:00
e326f072d2 视频合集用户信息扩大点击区域 2020-07-08 14:29:59 +08:00
f53cc18ab6 修改启动页调用获取设备弹窗接口错误 2020-07-08 10:38:54 +08:00
723a504d7c 开发环境不主动捕获RxJava抛出的异常 2020-07-08 10:23:21 +08:00
dab48607e8 修改文案 2020-07-08 09:59:23 +08:00
3ee69146bb 光环助手V4.0.2-视频上传与编辑功能优化(20200707测试补充 1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-07-08 09:57:33 +08:00
ca86a66b14 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-07 18:26:51 +08:00
c92bdd3014 修复首页竖向专题下载进度无法刷新问题 2020-07-07 18:26:35 +08:00
0be23f26f2 修复自定义栏目正文高亮文字点击提示复制成功的问题 2020-07-07 18:12:23 +08:00
6ce4592e5e 修改分享事件上报 2020-07-07 17:49:20 +08:00
92caedb011 光环助手V4.0.2-视频上传与编辑功能优化(20200707测试补充 3,5)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-07-07 16:48:45 +08:00
f796411fa8 光环助手V4.0.2-视频上传与编辑功能优化(20200707测试补充 1,2,4)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-07-07 16:06:38 +08:00
d45f185f77 处理分享数据未上传问题 2020-07-07 15:03:54 +08:00
6564de8a72 整理安装/卸载相关代码,尽量做到统一处理 2020-07-07 14:57:06 +08:00
10028dfebc 视频浏览记录、视频收藏列表扩大用户信息点击区域 2020-07-07 14:41:00 +08:00
fa06795cef Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-06 16:55:45 +08:00
c1eb324d79 分享功能数据埋点 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/919 2020-07-06 16:55:39 +08:00
cdf9528583 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-06 15:10:26 +08:00
5f5a621bd1 光环助手V4.0.2-视频上传与编辑功能优化(20200703测试补充1,2,3,5,6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-07-06 15:10:10 +08:00
b8d54dfa59 更新依赖库 hash 2020-07-06 11:55:37 +08:00
b4f39d09e4 Merge branch 'intergrate-antibot-sdk' into 'dev'
集成反爬虫SDK

See merge request halo/assistant-android!18
2020-07-06 11:47:52 +08:00
d57ac57f43 尝试将Xapk安装部分接入到原有的下载体系 2020-07-03 17:09:50 +08:00
a3aea6259c 光环助手V4.0.2 RELEASE(20200629-2330)测试汇总20200703测试问题(1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/914 2020-07-03 15:31:32 +08:00
73e4c90956 恢复 chucker 2020-07-03 12:02:46 +08:00
c1432159f3 修复前台启动也会显示光环助手正在运行中的问题 2020-07-03 11:59:44 +08:00
45f47d98ba 补充部分遗漏的接口 2020-07-03 10:13:00 +08:00
2e9638b8c5 光环助手V4.0.2 RELEASE(20200629-2330)测试汇总(8,9) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/914 2020-07-03 09:42:25 +08:00
7ea30c1d0e 修改 keep 规则 2020-07-02 18:09:26 +08:00
034e04944a 调整API_HOST 2020-07-02 17:51:48 +08:00
99326596d5 接入阿里反爬虫 SDK https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/915 2020-07-02 17:39:51 +08:00
1cc2b85816 光环助手V4.0.2-开服日历表优化(20200702需求补充) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893 2020-07-02 17:12:37 +08:00
942291d7c5 确定xapk的命名和存放路径问题 2020-07-02 16:59:57 +08:00
f4cd9419a4 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-02 15:56:35 +08:00
a24b9d92c7 WebFragment页面支持js打开分享弹窗 2020-07-02 15:56:29 +08:00
8e7e83ad72 处理link跳转使用jumpActivity方式 2020-07-02 15:37:14 +08:00
cd810f0048 光环助手V4.0.2-游戏专题功能强化(前端)20200701优化补充(2,3,4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-07-02 14:52:25 +08:00
fa050039cd 暂时停用chucker 2020-07-02 11:09:07 +08:00
935fb1149f DsBridge 转为本地依赖,暂时停用chucker(jitpack连不上) 2020-07-02 11:03:34 +08:00
951817455a 修复游戏列表评分数值字体大小不一问题 2020-07-01 18:22:53 +08:00
de597bdd36 初步完成Xapk解压部分 2020-07-01 16:06:03 +08:00
e71e7f6163 处理系统消息link不显示 2020-07-01 10:07:21 +08:00
09be5e157d 修复去掉游戏详情富文本正文换行符时会切掉最后一个字符的问题 2020-06-30 17:33:59 +08:00
1f5e59fc1d 处理系统推送列表link显示 2020-06-30 17:14:10 +08:00
e58861afa4 处理系统推送title为空问题 2020-06-30 16:47:36 +08:00
44e51ecb0a 补充一些代码注释 2020-06-30 15:10:59 +08:00
794c17a1bb 恢复误删的带 chucker 测试环境编译代码 2020-06-30 15:08:49 +08:00
1b287962f0 完成将镜像游戏隐藏的自定义栏目放置于详细信息之后的功能 2020-06-30 15:07:53 +08:00
8bdf98b9d8 修改游戏专题大图link跳转问题 2020-06-30 14:27:55 +08:00
e1aeb61c9b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-30 10:56:28 +08:00
a39a70ac2d 修复游戏列表和游戏详情评分数值不一致的问题 2020-06-30 10:56:22 +08:00
4fdcaaf591 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-30 00:07:04 +08:00
b4502638ff 修改光环助手V4.0.2-链接跳转做成通用模块bug 2020-06-30 00:07:00 +08:00
05502d56b1 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-29 22:54:31 +08:00
90e1e8a40f 修复游戏列表和游戏详情评分数值不一致的问题 2020-06-29 22:54:26 +08:00
b10293da50 镜像游戏去掉大家都在玩 2020-06-29 22:50:43 +08:00
83cf0687e6 修复一些闪退问题 2020-06-29 22:32:15 +08:00
f56b03716a 我的光环进入游戏投稿前请求权限 2020-06-29 21:45:41 +08:00
61a41e6039 修复游戏详情游戏简介的显示异常 2020-06-29 21:02:03 +08:00
20ae9fe0ec 补充镜像游戏的镜像下载选项 2020-06-29 20:51:36 +08:00
74fdec9d72 UI优化 2020-06-29 19:31:51 +08:00
3437265cc1 Merge branches 'dev' and 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt
2020-06-29 19:08:36 +08:00
271993a876 光环助手V4.0.2-链接跳转做成通用模块0629测试1(2),2(1),5(3),9(2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/879 2020-06-29 19:06:28 +08:00
3a8b7bb920 视频上传时把是否勾选"视频上传服务准则"的判断放到最后 2020-06-29 17:52:37 +08:00
fd85f3889d 修复镜像游戏的预约状态问题 2020-06-29 17:05:01 +08:00
556ecea749 修复游戏详情游戏简介的换行问题 2020-06-29 17:04:33 +08:00
8a97844676 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-29 16:58:06 +08:00
f152296e7a 游戏列表评分数值与游戏详情统一 2020-06-29 16:57:59 +08:00
4ccc789c7c Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-29 16:09:55 +08:00
747b02eb7a 处理视频流内存泄漏问题 2020-06-29 16:09:50 +08:00
a73c033c03 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-29 15:57:59 +08:00
939db8c820 光环助手V4.0.2-游戏专题功能强化(前端)(20200629UI测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-06-29 15:57:54 +08:00
8601440d97 修复接口环境标识文字造成的显示问题 2020-06-29 15:12:48 +08:00
7a1fa90175 测试包右上角添加接口环境标识文字 2020-06-29 12:36:41 +08:00
46722ba69d 测试包右上角添加接口环境标识文字 2020-06-29 12:03:37 +08:00
70d9d461bf 更换web编辑器图标 2020-06-29 11:03:52 +08:00
91944df6a4 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-29 10:59:40 +08:00
ef86c1158c 尝试修复Tab专题页面Fragment回收后无法重建的问题 2020-06-29 10:59:36 +08:00
0f3b6ed34b 镜像游戏去掉镜像标签中的特殊标签 2020-06-29 10:26:52 +08:00
8b50620ddc SpanBuilder的image方法使用application,避免出现内存泄漏 2020-06-29 10:12:39 +08:00
8b2a9eb6ca 我的收藏ui优化 2020-06-29 09:54:27 +08:00
7297f5480e 修改意见反馈文案 2020-06-28 19:58:41 +08:00
3bee8cc034 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-28 18:56:12 +08:00
584a16e111 上传视频流浏览记录 2020-06-28 18:55:25 +08:00
6460c7f8d6 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-28 18:24:15 +08:00
feb99c9f78 光环助手V4.0.2-开服日历表优化(20200628UI测试) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893 2020-06-28 18:24:09 +08:00
68ac809bcb 恢复误删的华为离线推送配置 2020-06-28 17:58:35 +08:00
de207f66d9 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-28 17:53:09 +08:00
054fcd2049 修正横向专题第一行文案标红规则 2020-06-28 17:52:45 +08:00
497fc998fe 修复通知栏推送的跳转问题 2020-06-28 17:16:56 +08:00
03f76453ab 更正错误的游戏镜像判断规则 2020-06-28 15:57:55 +08:00
0a87bd354a 修复首次启动时根据 gid 获取已下载的游戏列表失败的问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/880 2020-06-28 15:13:36 +08:00
1baceaef15 光环助手V4.0.2-多版本下载面板:合集插件化提示 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/907 2020-06-28 10:50:28 +08:00
9719a7fa28 微调视频上传页面UI 2020-06-28 09:39:41 +08:00
1718a66126 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-24 18:21:38 +08:00
b317ef3a39 fix bug 2020-06-24 18:21:29 +08:00
8b0cd69ae6 DownloadService 的前台通知增加 channelId 避免在部分国产 ROM 上显示不出来 2020-06-24 16:50:33 +08:00
c7126e9836 处理一些内存泄漏问题 2020-06-24 15:33:53 +08:00
f3d01335a4 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-24 15:07:01 +08:00
88e029b129 修复多平台下载面板-我的版本出现的未知类型 2020-06-24 15:06:54 +08:00
2bc72328c1 修复一些闪退异常 2020-06-24 14:45:44 +08:00
81179b1f72 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-24 11:54:59 +08:00
9a7d4997c2 修改更新弹窗文案 2020-06-24 11:54:53 +08:00
3b6ac881c2 正式环境api地址更新至4.0.2 2020-06-24 11:33:14 +08:00
6b5fb7d8bc Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-24 10:47:42 +08:00
1551b0a358 测试环境App更新为了方便测试写死下载链接(测试环境的包链接是不可用的) 2020-06-24 10:47:35 +08:00
6540af8386 适配居中显示文字的渐隐文字颜色 2020-06-24 10:29:24 +08:00
9badcdc382 插件意见反馈跳转协议新增参数 2020-06-24 10:05:14 +08:00
0ba94fa56f 插件意见反馈跳转协议新增参数 2020-06-24 09:51:46 +08:00
52c1343ade 光环助手V4.0.2-视频上传与编辑功能优化(20200623测试1,4) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-06-23 21:14:00 +08:00
7a0e633b79 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-23 20:53:46 +08:00
9b68b05d7d 光环助手V4.0.2-更新推送功能优化(20200619补充)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/882 2020-06-23 20:53:41 +08:00
9e7f6b0854 处理一些内存泄漏问题 2020-06-23 20:34:47 +08:00
cf20ad6fc2 修复曝光类型下载上报类型错误问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/884 2020-06-23 19:42:56 +08:00
cb7bdba338 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-23 18:13:58 +08:00
f1fc06ca84 游戏上传接口更改 2020-06-23 18:13:52 +08:00
18f9fe7fcf 游戏详情自定义栏目渐隐文字支持颜色继承 2020-06-23 17:51:28 +08:00
18816a8a4e Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-23 17:15:24 +08:00
8d379501cb 光环助手V4.0.2-游戏上传功能优化20200623测试1,2,4 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/903 2020-06-23 17:15:18 +08:00
8f4c6abfd3 游戏详情自定义栏目富文本正文兼容低版本安卓系统 2020-06-23 16:44:28 +08:00
a24d0a9618 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-23 14:44:24 +08:00
8cdd66cd89 光环前端优化汇总(2020年6月第2周)0622测试:7(2) 9/10(1) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/895 2020-06-23 14:44:17 +08:00
3fd34576e8 更改游戏详情的自定义栏目富文本正文的展开实现 2020-06-23 11:58:27 +08:00
78d5cbcc42 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-23 10:43:40 +08:00
803f2bef75 修改新增开服的默认时间选择规则->开服表的选择时间(yyyy-MM-dd)+当前时间(HH:mm) 2020-06-23 10:43:33 +08:00
40c7e8f9e6 处理一些内存泄漏问题 2020-06-23 10:31:35 +08:00
b3c5ca6112 光环助手V4.0.2-意见反馈增加 版权申诉20200622测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/904 2020-06-22 18:22:20 +08:00
31067ea66d 光环助手V4.0.2-意见反馈增加 版权申诉 20200622UI测试 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/904 2020-06-22 18:05:31 +08:00
4e7626ff41 游戏上传UI优化 2020-06-22 17:50:58 +08:00
e62822505e urlscheme增加游戏上传 2020-06-22 17:02:28 +08:00
cbc705d1eb Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-22 16:05:40 +08:00
aa2e147a51 光环助手V4.0.2-游戏上传功能优化(20200622测试 1-5,7-9,15) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/903 2020-06-22 16:05:34 +08:00
6249726839 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-22 16:05:04 +08:00
8f4bc5a164 修复游戏专题在部分情况游戏摘要无法控制的问题 2020-06-22 16:04:53 +08:00
eee459d08a 修复自定义栏目富文本正文的收起异常 2020-06-22 15:55:09 +08:00
81b4e40dbf Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-22 11:51:26 +08:00
261068e286 处理视频数据统计异常问题 2020-06-22 11:51:21 +08:00
84364a7c66 修复模拟器上游戏详情自定义栏目圆形头像导致闪退的问题 2020-06-22 10:52:58 +08:00
3beb47a8be 避免周期性任务在其它进程触发 2020-06-22 10:11:28 +08:00
ca76af4474 避免周期性任务在其它进程触发 2020-06-22 09:55:43 +08:00
bc33673533 完成MTA的AppKey替换和不需要事件的移除 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/910 2020-06-22 09:54:28 +08:00
c5d038a173 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-19 17:57:50 +08:00
b1e492df1b 修复APP更新弹窗点击弹窗边缘无法取消弹窗问题 2020-06-19 17:57:42 +08:00
9d9c213af7 修复插件化更新曝光事件没有附上版本号的问题 2020-06-19 17:25:46 +08:00
d3f97ea527 更新 leakCanary 2020-06-19 17:24:58 +08:00
0a5fb4cb1d Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-19 17:03:19 +08:00
6905f7191a 修复一些闪退问题 2020-06-19 17:03:11 +08:00
bad7fb4922 游戏详情自定义栏目正文里的用户头像裁成圆形 2020-06-19 16:41:38 +08:00
250fa7eb7b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-19 16:22:03 +08:00
f0cd8567cb 1.增加视频流浏览记录表用于日志上传 2.视频流增加计时器 2020-06-19 16:21:58 +08:00
f6dd35e4b8 回答、文章web编辑器字数监听 2020-06-19 15:02:18 +08:00
2dc299e7f4 游戏投稿包名去掉后缀apk 2020-06-19 11:01:13 +08:00
366e8ded14 完成"下载数据统计需求"的0618测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/884 2020-06-19 09:35:32 +08:00
8175742143 完成"下载数据统计需求"的0618测试问题 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/884 2020-06-18 18:20:52 +08:00
fc858f1272 删除无用的多版本图片 2020-06-18 18:20:18 +08:00
84b668714b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-18 17:53:58 +08:00
5ea5346ee8 修改我的光环小红点规则 2020-06-18 17:53:53 +08:00
c2eb0b267c 完成"首页插件化提示区域优化"的红点优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/898 2020-06-18 17:32:17 +08:00
7fb502e87e Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-18 17:27:24 +08:00
98726ddc3a 修改我的光环小红点规则 2020-06-18 17:27:20 +08:00
75ff76acf4 评论详情间距优化 2020-06-18 17:13:14 +08:00
ba552812a3 游戏详情自定义栏目正文内容支持用户头像 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/891 2020-06-18 14:53:29 +08:00
83bfeb0abc 修复一些闪退问题 2020-06-18 14:31:26 +08:00
70f1b7a678 游戏开服的新增取最后一条开服数据作为模板 2020-06-18 11:07:33 +08:00
455d53fee0 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-18 10:55:16 +08:00
39e4b5bf55 20200616测试问题:1 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893 2020-06-18 10:55:00 +08:00
40a729b6f8 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-18 10:40:26 +08:00
9643176e06 光环助手V4.0.2-意见反馈增加 版权申诉 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/904 2020-06-18 10:40:21 +08:00
1a70c33bef Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-18 10:25:45 +08:00
888ebe5f54 光环助手V4.0.2-多版本下载面板:合集插件化提示 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/907 2020-06-18 10:25:39 +08:00
cb02dbae57 游戏分地区配置添加网络状态切换重试 2020-06-18 09:43:51 +08:00
2683d02dcd Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-17 18:32:38 +08:00
ceb924e8f1 微调UI 2020-06-17 18:32:19 +08:00
bd91609a80 补充数据库升级配置 2020-06-17 18:31:39 +08:00
2fd74a4698 Merge remote-tracking branch 'origin/dev' into dev 2020-06-17 18:21:07 +08:00
e9e0d3b43e 基本完成游戏分地区管理供嗯 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/900 2020-06-17 18:20:59 +08:00
17e09ddad3 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-17 18:18:00 +08:00
65427c55d6 修改游戏投稿 2020-06-17 18:17:55 +08:00
e1fc23a1bb tinker_base-4.0.1_bugfix 2020-06-17 17:51:22 +08:00
2d551a3f73 VersionCode 改为171 2020-06-17 17:42:37 +08:00
7f99f75c6f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-17 17:39:10 +08:00
548aea8d13 光环助手V4.0.2-首页插件化提示区域优化(除4.4外,其它完成) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/898 2020-06-17 17:39:05 +08:00
a177137744 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-17 16:50:52 +08:00
3c6443d78f 版权申诉UI 2020-06-17 16:50:47 +08:00
ba81ed9cb0 完成游戏镜像功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/899 2020-06-17 15:19:48 +08:00
6a1cbd10c6 光环助手V4.0.2-游戏上传功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/903 2020-06-17 11:25:40 +08:00
9b205366f7 1.修改视频流广告gif不播放 2.添加网页跳转支付宝微信支付 2020-06-16 18:29:20 +08:00
7e9ac0c4f1 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-16 17:26:10 +08:00
fe889639b3 游戏投稿(未完) 2020-06-16 17:26:05 +08:00
848e43af28 首页相关接口增加channel参数 2020-06-16 14:18:49 +08:00
c7a3893fae 修复虚拟按键遮挡启动图的问题 2020-06-16 11:51:51 +08:00
f7d633188c 光环助手V4.0.2-更新推送功能优化(3)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/882 2020-06-16 10:59:11 +08:00
e1e7d2d3d6 修复版块轮播图的曝光统计缺失问题 2020-06-15 18:18:43 +08:00
2b8a280768 移除无用代码 2020-06-15 18:18:08 +08:00
6efe96eb0d 微调UI 2020-06-15 18:06:33 +08:00
3562fe9273 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-15 16:29:04 +08:00
739ef44a8b 光环助手V4.0.2-开服日历表优化(1)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893 2020-06-15 16:27:51 +08:00
879b42dbf2 修复游戏详情自定义栏目正文描述的显示问题 2020-06-15 15:02:43 +08:00
fae626bb98 移除下载限速相关的无用代码 2020-06-15 15:01:47 +08:00
cebd639d78 处理视频流全屏播放时点击返回键关闭页面问题 2020-06-15 11:32:35 +08:00
17a99a1cda 微调专题过滤选项UI 2020-06-15 10:50:02 +08:00
2a03683e1e 修改游戏专题平铺样式UI 2020-06-15 10:34:00 +08:00
a579b3fe10 修复游戏详情闪退问题 2020-06-15 09:33:51 +08:00
9c75dd18df Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-12 18:30:12 +08:00
cdc9c86852 光环助手V4.0.2-游戏专题功能强化(前端)(7) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885
修改专题详情游戏列表UI
修改多行类型专题控制选项UI(包换标签详情和分类详情)
2020-06-12 18:30:04 +08:00
fab1851436 完成自定义栏目优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/891 2020-06-12 11:54:04 +08:00
a6704e46a9 微调游戏列表UI 2020-06-12 11:49:19 +08:00
e188f70eb6 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-12 10:54:24 +08:00
02dd115886 移除游戏列表礼包图标相关代码
修复开服表闪退问题
2020-06-12 10:54:19 +08:00
5cbfc7b461 游戏评论、撰写问答、撰写文章toast居中显示 2020-06-12 10:43:48 +08:00
b4742b5645 更换富文本编辑器图标 2020-06-12 09:36:22 +08:00
5ec25475ea Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-11 18:34:20 +08:00
c58040ef83 光环助手V4.0.2-游戏专题功能强化(前端)(1,2,3,4,5,6) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-06-11 18:34:10 +08:00
75701b6875 游戏详情自定义栏目支持富文本 2020-06-11 18:29:44 +08:00
2155a33689 处理个人主页文章关闭评论显示问题 2020-06-11 15:21:05 +08:00
68a9d5d771 微调UI 2020-06-11 11:51:35 +08:00
ebf6107faf Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-10 18:19:43 +08:00
e4bc36a743 光环前端优化汇总(2020年6月第2周)2-6,8,13 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/895 2020-06-10 18:19:37 +08:00
7a64251811 Merge branch 'update_push_sdk' into 'dev'
Update push sdk

See merge request halo/assistant-android!17
2020-06-10 18:13:12 +08:00
65409d75a7 统一测试环境和正式环境的推送配置 2020-06-10 18:08:49 +08:00
d40081d58b Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-10 16:34:46 +08:00
f276e981ed 光环助手V4.0.2-游戏专题功能强化(前端)(11)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-06-10 16:34:42 +08:00
e50db66b47 光环助手V4.0.2-游戏评论功能优化4,5 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/892 2020-06-10 15:06:16 +08:00
fc84022852 微调UI 2020-06-10 11:43:21 +08:00
b593f2f3ea 微调UI 2020-06-09 18:21:29 +08:00
e782d0542c Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-09 17:59:28 +08:00
1a085cad98 光环助手V4.0.2-开服日历表优化2(3) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893
修复开服备注字数过多产生的UI显示异常问题
2020-06-09 17:59:22 +08:00
1c33a0c4c5 去掉评论数为0时,点击评论内容卡片自动弹出键盘的功能 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/892 2020-06-09 17:36:36 +08:00
3c4a7961c2 处理EllipsizeTextView省略号不显示问题 2020-06-09 16:37:48 +08:00
712f9b84cf 简单升级推送SDK,离线推送还有很多问题 2020-06-09 16:08:19 +08:00
2efb7b76cc Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-06-09 15:45:25 +08:00
5c4d93ce15 光环助手V4.0.2-视频上传与编辑功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/887 2020-06-09 15:45:16 +08:00
7addd92058 处理滑动视频流播放问题 2020-06-09 14:40:12 +08:00
82c5898b9a 光环助手V4.0.2-链接跳转做成通用模块 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/879 2020-06-09 11:40:12 +08:00
cced6b7035 光环助手V4.0.2-开服日历表优化(2(1),2(2))https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/893 2020-06-08 16:47:38 +08:00
ae0b5b3738 Merge branch 'dev_4.0.2' into 'dev'
Merge 4.0.2 feature changes

See merge request halo/assistant-android!16
2020-06-08 15:37:08 +08:00
6fdf9cbe5d Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-08 15:36:00 +08:00
009244c65d 游戏评论字数限制 2020-06-08 15:35:54 +08:00
73a720bb9c Merge branch 'dev_4.0.2' of gitlab.ghzhushou.com:halo/assistant-android into dev_4.0.2 2020-06-08 15:31:19 +08:00
fd9df9904f 完成首页游戏替换功能(第三期) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/880 2020-06-08 15:30:52 +08:00
e75fb3a40d 视频合集、浏览记录、我的收藏视频点击用户头像昵称跳转个人主页 2020-06-08 11:36:33 +08:00
0bef1a2aa8 视频合集、个人主页、浏览记录、我的收藏视频UI优化 2020-06-08 11:01:03 +08:00
395eb641e5 移除首页无用的下载监听 2020-06-05 16:21:32 +08:00
9019242ffb Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-05 15:10:49 +08:00
9433bb72ca 光环助手V4.0.2-游戏专题功能强化(后台)(8) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/886 2020-06-05 15:10:13 +08:00
500f751152 完成光环助手V4.0.2-下载数据统计需求 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/884 2020-06-05 15:03:01 +08:00
9ebe3f4a0e 处理关闭视频流页面上传播放数据progress为0的问题 2020-06-05 10:32:51 +08:00
8c92fc9a42 Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-04 17:40:11 +08:00
2a7cb34218 新增urlscheme跳转链接 2020-06-04 17:40:07 +08:00
e1a42b49c1 光环助手V4.0.2-更新推送功能优化(2) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/882 2020-06-04 17:24:07 +08:00
5a825debf5 Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-04 15:49:33 +08:00
e46b0a42b0 修复专题下载进度串行问题(10)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-06-04 15:49:25 +08:00
eb0c442a5e Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-04 10:58:29 +08:00
eb6460236b 视频UI封面图比例改为16:9 2020-06-04 10:58:24 +08:00
ef051daffd 历史记录数据库表新增字段 2020-06-04 10:55:50 +08:00
b6acb302d2 Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-04 10:54:36 +08:00
5cfc5a3971 光环助手V4.0.2-游戏专题功能强化(前端)(8,9)https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/885 2020-06-04 10:54:28 +08:00
04de97af16 升级版本至4.0.2 2020-06-04 10:32:03 +08:00
6367f90589 Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-03 17:33:32 +08:00
bc8f9d07bb 页面回收重建,根据tag找回fragment避免每次都重新创建 2020-06-03 17:33:27 +08:00
e205abd120 Merge branch 'dev_4.0.2' of gitlab.ghzs.com:halo/assistant-android into dev_4.0.2 2020-06-03 17:22:56 +08:00
5da8fccef7 尝试修复首页-问答模块不能左右滑动的问题 2020-06-03 17:22:38 +08:00
c7e78142ee okhttp版本更新至3.12.12 2020-06-03 16:42:21 +08:00
354c7d1f85 光环助手V4.0.2-游戏关注功能优化 https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/851 2020-06-03 14:49:33 +08:00
1599 changed files with 60361 additions and 16404 deletions

View File

@ -6,7 +6,9 @@ apply plugin: 'kotlin-kapt'
// apkChannelPackage
apply plugin: 'channel'
apply from: 'tinker-support.gradle'
import groovy.xml.XmlUtil
//apply from: 'tinker-support.gradle'
android {
@ -18,6 +20,10 @@ android {
enabled = true
}
viewBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
@ -42,9 +48,12 @@ android {
}
ndk {
abiFilters "armeabi-v7a", "x86"
abiFilters "armeabi-v7a"
}
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
// 由于app只针对中文用户所以仅保留zh资源其他删掉
resConfigs "zh"
@ -67,6 +76,15 @@ android {
buildConfigField "String", "TD_APPID", "\"${TD_APPID}\""
buildConfigField "String", "LETO_APPID", "\"${LETO_APPID}\""
buildConfigField "String", "TTAD_APPID", "\"${TTAD_APPID}\""
buildConfigField "String", "DOUYIN_CLIENTKEY", "\"${DOUYIN_CLIENTKEY}\""
buildConfigField "String", "DOUYIN_CLIENTSECRET", "\"${DOUYIN_CLIENTSECRET}\""
buildConfigField "String", "MIPUSH_APPID", "\"${MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${MIPUSH_APPKEY}\""
buildConfigField "String", "MEIZUPUSH_APPID", "\"${MEIZUPUSH_APPID}\""
buildConfigField "String", "MEIZUPUSH_APPKEY", "\"${MEIZUPUSH_APPKEY}\""
resValue "string", "huawei_push_appid", "appid=${HUAWEI_PUSH_APPID}"
/**
* Build Time 供区分 jenkins 打包时间用
@ -95,7 +113,7 @@ android {
signingConfig signingConfigs.debug
buildConfigField "String", "EXPOSURE_REPO", "\"test\""
buildConfigField "String", "EXPOSURE_VERSION", "\"E3\""
buildConfigField "String", "EXPOSURE_VERSION", "\"E4\""
multiDexKeepProguard file("tinker_multidexkeep.pro")
}
@ -107,47 +125,77 @@ android {
signingConfig signingConfigs.release
buildConfigField "String", "EXPOSURE_REPO", "\"exposure\""
buildConfigField "String", "EXPOSURE_VERSION", "\"E3\""
buildConfigField "String", "EXPOSURE_VERSION", "\"E4\""
multiDexKeepProguard file("tinker_multidexkeep.pro")
}
}
flavorDimensions "nonsense"
flavorDimensions("env")
sourceSets {
publish {
java.srcDirs = ['src/main/java']
}
internal {
java.srcDirs = ['src/main/java']
}
tea {
java.srcDirs = ['src/main/java', 'src/tea/java']
}
gdt {
java.srcDirs = ['src/main/java', 'src/gdt/java']
}
}
/**
* 多渠道打包,渠道请参考"channel.txt"文件所有渠道值均通过java code设置
*/
productFlavors {
// publish release host
publish {
dimension "nonsense"
dimension "env"
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
buildConfigField "String", "SENSITIVE_API_HOST", "\"${SENSITIVE_API_HOST}\""
buildConfigField "String", "UMENG_APPKEY", "\"${UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "MIPUSH_APPID", "\"${MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${MIPUSH_APPKEY}\""
buildConfigField "String", "MEIZUPUSH_APPID", "\"${MEIZUPUSH_APPID}\""
buildConfigField "String", "MEIZUPUSH_APPKEY", "\"${MEIZUPUSH_APPKEY}\""
buildConfigField "String", "BUGLY_APPID", "\"${BUGLY_APPID}\""
}
// internal test dev host
internal {
dimension "nonsense"
dimension "env"
versionNameSuffix "-debug"
buildConfigField "String", "API_HOST", "\"${DEV_API_HOST}\""
buildConfigField "String", "UMENG_APPKEY", "\"${DEBUG_UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${DEBUG_UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "MIPUSH_APPID", "\"${DEBUG_MIPUSH_APPID}\""
buildConfigField "String", "MIPUSH_APPKEY", "\"${DEBUG_MIPUSH_APPKEY}\""
buildConfigField "String", "MEIZUPUSH_APPID", "\"${DEBUG_MEIZUPUSH_APPID}\""
buildConfigField "String", "MEIZUPUSH_APPKEY", "\"${DEBUG_MEIZUPUSH_APPKEY}\""
buildConfigField "String", "SENSITIVE_API_HOST", "\"${DEV_API_HOST}\""
buildConfigField "String", "BUGLY_APPID", "\"${DEBUG_BUGLY_APPID}\""
buildConfigField "String", "UMENG_APPKEY", "\"${DEV_UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${DEV_UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "BUGLY_APPID", "\"${DEV_BUGLY_APPID}\""
}
tea {
dimension "env"
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
buildConfigField "String", "SENSITIVE_API_HOST", "\"${SENSITIVE_API_HOST}\""
buildConfigField "String", "UMENG_APPKEY", "\"${UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "BUGLY_APPID", "\"${BUGLY_APPID}\""
}
gdt {
dimension "env"
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
buildConfigField "String", "SENSITIVE_API_HOST", "\"${SENSITIVE_API_HOST}\""
buildConfigField "String", "UMENG_APPKEY", "\"${UMENG_APPKEY}\""
buildConfigField "String", "UMENG_MESSAGE_SECRET", "\"${UMENG_MESSAGE_SECRET}\""
buildConfigField "String", "BUGLY_APPID", "\"${BUGLY_APPID}\""
}
}
}
@ -171,13 +219,14 @@ rebuildChannel {
repositories {
flatDir {
dirs 'libs','libs/aars'
dirs 'libs', 'libs/aars'
}
}
dependencies {
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
gdtImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/gdt/libs')
testImplementation 'junit:junit:4.12'
@ -186,6 +235,7 @@ dependencies {
debugImplementation "com.facebook.stetho:stetho-okhttp3:${stetho}"
debugImplementation "com.squareup.okhttp3:logging-interceptor:${okHttp}"
debugImplementation "com.gu.android:toolargetool:${toolargetool}"
debugImplementation "com.github.nichbar:WhatTheStack:$whatTheStack"
implementation "androidx.core:core:${core}"
implementation "androidx.fragment:fragment:${fragment}"
@ -242,7 +292,7 @@ dependencies {
implementation "com.sina.weibo.sdk:core:${weiboSDK}"
// bugly with tinker support
implementation "com.tencent.bugly:crashreport_upgrade:${buglyTinkerSupport}"
// implementation "com.tencent.bugly:crashreport_upgrade:${buglyTinkerSupport}"
implementation "com.google.android:flexbox:${flexbox}"
@ -263,13 +313,12 @@ dependencies {
implementation "com.squareup.picasso:picasso:${picasso}"
// for video streaming
implementation ("com.shuyu:gsyVideoPlayer-java:$gsyVideo",{
implementation("com.shuyu:gsyVideoPlayer-java:$gsyVideo", {
exclude module: "gsyvideoplayer-androidvideocache"
exclude group: "tv.danmaku.ijk.media"
})
implementation "com.shuyu:GSYVideoPlayer-exo2:$gsyVideo"
implementation "com.github.wendux:DSBridge-Android:$dsBridge"
implementation "android.arch.work:work-runtime:${workManager}"
implementation "com.llew.huawei:verifier:${verifier}"
@ -283,25 +332,33 @@ dependencies {
debugImplementation "com.github.nichbar.chucker:library:$chucker"
releaseImplementation "com.github.nichbar.chucker:library-no-op:$chucker"
implementation "com.bytedance.applog:RangersAppLog-Lite-cn:$bytedanceApplog"
teaImplementation "com.bytedance.applog:RangersAppLog-Lite-cn:$bytedanceApplog"
// implementation "com.bytedance.ies.ugc.aweme:opensdk-china-external:$bytedanceAweme"
// implementation "com.bytedance.ies.ugc.aweme:opensdk-common:$bytedanceAweme"
implementation "com.aliyun.dpa:oss-android-sdk:${oss}"
implementation "com.airbnb.android:lottie:$lottie"
implementation "net.lingala.zip4j:zip4j:${zip4j}"
implementation "io.sentry:sentry-android:$sentry"
implementation("com.github.piasy:BigImageViewer:$bigImageViewer", {
exclude group: 'com.squareup.okhttp3'
exclude group: 'androidx.swiperefreshlayout'
exclude group: 'com.github.bumptech.glide'
})
implementation "com.github.PhilJay:MPAndroidChart:${chart}"
implementation project(':libraries:LGLibrary')
implementation project(':libraries:MTA')
// implementation project(':libraries:MTA')
implementation project(':libraries:QQShare')
implementation project(':libraries:TalkingData')
implementation project(':libraries:UmengPush')
// implementation project(':libraries:TalkingData')
// implementation project(':libraries:UmengPush')
// implementation project(':libraries:WechatShare')
implementation project(':libraries:im')
// implementation project(':libraries:im')
implementation project(':libraries:Matisse')
implementation project(path: ':libraries:gsyVideoPlayer-proxy_cache')
}
File propFile = file('sign.properties')
if (propFile.exists()) {
@ -332,7 +389,7 @@ if (propFile.exists()) {
android.buildTypes.release.signingConfig = null
}
// 用于测试读取 META-INF 里的 JSON 的代码
// 用于测试读取 META-INF 里的文件
//task generateMetaJson {
// def resDir = new File(buildDir, 'generated/FILES_FOR_META_INF/')
// def destDir = new File(resDir, 'META-INF/')
@ -359,3 +416,78 @@ if (propFile.exists()) {
// task.name.startsWith('merge') && task.name.endsWith('Resources')
// }.each { t -> t.dependsOn generateMetaJson }
//}
project.afterEvaluate {
def variants = null
try {
variants = android.applicationVariants
} catch (Throwable t) {
t.printStackTrace()
try {
variants = android.libraryVariants
} catch (Throwable tt) {
tt.printStackTrace()
}
}
if (variants != null) {
variants.all { variant ->
variant.outputs.each { output ->
def task = output.processManifestProvider.get()
if (task == null) {
return
}
/**
* 为 Manifest 的 Activity 的 configChanges 添加自己手动处理 configurationChanges 配置 [https://developer.android.com/guide/topics/resources/runtime-changes]
* AGP 4.1.0 从 ProcessManifest task 里拿 manifest 的 API 变更调整可以参考这里 [https://github.com/Tencent/tinker/pull/1476/commits/d71645729b13d545ca4ba6826f93fbf558751434]
* (搞半天还是不会抽离方法,有空再把 gradle 改成用 kotlin 实现吧)
*/
task.doLast {
def manifestFile = new File(multiApkManifestOutputDirectory.get().asFile, "AndroidManifest.xml")
if (manifestFile == null || !manifestFile.exists()) {
return
}
def parser = new XmlSlurper(false, true)
def manifest = parser.parse(manifestFile)
def app = manifest.'application'[0]
app.'activity'.each { act ->
String value = act.attributes()['android:configChanges']
if (value == null || value.isEmpty()) {
value = "keyboardHidden|orientation|screenSize|screenLayout|density|fontScale|locale"
act.attributes()['androidconfigChanges'] = value
} else {
String[] valueSplit = value.split("\\|")
if (!valueSplit.contains("keyboardHidden")) {
value += "|keyboardHidden"
}
if (!valueSplit.contains("orientation")) {
value += "|orientation"
}
if (!valueSplit.contains("screenSize")) {
value += "|screenSize"
}
if (!valueSplit.contains("screenLayout")) {
value += "|screenLayout"
}
if (!valueSplit.contains("density")) {
value += "|density"
}
if (!valueSplit.contains("fontScale")) {
value += "|fontScale"
}
if (!valueSplit.contains("locale")) {
value += "|locale"
}
act.attributes()['android:configChanges'] = value
}
}
def tmpManifest = XmlUtil.serialize(manifest).replaceAll("androidconfigChanges", "android:configChanges")
manifest = parser.parseText(tmpManifest)
manifestFile.setText(XmlUtil.serialize(manifest), "utf-8")
}
}
}
}
}

Binary file not shown.

Binary file not shown.

BIN
app/libs/gid-1.3.jar Normal file

Binary file not shown.

View File

@ -241,6 +241,13 @@
-dontwarn com.shuyu.gsyvideoplayer.utils.**
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**
-keep public class * extends android.view.View{
*** get*();
void set*(***);
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
#穿山甲
-keep class com.bytedance.sdk.openadsdk.** { *; }
@ -248,4 +255,17 @@
-keep class com.pgl.sys.ces.* {*;}
-keep class com.gyf.immersionbar.* {*;}
-dontwarn com.gyf.immersionbar.**
-dontwarn com.gyf.immersionbar.**
-keep class com.taobao.securityjni.**{*;}
-keep class com.taobao.wireless.security.**{*;}
-keep class com.ut.secbody.**{*;}
-keep class com.taobao.dp.**{*;}
-keep class com.alibaba.wireless.security.**{*;}
-keep class com.alibaba.sdk.android.**{*;}
-keep class com.ut.**{*;}
-keep class com.ta.**{*;}
-keep class com.gh.gamecenter.GdtHelper { *; }
-keep class com.gh.gamecenter.TeaHelper { *; }

View File

@ -4,7 +4,6 @@ import android.app.Application;
import com.facebook.stetho.Stetho;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.squareup.leakcanary.LeakCanary;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
@ -18,15 +17,6 @@ import okhttp3.logging.HttpLoggingInterceptor;
public class Injection {
public static boolean appInit(Application application) {
// init leakcanary
if (LeakCanary.isInAnalyzerProcess(application)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return false;
}
LeakCanary.install(application);
// init stetho
Stetho.initializeWithDefaults(application);

View File

@ -1,7 +1,9 @@
package com.gh.common.util
package com.gh.gamecenter
import android.app.Application
import android.text.TextUtils
import android.util.Log
import com.gh.common.util.ToastUtils
import com.lightgame.utils.Utils
import com.qq.gdt.action.GDTAction
import org.json.JSONObject
@ -22,15 +24,27 @@ object GdtHelper {
const val SCORE = "SCORE"
const val PLATFORM = "PLATFORM"
fun init(application: Application) {
GDTAction.init(application, "1110071928", "7fe03caa04ed382e9dce401312b1d0ae")
}
fun logAction(type: String) {
GDTAction.logAction(type)
Utils.log("GDT", type)
@JvmStatic
fun init(application: Application, channel: String) {
if (shouldUseGdtHelper()) {
if (channel == "GH_728") {
GDTAction.init(application, "1111012969", "9d3d9da5b0948a317c03d08f14d445dc")
} else if (channel == "GH_729") {
GDTAction.init(application, "1111013063", "f53dabf458a356b101d99fc4069eb7f1")
} else {
GDTAction.init(application, "1110680399", "f5ddaafbf520d7d7385499232a408d0a")
}
}
Utils.log("init GdtHelper")
}
// fun logAction(type: String) {
// if (shouldUseGdtHelper()) {
// GDTAction.logAction(type)
// Utils.log("GDT", type)
// }
// }
@JvmStatic
fun logAction(type: String, vararg kv: String?) {
try {
val actionParam = JSONObject()
@ -50,4 +64,12 @@ object GdtHelper {
}
}
// TODO 确认开启的渠道条件
private fun shouldUseGdtHelper(): Boolean {
return true
//
// val channel = HaloApp.getInstance().channel
// return !(TextUtils.isEmpty(channel) || channel.contains("GDT".toLowerCase(Locale.CHINA)))
}
}

Binary file not shown.

View File

@ -9,8 +9,6 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- 允许应用程序读取扩展存储器 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<!-- 允许挂载和反挂载文件系统可移动存储 -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<!-- 允许应用程序访问Wi-Fi网络状态信息 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- 允许应用程序获取网络信息状态 -->
@ -25,41 +23,33 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- 允许应用程序打开系统窗口,显示其他应用程序 -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- 修改系统设置的权限 -->
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<!-- 创建快捷方式的权限 -->
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<!-- bugly with tinker -->
<uses-permission android:name="android.permission.READ_LOGS" />
<!-- <uses-permission android:name="android.permission.READ_LOGS" />-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!--可选,穿山甲提供“获取地理位置权限”和“不给予地理位置权限,开发者传入地理位置参数”两种方式上报用户位置,两种方式均可不选,添加位置权限或参数将帮助投放定位广告-->
<!--请注意:无论通过何种方式提供给穿山甲用户地理位置,均需向用户声明地理位置权限将应用于穿山甲广告投放,穿山甲不强制获取地理位置信息-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
<!-- 如果有视频相关的广告且使用textureView播放请务必添加否则黑屏 -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-sdk tools:overrideLibrary="com.shuyu.gsyvideoplayer,
com.shuyu.gsyvideoplayer.lib,
com.haroldadmin.whatthestack,
com.shuyu.gsyvideoplayer.armv7a,
com.shuyu.gsyvideoplayer.x86,
com.shuyu.gsy.base,
com.google.android.exoplayer2,
tv.danmaku.ijk.media.exo2,
shuyu.com.androidvideocache,
pl.droidsonroids.gif,
com.ledong.lib.minigame,
com.ledong.lib.leto,
com.leto.game.base.glide4,
com.leto.game.ad.gdt,
com.leto.game.fcm,
com.leto.game.ad.toutiao" />
pl.droidsonroids.gif" />
<!-- 去掉 SDK 一些流氓权限 -->
<uses-permission
@ -75,15 +65,20 @@
<!--android:largeHeap = "true"-->
<application
android:name="com.halo.assistant.TinkerApp"
android:name="com.halo.assistant.HaloApp"
android:allowBackup="true"
android:icon="@mipmap/logo"
android:label="@string/app_name"
android:largeHeap="true"
android:resizeableActivity="true"
android:theme="@style/AppCompatTheme.APP"
tools:replace="android:allowBackup"
tools:targetApi="n">
<meta-data
android:name="io.sentry.auto-init"
android:value="false" />
<!--android:launchMode = "singleTask"-->
<activity
android:name="com.gh.gamecenter.SplashScreenActivity"
@ -112,7 +107,9 @@
android:screenOrientation="portrait" />
<!--android:theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen" 退出时屏幕抖动 -->
<activity android:name="com.gh.gamecenter.ViewImageActivity" />
<activity
android:name="com.gh.gamecenter.ImageViewerActivity"
android:theme="@style/Theme.Transparent" />
<activity
android:name="com.gh.gamecenter.SearchActivity"
@ -167,6 +164,10 @@
android:name="com.gh.gamecenter.WebActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.FullScreenWebActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.ShareCardPicActivity"
android:screenOrientation="portrait" />
@ -176,9 +177,9 @@
android:screenOrientation="portrait" />
<activity
android:theme="@style/TransparentStatusBarAndNavigationBar"
android:name="com.gh.gamecenter.MessageDetailActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:theme="@style/TransparentStatusBarAndNavigationBar" />
<activity
android:name="com.gh.gamecenter.LibaoActivity"
@ -206,10 +207,18 @@
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.CommentDetailActivity"
android:theme="@style/TransparentStatusBarAndNavigationBar"
android:name="com.gh.gamecenter.security.SecurityActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.security.BindPhoneActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.CommentDetailActivity"
android:screenOrientation="portrait"
android:theme="@style/TransparentStatusBarAndNavigationBar" />
<activity
android:name="com.gh.gamecenter.mygame.MyGameActivity"
android:screenOrientation="portrait" />
@ -388,6 +397,10 @@
android:name="com.gh.gamecenter.qa.article.detail.ArticleDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.qa.article.detail.comment.ArticleDetailCommentActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.qa.draft.CommunityDraftWrapperActivity"
android:screenOrientation="portrait" />
@ -418,9 +431,9 @@
android:screenOrientation="portrait" />
<activity
android:theme="@style/TransparentStatusBarAndNavigationBar"
android:name="com.gh.gamecenter.gamedetail.rating.RatingReplyActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:theme="@style/TransparentStatusBarAndNavigationBar" />
<activity
android:name="com.gh.gamecenter.history.HistoryActivity"
@ -448,7 +461,8 @@
<activity
android:name="com.gh.gamecenter.video.upload.view.UploadVideoActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<activity
android:name="com.gh.gamecenter.video.game.GameVideoActivity"
@ -513,12 +527,88 @@
<activity
android:name=".qa.answer.draft.AnswerDraftActivity"
android:screenOrientation="portrait" />
<!-- 使用小米/华为推送弹窗功能提高推送成功率-->
<activity
android:name="com.gh.gamecenter.PushProxyActivity"
android:exported="true"
android:theme="@android:style/Theme.Translucent" />
android:name=".gamedetail.rating.RatingFoldActivity"
android:screenOrientation="portrait" />
<activity
android:name=".video.data.VideoDataActivity"
android:screenOrientation="portrait" />
<activity
android:name=".video.poster.PosterEditActivity"
android:screenOrientation="portrait" />
<activity
android:name=".video.poster.PosterClipActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.select.ForumSelectActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.follow.ForumMyFollowActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.detail.ForumDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.moderator.ModeratorListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".video.label.VideoLabelActivity"
android:screenOrientation="portrait" />
<activity
android:name=".personalhome.border.AvatarBorderActivity"
android:screenOrientation="portrait" />
<activity
android:name=".personalhome.background.PersonalityBackgroundActivity"
android:screenOrientation="portrait" />
<activity
android:name=".personalhome.background.BackgroundPreviewActivity"
android:screenOrientation="portrait" />
<activity
android:name=".personalhome.background.BackgroundClipActivity"
android:screenOrientation="portrait"
android:theme="@style/TransparentStatusBarAndNavigationBar" />
<activity
android:name=".personalhome.excellentcomments.ExcellentCommentsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".simulatorgame.SimulatorGameActivity"
android:screenOrientation="portrait" />
<activity
android:name=".simulatorgame.SimulatorManagementActivity"
android:screenOrientation="portrait" />
<activity
android:name=".catalog.CatalogActivity"
android:screenOrientation="portrait" />
<activity
android:name=".catalog.NewCatalogListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.search.ForumOrUserSearchActivity"
android:screenOrientation="portrait" />
<!-- &lt;!&ndash; 使用小米/华为推送弹窗功能提高推送成功率&ndash;&gt;-->
<!-- <activity-->
<!-- android:name="com.gh.gamecenter.PushProxyActivity"-->
<!-- android:exported="true"-->
<!-- android:launchMode="singleTask"-->
<!-- android:theme="@android:style/Theme.Translucent" />-->
<activity
android:name="com.gh.gamecenter.SkipActivity"
@ -530,6 +620,14 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<data android:scheme="market" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<activity
@ -540,6 +638,12 @@
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->
<!-- android:launchMode="singleTask"-->
<!-- android:taskAffinity="${applicationId}"-->
<!-- android:exported="true" />-->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}"
@ -573,39 +677,45 @@
</intent-filter>
</receiver>
<receiver android:name="com.gh.gamecenter.receiver.UmengMessageReceiver">
<intent-filter>
<action android:name="com.gh.gamecenter.UMENG" />
</intent-filter>
</receiver>
<!-- <receiver android:name="com.gh.gamecenter.receiver.UmengMessageReceiver">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.gh.gamecenter.UMENG" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!--魅族push应用定义消息receiver声明 -->
<receiver android:name="com.gh.gamecenter.receiver.MeizuPushReceiver">
<intent-filter>
<!-- 接收push消息 -->
<action android:name="com.meizu.flyme.push.intent.MESSAGE" />
<!-- 接收register消息 -->
<action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" />
<!-- 接收unregister消息-->
<action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" />
<!-- 兼容低版本Flyme3推送服务配置 -->
<action android:name="com.meizu.c2dm.intent.REGISTRATION" />
<action android:name="com.meizu.c2dm.intent.RECEIVE" />
<!-- &lt;!&ndash;魅族push应用定义消息receiver声明 &ndash;&gt;-->
<!-- <receiver android:name="com.gh.gamecenter.receiver.UmengMeizuPushReceiver">-->
<!-- <intent-filter>-->
<!-- &lt;!&ndash; 接收push消息 &ndash;&gt;-->
<!-- <action android:name="com.meizu.flyme.push.intent.MESSAGE" />-->
<!-- &lt;!&ndash; 接收register消息 &ndash;&gt;-->
<!-- <action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" />-->
<!-- &lt;!&ndash; 接收unregister消息&ndash;&gt;-->
<!-- <action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" />-->
<!-- &lt;!&ndash; 兼容低版本Flyme3推送服务配置 &ndash;&gt;-->
<!-- <action android:name="com.meizu.c2dm.intent.REGISTRATION" />-->
<!-- <action android:name="com.meizu.c2dm.intent.RECEIVE" />-->
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<!-- <category android:name="${applicationId}" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<receiver
android:name="com.gh.common.im.ImReceiver"
android:enabled="true">
<intent-filter android:priority="2147483647">
<action android:name="com.gh.im" />
<action android:name="action_finish" />
</intent-filter>
</receiver>
<!-- <receiver-->
<!-- android:name="com.gh.common.im.ImReceiver"-->
<!-- android:enabled="true">-->
<!-- <intent-filter android:priority="2147483647">-->
<!-- <action android:name="com.gh.im" />-->
<!-- <action android:name="action_finish" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<service android:name="com.gh.base.GHUmengNotificationService" />
<!-- <meta-data-->
<!-- android:name="com.huawei.hms.client.appid"-->
<!-- android:value="@string/huawei_push_appid" />-->
<!-- <service-->
<!-- android:name="com.gh.base.GHUmengNotificationService"-->
<!-- android:permission="android.permission.BIND_JOB_SERVICE" />-->
<!--<service android:name = "com.gh.gamecenter.statistics.AppStaticService" />-->

View File

@ -1,40 +0,0 @@
emoji_kf_1.png,:smile:
emoji_kf_2.png,:smiley:
emoji_kf_3.png,:laughing:
emoji_kf_4.png,:blush:
emoji_kf_5.png,:heart_eyes:
emoji_kf_6.png,:smirk:
emoji_kf_7.png,:flushed:
emoji_kf_8.png,:kissing_heart:
emoji_kf_9.png,:grin:
emoji_kf_10.png,:wink:
emoji_kf_11.png,:stuck_out_tongue_winking_eye:
emoji_kf_12.png,:stuck_out_tongue_closed eyes:
emoji_kf_13.png,:worried:
emoji_kf_14.png,:sleeping:
emoji_kf_15.png,:expressionless:
emoji_kf_16.png,:sweat_smile:
emoji_kf_17.png,:joy:
emoji_kf_18.png,:cold_sweat:
emoji_kf_19.png,:sob:
emoji_kf_20.png,:angry:
emoji_kf_21.png,:mask:
emoji_kf_22.png,:scream:
emoji_kf_23.png,:sunglasses:
emoji_kf_24.png,:heart:
emoji_kf_25.png,:broken_heart:
emoji_kf_26.png,:star:
emoji_kf_27.png,:anger:
emoji_kf_28.png,:exclamation:
emoji_kf_29.png,:question:
emoji_kf_30.png,:zzz:
emoji_kf_31.png,:thumbsup:
emoji_kf_32.png,:thumbsdown:
emoji_kf_33.png,:ok_hand:
emoji_kf_34.png,:punch:
emoji_kf_35.png,:yeah:
emoji_kf_36.png,:clap:
emoji_kf_37.png,:muscle:
emoji_kf_38.png,:pray:
emoji_kf_39.png,:skull:
emoji_kf_40.png,:trollface:

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"v":"5.6.9","fr":30,"ip":0,"op":20,"w":66,"h":66,"nm":"bottom bar tab/论坛/选中/E","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"白-修正","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[33,33,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[100,100,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":4,"s":[80,80,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":9,"s":[110,110,100]},{"t":13,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":1,"y":0},"t":0,"s":[{"i":[[0,-0.66],[0,0],[1.38,0],[0,1.38],[0,0],[-0.66,0],[0,0]],"o":[[0,0],[0,1.38],[-1.38,0],[0,0],[0,-0.66],[0,0],[0.66,0]],"v":[[2.5,-1.3],[2.5,0],[0,2.5],[-2.5,0],[-2.5,-1.3],[-1.3,-2.5],[1.3,-2.5]],"c":true}]},{"i":{"x":0,"y":1},"o":{"x":0.333,"y":0},"t":4,"s":[{"i":[[0,-0.66],[0,0],[1.38,0],[0,1.38],[0,0],[-0.66,0],[0,0]],"o":[[0,0],[0,1.38],[-1.38,0],[0,0],[0,-0.66],[0,0],[0.66,0]],"v":[[2.5,-0.102],[2.5,0],[0,2.109],[-2.5,0],[-2.5,-0.102],[-1.3,-1.302],[1.3,-1.302]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":1,"y":0},"t":9,"s":[{"i":[[0,-0.66],[0,0],[1.38,0],[0,1.38],[0,0],[-0.66,0],[0,0]],"o":[[0,0],[0,1.38],[-1.38,0],[0,0],[0,-0.66],[0,0],[0.66,0]],"v":[[2.498,-1.845],[2.5,0],[0,2.734],[-2.5,0],[-2.502,-1.845],[-1.302,-3.045],[1.298,-3.045]],"c":true}]},{"t":13,"s":[{"i":[[0,-0.66],[0,0],[1.38,0],[0,1.38],[0,0],[-0.66,0],[0,0]],"o":[[0,0],[0,1.38],[-1.38,0],[0,0],[0,-0.66],[0,0],[0.66,0]],"v":[[2.5,-1.3],[2.5,0],[0,2.5],[-2.5,0],[-2.5,-1.3],[-1.3,-2.5],[1.3,-2.5]],"c":true}]}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":150,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"蓝","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[33,33.76,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-1.8,0.42],[-3.44,-0.79],[-0.09,-1.71],[0,0],[0,0],[1.98,-0.1],[0,0],[0,0],[0,0],[0.62,0.57],[0,0],[0,0],[0,0],[0,0],[0,0],[0.2,1.89],[0,0],[0,0],[0,0]],"o":[[3.44,-0.79],[1.74,0.41],[0,0],[0,0],[0,2],[0,0],[0,0],[0,0],[-0.69,0.52],[0,0],[0,0],[0,0],[0,0],[0,0],[-1.94,0],[0,0],[0,0],[0,0],[0,-1.8]],"v":[[-6.39,-8.971],[6.39,-8.971],[9.49,-5.471],[9.5,-5.271],[9.5,3.249],[5.95,6.989],[5.75,6.999],[3.25,6.999],[0.3,9.209],[-1.95,9.089],[-2.06,8.969],[-2.17,8.849],[-2.21,8.779],[-3.4,6.999],[-5.75,6.999],[-9.48,3.639],[-9.49,3.449],[-9.5,3.249],[-9.5,-5.271]],"c":true},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.266,0.638,1,0.5,0.242,0.595,1,1,0.217,0.552,1],"ix":9}},"s":{"a":0,"k":[-9.5,-9.561],"ix":5},"e":{"a":0,"k":[9.5,9.561],"ix":6},"t":1,"nm":"color","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"路径","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":150,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"预合成 1","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[33,33,0],"ix":2},"a":{"a":0,"k":[33,33,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":4,"s":[70,70,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":9,"s":[110,110,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":13,"s":[90,90,100]},{"t":16,"s":[100,100,100]}],"ix":6}},"ao":0,"w":66,"h":66,"ip":0,"op":20,"st":0,"bm":0}],"markers":[]}

View File

@ -1,5 +0,0 @@
# This is a simple Microlog configuration file
microlog.level=DEBUG
microlog.appender=LogCatAppender;FileAppender
microlog.formatter=PatternFormatter
microlog.formatter.PatternFormatter.pattern=%c [%P] %m %T

View File

@ -0,0 +1,132 @@
[
{
"login": {
"title": "开启消息通知",
"content": "新游上线、互动回复,重要推送不错过",
"image": "bg_notification_login_style_1",
"styleNo": "样式A",
"scenes": "场景1"
},
"question": {
"title": "开启消息通知",
"content": "及时查看大神回答",
"image": "bg_notification_question_style_1",
"styleNo": "样式A",
"scenes": "场景2"
},
"answer": {
"title": "开启消息通知",
"content": "及时查看点赞与评论",
"image": "bg_notification_answer_style_1",
"styleNo": "样式A",
"scenes": "场景3"
},
"article": {
"title": "开启消息通知",
"content": "及时查看点赞与评论",
"image": "bg_notification_article_style_1",
"styleNo": "样式A",
"scenes": "场景4"
},
"video": {
"title": "开启消息通知",
"content": "实时获取审核与推荐进度",
"image": "bg_notification_video_style_1",
"styleNo": "样式A",
"scenes": "场景5"
},
"rating": {
"title": "开启消息通知",
"content": "成功上墙立即知道",
"image": "bg_notification_rating_style_1",
"styleNo": "样式A",
"scenes": "场景6"
},
"gift": {
"title": "开启消息通知",
"content": "新上礼包不再错过",
"image": "bg_notification_gift_style_1",
"styleNo": "样式A",
"scenes": "场景7"
},
"reserveGame": {
"title": "开启消息通知",
"content": "新游上线即时体验",
"image": "bg_notification_reserve_game_style_1",
"styleNo": "样式A",
"scenes": "场景8"
},
"feedback": {
"title": "开启消息通知",
"content": "及时查看客服回复",
"image": "bg_notification_feedback_style_1",
"styleNo": "样式A",
"scenes": "场景9"
}
},
{
"login": {
"title": "咦!是新的小伙伴耶!",
"content": "打开<font color=\"#1383EB\">通知开关</font>,游戏、礼包、抽奖活动不错过",
"image": "bg_notification_login_style_2",
"styleNo": "样式B",
"scenes": "场景1"
},
"question": {
"title": "发布成功!答案马上来!",
"content": "为了第一时间通知您,需要打开<font color=\"#1383EB\">通知开关</font>",
"image": "bg_notification_question_style_2",
"styleNo": "样式B",
"scenes": "场景2"
},
"answer": {
"title": "精彩的回答!大佬牛啤!",
"content": "打开<font color=\"#1383EB\">通知开关</font>,可以第一时间收获赞美和感谢哟!",
"image": "bg_notification_answer_style_2",
"styleNo": "样式B",
"scenes": "场景3"
},
"article": {
"title": "发布成功!不愧是你!",
"content": "打开<font color=\"#1383EB\">通知开关</font>,可以第一时间收获赞美和互动哟!",
"image": "bg_notification_article_style_2",
"styleNo": "样式B",
"scenes": "场景4"
},
"video": {
"title": "“百万”播放预定!",
"content": "<font color=\"#1383EB\">打开通知!</font>第一时间知道审核结果和互动信息哟!",
"image": "bg_notification_video_style_2",
"styleNo": "样式B",
"scenes": "场景5"
},
"rating": {
"title": "这游戏超好玩,我说的!",
"content": "想知道有多少人吃下安利?<font color=\"#1383EB\">打开通知</font>,马上知道!",
"image": "bg_notification_rating_style_2",
"styleNo": "样式B",
"scenes": "场景6"
},
"gift": {
"title": "获得道具:神奇的游戏礼包!",
"content": "<font color=\"#1383EB\">打开通知!</font>礼包上线,马上知道!",
"image": "bg_notification_gift_style_2",
"styleNo": "样式B",
"scenes": "场景7"
},
"reserveGame": {
"title": "玩最新的游戏,做游戏圈最靓的仔",
"content": "<font color=\"#1383EB\">打开通知!</font>游戏上线,更快知道!",
"image": "bg_notification_reserve_game_style_2",
"styleNo": "样式B",
"scenes": "场景8"
},
"feedback": {
"title": "真是重要的反馈!",
"content": "感恩有你,光环更精彩!<font color=\"#1383EB\">打开通知</font>,客服回复,马上知道!",
"image": "bg_notification_feedback_style_2",
"styleNo": "样式B",
"scenes": "场景9"
}
}
]

View File

@ -0,0 +1,758 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>隐私政策</title>
<style>
* {
margin: 0;
padding: 0;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.page {
padding: 0 10px;
}
.date p {
margin-bottom: 6px;
}
p {
font-family: "SourceHanSansSC-regular" !important;
color: #101010;
font-size: 14px;
font-weight: normal;
margin-bottom: 6px;
word-break: break-all;
}
b {
font-weight: 700;
font-size: 14px;
}
.points {
margin: 14px 0;
}
.points p {
margin-bottom: 6px;
}
.introduce p {
margin-bottom: 6px;
}
.content p b {
margin: 6px 0;
display: block;
}
.link-text {
color: rgb(19, 131, 235);
cursor: pointer;
}
.link-text a {
color: rgb(19, 131, 235);
cursor: pointer;
text-decoration: none;
}
.left-indent {
margin-left: 20px;
}
.page-title {
font-weight: bold;
font-size: 16px;
text-align: center;
margin: 20px 0 10px 0;
}
.red-style {
color: red;
}
.bold-font {
font-weight: bold;
}
span.bold {
font-weight: bold;
}
.link-text {
color: #005ad0;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="page">
<div class="page-title">欢迎您使用光环助手!</div>
<div class="introduce">
<p>
为了向您提供游戏预约、论坛互动交流等相关服务,受制于手机系统限制,我们会申请您的设备信息权限;
</p>
<p>为了让您正常使用游戏下载和论坛功能,我们会申请您的储存权限;</p>
<p>以下为完整《隐私权限政策》</p>
<p>
光环助手(简称“我们”)深知个人信息对您的重要性,我们将依据《中华人民共和国网络安全法》、《信息安全技术
个人信息安全规范》GB/T
35273-2017以及其他相关法律法规和技术规范收集和使用您的个人信息以帮助我们向您提供更优质的产品和/或服务,
保护您的个人信息及隐私安全。我们制定本“隐私指引”并特别提示:希望您在使用光环助手及相关服务前仔细阅读并理解本隐私政策,以便做出适当的选择。
</p>
<p>
下文将帮您详细了解我们如何收集、使用、存储、传输、共享、转让(如适用)与保护个人信息;帮您了解查询、访问、删除、更正、撤回授权个人信息的方式。其中,
<b>
有关您个人信息权益的条款重要内容我们已用加粗形式提示,请特别关注。
</b>
</p>
</div>
<div class="points">
<p><b>1.我们处理个人信息的法律依据</b></p>
<p><b>2.我们如何共享、转让、公开披露个人信息</b></p>
<p><b>3.我们如何收集和使用个人信息</b></p>
<p><b>4.我们如何存储个人信息</b></p>
<p><b>5.我们如何保护个人信息的安全</b></p>
<p><b>6.管理您的个人信息</b></p>
<p><b>7.未成年人使用条款</b></p>
<p><b>8.隐私政策的修订和通知</b></p>
<p><b>9.联系我们</b></p>
</div>
<div class="content">
<p><b>1.我们处理个人信息的法律依据</b></p>
<p>
如果您是中华人民共和国大陆地区的用户,我们将依据《中华人民共和国网络安全法》、《信息安全技术
个人信息安全规范》GB/T
35273-2017以及其他相关法律法规收集和使用您的个人信息为您提供产品或服务。
</p>
<p>
我们通常只会在征得您同意的情况下收集您的个人信息。
在某些情况下,我们可能还会基于法律义务或者履行合同之必需向您收集个人信息,或者可能需要个人信息来保护您的重要利益或其他人的利益。
</p>
<p><b>2.我们如何共享、转让、公开披露个人信息</b></p>
<p class="title margintop"><b>2.1第三方SDK接入说明</b></p>
<p>
为保障光环助手App相关功能的实现与应用安全稳定的运行我们会接入由第三方提供的软件开发包SDK实现相关功能。
<br />
我们会对合作方获取有关信息的软件工具开发包SDK进行严格的安全检测并与授权合作伙伴约定严格的数据保护措施令其按照我们的委托目的、服务说明、本隐私权政策以及其他任何相关的保密和安全措施来处理个人信息。
<br />
<span class="red-style">
下方为整个光环助手
<span class="bold">所有版本</span>
内接入的所有信息收集类第三方SDK的权限说明因隐私政策会因光环助手版本迭代而新接入SDK或停止合作部分SDK方便照顾
<span class="bold">所有版本</span>
的用户查看自己SDK第三方权限说明。
<br />
我们对涉及用户信息使用的SDK相关情况进行了逐项列举具体如下
</span>
</p>
<p class="margintop red-style bold-font"><b>1数据统计类</b></p>
<p>1.头条推广</p>
<p>
SDK官网
<span class="link-text">
https://ad.oceanengine.com/openapi/index.html
</span>
</p>
<p>SDK包名com.bytedance</p>
<p>企业主体:北京有竹居网络技术有限公司</p>
<p>使用目的:用于广告流量统计相关服务</p>
<p>
收集信息类型设备品牌、型号、软件系统相关信息、安卓oaid、无线网SSID名称、WiFi路由器MAC地址、设备MAC地址、IMEI、地理位置
</p>
<p>
隐私政策链接:
<span class="link-text">
https://ad.oceanengine.com/openapi/register/protocol.html?rid=vo25p8sfqde
</span>
</p>
<p>2.talkingdata统计</p>
<p>
SDK官网
<span class="link-text">http://www.talkingdata.com/</span>
</p>
<p>SDK包名com.tendcloud</p>
<p>企业主体:北京腾云天下科技有限公司</p>
<p>使用目的:用于统计数据和效果分析,以便为用户提供更好的服务</p>
<p>收集信息类型:设备信息、网络信息、位置信息、应用信息</p>
<p>
隐私政策链接:
<span class="link-text">
http://www.talkingdata.com/privacy.jsp?languagetype=zh_cn
</span>
</p>
<p>3.腾讯MTA</p>
<p>
SDK官网
<span class="link-text">https://mta.qq.com/mta/</span>
</p>
<p>SDK包名com.tencent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于统计数据和效果分析</p>
<p>
收集信息类型Mac地址、唯一设备识别码IMEI、android
ID、IDFA、OPENUDID、GUID/SIM卡IMSI信息、地理位置信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://mta.qq.com/mta/ctr_index/protocol_v2/
</span>
</p>
<p>4.腾讯广点通</p>
<p>
SDK官网
<span class="link-text">https://developers.e.qq.com/</span>
</p>
<p>SDK包名com.tencent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于广告流量统计相关服务</p>
<p>
收集信息类型:
个人常用设备信息IMEI、AndroidID、位置信息IP地址、软件版本号
</p>
<p>
隐私政策链接:
<span class="link-text">https://e.qq.com/optout.html</span>
</p>
<p class="margintop red-style bold-font"><b>2社交登录类</b></p>
<p>5.微信登录分享</p>
<p>
SDK官网
<span class="link-text">https://open.weixin.qq.com/</span>
</p>
<p>SDK包名com.tencent.mm.opensdk</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于支持微信登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">https://privacy.tencent.com/</span>
</p>
<p>6.QQ登录分享</p>
<p>
SDK官网
<span class="link-text">https://connect.qq.com/</span>
</p>
<p>SDK包名com.tentcent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的用于支持QQ登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、IMSI、ICCID、序列号、设备型号、操作系统版本、软件信息软件版本号、浏览器类型、网络信息、IP地址、服务日志信息、通讯日志信息 
</p>
<p>
隐私政策链接:
<span class="link-text">
https://wiki.connect.qq.com/qq互联sdk隐私保护声明
</span>
</p>
<p>7.微博登录分享</p>
<p>
SDK官网
<span class="link-text">http://open.weibo.com/authentication</span>
</p>
<p>SDK包名com.sina.weibo.sdk</p>
<p>企业主体:北京微梦创科网络技术有限公司</p>
<p>使用目的:用于支持微博登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、IMSI、ICCID、序列号、网络信息、应用列表硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">https://open.weibo.com/wiki/开发者协议</span>
</p>
<p>8.头条抖音登录</p>
<p>
SDK官网
<span class="link-text">https://open.douyin.com/platform</span>
</p>
<p>SDK包名com.bytedance.sdk</p>
<p>企业主体:北京字节跳动科技有限公司</p>
<p>使用目的:用于支持抖音登录</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://www.douyin.com/agreements/?id=6773901168964798477
</span>
</p>
<p class="margintop red-style bold-font"><b>3推送通知类</b></p>
<p>9.友盟推送</p>
<p>
SDK官网
<span class="link-text">https://www.umeng.com/push</span>
</p>
<p>SDK包名com.umeng</p>
<p>企业主体:北京友盟网络科技有限公司</p>
<p>使用目的:用于游戏相关信息的提醒通知</p>
<p>
收集信息类型Mac地址、唯一设备识别码IMEI、android
ID、IDFA、OPENUDID、GUID/SIM卡IMSI信息、地理位置信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://www.umeng.com/page/policy?spm=a213m0.14063960.0.0.7f626e72hx3nnv
</span>
</p>
<p class="margintop red-style bold-font"><b>4其他功能类</b></p>
<p>10.阿里云反爬虫</p>
<p>
SDK官网
<span class="link-text">https://www.aliyun.com/product/antibot</span>
</p>
<p>SDK包名com.alibaba.wireless</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>使用目的为APP提供网络应用安全防护</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>11.腾讯bugly</p>
<p>
SDK官网
<span class="link-text">https://bugly.qq.com/v2/</span>
</p>
<p>SDK包名com.tencent.bugly</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的APP异常上报</p>
<p>
收集信息类型:设备及应用信息。如:设备名称、设备识别符、硬件型号、操作系统版本、应用程序版本
</p>
<p>
隐私政策链接:
<span class="link-text">https://bugly.qq.com/v2/contract</span>
</p>
<p>12.阿里云文件上传</p>
<p>
SDK官网
<span class="link-text">https://www.alibabacloud.com/zh</span>
</p>
<p>SDK包名com.alibaba.sdk.android</p>
<p>SDK包名com.alibaba.sdk.android</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>使用目的:用于支持用户上传视频等相关内容</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>13.阿里云日志上传</p>
<p>
SDK官网
<span class="link-text">https://www.alibabacloud.com/zh</span>
</p>
<p>SDK包名com.aliyun.sls.android.sdk</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>
使用目的:通过网络日志分析这些信息以便更及时响应您的帮助请求,以及用于改进服务
</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>14.容联七陌</p>
<p>
SDK官网
<span class="link-text">https://www.7moor.com/developer</span>
</p>
<p>SDK包名com.m7.imkfsdk</p>
<p>企业主体:北京七陌科技有限公司</p>
<p>使用目的:用于提供对应在线客服功能</p>
<p>
收集信息类型:设备相关信息(设备名称、设备型号、硬件序列号、操作系统和应用程序版本及类型、语言设置、分辨率、移动终端随机存储内存、摄像头/相册、通讯录权限等)
</p>
<p>
隐私政策链接:
<span class="link-text">
http://m.7moor.com/72/57/p5077783560e807/
</span>
</p>
<p><b>2.2 共享您的个人信息</b></p>
<p>
1我们不会与任何公司、组织和个人共享您的个人信息但以下情况除外
</p>
<p>
2事先获得您的明确授权或同意
获得您的明确同意后,我们会与其他方共享您的个人信息;
</p>
<p>
3在法定情形下的共享
根据适用的法律法规、法律程序、政府的强制命令或司法裁定而需共享您的个人信息;
</p>
<p>
4在法律要求或允许的范围内为了保护光环助手及其用户或社会公众的利益、财产或安全免遭损害而有必要提供您的个人信息给第三方
</p>
<p>
5与我们的关联公司共享
您的个人信息可能会在我们的关联公司之间共享。我们会对共享的个人信息进行匿名化处理,且这种共享受本指引所声明目的的约束。关联公司如要改变个人信息的处理目的,将再次征求您的授权同意。
</p>
<p><b>2.3转让</b></p>
<p>
1我们不会转让您的个人信息给任何其他第三方除非征得您的明确同意。
</p>
<p>
2随着我们业务的持续发展我们将有可能进行合并、收购、资产转让您的个人信息有可能因此而被转移。在发生前述变更时我们将按照法律法规及不低于本隐私政策所载明的安全标准要求继受方保护您的个人信息否则我们将要求继受方重新征得您的授权同意。
</p>
<p><b>2.4披露</b></p>
<p>
1我们不会公开披露您的信息除非遵循国家法律法规规定或者获得您的同意。我们公开披露您的个人信息会采用符合行业内标准的安全保护措施。
</p>
<p>
2基于法律、法律程序、诉讼或政府主管部门强制性要求的情况下我们可能会向有权机关披露您的个人信息。但我们保证在上述情况发生时我们会要求披露请求方必须出具与之相应的有效法律文件并对被披露的信息采取符合法律和业界标准的安全防护措施。
</p>
<p>
3对违规账号、欺诈行为进行处罚公告时我们会披露相关账号的信息。
</p>
<p><b>2.5依法豁免征得同意共享、转让、公开披露的个人信息</b></p>
<p>
请您理解,在下列情形中,根据法律法规及国家标准,我们共享、转让、公开披露您的个人信息无需征得您的授权同意:
</p>
<p>1与国家安全、国防安全直接相关的</p>
<p>2与公共安全、公共卫生、重大公共利益直接相关的</p>
<p>3与犯罪侦查、起诉、审判和判决执行等直接相关的</p>
<p>
4出于维护您或其他个人的生命、财产等重大合法权益但又很难得到本人同意的
</p>
<p>5您自行向社会公众公开的个人信息</p>
<p>
6从合法公开披露的信息中收集个人信息的如合法的新闻报道、政府信息公开等渠道。
</p>
<p><b>3.我们如何收集和使用个人信息</b></p>
<p>
我们会遵循正当、合法、必要的原则,出于本指引所述的以下目的,收集和使用您在使用服务过程中主动提供或因使用产品或服务而产生的个人信息。
</p>
<p>
我们收集和使用的您的个人信息类型包括两种:第一种:我们产品或服务的核心业务功能所必需的信息:此类信息为产品或服务正常运行的必备信息,您须授权我们收集。如您拒绝提供,您将无法正常使用我们的功能,以"仅浏览(游客身份)"
的状态体验;第二种:我们产品或服务的附加业务功能可能需要收集的信息:此信息为非核心业务功能所需的信息,您可以选择是否授权我们收集。如您拒绝提供,将导致附加业务功能无法实现或无法达到我们拟达到的效果,但不影响您对核心业务功能的正常使用。
</p>
<p>
如果我们要将您的个人信息用于本指引未载明的其它用途,或基于特定目的将收集而来的信息用于其他目的,我们将以合理的方式向您告知,并在使用前再次征得您的同意。
</p>
<p><b>3.1实现产品或服务的基本功能</b></p>
<p>
1手机管理和内容资源下载功能。为实现手机管理及手机内容资源下载的基本功能我们会通过手机系统的公用接口收集经过MD5算法加密的国际移动设备身份码IMEI和网络设备地址MAC以及手机型号、手机系统版本号、系统编号、系统ID号、屏幕分辨率、上网类型、手机中软件的名称、版本号、版本名、包名、软件使用时间和频率、软件崩溃信息、设备和软件相关的信息。这些信息是提供服务所必须收集的基础信息如您拒绝提供上述权限将可能导致您无法使用我们的服务。
</p>
<p>
2软件升级管理功能。为实现手机软件下载、安装、升级、卸载软件管理功能在您使用产品时我们会采集您手机中已安装软件的软件名称、版本号、版本名、软件包名信息并上传到我们的服务器进行软件版本比对。发现有更新的版本我们会提示您升级相应的软件。上述软件信息为实现此功能所必需不涉及您个人身份敏感信息。
</p>
<p>
3过滤无法使用的软件功能。为了过滤您手机无法使用的软件我们会收集您手机的手机型号、手机系统版本号、系统版本号、屏幕分辨率信息并依据这些信息排除您手机无法使用的软件以保证您在光环助手下载的软件都可安装使用。
</p>
<p><b>3.2关于获取手机设备信息的说明</b></p>
<p>
1为方便区分每个用户的个人信息等本软件需获取用户的手机设备信息用于游戏主动预约、论坛互动交流后进行推送等用户相关的行为
</p>
<p>
2为了保障软件与服务的安全运行我们会收集您的硬件型号、操作系统版本号、国际移动设备识别码、唯一设备标识符、网络设备硬件地址、IP
地址、WLAN接入点、蓝牙、基站、软件版本号、网络接入方式、类型、状态、网络质量数据、操作、使用、服务日志。
</p>
<p>
3为了预防恶意程序及安全运营所必需我们会收集安装的应用信息或正在运行的进程信息、应用程序的总体运行、使用情况与频率、应用崩溃情况、总体安装使用情况、性能数据、应用来源。
</p>
<p>
4我们可能使用您的账户信息、设备信息、服务日志信息以及我们关联公司、合作方在获得您授权或依法可以共享的信息用于判断账户安全、进行身份验证、检测及防范安全事件。
</p>
<p>5具体会发生获取手机设备信息场景如下说明</p>
<p class="left-indent">
1 首次启动光环助手
<b></b>
2 游戏列表/游戏详情/资讯文章详情/搜索结果页-预约功能
<b></b>
3 礼包中心/礼包详情-领取功能
<b></b>
4 评论详情-发送评论功能
<b></b>
5 回答/问题详情-我来回答功能
<b></b>
6 问答首页-提问功能
<b></b>
7 个人主页-发文章功能
<b></b>
8 帖子草稿/我的草稿-编辑功能
<b></b>
9 游戏投稿功能
<b></b>
10视频投稿-上传视频功能
<b></b>
11游戏详情-关注游戏功能
</p>
<p><b>3.3帮助您成为我们的在线用户</b></p>
<p>1注册账号/登录账号</p>
<p>
a.当您注册、登录我们相关服务时,您可以通过手机号创建账号,并且您可以完善相关的网络身份识别信息(头像、昵称、密码),收集这些信息是为了帮助您完成注册。您还可以根据自身需求选择填写性别、生日、地区及个人介绍来完善您的信息。
</p>
<p>
b.您也可以使用第三方账号登录并使用,您将授权我们获取您在第三方平台注册的公开信息(头像、昵称以及您授权的其他信息),用于与光环助手账号绑定,使您可以直接登录并使用本产品和相关服务。
</p>
<p>2认证用户</p>
<p>
a.在您使用身份认证的功能或服务时,根据相关法律法规,您可能需要提供您的真实身份信息(真实姓名、身份证号码、电话号码)以完成实名验证。
</p>
<p>
b.这些信息属于个人敏感信息,您可以拒绝提供,但您将可能无法获得相关服务,但不影响其他功能与服务的正常使用。
</p>
<p><b>3.4搜索</b></p>
<p>
1您使用“光环助手”的搜索服务时我们会收集您的搜索关键字信息、日志记录。
</p>
<p>
2为了提供高效的搜索服务部分前述信息会暂时存储在您的本地存储设备之中并可向您展示搜索结果内容、搜索历史记录。
</p>
<p><b>3.5预约游戏</b></p>
<p>
当您使用游戏预约、游戏开测提醒功能时,您可以根据需要是否填写手机号。如您拒绝提供,仅会使您无法接收该预约游戏的短信快速提醒功能,但并不影响您正常使用产品与服务的其他。
</p>
<p><b>3.6游戏时长统计</b></p>
<p>
您可以授权我们使用应用使用记录访问权限,我们会获取您使用某款游戏应用的使用时长,以便于提供游戏时长展示服务以及对应的大数据统计分析。
</p>
<p><b>3.7信息发布功能</b></p>
<p>
1注册成为光环用户后可在光环平台上发布提问、帖子、视频并对别人的提问作出回答或邀请其他用户回答您还可以对别人的回答、帖子和视频的评论作出回复、赞同、感谢。
</p>
<p>
2上述功能基于相册图片库/视频库)的图片/视频访问及上传的附加服务,我们会请求您授权相机、照片、麦克风权限,您可以使用该功能上传您的照片/图片/视频,以实现发布照片/图片/视频的功能、与其他用户进行照片/图片分享等功能。如您拒绝提供该权限和内容的,仅会使您无法使用该功能,但并不影响您正常使用产品与/或服务的其他功能。
</p>
<p>
3您发布内容、评论、提问或回答时我们将收集您发布的信息并展示您的昵称、头像、发布内容。
</p>
<p>
4用户因使用我们的产品或者服务而被我们收集的信息例如其他用户发布的信息中可能含有您的部分信息在评论、留言、发布图文、音视频中涉及到与您相关的信息
</p>
<p><b>3.8浏览、关注与收藏功能</b></p>
<p>1您可浏览的内容包括问答、评论、专栏、文章。</p>
<p>
2在浏览的过程中您还可以关注您感兴趣的用户、专栏、问题、收藏并收藏上述内容。
</p>
<p>
3为此
我们可能会收集您使用时的设备信息,如设备型号、唯一设备标识符、操作系统、分辨率、电信运营商等软硬件信息。
我们还可能收集您的浏览器类型,以此来为您提供信息展示的最优方案。
</p>
<p>
4此外在您使用浏览和收藏功能的过程中我们会自动收集您使用的详细情况并作为有关的
网络日志保存,包括但不限于您输入的搜索关键词信息和点击的链接。
</p>
<p>
5您浏览和发布的内容及评论信息您上传的图片信息、您的交易信息、您使用的语言、访问的日期和时间、及您请求的网页记录、操作系统、软件版本号、登录
IP 信息。
</p>
<p>
6在此过程中
我们会收集您的浏览记录,浏览记录包括您浏览的问答、主页、文章、专栏,
您可以自主删除浏览记录。
</p>
<p><b>3.9互动交流</b></p>
<p>
1您主动关注您感兴趣的账号、内容、视频并与之进行互动进行浏览、评论、收藏、点赞或分享内容时我们会收集您关注的账号并向您展示您关注账号发布内容。
</p>
<p>
2您使用推荐通讯录好友功能时我们会请求通讯录权限并将通讯录中的信息进行高强度加密算法处理后用于向您推荐通信录中的好友。通讯录信息属于个人敏感信息拒绝提供该信息仅会使您无法使用上述功能但不影响您正常使用“光环助手”及相关服务的其他功能。
</p>
<p><b>3.10收集、使用个人信息目的变更</b></p>
<p>
1请您了解随着我们业务的发展可能会对“光环助手”的功能和提供的服务有所调整变化。
</p>
<p>
2原则上当新功能或服务与我们当前提供的功能或服务相关时收集与使用的个人信息将与原处理目的具有直接或合理关联。
</p>
<p>
3在与原处理目的无直接或合理关联的场景下我们收集、使用您的个人信息会再次进行告知并征得您的同意。
</p>
<p><b>3.11依法豁免征得同意收集和使用的个人信息</b></p>
<p>
请您理解,在下列情形中,根据法律法规及相关国家标准,我们收集和使用您的个人信息无需征得您的授权同意:
</p>
<p>1与国家安全、国防安全直接相关的</p>
<p>2与公共安全、公共卫生、重大公共利益直接相关的</p>
<p>3与犯罪侦查、起诉、审判和判决执行等直接相关的</p>
<p>
4出于维护个人信息主体或其他个人的生命、财产等重大合法权益但又很难得到本人同意的
</p>
<p>5所收集的您的个人信息是您自行向社会公众公开的</p>
<p>
6从合法公开披露的信息中收集的您的个人信息的如合法的新闻报道、政府信息公开等渠道
</p>
<p>7根据您的要求签订或履行合同所必需的</p>
<p>
8用于维护软件及相关服务的安全稳定运行所必需的例如发现、处置软件及相关服务的故障
</p>
<p>9为合法的新闻报道所必需的</p>
<p>
10学术研究机构基于公共利益开展统计或学术研究所必要且对外提供学术研究或描述的结果时对结果中所包含的个人信息进行去标识化处理的。
</p>
<p>11法律法规规定的其他情形。</p>
<p>
特别提示您注意,如信息无法单独或结合其他信息识别到您的个人身份,其不属于法律意义上您的个人信息;当您的信息可以单独或结合其他信息识别到您的个人身份时或我们将无法与任何特定个人信息建立联系的数据与其他您的个人信息结合使用时,这些信息在结合使用期间,将作为您的个人信息按照本隐私政策处理与保护。
</p>
<p><b>4.我们如何存储个人信息</b></p>
<p><b>4.1 存储地点</b></p>
<p>
1我们依照法律法规的规定将在境内运营过程中收集和产生的您的个人信息存储于中华人民共和国境内。
</p>
<p>
2目前我们不会将上述信息传输至境外如果我们向境外传输我们将会遵循相关国家规定或者征求您的同意。
</p>
<p><b>4.2存储期限</b></p>
<p>
1我们仅在为提供“光环助手”及服务之目的所必需的期间内保留您的个人信息您发布的信息、评论、点赞及相关信息在您未撤回、删除或未注销账号期间我们会保留相关信息。
</p>
<p>
2超出必要期限后我们将对您的个人信息进行删除或匿名化处理但法律法规另有规定的除外。
</p>
<p><b>5.我们如何保护个人信息的安全</b></p>
<p>
1我们非常重视您个人信息的安全将努力采取合理的安全措施包括技术方面和管理方面来保护您的个人信息防止您提供的个人信息被不当使用或未经授权的情况下被访问、公开披露、使用、修改、损坏、丢失或泄漏。
</p>
<p>
2我们会使用不低于行业同行的加密技术、匿名化处理及相关合理可行的手段保护您的个人信息并使用安全保护机制防止您的个人信息遭到恶意攻击。
</p>
<p>
3我们会建立专门的安全部门、安全管理制度、数据安全流程保障您的个人信息安全。我们采取严格的数据使用和访问制度确保只有授权人员才可访问您的个人信息并适时对数据和技术进行安全审计。
</p>
<p>
4尽管已经采取了上述合理有效措施并已经遵守了相关法律规定要求的标准但请您理解由于技术的限制以及可能存在的各种恶意手段在互联网行业即便竭尽所能加强安全措施也不可能始终保证信息百分之百的安全我们将尽力确保您提供给我们的个人信息的安全性。
</p>
<p>
5您知悉并理解您接入我们的服务所用的系统和通讯网络有可能因我们可控范围外的因素而出现问题。因此我们强烈建议您采取积极措施保护个人信息的安全包括但不限于使用复杂密码、定期修改密码、不将自己的账号密码及相关个人信息透露给他人。
</p>
<p>
6我们会制定应急处理预案并在发生用户信息安全事件时立即启动应急预案努力阻止这些安全事件的影响和后果扩大。一旦发生用户信息安全事件泄露、丢失我们将按照法律法规的要求及时向您告知安全事件的基本情况和可能的影响、我们已经采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施。我们将及时将事件相关情况以推送通知、邮件、信函、短信及相关形式告知您难以逐一告知时我们会采取合理、有效的方式发布公告。同时我们还将按照相关监管部门要求上报用户信息安全事件的处置情况。
</p>
<p>
7您一旦离开“光环助手”及相关服务浏览或使用其他网站、服务及内容资源我们将没有能力和直接义务保护您在光环助手及相关服务之外的软件、网站提交的任何个人信息无论您登录、浏览或使用上述软件、网站是否基于“光环助手”的链接或引导。
</p>
<p><b>6.管理您的个人信息</b></p>
<p>
我们非常重视您对个人信息的管理,并尽全力保护您的隐私,对于您个人信息的查询、访问、修改、删除、撤回同意授权、注销账号、投诉举报以及设置隐私功能的相关权利,以使您有能力保障您的隐私和信息安全。
</p>
<p><b>6.1 访问、删除、更正您的个人信息</b></p>
<p>1访问个人账号信息</p>
<p>a. 您可以查询、访问您的头像、用户名、简介、性别、生日、地区</p>
<p>b.您可以在光环助手的“个人中心”中进行查询、访问。</p>
<p>2查询访问、更正、取消您关注账号、查询访问粉丝、访客信息</p>
<p>a.进入“关注”在关注列表中查询、访问、取消关注您关注的账号。</p>
<p>
3查询访问、更改、删除您的收藏、点赞、浏览记录、阅读历史记录、搜索历史历史记录
</p>
<p>
a.点击“我的”—点击“我的收藏”、
“我的点赞”、或“浏览历史”进入查询访问、删除;
</p>
<p>b.点击搜索栏—删除搜索“历史记录”</p>
<p>c.您可以通过点击“系统设置”—点击“清理缓存”。</p>
<p>4投诉举报</p>
<p>a.您可按照我们公示的制度进行投诉或举报。</p>
<p>
b.如果您认为您的个人信息权利可能受到侵害,或者发现侵害个人信息权利的线索(例如:认为我们收集您的个人信息违反法律规定或者双方约定),“我的”—“基础功能”—“用户反馈”,进入用户反馈界面与我们联系。
</p>
<p>c.我们核查后会及时反馈您的投诉与举报。</p>
<p>5访问隐私政策</p>
<p>
a.您可以在注册页面,或者在登录个人账号“设置”—“关于”查看本隐私政策的全部内容
</p>
<p>
b.请您了解,本隐私政策中所述的“光环助手”及相关服务可能会根据您所使用的手机型号、系统版本、软件应用程序版本、移动客户端等因素而有所不同。最终的产品和服务以您所使用的“光环助手”软件及相关服务为准。
</p>
<p>6停止运营向您告知</p>
<p>
a.如我们停止运营,我们将及时停止收集您个人信息的活动,将停止运营的通知以逐一送达或公告的形式通知您,并对所持有的您的个人信息进行删除或匿名化处理。
</p>
<p><b>6.2 注销您的个人账号</b></p>
<p>
如需要注销个人账户,可前往光环助手,我的光环> 设置 > 账号与安全
账号安全中心
注销账号,进行注销操作。请您注意,如果您选择注销光环助手账户,那么您的光环助手账号将不可被使用且相关账号信息将被删除,包括所发布的所有内容,包括:提问、回答、社区文章、评论、关注的人等均会被清空;您将无法再通过光环助手账号登录光环助手的服务(但不会影响您使用无需账号登录即可使用的服务和功能)
</p>
<p>
当您注销账户后除法律法规要求我们保存相关信息的情况外我们将停止为您提供相应的产品或服务并在60个工作日内删除或匿名化您的个人信息。
</p>
<p><b>7.未成年人条款</b></p>
<p>
a.若您是未满18周岁的未成年人在使用“光环助手”及相关服务前应在您的父母或其他监护人监护、指导下共同阅读并同意本隐私政策。
</p>
<p>
b.我们根据国家相关法律法规的规定保护未成年人的个人信息,只会在法律允许、父母或其他监护人明确同意或保护未成年人所必要的情况下收集、使用、储存、共享、转让或披露未成年人的个人信息;如果我们发现在未事先获得可证实的父母同意的情况下收集了未成年人的个人信息,则会设法尽快删除相关信息。
</p>
<p>
c.若您是未成年人的监护人,当您对您所监护的未成年人的个人信息有相关疑问时,请通过公司本隐私政策公示的联系方式与我们联系。
</p>
<p><b>8.隐私政策的修订和通知</b></p>
<p>
1为了给您提供更好的服务光环助手及相关服务将不时更新与变化我们会适时对本隐私政策进行修订这些修订构成本隐私政策的一部分并具有等同于本隐私政策的效力未经您明确同意我们不会削减您依据当前生效的本隐私政策所应享受的权利。
</p>
<p>
2本隐私政策更新后我们会在光环助手发出更新版本并在更新后的条款生效前通过公告或其他适当的方式提醒您更新的内容以便您及时了解本隐私政策的最新版本。
</p>
<p><b>9.联系我们</b></p>
<p>
如果您对我们的隐私政策及对您个人信息的处理有任何疑问、意见、建议、或投诉,请通过以下方式与我们联系
</p>
<p>广州加兔网络科技有限公司</p>
<p>注册地址广州市番禺区市桥街丹山村青云一街2号229房</p>
<p>在线客服QQ350473523</p>
<p>信息保护事务联系电话020-85526920</p>
<p>在一般情况下我们会在15个工作日内对您的请求予以答复</p>
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,493 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>光环助手软件许可及服务协议</title>
</head>
<style>
* {
margin: 0;
padding: 0;
font-size: 14px;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
body {
margin: 10px;
}
.top {
margin-left: 0;
margin-right: 0;
padding: 10px 0 10px 0;
}
.title {
font-weight: 700;
}
p {
font-size: 14px;
word-break: break-all;
}
.bold {
font-weight: 700;
}
.margintop {
margin-top: 10px;
}
.left-indent {
margin-left: 20px;
}
.red-style {
color: red;
}
.bold-font {
font-weight: bold;
}
span.bold {
font-weight: bold;
}
.link-text {
color: #005ad0;
text-decoration: underline;
}
</style>
<body>
<h3 class="top">光环助手软件许可及服务协议</h3>
<h5 class="title">首部及导言</h5>
<p>欢迎使用光环助手软件许可及服务</p>
<p>
各位用户在使用光环助手前,请您务必审慎阅读、并充分理解本协议中的各项条款,
<span class="bold">
特别是免除或者限制责任的条款,以及开通或使用某项服务的单独协议,并选择接受或不接受。
</span>
除非您已阅读并接受本协议所有条款,否则您无权下载、安装或使用本软件及相关服务。您的下载、安装、使用、登录等行为即视为您已阅读并同意上述协议的约束。
</p>
<p>如果您未满18周岁请在法定监护人的陪同下阅读本协议及其他上述协议。</p>
<h5 class="title margintop">一、权利声明</h5>
<p>
“光环助手”的一切知识产权,以及与“光环助手”相关的所有信息内容,包括但不限于:文字表述及其组合、图标、图饰、图像、图表、色彩、界面设计、版面框架、有关数据、附加程序、印刷材料或电子文档等均为光环助手所有,受著作权法和国际著作权条约以及其他知识产权法律法规的保护。
</p>
<h5 class="title margintop">二、软件使用规范</h5>
<p>
2.1
本软件是基于Android安卓系统手机、平板电脑(PAD)等设备开发的一款软件,提供注册登录、手机游戏管理、游戏推荐、文章阅读等功能
</p>
<p>2.2 软件的下载、安装和使用</p>
<p>
本软件为免费软件,用户可以非商业性、无限制数量地从光环授权的渠道下载、安装及使用本软件。
</p>
<p>
<span class="bold">
如果您从未经光环授权的第三方获取本软件或与本软件名称相同的安装程序,光环无法保证该软件能够正常使用,并对因此给您造成的损失不予负责。
</span>
</p>
<p>2.3 软件的复制、分发和传播</p>
<p>
本产品以学习、研究交流为目的。用户可以非商业性、无限制数量地复制、分发和传播本软件产品。但必须保证每一份复制、分发和传播都是完整和真实的,
包括所有有关本软件产品的软件、电子文档, 版权和商标,亦包括本协议。
</p>
<p>2.4 软件的更新</p>
<p>
为了改善用户体验、完善服务内容,光环将不断努力开发新的服务,并为您不时提供软件更新(这些更新可能会采取软件替换、修改、功能强化、版本升级等形式)。为了保证本软件及服务的安全性和功能的一致性,光环有权不经向您特别通知而对软件进行更新,或者对软件的部分功能效果进行改变或限制。本软件新版本发布后,旧版本的软件可能无法使用。光环不保证旧版本软件继续可用及相应的客户服务,请您随时核对并下载最新版本。
</p>
<h5 class="title margintop">三、用户使用须知</h5>
<p>3.1 您理解并同意:</p>
<p>
为了向您提供有效的服务,本软件会利用您移动通讯终端的处理器和带宽等资源。本软件使用过程中可能产生数据流量的费用,用户需自行向运营商了解相关资费信息,并自行承担相关费用.
</p>
<p>3.2 您理解并同意:</p>
<p>
由本软件进行收录、推荐并提供下载、升级服务的第三方软件,由第三方享有一切合法权利,光环并不能识别用户利用本软件下载、安装的第三方软件是否有合法来源。
<span class="bold">
因第三方软件引发的任何纠纷,由该第三方负责解决,光环不承担任何责任。
</span>
同时光环不对第三方软件或技术提供客服支持,若用户需要获取支持,请与该软件或技术提供商联系,若您为有关软件的权利人,不愿本软件为您的软件提供用户下载、安装、使用的服务,也可按本协议约定的联系方式联系我们,我们将会积极配合进行处理。
</p>
<p>3.3 您理解并同意:</p>
<p>
<span class="bold">
如果因您不正当使用本软件造成了不良影响,或因使用本软件造成的包括但不限于数据异常等问题,均由使用者自行承担,光环团队不对任意类型的使用结果承担责任;
</span>
</p>
<p>3.4 您理解并同意:</p>
<p>
本软件不含任何破坏用户移动通讯设备数据和获取用户隐私信息的恶意代码,不会泄露用户的个人信息和隐私;
</p>
<p>3.5 您理解并同意:</p>
<p>
<span class="bold">
对于包括但不限于互联网网络故障、计算机故障、手机故障或病毒、信息损坏或丢失、计算机系统问题,或其它任何基于不可抗力原因而产生的损失,光环团队不承担任何责任。
</span>
</p>
<p>3.6 您理解并同意:</p>
<p>光环发布、收录的文章均不代表光环立场。</p>
<p>3.7 您理解并同意:</p>
<p>
为实现软件包括但不限于集中展示、下载、安装、卸载等游戏管理功能以及文章优先推荐功能,本软件会检测用户手机中已安装游戏的包名、版本号、版本名、游戏名称信息。除征得用户明确同意和法律明确规定外,光环不会向第三方泄露任何的用户信息
</p>
<p>3.8 您理解并同意:</p>
<p>
用户应在遵守法律及本协议的前提下使用本软件。用户无权实施包括但不限于下列行为:
</p>
3.8.1 不得删除或者改变本软件上的所有权利管理电子信息
<br />
3.8.2 不得故意避开或者破坏著作权人为保护本软件著作权而采取的技术措施;
<br />
3.8.3 用户不得利用本软件误导、欺骗他人;
<br />
3.8.4
违反国家规定,对计算机信息系统功能进行删除、修改、增加、干扰,造成计算机信息系统不能正常运行;
<br />
3.8.5 未经允许,进入计算机信息网络或者使用计算机信息网络资源;
<br />
3.8.6 未经允许,对计算机信息网络功能进行删除、修改或者增加;
<br />
3.8.7
未经允许,对计算机信息网络中存储、处理或者传输的数据和应用程序进行删除、修改或者增加;
<br />
3.8.8 破坏本软件系统或网站的正常运行,故意传播计算机病毒等破坏性程序;
<br />
3.8.9 其他任何危害计算机信息网络安全的行为。
<br />
<p>3.9 您理解并同意:</p>
<p>
本软件经过详细的测试,但不能保证与所有的软硬件系统完全兼容,不能保证本软件完全没有错误。如果出现不兼容及软件错误的情况,用户可通过各反馈途径将情况告知光环团队,获得技术支持。如果无法解决兼容性问题,用户可以删除本软件。
</p>
<h5 class="title margintop">四、争议解决处理</h5>
<p>
本《协议》的解释、效力及纠纷的解决,适用于中华人民共和国法律。若用户和光环助手之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,用户在此完全同意将纠纷或争议提交光环助手所在地法院管辖
</p>
<p class="title margintop"><b>五、第三方SDK接入说明</b></p>
<p>
为保障光环助手App相关功能的实现与应用安全稳定的运行我们会接入由第三方提供的软件开发包SDK实现相关功能。
<br />
我们会对合作方获取有关信息的软件工具开发包SDK进行严格的安全检测并与授权合作伙伴约定严格的数据保护措施令其按照我们的委托目的、服务说明、本隐私权政策以及其他任何相关的保密和安全措施来处理个人信息。
<br />
<span class="red-style">
下方为整个光环助手
<span class="bold">所有版本</span>
内接入的所有信息收集类第三方SDK的权限说明因隐私政策会因光环助手版本迭代而新接入SDK或停止合作部分SDK方便照顾
<span class="bold">所有版本</span>
的用户查看自己SDK第三方权限说明。
<br />
我们对涉及用户信息使用的SDK相关情况进行了逐项列举具体如下
</span>
</p>
<p class="margintop red-style bold-font"><b>1数据统计类</b></p>
<p>1.头条推广</p>
<p>
SDK官网
<span class="link-text">
https://ad.oceanengine.com/openapi/index.html
</span>
</p>
<p>SDK包名com.bytedance</p>
<p>企业主体:北京有竹居网络技术有限公司</p>
<p>使用目的:用于广告流量统计相关服务</p>
<p>
收集信息类型设备品牌、型号、软件系统相关信息、安卓oaid、无线网SSID名称、WiFi路由器MAC地址、设备MAC地址、IMEI、地理位置
</p>
<p>
隐私政策链接:
<span class="link-text">
https://ad.oceanengine.com/openapi/register/protocol.html?rid=vo25p8sfqde
</span>
</p>
<p>2.talkingdata统计</p>
<p>
SDK官网
<span class="link-text">http://www.talkingdata.com/</span>
</p>
<p>SDK包名com.tendcloud</p>
<p>企业主体:北京腾云天下科技有限公司</p>
<p>使用目的:用于统计数据和效果分析,以便为用户提供更好的服务</p>
<p>收集信息类型:设备信息、网络信息、位置信息、应用信息</p>
<p>
隐私政策链接:
<span class="link-text">
http://www.talkingdata.com/privacy.jsp?languagetype=zh_cn
</span>
</p>
<p>3.腾讯MTA</p>
<p>
SDK官网
<span class="link-text">https://mta.qq.com/mta/</span>
</p>
<p>SDK包名com.tencent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于统计数据和效果分析</p>
<p>
收集信息类型Mac地址、唯一设备识别码IMEI、android
ID、IDFA、OPENUDID、GUID/SIM卡IMSI信息、地理位置信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://mta.qq.com/mta/ctr_index/protocol_v2/
</span>
</p>
<p>4.腾讯广点通</p>
<p>
SDK官网
<span class="link-text">https://developers.e.qq.com/</span>
</p>
<p>SDK包名com.tencent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于广告流量统计相关服务</p>
<p>
收集信息类型:
个人常用设备信息IMEI、AndroidID、位置信息IP地址、软件版本号
</p>
<p>
隐私政策链接:
<span class="link-text">https://e.qq.com/optout.html</span>
</p>
<p class="margintop red-style bold-font"><b>2社交登录类</b></p>
<p>5.微信登录分享</p>
<p>
SDK官网
<span class="link-text">https://open.weixin.qq.com/</span>
</p>
<p>SDK包名com.tencent.mm.opensdk</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的:用于支持微信登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">https://privacy.tencent.com/</span>
</p>
<p>6.QQ登录分享</p>
<p>
SDK官网
<span class="link-text">https://connect.qq.com/</span>
</p>
<p>SDK包名com.tentcent</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的用于支持QQ登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、IMSI、ICCID、序列号、设备型号、操作系统版本、软件信息软件版本号、浏览器类型、网络信息、IP地址、服务日志信息、通讯日志信息 
</p>
<p>
隐私政策链接:
<span class="link-text">
https://wiki.connect.qq.com/qq互联sdk隐私保护声明
</span>
</p>
<p>7.微博登录分享</p>
<p>
SDK官网
<span class="link-text">http://open.weibo.com/authentication</span>
</p>
<p>SDK包名com.sina.weibo.sdk</p>
<p>企业主体:北京微梦创科网络技术有限公司</p>
<p>使用目的:用于支持微博登录、分享</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、IMSI、ICCID、序列号、网络信息、应用列表硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">https://open.weibo.com/wiki/开发者协议</span>
</p>
<p>8.头条抖音登录</p>
<p>
SDK官网
<span class="link-text">https://open.douyin.com/platform</span>
</p>
<p>SDK包名com.bytedance.sdk</p>
<p>企业主体:北京字节跳动科技有限公司</p>
<p>使用目的:用于支持抖音登录</p>
<p>
收集信息类型个人常用设备信息MAC地址、IMEI、AndroidID、硬件型号、操作系统类型、软件信息软件版本号、浏览器类型、IP地址、服务日志信息、通讯日志信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://www.douyin.com/agreements/?id=6773901168964798477
</span>
</p>
<p class="margintop red-style bold-font"><b>3推送通知类</b></p>
<p>9.友盟推送</p>
<p>
SDK官网
<span class="link-text">https://www.umeng.com/push</span>
</p>
<p>SDK包名com.umeng</p>
<p>企业主体:北京友盟网络科技有限公司</p>
<p>使用目的:用于游戏相关信息的提醒通知</p>
<p>
收集信息类型Mac地址、唯一设备识别码IMEI、android
ID、IDFA、OPENUDID、GUID/SIM卡IMSI信息、地理位置信息
</p>
<p>
隐私政策链接:
<span class="link-text">
https://www.umeng.com/page/policy?spm=a213m0.14063960.0.0.7f626e72hx3nnv
</span>
</p>
<p class="margintop red-style bold-font"><b>4其他功能类</b></p>
<p>10.阿里云反爬虫</p>
<p>
SDK官网
<span class="link-text">https://www.aliyun.com/product/antibot</span>
</p>
<p>SDK包名com.alibaba.wireless</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>使用目的为APP提供网络应用安全防护</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>11.腾讯bugly</p>
<p>
SDK官网
<span class="link-text">https://bugly.qq.com/v2/</span>
</p>
<p>SDK包名com.tencent.bugly</p>
<p>企业主体:深圳市腾讯计算机系统有限公司</p>
<p>使用目的APP异常上报</p>
<p>
收集信息类型:设备及应用信息。如:设备名称、设备识别符、硬件型号、操作系统版本、应用程序版本
</p>
<p>
隐私政策链接:
<span class="link-text">https://bugly.qq.com/v2/contract</span>
</p>
<p>12.阿里云文件上传</p>
<p>
SDK官网
<span class="link-text">https://www.alibabacloud.com/zh</span>
</p>
<p>SDK包名com.alibaba.sdk.android</p>
<p>SDK包名com.alibaba.sdk.android</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>使用目的:用于支持用户上传视频等相关内容</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>13.阿里云日志上传</p>
<p>
SDK官网
<span class="link-text">https://www.alibabacloud.com/zh</span>
</p>
<p>SDK包名com.aliyun.sls.android.sdk</p>
<p>企业主体:阿里巴巴网络技术有限公司</p>
<p>
使用目的:通过网络日志分析这些信息以便更及时响应您的帮助请求,以及用于改进服务
</p>
<p>
收集信息类型设备相关信息例如设备型号、操作系统版本、设备设置、唯一设备标识符等软硬件特征信息、设备所在位置相关信息例如IP地址、GPS位置以及能够提供相关信息的Wi-Fi接入点、蓝牙和基站等传感器信息
</p>
<p>
隐私政策链接:
<span class="link-text">
http://terms.aliyun.com/legal-agreement/terms/suit_bu1_ali_cloud/suit_bu1_ali_cloud201902141711_54837.html?spm=a2c4g.11186623.J_9220772140.81.b7574832gmk0vr
</span>
</p>
<p>14.容联七陌</p>
<p>
SDK官网
<span class="link-text">https://www.7moor.com/developer</span>
</p>
<p>SDK包名com.m7.imkfsdk</p>
<p>企业主体:北京七陌科技有限公司</p>
<p>使用目的:用于提供对应在线客服功能</p>
<p>
收集信息类型:设备相关信息(设备名称、设备型号、硬件序列号、操作系统和应用程序版本及类型、语言设置、分辨率、移动终端随机存储内存、摄像头/相册、通讯录权限等)
</p>
<p>
隐私政策链接:
<span class="link-text">http://m.7moor.com/72/57/p5077783560e807/</span>
</p>
<h5 class="title margintop">六、关于获取手机设备信息的说明</h5>
<div>
1为方便区分每个用户的个人信息等本软件需获取用户的手机设备信息用于游戏主动预约、论坛互动交流后进行推送等用户相关的行为
<br />
2为了保障软件与服务的安全运行我们会收集您的硬件型号、操作系统版本号、国际移动设备识别码、唯一设备标识符、网络设备硬件地址、IP
地址、WLAN接入点、蓝牙、基站、软件版本号、网络接入方式、类型、状态、网络质量数据、操作、使用、服务日志。
<br />
3为了预防恶意程序及安全运营所必需我们会收集安装的应用信息或正在运行的进程信息、应用程序的总体运行、使用情况与频率、应用崩溃情况、总体安装使用情况、性能数据、应用来源。
<br />
4我们可能使用您的账户信息、设备信息、服务日志信息以及我们关联公司、合作方在获得您授权或依法可以共享的信息用于判断账户安全、进行身份验证、检测及防范安全事件。
<br />
5具体会发生获取手机设备信息场景如下说明
<br />
<p class="left-indent">
1) 首次启动光环助手
<br />
2) 游戏列表/游戏详情/资讯文章详情/搜索结果页-预约功能
<br />
3) 礼包中心/礼包详情-领取功能
<br />
4) 评论详情-发送评论功能
<br />
5) 回答/问题详情-我来回答功能
<br />
6) 问答首页-提问功能
<br />
7) 个人主页-发文章功能
<br />
8) 帖子草稿/我的草稿-编辑功能
<br />
9) 游戏投稿功能
<br />
10) 视频投稿-上传视频功能
<br />
11) 游戏详情-关注游戏功能
</p>
</div>
<h5 class="title margintop">七、其他</h5>
<p>
7.1
本协议所有条款的标题仅为阅读方便,本身并无实际涵义,不能作为本协议涵义解释的依据。
<br />
7.2
如果本协议中的任何条款无论因何种原因完全或部分无效或不具有执行力,或违反任何适用的法律,则该条款被视为删除,但本协议的其余条款仍应有效并且有约束力。
<br />
7.3
光环有权随时根据有关法律、法规的变化以及公司经营状况和经营策略的调整等修改本协议。修改后的协议会在软件设置内发布。
当发生有关争议时,以最新的协议文本为准。如果不同意改动的内容,用户可以自行删除本软件。如果用户继续使用本软件,则视为您接受本协议的变动。
<br />
<span class="bold">
7.4 光环在法律允许的最大范围内对本协议拥有解释权与修改权。
</span>
</p>
</body>
</html>

View File

@ -0,0 +1,159 @@
/*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.swiperefreshlayout.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RadialGradient;
import android.graphics.Shader;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.view.View;
import android.view.animation.Animation;
import android.widget.ImageView;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
/**
* Private class created to work around issues with AnimationListeners being
* called before the animation is actually complete and support shadows on older
* platforms.
*/
class CircleImageView extends ImageView {
private static final int KEY_SHADOW_COLOR = 0x1E000000;
private static final int FILL_SHADOW_COLOR = 0x3D000000;
// PX
private static final float X_OFFSET = 0f;
private static final float Y_OFFSET = 1.75f;
private static final float SHADOW_RADIUS = 3.5f;
private static final int SHADOW_ELEVATION = 4;
private Animation.AnimationListener mListener;
int mShadowRadius;
CircleImageView(Context context, int color) {
super(context);
final float density = getContext().getResources().getDisplayMetrics().density;
final int shadowYOffset = (int) (density * Y_OFFSET);
final int shadowXOffset = (int) (density * X_OFFSET);
mShadowRadius = (int) (density * SHADOW_RADIUS);
ShapeDrawable circle;
if (elevationSupported()) {
circle = new ShapeDrawable(new OvalShape());
ViewCompat.setElevation(this, SHADOW_ELEVATION * density);
} else {
OvalShape oval = new OvalShadow(mShadowRadius);
circle = new ShapeDrawable(oval);
setLayerType(View.LAYER_TYPE_SOFTWARE, circle.getPaint());
circle.getPaint().setShadowLayer(mShadowRadius, shadowXOffset, shadowYOffset,
KEY_SHADOW_COLOR);
final int padding = mShadowRadius;
// set padding so the inner image sits correctly within the shadow.
setPadding(padding, padding, padding, padding);
}
circle.getPaint().setColor(color);
ViewCompat.setBackground(this, circle);
}
private boolean elevationSupported() {
return android.os.Build.VERSION.SDK_INT >= 21;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (!elevationSupported()) {
setMeasuredDimension(getMeasuredWidth() + mShadowRadius * 2, getMeasuredHeight()
+ mShadowRadius * 2);
}
}
public void setAnimationListener(Animation.AnimationListener listener) {
mListener = listener;
}
@Override
public void onAnimationStart() {
super.onAnimationStart();
if (mListener != null) {
mListener.onAnimationStart(getAnimation());
}
}
@Override
public void onAnimationEnd() {
super.onAnimationEnd();
if (mListener != null) {
mListener.onAnimationEnd(getAnimation());
}
}
/**
* Update the background color of the circle image view.
*
* @param colorRes Id of a color resource.
*/
public void setBackgroundColorRes(int colorRes) {
setBackgroundColor(ContextCompat.getColor(getContext(), colorRes));
}
@Override
public void setBackgroundColor(int color) {
if (getBackground() instanceof ShapeDrawable) {
((ShapeDrawable) getBackground()).getPaint().setColor(color);
}
}
private class OvalShadow extends OvalShape {
private RadialGradient mRadialGradient;
private Paint mShadowPaint;
OvalShadow(int shadowRadius) {
super();
mShadowPaint = new Paint();
mShadowRadius = shadowRadius;
updateRadialGradient((int) rect().width());
}
@Override
protected void onResize(float width, float height) {
super.onResize(width, height);
updateRadialGradient((int) width);
}
@Override
public void draw(Canvas canvas, Paint paint) {
final int viewWidth = CircleImageView.this.getWidth();
final int viewHeight = CircleImageView.this.getHeight();
canvas.drawCircle(viewWidth / 2, viewHeight / 2, viewWidth / 2, mShadowPaint);
canvas.drawCircle(viewWidth / 2, viewHeight / 2, viewWidth / 2 - mShadowRadius, paint);
}
private void updateRadialGradient(int diameter) {
mRadialGradient = new RadialGradient(diameter / 2, diameter / 2,
mShadowRadius, new int[] { FILL_SHADOW_COLOR, Color.TRANSPARENT },
null, Shader.TileMode.CLAMP);
mShadowPaint.setShader(mRadialGradient);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,8 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import io.sentry.core.Sentry;
public class AppUncaughtHandler implements UncaughtExceptionHandler {
private Context mContext;
@ -45,7 +47,9 @@ public class AppUncaughtHandler implements UncaughtExceptionHandler {
Looper.loop();
}
});
saveLocalLog(mContext, ex);
Sentry.captureException(ex);
restart(mContext);
}

View File

@ -3,27 +3,46 @@ package com.gh.base;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Lifecycle;
import com.gh.base.fragment.BaseFragment;
import com.gh.common.constant.Constants;
import com.gh.common.util.DialogUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.EntranceUtils;
import com.gh.common.util.ExtensionsKt;
import com.gh.common.util.MtaHelper;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PackageInstaller;
import com.gh.common.util.RunningUtils;
import com.gh.common.util.SPUtils;
import com.gh.common.util.ShareUtils;
import com.gh.common.util.StringUtils;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.LoginActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.SplashScreenActivity;
import com.gh.gamecenter.eventbus.EBShowDialog;
import com.lightgame.BaseAppCompatActivity;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.FileUtils;
import com.lightgame.utils.Utils;
import com.tencent.tauth.Tencent;
@ -36,9 +55,6 @@ import org.json.JSONObject;
import java.lang.ref.WeakReference;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Lifecycle;
import butterknife.ButterKnife;
import pub.devrel.easypermissions.EasyPermissions;
@ -88,10 +104,13 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == com.tencent.connect.common.Constants.REQUEST_QQ_SHARE
|| requestCode == com.tencent.connect.common.Constants.REQUEST_QZONE_SHARE) {
Tencent.onActivityResultData(requestCode, resultCode, data, ShareUtils.getInstance(this).QqShareListener);
}
ExtensionsKt.tryCatchInRelease(() -> {
if (requestCode == com.tencent.connect.common.Constants.REQUEST_QQ_SHARE
|| requestCode == com.tencent.connect.common.Constants.REQUEST_QZONE_SHARE) {
Tencent.onActivityResultData(requestCode, resultCode, data, ShareUtils.getInstance(this).QqShareListener);
}
return null;
});
}
@Override
@ -107,6 +126,32 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
if (BuildConfig.DEBUG) {
Utils.log("ACTIVITY_ENTRANCE -> " + mEntrance);
}
if (savedInstanceState != null) {
String xapkUnzipActivity = SPUtils.getString(Constants.SP_XAPK_UNZIP_ACTIVITY);
String xapkUrl = SPUtils.getString(Constants.SP_XAPK_URL);
Utils.log("页面重建了--" + xapkUnzipActivity + "--" + xapkUrl);
if (this.getClass().getName().equals(SplashScreenActivity.class.getName())) {
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "");
SPUtils.setString(Constants.SP_XAPK_URL, "");
return;
}
if (this.getClass().getName().equals(xapkUnzipActivity) && !TextUtils.isEmpty(xapkUrl)) {
DownloadEntity downloadEntity = DownloadManager.getInstance(this).getDownloadEntityByUrl(xapkUrl);
PackageInstaller.install(this, downloadEntity, false);
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "");
SPUtils.setString(Constants.SP_XAPK_URL, "");
}
}
}
@SuppressWarnings("ConstantConditions")
@Override
public void setContentView(View view) {
if (BuildConfig.DEBUG || BuildConfig.BUILD_TIME != 0) {
view = getRootViewWithEnvIndicator(view);
}
super.setContentView(view);
}
@Override
@ -128,21 +173,63 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
String icon,
String shareTitle,
String shareSummary,
ShareUtils.ShareType shareType) {
ShareUtils.ShareEntrance shareEntrance, String id) {
ShareUtils.getInstance(this).showShareWindows(this,
getWindow().getDecorView(),
url,
icon,
shareTitle,
shareSummary,
shareType);
if (shareType == ShareUtils.ShareType.game || shareType == ShareUtils.ShareType.plugin) {
shareEntrance, id);
if (shareEntrance == ShareUtils.ShareEntrance.game || shareEntrance == ShareUtils.ShareEntrance.plugin) {
MtaHelper.onEvent("内容分享", "内容分享", shareTitle + shareSummary);
} else {
MtaHelper.onEvent("内容分享", "内容分享", shareTitle);
}
}
private View getRootViewWithEnvIndicator(View view) {
RelativeLayout screenRootView = new RelativeLayout(this);
screenRootView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
LinearLayout ll = new LinearLayout(this);
TextView tv = new TextView(this);
String envText = "正式环境";
tv.setBackground(ContextCompat.getDrawable(this, R.color.theme));
if (BuildConfig.FLAVOR.equals("internal")) {
envText = "测试环境";
tv.setBackground(ContextCompat.getDrawable(this, R.color.red));
}
tv.setText(envText);
tv.setGravity(Gravity.CENTER);
tv.setTextColor(Color.WHITE);
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
tv.measure(0, 0);
tv.setAlpha(0.15F);
int height = tv.getMeasuredHeight();
int width = tv.getMeasuredWidth();
tv.setPadding(DisplayUtils.dip2px(20), 0, DisplayUtils.dip2px(20), 0);
ll.setTranslationX(DisplayUtils.dip2px(20));
ll.setRotation(45);
ll.addView(tv);
ll.setPadding(0, (width - height) / 2, 0, (width - height) / 2);
if (BuildConfig.DEBUG) {
tv.setOnLongClickListener(v -> {
EntranceUtils.saveShortcut(this.getClass().getName(), getIntent().getExtras());
return true;
});
}
screenRootView.addView(view);
screenRootView.addView(ll);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) ll.getLayoutParams();
lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
view.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
return screenRootView;
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(final EBShowDialog showDialog) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)
@ -154,7 +241,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
if (FileUtils.isEmptyFile(showDialog.getPath())) {
toast(R.string.install_failure_hint);
} else {
startActivity(PackageUtils.getUninstallIntent(BaseActivity.this, showDialog.getPath()));
PackageInstaller.uninstall(BaseActivity.this, showDialog.getPath());
}
});
} else if (LOGIN_EXCEPTION.equals(showDialog.getType())) {

View File

@ -4,10 +4,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import com.gh.base.adapter.FragmentAdapter;
import com.gh.base.fragment.BaseFragment_TabLayout;
import com.gh.common.view.TabIndicatorView;
@ -18,6 +14,9 @@ import com.lightgame.view.NoScrollableViewPager;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
/**
@ -73,10 +72,13 @@ public abstract class BaseActivity_TabLayout extends ToolBarActivity implements
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getIntent() != null) mCheckedIndex = getIntent().getIntExtra(PAGE_INDEX, 0);
mFragmentsList = new ArrayList<>();
initFragmentList(mFragmentsList);
mTabTitleList = new ArrayList<>();
initTabTitleList(mTabTitleList);
mFragmentsList = new ArrayList<>(restoreFragments());
if (mFragmentsList.isEmpty() || mFragmentsList.size() != mTabTitleList.size()) {
mFragmentsList.clear();
initFragmentList(mFragmentsList);
}
mViewPager.setOffscreenPageLimit(mFragmentsList.size());
mViewPager.addOnPageChangeListener(this);
@ -100,6 +102,20 @@ public abstract class BaseActivity_TabLayout extends ToolBarActivity implements
BaseFragment_TabLayout.initTabStyle(mTabLayout, mCheckedIndex);
}
private ArrayList<Fragment> restoreFragments() {
String tag = "android:switcher:" + mViewPager.getId() + ":";
ArrayList<Fragment> fragments = new ArrayList<>();
int childCount = mTabTitleList.size();
for (int index = 0; index < childCount; index++) {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(tag + index);
if (fragment != null) {
fragments.add(fragment);
}
}
return fragments;
}
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

View File

@ -35,6 +35,7 @@ abstract class BaseRichEditorActivity : ToolBarActivity() {
val mRichEditor by bindView<RichEditor>(R.id.rich_editor)
val mDraftBtn by bindView<TextView>(R.id.draft_btn)
private val mEditorTextNumTv by bindView<TextView>(R.id.editorTextNumTv)
private val mEditorFont by bindView<CheckableImageView>(R.id.editor_font)
private val mEditorLink by bindView<CheckableImageView>(R.id.editor_link)
private val mEditorParagraph by bindView<CheckableImageView>(R.id.editor_paragraph)
@ -89,11 +90,12 @@ abstract class BaseRichEditorActivity : ToolBarActivity() {
// 防止个别手机在Js里无法获取粘贴内容
mRichEditor.addJavascriptInterface(OnPasteListener(), "onPasteListener")
mRichEditor.addJavascriptInterface(OnCursorChangeListener(), "OnCursorChangeListener")
mRichEditor.addJavascriptInterface(OnEditorTextChangeListener(), "OnEditorTextChangeListener")
mRichEditor.setInputEnabled(true)
mDraftBtn.text = if (this is AnswerEditActivity) {
"回答草稿"
} else "文章草稿"
} else "帖子草稿"
}
@OnClick(R.id.editor_image, R.id.editor_font, R.id.editor_link, R.id.editor_paragraph,
@ -258,6 +260,14 @@ abstract class BaseRichEditorActivity : ToolBarActivity() {
}
}
private inner class OnEditorTextChangeListener {
@JavascriptInterface
fun onTextChange(count: Int) {
val num = if (count > MAX_INPUT_TEXT_NUM) MAX_INPUT_TEXT_NUM - count else count
mEditorTextNumTv.text = num.toString()
}
}
abstract fun mtaEventName(): String
companion object {
@ -273,5 +283,6 @@ abstract class BaseRichEditorActivity : ToolBarActivity() {
const val INSERT_ANSWER_CODE = 411
const val INSERT_ARTICLE_CODE = 412
const val INSERT_GAME_CODE = 413
const val MAX_INPUT_TEXT_NUM = 10000
}
}

View File

@ -4,10 +4,10 @@ import android.app.Activity;
import android.app.Application.ActivityLifecycleCallbacks;
import android.os.Bundle;
import com.gh.common.im.ImManager;
import com.gh.common.notifier.Notifier;
import com.gh.common.util.DataUtils;
import com.gh.download.DownloadManager;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.AppManager;
/**
@ -34,23 +34,27 @@ public class GHActivityLifecycleCallbacksImpl implements ActivityLifecycleCallba
@Override
public void onActivityResumed(Activity activity) {
DataUtils.onResume(activity);
CurrentActivityHolder.getActivitySet().add(activity);
ImManager.updateFloatingWindow();
//FIXME 这里应该只是部分Activity需要
try {
// 初始化gameMap
DownloadManager.getInstance(activity).initGameMap();
} catch (Exception e) {
e.printStackTrace();
if (HaloApp.isUserAcceptPrivacyPolicy(activity)) {
DataUtils.onResume(activity);
//FIXME 这里应该只是部分Activity需要
try {
// 初始化gameMap
DownloadManager.getInstance(activity).initGameMap();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void onActivityPaused(Activity activity) {
DataUtils.onPause(activity);
CurrentActivityHolder.getActivitySet().remove(activity);
if (HaloApp.isUserAcceptPrivacyPolicy(activity)) {
DataUtils.onPause(activity);
}
}
@Override

View File

@ -1,229 +1,229 @@
package com.gh.base
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
import android.text.TextUtils
import android.view.View
import androidx.core.app.NotificationCompat
import androidx.core.text.htmlEncode
import com.gh.common.notifier.Notifier
import com.gh.common.util.*
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.PushEntity
import com.gh.gamecenter.entity.PushMessageEntity
import com.gh.gamecenter.entity.PushMessageUnreadEntity
import com.gh.gamecenter.entity.PushNotificationEntity
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.message.MessageUnreadRepository
import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity
import com.gh.gamecenter.receiver.UmengMessageReceiver
import com.gh.gamecenter.receiver.UmengMessageReceiver.Companion.TYPE_CLICK
import com.gh.gamecenter.receiver.UmengMessageReceiver.Companion.TYPE_REMOVE
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.google.gson.Gson
import com.umeng.message.UmengMessageService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.RequestBody
import okhttp3.ResponseBody
import org.android.agoo.common.AgooConstants
import org.json.JSONObject
import retrofit2.HttpException
import java.util.*
class GHUmengNotificationService : UmengMessageService() {
companion object {
const val ACTION_UMENG = "com.gh.gamecenter.UMENG"
const val MESSAGE_FROM_SYSTEM = "message_from_system"
const val HALO_MESSAGE_DIALOG = "HALO_MESSAGE_DIALOG"
const val HALO_MESSAGE_CENTER = "HALO_MESSAGE_CENTER"
const val ANSWER = "answer"
const val FOLLOW_QUESTION = "follow_question"
const val NOTIFICATION_ID = 2015
const val DISPLAY_TYPE_NOTIFICATION = "notification"
const val DISPLAY_TYPE_CUSTOM = "custom"
const val MESSAGE_ID = "message_id"
const val NOTIFICATION_MESSAGE_ID = "notification_message_id" // 通知中心消息 ID
const val PUSH_ID = "push_id"
}
val notificationTags = arrayOf("GH_UMENG_TAG_1", "GH_UMENG_TAG_2", "GH_UMENG_TAG_3")
val gson = Gson()
override fun onMessage(context: Context, intent: Intent) {
val message = intent.getStringExtra(AgooConstants.MESSAGE_BODY)
val isMessageFromSystem = intent.getBooleanExtra(MESSAGE_FROM_SYSTEM, false)
try {
val pushData = message.toObject<PushEntity>()
pushData?.let { handlePushData(context, it, message, isMessageFromSystem) }
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun handlePushData(context: Context, pushData: PushEntity, message: String, isMessageFromSystem: Boolean) {
val notificationManager = context.applicationContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
if (pushData.displayType == DISPLAY_TYPE_NOTIFICATION) {
// 其它类型的透传信息
// 显示到通知栏
val msg = message.toObject<PushNotificationEntity>()
val data = msg?.extra?.data
// 系统推送(非自定义信息),直接处理跳转
if (isMessageFromSystem) {
val intent = Intent()
intent.setClass(context, UmengMessageReceiver::class.java)
intent.putExtra(EntranceUtils.KEY_DATA, data?.link)
intent.putExtra(EntranceUtils.KEY_TYPE, UmengMessageReceiver.DIRECT_ONLY)
intent.putExtra(EntranceUtils.KEY_MESSAGE, message)
intent.putExtra(NOTIFICATION_MESSAGE_ID, data?.messageId)
context.sendBroadcast(intent)
return
}
// 用户未登录的情况下不生成消息中心通知,避免用户掉登录了还收到跳转至消息中心的通知
if (data != null
&& data.link?.target == "system"
&& !UserManager.getInstance().isLoggedIn) {
return
}
val clickIntent = Intent()
val removeIntent = Intent()
clickIntent.setClass(context, UmengMessageReceiver::class.java)
clickIntent.putExtra(EntranceUtils.KEY_DATA, data?.link)
clickIntent.putExtra(EntranceUtils.KEY_MESSAGE, message)
clickIntent.putExtra(MESSAGE_ID, msg?.msgId)
clickIntent.putExtra(PUSH_ID, data?.pushId)
clickIntent.putExtra(NOTIFICATION_MESSAGE_ID, data?.messageId)
clickIntent.putExtra(EntranceUtils.KEY_TYPE, TYPE_CLICK)
removeIntent.setClass(context, UmengMessageReceiver::class.java)
removeIntent.putExtra(EntranceUtils.KEY_TYPE, TYPE_REMOVE)
removeIntent.putExtra(EntranceUtils.KEY_MESSAGE, message)
val clickPendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt(),
clickIntent, PendingIntent.FLAG_UPDATE_CURRENT)
val deletePendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt() + 1,
removeIntent, PendingIntent.FLAG_UPDATE_CURRENT)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel("Halo_Push", "Halo_Push", NotificationManager.IMPORTANCE_DEFAULT)
notificationManager.createNotificationChannel(channel)
}
val notification = NotificationCompat.Builder(context, "Halo_Push")
.setSmallIcon(R.drawable.ic_notification)
.setTicker(pushData.body?.ticker)
.setContentTitle(pushData.body?.title)
.setContentText(pushData.body?.text?.fromHtml())
.setContentIntent(clickPendingIntent)
.setDeleteIntent(deletePendingIntent)
.build()
notification.flags = notification.flags or Notification.FLAG_AUTO_CANCEL
notificationManager.notify(getNotificationTag(context), NOTIFICATION_ID, notification)
} else {
if (UserManager.getInstance().isLoggedIn &&
HALO_MESSAGE_DIALOG == pushData.body?.custom &&
MessageUnreadRepository.unreadLiveData.value != null) {
// 回答了问题或者关注了问题的消息
val msg = gson.fromJson(message, PushMessageEntity::class.java)
val data = msg?.extra?.data
val type = if (ANSWER == data?.type) {
"回答了你的问题"
} else {
"回答了你关注的问题"
}
val userName = StringUtils.shrinkStringWithDot(data?.userEntity?.name, 8)
val displayText = userName + type
if (Notifier.isActivityValid(CurrentActivityHolder.getCurrentActivity()) &&
Notifier.shouldShowNotifier(data?.answer?.id + displayText)) {
Notifier.create(CurrentActivityHolder.getCurrentActivity())
.setText(displayText)
.setDuration(5000)
.setIcon(data?.userEntity?.icon)
.setOnClickListener(View.OnClickListener {
val bundle = Bundle()
bundle.putString(EntranceUtils.KEY_ANSWER_ID, data?.answer?.id)
bundle.putString(EntranceUtils.KEY_ENTRANCE, EntranceUtils.ENTRANCE_UMENG)
bundle.putString(EntranceUtils.KEY_TO, AnswerDetailActivity::class.java.name)
EntranceUtils.jumpActivity(context, bundle)
MtaHelper.onEvent("消息弹窗", type, "Does not contains any parameter.")
// 标记已读
val jsonObject = JSONObject()
jsonObject.put("type", type)
val body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString())
RetrofitManager.getInstance(application).api.postMessageRead(UserManager.getInstance().userId, data?.id, body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
MessageUnreadRepository.loadMessageUnreadData()
}
override fun onFailure(e: HttpException?) {
e?.printStackTrace()
}
})
Notifier.hide()
})
.show(false)
Notifier.tagNotifierAsShowed(data?.answer?.id + displayText)
}
} else if (HALO_MESSAGE_CENTER == pushData.body?.custom) {
// 消息中心逻辑
val msg = gson.fromJson(message, PushMessageUnreadEntity::class.java)
val data = msg?.extra?.data
data?.let { MessageUnreadRepository.loadMessageUnreadData() }
}
}
}
/**
* 规则:最多三条消息,以旧换新
*
* @return NotificationTag
*/
private fun getNotificationTag(context: Context): String {
val sp = PreferenceManager.getDefaultSharedPreferences(context)
val edit = sp.edit()
val timeTagMap = HashMap<Long, String>()
for (tag in notificationTags) {
val time = sp.getLong(tag, 0)
if (time == 0L) {
edit.putLong(tag, System.currentTimeMillis()).apply()
return tag
} else {
timeTagMap[time] = tag
}
}
val minTime = Collections.min(timeTagMap.keys)
val tag = timeTagMap[minTime]
edit.putLong(tag, System.currentTimeMillis()).apply()
return if (TextUtils.isEmpty(tag)) notificationTags[0] else tag!!
}
}
//package com.gh.base
//
//import android.app.Notification
//import android.app.NotificationChannel
//import android.app.NotificationManager
//import android.app.PendingIntent
//import android.content.Context
//import android.content.Intent
//import android.os.Build
//import android.os.Bundle
//import android.preference.PreferenceManager
//import android.text.TextUtils
//import android.view.View
//import androidx.core.app.NotificationCompat
//import androidx.core.text.htmlEncode
//import com.gh.common.notifier.Notifier
//import com.gh.common.util.*
//import com.gh.gamecenter.R
//import com.gh.gamecenter.entity.PushEntity
//import com.gh.gamecenter.entity.PushMessageEntity
//import com.gh.gamecenter.entity.PushMessageUnreadEntity
//import com.gh.gamecenter.entity.PushNotificationEntity
//import com.gh.gamecenter.manager.UserManager
//import com.gh.gamecenter.message.MessageUnreadRepository
//import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity
//import com.gh.gamecenter.receiver.UmengMessageReceiver
//import com.gh.gamecenter.receiver.UmengMessageReceiver.Companion.TYPE_CLICK
//import com.gh.gamecenter.receiver.UmengMessageReceiver.Companion.TYPE_REMOVE
//import com.gh.gamecenter.retrofit.Response
//import com.gh.gamecenter.retrofit.RetrofitManager
//import com.google.gson.Gson
//import com.umeng.message.UmengMessageService
//import io.reactivex.android.schedulers.AndroidSchedulers
//import io.reactivex.schedulers.Schedulers
//import okhttp3.MediaType
//import okhttp3.RequestBody
//import okhttp3.ResponseBody
//import org.android.agoo.common.AgooConstants
//import org.json.JSONObject
//import retrofit2.HttpException
//import java.util.*
//
//class GHUmengNotificationService : UmengMessageService() {
//
// companion object {
// const val ACTION_UMENG = "com.gh.gamecenter.UMENG"
// const val MESSAGE_FROM_SYSTEM = "message_from_system"
// const val HALO_MESSAGE_DIALOG = "HALO_MESSAGE_DIALOG"
// const val HALO_MESSAGE_CENTER = "HALO_MESSAGE_CENTER"
// const val ANSWER = "answer"
// const val FOLLOW_QUESTION = "follow_question"
// const val NOTIFICATION_ID = 2015
// const val DISPLAY_TYPE_NOTIFICATION = "notification"
// const val DISPLAY_TYPE_CUSTOM = "custom"
// const val MESSAGE_ID = "message_id"
// const val NOTIFICATION_MESSAGE_ID = "notification_message_id" // 通知中心消息 ID
// const val PUSH_ID = "push_id"
// }
//
// val notificationTags = arrayOf("GH_UMENG_TAG_1", "GH_UMENG_TAG_2", "GH_UMENG_TAG_3")
// val gson = Gson()
//
// override fun onMessage(context: Context, intent: Intent) {
// val message = intent.getStringExtra(AgooConstants.MESSAGE_BODY)
// val isMessageFromSystem = intent.getBooleanExtra(MESSAGE_FROM_SYSTEM, false)
//
// try {
// val pushData = message.toObject<PushEntity>()
// pushData?.let { handlePushData(context, it, message, isMessageFromSystem) }
// } catch (e: Exception) {
// e.printStackTrace()
// }
// }
//
// private fun handlePushData(context: Context, pushData: PushEntity, message: String, isMessageFromSystem: Boolean) {
// val notificationManager = context.applicationContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
//
// if (pushData.displayType == DISPLAY_TYPE_NOTIFICATION) {
// // 其它类型的透传信息
// // 显示到通知栏
// val msg = message.toObject<PushNotificationEntity>()
// val data = msg?.extra?.data
//
// // 系统推送(非自定义信息),直接处理跳转
// if (isMessageFromSystem) {
// val intent = Intent()
// intent.setClass(context, UmengMessageReceiver::class.java)
// intent.putExtra(EntranceUtils.KEY_DATA, data?.link)
// intent.putExtra(EntranceUtils.KEY_TYPE, UmengMessageReceiver.DIRECT_ONLY)
// intent.putExtra(EntranceUtils.KEY_MESSAGE, message)
// intent.putExtra(NOTIFICATION_MESSAGE_ID, data?.messageId)
// context.sendBroadcast(intent)
// return
// }
//
// // 用户未登录的情况下不生成消息中心通知,避免用户掉登录了还收到跳转至消息中心的通知
// if (data != null
// && data.link?.link == "system"
// && !UserManager.getInstance().isLoggedIn) {
// return
// }
//
// val clickIntent = Intent()
// val removeIntent = Intent()
//
// clickIntent.setClass(context, UmengMessageReceiver::class.java)
// clickIntent.putExtra(EntranceUtils.KEY_DATA, data?.link)
// clickIntent.putExtra(EntranceUtils.KEY_MESSAGE, message)
// clickIntent.putExtra(MESSAGE_ID, msg?.msgId)
// clickIntent.putExtra(PUSH_ID, data?.pushId)
// clickIntent.putExtra(NOTIFICATION_MESSAGE_ID, data?.messageId)
// clickIntent.putExtra(EntranceUtils.KEY_TYPE, TYPE_CLICK)
//
// removeIntent.setClass(context, UmengMessageReceiver::class.java)
// removeIntent.putExtra(EntranceUtils.KEY_TYPE, TYPE_REMOVE)
// removeIntent.putExtra(EntranceUtils.KEY_MESSAGE, message)
//
// val clickPendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt(),
// clickIntent, PendingIntent.FLAG_UPDATE_CURRENT)
//
// val deletePendingIntent = PendingIntent.getBroadcast(context, System.currentTimeMillis().toInt() + 1,
// removeIntent, PendingIntent.FLAG_UPDATE_CURRENT)
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// val channel = NotificationChannel("Halo_Push", "Halo_Push", NotificationManager.IMPORTANCE_DEFAULT)
// notificationManager.createNotificationChannel(channel)
// }
//
// val notification = NotificationCompat.Builder(context, "Halo_Push")
// .setSmallIcon(R.drawable.ic_notification)
// .setTicker(pushData.body?.ticker)
// .setContentTitle(pushData.body?.title)
// .setContentText(pushData.body?.text?.fromHtml())
// .setContentIntent(clickPendingIntent)
// .setDeleteIntent(deletePendingIntent)
// .build()
// notification.flags = notification.flags or Notification.FLAG_AUTO_CANCEL
//
// notificationManager.notify(getNotificationTag(context), NOTIFICATION_ID, notification)
// } else {
// if (UserManager.getInstance().isLoggedIn &&
// HALO_MESSAGE_DIALOG == pushData.body?.custom &&
// MessageUnreadRepository.unreadLiveData.value != null) {
// // 回答了问题或者关注了问题的消息
// val msg = gson.fromJson(message, PushMessageEntity::class.java)
// val data = msg?.extra?.data
//
// val type = if (ANSWER == data?.type) {
// "回答了你的问题"
// } else {
// "回答了你关注的问题"
// }
//
// val userName = StringUtils.shrinkStringWithDot(data?.userEntity?.name, 8)
// val displayText = userName + type
//
// if (Notifier.isActivityValid(CurrentActivityHolder.getCurrentActivity()) &&
// Notifier.shouldShowNotifier(data?.answer?.id + displayText)) {
// Notifier.create(CurrentActivityHolder.getCurrentActivity())
// .setText(displayText)
// .setDuration(5000)
// .setIcon(data?.userEntity?.icon)
// .setOnClickListener(View.OnClickListener {
// val bundle = Bundle()
// bundle.putString(EntranceUtils.KEY_ANSWER_ID, data?.answer?.id)
// bundle.putString(EntranceUtils.KEY_ENTRANCE, EntranceUtils.ENTRANCE_UMENG)
// bundle.putString(EntranceUtils.KEY_TO, AnswerDetailActivity::class.java.name)
// EntranceUtils.jumpActivity(context, bundle)
//
// MtaHelper.onEvent("消息弹窗", type, "Does not contains any parameter.")
//
// // 标记已读
// val jsonObject = JSONObject()
// jsonObject.put("type", type)
// val body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString())
//
// RetrofitManager.getInstance(application).api.postMessageRead(UserManager.getInstance().userId, data?.id, body)
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(object : Response<ResponseBody>() {
// override fun onResponse(response: ResponseBody?) {
// super.onResponse(response)
// MessageUnreadRepository.loadMessageUnreadData()
// }
//
// override fun onFailure(e: HttpException?) {
// e?.printStackTrace()
// }
// })
// Notifier.hide()
// })
// .show(false)
// Notifier.tagNotifierAsShowed(data?.answer?.id + displayText)
// }
// } else if (HALO_MESSAGE_CENTER == pushData.body?.custom) {
// // 消息中心逻辑
// val msg = gson.fromJson(message, PushMessageUnreadEntity::class.java)
// val data = msg?.extra?.data
// data?.let { MessageUnreadRepository.loadMessageUnreadData() }
// }
// }
// }
//
// /**
// * 规则:最多三条消息,以旧换新
// *
// * @return NotificationTag
// */
// private fun getNotificationTag(context: Context): String {
// val sp = PreferenceManager.getDefaultSharedPreferences(context)
// val edit = sp.edit()
//
// val timeTagMap = HashMap<Long, String>()
// for (tag in notificationTags) {
// val time = sp.getLong(tag, 0)
// if (time == 0L) {
// edit.putLong(tag, System.currentTimeMillis()).apply()
// return tag
// } else {
// timeTagMap[time] = tag
// }
// }
//
// val minTime = Collections.min(timeTagMap.keys)
// val tag = timeTagMap[minTime]
// edit.putLong(tag, System.currentTimeMillis()).apply()
// return if (TextUtils.isEmpty(tag)) notificationTags[0] else tag!!
// }
//}

View File

@ -14,8 +14,14 @@ import android.view.Window;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.MtaHelper;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.DownloadManagerActivity;
import com.gh.gamecenter.R;
@ -32,13 +38,6 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
/**
* 需要用到工具栏的页面使用
* <p>
@ -50,7 +49,7 @@ public abstract class ToolBarActivity extends BaseActivity implements ToolbarCon
@Nullable
private PackageViewModel mPackageViewModel;
protected RelativeLayout mToolbarContainer;
protected View mToolbarContainer;
protected Toolbar mToolbar;
@ -239,7 +238,7 @@ public abstract class ToolBarActivity extends BaseActivity implements ToolbarCon
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.menu_download) {
MtaHelper.onEvent("下载管理", "下载管理入口", getActivityNameInChinese());
// MtaHelper.onEvent("下载管理", "下载管理入口", getActivityNameInChinese());
Intent intent = DownloadManagerActivity.getDownloadMangerIntent(this, mEntrance);
startActivity(intent);
}

View File

@ -4,16 +4,20 @@ import android.app.Dialog;
import android.os.Bundle;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Lifecycle;
import com.gh.common.util.ClickUtils;
import com.gh.gamecenter.R;
import com.lightgame.utils.RuntimeUtils;
import com.lightgame.utils.Utils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
/**
* @author CsHeng
* @Date 17/05/2017
@ -58,6 +62,18 @@ public class BaseDialogFragment extends DialogFragment {
public boolean onBack() {
return false;
}
@Override
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
Fragment fragment = manager.findFragmentByTag(tag);
if (fragment != null) {
FragmentTransaction transaction = manager.beginTransaction();
transaction.show(fragment);
transaction.commit();
} else {
super.show(manager, tag);
}
}
}

View File

@ -9,6 +9,14 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import com.gh.base.OnListClickListener;
import com.gh.base.OnRequestCallBackListener;
import com.gh.common.constant.Constants;
@ -29,13 +37,6 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.ButterKnife;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
@ -210,6 +211,13 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
return mCachedView;
}
@Override
public void onDestroyView() {
super.onDestroyView();
mCachedView = null;
}
@Override
public void onResume() {
super.onResume();

View File

@ -3,15 +3,6 @@ package com.gh.base.fragment;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckedTextView;
@ -21,6 +12,7 @@ import com.gh.base.adapter.FragmentAdapter;
import com.gh.common.view.TabIndicatorView;
import com.gh.gamecenter.R;
import com.gh.gamecenter.normal.NormalFragment;
import com.google.android.material.tabs.TabLayout;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Utils;
import com.lightgame.view.NoScrollableViewPager;
@ -28,6 +20,10 @@ import com.lightgame.view.NoScrollableViewPager;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
/**
@ -83,10 +79,27 @@ public abstract class BaseFragment_TabLayout extends NormalFragment implements V
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) mCheckedIndex = getArguments().getInt(PAGE_INDEX, 0);
mFragmentsList = new ArrayList<>();
initFragmentList(mFragmentsList);
mTabTitleList = new ArrayList<>();
initTabTitleList(mTabTitleList);
mFragmentsList = new ArrayList<>(restoreFragments());
if (mFragmentsList.isEmpty() || mFragmentsList.size() != mTabTitleList.size()) {
mFragmentsList.clear();
initFragmentList(mFragmentsList);
}
}
private ArrayList<Fragment> restoreFragments() {
String tag = "android:switcher:" + mViewPager.getId() + ":";
ArrayList<Fragment> fragments = new ArrayList<>();
int childCount = mTabTitleList.size();
for (int index = 0; index < childCount; index++) {
Fragment fragment = getChildFragmentManager().findFragmentByTag(tag + index);
if (fragment != null) {
fragments.add(fragment);
}
}
return fragments;
}
@Override

View File

@ -1,30 +1,27 @@
package com.gh.base.fragment
import android.content.Intent
import android.graphics.Typeface
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.widget.CheckedTextView
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import butterknife.BindView
import com.gh.base.adapter.FragmentAdapter
import com.gh.common.view.TabIndicatorView
import com.gh.gamecenter.R
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import com.lightgame.view.NoScrollableViewPager
import java.util.*
abstract class BaseLazyTabFragment : BaseLazyFragment(), ViewPager.OnPageChangeListener {
@BindView(R.id.fragment_tab_layout)
lateinit var mTabLayout: TabLayout
@BindView(R.id.fragment_view_pager)
lateinit var mViewPager: NoScrollableViewPager
@BindView(R.id.fragment_tab_indicator)
lateinit var mTabIndicatorView: TabIndicatorView
@ -66,15 +63,26 @@ abstract class BaseLazyTabFragment : BaseLazyFragment(), ViewPager.OnPageChangeL
if (arguments != null) mCheckedIndex = requireArguments().getInt(PAGE_INDEX, 0)
}
open fun providePagerAdapter(): PagerAdapter? {
return null
}
override fun onFragmentFirstVisible() {
super.onFragmentFirstVisible()
mTabTitleList.clear()
mFragmentsList.clear()
initFragmentList(mFragmentsList)
initTabTitleList(mTabTitleList)
mFragmentsList.addAll(restoreFragments())
if (mFragmentsList.isEmpty() || mFragmentsList.size != mTabTitleList.size) {
mFragmentsList.clear()
initFragmentList(mFragmentsList)
}
mViewPager.offscreenPageLimit = mFragmentsList.size
mViewPager.addOnPageChangeListener(this)
mViewPager.adapter = FragmentAdapter(childFragmentManager, mFragmentsList, mTabTitleList)
mViewPager.adapter = providePagerAdapter()
?: FragmentAdapter(childFragmentManager, mFragmentsList, mTabTitleList)
mViewPager.currentItem = mCheckedIndex
mTabLayout.setupWithViewPager(mViewPager)
mTabIndicatorView.setupWithTabLayout(mTabLayout)
@ -84,60 +92,23 @@ abstract class BaseLazyTabFragment : BaseLazyFragment(), ViewPager.OnPageChangeL
val tab = mTabLayout.getTabAt(i) ?: continue
val tabTitle = if (tab.text != null) tab.text.toString() else ""
var tabView = provideTabView(i, tabTitle)
if (tabView == null) tabView = createDefaultTabCustomView(tabTitle)
if (tabView == null) tabView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle)
tab.customView = tabView
}
initTabStyle(mTabLayout, mCheckedIndex)
BaseFragment_TabLayout.initTabStyle(mTabLayout, mCheckedIndex)
}
open fun initTabStyle(tabLayout: TabLayout?, currentItem: Int) { // 默认选择addOnTabSelectedListener不会回调
val tabCount = tabLayout!!.tabCount
if (tabCount > 0) {
val tab = tabLayout.getTabAt(currentItem)
if (tab != null) updateTabStyle(tab, true)
}
tabLayout.addOnTabSelectedListener(object : OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab) {
updateTabStyle(tab, true)
private fun restoreFragments(): ArrayList<Fragment> {
val tag = "android:switcher:${mViewPager.id}:"
val fragments = ArrayList<Fragment>()
val childCount = mTabTitleList.size
for (index in 0 until childCount) {
val fragment = childFragmentManager.findFragmentByTag("$tag$index")
if (fragment != null) {
fragments.add(fragment)
}
override fun onTabUnselected(tab: TabLayout.Tab) {
updateTabStyle(tab, false)
}
override fun onTabReselected(tab: TabLayout.Tab) {
updateTabStyle(tab, true)
}
})
}
open fun updateTabStyle(tab: TabLayout.Tab, isChecked: Boolean) {
val tabView = tab.customView
if (tabView == null) {
Utils.log("TabLayout->Tab样式不是通用样式,请检查")
return
}
val tabTitle: TextView?
tabTitle = if (tabView is TextView) {
tabView
} else {
tabView.findViewById(R.id.tab_title)
}
if (tabTitle == null) {
Utils.log("TabLayout->Tab样式不是通用样式,请检查")
return
}
tabTitle.typeface = if (isChecked) Typeface.DEFAULT_BOLD else Typeface.DEFAULT
}
// 如果不设置View的话无法动态设置字体样式
open fun createDefaultTabCustomView(title: String?): View {
val view = LayoutInflater.from(HaloApp.getInstance().application.baseContext).inflate(R.layout.tab_item, null)
val tabTitle = view.findViewById<View>(R.id.tab_title)
if (tabTitle is CheckedTextView) {
tabTitle.text = title
}
return view
return fragments
}
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {}

View File

@ -81,8 +81,13 @@ public class WaitingDialogFragment extends BaseDialogFragment {
@Override
public void dismiss() {
dismissAllowingStateLoss();
}
@Override
public void dismissAllowingStateLoss() {
mBackListener = null;
super.dismiss();
super.dismissAllowingStateLoss();
}
public static class WaitingDialogData {

View File

@ -5,6 +5,7 @@ import android.os.Looper
import com.gh.common.AppExecutor.ioExecutor
import com.gh.common.AppExecutor.lightWeightIoExecutor
import com.gh.common.AppExecutor.uiExecutor
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.Executor
import java.util.concurrent.Executors
@ -25,6 +26,8 @@ object AppExecutor {
@JvmStatic
val ioExecutor = Executors.newCachedThreadPool() // 用 by lazy 可能影响初始化速度
val cachedScheduler by lazy { Schedulers.from(ioExecutor) }
class MainThreadExecutor : Executor {
private val mainThreadHandler = Handler(Looper.getMainLooper())

View File

@ -1,21 +1,28 @@
package com.gh.common
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.webkit.JavascriptInterface
import androidx.annotation.Keep
import androidx.appcompat.app.AppCompatActivity
import com.gh.base.CurrentActivityHolder
import com.gh.common.constant.Constants
import com.gh.common.util.*
import com.gh.common.view.dsbridge.CompletionHandler
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.LoginActivity
import com.gh.gamecenter.ViewImageActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.entity.Badge
import com.gh.gamecenter.entity.MtaEvent
import com.gh.gamecenter.entity.NotificationUgc
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.room.AppDatabase
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.user.LoginTag
import com.gh.gamecenter.user.UserRepository
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
@ -23,7 +30,8 @@ import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import org.json.JSONObject
import retrofit2.HttpException
import wendu.dsbridge.CompletionHandler
import java.util.*
import kotlin.collections.ArrayList
class DefaultJsApi(var context: Context) {
@ -46,7 +54,7 @@ class DefaultJsApi(var context: Context) {
@JavascriptInterface
fun getUserInfo(msg: Any): String {
return UserManager.getInstance().userInfoEntity.toJson()
return UserManager.getInstance().userInfoEntity?.toJson() ?: ""
}
@JavascriptInterface
@ -65,12 +73,11 @@ class DefaultJsApi(var context: Context) {
val userInfoEntity = UserManager.getInstance().userInfoEntity
if (msg.toString().isNotEmpty()) {
val badge = msg.toString().toObject() ?: Badge()
userInfoEntity.badge = badge
userInfoEntity?.badge = badge
} else {
userInfoEntity.badge = null
userInfoEntity?.badge = null
}
UserManager.getInstance().userInfoEntity = userInfoEntity
AppDatabase.getInstance(context).userInfoDao().updateUserInfo(userInfoEntity)
}
@JavascriptInterface
@ -83,6 +90,11 @@ class DefaultJsApi(var context: Context) {
return BuildConfig.VERSION_NAME
}
@JavascriptInterface
fun getAppVersionCode(msg: Any): Int {
return PackageUtils.getVersionCode()
}
@JavascriptInterface
fun bindWechat(msg: Any, handler: CompletionHandler<Any>) {
context.ifLogin("浏览器") {
@ -139,7 +151,21 @@ class DefaultJsApi(var context: Context) {
val context = CurrentActivityHolder.getCurrentActivity()
context?.startActivity(ViewImageActivity.getViewImageIntent(context, imageEvent.imageList, imageEvent.position, "浏览器"))
context?.startActivity(ImageViewerActivity.getIntent(context, imageEvent.imageList, imageEvent.position, "浏览器"))
}
@JavascriptInterface
fun isInstalled(event: Any): String {
val localInstalledPackageList = PackageUtils.getAllPackageName(HaloApp.getInstance().application)
val packageNameList: ArrayList<String> = event.toString().toObject() ?: ArrayList()
for (packageName in packageNameList) {
if (!localInstalledPackageList.contains(packageName)) {
return "false"
}
}
return "true"
}
@JavascriptInterface
@ -148,10 +174,93 @@ class DefaultJsApi(var context: Context) {
Base64ImageHolder.image = event.toString()
context?.startActivity(ViewImageActivity.getBase64ViewImageIntent(context, true))
context?.startActivity(ImageViewerActivity.getBase64Intent(context, true))
}
@JavascriptInterface
fun openNotificationSetting(msg: Any) {
NotificationHelper.show(context as AppCompatActivity, NotificationUgc.LOGIN)
}
@JavascriptInterface
fun useDarkStatusBarText(msg: Any) {
runOnUiThread {
DisplayUtils.transparentStatusBar(context as AppCompatActivity)
DisplayUtils.setLightStatusBar(context as AppCompatActivity, msg.toString() == "true")
}
}
@JavascriptInterface
fun exitWebView(msg: Any) {
runOnUiThread { (context as Activity).finish() }
}
@JavascriptInterface
fun updateRegulationTestStatus(msg: Any) {
if (msg.toString().toLowerCase(Locale.getDefault()) == "pass") {
SPUtils.setString(Constants.SP_REGULATION_TEST_PASS_STATUS, "pass")
}
}
@JavascriptInterface
fun getStatusBarHeight(msg: Any): String {
val statusBarHeight = DisplayUtils.getStatusBarHeight(context.resources)
return "$statusBarHeight"
}
@JavascriptInterface
fun getGid(msg: Any): String {
return HaloApp.getInstance().gid
}
@JavascriptInterface
fun showIncompatibleVersionDialog(msg: Any) {
DialogUtils.showLowVersionDialog(context)
}
@JavascriptInterface
fun shareBase64Image(event: Any) {
val imageShareEvent = event.toString().toObject() ?: ImageShareEvent()
val context = CurrentActivityHolder.getCurrentActivity()
Base64ImageHolder.image = imageShareEvent.image.run {
if (this.startsWith("data:image/png;base64")) this.split(",")[1] else this
}
MessageShareUtils.getInstance(context).shareFromWeb(context, imageShareEvent.type)
}
@JavascriptInterface
fun bindPhone(msg: Any) {
val intent = BindPhoneActivity.getNormalIntent(context, false)
context.startActivity(intent)
}
@JavascriptInterface
fun updateTitle(msg: Any) {
if (context is WebActivity) {
runOnUiThread { (context as WebActivity).setNavigationTitle(msg.toString()) }
}
}
@JavascriptInterface
fun logoutExitWebViewAndRedirectToLogin() {
UserRepository.getInstance(context).logout()
if (context is Activity) {
AppExecutor.uiExecutor.executeWithDelay(Runnable {
context.ifLogin("内部网页")
(context as Activity).finish()
}, 100)
}
}
@JavascriptInterface
fun openInNewWebview(url: Any) {
runOnUiThread { DirectUtils.directToWebView(context, url.toString(), "内部网页") }
}
@Keep
internal data class ImageEvent(var imageList: ArrayList<String> = arrayListOf(), var position: Int = 0)
@Keep
internal data class ImageShareEvent(var image: String = "", var type: String = "")
}

View File

@ -0,0 +1,419 @@
package com.gh.common
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import android.util.Base64
import com.gh.common.util.*
import com.gh.common.util.DirectUtils.directToFeedback
import com.gh.common.util.DirectUtils.directToGameDetailVideoStreaming
import com.gh.common.util.DirectUtils.directToGameServerCalendar
import com.gh.common.util.DirectUtils.directToGameVideo
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.DirectUtils.directToQa
import com.gh.common.util.DirectUtils.directToVideoDetail
import com.gh.common.util.GsonUtils.gson
import com.gh.gamecenter.LibaoDetailActivity
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.NewsDetailActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
import com.lightgame.utils.Utils
import java.nio.charset.Charset
object DefaultUrlHandler {
@JvmStatic
fun interceptUrl(context: Context, url: String, entrance: String): Boolean {
val uri = Uri.parse(url)
if ("ghzhushou" == uri.scheme) {
Utils.log("url = $url")
Utils.log("url = " + uri.scheme!!)
val host = uri.host
val path = uri.path
var id = ""
if (!TextUtils.isEmpty(path)) {
id = path!!.substring(1)
}
val intent: Intent
when (host) {
"article" -> context.startActivity(NewsDetailActivity.getIntentById(context, id, entrance))
"game" -> DirectUtils.directToGameDetail(context, id = id, tab = uri.getQueryParameter("to"), autoDownload = uri.getQueryParameter("auto_download") == "true", entrance = entrance)
"column" -> SubjectActivity.startSubjectActivity(context, id, uri.getQueryParameter("name"), false, entrance)
"libao" -> context.startActivity(LibaoDetailActivity.getIntentById(context, id, entrance))
"qq" -> try {
DirectUtils.directToQqConversation(context, id)
} catch (e: Throwable) {
Utils.toast(context, "请检查是否已经安装手机QQ")
e.printStackTrace()
}
EntranceUtils.HOST_QQ_QUN -> {
val key = uri.getQueryParameter("key")
if (!DirectUtils.directToQqGroup(context, key)) {
Utils.toast(context, "请检查是否已经安装手机QQ")
}
}
"inurl" -> {
intent = Intent(context, WebActivity::class.java)
intent.putExtra(EntranceUtils.KEY_URL, uri.getQueryParameter("url"))
context.startActivity(intent)
}
"outurl" -> {
intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.data = Uri.parse(uri.getQueryParameter("url"))
try {
context.startActivity(intent)
} catch (e: Exception) {
Utils.toast(context, "请检查是否已经安装手机浏览器")
e.printStackTrace()
}
}
"question" -> DirectUtils.directToQuestionDetail(context, id, entrance, "文章链接")
"community" -> {
val community = CommunityEntity()
community.id = id
community.name = uri.getQueryParameter("name") ?: ""
DirectUtils.directToCommunity(context, community)
}
"community_column" -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val columnId = uri.getQueryParameter("column_id") ?: ""
DirectUtils.directToCommunityColumn(context, community, columnId, entrance, "文章链接")
}
"answer" -> DirectUtils.directToAnswerDetail(context, id, entrance, "文章链接")
"communities" -> {
// ghzhushou://communities/5a32405b2397ab000f688de3/articles/5c99d262c140b321564f04e3
var communityId = ""
var type = ""
var typeId = ""
val split = id.split("/".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
for (text in split) {
if (TextUtils.isEmpty(communityId)) {
communityId = text
continue
}
if (TextUtils.isEmpty(type)) {
type = text
continue
}
if (TextUtils.isEmpty(typeId)) {
typeId = text
}
}
if ("articles" == type) {
DirectUtils.directToCommunityArticle(
context, typeId, communityId,
entrance, "文章链接")
}
}
EntranceUtils.HOST_UPLOAD_VIDEO -> {
val titleParameter = uri.getQueryParameter("title")
val title = if (titleParameter.isNullOrEmpty()) "" else "#$titleParameter#"
val categoryId = uri.getQueryParameter("category_id") ?: ""
val link = uri.getQueryParameter("link") ?: ""
val gameId = uri.getQueryParameter("gameId") ?: ""
val gameName = uri.getQueryParameter("gameName") ?: ""
val tagActivityId = uri.getQueryParameter("tagActivityId") ?: ""
val tagActivityName = uri.getQueryParameter("tagActivityName") ?: ""
val linkEntity = VideoLinkEntity(title, categoryId, link, tagActivityId, tagActivityName)
val simpleGameEntity = SimpleGameEntity(gameId, gameName)
CheckLoginUtils.checkLogin(context, null, true, EntranceUtils.ENTRANCE_BROWSER) {
DirectUtils.directToVideoManager(context, linkEntity, simpleGameEntity, EntranceUtils.ENTRANCE_BROWSER, "")
}
}
EntranceUtils.HOST_USERHOME -> {
val position = uri.getQueryParameter("position")
DirectUtils.directToHomeActivity(context, id, if (position.isNullOrEmpty()) -1 else position.toInt(), entrance, "")
}
EntranceUtils.HOST_VIDEO_MORE -> {
val referer = uri.getQueryParameter("referer") ?: ""
val type = uri.getQueryParameter("type") ?: ""
val act = uri.getQueryParameter("act") ?: ""
val gameId = uri.getQueryParameter("gameId") ?: ""
val fieldId = uri.getQueryParameter("fieldId") ?: ""
val sectionName = uri.getQueryParameter("sectionName") ?: ""
val paginationType = uri.getQueryParameter("paginationType")
?: "page"//活动分页方式 page filter
val location = if (!TextUtils.isEmpty(act)) {
VideoDetailContainerViewModel.Location.VIDEO_ACTIVITY.value
} else if (!TextUtils.isEmpty(fieldId)) {
VideoDetailContainerViewModel.Location.GAME_ZONE.value
} else {
id
}
directToVideoDetail(context, id, location, false, gameId, entrance, "", referer, type, act, paginationType, fieldId, sectionName)
}
EntranceUtils.HOST_VIDEO_SINGLE -> {
val referer = uri.getQueryParameter("referer") ?: ""
directToVideoDetail(context, id, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.value,
false, "", entrance, "", if (TextUtils.isEmpty(referer)) "" else referer)
}
EntranceUtils.HOST_VIDEO_STREAMING_HOME -> {
intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
intent.putExtra(MainActivity.SWITCH_TO_VIDEO, true)
context.startActivity(intent)
}
EntranceUtils.HOST_VIDEO_STREAMING_DESC -> {
directToGameDetailVideoStreaming(context, id, entrance)
}
EntranceUtils.HOST_VIDEO_COLLECTION -> {
directToGameVideo(context, id, entrance, "")
}
EntranceUtils.HOST_CATEGORY -> {
val title = uri.getQueryParameter("title")
DirectUtils.directCategoryDirectory(context, id, title ?: "", entrance, "")
}
EntranceUtils.HOST_COLUMN_COLLECTION -> {
val name = uri.getQueryParameter("name")
DirectUtils.directToColumnCollection(context, id, -1, entrance, name ?: "")
}
EntranceUtils.HOST_COLUMN -> {
DirectUtils.directToSubject(context, id, uri.getQueryParameter(EntranceUtils.KEY_NAME), entrance)
}
EntranceUtils.HOST_COMMUNITY_QUESTION_LABEL_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val tag = uri.getQueryParameter("tag") ?: ""
DirectUtils.directAskColumnLabelDetail(context, tag, community, entrance, "")
}
EntranceUtils.HOST_COMMUNITY_COLUMN_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val columnId = uri.getQueryParameter("column_id") ?: ""
DirectUtils.directAskColumnDetail(context, columnId, community, entrance, "")
}
EntranceUtils.HOST_BLOCK -> {
val name = uri.getQueryParameter("name")
?: ""
val entity = SubjectRecommendEntity(link = id, name = name, text = name)
DirectUtils.directToBlock(context, entity, entrance)
}
EntranceUtils.HOST_SERVER_BLOCK -> {
DirectUtils.directToGameServers(context, entrance = entrance, path = "")
}
EntranceUtils.HOST_AMWAY_BLOCK -> {
DirectUtils.directToAmway(context, entrance = entrance, path = "")
}
EntranceUtils.HOST_HELP -> {
val name = uri.getQueryParameter("name")
?: ""
DirectUtils.directToQa(context, name, id)
}
EntranceUtils.HOST_HELP_COLLECTION -> {
val name = uri.getQueryParameter("name")
?: ""
DirectUtils.directToQaCollection(context, name, id)
}
EntranceUtils.HOST_GAME_UPLOAD -> {
DirectUtils.directGameUpload(context, entrance = entrance, path = "")
}
EntranceUtils.HOST_GAME_ZONE -> {
val zoneUrl = uri.getQueryParameter("url") ?: ""
DirectUtils.directGameZone(context, id, zoneUrl, entrance)
}
EntranceUtils.HOST_LINK -> {
try {
val dataString = uri.getQueryParameter("data")
if (!TextUtils.isEmpty(dataString)) {
val linkData = Base64.decode(dataString, Base64.DEFAULT)
val linkDataString = String(linkData, Charset.defaultCharset())
val le = gson.fromJson(linkDataString, LinkEntity::class.java)
directToLinkPage(context, le, entrance, "")
}
} catch (e: Exception) {
e.printStackTrace()
}
}
EntranceUtils.HOST_GAME_NEWS -> {
DirectUtils.directToGameNews(
context,
uri.getQueryParameter(EntranceUtils.KEY_GAME_ID),
uri.getQueryParameter(EntranceUtils.KEY_GAME_NAME),
entrance);
}
EntranceUtils.HOST_GAME_CALENDAR -> {
directToGameServerCalendar(context, uri.getQueryParameter(EntranceUtils.KEY_GAME_ID))
}
EntranceUtils.HOST_HISTORY_APK -> {
DirectUtils.directToHistoryApk(context, uri.getQueryParameter(EntranceUtils.KEY_GAME_ID))
}
EntranceUtils.HOST_FORUM_DETAIL -> {
DirectUtils.directForumDetail(context, id, entrance)
}
EntranceUtils.HOST_GAME_RATING_DETAIL -> {
DirectUtils.directToGameRatingDetail(context, uri.getQueryParameter(EntranceUtils.KEY_GAME_ID), uri.getQueryParameter(EntranceUtils.KEY_COMMENT_ID), EntranceUtils.ENTRANCE_BROWSER)
}
EntranceUtils.HOST_FORUM -> {
DirectUtils.directToForum(context)
}
EntranceUtils.HOST_SUGGESTION -> {
val platform = uri.getQueryParameter(EntranceUtils.KEY_PLATFORM)
val platformName = PlatformUtils.getInstance(context).getPlatformName(platform)
val gameId = uri.getQueryParameter(EntranceUtils.KEY_GAMEID)
val packageMd5 = uri.getQueryParameter(EntranceUtils.KEY_PACKAGE_MD5)
val content = if (TextUtils.isEmpty(gameId) || TextUtils.isEmpty(packageMd5)) String.format("%s-%s-V%s",
uri.getQueryParameter(EntranceUtils.KEY_GAME_NAME),
if (TextUtils.isEmpty(platformName)) platform else platformName,
uri.getQueryParameter(EntranceUtils.KEY_VERSION)) else String.format("%s-%s-V%s\n游戏ID%s\n游戏包MD5%s\n",
uri.getQueryParameter(EntranceUtils.KEY_GAME_NAME),
if (TextUtils.isEmpty(platformName)) platform else platformName,
uri.getQueryParameter(EntranceUtils.KEY_VERSION), gameId, packageMd5)
val qaId = uri.getQueryParameter("qa_id") ?: ""
val qaTitle = uri.getQueryParameter(EntranceUtils.KEY_QA_TITLE)
if (!TextUtils.isEmpty(qaId)) {
directToQa(context, qaTitle, qaId)
} else {
directToFeedback(context, content, EntranceUtils.ENTRANCE_BROWSER)
}
}
EntranceUtils.HOST_HELP_AND_FEEDBACK -> {
val position = uri.getQueryParameter("position") ?: ""
DirectUtils.directToHelpAndFeedback(context, position.toInt())
}
else -> DialogUtils.showLowVersionDialog(context)
}
return true
} else if ("zhiqu" == uri.scheme) {
if (PackageUtils.isInstalled(context, "com.beieryouxi.zqyxh")) {
val intent = Intent()
intent.data = Uri.parse(url)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
} else {
Utils.toast(context, "请安装指趣游戏盒")
}
}
if (url.startsWith("alipays:") || url.startsWith("alipay")) {
try {
context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(url)))
} catch (e: Exception) {
ToastUtils.showToast("请安装支付宝客户端")
}
return true
} else if (url.startsWith("weixin")) {
try {
context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(url)))
} catch (e: Exception) {
ToastUtils.showToast("请安装微信客户端")
}
return true
} else if (url.startsWith("mqqwpa")) {
try {
context.startActivity(Intent("android.intent.action.VIEW", Uri.parse(url)))
} catch (e: Exception) {
ToastUtils.showToast("请安装QQ客户端")
}
return true
}
if ("http" != uri.scheme && "https" != uri.scheme) return true
return false
}
@JvmStatic
fun transformNormalScheme(context: Context, url: String, entrance: String): Boolean {
val uri = Uri.parse(url)
if (uri.host == "www.ghzs666.com"
|| uri.host == "www.ghzs.com"
|| uri.host == "ask.ghzs.com"
|| uri.host == "m.ghzs.com"
|| uri.host == "m.ghzs666.com") {
Utils.log(uri.path)
uri.path?.apply {
when {
contains("game") -> {
val gameId = uri.getQueryParameter("gameId") ?: ""
DirectUtils.directToGameDetail(context, gameId, entrance, autoDownload = false, traceEvent = null)
}
contains("question") -> {
val questionId = split("/")[2]
val answerId = uri.getQueryParameter("answer")
if (answerId.isNullOrEmpty()) {
DirectUtils.directToQuestionDetail(context, questionId, entrance, "")
} else {
DirectUtils.directToAnswerDetail(context, answerId, entrance, "")
}
}
contains("communities") && contains("article") -> {
var communityId = ""
var type = ""
var typeId = ""
val split = replace("/communities", "").replace(".html", "").split("/".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
for (text in split) {
if (TextUtils.isEmpty(communityId)) {
communityId = text
continue
}
if (TextUtils.isEmpty(type)) {
type = text
continue
}
if (TextUtils.isEmpty(typeId)) {
typeId = text
}
}
if ("articles" == type) {
DirectUtils.directToCommunityArticle(
context, typeId, communityId,
entrance, "文章链接")
}
}
contains("article") -> {
val articleId = split("/")[2].replace(".html", "")
DirectUtils.directToArticle(context, articleId, entrance)
}
contains("columns") -> {
val columnsId = split("/")[3]
val id = uri.getQueryParameter("communityId") ?: ""
val name = uri.getQueryParameter("communityName") ?: ""
DirectUtils.directToCommunityColumn(context, CommunityEntity(id, name), columnsId, entrance, "")
}
contains("zone") -> {
val gameId = split("/")[2]
DirectUtils.directGameZone(context, gameId, url, entrance)
}
}
}
return true
}
return false
}
}

View File

@ -1,196 +0,0 @@
package com.gh.common
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import com.gh.common.util.CheckLoginUtils
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.DirectUtils.directToGameDetailVideoStreaming
import com.gh.common.util.DirectUtils.directToGameVideo
import com.gh.common.util.DirectUtils.directToVideoDetail
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.*
import com.gh.gamecenter.entity.CommunityEntity
import com.gh.gamecenter.entity.VideoLinkEntity
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
import com.lightgame.utils.Utils
object DefaultWebViewUrlHandler {
@JvmStatic
fun interceptUrl(context: Context, url: String, entrance: String): Boolean {
val uri = Uri.parse(url)
if ("ghzhushou" == uri.scheme) {
Utils.log("url = $url")
Utils.log("url = " + uri.scheme!!)
val host = uri.host
val path = uri.path
var id = ""
if (!TextUtils.isEmpty(path)) {
id = path!!.substring(1)
}
val intent: Intent
when (host) {
"article" -> context.startActivity(NewsDetailActivity.getIntentById(context, id, entrance))
"game" -> GameDetailActivity.startGameDetailActivity(context, id, "libao" == uri.getQueryParameter("to"), entrance)
"column" -> SubjectActivity.startSubjectActivity(context, id, uri.getQueryParameter("name"), false, entrance)
"libao" -> context.startActivity(LibaoDetailActivity.getIntentById(context, id, entrance))
"qq" -> try {
DirectUtils.directToQqConversation(context, id)
} catch (e: Throwable) {
Utils.toast(context, "请检查是否已经安装手机QQ")
e.printStackTrace()
}
"qqqun" -> {
val key = uri.getQueryParameter("key")
if (!DirectUtils.directToQqGroup(context, key)) {
Utils.toast(context, "请检查是否已经安装手机QQ")
}
}
"inurl" -> {
intent = Intent(context, WebActivity::class.java)
intent.putExtra(EntranceUtils.KEY_URL, uri.getQueryParameter("url"))
context.startActivity(intent)
}
"outurl" -> {
intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.data = Uri.parse(uri.getQueryParameter("url"))
try {
context.startActivity(intent)
} catch (e: Exception) {
Utils.toast(context, "请检查是否已经安装手机浏览器")
e.printStackTrace()
}
}
"question" -> DirectUtils.directToQuestionDetail(context, id, entrance, "文章链接")
"community" -> {
val community = CommunityEntity()
community.id = id
community.name = uri.getQueryParameter("name") ?: ""
DirectUtils.directToCommunity(context, community)
}
"community_column" -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val columnId = uri.getQueryParameter("column_id") ?: ""
DirectUtils.directToCommunityColumn(context, community, columnId, entrance, "文章链接")
}
"answer" -> DirectUtils.directToAnswerDetail(context, id, entrance, "文章链接")
"communities" -> {
// ghzhushou://communities/5a32405b2397ab000f688de3/articles/5c99d262c140b321564f04e3
var communityId = ""
var type = ""
var typeId = ""
val split = id.split("/".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
for (text in split) {
if (TextUtils.isEmpty(communityId)) {
communityId = text
continue
}
if (TextUtils.isEmpty(type)) {
type = text
continue
}
if (TextUtils.isEmpty(typeId)) {
typeId = text
}
}
if ("articles" == type) {
DirectUtils.directToCommunityArticle(
context, typeId, communityId,
entrance, "文章链接")
}
}
EntranceUtils.HOST_UPLOAD_VIDEO -> {
val titleParameter = uri.getQueryParameter("title")
val title = if (titleParameter.isNullOrEmpty()) "" else "#$titleParameter#"
val categoryId = uri.getQueryParameter("category_id") ?: ""
val link = uri.getQueryParameter("link") ?: ""
val linkEntity = VideoLinkEntity(title, categoryId, link)
// if (!CheckLoginUtils.isLogin()) {
// HaloApp.put(EntranceUtils.HOST_UPLOAD_VIDEO, linkEntity)
// }
CheckLoginUtils.checkLogin(context, null, true, EntranceUtils.ENTRANCE_BROWSER) {
DirectUtils.directToVideoManager(context, linkEntity, EntranceUtils.ENTRANCE_BROWSER, "")
}
}
EntranceUtils.HOST_USERHOME -> {
val position = uri.getQueryParameter("position")
DirectUtils.directToHomeActivity(context, id, if (position.isNullOrEmpty()) -1 else position.toInt(), entrance, "")
}
EntranceUtils.HOST_VIDEO_MORE -> {
val referer = uri.getQueryParameter("referer") ?: ""
val type = uri.getQueryParameter("type") ?: ""
val act = uri.getQueryParameter("act") ?: ""
val loaction = if (TextUtils.isEmpty(act)) id else VideoDetailContainerViewModel.Location.VIDEO_ACTIVITY.value
directToVideoDetail(context, id, loaction, false, "", entrance, "", referer, type, act)
}
EntranceUtils.HOST_VIDEO_SINGLE -> {
val referer = uri.getQueryParameter("referer") ?: ""
directToVideoDetail(context, id, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.value,
false, "", entrance, "", if (TextUtils.isEmpty(referer)) "" else referer)
}
EntranceUtils.HOST_VIDEO_STREAMING_HOME -> {
intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
intent.putExtra(MainActivity.SWITCH_TO_VIDEO, true)
context.startActivity(intent)
}
EntranceUtils.HOST_VIDEO_STREAMING_DESC -> {
directToGameDetailVideoStreaming(context, id, entrance)
}
EntranceUtils.HOST_VIDEO_COLLECTION -> {
directToGameVideo(context, id, entrance, "")
}
EntranceUtils.HOST_CATEGORY -> {
val title = uri.getQueryParameter("title")
DirectUtils.directCategoryDirectory(context, id, title ?: "", entrance, "")
}
EntranceUtils.HOST_COLUMN_COLLECTION -> {
val name = uri.getQueryParameter("name")
DirectUtils.directToColumnCollection(context, id, -1, entrance, name ?: "")
}
EntranceUtils.HOST_COLUMN -> {
DirectUtils.directToSubject(context, id, uri.getQueryParameter(EntranceUtils.KEY_NAME), entrance)
}
EntranceUtils.HOST_COMMUNITY_QUESTION_LABEL_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val tag = uri.getQueryParameter("tag") ?: ""
DirectUtils.directAskColumnLabelDetail(context, tag, community, entrance, "")
}
EntranceUtils.HOST_COMMUNITY_COLUMN_DETAIL->{
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val columnId = uri.getQueryParameter("column_id") ?: ""
DirectUtils.directAskColumnDetail(context, columnId, community, entrance, "")
}
else -> DialogUtils.showLowVersionDialog(context)
}
return true
}
if ("http" != uri.scheme && "https" != uri.scheme) return true
return false
}
}

View File

@ -0,0 +1,82 @@
package com.gh.common
import com.gh.common.exposure.ExposureManager
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.loghub.LoghubUtils
import com.gh.common.util.doOnMainProcessOnly
import com.gh.common.util.tryCatchInRelease
import com.gh.common.videolog.VideoRecordUtils
import com.gh.download.DownloadDataHelper
import com.gh.gamecenter.entity.TimeEntity
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import kotlin.concurrent.fixedRateTimer
object FixedRateJobHelper {
private const val CHECKER_PERIOD: Long = 15 * 1000L
private const val TIME_PERIOD: Long = 600 * 1000L
private const val LOGHUB_PERIOD: Long = 120 * 1000L
private const val EXPOSURE_PERIOD: Long = 300 * 1000L
private const val REGION_SETTING_PERIOD: Long = 300 * 1000L
private const val VIDEO_RECORD_PERIOD: Long = 60 * 1000L
private const val DOWNLOAD_HEARTBEAT_PERIOD: Long = 60 * 1000L
private const val DOWNLOAD_HEARTBEAT_SHEET_PERIOD: Long = 15 * 1000L
private var mExecuteCount: Int = 0
var timeDeltaBetweenServerAndClient: Long = 0
@JvmStatic
fun begin() {
doOnMainProcessOnly {
fixedRateTimer("Global-Fixed-Rate-Timer", initialDelay = 100, period = CHECKER_PERIOD) {
// 时间校对10分钟一次
if ((mExecuteCount * CHECKER_PERIOD) % TIME_PERIOD == 0L) {
RetrofitManager.getInstance(HaloApp.getInstance().application).api.time
.subscribeOn(AppExecutor.cachedScheduler)
.subscribe(object : Response<TimeEntity>() {
override fun onResponse(response: TimeEntity?) {
val serverTime = response?.time
serverTime?.let { timeDeltaBetweenServerAndClient = it * 1000 - System.currentTimeMillis() }
}
})
}
// 提交曝光数据
if ((mExecuteCount * CHECKER_PERIOD) % EXPOSURE_PERIOD == 0L) {
ExposureManager.commitSavedExposureEvents(true)
}
// 分片检测下载进度
if ((mExecuteCount * CHECKER_PERIOD) % DOWNLOAD_HEARTBEAT_SHEET_PERIOD == 0L) {
tryCatchInRelease {
val upload = (mExecuteCount * CHECKER_PERIOD) % DOWNLOAD_HEARTBEAT_PERIOD == 0L
DownloadDataHelper.uploadDownloadHeartbeat(upload)
}
}
// 提交普通 loghub 数据
if ((mExecuteCount * CHECKER_PERIOD) % LOGHUB_PERIOD == 0L) {
LoghubUtils.commitSavedLoghubEvents()
}
// 更新游戏屏蔽信息
if ((mExecuteCount * CHECKER_PERIOD) % REGION_SETTING_PERIOD == 0L) {
if (HaloApp.getInstance().isRunningForeground) {
RegionSettingHelper.getRegionSetting()
}
}
// 提交视频浏览记录数据
if ((mExecuteCount * CHECKER_PERIOD) % VIDEO_RECORD_PERIOD == 0L) {
VideoRecordUtils.commitVideoRecord()
}
// ExposureUtils.logADownloadCompleteExposureEvent(GameEntity(id = mExecuteCount.toString(), name = "测试曝光上传"), platform = "", trace = null, downloadType = ExposureUtils.DownloadType.DOWNLOAD)
mExecuteCount++
}
}
}
}

View File

@ -1,39 +1,39 @@
package com.gh.common
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.gh.common.im.ImManager
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.m7.imkfsdk.chat.ChatActivity
import io.reactivex.schedulers.Schedulers
/**
* 可使用 [LocalBroadcastManager] 来进行简单的模块间消息通知
*/
class LocalBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
intent?.let {
when (intent.action) {
ChatActivity.ACTION_DISMISS_FLOATING_WINDOW -> {
ImManager.dismissFloatingWindow()
RetrofitManager.getInstance(HaloApp.getInstance().application).api.postImEnding(UserManager.getInstance().userId)
.subscribeOn(Schedulers.io())
.subscribe()
}
ChatActivity.ACTION_HIDE_UNREAD_DOT -> {
ImManager.updateShouldShowFloatingWindowDot(false)
}
else -> return
}
}
}
}
//package com.gh.common
//
//import android.content.BroadcastReceiver
//import android.content.Context
//import android.content.Intent
//import com.gh.common.im.ImManager
//import com.gh.gamecenter.manager.UserManager
//import com.gh.gamecenter.retrofit.RetrofitManager
//import com.halo.assistant.HaloApp
//import com.m7.imkfsdk.chat.ChatActivity
//import io.reactivex.schedulers.Schedulers
//
///**
// * 可使用 [LocalBroadcastManager] 来进行简单的模块间消息通知
// */
//
//class LocalBroadcastReceiver : BroadcastReceiver() {
//
// override fun onReceive(context: Context?, intent: Intent?) {
// intent?.let {
// when (intent.action) {
// ChatActivity.ACTION_DISMISS_FLOATING_WINDOW -> {
// ImManager.dismissFloatingWindow()
//
// RetrofitManager.getInstance(HaloApp.getInstance().application).api.postImEnding(UserManager.getInstance().userId)
// .subscribeOn(Schedulers.io())
// .subscribe()
// }
//
// ChatActivity.ACTION_HIDE_UNREAD_DOT -> {
// ImManager.updateShouldShowFloatingWindowDot(false)
// }
//
// else -> return
// }
// }
// }
//
//}

View File

@ -1,29 +1,8 @@
package com.gh.common
import android.annotation.SuppressLint
import android.preference.PreferenceManager
import com.gh.base.GHUmengNotificationService
import com.gh.common.constant.Config
import com.gh.common.exposure.meta.MetaUtil
import com.gh.common.util.edit
import com.gh.common.util.toJson
import com.gh.common.util.toObject
import com.gh.common.util.tryWithDefaultCatch
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.entity.AliasEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import com.umeng.commonsdk.UMConfigure
import com.umeng.message.IUmengRegisterCallback
import com.umeng.message.PushAgent
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.RequestBody
import org.android.agoo.huawei.HuaWeiRegister
import org.android.agoo.mezu.MeizuRegister
import org.android.agoo.xiaomi.MiPushRegistar
import org.json.JSONObject
object PushManager {
@ -36,107 +15,103 @@ object PushManager {
@JvmStatic
fun init(channel: String) {
tryWithDefaultCatch {
//初始化友盟推送
UMConfigure.init(mApplication,
Config.UMENG_APPKEY, channel,
UMConfigure.DEVICE_TYPE_PHONE,
Config.UMENG_MESSAGE_SECRET)
// 注册小米、华为和魅族通道
MiPushRegistar.register(mApplication, Config.MIPUSH_APPID, Config.MIPUSH_APPKEY)
HuaWeiRegister.register(mApplication)
MeizuRegister.register(mApplication, BuildConfig.MEIZUPUSH_APPID, BuildConfig.MEIZUPUSH_APPKEY)
//友盟推送
val pushAgent = PushAgent.getInstance(mApplication)
//注册推送服务每次调用register方法都会回调该接口
runOnIoThread { registerDevice() }
val aliasInSp = PreferenceManager.getDefaultSharedPreferences(mApplication).getString(SP_PUSH_ALIAS, "")
mPreviousAlias = aliasInSp?.toObject()
if (mPreviousAlias == null) {
getAndSetAlias()
}
// 完全自定义处理(透传)
pushAgent.setPushIntentServiceClass(GHUmengNotificationService::class.java)
}
// tryWithDefaultCatch {
// //初始化友盟推送
// UMConfigure.init(mApplication, Config.UMENG_APPKEY, channel, UMConfigure.DEVICE_TYPE_PHONE, Config.UMENG_MESSAGE_SECRET)
//
// val pushAgent = PushAgent.getInstance(mApplication)
//
// runOnIoThread { registerDevice() }
//
// // 注册小米、华为和魅族通道
// MiPushRegistar.register(mApplication, Config.MIPUSH_APPID, Config.MIPUSH_APPKEY)
// HuaWeiRegister.register(mApplication)
// MeizuRegister.register(mApplication, BuildConfig.MEIZUPUSH_APPID, BuildConfig.MEIZUPUSH_APPKEY)
//
// val aliasInSp = PreferenceManager.getDefaultSharedPreferences(mApplication).getString(SP_PUSH_ALIAS, "")
// mPreviousAlias = aliasInSp?.toObject()
//
// if (mPreviousAlias == null) {
// getAndSetAlias()
// }
//
// // 完全自定义处理(透传)
// pushAgent.setPushIntentServiceClass(GHUmengNotificationService::class.java)
// }
}
private fun registerDevice() {
PushAgent.getInstance(mApplication).register(object : IUmengRegisterCallback {
override fun onSuccess(dToken: String) {
//注册成功会返回device token
deviceToken = dToken
getAndSetAlias()
Utils.log("deviceToken::$dToken")
}
override fun onFailure(s: String, s1: String) {
Utils.log("deviceToken::" + "注册失败")
}
})
// PushAgent.getInstance(mApplication).register(object : IUmengRegisterCallback {
// override fun onSuccess(dToken: String) {
// //注册成功会返回device token
// deviceToken = dToken
// getAndSetAlias()
// Utils.log("deviceToken::$dToken")
// }
//
// override fun onFailure(s: String, s1: String) {
// Utils.log("deviceToken::" + "注册失败")
// }
// })
}
@SuppressLint("CheckResult")
@JvmStatic
fun getAndSetAlias() {
if (deviceToken.isNullOrEmpty()) {
registerDevice()
return
}
val meta = MetaUtil.getMeta()
val jsonObject = JSONObject()
jsonObject.put("device_token", deviceToken)
jsonObject.put("imei", meta.imei)
jsonObject.put("android_id", meta.android_id)
jsonObject.put("model", meta.model)
jsonObject.put("manufacturer", meta.manufacturer)
jsonObject.put("os", meta.os)
jsonObject.put("os_version", meta.android_version)
jsonObject.put("mac", meta.mac)
val body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString())
RetrofitManager.getInstance(mApplication).api.getAlias(body)
.subscribeOn(Schedulers.io())
.subscribe(
{ setAlias(it) },
{ it.printStackTrace() }
)
// if (deviceToken.isNullOrEmpty()) {
// registerDevice()
// return
// }
//
// val meta = MetaUtil.getMeta()
//
// val jsonObject = JSONObject()
// jsonObject.put("device_token", deviceToken)
// jsonObject.put("imei", meta.imei)
// jsonObject.put("android_id", meta.android_id)
// jsonObject.put("model", meta.model)
// jsonObject.put("manufacturer", meta.manufacturer)
// jsonObject.put("os", meta.os)
// jsonObject.put("os_version", meta.android_version)
// jsonObject.put("mac", meta.mac)
// jsonObject.put("gid", meta.gid)
//
// val body = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString())
//
// RetrofitManager.getInstance(mApplication).api.getAlias(body)
// .subscribeOn(Schedulers.io())
// .subscribe(
// { setAlias(it) },
// { it.printStackTrace() }
// )
}
@JvmStatic
fun setAlias(alias: AliasEntity) {
val pushAgent = PushAgent.getInstance(mApplication)
mPreviousAlias = alias
PreferenceManager.getDefaultSharedPreferences(mApplication).edit {
putString(SP_PUSH_ALIAS, mPreviousAlias?.toJson())
}
pushAgent.setAlias(alias.alias, alias.aliasType) { b, s ->
Utils.log("注册别名 $b + $s")
}
// val pushAgent = PushAgent.getInstance(mApplication)
//
// mPreviousAlias = alias
// PreferenceManager.getDefaultSharedPreferences(mApplication).edit {
// putString(SP_PUSH_ALIAS, mPreviousAlias?.toJson())
// }
//
// pushAgent.setAlias(alias.alias, alias.aliasType) { b, s ->
// Utils.log("注册别名 $b + $s")
// }
}
@JvmStatic
fun deleteAlias() {
val pushAgent = PushAgent.getInstance(mApplication)
mPreviousAlias?.let {
pushAgent.deleteAlias(it.alias, it.aliasType) { b, s ->
Utils.log("删除别名 $b + $s")
}
}
PreferenceManager.getDefaultSharedPreferences(mApplication).edit {
putString(SP_PUSH_ALIAS, "")
}
mPreviousAlias = null
// val pushAgent = PushAgent.getInstance(mApplication)
//
// mPreviousAlias?.let {
// pushAgent.deleteAlias(it.alias, it.aliasType) { b, s ->
// Utils.log("删除别名 $b + $s")
// }
// }
// PreferenceManager.getDefaultSharedPreferences(mApplication).edit {
// putString(SP_PUSH_ALIAS, "")
// }
// mPreviousAlias = null
}
}

View File

@ -0,0 +1,3 @@
package com.gh.common
typealias OnFastClickListener = (isSuccess: Boolean) -> Unit

View File

@ -5,8 +5,6 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.gh.common.util.GsonUtils;
import com.gh.common.util.PackageHelper;
import com.gh.common.util.PackageUtils;
@ -25,12 +23,14 @@ import org.greenrobot.eventbus.EventBus;
import java.util.List;
import androidx.annotation.Nullable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class Config {
public static final String API_HOST = BuildConfig.API_HOST;
public static final String SENSITIVE_API_HOST = BuildConfig.SENSITIVE_API_HOST;
/**
* 需要配置的请使用{@link PreferenceManager#getDefaultSharedPreferences(Context)}
@ -50,6 +50,8 @@ public class Config {
public static final String BUGLY_APPID = BuildConfig.BUGLY_APPID;
public static final String LETO_APPID = BuildConfig.LETO_APPID;
public static final String TTAD_APPID = BuildConfig.TTAD_APPID;
public static final String DOUYIN_CLIENTKEY = BuildConfig.DOUYIN_CLIENTKEY;
public static final String DOUYIN_CLIENTSECRET = BuildConfig.DOUYIN_CLIENTSECRET;
// http://www.ghzs666.com/article/${articleId}.html
public static final String URL_ARTICLE = "http://www.ghzs666.com/article/"; // ghzs/ghzs666 统一
public static final String PATCHES = "patches";
@ -238,6 +240,9 @@ public class Config {
public static boolean isGameDomeSwitchOpen() {
return getSettings() != null && getSettings().getGameDomeSwitch().equals("on");
}
public static boolean isPermissionPopupSwitchOpen() {
return getSettings() != null && getSettings().getPermissionPopupSwitch().equals("on");
}
public static void fixHideFunction() {
SharedPreferences preferences = PreferenceManager.
@ -253,7 +258,7 @@ public class Config {
public static void getGhzsSettings() {
String channel = HaloApp.getInstance().getChannel();
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
.getApi().getSettings(PackageUtils.getVersionName(), channel)
.getSensitiveApi().getSettings(PackageUtils.getVersionName(), channel)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Response<SettingsEntity>() {

View File

@ -1,6 +1,7 @@
package com.gh.common.constant;
import com.gh.common.util.PackageUtils;
import com.halo.assistant.HaloApp;
public class Constants {
@ -12,11 +13,12 @@ public class Constants {
public final static int NOT_NETWORK_CODE = 504; // 没有网络的状态码(应该是这个吧!)
public static final String LOGIN_TOKEN_ID = "userToken_id"; // 用户ID 与服务器无关
public static final String USER_TOKEN_KEY = "userTokenKey";
public static final String USER_INFO_KEY = "userInfoKey";
public static final String WELCOME_DIALOG_ID = "welcome_dialog_id";
public static final String WELCOME_DIALOG_LINK_TITLE = "welcome_dialog_link_title";
public static final String DEVICE_KEY = "deviceKey";
public static final String HAS_REQUESTED_NOTIFICATION_PERMISSIONS = "has_requested_notification_permissions";
@ -28,12 +30,12 @@ public class Constants {
public static final String XPOSED_INSTALLER_PACKAGE_NAME = "de.robv.android.xposed.installer";
public static final String EB_QUIT_LOGIN = "quit_login";
// 用于避免历史下载掺和到普通下载状态的 ID 修饰符
public static final String GAME_ID_DIVIDER = ":";
// 用于避免历史下载影响到部分依赖名字作为数据更新条件的修饰符
public static final String GAME_NAME_DECORATOR = " ";
// 游戏详情进入时的自定义栏目标签是否已经默认展开过一次的标记
public static final String SP_HAS_EXPANDED_GAME_DETAIL_TAGS = "has_expanded_game_detail_tags";
// 游戏详情进入时的自定义栏目标签是否已经显示过一次展开更多的浮窗提示
@ -43,6 +45,23 @@ public class Constants {
public static final String SP_LAST_OPENING_ID = "last_opening_dialog_id";
public static final String SP_LAST_OPENING_TIME = "last_opening_dialog_time";
// 游戏图标和图标角标
public static final String RAW_GAME_ICON = "raw_game_icon";
public static final String GAME_ICON_SUBSCRIPT = "game_icon_subscript";
public static final String EXTRA_DOWNLOAD_TYPE = "extra_download_type";
public static final String SILENT_UPDATE = "静默更新";
public static final String SIMULATOR_DOWNLOAD = "下载模拟器";
public static final String SIMULATOR_GAME = "simulator_game";
public static final String SIMULATOR_DOWNLOAD_START_TIME = "simulator_download_start_time";
public static final String LAST_GHZS_UPDATE_FILE_SIZE = "last_ghzs_update_file_size";
// 新用户首次启动光环的时间
public static final String SP_INITIAL_USAGE_TIME = "initial_usage_time";
public static final String SP_IMEI = "imei";
public static final String SP_ANDROID_ID = "android_id";
//引导设置 “通知管理” 引导弹窗
public static final String SP_SHOWED_NOTIFICATION_LOGIN = "show_notification_login_hint";
public static final String SP_SHOWED_NOTIFICATION_QUESTION = "show_notification_question_hint";
@ -50,6 +69,9 @@ public class Constants {
public static final String SP_SHOWED_NOTIFICATION_ARTICLE = "show_notification_article_hint";
public static final String SP_SHOWED_NOTIFICATION_VIDEO = "show_notification_video_hint";
public static final String SP_SHOWED_NOTIFICATION_RATING = "show_notification_rating_hint";
public static final String SP_SHOWED_NOTIFICATION_GIFT = "show_notification_gift_hint";
public static final String SP_SHOWED_NOTIFICATION_RESERVE_GAME = "show_notification_reserve_game_hint";
public static final String SP_SHOWED_NOTIFICATION_FEEDBACK = "show_notification_feedback_hint";
// 新版本 也要触发一次“通知管理” 引导弹窗
public static final String SP_SHOWED_NOTIFICATION_NEW_VERSION = "show_notification_new_version";
// 今天是否已经触发了 “通知管理” 引导弹窗
@ -86,6 +108,32 @@ public class Constants {
public static final String SP_AUTH_DIALOG = "auth_dialog";
//顶部视频进度保存,重启恢复
public static final String SP_TOP_VIDEO_SCHEDULE = "top_video_schedule";
//我的光环小红点提示
public static final String SP_GH_RED_POINT_REMIND = "gh_red_point_remind";
//论坛首页引导
public static final String SP_FORUM_GUIDE = "forum_guide";
//礼仪考试开启状态
public static final String SP_REGULATION_TEST_LAST_REMIND_TIME = "regulation_test_last_remind_time";
public static final String SP_REGULATION_TEST_STATUS = "regulation_test_status";
public static final String SP_REGULATION_TEST_PASS_STATUS = "regulation_test_pass_status";
//相同设备号,每一种第三方登录方式登录后弹出绑定手机页面的次数
public static final String SP_QQ_SHOW_BIND_PHONE_TIME = "qq_show_bind_phone_time" + HaloApp.getInstance().getGid();
public static final String SP_WECHAT_SHOW_BIND_PHONE_TIME = "wechat_show_bind_phone_time" + HaloApp.getInstance().getGid();
public static final String SP_WEIBO_SHOW_BIND_PHONE_TIME = "weibo_show_bind_phone_time" + HaloApp.getInstance().getGid();
public static final String SP_DOUYIN_SHOW_BIND_PHONE_TIME = "douyin_show_bind_phone_time" + HaloApp.getInstance().getGid();
//隐私政策是否有更新
public static final String SP_PRIVACY_CURRENT_MD5 = "sp_privacy_current_md5";
public static final String SP_PRIVACY_MINE_MD5 = "sp_privacy_mine_md5";
public static final String SP_PRIVACY_SETTING_MD5 = "sp_privacy_setting_md5";
public static final String SP_PRIVACY_MD5 = "sp_privacy_md5";
public static final String SP_IS_USER_ACCEPTED_PRIVACY_STATEMENT = "has_user_accepted_privacy_statement";
public static final String SP_BRAND_NEW_USER = "brand_new_user";
//包名检测是否点击不再提示
public static final String SP_PACKAGE_CHECK = "package_check";
public static final String SP_XAPK_UNZIP_ACTIVITY = "xapk_unzip_activity";
public static final String SP_XAPK_URL = "xapk_url";
//手机号码匹配规则
public static final String REGEX_MOBILE = "^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$";
@ -95,13 +143,39 @@ public class Constants {
//输入规则
public static final String INPUT_RULE = "0123456789abcdefghijklnmopqrstuvwxyzABCDEFGHIJKLNMOPQRSTUVWXYZ_";
// 微信绑定地址地址
// 微信绑定地址
public static final String WECHAT_BIND_ADDRESS_DEV = "https://resource.ghzs.com/page/wechat_dev/index.html#/";
public static final String WECHAT_BIND_ADDRESS = "https://resource.ghzs.com/page/wechat_pro/index.html#/";
// 徽章
public static final String BADGE_ADDRESS_DEV = "http://resource.ghzs.com/page/badge_dev/index.html#/";
public static final String BADGE_ADDRESS = "http://resource.ghzs.com/page/badge_pro/index.html#/";
// 礼仪考试地址
public static final String REGULATION_TEST_ADDRESS_DEV = "https://static-web.ghzs.com/etiquette-dev/index.html#/";
public static final String REGULATION_TEST_ADDRESS = "https://static-web.ghzs.com/etiquette/index.html#/";
// 徽章中心
public static final String BADGE_ADDRESS_DEV = "https://static-web.ghzs.com/badge-dev/index.html#/";
public static final String BADGE_ADDRESS = "https://static-web.ghzs.com/badge/index.html#/";
// 徽章详情
public static final String BADGE_DETAIL_ADDRESS_DEV = "https://static-web.ghzs.com/badge-dev/index.html#/badgedetail";
public static final String BADGE_DETAIL_ADDRESS = "https://static-web.ghzs.com/badge/index.html#/badgedetail";
// 分享个人主页地址
public static final String SHARE_USER_HOME_ADDRESS_DEV = "https://static-web.ghzs.com/ghzs-userhome-dev/index.html#/";
public static final String SHARE_USER_HOME_ADDRESS = "https://static-web.ghzs.com/ghzs-userhome/index.html#/";
// 腾讯企点地址
public static final String TENCENT_QIDIAN_ADDRESS = "https://admin.qidian.qq.com/template/blue/mp/menu/qr-code-jump.html?linkType=0&env=ol&kfuin=2355094296&fid=457&key=c76dcb2e3d582b6ffbfb5bb22cde85ff&cate=1&source=&isLBS=&isCustomEntry=&type=16&ftype=1&_type=wpa&qidian=true";
//版规声明
public static final String FORUM_REGULATIONS_NEWS_ID = "5f4db9cc34d44d01b92fd670";
//帮助内容详情
public static final String HELP_ADDRESS_DEV = "https://static-web.ghzs.com/ghzs_help_dev/help.html?content=";
public static final String HELP_ADDRESS = "https://static-web.ghzs.com/ghzs_help/help.html?content=";
// 注销页面
public static final String LOGOUT_ADDRESS_DEV = "https://static-web.ghzs.com/ghzs_help_dev/help.html?content=5f6b1f02786564003944a693";
public static final String LOGOUT_ADDRESS = "https://static-web.ghzs.com/ghzs_help/help.html?content=5f534111b1f72909fc225672";
//最少需要多少数据才能上传
public static final int DATA_AMOUNT = 20;

View File

@ -32,6 +32,9 @@ public class ItemViewType {
public static final int IMAGE_SLIDE_ITEM = 23;
public static final int VERTICAL_SLIDE_ITEM = 24;
public static final int COLUMN_COLLECTION = 25;
public static final int GALLERY_SLIDE = 27; // 首页自动滚动画廊专题
public static final int GALLERY = 28; // 首页倾斜画廊专题
public static final int BLANK_DIVIDER = 29; // 空白补充区域
/**
* 普通列表

View File

@ -2,6 +2,7 @@ package com.gh.common.databind;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
@ -13,14 +14,23 @@ import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.databinding.BindingAdapter;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.base.OnViewClickListener;
import com.gh.common.constant.Config;
import com.gh.common.dialog.CertificationDialog;
import com.gh.common.dialog.PackageCheckDialogFragment;
import com.gh.common.dialog.ReserveDialogFragment;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.history.HistoryHelper;
import com.gh.common.repository.ReservationRepository;
import com.gh.common.simulator.SimulatorDownloadManager;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.util.CheckLoginUtils;
import com.gh.common.util.DataUtils;
import com.gh.common.util.DialogUtils;
@ -33,12 +43,13 @@ import com.gh.common.util.LogUtils;
import com.gh.common.util.MtaHelper;
import com.gh.common.util.NewsUtils;
import com.gh.common.util.NumberUtils;
import com.gh.common.util.PackageInstaller;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PermissionHelper;
import com.gh.common.util.PlatformUtils;
import com.gh.common.util.ReservationHelper;
import com.gh.common.view.DownloadProgressBar;
import com.gh.common.view.DrawableView;
import com.gh.common.view.GameIconView;
import com.gh.download.DownloadManager;
import com.gh.download.dialog.DownloadDialog;
import com.gh.gamecenter.DownloadManagerActivity;
@ -63,17 +74,12 @@ import com.lightgame.utils.Utils;
import org.greenrobot.eventbus.EventBus;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.databinding.BindingAdapter;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
/**
* Created by khy on 12/02/18.
*/
@ -95,6 +101,26 @@ public class BindingAdapters {
view.setTextSize(number);
}
@BindingAdapter("setTypeface")
public static void setTypeface(TextView view, String type) {
if (type == null) return;
switch (type) {
case "bold":
view.setTypeface(null, Typeface.BOLD);
break;
case "italic":
view.setTypeface(null, Typeface.ITALIC);
break;
case "bold_italic":
view.setTypeface(null, Typeface.BOLD_ITALIC);
break;
default:
view.setTypeface(null, Typeface.NORMAL);
break;
}
}
@BindingAdapter({"addDetailKaiFuView", "addDetailKaiFuViewListener", "isReadyPatch"})
public static void addDetailKaiFuView(LinearLayout view, List<ServerCalendarEntity> list
, OnViewClickListener listener, Boolean isReadyPatch) {
@ -230,6 +256,14 @@ public class BindingAdapters {
}
}
/**
* lazy 的 paddingTop
*/
@BindingAdapter("lazyPaddingLeft")
public static void lazyPaddingLeft(View view, int paddingLeftInDp) {
view.setPadding(DisplayUtils.dip2px(paddingLeftInDp), view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());
}
/**
* lazy 的 paddingTop
*/
@ -292,6 +326,13 @@ public class BindingAdapters {
}
}
@BindingAdapter("game")
public static void setGame(View view, GameEntity gameEntity) {
if (gameEntity != null && view instanceof GameIconView) {
((GameIconView) view).displayGameIcon(gameEntity);
}
}
@BindingAdapter("articleType")
public static void setArticleType(TextView view, String articleType) {
NewsUtils.setNewsType(view, articleType, 0, 0);
@ -406,15 +447,27 @@ public class BindingAdapters {
case PLUGIN:
if (gameEntity.getApk().size() == 1) {
ApkEntity apk = gameEntity.getApk().get(0);
DownloadDialogHelper.findAvailableDialogAndShow(v.getContext(), gameEntity, apk,
() -> {
CertificationDialog.showCertificationDialog(v.getContext(), gameEntity, () -> {
DialogUtils.showVersionNumberDialog(v.getContext(), gameEntity, () -> {
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.getUrl());
if (gameEntity.getSimulator() != null) {
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(v.getContext(), gameEntity.getSimulator().getApk().getPackageName());
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled) {
SimulatorDownloadManager.getInstance().showDownloadDialog(v.getContext(), gameEntity.getSimulator(),
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.getId(), gameEntity.getName(), null);
return;
}
}
PackageCheckDialogFragment.show((AppCompatActivity) v.getContext(), gameEntity.getPackageDialog(), () -> {
DownloadDialogHelper.findAvailableDialogAndShow(v.getContext(), gameEntity, apk, () -> {
CertificationDialog.showCertificationDialog(v.getContext(), gameEntity, () -> {
DialogUtils.showVersionNumberDialog(v.getContext(), gameEntity, () -> {
DialogUtils.showOverseaDownloadDialog(v.getContext(), gameEntity, () -> {
DialogUtils.checkDownload(v.getContext(), apk.getSize(),
isSubscribe -> download(progressBar, gameEntity, traceEvent, isSubscribe, entrance, location));
});
});
});
});
});
} else {
CertificationDialog.showCertificationDialog(v.getContext(), gameEntity, () -> {
DialogUtils.showVersionNumberDialog(v.getContext(), gameEntity, () -> {
@ -430,6 +483,20 @@ public class BindingAdapters {
break;
case LAUNCH_OR_OPEN:
if (gameEntity.getApk().size() == 1) {
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
if (!file.exists()) {
download(progressBar, gameEntity, traceEvent, false, entrance, location);
return;
}
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
}
return;
}
DataUtils.onGameLaunchEvent(v.getContext(), gameEntity.getName(), gameEntity.getApk().get(0).getPlatform(), location);
PackageUtils.launchApplicationByPackageName(v.getContext(), gameEntity.getApk().get(0).getPackageName());
} else {
@ -446,19 +513,17 @@ public class BindingAdapters {
if (gameEntity.getApk().size() == 1) {
DownloadEntity downloadEntity = DownloadManager.getInstance(progressBar.getContext()).getDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
PackageUtils.launchSetup(v.getContext(), downloadEntity);
PackageInstaller.install(v.getContext(), downloadEntity);
}
}
break;
case RESERVABLE:
CheckLoginUtils.checkLogin(progressBar.getContext(), "", () -> {
PermissionHelper.checkReadPhoneStatePermissionBeforeAction(progressBar.getContext(), () -> {
ReserveDialogFragment dialogFragment = ReserveDialogFragment.getInstance(gameEntity, () -> {
LogUtils.logReservation(gameEntity, traceEvent);
updateReservation(progressBar, gameEntity);
});
dialogFragment.show(((AppCompatActivity) progressBar.getContext()).getSupportFragmentManager(), "reserve");
ReserveDialogFragment dialogFragment = ReserveDialogFragment.getInstance(gameEntity, () -> {
LogUtils.logReservation(gameEntity, traceEvent);
updateReservation(progressBar, gameEntity);
});
dialogFragment.show(((AppCompatActivity) progressBar.getContext()).getSupportFragmentManager(), "reserve");
});
break;
case RESERVED:
@ -485,9 +550,12 @@ public class BindingAdapters {
HistoryHelper.insertGameEntity(gameEntity);
}
Intent i = new Intent(WebActivity.getIntentForWebGame(progressBar.getContext(), linkEntity.getLink(), gameEntity.getName(), isPlay));
Intent i = new Intent(WebActivity.getIntentForWebGame(progressBar.getContext(), linkEntity.getLink(), gameEntity.getName(), isPlay, linkEntity.getCloseButton()));
progressBar.getContext().startActivity(i);
break;
case UPDATING:
Utils.toast(progressBar.getContext(), "正在加急更新版本,敬请后续留意");
break;
}
});
@ -517,10 +585,14 @@ public class BindingAdapters {
} else {
if (offStatus != null && "dialog".equals(offStatus)) {
progressBar.setText("查看");
progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
} else if ("updating".equals(offStatus)) {
progressBar.setText("更新中");
progressBar.setDownloadType(DownloadProgressBar.DownloadType.UPDATING);
} else {
progressBar.setText("暂无");
progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
}
progressBar.setDownloadType(DownloadProgressBar.DownloadType.NONE);
}
} else {
@ -687,14 +759,15 @@ public class BindingAdapters {
}
}
@BindingAdapter({"setGameName", "isShowPlatform"})
public static void setGameName(TextView view, GameEntity game, boolean isShowPlatform) {
@BindingAdapter({"setGameName", "isShowPlatform", "isShowSuffix"})
public static void setGameName(TextView view, GameEntity game, boolean isShowPlatform, @Nullable Boolean isShowSuffix) {
if (isShowSuffix == null) isShowSuffix = true; // 默认显示
if (isShowPlatform && game.getApk().size() > 0) {
view.setText(String.format("%s - %s", game.getName(),
view.setText(String.format("%s - %s", !isShowSuffix ? game.getNameWithoutSuffix() : game.getName(),
PlatformUtils.getInstance(view.getContext()).getPlatformName(
game.getApk().get(0).getPlatform())));
} else {
view.setText(game.getName());
view.setText(!isShowSuffix ? game.getNameWithoutSuffix() : game.getName());
}
}
@ -753,4 +826,17 @@ public class BindingAdapters {
}
view.setText(span);
}
@BindingAdapter({"setVideoData"})
public static void setVideoData(TextView view, int count) {
if (count > 0) {
view.setCompoundDrawablesWithIntrinsicBounds(ContextCompat.getDrawable(view.getContext(), R.drawable.ic_video_data_up), null, null, null);
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.text_EA3333));
view.setText(count + "");
} else {
view.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.text_999999));
view.setText("-");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -26,21 +26,12 @@ import com.gh.gamecenter.UserInfoEditActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.entity.AuthDialogEntity
import com.gh.gamecenter.entity.AuthDialogLevel
import com.gh.gamecenter.entity.DeviceDialogEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.user.UserViewModel
import com.google.gson.reflect.TypeToken
import com.halo.assistant.fragment.user.UserInfoEditFragment
import com.lightgame.utils.AppManager
import com.tencent.bugly.beta.tinker.TinkerManager.getApplication
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import retrofit2.HttpException
class CertificationDialog(context: Context, private val authDialogEntity: AuthDialogEntity, val gameId: String, val listener: DialogUtils.ConfirmListener) :
Dialog(context, R.style.GhAlertDialog) {
@ -127,7 +118,9 @@ class CertificationDialog(context: Context, private val authDialogEntity: AuthDi
//跳转登录页面
private fun gotoLoginPage() {
CheckLoginUtils.checkLogin(AppManager.getInstance().currentActivity() as AppCompatActivity,
val currentActivity = AppManager.getInstance().currentActivity() ?: return
CheckLoginUtils.checkLogin(currentActivity as AppCompatActivity,
null, true, "实名认证弹窗") {
if (UserManager.getInstance().isAuth) {
listener.onConfirm()
@ -138,7 +131,9 @@ class CertificationDialog(context: Context, private val authDialogEntity: AuthDi
//跳转实名认证页面
private fun gotoAuthPage() {
AvoidOnResultManager.getInstance(AppManager.getInstance().currentActivity() as AppCompatActivity)
val currentActivity = AppManager.getInstance().currentActivity() ?: return
AvoidOnResultManager.getInstance(currentActivity as AppCompatActivity)
.startForResult(UserInfoEditActivity.getIntent(context, UserViewModel.TYPE_ID_CARD), object : Callback {
override fun onActivityResult(resultCode: Int, data: Intent?) {
if (resultCode == Activity.RESULT_OK && data != null) {

View File

@ -10,6 +10,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.text.HtmlCompat
import com.gh.base.fragment.BaseDialogFragment
import com.gh.common.util.DirectUtils
import com.gh.common.util.DisplayUtils
import com.gh.common.util.MtaHelper
@ -18,7 +19,10 @@ import com.gh.gamecenter.entity.GameEntity
import kotlinx.android.synthetic.main.dialog_game_off_service.*
// 游戏关闭下载弹窗
class GameOffServiceDialogFragment : BaseTrackableDialogFragment() {
class GameOffServiceDialogFragment
// : BaseTrackableDialogFragment()
:BaseDialogFragment() {
private var mDialog: GameEntity.Dialog? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
@ -42,9 +46,9 @@ class GameOffServiceDialogFragment : BaseTrackableDialogFragment() {
siteTv.text = site.text
siteTv.paintFlags = siteTv.paintFlags or Paint.UNDERLINE_TEXT_FLAG
siteTv.setOnClickListener {
MtaHelper.onEvent("游戏下载状态按钮", getKey(), site.text)
// MtaHelper.onEvent("游戏下载状态按钮", getKey(), site.text)
DirectUtils.directToWebView(requireContext(), site.url, "(关闭下载弹窗)")
dismiss()
dismissAllowingStateLoss()
}
container.addView(siteTv)
@ -52,13 +56,13 @@ class GameOffServiceDialogFragment : BaseTrackableDialogFragment() {
}
}
override fun getEvent(): String {
return "游戏下载状态按钮"
}
override fun getKey(): String {
return "查看详情弹窗"
}
// override fun getEvent(): String {
// return "游戏下载状态按钮"
// }
//
// override fun getKey(): String {
// return "查看详情弹窗"
// }
companion object {
@JvmStatic

View File

@ -0,0 +1,135 @@
package com.gh.common.dialog
import android.app.Activity.RESULT_OK
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentTransaction
import com.airbnb.lottie.LottieAnimationView
import com.gh.common.constant.Config
import com.gh.common.constant.Constants
import com.gh.common.util.*
import com.gh.common.util.PermissionHelper.INSTALL_PERMISSION_CODE
import com.gh.common.xapk.XapkInstaller
import com.gh.gamecenter.R
import com.lightgame.download.DownloadEntity
import kotlin.random.Random
class InstallPermissionDialogFragment : BaseTrackableDialogFragment() {
lateinit var mView: View
var isXapk = false
var url: String = ""
var mCallBack: (() -> Unit)? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mView = inflater.inflate(R.layout.dialog_install_permission, null, false)
return mView
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val closeTv = mView.findViewById<TextView>(R.id.closeTv)
val closeIv = mView.findViewById<ImageView>(R.id.closeIv)
val activateTv = mView.findViewById<TextView>(R.id.activateTv)
val contentTv = mView.findViewById<TextView>(R.id.contentTv)
val switchLottie = mView.findViewById<LottieAnimationView>(R.id.switchLottie)
contentTv.text = if (isXapk) "未授权下解压XAPK可能导致解压失败" else "以保证游戏的安装和更新"
switchLottie.setAnimation("lottie/install_permission_switch.json")
switchLottie.playAnimation()
val randomNumber = if (isXapk) 1 else Random.nextInt(2)
closeTv.goneIf(randomNumber == 0)
closeIv.goneIf(randomNumber != 0)
if (isXapk) {
closeTv.text = "暂不,尝试解压"
closeIv.visibility = View.VISIBLE
}
closeTv.setOnClickListener {
MtaHelper.onEvent(getEvent(), getKey(), "文案样式_点击以后再说")
if (isXapk) {
mCallBack?.invoke()
}
dismiss()
}
closeIv.setOnClickListener {
MtaHelper.onEvent(getEvent(), getKey(), "图标样式_点击关闭")
dismiss()
}
activateTv.setOnClickListener {
MtaHelper.onEvent(getEvent(), getKey(), if (randomNumber == 0) "文案样式_点击立即开启" else "图标样式_点击立即开启")
PermissionHelper.toInstallPermissionSetting(requireActivity())
if (isXapk) {
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, requireActivity().javaClass.name)
SPUtils.setString(Constants.SP_XAPK_URL, url)
}
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == RESULT_OK && requestCode == INSTALL_PERMISSION_CODE) {
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "")
SPUtils.setString(Constants.SP_XAPK_URL, "")
mCallBack?.invoke()
dismiss()
}
}
override fun getEvent(): String = "安装引导弹窗"
override fun getKey(): String = "引导弹窗"
companion object {
@JvmStatic
fun show(activity: AppCompatActivity, downloadEntity: DownloadEntity, callBack: (() -> Unit)?) {
val isXapk = XapkInstaller.XAPK_EXTENSION_NAME == downloadEntity.path.getExtension()
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
callBack?.invoke()
return
}
val haveInstallPermission = activity.packageManager.canRequestPackageInstalls()
if (haveInstallPermission) {
callBack?.invoke()
return
}
if (isXapk) {
val xapkUnzipVersions = Config.getSettings()?.permissionPopupAppliedVersions?.xapkUnzip
if (xapkUnzipVersions?.contains(Build.VERSION.SDK_INT.toString()) == false) {
callBack?.invoke()
return
}
} else {
val installVersions = Config.getSettings()?.permissionPopupAppliedVersions?.install
if (installVersions?.contains(Build.VERSION.SDK_INT.toString()) == false) {
callBack?.invoke()
return
}
}
var installPermissionDialogFragment = activity.supportFragmentManager.findFragmentByTag(InstallPermissionDialogFragment::class.java.simpleName) as? InstallPermissionDialogFragment
if (installPermissionDialogFragment != null) {
installPermissionDialogFragment.mCallBack = callBack
installPermissionDialogFragment.isXapk = isXapk
installPermissionDialogFragment.url = downloadEntity.url
val transaction: FragmentTransaction = activity.supportFragmentManager.beginTransaction()
transaction.show(installPermissionDialogFragment)
transaction.commit()
} else {
installPermissionDialogFragment = InstallPermissionDialogFragment().apply {
this.mCallBack = callBack
this.isXapk = isXapk
this.url = downloadEntity.url
}
installPermissionDialogFragment.show(activity.supportFragmentManager, InstallPermissionDialogFragment::class.java.simpleName)
}
}
}
}

View File

@ -2,28 +2,33 @@ package com.gh.common.dialog
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.util.DisplayUtils
import androidx.core.content.ContextCompat
import com.gh.common.util.GsonUtils
import com.gh.common.util.MtaHelper
import com.gh.common.util.PermissionHelper
import com.gh.common.util.fromHtml
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.NotificationHint
import com.gh.gamecenter.entity.NotificationStyleEntity
import com.gh.gamecenter.entity.NotificationUgc
import com.lightgame.utils.Utils
import kotlinx.android.synthetic.main.dialog_notification_hint.*
import org.json.JSONArray
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
import kotlin.random.Random
// 通知权限弹窗
class NotificationHintDialogFragment : BaseTrackableDialogFragment() {
private var mNotificationHint: NotificationHint? = null
private var mNotificationUgc: NotificationUgc? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_notification_hint, null)
@ -34,23 +39,34 @@ class NotificationHintDialogFragment : BaseTrackableDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
titleTv.text = mNotificationHint?.title
contentContainer.removeAllViews()
for (item in mNotificationHint?.content ?: arrayListOf()) {
val tv = TextView(context)
tv.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT).apply {
topMargin = if (contentContainer.childCount == 0) 0 else DisplayUtils.dip2px(12f)
}
tv.text = item
tv.setTextColor(Color.parseColor("#1383EB"))
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f)
contentContainer.addView(tv)
val jsonString = getJsonFromAssets()
if (jsonString.isNullOrEmpty()) {
Utils.log("Failed to obtain configuration file")
return
}
val index = Random.nextInt(2)
val jsonArray = JSONArray(jsonString)
val jsonObj = jsonArray.getJSONObject(index)
if (!jsonObj.has(mNotificationUgc?.value)) {
Utils.log("ugc type error")
return
}
val styleEntityJson = jsonObj.getJSONObject(mNotificationUgc!!.value)
val styleEntity = GsonUtils.fromJson(styleEntityJson.toString(), NotificationStyleEntity::class.java)
val drawableId = resources.getIdentifier(styleEntity.image, "drawable", requireContext().packageName)
notificationIv.setImageDrawable(ContextCompat.getDrawable(requireContext(), drawableId))
notificationTitle.text = styleEntity.title
notificationContent.text = styleEntity.content.fromHtml()
if (index == 0) {
closeIv.setImageDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.ic_notification_close_1))
} else {
activateTv.background = ContextCompat.getDrawable(requireContext(), R.drawable.bg_notification_open_btn_style_1)
activateTv.text = "优雅的开启"
}
activateTv.setOnClickListener {
MtaHelper.onEventWithBasicDeviceInfo(getEvent(), getKey(), "点击立即开启")
MtaHelper.onEventWithBasicDeviceInfo(getEvent(), getKey(), "${styleEntity.scenes}_${styleEntity.styleNo}_点击立即开启")
dismiss()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//这种方案适用于 API 26, 即8.0含8.0)以上可以用
@ -63,9 +79,10 @@ class NotificationHintDialogFragment : BaseTrackableDialogFragment() {
}
}
laterTv.setOnClickListener {
closeIv.setOnClickListener {
dismiss()
MtaHelper.onEventWithBasicDeviceInfo(getEvent(), getKey(), "点击以后再说")
MtaHelper.onEventWithBasicDeviceInfo(getEvent(), getKey(), "点击关闭")
MtaHelper.onEventWithBasicDeviceInfo(getEvent(), getKey(), "${styleEntity.scenes}_${styleEntity.styleNo}_点击关闭")
}
dialog?.setCanceledOnTouchOutside(true)
@ -81,10 +98,30 @@ class NotificationHintDialogFragment : BaseTrackableDialogFragment() {
override fun trackWithBasicDeviceInfo() = true
private fun getJsonFromAssets(): String? {
val stringBuilder = StringBuilder()
var bufferedReader: BufferedReader? = null
var inputStreamReader: InputStreamReader? = null
try {
inputStreamReader = InputStreamReader(requireContext().assets.open("notification_style.json"))
bufferedReader = BufferedReader(inputStreamReader)
var line: String?
while (bufferedReader.readLine().also { line = it } != null) {
stringBuilder.append(line)
}
} catch (e: IOException) {
e.printStackTrace()
} finally {
inputStreamReader?.close()
bufferedReader?.close()
}
return stringBuilder.toString()
}
companion object {
@JvmStatic
fun getInstance(hint: NotificationHint) = NotificationHintDialogFragment().apply {
mNotificationHint = hint
fun getInstance(ugc: NotificationUgc) = NotificationHintDialogFragment().apply {
mNotificationUgc = ugc
}
}
}

View File

@ -0,0 +1,305 @@
package com.gh.common.dialog
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.RelativeLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentTransaction
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gh.base.BaseRecyclerViewHolder
import com.gh.common.constant.Constants
import com.gh.common.util.*
import com.gh.common.view.CustomLinkMovementMethod
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.FragmentPackageCheckBinding
import com.gh.gamecenter.databinding.PackageCheckItemBinding
import com.gh.gamecenter.entity.DetectionObjectEntity
import com.gh.gamecenter.entity.PackageDialogEntity
import com.gh.gamecenter.eventbus.EBPackage
import com.halo.assistant.HaloApp
import com.lightgame.adapter.BaseRecyclerAdapter
import com.lightgame.dialog.BaseDialogFragment
import io.reactivex.disposables.Disposable
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
/**
* 包名检测弹窗
*/
class PackageCheckDialogFragment : BaseDialogFragment() {
private lateinit var binding: FragmentPackageCheckBinding
private var mTotalWidth = 0f
private val mDuration = 3000
private var mDisposable: Disposable? = null
private var mAdapter: PackageCheckAdapter? = null
var packageDialogEntity: PackageDialogEntity? = null
var callBack: DialogUtils.ConfirmListener? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
EventBus.getDefault().register(this)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = FragmentPackageCheckBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
packageDialogEntity?.let {
changeParams(it.detectionObjects.size)
binding.packageRv.layoutManager = LinearLayoutManager(requireContext())
mAdapter = PackageCheckAdapter(requireContext(), it.detectionObjects)
binding.packageRv.adapter = mAdapter
binding.titleTv.text = it.title
binding.contentTv.text = it.content
val spanBuilder = SpanBuilder(it.linkHintText).build()
it.links.forEachIndexed { index, link ->
val linkSpan = SpanBuilder(link.title ?: "").click(0, (link.title
?: "").length, R.color.theme_font, true) {
DirectUtils.directToLinkPage(requireContext(), link, "包名检测弹窗", "")
}.build()
spanBuilder.append(linkSpan)
if (index != it.links.size - 1) {
spanBuilder.append("")
}
}
binding.linkHintTv.text = spanBuilder
binding.linkHintTv.movementMethod = CustomLinkMovementMethod.getInstance()
when (it.level) {
"HINT_SKIP" -> {
binding.cancelTv.text = "取消"
binding.noRemindAgainCb.visibility = View.GONE
}
"ALWAYS_HINT" -> {
binding.cancelTv.text = "我知道了"
binding.noRemindAgainCb.visibility = View.GONE
}
else -> {
binding.cancelTv.text = "我知道了"
binding.noRemindAgainCb.visibility = View.VISIBLE
}
}
initListener(it)
}
checkPackage()
}
private fun changeParams(size: Int) {
val params = binding.packageRv.layoutParams as LinearLayout.LayoutParams
params.height = if (size > 3) (28f.dip2px() * 3.5).toInt() else 28f.dip2px() * size
binding.packageRv.layoutParams = params
}
private fun initListener(entity: PackageDialogEntity) {
binding.downloadBtn.setOnClickListener {
if (binding.noRemindAgainCb.isChecked) {
SPUtils.setBoolean(Constants.SP_PACKAGE_CHECK, true)
}
val isAllPackageInstalled = isAllPackageInstalled(entity)
if (isAllPackageInstalled) {
callBack?.onConfirm()
dismissAllowingStateLoss()
} else {
val packageLink = entity.links.find { it.buttonLink }
if (packageLink != null) {
DirectUtils.directToLinkPage(requireContext(), packageLink, "包名检测弹窗", "")
}
}
}
binding.cancelTv.setOnClickListener {
if (entity.level != "HINT_SKIP") {
callBack?.onConfirm()
}
if (binding.noRemindAgainCb.isChecked) {
SPUtils.setBoolean(Constants.SP_PACKAGE_CHECK, true)
}
dismissAllowingStateLoss()
}
}
private fun checkPackage() {
var index = 0
mTotalWidth = (DisplayUtils.getScreenWidth() - 108f.dip2px()).toFloat()
mDisposable = rxTimer(1) {
val width = (mTotalWidth / mDuration) * it
val params = binding.progressView.layoutParams as RelativeLayout.LayoutParams
params.width = width.toInt()
binding.progressView.layoutParams = params
packageDialogEntity?.detectionObjects?.let { objects ->
if (objects.isNotEmpty()) {
val averageTime = if (objects.size == 1) {
mDuration
} else {
mDuration / objects.size
}
if (it != 0L && it % averageTime == 0L && index < objects.size) {
mAdapter?.notifyPackages()
binding.packageRv.smoothScrollToPosition(index)
index++
}
}
}
if (it >= mDuration) {
mDisposable?.dispose()
binding.downloadBtn.isEnabled = true
binding.progressText.text = "检测完成"
binding.progressView.background = ContextCompat.getDrawable(requireContext(), R.drawable.package_check_complete_bg)
}
}
}
override fun onStart() {
super.onStart()
val width = requireContext().resources.displayMetrics.widthPixels - 60F.dip2px()
val height = ViewGroup.LayoutParams.WRAP_CONTENT
dialog?.window?.setLayout(width, height)
dialog?.setCanceledOnTouchOutside(true)
}
override fun onResume() {
super.onResume()
packageDialogEntity?.let {
if (isAllPackageInstalled(it)) {
callBack?.onConfirm()
dismissAllowingStateLoss()
}
}
}
override fun onDestroyView() {
super.onDestroyView()
EventBus.getDefault().unregister(this)
if (mDisposable?.isDisposed == false) {
mDisposable?.dispose()
}
}
//安装、卸载事件
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(busFour: EBPackage) {
if ("安装" == busFour.type || "卸载" == busFour.type) {
mAdapter?.notifyDataSetChanged()
}
}
class PackageCheckAdapter(val context: Context, val entities: ArrayList<DetectionObjectEntity>) : BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
private var index = -1
fun notifyPackages() {
index++
notifyDataSetChanged()
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return PackageCheckViewHolder(PackageCheckItemBinding.bind(LayoutInflater.from(context).inflate(R.layout.package_check_item, parent, false)))
}
override fun getItemCount(): Int = entities.size
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is PackageCheckViewHolder) {
val entity = entities[position]
holder.binding.entity = entity
if (position <= index) {
var isAllInstalled = false
entity.packages.forEach { packageName ->
val isInstalled = PackageUtils.getInstalledPackages(context, 0).find { it.packageName == packageName } != null
if (isInstalled) {
isAllInstalled = true
return@forEach
}
}
if (isAllInstalled) {
holder.binding.statusTv.text = "已安装"
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font))
} else {
holder.binding.statusTv.text = "未安装"
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.text_FF4147))
}
holder.binding.statusTv.visibility = View.VISIBLE
} else {
holder.binding.statusTv.visibility = View.GONE
}
}
}
}
class PackageCheckViewHolder(val binding: PackageCheckItemBinding) : BaseRecyclerViewHolder<DetectionObjectEntity>(binding.root)
companion object {
@JvmStatic
fun show(activity: AppCompatActivity, packageDialogEntity: PackageDialogEntity?, callBack: DialogUtils.ConfirmListener) {
if (packageDialogEntity == null) {
callBack.onConfirm()
return
}
if (isAllPackageInstalled(packageDialogEntity)) {
callBack.onConfirm()
return
}
val isChoose = SPUtils.getBoolean(Constants.SP_PACKAGE_CHECK, false)
if (packageDialogEntity.level == "OPTIONAL_HINT" && isChoose) {
callBack.onConfirm()
return
}
var dialogFragment = activity.supportFragmentManager.findFragmentByTag(PackageCheckDialogFragment::class.java.simpleName) as? PackageCheckDialogFragment
if (dialogFragment == null) {
dialogFragment = PackageCheckDialogFragment()
dialogFragment.packageDialogEntity = packageDialogEntity
dialogFragment.callBack = callBack
dialogFragment.show(activity.supportFragmentManager, PackageCheckDialogFragment::class.java.simpleName)
} else {
dialogFragment.packageDialogEntity = packageDialogEntity
dialogFragment.callBack = callBack
val transaction: FragmentTransaction = activity.supportFragmentManager.beginTransaction()
transaction.show(dialogFragment)
transaction.commit()
}
}
fun isAllPackageInstalled(packageDialogEntity: PackageDialogEntity): Boolean {
var isAllInstalled = true
val isPackagesInstall: (ArrayList<String>) -> Boolean = { packages ->
var isPackagesInstalled = false
packages.forEach {packageName->
val isInstalled = PackageUtils.getInstalledPackages(HaloApp.getInstance().application, 0).find { it.packageName == packageName } != null
if (isInstalled) {
isPackagesInstalled = true
return@forEach
}
}
isPackagesInstalled
}
packageDialogEntity.detectionObjects.forEach loop@{ obj ->
if (!isPackagesInstall(obj.packages)) {
isAllInstalled = false
return isAllInstalled
}
}
return isAllInstalled
}
}
}

View File

@ -0,0 +1,155 @@
package com.gh.common.dialog
import android.app.Dialog
import android.content.DialogInterface
import android.os.Bundle
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.TextPaint
import android.text.method.ScrollingMovementMethod
import android.text.style.ClickableSpan
import android.view.*
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentTransaction
import com.gh.base.fragment.BaseDialogFragment
import com.gh.common.util.DirectUtils.directToExternalBrowser
import com.gh.common.util.dip2px
import com.gh.common.view.CustomLinkMovementMethod
import com.gh.gamecenter.R
class PrivacyDialogFragment : BaseDialogFragment() {
// private val mLocalPrivacyHtml = "file:///android_asset/privacy_policies.html"
// private val mLocalRegulationHtml = "file:///android_asset/user_regulation.html"
var containerView: View? = null
var mCallBack: ((isSuccess: Boolean) -> Unit)? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
containerView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_privacy_protocol, null, false)
return containerView
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// val mWebViewPrivacy = containerView?.findViewById<WebView>(R.id.webView)
// val mWebViewRegulation = containerView?.findViewById<WebView>(R.id.webView2)
//
// mWebViewPrivacy?.isHorizontalScrollBarEnabled = false
// mWebViewRegulation?.isHorizontalScrollBarEnabled = false
val contentTv = containerView?.findViewById<TextView>(R.id.contentTv)
val descTv = containerView?.findViewById<TextView>(R.id.descTv)
contentTv?.movementMethod = ScrollingMovementMethod()
val skipText = SpannableStringBuilder("查看完整版的隐私政策和用户协议")
skipText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.isUnderlineText = false
}
override fun onClick(widget: View) {
directToExternalBrowser(context!!, context!!.getString(R.string.privacy_policy_url))
}
}, skipText.length - 9, skipText.length - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
skipText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.isUnderlineText = false
}
override fun onClick(widget: View) {
directToExternalBrowser(requireContext(), requireContext().getString(R.string.disclaimer_url))
}
}, skipText.length - 4, skipText.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
descTv?.movementMethod = CustomLinkMovementMethod()
descTv?.text = skipText
// val mWebViewPrivacy = containerView?.findViewById<WebView>(R.id.webView)
//
// mWebViewPrivacy?.isHorizontalScrollBarEnabled = false
//
// val settingsArrayList = arrayListOf(mWebViewPrivacy?.settings, mWebViewRegulation?.settings)
//
// for (settings in settingsArrayList) {
// settings?.javaScriptEnabled = true
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// settings?.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
// }
// // 避免提示网页有害信息不能访问
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// settings?.safeBrowsingEnabled = false
// }
//
// // 适配大于屏幕宽度的页面
// settings?.useWideViewPort = true
// settings?.loadWithOverviewMode = true
// settings?.domStorageEnabled = true
//
// // 自适应屏幕
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// settings?.layoutAlgorithm = WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING
// }
// }
// mWebViewPrivacy?.webViewClient = client
// mWebViewRegulation?.webViewClient = client
containerView?.findViewById<View>(R.id.refuseTv)?.setOnClickListener {
mCallBack?.invoke(false)
dismissAllowingStateLoss()
}
containerView?.findViewById<View>(R.id.agreeTv)?.setOnClickListener {
mCallBack?.invoke(true)
dismissAllowingStateLoss()
}
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val createDialog = super.onCreateDialog(savedInstanceState)
createDialog.setCanceledOnTouchOutside(false)
createDialog.setOnKeyListener(object : DialogInterface.OnKeyListener {
override fun onKey(dialog: DialogInterface?, keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK) {
return true
}
return false
}
})
val window = createDialog.window
window?.setGravity(Gravity.CENTER)
return createDialog
}
override fun onStart() {
super.onStart()
val width = requireContext().resources.displayMetrics.widthPixels - 60F.dip2px()
val height = ViewGroup.LayoutParams.WRAP_CONTENT
dialog?.window?.setLayout(width, height)
}
companion object {
@JvmStatic
fun show(activity: AppCompatActivity, callBack: ((isSuccess: Boolean) -> Unit)?) {
var privacyDialogFragment = activity.supportFragmentManager.findFragmentByTag(PrivacyDialogFragment::class.java.simpleName) as? PrivacyDialogFragment
if (privacyDialogFragment != null) {
privacyDialogFragment.mCallBack = callBack
val transaction: FragmentTransaction = activity.supportFragmentManager.beginTransaction()
transaction.show(privacyDialogFragment)
transaction.commit()
} else {
privacyDialogFragment = PrivacyDialogFragment().apply {
mCallBack = callBack
}
privacyDialogFragment.show(activity.supportFragmentManager, PrivacyDialogFragment::class.java.simpleName)
}
}
}
}

View File

@ -4,48 +4,80 @@ import android.annotation.SuppressLint
import android.app.Application
import android.os.Bundle
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.*
import android.view.animation.AnimationUtils
import android.widget.EditText
import android.widget.TextView
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Observer
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.OnClick
import com.gh.base.fragment.BaseDialogFragment
import com.gh.common.AppExecutor
import com.gh.common.constant.Config
import com.gh.common.history.HistoryHelper
import com.gh.common.repository.ReservationRepository
import com.gh.common.util.*
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.NotificationUgc
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import org.json.JSONArray
import org.json.JSONObject
// 预约弹窗
class ReserveDialogFragment : BaseTrackableDialogFragment() {
class ReserveDialogFragment
: BaseDialogFragment(), KeyboardHeightObserver {
// : BaseTrackableDialogFragment() {
@BindView(R.id.reserve_hint_tv)
lateinit var reserveHintTv: TextView
@BindView(R.id.reserve_content_tv)
lateinit var reserveContentTv: TextView
@BindView(R.id.reserve_completed_content_tv)
lateinit var reserveCompletedContentTv: TextView
@BindView(R.id.mobile_et)
lateinit var mobileEt: EditText
@BindView(R.id.reserve_container)
lateinit var reserveContainer: View
@BindView(R.id.reserve_completed_container)
lateinit var reserveCompletedContainer: View
@BindView(R.id.customizable_btn)
lateinit var customizableBtn: TextView
@BindView(R.id.content_container)
lateinit var contentContainer: View
@BindView(R.id.mobile_index_container)
lateinit var mobileIndexContainer: View
@BindView(R.id.mobile_index_reserve)
lateinit var mobileIndexReserve: TextView
@BindView(R.id.mobile_index_user)
lateinit var mobileIndexUser: TextView
@BindView(R.id.mobile_et_delete)
lateinit var mobileEtDelete: View
@BindView(R.id.layout_container)
lateinit var layoutContainer: View
private lateinit var mViewModel: ReserveViewModel
private var mSuccessCallback: SuccessCallback? = null
@ -54,23 +86,32 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
private var mGameId: String = ""
private var mGameName: String = ""
private var mKeyboardHeightProvider: KeyboardHeightProvider? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mViewModel = viewModelProvider()
mKeyboardHeightProvider = KeyboardHeightProvider(activity)
mKeyboardHeightProvider?.start()
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.dialog_reserve_game, null)
}
override fun getEvent(): String {
return "预约游戏"
}
override fun getKey(): String {
return "预约功能操作"
}
// override fun getEvent(): String {
// return "预约游戏"
// }
//
// override fun getKey(): String {
// return "预约功能操作"
// }
@Suppress("DEPRECATION")
@SuppressLint("SetTextI18n")
@ -78,11 +119,14 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
super.onViewCreated(view, savedInstanceState)
ButterKnife.bind(this, view)
val reserveContent = "游戏上线,您将<font color='#ff4147'>免费</font>收到短信提醒"
val reserveContent = "游戏上线,您将收到<font color='#1383EB'>免费短信</font>提醒"
reserveContentTv.text = Html.fromHtml(reserveContent)
mobileEt.setText(UserManager.getInstance().userInfoEntity.mobile)
mobileEt.setSelection(mobileEt.text.length)
mobileEt.setTextChangedListener { s, _, _, _ ->
mobileIndexContainer.visibility = View.GONE
mobileEtDelete.goneIf(s.trim().isEmpty())
}
mViewModel.reservation.observeNonNull(this) {
if (it.success) {
@ -91,6 +135,11 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
HistoryHelper.insertGameEntity(mGame!!)
}
}
mViewModel.reserveMobile.observe(viewLifecycleOwner, Observer {
setMobileIndexHint(it)
})
dialog?.setCanceledOnTouchOutside(true)
}
@ -109,7 +158,7 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
} else {
customizableBtn.text = dialogConfig?.text
customizableBtn.setOnClickListener {
MtaHelper.onEvent("预约游戏", "预约功能操作", "点击跳转按钮")
// MtaHelper.onEvent("预约游戏", "预约功能操作", "点击跳转按钮")
DirectUtils.directToLinkPage(
requireContext(),
dialogConfig!!.toLinkEntity(),
@ -120,35 +169,132 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
}
}
private fun setMobileIndexHint(reserveMobile: String?) {
var userMobile = UserManager.getInstance().userInfoEntity?.mobile
if (reserveMobile == userMobile) userMobile = null
if (!reserveMobile.isNullOrEmpty()) {
mobileIndexReserve.visibility = View.VISIBLE
mobileIndexReserve.text = reserveMobile
} else {
mobileIndexReserve.visibility = View.GONE
}
if (!userMobile.isNullOrEmpty()) {
mobileIndexUser.visibility = View.VISIBLE
mobileIndexUser.text = userMobile
} else {
mobileIndexUser.visibility = View.GONE
}
mobileIndexContainer.goneIf(mobileIndexUser.visibility == View.GONE && mobileIndexReserve.visibility == View.GONE)
if (mobileIndexContainer.visibility ==View.VISIBLE) {
mobileIndexContainer.animation = AnimationUtils.loadAnimation(requireContext(), R.anim.reserve_dialog_index_anim)
}
}
@OnClick(R.id.reserve_with_mobile_btn,
R.id.reserve_without_mobile_btn,
R.id.content_container,
R.id.close_btn,
R.id.customizable_btn)
R.id.customizable_btn,
R.id.mobile_index_reserve,
R.id.mobile_index_user,
R.id.mobile_et_delete,
R.id.mobile_et,
R.id.layout_container)
fun onClick(view: View) {
when (view.id) {
R.id.reserve_without_mobile_btn -> {
MtaHelper.onEvent("预约游戏", "预约功能操作", "点击无手机号预约")
// MtaHelper.onEvent("预约游戏", "预约功能操作", "点击无手机号预约")
if (mobileIndexContainer.visibility == View.VISIBLE) {
mobileIndexContainer.visibility = View.GONE
return
}
mViewModel.reserve(gameId = mGameId, gameName = mGameName)
}
R.id.reserve_with_mobile_btn -> {
if (mobileIndexContainer.visibility == View.VISIBLE) {
mobileIndexContainer.visibility = View.GONE
return
}
val mobile = mobileEt.text.toString()
if (mobile.length < 11 || !mobile.startsWith("1")) {
Utils.toast(context, "手机号格式错误,请检查并重新输入")
return
}
MtaHelper.onEvent("预约游戏", "预约功能操作", "点击立即预约")
// MtaHelper.onEvent("预约游戏", "预约功能操作", "点击立即预约")
mViewModel.reserve(gameId = mGameId, gameName = mGameName, mobile = mobile)
}
R.id.close_btn -> {
MtaHelper.onEvent("预约游戏", "预约功能操作", "点击关闭")
// MtaHelper.onEvent("预约游戏", "预约功能操作", "点击关闭")
dismissAllowingStateLoss()
AppExecutor.uiExecutor.executeWithDelay(Runnable {
NotificationHelper.showNotificationHintDialog(NotificationUgc.RESERVE_GAME)
}, 1000)
}
R.id.content_container -> {
mobileIndexContainer.visibility = View.GONE
}
R.id.mobile_index_reserve -> {
mobileEt.setText(mobileIndexReserve.text.toString())
mobileEt.setSelection(mobileEt.text.length)
mobileIndexContainer.visibility = View.GONE
}
R.id.mobile_index_user -> {
mobileEt.setText(mobileIndexUser.text.toString())
mobileEt.setSelection(mobileEt.text.length)
mobileIndexContainer.visibility = View.GONE
}
R.id.mobile_et_delete -> {
mobileEt.setText("")
}
R.id.mobile_et -> {
mobileIndexContainer.visibility = View.GONE
}
R.id.layout_container -> {
dismissAllowingStateLoss()
}
}
}
override fun onResume() {
super.onResume()
if (HaloApp.getInstance().mCacheKeyboardHeight > 0) {
val attributes = dialog?.window?.attributes
val heightPixels = requireContext().resources.displayMetrics.heightPixels
val mCacheKeyboardHeight = HaloApp.getInstance().mCacheKeyboardHeight
val statusBarHeight = DisplayUtils.getStatusBarHeight(requireContext().resources)
dialog?.window?.attributes?.height = heightPixels - mCacheKeyboardHeight - statusBarHeight
attributes?.gravity = Gravity.TOP
dialog?.window?.attributes = attributes
}
mKeyboardHeightProvider?.setKeyboardHeightObserver(this)
}
override fun onPause() {
super.onPause()
mKeyboardHeightProvider?.setKeyboardHeightObserver(null)
}
override fun onDestroy() {
super.onDestroy()
mKeyboardHeightProvider?.close()
}
override fun onKeyboardHeightChanged(height: Int, orientation: Int) {
if (height > 0) {
val attributes = dialog?.window?.attributes
attributes?.gravity = Gravity.CENTER
dialog?.window?.attributes = attributes
HaloApp.getInstance().mCacheKeyboardHeight = height
}
}
companion object {
@JvmStatic
fun getInstance(gameEntity: GameEntity, successCallback: SuccessCallback) = ReserveDialogFragment().apply {
@ -167,6 +313,12 @@ class ReserveDialogFragment : BaseTrackableDialogFragment() {
class ReserveViewModel(application: Application) : AndroidViewModel(application) {
val reservation = MutableLiveData<Reservation>()
val reserveMobile = MutableLiveData<String>()
init {
getAppointmentMobile()
}
@SuppressLint("CheckResult")
fun reserve(gameId: String, gameName: String, mobile: String = "") {
@ -189,7 +341,7 @@ class ReserveViewModel(application: Application) : AndroidViewModel(application)
reservation.postValue(Reservation(success = true, withMobile = mobile.isNotEmpty(), boundWechat = boundWechat))
ReservationRepository.addReservationToMemoryAndRefresh(gameId)
MtaHelper.onEvent("预约游戏", "预约", gameName)
// MtaHelper.onEvent("预约游戏", "预约", gameName)
}
override fun onFailure(exception: Exception) {
@ -198,5 +350,30 @@ class ReserveViewModel(application: Application) : AndroidViewModel(application)
})
}
@SuppressLint("CheckResult")
private fun getAppointmentMobile() {
RetrofitManager.getInstance(getApplication()).api
.getAppointmentMobile(UserManager.getInstance().userId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
var mobile: String? = null
tryCatchInRelease {
val jsonArray = JSONArray(data.string())
if (jsonArray.length() > 0) {
mobile = jsonArray.get(0).toString()
}
}
reserveMobile.postValue(mobile)
}
override fun onFailure(exception: Exception) {
reserveMobile.postValue(null)
}
})
}
class Reservation(var success: Boolean = false, var withMobile: Boolean = false, var boundWechat: Boolean = false)
}

View File

@ -11,8 +11,19 @@ data class ExposureEntity(
@SerializedName("game_id")
val gameId: String? = "",
val gameName: String? = "",
val gameVersion: String? = "",
val sequence: Int? = 0,
val platform: String? = "",
val downloadType: String? = "",
val downloadCompleteType: String? = ""
val downloadCompleteType: String? = "",
// 下载地址的 host 和 path
var host: String? = "",
var path: String? = "",
// 统计启动弹窗相关数据用的 (ugly)
@SerializedName("dialog_id")
var welcomeDialogId: String? = "",
@SerializedName("link_title")
var welcomeDialogLinkTitle: String? = ""
) : Parcelable

View File

@ -8,6 +8,7 @@ import com.gh.common.constant.Constants
import com.gh.common.exposure.meta.Meta
import com.gh.common.exposure.meta.MetaUtil
import com.gh.common.exposure.time.TimeUtil
import com.gh.common.util.getFirstElementDividedByDivider
import com.gh.gamecenter.entity.GameEntity
import kotlinx.android.parcel.Parcelize
import java.util.*
@ -25,15 +26,25 @@ data class ExposureEvent(
@PrimaryKey
val id: String = UUID.randomUUID().toString()) : Parcelable {
companion object {
// TODO 建一个 exposureEvent 池规避反复生成对象
@JvmStatic
fun createEvent(gameEntity: GameEntity?, source: List<ExposureSource>, eTrace: List<ExposureEvent>? = null, event: ExposureType = ExposureType.EXPOSURE): ExposureEvent {
if (gameEntity?.getApk()?.size == 1) {
gameEntity.gameVersion = gameEntity.getApk().elementAtOrNull(0)?.version ?: ""
}
return ExposureEvent(
payload = ExposureEntity(gameId = gameEntity?.id,
payload = ExposureEntity(
gameId = gameEntity?.id?.getFirstElementDividedByDivider(Constants.GAME_ID_DIVIDER),
gameName = gameEntity?.name?.removeSuffix(Constants.GAME_NAME_DECORATOR),
gameVersion = gameEntity?.gameVersion,
sequence = gameEntity?.sequence,
platform = gameEntity?.platform,
downloadType = gameEntity?.downloadType,
downloadCompleteType = gameEntity?.downloadCompleteType),
downloadCompleteType = gameEntity?.downloadCompleteType,
// ugly
welcomeDialogId = gameEntity?.welcomeDialogId ?: eTrace?.firstOrNull()?.payload?.welcomeDialogId,
welcomeDialogLinkTitle = gameEntity?.welcomeDialogTitle ?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle),
source = source,
eTrace = eTrace,
event = event).apply { gameEntity?.exposureEvent = this }

View File

@ -26,6 +26,10 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
visibleState?.let { commitExposure(it) }
throttleBus?.clear()
}
override fun onFragmentViewDestroyed(fm: FragmentManager, f: Fragment) {
fragment.fragmentManager?.unregisterFragmentLifecycleCallbacks(this)
}
}, false)
}
@ -39,7 +43,7 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
if (layoutManager == null) layoutManager = recyclerView.layoutManager as LinearLayoutManager
layoutManager?.run {
visibleState = ExposureThrottleBus.VisibleState(findFirstCompletelyVisibleItemPosition(), findLastCompletelyVisibleItemPosition())
visibleState = ExposureThrottleBus.VisibleState(findFirstVisibleItemPosition(), findLastVisibleItemPosition())
throttleBus?.postVisibleState(visibleState!!)
}
}
@ -51,7 +55,7 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
val eventList = arrayListOf<ExposureEvent>()
for (pos in visibleState.firstCompletelyVisible..visibleState.lastCompletelyVisible) {
for (pos in visibleState.firstVisiblePosition..visibleState.lastVisiblePosition) {
try {
exposable.getEventByPosition(pos)?.let { eventList.add(it) }
exposable.getEventListByPosition(pos)?.let { eventList.addAll(it) }

View File

@ -3,13 +3,13 @@ package com.gh.common.exposure
import com.aliyun.sls.android.sdk.model.LogGroup
import com.gh.common.exposure.time.TimeUtil
import com.gh.common.util.toJson
import com.gh.common.util.tryWithDefaultCatch
import com.gh.gamecenter.BuildConfig
import com.gh.loghub.LgLOG
import com.gh.loghub.LoghubHelper
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import java.util.concurrent.Executors
import kotlin.concurrent.fixedRateTimer
/**
* A handful tool for committing logs to aliyun loghub.
@ -17,7 +17,7 @@ import kotlin.concurrent.fixedRateTimer
* 如何简单地统计列表中每个 item 的曝光事件?
*
* 1. Adapter 实现 IExposable 接口,在 BindView 阶段更新 ExposureEventExposureEvent 供 getEventByPosition(pos) 方法获取用
* 2. 构建一个 ExposureListener 并作为入参添加至 recyclerview 的 Scroll 回调中
* 2. 构建一个 ExposureListener 并作为入参添加至 recyclerview 的 onScroll 回调中
* 3. 没了
*/
object ExposureManager {
@ -25,7 +25,6 @@ object ExposureManager {
private const val ENDPOINT = "cn-qingdao.log.aliyuncs.com"
private const val PROJECT = "ghzs"
private const val STORE_SIZE = 100
private const val STORE_FORCE_UPLOAD_PERIOD = 300 * 1000L
private const val LOG_STORE = BuildConfig.EXPOSURE_REPO
private val loghubHelper = LoghubHelper.getInstance()
@ -38,18 +37,12 @@ object ExposureManager {
@JvmStatic
fun init() {
TimeUtil.init()
loghubHelper.init(HaloApp.getInstance().application, ENDPOINT, PROJECT, LOG_STORE) { TimeUtil.currentTimeMillis() }
exposureExecutor.execute {
val eventList = exposureDao.getAll()
exposureSet.addAll(eventList)
}
fixedRateTimer(name = "ExposureManager-Store-Checker", initialDelay = 500, period = STORE_FORCE_UPLOAD_PERIOD) {
commitSavedExposureEvents(true)
}
}
/**
@ -102,15 +95,18 @@ object ExposureManager {
*/
fun commitSavedExposureEvents(forced: Boolean = false) {
exposureExecutor.execute {
if (exposureSet.size < STORE_SIZE && !forced || exposureSet.size == 0) return@execute
tryWithDefaultCatch {
// TODO 初始化 loghubHelper 去掉这个 tryCatch 块
if (exposureSet.size < STORE_SIZE && !forced || exposureSet.size == 0) return@execute
val exposureList = exposureSet.toList()
// uploadLogGroup 是一个异步方法LoghubHelper 里面实现了重传功能,所以这里交给它就好了
loghubHelper.uploadLogGroup(buildLogGroup(exposureList))
val exposureList = exposureSet.toList()
// uploadLogGroup 是一个异步方法LoghubHelper 里面实现了重传功能,所以这里交给它就好了
loghubHelper.uploadLogGroup(buildLogGroup(exposureList))
Utils.log("Exposure", "提交了${exposureList.size}条曝光记录")
exposureSet.removeAll(exposureList)
exposureDao.deleteMany(exposureList)
Utils.log("Exposure", "提交了${exposureList.size}条曝光记录")
exposureSet.removeAll(exposureList)
exposureDao.deleteMany(exposureList)
}
}
}

View File

@ -38,21 +38,21 @@ class ExposureThrottleBus(var onSuccess: Consumer<VisibleState>, var onError: Co
mPublishSubject.onNext(visibleState)
}
class VisibleState(val firstCompletelyVisible: Int, val lastCompletelyVisible: Int) {
class VisibleState(val firstVisiblePosition: Int, val lastVisiblePosition: Int) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || javaClass != other.javaClass) return false
val that = other as VisibleState
if (firstCompletelyVisible != that.firstCompletelyVisible) return false
if (firstVisiblePosition != that.firstVisiblePosition) return false
return lastCompletelyVisible == that.lastCompletelyVisible
return lastVisiblePosition == that.lastVisiblePosition
}
override fun hashCode(): Int {
var result = firstCompletelyVisible
result = 31 * result + lastCompletelyVisible
var result = firstVisiblePosition
result = 31 * result + lastVisiblePosition
return result
}
}

View File

@ -1,5 +1,6 @@
package com.gh.common.exposure
import android.text.TextUtils
import com.g00fy2.versioncompare.Version
import com.gh.common.constant.Constants
import com.gh.common.util.PackageUtils
@ -22,6 +23,7 @@ object ExposureUtils {
} else {
entity.id
}
gameEntity.gameVersion = entity.getApk().elementAtOrNull(0)?.version ?: gameEntity.gameVersion
gameEntity.platform = platform
gameEntity.downloadType = downloadType.toString()
val exposureEvent = ExposureEvent.createEvent(gameEntity = gameEntity,
@ -36,6 +38,8 @@ object ExposureUtils {
fun logADownloadCompleteExposureEvent(entity: GameEntity,
platform: String?,
trace: String?,
host: String? = "unknown",
path: String? = "unknown",
downloadType: DownloadType) {
val gameEntity = entity.clone()
gameEntity.platform = platform
@ -45,6 +49,8 @@ object ExposureUtils {
source = traceEvent?.source ?: ArrayList(),
eTrace = ExposureTraceUtils.appendTrace(traceEvent),
event = ExposureType.DOWNLOAD_COMPLETE)
exposureEvent.payload.host = host
exposureEvent.payload.path = path
ExposureManager.log(exposureEvent)
ExposureManager.commitSavedExposureEvents(forced = true)
}
@ -63,7 +69,11 @@ object ExposureUtils {
}
}
} else {
DownloadType.PLUGIN_DOWNLOAD
if (!TextUtils.isEmpty(apkEntity.ghVersion)) {
DownloadType.PLUGIN_DOWNLOAD
} else {
DownloadType.UPDATE
}
}
} else {
DownloadType.DOWNLOAD

View File

@ -5,17 +5,17 @@ import android.app.Application
import android.content.Context
import android.content.pm.PackageManager
import android.net.ConnectivityManager
import android.net.wifi.WifiManager
import android.os.Build
import android.provider.Settings
import android.telephony.TelephonyManager
import android.text.TextUtils
import com.gh.common.constant.Constants
import com.gh.common.util.SPUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.manager.UserManager
import com.halo.assistant.HaloApp
import com.leon.channel.helper.ChannelReaderUtil
import com.walkud.rom.checker.RomIdentifier
import java.io.File
object MetaUtil {
@ -23,9 +23,12 @@ object MetaUtil {
private var channel = ""
private var m: Meta? = null
private var imei: String? = null
private var base64EncodedImei: String? = null
private var androidId: String? = null
fun refreshMeta() {
m = Meta(mac = getMac(),
m = Meta(mac = "",
imei = getIMEI(),
model = getModel(),
manufacturer = getManufacturer(),
@ -57,60 +60,65 @@ object MetaUtil {
return channel
}
/**
* Get MAC address
* TODO check > 6.0 results
*/
fun getMac(): String? {
var mac: String = ""
//Plan A
try {
mac = File("/sys/class/net/wlan0/address").inputStream().bufferedReader().use { it.readText() }
if (!TextUtils.isEmpty(mac)) return mac.trim()
} catch (e: Exception) {
// e.printStackTrace()
}
// Plan B
try {
mac = File("/sys/class/net/eth0/address").inputStream().bufferedReader().use { it.readText() }
if (!TextUtils.isEmpty(mac)) return mac.trim()
} catch (e: Exception) {
// e.printStackTrace()
}
// Plan C
val wifiManager = application.getSystemService(Context.WIFI_SERVICE) as WifiManager
try {
mac = wifiManager.connectionInfo.macAddress
} catch (e: Exception) {
// e.printStackTrace()
}
return mac.trim()
}
/**
* Get IMEI
*/
fun getIMEI(): String? {
@JvmStatic
fun getIMEI(): String {
if (application.checkCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED)
if (!HaloApp.isUserAcceptPrivacyPolicy(HaloApp.getInstance().application)) {
return ""
}
if (imei != null) {
return imei ?: ""
}
imei = SPUtils.getString(Constants.SP_IMEI)
if (!TextUtils.isEmpty(imei)) {
return imei ?: ""
}
if (application.checkCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
return ""
}
val telephonyManager = application.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
if (Build.VERSION.SDK_INT >= 26) {
return telephonyManager.imei
if (Build.VERSION.SDK_INT >= 29) {
return "".apply {
imei = this
SPUtils.setString(Constants.SP_IMEI, this)
}
} else if (Build.VERSION.SDK_INT >= 26) {
return (telephonyManager.imei ?: "").apply {
imei = this
SPUtils.setString(Constants.SP_IMEI, this)
}
}
return telephonyManager.getDeviceId()
return (telephonyManager.getDeviceId() ?: "").apply {
imei = this
SPUtils.setString(Constants.SP_IMEI, this)
}
}
@JvmStatic
fun getBase64EncodedIMEI(): String {
if (TextUtils.isEmpty(base64EncodedImei) && imei != null) {
try {
base64EncodedImei = android.util.Base64.encodeToString(getIMEI().trim().toByteArray(), android.util.Base64.NO_WRAP)
} catch (e: java.lang.Exception) {
e.printStackTrace()
return ""
}
}
return base64EncodedImei ?: ""
}
fun getModel(): String? {
return Build.MODEL
}
@ -119,14 +127,35 @@ object MetaUtil {
return Build.MANUFACTURER
}
fun getAndroidId(): String? {
var android_id: String = ""
try {
android_id = Settings.Secure.getString(application.contentResolver, Settings.Secure.ANDROID_ID)
@JvmStatic
fun getAndroidId(): String {
if (!HaloApp.isUserAcceptPrivacyPolicy(HaloApp.getInstance().application)) {
return ""
}
if (androidId != null) {
return androidId ?: ""
}
androidId = SPUtils.getString(Constants.SP_ANDROID_ID)
if (!TextUtils.isEmpty(androidId)) {
return androidId ?: ""
}
return try {
Settings.Secure.getString(application.contentResolver, Settings.Secure.ANDROID_ID).apply {
androidId = this
SPUtils.setString(Constants.SP_ANDROID_ID, this)
}
} catch (e: Exception) {
e.printStackTrace()
androidId = ""
SPUtils.setString(Constants.SP_ANDROID_ID, "")
""
}
return android_id
}
fun getAndroidSDK(): Int? {

View File

@ -1,30 +0,0 @@
package com.gh.common.exposure.time
import com.gh.gamecenter.entity.TimeEntity
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.schedulers.Schedulers
import kotlin.concurrent.fixedRateTimer
class Corrector {
companion object {
const val TIME_CORRECTOR_ADJUST_PERIOD: Long = 600000
}
var delta: Long = 0
init {
fixedRateTimer("TimeUtil-Corrector-Checker", initialDelay = 0, period = TIME_CORRECTOR_ADJUST_PERIOD) {
RetrofitManager.getInstance(HaloApp.getInstance().application).api.time
.subscribeOn(Schedulers.io())
.subscribe(object : Response<TimeEntity>() {
override fun onResponse(response: TimeEntity?) {
val serverTime = response?.time
serverTime?.let { delta = it * 1000 - System.currentTimeMillis() }
}
})
}
}
}

View File

@ -1,23 +1,15 @@
package com.gh.common.exposure.time
import com.gh.common.FixedRateJobHelper
object TimeUtil {
private lateinit var corrector: Corrector
fun init() {
corrector = Corrector()
}
fun currentTimeMillis(): Long {
return corrector.delta + System.currentTimeMillis()
return FixedRateJobHelper.timeDeltaBetweenServerAndClient + System.currentTimeMillis()
}
fun currentTime(): Int {
return if (::corrector.isInitialized) {
((corrector.delta + System.currentTimeMillis()) / 1000).toInt()
} else {
(System.currentTimeMillis() / 1000).toInt()
}
return ((FixedRateJobHelper.timeDeltaBetweenServerAndClient + System.currentTimeMillis()) / 1000).toInt()
}
}

View File

@ -0,0 +1,21 @@
package com.gh.common.filter
import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName
@Keep
data class RegionSetting(
@SerializedName("game_mirror")
var mirrorGameIdSet: HashSet<String>,
@SerializedName("game_block")
var filterGameIdSet: HashSet<String>,
@SerializedName("channel_control")
var channelControl: ChannelControl) {
@Keep
data class ChannelControl(
@SerializedName("game_category")
var gameCategory: String,
@SerializedName("effect")
var effect: Boolean)
}

View File

@ -0,0 +1,101 @@
package com.gh.common.filter
import android.annotation.SuppressLint
import com.gh.common.AppExecutor
import com.gh.common.constant.Constants
import com.gh.common.util.SPUtils
import com.gh.common.util.debounceActionWithInterval
import com.gh.common.util.toJson
import com.gh.common.util.toObject
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Function
object RegionSettingHelper {
private var mChannelControl: RegionSetting.ChannelControl? = null
private var mFilterGameIdSet: HashSet<String>? = hashSetOf()
private var mDisplayMirrorIfoGameIdSet: HashSet<String>? = hashSetOf()
private const val SP_SETTING = "region_setting"
fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return mDisplayMirrorIfoGameIdSet?.contains(gameId) ?: false
}
@JvmStatic
fun shouldThisGameBeFiltered(gameId: String?): Boolean {
return mFilterGameIdSet?.contains(gameId) ?: false
}
@JvmStatic
fun filterGame(list: List<GameEntity>?): ArrayList<GameEntity> {
if (list == null) return arrayListOf()
if (mFilterGameIdSet?.isEmpty() == true) {
if (list is ArrayList) return list
}
val listCopy: ArrayList<GameEntity> = if (list is ArrayList) list else ArrayList(list)
listCopy.removeAll { mFilterGameIdSet?.contains(it.id) ?: false }
return listCopy
}
@JvmField
var filterGame = Function { list: List<GameEntity> ->
filterGame(list)
list
}
fun shouldGameOfThisCategoryUseMirrorInfo(category: String): Boolean {
return if (mChannelControl == null || mChannelControl?.effect == false || !isUserUsedLessThan24Hours()) {
false
} else {
mChannelControl?.gameCategory == category
}
}
@SuppressLint("CheckResult")
@JvmStatic
fun getRegionSetting() {
debounceActionWithInterval(R.string.app_name, 3000) {
// 使用默认的 Schdulers.io() 可能会触发 OOM
RetrofitManager.getInstance(HaloApp.getInstance().application)
.sensitiveApi
.getRegionSetting(HaloApp.getInstance().channel)
.subscribeOn(AppExecutor.cachedScheduler)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<RegionSetting>() {
override fun onSuccess(data: RegionSetting) {
updateSettingsInMemory(data)
SPUtils.setString(SP_SETTING, data.toJson())
}
override fun onFailure(exception: Exception) {
SPUtils.getString(SP_SETTING).toObject<RegionSetting>()?.let {
updateSettingsInMemory(it)
}
}
})
}
}
private fun updateSettingsInMemory(data: RegionSetting) {
mFilterGameIdSet = data.filterGameIdSet
mDisplayMirrorIfoGameIdSet = data.mirrorGameIdSet
mChannelControl = data.channelControl
}
/**
* 该用户是否是使用了不到 24 小时的新用户
*/
private fun isUserUsedLessThan24Hours(): Boolean {
val initialUsageTime = SPUtils.getLong(Constants.SP_INITIAL_USAGE_TIME, 0)
return !(initialUsageTime == 0L || System.currentTimeMillis() - initialUsageTime > 86400000)
}
}

View File

@ -15,7 +15,7 @@ import com.gh.gamecenter.room.converter.*
import com.gh.gamecenter.room.dao.*
import com.halo.assistant.HaloApp
@Database(entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class], version = 5, exportSchema = false)
@Database(entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class], version = 7, exportSchema = false)
@TypeConverters(CountConverter::class,
CommunityConverter::class,
TimeConverter::class,
@ -23,7 +23,8 @@ import com.halo.assistant.HaloApp
ThumbnailConverter::class,
TagStyleListConverter::class,
StringArrayListConverter::class,
CommunityVideoConverter::class)
CommunityVideoConverter::class,
UserConverter::class)
abstract class HistoryDatabase : RoomDatabase() {
@ -54,11 +55,27 @@ abstract class HistoryDatabase : RoomDatabase() {
}
}
val MIGRATION_5_6: Migration = object : Migration(5, 6) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("Alter TABLE MyVideoEntity add title TEXT NOT NULL DEFAULT ''")
database.execSQL("Alter TABLE MyVideoEntity add commentCount INTEGER NOT NULL DEFAULT 0")
database.execSQL("Alter TABLE MyVideoEntity add user TEXT NOT NULL DEFAULT ''")
}
}
val MIGRATION_6_7: Migration = object : Migration(6, 7) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("Alter TABLE HistoryGameEntity add iconSubscript TEXT DEFAULT ''")
}
}
val instance by lazy {
Room.databaseBuilder(HaloApp.getInstance().application, HistoryDatabase::class.java, "USER_TRACK_HISTORY_DATABASE")
.addMigrations(MIGRATION_2_3)
.addMigrations(MIGRATION_3_4)
.addMigrations(MIGRATION_4_5)
.addMigrations(MIGRATION_5_6)
.addMigrations(MIGRATION_6_7)
.build()
}
}

View File

@ -4,6 +4,7 @@ import com.gh.common.runOnIoThread
import com.gh.common.util.clearHtmlFormatCompletely
import com.gh.common.util.removeInsertedContent
import com.gh.common.util.removeVideoContent
import com.gh.common.util.tryCatchInRelease
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.qa.entity.AnswerDetailEntity
import com.gh.gamecenter.qa.entity.AnswerEntity
@ -14,34 +15,36 @@ object HistoryHelper {
fun insertAnswerEntity(answerDetailEntity: AnswerDetailEntity) {
val answerEntity = convertAnswerDetailToAnswer(answerDetailEntity)
runOnIoThread { HistoryDatabase.instance.answerDao().addAnswer(answerEntity) }
// 偶尔有设备会出现磁盘满了写不进数据库的问题 database or disk is full 异常,毕竟只是插入个本地历史,这里直接捕抓
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.answerDao().addAnswer(answerEntity) } }
}
fun insertArticleEntity(articleDetailEntity: ArticleDetailEntity) {
val articleEntity = convertArticleDetailToArticle(articleDetailEntity)
runOnIoThread { HistoryDatabase.instance.articleDao().addArticle(articleEntity) }
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.articleDao().addArticle(articleEntity) } }
}
@JvmStatic
fun insertGameEntity(gameEntity: GameEntity) {
val historyGameEntity = convertGameEntityToHistoryGameEntity(gameEntity)
runOnIoThread { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) }
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) } }
}
@JvmStatic
fun insertGameEntity(updateEntity: GameUpdateEntity) {
val historyGameEntity = convertGameUpdateEntityToHistoryGameEntity(updateEntity)
runOnIoThread { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) }
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) } }
}
private fun convertGameUpdateEntityToHistoryGameEntity(updateEntity: GameUpdateEntity): HistoryGameEntity{
private fun convertGameUpdateEntityToHistoryGameEntity(updateEntity: GameUpdateEntity): HistoryGameEntity {
val historyGame = HistoryGameEntity()
historyGame.orderTag = System.currentTimeMillis()
historyGame.id = updateEntity.id
historyGame.brief = updateEntity.brief
historyGame.des = ""
historyGame.icon = updateEntity.icon
historyGame.icon = updateEntity.rawIcon ?: updateEntity.icon
historyGame.iconSubscript = historyGame.iconSubscript
historyGame.name = updateEntity.name
historyGame.tagStyle = updateEntity.tagStyle
historyGame.tag = updateEntity.tag
@ -55,11 +58,11 @@ object HistoryHelper {
historyGame.id = gameEntity.id
historyGame.brief = gameEntity.brief
historyGame.des = gameEntity.des
historyGame.icon = gameEntity.icon
historyGame.icon = gameEntity.rawIcon ?: gameEntity.icon
historyGame.iconSubscript = gameEntity.iconSubscript
historyGame.name = gameEntity.name
historyGame.tagStyle = gameEntity.tagStyle
historyGame.tag = gameEntity.getTag()
historyGame.isLibaoExist = gameEntity.isLibaoExists
return historyGame
}
@ -109,6 +112,7 @@ object HistoryHelper {
clearHtmlFormatCompletely().
replace(" +".toRegex()," ")
articleEntity.count = articleDetailEntity.count
articleDetailEntity.community.id = articleDetailEntity.communityId
articleEntity.community = articleDetailEntity.community
articleEntity.time = articleDetailEntity.time
articleEntity.title = articleDetailEntity.title

View File

@ -0,0 +1,10 @@
package com.gh.common.iinterface
@Suppress("SpellCheckingInspection")
interface IOffsetable {
fun getOffset(position: Int): Int
fun updateOffset(position: Int, offset: Int)
fun resetOffset()
}

View File

@ -0,0 +1,5 @@
package com.gh.common.iinterface
interface IScrollable {
fun scrollToTop()
}

View File

@ -1,67 +1,67 @@
package com.gh.common.im
import android.app.Activity
import androidx.core.view.ViewCompat
import android.view.View
import android.view.ViewGroup
object ImHintHelper {
@JvmStatic
fun show(activity: Activity?) {
activity?.let {
var hintView = retrieveHintViewFromActivity(it)
if (hintView == null) {
hintView = ImHintView(it)
hintView.showDot(ImManager.shouldShowFloatingWindowDot)
val decorView = it.window.decorView as ViewGroup
it.runOnUiThread {
decorView.addView(hintView)
}
} else {
hintView.showDot(ImManager.shouldShowFloatingWindowDot)
}
}
}
@JvmStatic
fun dismiss(activity: Activity?) {
activity?.let {
clearCurrent(it)
}
}
private fun retrieveHintViewFromActivity(activity: Activity?) : ImHintView? {
(activity?.window?.decorView as? ViewGroup)?.let {
for (i in 0..it.childCount) {
val childView = if (it.getChildAt(i) is ImHintView) it.getChildAt(i) as ImHintView else null
if (childView != null && childView.windowToken != null) {
return childView
}
}
return null
}
return null
}
private fun clearCurrent(activity: Activity?) {
(activity?.window?.decorView as? ViewGroup)?.let {
for (i in 0..it.childCount) {
val childView = if (it.getChildAt(i) is ImHintView) it.getChildAt(i) as ImHintView else null
if (childView != null && childView.windowToken != null) {
ViewCompat.animate(childView).alpha(0f).withEndAction(getRemoveViewRunnable(childView))
}
}
}
}
private fun getRemoveViewRunnable(childView: View?): Runnable {
return Runnable {
childView?.let {
(childView.parent as? ViewGroup)?.removeView(childView)
}
}
}
}
//package com.gh.common.im
//
//import android.app.Activity
//import androidx.core.view.ViewCompat
//import android.view.View
//import android.view.ViewGroup
//
//object ImHintHelper {
//
// @JvmStatic
// fun show(activity: Activity?) {
// activity?.let {
// var hintView = retrieveHintViewFromActivity(it)
// if (hintView == null) {
// hintView = ImHintView(it)
// hintView.showDot(ImManager.shouldShowFloatingWindowDot)
//
// val decorView = it.window.decorView as ViewGroup
// it.runOnUiThread {
// decorView.addView(hintView)
// }
// } else {
// hintView.showDot(ImManager.shouldShowFloatingWindowDot)
// }
// }
// }
//
// @JvmStatic
// fun dismiss(activity: Activity?) {
// activity?.let {
// clearCurrent(it)
// }
// }
//
// private fun retrieveHintViewFromActivity(activity: Activity?) : ImHintView? {
// (activity?.window?.decorView as? ViewGroup)?.let {
// for (i in 0..it.childCount) {
// val childView = if (it.getChildAt(i) is ImHintView) it.getChildAt(i) as ImHintView else null
// if (childView != null && childView.windowToken != null) {
// return childView
// }
// }
// return null
// }
// return null
// }
//
// private fun clearCurrent(activity: Activity?) {
// (activity?.window?.decorView as? ViewGroup)?.let {
// for (i in 0..it.childCount) {
// val childView = if (it.getChildAt(i) is ImHintView) it.getChildAt(i) as ImHintView else null
// if (childView != null && childView.windowToken != null) {
// ViewCompat.animate(childView).alpha(0f).withEndAction(getRemoveViewRunnable(childView))
// }
// }
// }
// }
//
// private fun getRemoveViewRunnable(childView: View?): Runnable {
// return Runnable {
// childView?.let {
// (childView.parent as? ViewGroup)?.removeView(childView)
// }
// }
// }
//
//}

View File

@ -1,45 +1,45 @@
package com.gh.common.im
import android.app.Activity
import android.content.Context
import android.util.AttributeSet
import android.util.TypedValue
import android.view.View
import android.widget.RelativeLayout
import androidx.core.view.ViewCompat
import com.gh.common.util.DisplayUtils
import com.gh.gamecenter.R
import kotlinx.android.synthetic.main.view_im_hint.view.*
class ImHintView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
: RelativeLayout(context, attrs, defStyle) {
init {
inflate(context, R.layout.view_im_hint, this)
ViewCompat.setTranslationZ(this, Integer.MAX_VALUE.toFloat() - 1)
ivContainer.setOnClickListener {
if (context is Activity) {
ImManager.startChatActivity(context)
ImManager.removeNotification()
}
}
val lp = ivContainer.layoutParams as RelativeLayout.LayoutParams
lp.setMargins(0, 0, dp2px(30f), dp2px(106f) + DisplayUtils.retrieveNavigationHeight(context))
}
fun showDot(show: Boolean) {
if (show) {
unreadDot.visibility = View.VISIBLE
} else {
unreadDot.visibility = View.GONE
}
}
private fun dp2px(dp: Float): Int {
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.applicationContext.resources.displayMetrics).toInt()
}
}
//package com.gh.common.im
//
//import android.app.Activity
//import android.content.Context
//import android.util.AttributeSet
//import android.util.TypedValue
//import android.view.View
//import android.widget.RelativeLayout
//import androidx.core.view.ViewCompat
//import com.gh.common.util.DisplayUtils
//import com.gh.gamecenter.R
//import kotlinx.android.synthetic.main.view_im_hint.view.*
//
//class ImHintView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
// : RelativeLayout(context, attrs, defStyle) {
//
// init {
// inflate(context, R.layout.view_im_hint, this)
//
// ViewCompat.setTranslationZ(this, Integer.MAX_VALUE.toFloat() - 1)
//
// ivContainer.setOnClickListener {
// if (context is Activity) {
// ImManager.startChatActivity(context)
// ImManager.removeNotification()
// }
// }
//
// val lp = ivContainer.layoutParams as RelativeLayout.LayoutParams
//
// lp.setMargins(0, 0, dp2px(30f), dp2px(106f) + DisplayUtils.retrieveNavigationHeight(context))
// }
//
// fun showDot(show: Boolean) {
// if (show) {
// unreadDot.visibility = View.VISIBLE
// } else {
// unreadDot.visibility = View.GONE
// }
// }
//
// private fun dp2px(dp: Float): Int {
// return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.applicationContext.resources.displayMetrics).toInt()
// }
//}

View File

@ -1,25 +1,9 @@
package com.gh.common.im
import android.app.Activity
import android.app.NotificationManager
import android.content.Context
import com.gh.base.CurrentActivityHolder
import com.gh.common.runOnIoThread
import com.gh.common.util.SPUtils
import com.gh.common.util.tryWithDefaultCatch
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.HelpAndFeedbackActivity
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.MessageActivity
import com.gh.gamecenter.manager.UserManager
import com.halo.assistant.HaloApp
import com.m7.imkfsdk.KfStartHelper
import com.m7.imkfsdk.utils.Utils
import com.moor.imkf.ChatListener
import com.moor.imkf.IMChat
import com.moor.imkf.IMChatManager
import com.moor.imkf.IMMessage
import com.moor.imkf.utils.MoorUtils
object ImManager {
@ -35,57 +19,57 @@ object ImManager {
@JvmStatic
fun attachIm() {
try {
if (UserManager.getInstance().userInfoEntity != null &&
currentUserId != UserManager.getInstance().userId) {
currentUserId = UserManager.getInstance().userId
MoorUtils.init(HaloApp.getInstance().application)
Utils.init(HaloApp.getInstance().application)
IMChatManager.getInstance().init(
HaloApp.getInstance().application,
ImReceiver.UNIQUE_BROADCAST_ACTION,
IM_KEY,
UserManager.getInstance().userInfoEntity.name + "(" + UserManager.getInstance().userId + ")",
UserManager.getInstance().userId)
shouldShowFloatingWindow = SPUtils.getBoolean(SP_FLOATING_WINDOW_KEY + UserManager.getInstance().userId)
shouldShowFloatingWindowDot = SPUtils.getBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId)
updateFloatingWindow()
}
} catch (e: Exception) {
e.printStackTrace()
}
// try {
// if (UserManager.getInstance().userInfoEntity != null &&
// currentUserId != UserManager.getInstance().userId) {
// currentUserId = UserManager.getInstance().userId
// MoorUtils.init(HaloApp.getInstance().application)
// Utils.init(HaloApp.getInstance().application)
// IMChatManager.getInstance().init(
// HaloApp.getInstance().application,
// ImReceiver.UNIQUE_BROADCAST_ACTION,
// IM_KEY,
// UserManager.getInstance().userInfoEntity?.name + "(" + UserManager.getInstance().userId + ")",
// UserManager.getInstance().userId)
//
// shouldShowFloatingWindow = SPUtils.getBoolean(SP_FLOATING_WINDOW_KEY + UserManager.getInstance().userId)
// shouldShowFloatingWindowDot = SPUtils.getBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId)
// updateFloatingWindow()
// }
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
@JvmStatic
fun detachIm() {
try {
IMChatManager.getInstance().quitSDk()
shouldShowFloatingWindow = false
updateFloatingWindow()
removeNotification()
} catch (e: Exception) {
e.printStackTrace()
}
// try {
// IMChatManager.getInstance().quitSDk()
// shouldShowFloatingWindow = false
// updateFloatingWindow()
// removeNotification()
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
@JvmStatic
fun startChatActivity(activity: Activity, inputContent: String? = "", requestCode: Int? = null) {
if (!UserManager.getInstance().userId.isNullOrEmpty()) {
try {
SPUtils.setBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId, false)
shouldShowFloatingWindowDot = false
val chatHelper = KfStartHelper(activity, UserManager.getInstance().userInfoEntity.icon, inputContent, requestCode)
chatHelper.initSdkChat(
ImReceiver.UNIQUE_BROADCAST_ACTION,
IM_KEY,
UserManager.getInstance().userInfoEntity.name + "(" + UserManager.getInstance().userId + ")"
+ "[" + BuildConfig.VERSION_NAME + "]",
UserManager.getInstance().userId)
} catch (e: Exception) {
e.printStackTrace()
}
}
// if (!UserManager.getInstance().userId.isNullOrEmpty()) {
// try {
// SPUtils.setBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId, false)
// shouldShowFloatingWindowDot = false
// val chatHelper = KfStartHelper(activity, UserManager.getInstance().userInfoEntity?.icon, inputContent, requestCode)
// chatHelper.initSdkChat(
// ImReceiver.UNIQUE_BROADCAST_ACTION,
// IM_KEY,
// UserManager.getInstance().userInfoEntity?.name + "(" + UserManager.getInstance().userId + ")"
// + "[" + BuildConfig.VERSION_NAME + "]",
// UserManager.getInstance().userId)
// } catch (e: Exception) {
// e.printStackTrace()
// }
// }
}
@JvmStatic
@ -104,50 +88,50 @@ object ImManager {
@JvmStatic
fun removeNotification() {
val notificationManager = HaloApp.getInstance().application?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.cancel(ImReceiver.NOTIFICATION_ID)
// val notificationManager = HaloApp.getInstance().application?.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
// notificationManager.cancel(ImReceiver.NOTIFICATION_ID)
}
@JvmStatic
fun updateFloatingWindow() {
try {
CurrentActivityHolder.getCurrentActivity()?.let {
if (isActivityValid(it)) {
if (shouldShowFloatingWindow) {
ImHintHelper.show(it)
} else {
ImHintHelper.dismiss(it)
removeNotification()
}
}
}
} catch (e: Exception) {
e.printStackTrace()
}
// try {
// CurrentActivityHolder.getCurrentActivity()?.let {
// if (isActivityValid(it)) {
// if (shouldShowFloatingWindow) {
// ImHintHelper.show(it)
// } else {
// ImHintHelper.dismiss(it)
// removeNotification()
// }
// }
// }
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
@JvmStatic
fun sendFeedbackMessage(message: String) {
val fromToMessage = IMMessage.createTxtMessage(message)
runOnIoThread {
tryWithDefaultCatch {
IMChat.getInstance().sendMessage(fromToMessage, object : ChatListener {
override fun onProgress(p0: Int) {}
override fun onSuccess() {}
override fun onFailed() {}
})
}
}
// val fromToMessage = IMMessage.createTxtMessage(message)
// runOnIoThread {
// tryWithDefaultCatch {
// IMChat.getInstance().sendMessage(fromToMessage, object : ChatListener {
// override fun onProgress(p0: Int) {}
// override fun onSuccess() {}
// override fun onFailed() {}
// })
// }
// }
}
fun updateShouldShowFloatingWindow(show: Boolean) {
SPUtils.setBoolean(SP_FLOATING_WINDOW_KEY + UserManager.getInstance().userId, show)
shouldShowFloatingWindow = show
// SPUtils.setBoolean(SP_FLOATING_WINDOW_KEY + UserManager.getInstance().userId, show)
// shouldShowFloatingWindow = show
}
fun updateShouldShowFloatingWindowDot(show: Boolean) {
SPUtils.setBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId, show)
shouldShowFloatingWindowDot = show
// SPUtils.setBoolean(SP_FLOATING_WINDOW_DOT_KEY + UserManager.getInstance().userId, show)
// shouldShowFloatingWindowDot = show
}
private fun isActivityValid(activity: Activity): Boolean {

View File

@ -1,20 +1,9 @@
package com.gh.common.im
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.core.app.NotificationCompat
import com.gh.base.CurrentActivityHolder
import com.gh.common.util.doOnMainProcessOnly
import com.gh.gamecenter.R
import com.m7.imkfsdk.chat.ChatActivity
import com.m7.imkfsdk.utils.Utils
import com.moor.imkf.IMChatManager
class ImReceiver : BroadcastReceiver() {
@ -26,54 +15,54 @@ class ImReceiver : BroadcastReceiver() {
var notificationManager: NotificationManager? = null
override fun onReceive(context: Context?, intent: Intent?) {
context?.doOnMainProcessOnly {
intent?.let {
if (intent.action == IMChatManager.NEW_MSG_ACTION) {
notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
// 判断 ImActivity 是否在最顶端
if (CurrentActivityHolder.getCurrentActivity() is ChatActivity) {
ImManager.showFloatingWindow()
ImManager.updateShouldShowFloatingWindowDot(false)
} else {
val contentIntent = Intent(Utils.getApp(), ChatActivity::class.java)
contentIntent.putExtra("PeerId", "")
contentIntent.putExtra("type", "peedId")
contentIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
val resultPendingIntent = PendingIntent.getActivity(
Utils.getApp(),
0,
contentIntent,
PendingIntent.FLAG_UPDATE_CURRENT
)
// 新的通知
val builder = NotificationCompat.Builder(Utils.getApp(), "Halo_IM")
val notification = builder.setTicker("您有新的消息")
.setDefaults(Notification.DEFAULT_ALL)
.setSmallIcon(R.drawable.ic_notification)
.setWhen(System.currentTimeMillis())
.setContentIntent(resultPendingIntent)
.setContentTitle("光环助手客服回复")
.setContentText("您有新的消息")
.setAutoCancel(true)
.build()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel("Halo_IM", "Halo_IM", NotificationManager.IMPORTANCE_DEFAULT)
notificationManager?.createNotificationChannel(channel)
}
if (notification != null) {
notificationManager?.notify(NOTIFICATION_ID, notification)
ImManager.showFloatingWindow()
}
}
} else if (intent.action == IMChatManager.FINISH_ACTION) {
ImManager.dismissFloatingWindow()
}
}
}
// context?.doOnMainProcessOnly {
// intent?.let {
// if (intent.action == IMChatManager.NEW_MSG_ACTION) {
// notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
// // 判断 ImActivity 是否在最顶端
// if (CurrentActivityHolder.getCurrentActivity() is ChatActivity) {
// ImManager.showFloatingWindow()
// ImManager.updateShouldShowFloatingWindowDot(false)
// } else {
// val contentIntent = Intent(Utils.getApp(), ChatActivity::class.java)
//
// contentIntent.putExtra("PeerId", "")
// contentIntent.putExtra("type", "peedId")
//
// contentIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
// val resultPendingIntent = PendingIntent.getActivity(
// Utils.getApp(),
// 0,
// contentIntent,
// PendingIntent.FLAG_UPDATE_CURRENT
// )
//
// // 新的通知
// val builder = NotificationCompat.Builder(Utils.getApp(), "Halo_IM")
// val notification = builder.setTicker("您有新的消息")
// .setDefaults(Notification.DEFAULT_ALL)
// .setSmallIcon(R.drawable.ic_notification)
// .setWhen(System.currentTimeMillis())
// .setContentIntent(resultPendingIntent)
// .setContentTitle("光环助手客服回复")
// .setContentText("您有新的消息")
// .setAutoCancel(true)
// .build()
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// val channel = NotificationChannel("Halo_IM", "Halo_IM", NotificationManager.IMPORTANCE_DEFAULT)
// notificationManager?.createNotificationChannel(channel)
// }
//
// if (notification != null) {
// notificationManager?.notify(NOTIFICATION_ID, notification)
// ImManager.showFloatingWindow()
// }
// }
// } else if (intent.action == IMChatManager.FINISH_ACTION) {
// ImManager.dismissFloatingWindow()
// }
// }
// }
}
}

View File

@ -1,18 +1,19 @@
package com.gh.common.loghub
import android.app.Application
import androidx.annotation.Keep
import com.aliyun.sls.android.sdk.model.Log
import com.aliyun.sls.android.sdk.model.LogGroup
import com.gh.common.exposure.ExposureEntity
import com.gh.common.exposure.meta.Meta
import com.gh.common.util.tryWithDefaultCatch
import com.gh.loghub.LoghubHelper
import org.json.JSONObject
import java.util.concurrent.Executors
import kotlin.concurrent.fixedRateTimer
object LoghubUtils {
private const val STORE_SIZE = 100
private const val STORE_FORCE_UPLOAD_INTERVAL = 120 * 1000L
private lateinit var mApplication: Application
private val loghubEventSet by lazy { hashSetOf<LoghubEvent>() }
@ -27,10 +28,6 @@ object LoghubUtils {
val eventList = loghubEventDao.getAll()
loghubEventSet.addAll(eventList)
}
fixedRateTimer(name = "Loghub-Event-Checker", initialDelay = 1000, period = STORE_FORCE_UPLOAD_INTERVAL) {
commitSavedLoghubEvents()
}
}
@JvmStatic
@ -50,19 +47,39 @@ object LoghubUtils {
}
}
@JvmStatic
fun log(jsonString: String, logStore: String, forcedUpload: Boolean) {
loghubEventExecutor.execute {
try {
val event = LoghubEvent(time = (System.currentTimeMillis() / 1000L).toString(), content = jsonString, logStore = logStore)
loghubEventSet.add(event)
loghubEventDao.insert(event)
} catch (e: Exception) {
e.printStackTrace()
}
if (forcedUpload || loghubEventSet.size >= STORE_SIZE) {
commitSavedLoghubEvents()
}
}
}
private fun uploadLogGroup(logGroup: LogGroup, logStore: String) {
LoghubHelper.getInstance().uploadLogGroup(logGroup, logStore)
}
private fun commitSavedLoghubEvents() {
fun commitSavedLoghubEvents() {
loghubEventExecutor.execute {
if (loghubEventSet.isEmpty()) return@execute
// TODO 初始化 loghubHelper 去掉这个 tryCatch 块
tryWithDefaultCatch {
if (loghubEventSet.isEmpty()) return@execute
val exposureList = loghubEventSet.toList()
val exposureList = loghubEventSet.toList()
createLogGroupAndUpload()
loghubEventSet.removeAll(exposureList)
loghubEventDao.deleteMany(exposureList)
createLogGroupAndUpload()
loghubEventSet.removeAll(exposureList)
loghubEventDao.deleteMany(exposureList)
}
}
}
@ -93,4 +110,12 @@ object LoghubUtils {
}
}
}
}
@Keep
data class SimpleLogContainerEntity(
var event: String? = null,
var action: String? = null,
var meta: Meta? = null,
var payload: ExposureEntity? = null,
var timestamp: Long? = 0)

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.database.ContentObserver
import android.media.AudioManager
import android.os.Handler
import com.gh.common.util.tryCatchInRelease
class VolumeObserver(var context: Context, handler: Handler, var callback: MuteCallback? = null)
: ContentObserver(handler) {
@ -11,7 +12,8 @@ class VolumeObserver(var context: Context, handler: Handler, var callback: MuteC
init {
val audio = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
previousVolume = audio.getStreamVolume(AudioManager.STREAM_MUSIC)
// 部分设备的 audioManager getStreamVolume 内部会触发空指针 :(
tryCatchInRelease { previousVolume = audio.getStreamVolume(AudioManager.STREAM_MUSIC) }
}
override fun onChange(selfChange: Boolean) {

View File

@ -1,10 +1,11 @@
package com.gh.common.repository
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.util.ApkActiveUtils
import com.gh.common.util.RandomUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.tencent.bugly.beta.tinker.TinkerManager.getApplication
import com.halo.assistant.HaloApp
import io.reactivex.Observable
// 热门卡牌的仓库
@ -15,7 +16,8 @@ object RemenkapaiRepository {
@JvmStatic
fun getRemenkapai(size: Int): Observable<List<GameEntity>> {
return if (remenkapaiList.isEmpty()) {
RetrofitManager.getInstance(getApplication()).api.remenkapai
RetrofitManager.getInstance(HaloApp.getInstance().application).sensitiveApi.remenkapai
.map(RegionSettingHelper.filterGame)
.map { gameList -> filterEntityWithoutApk(gameList) }
.map { pickRandomSizeEntity(size) }
.map(ApkActiveUtils.filterMapperList)

View File

@ -0,0 +1,244 @@
package com.gh.common.simulator
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.view.Window
import android.widget.ProgressBar
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.g00fy2.versioncompare.Version
import com.gh.common.AppExecutor.uiExecutor
import com.gh.common.constant.Constants
import com.gh.common.dialog.TrackableDialog
import com.gh.common.util.*
import com.gh.common.util.PackageInstaller.getDownloadPath
import com.gh.download.DownloadManager
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.SimulatorEntity
import com.gh.gamecenter.entity.TrackableEntity
import com.halo.assistant.HaloApp
import com.lightgame.download.*
import com.lightgame.utils.Utils
import java.text.DecimalFormat
class SimulatorDownloadManager private constructor() {
private var app_pb_progress: ProgressBar? = null
private var appProgressSize: TextView? = null
private var appProgressRemain: TextView? = null
private var appProgressPercent: TextView? = null
private var appProgressFilling: View? = null
private var appProgressAnchor: View? = null
private var downloadDialog: Dialog? = null
private var simulatorLocation: SimulatorLocation? = null
private var simulator: SimulatorEntity? = null
private var gameId: String = ""
private var gameName: String = ""
private var downloadType: String = ""
private val dataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity?) {
if (downloadEntity?.isSimulatorDownload() == true) {
val size = downloadEntity.progress.toFloat() / 1024 / 1024
val df = DecimalFormat("0.00")
appProgressSize!!.text = "${df.format(size.toDouble())}MB"
appProgressRemain!!.text = String.format("剩余%s", SpeedUtils.getRemainSecondTime(downloadEntity.size,
downloadEntity.progress, downloadEntity.speed * 1024))
app_pb_progress!!.progress = (downloadEntity.percent * 10).toInt()
val width = app_pb_progress!!.width
val marLeft = (downloadEntity.percent / 100 * width).toInt()
val anchorLp = appProgressAnchor!!.layoutParams
if (anchorLp is ConstraintLayout.LayoutParams) {
anchorLp.leftMargin = marLeft
appProgressAnchor!!.layoutParams = anchorLp
}
val fillingLp = appProgressFilling!!.layoutParams
fillingLp.width = marLeft + DisplayUtils.dip2px(5f)
appProgressFilling!!.layoutParams = fillingLp
appProgressPercent?.text = if (downloadEntity.percent != 100.0) "${downloadEntity.percent}%" else "100%"
when {
DownloadStatus.done == downloadEntity.status -> {
val locationStr = if (simulatorLocation == SimulatorLocation.LAUNCH) "${simulatorLocation?.value}${gameName}" else simulatorLocation?.value
val fileName = downloadEntity.path.substring(downloadEntity.path.lastIndexOf('/') + 1).removeSuffix(".apk")
val startTime = downloadEntity.getMetaExtra(Constants.SIMULATOR_DOWNLOAD_START_TIME)
LogUtils.uploadSimulatorDownload("simulator_download_complete", fileName, simulator?.id, downloadEntity.name, gameId, locationStr, downloadType, startTime)
DownloadManager.getInstance(HaloApp.getInstance().application).cancel(downloadEntity.url, false, true)
downloadDialog?.dismiss()
}
DownloadStatus.neterror == downloadEntity.status -> {
ToastUtils.showToast("网络不稳定,下载任务已暂停")
}
DownloadStatus.timeout == downloadEntity.status -> {
ToastUtils.showToast("网络不稳定,下载任务已暂停")
}
DownloadStatus.notfound == downloadEntity.status -> {
ToastUtils.showToast("下载链接异常,请稍后重试")
}
DownloadStatus.hijack == downloadEntity.status -> {
ToastUtils.showToast("网络劫持,请稍后重试")
}
}
}
}
}
fun showDownloadDialog(context: Context, simulator: SimulatorEntity?, location: SimulatorLocation) {
showDownloadDialog(context, simulator, location, "", "", null)
}
fun showDownloadDialog(context: Context, simulator: SimulatorEntity?, location: SimulatorLocation, gameId: String = "", gameName: String = "", cancelCallback: (() -> Unit)? = null) {
this.simulatorLocation = location
this.simulator = simulator
this.gameId = gameId
this.gameName = gameName
//判断是否隐藏
if (simulator?.active == false) {
showNoneEmulatorDialog(context)
return
}
val isInstalled = PackageUtils.isInstalledFromAllPackage(context, simulator?.apk?.packageName)
val versionFromInstalledApp = PackageUtils.getVersionByPackage(simulator?.apk?.packageName)
val shouldShowUpdate = Version(simulator?.apk?.version).isHigherThan(versionFromInstalledApp)
val title = if (shouldShowUpdate && isInstalled) "更新模拟器" else "安装模拟器"
val message = if (shouldShowUpdate && isInstalled) "检测到模拟器存在更高版本,是否前往更新" else "模拟器游戏需要先下载安装对应的模拟器,才可以运行"
val positiveText = if (shouldShowUpdate && isInstalled) "更新(${simulator?.apk?.size}" else "下载(${simulator?.apk?.size}"
val negativeText = if (shouldShowUpdate && isInstalled) "下次再说" else "取消"
downloadType = if (shouldShowUpdate && isInstalled) "update" else "download"
val trackableEntity = TrackableEntity("模拟器下载",
key = if (shouldShowUpdate && isInstalled) "更新弹窗" else "下载弹窗",
logShowEvent = true
)
DialogUtils.showNewAlertDialog(context, title, message, negativeText, positiveText, trackableEntity, Gravity.LEFT, {
if (shouldShowUpdate && isInstalled) {
cancelCallback?.invoke()
MtaHelper.onEvent(trackableEntity.event, trackableEntity.key, "点击下次再说")
}
}, {
showDownloadingDialog(context, simulator)
MtaHelper.onEvent(trackableEntity.event, trackableEntity.key, if (shouldShowUpdate && isInstalled) "点击更新" else "点击下载")
})
}
private fun showDownloadingDialog(context: Context, simulator: SimulatorEntity?) {
val msg = FileUtils.isCanDownload(context, simulator?.apk?.size)
if (!msg.isNullOrEmpty()) {
Utils.toast(context, msg)
return
}
if (NetworkUtils.isMobileConnected(context)) {
Utils.toast(context, "当前使用移动数据进行下载")
}
downloadDialog = TrackableDialog(context, R.style.GhAlertDialog, "模拟器下载", "下载中弹窗")
downloadDialog?.window?.setBackgroundDrawableResource(R.color.transparent)
val view = View.inflate(context, R.layout.download_simulator_dialog, null)
app_pb_progress = view.findViewById(R.id.progress)
appProgressSize = view.findViewById(R.id.size)
appProgressRemain = view.findViewById(R.id.remain)
appProgressAnchor = view.findViewById(R.id.progress_anchor)
appProgressPercent = view.findViewById(R.id.percent)
appProgressFilling = view.findViewById(R.id.progress_filling)
view.findViewById<View>(R.id.app_tv_cancel).setOnClickListener {
DownloadManager.getInstance(context).pause(simulator?.apk?.url)
MtaHelper.onEvent("模拟器下载", "下载中弹窗", "点击关闭")
downloadDialog?.dismiss()
}
downloadDialog?.setOnDismissListener {
DownloadManager.getInstance(context).removeObserver(dataWatcher)
}
downloadDialog?.setCanceledOnTouchOutside(false)
downloadDialog?.setCancelable(false)
downloadDialog?.closeOptionsMenu()
downloadDialog?.requestWindowFeature(Window.FEATURE_NO_TITLE)
downloadDialog?.setContentView(view)
val params = downloadDialog?.window?.attributes
params?.width = context.resources.displayMetrics.widthPixels - DisplayUtils.dip2px(60f)
downloadDialog?.window?.attributes = params
download(context, simulator)
}
private fun showNoneEmulatorDialog(context: Context) {
val dialog = DialogUtils.showNewAlertDialog(context, "安装模拟器", "模拟器游戏需要先下载安装对应的模拟器,才可以运行", "取消", "暂无下载", null, {
ToastUtils.showToast("该模拟器暂未提供下载")
})
dialog?.window?.findViewById<TextView>(R.id.confirm)?.setTextColor(ContextCompat.getColor(context, R.color.text_cccccc))
}
private fun download(context: Context, simulator: SimulatorEntity?) {
val apkEntity = simulator?.apk ?: return
DownloadManager.getInstance(context).pauseAll()
val entity = DownloadManager.getInstance(context).getDownloadEntityByUrl(apkEntity.url)
if (entity != null) {
when (entity.status) {
DownloadStatus.pause, DownloadStatus.subscribe,
DownloadStatus.neterror, DownloadStatus.timeout -> {
DownloadManager.getInstance(context).addObserver(dataWatcher)
uiExecutor.executeWithDelay(Runnable { DownloadManager.getInstance(context).resume(entity, true) }, 200)
downloadDialog?.show()
}
DownloadStatus.done -> DataChanger.notifyDataChanged(entity)
else -> createDownload(context, apkEntity, simulator)
}
} else {
createDownload(context, apkEntity, simulator)
}
}
private fun createDownload(context: Context, apkEntity: ApkEntity, simulator: SimulatorEntity) {
DownloadManager.getInstance(context).addObserver(dataWatcher)
val downloadEntity = DownloadEntity()
downloadEntity.url = apkEntity.url
downloadEntity.name = simulator.name
downloadEntity.path = getDownloadPath(simulator.name, apkEntity.format)
downloadEntity.platform = apkEntity.getPlatform()
downloadEntity.packageName = apkEntity.packageName
downloadEntity.versionName = apkEntity.version
downloadEntity.addMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE, Constants.SIMULATOR_DOWNLOAD)
downloadEntity.addMetaExtra(Constants.SIMULATOR_DOWNLOAD_START_TIME, (System.currentTimeMillis() / 1000).toString())
uiExecutor.executeWithDelay(Runnable { DownloadManager.getInstance(context).add(downloadEntity) }, 200)
val locationStr = if (simulatorLocation == SimulatorLocation.LAUNCH) "${simulatorLocation?.value}${gameName}" else simulatorLocation?.value
val fileName = downloadEntity.path.substring(downloadEntity.path.lastIndexOf('/') + 1).removeSuffix(".apk")
LogUtils.uploadSimulatorDownload("simulator_download", fileName, simulator.id, simulator.name, gameId, locationStr, downloadType, "")
downloadDialog?.show()
}
companion object {
@Volatile
private var instance: SimulatorDownloadManager? = null
@JvmStatic
fun getInstance(): SimulatorDownloadManager {
return instance ?: synchronized(this) {
instance ?: SimulatorDownloadManager().also { instance = it }
}
}
}
enum class SimulatorLocation(val value: String) {
LAUNCH("启动"),
SIMULATOR_GAME("模拟器游戏"),
SIMULATOR_MANAGE("模拟器游戏-模拟器管理")
}
}

View File

@ -0,0 +1,219 @@
package com.gh.common.simulator
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import com.g00fy2.versioncompare.Version
import com.gh.common.util.*
import com.gh.download.DownloadManager
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.retrofit.BiResponse
import com.gh.gamecenter.retrofit.EmptyResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadDao
import com.lightgame.download.DownloadEntity
import com.lightgame.download.FileUtils
import com.lightgame.utils.AppManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import java.io.File
object SimulatorGameManager {
private val gamePath = FileUtils.getDownloadPath(HaloApp.getInstance().application, "emulator_game")
@JvmStatic
fun getPathByType(type: String) = "${gamePath}/${type}"
@JvmStatic
fun deleteLocalGames(names: List<String>) {
val downloadEntityList = DownloadDao.getInstance(HaloApp.getInstance().application).all
names.forEach { name ->
val downloadEntity = downloadEntityList.find { it.name == name }
if (downloadEntity != null) {
val file = File(downloadEntity.path)
if (file.exists()) {
file.delete()
DownloadDao.getInstance(HaloApp.getInstance().application).delete(downloadEntity.url)
}
}
}
}
@JvmStatic
fun deleteLocalGame(name: String) {
val downloadEntityList = DownloadDao.getInstance(HaloApp.getInstance().application).all
val downloadEntity = downloadEntityList.find { it.name == name }
if (downloadEntity != null) {
val file = File(downloadEntity.path)
if (file.exists()) {
file.delete()
DownloadDao.getInstance(HaloApp.getInstance().application).delete(downloadEntity.url)
}
}
}
@JvmStatic
fun findDownloadEntityByUrl(url: String?): DownloadEntity? {
val downloadEntity = DownloadDao.getInstance(HaloApp.getInstance().application).get(url)
if (downloadEntity != null) {
val isFileCompleted = DownloadManager.getInstance(HaloApp.getInstance().application).isFileCompleted(url)
if (downloadEntity.isSimulatorGame() && isFileCompleted) {
return downloadEntity
}
}
return null
}
@JvmStatic
fun isSimulatorGame(gameEntity: GameEntity) = gameEntity.category == "simulator"
@JvmStatic
fun launchSimulatorGame(downloadEntity: DownloadEntity, gameEntity: GameEntity) {
val versionFromInstalledApp = PackageUtils.getVersionByPackage(gameEntity.simulator?.apk?.packageName)
val shouldShowUpdate = Version(gameEntity.simulator?.apk?.version).isHigherThan(versionFromInstalledApp)
if (shouldShowUpdate) {
SimulatorDownloadManager.getInstance().showDownloadDialog(AppManager.getInstance().recentActiveActivity, gameEntity.simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name
?: "") {
jumpToSimulator(downloadEntity, gameEntity)
}
} else {
jumpToSimulator(downloadEntity, gameEntity)
}
}
private fun jumpToSimulator(downloadEntity: DownloadEntity, gameEntity: GameEntity) {
val intent = Intent()
intent.data = Uri.fromFile(File(downloadEntity.path))
if (gameEntity.simulatorType == "FBA") {
val apkEntity = gameEntity.getApk()[0]
intent.putExtra("rom_name", apkEntity.packageName)
}
intent.putExtra("default_path", downloadEntity.path.substring(0, downloadEntity.path.lastIndexOf('/')))
intent.putExtra("game_type", gameEntity.simulatorType)
intent.putExtra("title", downloadEntity.name)
intent.putExtra("icon", gameEntity.icon ?: "")
intent.putExtra("meta", LogUtils.getMetaObject().toString())
intent.putExtra("simulatorId", gameEntity.simulator?.id)
intent.putExtra("simulatorName", gameEntity.simulator?.name)
intent.putExtra("gameId", gameEntity.id)
val destActivity = "com.gh.emu.RequestPermissionActivity"
intent.setClassName(gameEntity.simulator?.apk?.packageName ?: "", destActivity)
try {
AppManager.getInstance().recentActiveActivity.startActivity(intent)
} catch (e: ActivityNotFoundException) {
ToastUtils.showToast("模拟器安装错误")
}
recordPlaySimulatorGames(gameEntity.id)
}
/**
* 记录设备下载的模拟器游戏
*/
@SuppressLint("CheckResult")
@JvmStatic
fun recordDownloadSimulatorGames(gameId: String) {
val requestMap = hashMapOf<String, Any>()
requestMap["game_id"] = gameId
requestMap["package"] = "-"
val body = requestMap.createRequestBodyAny()
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.downloadSimulatorGames(HaloApp.getInstance().gid, body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(EmptyResponse())
}
/**
* 标记已玩过
*/
@SuppressLint("CheckResult")
fun postPlayedGame(gameId: String, packageName: String) {
if (!TextUtils.isEmpty(gameId) && UserManager.getInstance().isLoggedIn) {
val requestMap = hashMapOf<String, Any>()
requestMap["game_id"] = gameId
requestMap["package"] = packageName
val body = requestMap.toRequestBody()
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.postPlayedGame(UserManager.getInstance().userId, body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(EmptyResponse())
}
}
/**
* 记录启动设备上的模拟器游戏
*/
@SuppressLint("CheckResult")
fun recordPlaySimulatorGames(gameId: String) {
val requestMap = hashMapOf<String, Any>()
requestMap["game_id"] = gameId
requestMap["package"] = "-"
val body = requestMap.createRequestBodyAny()
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.playedSimulatorGames(HaloApp.getInstance().gid, body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(EmptyResponse())
}
/**
* 删除设备下载模拟器游戏的记录
*/
@SuppressLint("CheckResult")
fun deleteSimulatorGame(gameId: String, callback: () -> Unit) {
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.deleteSimulatorGame(HaloApp.getInstance().gid, gameId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
callback.invoke()
}
})
}
/**
* 批量删除设备下载模拟器游戏的记录
*/
@SuppressLint("CheckResult")
fun deleteSimulatorGames(gameIds: List<String>, callback: () -> Unit) {
val requestMap = hashMapOf<String, Any>()
requestMap["game_ids"] = gameIds
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.deleteSimulatorGames(HaloApp.getInstance().gid, requestMap.toRequestBody())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
callback.invoke()
}
})
}
/**
* 批量删除设备下载模拟器游戏的记录
*/
@JvmStatic
@SuppressLint("CheckResult")
fun deleteAllSimulatorGame() {
RetrofitManager.getInstance(HaloApp.getInstance().application).api
.deleteAllSimulatorGame(HaloApp.getInstance().gid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(EmptyResponse())
}
}

View File

@ -0,0 +1,16 @@
package com.gh.common.structure
class FixedSizeLinkedHashSet<T>(var maxSize: Int) : LinkedHashSet<T>() {
override fun add(element: T): Boolean {
if (size == maxSize) {
pop()
}
return super.add(element);
}
private fun pop() {
if (size > 0) {
remove(iterator().next())
}
}
}

View File

@ -5,14 +5,17 @@ object SyncFieldConstants {
// 是否点赞
const val ANSWER_VOTE = "ANSWER_VOTE"
const val ARTICLE_VOTE = "ARTICLE_VOTE"
const val ARTICLE_COMMENT_VOTE = "ARTICLE_COMMENT_VOTE"
// 赞同数量
const val ANSWER_VOTE_COUNT = "ANSWER_VOTE_COUNT"
const val ARTICLE_VOTE_COUNT = "ARTICLE_VOTE_COUNT"
const val ARTICLE_COMMENT_VOTE_COUNT = "ARTICLE_COMMENT_VOTE_COUNT"
// 评论数量
const val ANSWER_COMMENT_COUNT = "ANSWER_COMMENT_COUNT"
const val ARTICLE_COMMENT_COUNT = "ARTICLE_COMMENT_COUNT"
const val ARTICLE_COMMENT_REPLY_COUNT = "ARTICLE_COMMENT_REPLY_COUNT"
// 回答数量
const val ANSWER_COUNT = "ANSWER_COUNT"

View File

@ -21,9 +21,7 @@ object ActivationHelper {
*/
@JvmStatic
fun sendActivationInfo() {
// 能获取到 IMEI 并且之前没发送过激活信息才发
if (!mHasSentActivatedInfo
&& Util_System_Phone_State.canGetImei(HaloApp.getInstance().application)) {
if (!mHasSentActivatedInfo) {
RetrofitManager.getInstance(HaloApp.getInstance().application)
.api.postActivationInfo()
.subscribeOn(Schedulers.io())

View File

@ -5,11 +5,12 @@ import com.gh.gamecenter.entity.SettingsEntity
object AdHelper {
// 搜索为空/求版本/意见反馈-功能收录/发现
// 搜索为空/求版本/意见反馈-功能收录/发现/模拟器游戏
const val LOCATION_SEARCH_EMPTY = "search_empty"
const val LOCATION_GAME_REQUEST_VERSION = "game_request_version"
const val LOCATION_SUGGESTION_FUNCTION = "suggestion_function"
const val LOCATION_DISCOVER = "discover"
const val LOCATION_SIMULATOR_GAME = "simulator_game"
fun getAd(location: String): SettingsEntity.AD? {
val adList = Config.getSettings()?.adList ?: return null
@ -34,4 +35,19 @@ object AdHelper {
return discoverAdList
}
fun getAdForLocation(location: String): SettingsEntity.AD? {
val adList = Config.getSettings()?.adList ?: return null
var result: SettingsEntity.AD? = null
run outside@ {
for (ad in adList) {
if (ad.location == location) {
result = ad
return@outside
}
}
}
return result
}
}

View File

@ -0,0 +1,10 @@
package com.gh.common.util
object AntiBotHelper {
// @JvmStatic
// val manager by lazy {
// SecurityGuardManager.getInstance(HaloApp.getInstance().application).getInterface(IJAQAVMPSignComponent::class.java).apply {
// this.initialize()
// }
// }
}

View File

@ -0,0 +1,6 @@
package com.gh.common.util
interface BiCallback<FIRST, SECOND> {
fun onFirst(first: FIRST)
fun onSecond(second: SECOND)
}

View File

@ -1,5 +1,6 @@
package com.gh.common.util;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
@ -14,9 +15,17 @@ import com.halo.assistant.HaloApp;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import androidx.annotation.IntRange;
import androidx.annotation.RequiresApi;
import androidx.renderscript.Allocation;
import androidx.renderscript.Element;
import androidx.renderscript.RenderScript;
import androidx.renderscript.ScriptIntrinsicBlur;
/**
* Created by LGT on 2016/10/21.
*/
@ -114,6 +123,14 @@ public class BitmapUtils {
return true;
}
public static Bitmap getBitmapByFile(String filepath, int w, int h) {
return getBitmapByFile(filepath, w, h, Bitmap.Config.RGB_565);
}
public static Bitmap getBitmapByFile(String filepath, Bitmap.Config config) {
return getBitmapByFile(filepath, 0, 0, config);
}
/**
* 根据文件路径返回bitmap
*
@ -122,12 +139,12 @@ public class BitmapUtils {
* @param h 高
* @return bitmap
*/
public static Bitmap getBitmapByFile(String filepath, int w, int h) {
public static Bitmap getBitmapByFile(String filepath, int w, int h, Bitmap.Config config) {
try {
BitmapFactory.Options options = new BitmapFactory.Options();
// 设置为ture只获取图片大小
options.inJustDecodeBounds = true;
options.inPreferredConfig = Bitmap.Config.RGB_565;
options.inPreferredConfig = config;
// 返回为空
BitmapFactory.decodeFile(filepath, options);
int width = options.outWidth;
@ -135,8 +152,8 @@ public class BitmapUtils {
float scaleWidth = 0.f, scaleHeight = 0.f;
if (width > w || height > h) {
// 缩放
scaleWidth = ((float) width) / w;
scaleHeight = ((float) height) / h;
if (w > 0) scaleWidth = ((float) width) / w;
if (h > 0) scaleHeight = ((float) height) / h;
}
options.inJustDecodeBounds = false;
int scale = (int) Math.ceil(Math.max(scaleWidth, scaleHeight));
@ -189,6 +206,7 @@ public class BitmapUtils {
/**
* Drawable转Bitmap
*
* @param isSquare 是否是正方形
*/
public static Bitmap drawableToBitmap(Drawable drawable, boolean isSquare) {
@ -196,7 +214,7 @@ public class BitmapUtils {
return null;
}
int w,h;
int w, h;
// 取 drawable 的长宽
w = drawable.getIntrinsicWidth();
@ -227,4 +245,108 @@ public class BitmapUtils {
return bitmap;
}
/**
* 修改bitmap透明度
*
* @param sourceImg
* @param config
* @param number
* @return
*/
public static Bitmap getTransparentBitmap(Bitmap sourceImg, Bitmap.Config config, int number) {
int[] argb = new int[sourceImg.getWidth() * sourceImg.getHeight()];
sourceImg.getPixels(argb, 0, sourceImg.getWidth(), 0, 0, sourceImg
.getWidth(), sourceImg.getHeight());// 获得图片的ARGB值
number = number * 255 / 100;
for (int i = 0; i < argb.length; i++) {
argb[i] = (number << 24) | (argb[i] & 0x00FFFFFF);
}
sourceImg = Bitmap.createBitmap(argb, sourceImg.getWidth(), sourceImg
.getHeight(), config);
return sourceImg;
}
/**
* 高斯模糊
*
* @param context
* @param image
* @param radius
* @return
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public static Bitmap getBlurBitmap(Context context, Bitmap image, @IntRange(from = 1, to = 25) int radius) {
// 计算图片缩小后的长宽
int width = Math.round(image.getWidth() * 0.8f);
int height = Math.round(image.getHeight() * 0.8f);
// 将缩小后的图片做为预渲染的图片。
Bitmap inputBitmap = Bitmap.createScaledBitmap(image, width, height, false);
// 创建一张渲染后的输出图片。
Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap);
// 创建RenderScript内核对象
RenderScript rs = RenderScript.create(context);
// 创建一个模糊效果的RenderScript的工具对象
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
// 由于RenderScript并没有使用VM来分配内存,所以需要使用Allocation类来创建和分配内存空间。
// 创建Allocation对象的时候其实内存是空的,需要使用copyTo()将数据填充进去。
Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap);
Allocation tmpOut = Allocation.createTyped(rs, tmpIn.getType());
// 设置渲染的模糊程度, 25f是最大模糊度
blurScript.setRadius(radius);
// 设置blurScript对象的输入内存
blurScript.setInput(tmpIn);
// 将输出数据保存到输出内存中
blurScript.forEach(tmpOut);
// 将数据填充到Allocation中
tmpOut.copyTo(outputBitmap);
return outputBitmap;
}
/**
* 保存图片
*
* @param bitmap
* @param path
*/
public static void saveBitmap(Bitmap bitmap, String path) {
File file = new File(path);
if (file.exists()) {
file.delete();
}
FileOutputStream out;
try {
out = new FileOutputStream(file);
if (bitmap.compress(Bitmap.CompressFormat.PNG, 80, out)) {
out.flush();
out.close();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public static Bitmap compressBitmap(Bitmap bitmap) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Matrix matrix = new Matrix();
Bitmap result = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
result.compress(Bitmap.CompressFormat.WEBP, 100, bos);
while (bos.toByteArray().length > 400 * 1024) {
System.out.println(bos.toByteArray().length);
matrix.setScale(0.9f, 0.9f);
result = Bitmap.createBitmap(result, 0, 0, result.getWidth(), result.getHeight(), matrix, true);
bos.reset();
result.compress(Bitmap.CompressFormat.WEBP, 100, bos);
}
return result;
}
}

View File

@ -0,0 +1,9 @@
package com.gh.common.util
import com.gh.gamecenter.room.AppDatabase
import com.gh.gamecenter.room.dao.CommentDraftDao
import com.halo.assistant.HaloApp
object CommentDraftContainer {
val commentDraftDao: CommentDraftDao by lazy { AppDatabase.getInstance(HaloApp.getInstance().application).commentDraftDao() }
}

View File

@ -1,18 +1,23 @@
package com.gh.common.util
import android.content.Context
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.util.CommentUtils.copyText
import com.gh.common.view.BugFixedPopupWindow
import com.gh.gamecenter.CommentDetailActivity
import com.gh.gamecenter.MessageDetailActivity
import com.gh.gamecenter.adapter.OnCommentCallBackListener
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.CommentEntity
import com.gh.gamecenter.entity.MeEntity
import com.gh.gamecenter.entity.Permissions
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.qa.comment.OnCommentOptionClickListener
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import com.tencent.bugly.beta.tinker.TinkerManager.getApplication
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
@ -23,27 +28,31 @@ import retrofit2.HttpException
object CommentHelper {
@JvmStatic
fun showCommunityArticleCommentOptions(context: Context,
fun showCommunityArticleCommentOptions(view: View,
commentEntity: CommentEntity,
showConversation: Boolean,
articleId: String,
communityId: String,
listener: OnCommentCallBackListener?) {
showCommentOptions(context = context,
isShowTop: Boolean = false,
ignoreModerator: Boolean = false,
listener: OnCommentOptionClickListener?) {
showCommentOptions(view = view,
commentEntity = commentEntity,
showConversation = showConversation,
articleId = articleId,
communityId = communityId,
isShowTop = isShowTop,
ignoreModerator = ignoreModerator,
listener = listener)
}
@JvmStatic
fun showAnswerCommentOptions(context: Context,
fun showAnswerCommentOptions(view: View,
commentEntity: CommentEntity,
showConversation: Boolean,
answerId: String,
listener: OnCommentCallBackListener?) {
showCommentOptions(context = context,
listener: OnCommentOptionClickListener?) {
showCommentOptions(view = view,
commentEntity = commentEntity,
showConversation = showConversation,
answerId = answerId,
@ -51,31 +60,51 @@ object CommentHelper {
}
@JvmStatic
fun showVideoCommentOptions(context: Context,
fun showVideoCommentOptions(view: View,
commentEntity: CommentEntity,
showConversation: Boolean,
videoId: String,
listener: OnCommentCallBackListener?) {
showCommentOptions(context = context,
isVideoAuthor: Boolean,
listener: OnCommentOptionClickListener?) {
showCommentOptions(view = view,
commentEntity = commentEntity,
showConversation = showConversation,
videoId = videoId,
isVideoAuthor = isVideoAuthor,
listener = listener)
}
private fun showCommentOptions(context: Context,
private fun showCommentOptions(view: View,
commentEntity: CommentEntity,
showConversation: Boolean,
articleId: String? = null,
communityId: String? = null,
answerId: String? = null,
videoId: String? = null,
listener: OnCommentCallBackListener? = null) {
isShowTop: Boolean = false,
ignoreModerator: Boolean = false,
isVideoAuthor: Boolean = false,
listener: OnCommentOptionClickListener? = null) {
val context = view.context
val dialogOptions = ArrayList<String>()
if (isShowTop && articleId != null && commentEntity.me?.isArticleOrAnswerAuthor == true) {
dialogOptions.add(if (commentEntity.isTop) "取消置顶" else "置顶")
}
dialogOptions.add("复制")
dialogOptions.add("投诉")
if (commentEntity.user.id != UserManager.getInstance().userId) {
dialogOptions.add("投诉")
}
if (isVideoAuthor || (videoId != null && commentEntity.user.id == UserManager.getInstance().userId)) {
dialogOptions.add("删除评论")
} else if (articleId != null && (commentEntity.user.id == UserManager.getInstance().userId ||
commentEntity.me?.isModerator == true || commentEntity.me?.isArticleOrAnswerAuthor == true)) {
dialogOptions.add("删除评论")
}
commentEntity.me?.let {
if (ignoreModerator) return@let
if (it.isModerator || (it.moderatorPermissions.hideAnswerComment > Permissions.GUEST
|| it.moderatorPermissions.topAnswerComment > Permissions.GUEST
|| it.moderatorPermissions.hideCommunityArticleComment > Permissions.GUEST
@ -88,55 +117,75 @@ object CommentHelper {
dialogOptions.add("查看对话")
}
DialogUtils.showListDialog(context, dialogOptions, null) {
when (it) {
"管理" -> showControlDialog(context, answerId, articleId, communityId, commentEntity, commentEntity.me!!)
val inflater = LayoutInflater.from(context)
val layout = inflater.inflate(R.layout.comment_more_option, null)
val popupWindow = BugFixedPopupWindow(layout,
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT)
val container = layout.findViewById<LinearLayout>(R.id.container)
for (text in dialogOptions) {
val item = inflater.inflate(R.layout.comment_more_option_item, container, false)
container.addView(item)
"复制" -> copyText(commentEntity.content, context)
val hitText = item.findViewById<TextView>(R.id.hint_text)
hitText.text = text
"投诉" -> {
context.ifLogin("回答详情-评论-投诉") {
showReportTypeDialog(context) { reportType ->
item.setOnClickListener {
popupWindow.dismiss()
listener?.onCommentOptionClick(commentEntity, text)
when (text) {
"管理" -> showControlDialog(context, answerId, articleId, communityId, commentEntity, commentEntity.me!!)
val commentListener = object : PostCommentUtils.PostCommentListener {
override fun postSuccess(response: JSONObject?) {
Utils.toast(context, "感谢您的投诉")
}
"复制" -> copyText(commentEntity.content, context)
override fun postFailed(error: Throwable?) {
if (error == null) {
Utils.toast(context, "投诉失败,请稍后重试")
} else {
Utils.toast(context, "投诉失败,${error.message}")
"投诉" -> {
context.ifLogin("回答详情-评论-投诉") {
showReportTypeDialog(context, !videoId.isNullOrEmpty()) { reportType ->
val commentListener = object : PostCommentUtils.PostCommentListener {
override fun postSuccess(response: JSONObject?) {
Utils.toast(context, "感谢您的投诉")
}
override fun postFailed(error: Throwable?) {
if (error == null) {
Utils.toast(context, "投诉失败,请稍后重试")
} else {
Utils.toast(context, "投诉失败,${error.message}")
}
}
}
}
if (answerId != null) {
PostCommentUtils.postAnswerReportData(context, commentEntity.id, answerId, reportType, commentListener)
} else if (articleId != null) {
PostCommentUtils.reportCommunityArticleComment(context, communityId, articleId, commentEntity.id, reportType, commentListener)
} else {
PostCommentUtils.reportVideoComment(context, videoId, commentEntity.id, reportType, commentListener)
if (answerId != null) {
PostCommentUtils.postAnswerReportData(context, commentEntity.id, answerId, reportType, commentListener)
} else if (articleId != null) {
PostCommentUtils.reportCommunityArticleComment(context, communityId, articleId, commentEntity.id, reportType, commentListener)
} else {
PostCommentUtils.reportVideoComment(context, videoId, commentEntity.id, reportType, commentListener)
}
}
}
}
}
"查看对话" -> {
if (answerId != null) {
context.startActivity(CommentDetailActivity
.getAnswerCommentIntent(context, commentEntity.id, answerId, null))
} else if (articleId != null) {
context.startActivity(CommentDetailActivity
.getCommunityArticleCommentIntent(context, articleId, commentEntity.id, communityId, null))
} else {
context.startActivity(CommentDetailActivity
.getVideoCommentIntent(context, commentEntity.id, videoId, null))
"查看对话" -> {
if (answerId != null) {
context.startActivity(CommentDetailActivity
.getAnswerCommentIntent(context, commentEntity.id, answerId, null))
} else if (articleId != null) {
context.startActivity(CommentDetailActivity
.getCommunityArticleCommentIntent(context, articleId, commentEntity.id, communityId, null))
} else {
context.startActivity(CommentDetailActivity
.getVideoCommentIntent(context, commentEntity.id, videoId, isVideoAuthor, null))
}
}
}
}
}
popupWindow.isTouchable = true
popupWindow.isFocusable = true
popupWindow.showAutoOrientation(view)
}
private fun showControlDialog(context: Context,
@ -152,7 +201,7 @@ object CommentHelper {
var canHighlightCommentDirectly = false
var canHideCommentDirectly = false
if (me.moderatorPermissions.topAnswerComment > Permissions.GUEST
if (me.isModerator || me.moderatorPermissions.topAnswerComment > Permissions.GUEST
|| me.moderatorPermissions.topCommunityArticleComment > Permissions.GUEST) {
dialogOptions.add(highlight)
if (me.moderatorPermissions.topAnswerComment > Permissions.REPORTER
@ -161,7 +210,7 @@ object CommentHelper {
}
}
if (me.moderatorPermissions.hideAnswerComment > Permissions.GUEST
if (me.isModerator || me.moderatorPermissions.hideAnswerComment > Permissions.GUEST
|| me.moderatorPermissions.hideCommunityArticleComment > Permissions.GUEST) {
dialogOptions.add(hide)
if (me.moderatorPermissions.hideAnswerComment > Permissions.REPORTER
@ -226,10 +275,10 @@ object CommentHelper {
val errorJson = JSONObject(string)
val errorCode = errorJson.getInt("code")
if (errorCode == 403059) {
Utils.toast(getApplication(), "权限错误,请刷新后重试")
Utils.toast(HaloApp.getInstance().application, "权限错误,请刷新后重试")
return
} else {
Utils.toast(getApplication(), e.message())
Utils.toast(HaloApp.getInstance().application, e.message())
}
}
}
@ -275,10 +324,10 @@ object CommentHelper {
val errorJson = JSONObject(string)
val errorCode = errorJson.getInt("code")
if (errorCode == 403059) {
Utils.toast(getApplication(), "权限错误,请刷新后重试")
Utils.toast(HaloApp.getInstance().application, "权限错误,请刷新后重试")
return
} else {
Utils.toast(getApplication(), e.message())
Utils.toast(HaloApp.getInstance().application, e.message())
}
}
}
@ -309,16 +358,22 @@ object CommentHelper {
}
}
private fun showReportTypeDialog(context: Context, reportCallback: (reportType: String) -> Unit) {
private fun showReportTypeDialog(context: Context, isVideoComment: Boolean, reportCallback: (reportType: String) -> Unit) {
val reportTypes = arrayListOf("垃圾广告营销", "恶意攻击谩骂", "淫秽色情信息", "违法有害信息", "其它")
DialogUtils.showListDialog(context, reportTypes, null) { text ->
val jsonObject = JSONObject()
try {
jsonObject.put("reason", text)
reportCallback.invoke(jsonObject.toString())
} catch (e: JSONException) {
e.printStackTrace()
if (!isVideoComment) {
DialogUtils.showListDialog(context, reportTypes, null) { text ->
val jsonObject = JSONObject()
try {
jsonObject.put("reason", text)
reportCallback.invoke(jsonObject.toString())
} catch (e: JSONException) {
e.printStackTrace()
}
}
} else {
DialogUtils.showVideoComplaintDialog(context, reportTypes, null) { text ->
reportCallback.invoke(text)
}
}
}

View File

@ -2,7 +2,6 @@ package com.gh.common.util;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
@ -12,6 +11,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.gh.gamecenter.CommentDetailActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.viewholder.CommentViewHolder;
@ -20,6 +22,7 @@ import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserInfoEntity;
import com.gh.gamecenter.manager.UserManager;
import com.gh.gamecenter.retrofit.BiResponse;
import com.gh.gamecenter.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Utils;
@ -38,7 +41,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import androidx.core.content.ContextCompat;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.ResponseBody;
@ -50,9 +52,13 @@ import retrofit2.HttpException;
public class CommentUtils {
public static void setCommentTime(TextView textView, long time) {
textView.setText(getCommentTime(time));
}
public static String getCommentTime(long timestamp) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
try {
long day = time * 1000;
long day = timestamp * 1000;
String year = String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
format.applyPattern("yyyy");
String currentYear = format.format(day);
@ -63,35 +69,34 @@ public class CommentUtils {
int hour = (int) (min / (60 * 60));
if (hour == 0) {
if (min < 60) {
textView.setText("刚刚");
return "刚刚";
} else {
textView.setText(String.format(Locale.getDefault(), "%d分钟前", (int) (min / 60)));
return String.format(Locale.getDefault(), "%d分钟前", (int) (min / 60));
}
} else {
textView.setText(String.format(Locale.getDefault(), "%d小时前", hour));
return String.format(Locale.getDefault(), "%d小时前", hour);
}
} else if (day >= today - 86400 * 1000 && day < today) {
format.applyPattern("HH:mm");
textView.setText("昨天 ");
return "昨天 ";
} else if (day >= today - 86400 * 1000 * 7 && day < today - 86400 * 1000) {
format.applyPattern("HH:mm");
long days = (today - day) / 86400000 + 1;
textView.setText(String.format(Locale.getDefault(), "%d天前 ", days));
return String.format(Locale.getDefault(), "%d天前 ", days);
} else if (day < today - 86400 * 1000 * 7 && year.equals(currentYear)) {
format.applyPattern("MM-dd");
textView.setText(format.format(day));
return format.format(day);
} else {
format.applyPattern("yyyy-MM-dd");
textView.setText(format.format(day));
return format.format(day);
}
} catch (ParseException e) {
e.printStackTrace();
format.applyPattern("yyyy-MM-dd");
textView.setText(format.format(time * 1000));
return format.format(timestamp * 1000);
}
}
public static void showReportDialog(final CommentEntity commentEntity,
final Context context,
final boolean showConversation,
@ -275,6 +280,9 @@ public class CommentUtils {
if (TextUtils.isEmpty(articleId)) {
entrance = "社区文章详情-评论-点赞";
}
if (TextUtils.isEmpty(videoId)) {
entrance = "视频流-评论-点赞";
}
CheckLoginUtils.checkLogin(context, entrance, () -> {
if (commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(context, R.color.theme_font)) {
ToastUtils.INSTANCE.showToast("已经点过赞啦!");
@ -326,6 +334,97 @@ public class CommentUtils {
});
});
}
public static void voteVideoComment(final Context context,
String answerId,
String articleId,
String articleCommunityId,
String videoId,
final CommentEntity commentEntity,
final TextView commentLikeCountTv,
final ImageView commentLikeIv,
final OnVoteListener listener) {
String entrance = "视频流-评论-点赞";
CheckLoginUtils.checkLogin(context, entrance, () -> {
PostCommentUtils.likeComment(context, answerId, articleId, articleCommunityId, videoId, commentEntity.getId(),
new PostCommentUtils.PostCommentListener() {
@Override
public void postSuccess(JSONObject response) {
if (listener != null) {
listener.onVote();
}
}
@Override
public void postFailed(Throwable e) {
commentEntity.setVote(commentEntity.getVote() - 1);
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.hint));
commentLikeIv.setImageResource(R.drawable.comment_vote_unselect);
commentLikeCountTv.setText(NumberUtils.transSimpleCount(commentEntity.getVote()));
if (commentEntity.getVote() == 0) {
commentLikeCountTv.setVisibility(View.GONE);
} else {
commentLikeCountTv.setVisibility(View.VISIBLE);
}
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
if (exception.code() == 403) {
try {
String detail = new JSONObject(exception.response().errorBody().string()).getString("detail");
if ("voted".equals(detail)) {
ToastUtils.INSTANCE.showToast("已经点过赞啦!");
}
} catch (Exception ex) {
ex.printStackTrace();
}
return;
}
}
Utils.toast(context, "网络异常,点赞失败");
}
});
});
}
public static void unVoteVideoComment(final Context context,
String videoId,
final CommentEntity commentEntity,
final TextView commentLikeCountTv,
final ImageView commentLikeIv) {
String entrance = "视频流-评论-取消点赞";
CheckLoginUtils.checkLogin(context, entrance, () -> {
RetrofitManager.getInstance(context).getApi()
.unVoteVideoComment(videoId, commentEntity.getId())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Response<ResponseBody>() {
@Override
public void onResponse(@Nullable ResponseBody response) {
super.onResponse(response);
}
@Override
public void onFailure(@Nullable HttpException e) {
super.onFailure(e);
commentEntity.setVote(commentEntity.getVote() + 1);
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
commentLikeIv.setImageResource(R.drawable.comment_vote_select);
commentLikeCountTv.setText(NumberUtils.transSimpleCount(commentEntity.getVote()));
commentLikeCountTv.setVisibility(View.VISIBLE);
try {
if (e != null && e.response().errorBody() != null) {
ErrorHelper.handleError(context, e.response().errorBody().string(), false);
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
});
});
}
// 设置评论item 用户相关的view(点赞/头像/用户名)
@ -430,10 +529,7 @@ public class CommentUtils {
//复制文字
public static void copyText(String copyContent, Context context) {
ClipboardManager cmb = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(copyContent);
ToastUtils.INSTANCE.showToast("复制成功");
ExtensionsKt.copyTextAndToast(copyContent, "复制成功");
}

View File

@ -6,7 +6,7 @@ import android.widget.LinearLayout;
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.gamecenter.ViewImageActivity;
import com.gh.gamecenter.ImageViewerActivity;
import java.util.ArrayList;
import java.util.List;
@ -93,7 +93,7 @@ public class ConcernContentUtils {
break;
}
imageView.setOnClickListener(v -> {
Intent checkIntent = ViewImageActivity.getViewImageIntent(context, (ArrayList<String>) list, position, entrance);
Intent checkIntent = ImageViewerActivity.getIntent(context, (ArrayList<String>) list, position, entrance);
context.startActivity(checkIntent);
});
return imageView;

View File

@ -2,10 +2,10 @@ package com.gh.common.util;
import android.content.Context;
import com.gh.common.exposure.meta.MetaUtil;
import com.gh.common.loghub.LoghubUtils;
import com.halo.assistant.HaloApp;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import org.json.JSONObject;
@ -20,12 +20,13 @@ import java.util.Map;
public class DataLogUtils {
// 轮播图
public static void uploadLunbotuLog(Context context, String type, String text, String index, String source) {
public static void uploadLunbotuLog(Context context, String type, String text, String title, String index, String source) {
Map<String, Object> map = new HashMap<>();
map.put("index", index);
map.put("type", type);
map.put("text", text);
map.put("source", source);
map.put("slide_title", title);
uploadLog(context, "slide", map);
}
@ -52,10 +53,13 @@ public class DataLogUtils {
String channel = HaloApp.getInstance().getChannel();
map.put("version", version);
map.put("user", user);
map.put("device_id", Util_System_Phone_State.getDeviceId(context));
map.put("device_id", MetaUtil.getIMEI());
map.put("channel", channel);
Map<String, String> params = new HashMap<>();
if ("search-hot-tag".equals(topic) || "game".equals(topic) || "slide".equals(topic)) {
params.put("meta", LogUtils.getMetaObject().toString());
}
params.put("topic", topic);
params.put("source", "GH-ASSIST-Client");
params.put("time", String.valueOf(Utils.getTime(context)));

View File

@ -7,7 +7,6 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.gh.common.constant.Config;
import com.gh.common.constant.Constants;
import com.gh.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.BuildConfig;
@ -15,19 +14,14 @@ import com.gh.gid.GidCallback;
import com.gh.gid.GidHelper;
import com.halo.assistant.HaloApp;
import com.lightgame.config.CommonDebug;
import com.lightgame.utils.Util_System_Phone_State;
import com.lightgame.utils.Utils;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.stat.MtaSDkException;
import com.tencent.stat.StatConfig;
import com.tencent.stat.StatCrashReporter;
import com.tencent.stat.StatReportStrategy;
import com.tencent.stat.StatService;
import com.tendcloud.tenddata.TCAgent;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import io.sentry.android.core.SentryAndroid;
import io.sentry.core.Sentry;
import io.sentry.core.protocol.User;
/**
* Created by LGT on 2016/6/15.
@ -46,72 +40,101 @@ public class DataUtils {
if (CommonDebug.IS_DEBUG) {
return;
}
SentryAndroid.init(context, options -> {
options.setDebug(BuildConfig.DEBUG);
options.setEnableSessionTracking(true);
options.setEnvironment(BuildConfig.FLAVOR);
options.setDsn("https://6b1caf0d17c1408e8680f3f73ff80bd0@sentry.ghzs.com/22");
options.setBeforeSend((event, hint) -> {
if (BuildConfig.DEBUG) {
return null;
} else {
return event;
}
});
});
Sentry.configureScope(scope -> {
User user = new User();
user.setId(HaloApp.getInstance().getGid());
scope.setUser(user);
if (BuildConfig.BUILD_TIME != 0L) {
scope.setTag("alias", "内测版" + BuildConfig.VERSION_NAME + "_" + BuildConfig.BUILD_TIME);
} else {
scope.setTag("alias", "正式版" + BuildConfig.VERSION_NAME);
scope.setTag("channel", channel);
}
});
//TalkingData
try {
TCAgent.LOG_ON = false;
TCAgent.init(context, Config.TALKINGDATA_APPID, channel);
/**
*
* 不要启用!!!!不要启用,全部由{@link com.gh.base.AppUncaughtHandler}处理
*/
TCAgent.setReportUncaughtExceptions(false);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// TCAgent.LOG_ON = false;
// TCAgent.init(context, Config.TALKINGDATA_APPID, channel);
// /**
// *
// * 不要启用!!!!不要启用,全部由{@link com.gh.base.AppUncaughtHandler}处理
// */
// TCAgent.setReportUncaughtExceptions(false);
// } catch (Exception e) {
// e.printStackTrace();
// }
//MTA
try {
/**
*
* 不要启用!!!!全部由{@link com.gh.base.AppUncaughtHandler}处理
*/
StatConfig.setAutoExceptionCaught(false);
StatCrashReporter crashReporter = StatCrashReporter.getStatCrashReporter(context);
crashReporter.setJavaCrashHandlerStatus(false);
// crashReporter.setEnableInstantReporting(true);
StatConfig.setDebugEnable(false);
// 设置数据上报策略
// 测试渠道的时候即时上传,方便查看日志
if (Config.DEFAULT_CHANNEL.equals(HaloApp.getInstance().getChannel())) {
StatConfig.setStatSendStrategy(StatReportStrategy.INSTANT);
} else {
StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
StatConfig.setSendPeriodMinutes(5);
}
// 设置启用Tlink
StatConfig.setTLinkStatus(true);
StatConfig.init(context);
StatConfig.setInstallChannel(channel);
StatConfig.setAntoActivityLifecycleStat(true);
StatConfig.setAppVersion(PackageUtils.getVersionName());
// 开启收集服务
StatService.startStatService(context, Config.MTA_APPKEY, com.tencent.stat.common.StatConstants.VERSION);
StatService.registerActivityLifecycleCallbacks(context);
} catch (MtaSDkException e) {
e.printStackTrace();
}
// try {
// /**
// *
// * 不要启用!!!!全部由{@link com.gh.base.AppUncaughtHandler}处理
// */
// StatConfig.setAutoExceptionCaught(false);
//
// StatCrashReporter crashReporter = StatCrashReporter.getStatCrashReporter(context);
// crashReporter.setJavaCrashHandlerStatus(false);
//// crashReporter.setEnableInstantReporting(true);
//
// StatConfig.setDebugEnable(false);
//
// // 设置数据上报策略
// // 测试渠道的时候即时上传,方便查看日志
// if (Config.DEFAULT_CHANNEL.equals(HaloApp.getInstance().getChannel())) {
// StatConfig.setStatSendStrategy(StatReportStrategy.INSTANT);
// } else {
// StatConfig.setStatSendStrategy(StatReportStrategy.PERIOD);
// StatConfig.setSendPeriodMinutes(5);
// }
//
// // 设置启用Tlink
// StatConfig.setTLinkStatus(true);
//
// StatConfig.init(context);
// StatConfig.setInstallChannel(channel);
// StatConfig.setAntoActivityLifecycleStat(true);
// StatConfig.setAppVersion(PackageUtils.getVersionName());
//
// // 开启收集服务
// StatService.startStatService(context, Config.MTA_APPKEY, com.tencent.stat.common.StatConstants.VERSION);
// StatService.registerActivityLifecycleCallbacks(context);
// } catch (MtaSDkException e) {
// e.printStackTrace();
// }
// init bugly
try {
CrashReport.setIsDevelopmentDevice(context, Config.DEFAULT_CHANNEL.equals(channel));
CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
strategy.setEnableANRCrashMonitor(false);
strategy.setEnableNativeCrashMonitor(false);
strategy.setAppChannel(channel);
strategy.setAppVersion(PackageUtils.getVersionName());
CrashReport.initCrashReport(context, Config.BUGLY_APPID, false, strategy);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// CrashReport.setIsDevelopmentDevice(context, Config.DEFAULT_CHANNEL.equals(channel));
//
// CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(context);
// strategy.setEnableANRCrashMonitor(false);
// strategy.setEnableNativeCrashMonitor(false);
// strategy.setAppChannel(channel);
// strategy.setAppVersion(PackageUtils.getVersionName());
//
// CrashReport.initCrashReport(context, Config.BUGLY_APPID, false, strategy);
//
// } catch (Exception e) {
// e.printStackTrace();
// }
}
@ -124,39 +147,43 @@ public class DataUtils {
}
public static void getGid() {
GidHelper.getInstance().registerDevice(new GidCallback() {
GidHelper.getInstance().registerDevice(HaloApp.getInstance().getApplication(), new GidCallback() {
@Override
public void onSuccess(String s) {
Utils.log("Gid", s);
PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance().getApplication()).edit().putString(Constants.DEVICE_KEY, s).apply();
public void onSuccess(String gid) {
Utils.log("Gid", gid);
PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance().getApplication()).edit().putString(Constants.DEVICE_KEY, gid).apply();
String originalGid = HaloApp.getInstance().getGid();
HaloApp.getInstance().setGid(gid);
// 避免重复调用
if (!TextUtils.isEmpty(gid) && !gid.equals(originalGid)) {
GameSubstituteRepositoryHelper.updateSubstitutableGames();
}
HaloApp.getInstance().setGid(s);
// 避免初始化顺序问题导致 MetaUtil 一直持有空的 gid
MetaUtil.INSTANCE.refreshMeta();
}
@Override
public void onFailure(String s) {
Utils.log(s);
MtaHelper.onEventWithBasicDeviceInfo("开发辅助", "GID 获取异常", s);
}
});
}
public static void onEvent(Context var0, String var1, String var2) {
TCAgent.onEvent(var0, var1, var2);
Properties prop = new Properties();
prop.setProperty(var1, var2);
StatService.trackCustomKVEvent(var0, var1, prop);
// Properties prop = new Properties();
// prop.setProperty(var1, var2);
// StatService.trackCustomKVEvent(var0, var1, prop);
}
public static void onPause(Activity var0) {
TCAgent.onPageEnd(var0, var0.getClass().getSimpleName());
StatService.onPause(var0);
// StatService.onPause(var0);
}
public static void onResume(Activity var0) {
TCAgent.onPageStart(var0, var0.getClass().getSimpleName());
StatService.onResume(var0);
// StatService.onResume(var0);
}
// 游戏启动
@ -168,31 +195,30 @@ public class DataUtils {
}
public static void onEvent(Context var0, String var1, String var2, Map<String, Object> var3) {
TCAgent.onEvent(var0, var1, var2, var3);
Properties prop = new Properties();
prop.setProperty("label", var2);
for (String key : var3.keySet()) {
prop.setProperty(key, var3.get(key) + "");
}
StatService.trackCustomKVEvent(var0, var1, prop);
// Properties prop = new Properties();
// prop.setProperty("label", var2);
// for (String key : var3.keySet()) {
// prop.setProperty(key, var3.get(key) + "");
// }
// StatService.trackCustomKVEvent(var0, var1, prop);
}
public static void trackTimeEvent(Context context, String eventId, int costTime, String... kv) {
Properties prop = new Properties();
for (int i = 0; i < kv.length; i++) {
if (i % 2 != 0 || i != 0) {
String key = kv[i - 1];
String value = kv[i];
if (!TextUtils.isEmpty(key) && !TextUtils.isEmpty(value)) {
prop.setProperty(key, value);
}
}
}
if (prop.size() == 0) return;
StatService.trackCustomKVTimeIntervalEvent(context, costTime, eventId, prop);
//
// Properties prop = new Properties();
// for (int i = 0; i < kv.length; i++) {
// if (i % 2 != 0 || i != 0) {
// String key = kv[i - 1];
// String value = kv[i];
// if (!TextUtils.isEmpty(key) && !TextUtils.isEmpty(value)) {
// prop.setProperty(key, value);
// }
// }
// }
//
// if (prop.size() == 0) return;
//
// StatService.trackCustomKVTimeIntervalEvent(context, costTime, eventId, prop);
}
// 游戏下载
@ -203,7 +229,7 @@ public class DataUtils {
kv.put("版本", platform);
kv.put("用户机型", Build.MODEL);
kv.put("设备IMEI", Util_System_Phone_State.getDeviceId(HaloApp.getInstance().getApplication()));
kv.put("设备IMEI", MetaUtil.getIMEI());
kv.put("网络状态", DeviceUtils.getNetwork(HaloApp.getInstance().getApplication()));
kv.put("光环助手版本", BuildConfig.VERSION_NAME);
kv.put("位置", entrance);
@ -240,13 +266,13 @@ public class DataUtils {
public static void onError(Context context, Throwable throwable) {
//bugly 作为默认处理异常的类库,已经上报了,此处不重复上报
try {
CrashReport.postCatchedException(throwable);
// CrashReport.postCatchedException(throwable);
} catch (Exception e) {
}
//talkingdata
try {
TCAgent.onError(context, throwable);
// TCAgent.onError(context, throwable);
} catch (Exception e) {
}
}

View File

@ -5,7 +5,10 @@ import android.view.View;
import com.gh.common.constant.Config;
import com.gh.common.repository.ReservationRepository;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.view.DownloadProgressBar;
import com.gh.common.xapk.XapkInstaller;
import com.gh.common.xapk.XapkUnzipStatus;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.viewholder.DetailViewHolder;
@ -13,7 +16,6 @@ import com.gh.gamecenter.entity.LinkEntity;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.manager.PackagesManager;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.Utils;
/**
* Created by khy on 27/06/17.
@ -65,6 +67,9 @@ public class DetailDownloadUtils {
if ("dialog".equals(viewHolder.gameEntity.getDownloadOffStatus())) {
viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "查看详情" : viewHolder.gameEntity.getDownloadOffText());
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.NONE_WITH_HINT);
} else if ("updating".equals(viewHolder.gameEntity.getDownloadOffStatus())) {
viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "更新中" : viewHolder.gameEntity.getDownloadOffText());
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.UPDATING);
} else {
viewHolder.mDownloadPb.setText(TextUtils.isEmpty(viewHolder.gameEntity.getDownloadOffText()) ? "暂无下载" : viewHolder.gameEntity.getDownloadOffText());
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.NONE);
@ -112,8 +117,18 @@ public class DetailDownloadUtils {
}
public static void detailInvalidate(DetailViewHolder viewHolder) {
viewHolder.mDownloadPb.setProgress((int) (viewHolder.downloadEntity.getPercent() * 10));
DownloadEntity downloadEntity = viewHolder.downloadEntity;
String xapkStatus = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS);
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
String percent = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_PERCENT);
viewHolder.mDownloadPb.setText("解压中(" + percent + "%");
viewHolder.mDownloadPb.setProgress((int) (Float.valueOf(percent) * 10));
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.XAPK_UNZIPPING);
return;
}
viewHolder.mDownloadPb.setProgress((int) (viewHolder.downloadEntity.getPercent() * 10));
switch (downloadEntity.getStatus()) {
case downloading:
case pause:
@ -137,13 +152,25 @@ public class DetailDownloadUtils {
}
break;
case done:
viewHolder.mDownloadPb.setText(R.string.install);
if (downloadEntity.isPluggable()
&& PackagesManager.isInstalled(downloadEntity.getPackageName())) {
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.INSTALL_PLUGIN);
} else {
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.INSTALL_NORMAL);
if (SimulatorGameManager.isSimulatorGame(viewHolder.gameEntity)){
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(viewHolder.context, viewHolder.gameEntity.getSimulator().getApk().getPackageName());
if (isInstalled){
viewHolder.mDownloadPb.setText(R.string.launch);
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.LAUNCH_OR_OPEN);
}else{
viewHolder.mDownloadPb.setText(R.string.install);
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.INSTALL_NORMAL);
}
}else{
viewHolder.mDownloadPb.setText(R.string.install);
if (downloadEntity.isPluggable()
&& PackagesManager.isInstalled(downloadEntity.getPackageName())) {
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.INSTALL_PLUGIN);
} else {
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.INSTALL_NORMAL);
}
}
break;
case cancel:
case hijack:

View File

@ -3,12 +3,12 @@ package com.gh.common.util
import android.content.Context
import android.os.Environment
import android.preference.PreferenceManager
import com.gh.common.exposure.meta.MetaUtil
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.entity.TimeEntity
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Util_System_Phone_State
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
@ -60,7 +60,7 @@ object DeviceTokenUtils {
lunchType = LunchType.FIRST
}
// 保存deviceId
var deviceId = Util_System_Phone_State.getDeviceId(HaloApp.getInstance().application)
var deviceId = MetaUtil.getIMEI()
if (deviceId.isNullOrEmpty()) {
deviceId = Utils.getTime(HaloApp.getInstance().application).toString()
}

View File

@ -6,24 +6,21 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.gh.common.exposure.meta.MetaUtil;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Util_System_Phone_State;
import com.tencent.stat.StatConfig;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.io.Reader;
import java.net.Inet4Address;
import java.net.InetAddress;
@ -44,14 +41,14 @@ public class DeviceUtils {
context = context.getApplicationContext();
JSONObject object = new JSONObject();
object.put("os", "Android");
object.put("imei", Util_System_Phone_State.getDeviceId(context));
object.put("imei", MetaUtil.getIMEI());
object.put("mac", getMac(context));
object.put("model", MODEL);
object.put("manufacturer", MANUFACTURER);
object.put("android_id", Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
object.put("android_id", MetaUtil.getAndroidId());
object.put("android_sdk", Build.VERSION.SDK_INT);
object.put("android_version", android.os.Build.VERSION.RELEASE);
object.put("ip", getIPAddress(context));
object.put("ip", "");
object.put("network", getNetwork(context));
return object;
}
@ -60,10 +57,10 @@ public class DeviceUtils {
public static JSONObject getUserDevice(Context context) { // 判断新老用户device数据
JSONObject object = new JSONObject();
try {
object.put("IMEI", Util_System_Phone_State.getDeviceId(context));
object.put("ANDROID_ID", Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));
object.put("IMEI", MetaUtil.getIMEI());
object.put("ANDROID_ID", MetaUtil.getAndroidId());
object.put("MAC", getMac(context));
object.put("MTA_ID", StatConfig.getMid(context));
// object.put("MTA_ID", StatConfig.getMid(context));
object.put("MANUFACTURER", MANUFACTURER);
object.put("MODEL", MODEL);
object.put("ANDROID_SDK", Build.VERSION.SDK_INT);
@ -76,39 +73,39 @@ public class DeviceUtils {
}
public static String getMac(Context context) {
String str = "";
String macSerial = "";
try {
Process pp = Runtime.getRuntime().exec(
"cat /sys/class/net/wlan0/address ");
InputStreamReader ir = new InputStreamReader(pp.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
while (null != str) {
str = input.readLine();
if (str != null) {
macSerial = str.trim();// 去空格
break;
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
if ("".equals(macSerial)) {
try {
return loadFileAsString("/sys/class/net/eth0/address")
.toUpperCase().substring(0, 17);
} catch (FileNotFoundException e) {
// do nothing
} catch (Exception e) {
e.printStackTrace();
}
}
if (TextUtils.isEmpty(macSerial)) { // 备用方案
macSerial = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConnectionInfo().getMacAddress();
}
return macSerial;
// String str = "";
// String macSerial = "";
// try {
// Process pp = Runtime.getRuntime().exec(
// "cat /sys/class/net/wlan0/address ");
// InputStreamReader ir = new InputStreamReader(pp.getInputStream());
// LineNumberReader input = new LineNumberReader(ir);
//
// while (null != str) {
// str = input.readLine();
// if (str != null) {
// macSerial = str.trim();// 去空格
// break;
// }
// }
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// if ("".equals(macSerial)) {
// try {
// return loadFileAsString("/sys/class/net/eth0/address")
// .toUpperCase().substring(0, 17);
// } catch (FileNotFoundException e) {
// // do nothing
// } catch (Exception e) {
// e.printStackTrace();
// }
//
// }
// if (TextUtils.isEmpty(macSerial)) { // 备用方案
// macSerial = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConnectionInfo().getMacAddress();
// }
return "";
}
private static String loadFileAsString(String fileName) throws Exception {
@ -222,8 +219,7 @@ public class DeviceUtils {
// get sim
public static String getSim(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imsi = tm.getSubscriberId();
String imsi = getTelephonySubscriberId(context);
if (imsi == null) {
return "";
}
@ -239,6 +235,11 @@ public class DeviceUtils {
return "";
}
@Nullable
public static String getTelephonySubscriberId(Context context) {
return "";
}
// ping domain
public static String ping(String domain) {
try {
@ -266,21 +267,23 @@ public class DeviceUtils {
return memInfo.totalMem / (1024 * 1024);
}
// 只能获取WiFi的IpAddress
public static String getCurrentIpAddress() {
String ipAddress;
WifiManager wifiManager = (WifiManager) HaloApp.getInstance().
getApplication().
getApplicationContext().
getSystemService(Context.WIFI_SERVICE);
int address = wifiManager.getDhcpInfo().ipAddress;
ipAddress = ((address & 0xFF)
+ "." + ((address >> 8) & 0xFF)
+ "." + ((address >> 16) & 0xFF)
+ "." + ((address >> 24) & 0xFF));
return ipAddress;
String ipAddress = "0.0.0.0";
try {
WifiManager wifiManager = (WifiManager) HaloApp.getInstance().
getApplication().
getApplicationContext().
getSystemService(Context.WIFI_SERVICE);
int address = wifiManager.getDhcpInfo().ipAddress;
ipAddress = ((address & 0xFF)
+ "." + ((address >> 8) & 0xFF)
+ "." + ((address >> 16) & 0xFF)
+ "." + ((address >> 24) & 0xFF));
return ipAddress;
} catch (Exception e) {
return ipAddress;
}
}
}

View File

@ -8,9 +8,11 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.CountDownTimer;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
@ -25,12 +27,23 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.common.AppExecutor;
import com.gh.common.constant.Config;
import com.gh.common.dialog.TrackableDialog;
@ -40,32 +53,34 @@ import com.gh.common.view.LimitHeightLinearLayout;
import com.gh.common.view.MaxHeightNestedScrollView;
import com.gh.gamecenter.AboutActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.WebActivity;
import com.gh.gamecenter.SuggestionActivity;
import com.gh.gamecenter.adapter.viewholder.PrivacyPolicyItemViewHolder;
import com.gh.gamecenter.databinding.DialogOverseaConfirmationBinding;
import com.gh.gamecenter.databinding.ImprintContentItemBinding;
import com.gh.gamecenter.databinding.PrivacyItemBinding;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.Badge;
import com.gh.gamecenter.entity.BadgeEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.PrivacyPolicyEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.TrackableEntity;
import com.gh.gamecenter.suggest.SuggestType;
import com.halo.assistant.HaloApp;
import com.halo.assistant.fragment.SettingsFragment;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.AppManager;
import com.lightgame.utils.Util_System_Keyboard;
import com.lightgame.utils.Utils;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
public class DialogUtils {
public static Dialog showWaitDialog(Context context, String msg) {
@ -82,7 +97,6 @@ public class DialogUtils {
return dialog;
}
public static void showInstallHintDialog(Context context, final ConfirmListener cmListener) {
context = checkDialogContext(context);
@ -196,7 +210,7 @@ public class DialogUtils {
AppExecutor.getUiExecutor().executeWithDelay(() -> Utils.toast(context, "当前使用移动网络下载,请注意流量消耗"), 500);
callBack.onResponse(false);
} else {
MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(context), "出现弹窗提示");
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(context), "出现弹窗提示");
showDownloadDialog(context,
() -> callBack.onResponse(false),
() -> callBack.onResponse(true));
@ -256,12 +270,12 @@ public class DialogUtils {
}, 500);
listener.onConfirm();
dialog.dismiss();
MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "本次允许");
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "本次允许");
});
wifiAuto.setOnClickListener(v -> {
cancelListener.onCancel();
dialog.dismiss();
MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
});
allowAlways.setOnClickListener(v -> {
PreferenceManager
@ -276,7 +290,7 @@ public class DialogUtils {
}, 500);
listener.onConfirm();
dialog.dismiss();
MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "总是允许");
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "总是允许");
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -324,6 +338,84 @@ public class DialogUtils {
dialog.show();
}
/**
* ios 风格弹窗
*
* @param context
* @param title 标题
* @param message 内容
* @param negative 取消按钮文本
* @param positive 确认按钮文本
* @param clListener 取消按钮监听
* @param cmListener 确认按钮监听
*/
public static Dialog showNewAlertDialog(Context context, String title, CharSequence message
, String negative, String positive, TrackableEntity trackableEntity, int gravity, final CancelListener clListener, final ConfirmListener cmListener) {
context = checkDialogContext(context);
final Dialog dialog;
if (trackableEntity != null) {
dialog = new TrackableDialog(context,
R.style.GhAlertDialog,
trackableEntity.getEvent(),
trackableEntity.getKey(),
trackableEntity.getValue(),
trackableEntity.getCancelValue(),
trackableEntity.getKeyBackValue(),
trackableEntity.getLogShowEvent());
} else {
dialog = new Dialog(context, R.style.GhAlertDialog);
}
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_new_alert, null);
TextView titleTv = contentView.findViewById(R.id.title);
TextView contentTv = contentView.findViewById(R.id.content);
TextView cancelBtn = contentView.findViewById(R.id.cancel);
TextView confirmBtn = contentView.findViewById(R.id.confirm);
View middleLine = contentView.findViewById(R.id.middle_line);
titleTv.setGravity(gravity);
contentTv.setGravity(gravity);
titleTv.setText(title);
contentTv.setText(message);
cancelBtn.setText(negative);
confirmBtn.setText(positive);
if (negative.isEmpty()) {
cancelBtn.setVisibility(View.GONE);
middleLine.setVisibility(View.GONE);
confirmBtn.setTextColor(ContextCompat.getColor(context, R.color.text_333333));
}
if (positive.isEmpty()) {
confirmBtn.setVisibility(View.GONE);
middleLine.setVisibility(View.GONE);
}
cancelBtn.setOnClickListener(v -> {
if (clListener != null) clListener.onCancel();
dialog.dismiss();
});
confirmBtn.setOnClickListener(v -> {
if (cmListener != null) cmListener.onConfirm();
dialog.dismiss();
});
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
return dialog;
}
public static Dialog showNewAlertDialog(Context context, String title, CharSequence message
, String negative, String positive, final CancelListener clListener, final ConfirmListener cmListener) {
return showNewAlertDialog(context, title, message, negative, positive, null, Gravity.LEFT, clListener, cmListener);
}
/**
* Material Design 风格弹窗
*
@ -541,8 +633,6 @@ public class DialogUtils {
clListener.onCancel();
});
dialog.show();
}
@ -586,7 +676,6 @@ public class DialogUtils {
dialog.setContentView(contentView);
dialog.setCancelable(false);
dialog.show();
}
/**
@ -667,7 +756,6 @@ public class DialogUtils {
TextPaint tp = mesage.getPaint();
tp.setFakeBoldText(true);
}
}
public static void showSignDialog(Context context, String title, CharSequence message, CharSequence message2
@ -900,13 +988,13 @@ public class DialogUtils {
WindowManager.LayoutParams params = window.getAttributes();
params.horizontalMargin = 0;
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(40);
int height = context.getResources().getDisplayMetrics().heightPixels - DisplayUtils.dip2px(120);
int maxHeight = DisplayUtils.dip2px(546);
if (height > maxHeight) {
params.height = maxHeight;
} else {
params.height = height;
}
// int height = context.getResources().getDisplayMetrics().heightPixels - DisplayUtils.dip2px(120);
// int maxHeight = DisplayUtils.dip2px(446);
// if (height > maxHeight) {
// params.height = maxHeight;
// } else {
// params.height = height;
// }
window.setAttributes(params);
}
@ -937,7 +1025,7 @@ public class DialogUtils {
if (hierarchy != null) {
if (position == 0) {
hierarchy.setPlaceholderImage(R.drawable.permission_storage);
} else {
} else if (position == 1) {
hierarchy.setPlaceholderImage(R.drawable.permission_phone_state);
}
}
@ -961,9 +1049,8 @@ public class DialogUtils {
@Override
public void onClick(@NonNull View widget) {
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击隐私政策");
Intent intent = WebActivity.getPrivacyPolicyIntent(activityContext);
activityContext.startActivity(intent);
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击隐私政策");
DirectUtils.directToExternalBrowser(context, context.getString(R.string.privacy_policy_url));
}
}, skipText.length() - 9, skipText.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
@ -977,11 +1064,26 @@ public class DialogUtils {
@Override
public void onClick(@NonNull View widget) {
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击用户协议");
activityContext.startActivity(WebActivity.getWebIntent(activityContext));
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击用户协议");
DirectUtils.directToExternalBrowser(context, context.getString(R.string.disclaimer_url));
}
}, skipText.length() - 4, skipText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
/*skipText.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ContextCompat.getColor(activityContext, R.color.theme_font));
ds.setUnderlineText(false);
}
@Override
public void onClick(@NonNull View widget) {
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击第三方SDK接入说明");
activityContext.startActivity(WebActivity.getThirdPartySdkStatementIntent(activityContext));
}
}, skipText.length() - 10, skipText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);*/
title.setText(entity.getTitle());
linkContent.setText(skipText);
linkContent.setMovementMethod(new LinkMovementMethod());
@ -991,30 +1093,30 @@ public class DialogUtils {
allowButton.setOnClickListener(view -> {
dialog.dismiss();
callback.onCallback();
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击同意");
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击同意");
});
disallowButton.setOnClickListener(v -> {
dialog.dismiss();
showPrivacyPolicyDisallowDialog(activityContext, entity, callback);
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "不同意并退出App");
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "不同意并退出App");
});
dialog.setOnCancelListener(cd -> {
if (isCanceledByClickOutsideOfDialog.get()) {
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击空白");
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击空白");
}
});
dialog.setOnKeyListener((dialog1, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
isCanceledByClickOutsideOfDialog.set(false);
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击返回");
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击返回");
}
return false;
});
MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "出现弹窗");
// 用户未同意隐私策略不应该触发 MTA 事件
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "出现弹窗");
try {
dialog.setCancelable(false);
@ -1035,14 +1137,16 @@ public class DialogUtils {
View reviewButton = contentView.findViewById(R.id.review_button);
backButton.setOnClickListener(v -> {
MtaHelper.onEvent("隐私政策弹窗", "退出提示弹窗", "退出应用");
// 用户未同意隐私策略不应该触发 MTA 事件
// MtaHelper.onEvent("隐私政策弹窗", "退出提示弹窗", "退出应用");
dialog.dismiss();
AppManager.getInstance().appExit(activityContext);
});
reviewButton.setOnClickListener(v -> {
MtaHelper.onEvent("隐私政策弹窗", "退出提示弹窗", "再次查看");
// MtaHelper.onEvent("隐私政策弹窗", "退出提示弹窗", "再次查看");
callback.onCallback();
dialog.dismiss();
showPrivacyPolicyDialog(activityContext, entity, callback);
//showPrivacyPolicyDialog(activityContext, entity, callback);
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -1101,6 +1205,21 @@ public class DialogUtils {
final ConfirmListener cmListener,
final CancelListener clListener,
TrackableEntity trackableEntity) {
return showTrackableDialog(context, false, title, message, positive, negative, cmListener, clListener, trackableEntity);
}
/**
* @param useRoundedCornerStyle 使用圆角样式
*/
public static Dialog showTrackableDialog(Context context,
boolean useRoundedCornerStyle,
String title,
CharSequence message,
String positive,
String negative,
final ConfirmListener cmListener,
final CancelListener clListener,
TrackableEntity trackableEntity) {
context = checkDialogContext(context);
final TrackableDialog dialog = new TrackableDialog(context,
@ -1112,7 +1231,17 @@ public class DialogUtils {
trackableEntity.getKeyBackValue(),
trackableEntity.getLogShowEvent());
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
View contentView;
if (useRoundedCornerStyle) {
contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert_with_rounded_corner, null);
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
} else {
contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
}
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
@ -1267,6 +1396,45 @@ public class DialogUtils {
}
}
// 海外下载地址弹窗
public static void showOverseaDownloadDialog(Context context, GameEntity gameEntity, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
if (gameEntity.getOverseasAddressDialog() == null
|| gameEntity.getApk().size() == 0
|| !gameEntity.getOverseasAddressDialog().isEnable()) {
listener.onConfirm();
} else {
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
DialogOverseaConfirmationBinding binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_oversea_confirmation, null, false);
View contentView = binding.getRoot();
binding.setGame(gameEntity);
binding.urlTv.setText(gameEntity.getOverseasAddressDialog().getLink());
binding.closeIv.setOnClickListener(v -> dialog.dismiss());
binding.downloadBtn.setText("下载(" + gameEntity.getApk().get(0).getSize() + "");
binding.downloadBtn.setOnClickListener(v -> {
listener.onConfirm();
dialog.dismiss();
});
if ("show&download".equals(gameEntity.getOverseasAddressDialog().getStatus())) {
gameEntity.getApk().get(0).setUrl(gameEntity.getOverseasAddressDialog().getLink());
}
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
}
public static void showImprintDialog(Context context, GameEntity gameEntity, String titleName) {
context = checkDialogContext(context);
Dialog dialog = new Dialog(context, R.style.full_dialog);
@ -1343,6 +1511,397 @@ public class DialogUtils {
dialog.show();
}
public static void showStopServerExplanationDialog(Context context, String content, String gameName) {
context = checkDialogContext(context);
final Dialog dialog = new TrackableDialog(context, R.style.GhAlertDialog, "评论说明弹窗", "弹窗", gameName, null, null, true);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_stop_service_explanation, null);
TextView contentTv = contentView.findViewById(R.id.contentTv);
MaxHeightNestedScrollView scrollView = contentView.findViewById(R.id.scrollView);
if (TextUtils.isEmpty(content)) {
content = context.getString(R.string.rating_protection);
}
contentTv.setText(content);
TextView ok = contentView.findViewById(R.id.dialog_ok);
scrollView.setScrollChangedListener((l, t, oldl, oldt) -> {
MtaHelper.onEvent("评论说明弹窗", "滑动内容", gameName);
});
ok.setOnClickListener(v -> {
MtaHelper.onEvent("评论说明弹窗", "弹窗", "点击我知道了");
MtaHelper.onEvent("评论说明弹窗", "点击我知道了", gameName);
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(60f);
window.setAttributes(params);
}
}
public static void showPluggableNeverRemindDialog(Context context, String nameAndPlatform, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_pluggable_never_remind, null);
View cancelBtn = contentView.findViewById(R.id.cancel);
View confirmBtn = contentView.findViewById(R.id.confirm);
TextView contentTv = contentView.findViewById(R.id.content);
contentTv.setText(("助手首页将不再提示《" + nameAndPlatform + "》的所有插件化消息,确定吗?"));
cancelBtn.setOnClickListener(v -> {
dialog.dismiss();
});
confirmBtn.setOnClickListener(v -> {
listener.onConfirm();
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showRegulationTestDialog(Context context, @NonNull ConfirmListener confirmListener, @NonNull CancelListener cancelListener) {
context = checkDialogContext(context);
final Dialog dialog = new TrackableDialog(
context,
R.style.GhAlertDialog,
"礼仪考试",
"礼仪考试弹窗",
null, null, null,
true);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_regulation_test, null);
View cancelBtn = contentView.findViewById(R.id.cancel);
View confirmBtn = contentView.findViewById(R.id.confirm);
View linkTv = contentView.findViewById(R.id.link);
Context finalContext = context;
linkTv.setOnClickListener(v -> {
MtaHelper.onEvent("礼仪考试", "礼仪考试弹窗", "了解更多");
DirectUtils.directToArticle(finalContext, "5f4477be25e07e19be4e2a22", "(礼仪测试弹窗)");
});
cancelBtn.setOnClickListener(v -> {
cancelListener.onCancel();
MtaHelper.onEvent("礼仪考试", "礼仪考试弹窗", "跳过");
dialog.dismiss();
});
Context finalContext1 = context;
confirmBtn.setOnClickListener(v -> {
Util_System_Keyboard.hideSoftKeyboard((Activity) finalContext1);
MtaHelper.onEvent("礼仪考试", "礼仪考试弹窗", "确定");
confirmListener.onConfirm();
dialog.dismiss();
});
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showUnzipFailureDialog(Context context, DownloadEntity downloadEntity) {
final Context activityContext = checkDialogContext(context);
final Dialog dialog = new Dialog(activityContext, R.style.GhAlertDialog);
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawableResource(android.R.color.transparent);
}
View contentView = LayoutInflater.from(activityContext).inflate(R.layout.dialog_unzip_failure, null);
View cancelBtn = contentView.findViewById(R.id.cancel);
View confirmBtn = contentView.findViewById(R.id.confirm);
cancelBtn.setOnClickListener(v -> {
dialog.dismiss();
});
confirmBtn.setOnClickListener(v -> {
dialog.dismiss();
String hint = "" + downloadEntity.getName() + "》游戏安装包解压失败,问题反馈:";
SuggestionActivity.startSuggestionActivity(activityContext, SuggestType.normal, null, hint);
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showNoticeDialog(Context context, String title, String content, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_notice, null);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
if (title == null) {
titleTv.setVisibility(View.GONE);
} else {
titleTv.setVisibility(View.VISIBLE);
titleTv.setText(title);
}
contentTv.setText(content);
contentView.findViewById(R.id.dialog_ok).setOnClickListener(v -> {
listener.onConfirm();
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showVideoComplaintDialog(Context context,
List<String> options,
List<String> disabledOptions,
OptionCallback callback) {
context = checkDialogContext(context);
Dialog dialog = new Dialog(context);
View view = LayoutInflater.from(context).inflate(R.layout.dialog_video_complaint, null, false);
LinearLayout complaintContainer = view.findViewById(R.id.complaintContainer);
ConstraintLayout otherComplaintContainer = view.findViewById(R.id.otherComplaintContainer);
EditText complaintCommentEt = view.findViewById(R.id.complaintCommentEt);
TextView backTv = view.findViewById(R.id.backTv);
TextView commitTv = view.findViewById(R.id.commitTv);
Context finalContext = context;
//添加透明阴影,实现类似 clipPadding=false 效果
complaintCommentEt.setShadowLayer(complaintCommentEt.getExtendedPaddingBottom(), 0f, 0f, Color.TRANSPARENT);
ExtensionsKt.setTextChangedListener(complaintCommentEt, (s, start, before, count) -> {
commitTv.setTextColor(ContextCompat.getColor(finalContext, s.toString().trim().isEmpty() ? R.color.text_999999 : R.color.theme_font));
return null;
});
for (String option : options) {
TextView reportTv = new TextView(context);
reportTv.setText(option);
reportTv.setTextSize(16f);
if (disabledOptions != null && disabledOptions.contains(option)) {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.btn_gray));
} else {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.title));
reportTv.setBackgroundResource(R.drawable.textview_white_style);
}
reportTv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
reportTv.setPadding(DisplayUtils.dip2px(context, 20f), DisplayUtils.dip2px(context, 17f),
DisplayUtils.dip2px(context, 20f), DisplayUtils.dip2px(context, 17f));
if (option.equals("其它")) {
Drawable drawable = ContextCompat.getDrawable(context, R.drawable.ic_complaint_arrow_right);
drawable.setBounds(0, 0, DisplayUtils.dip2px(6f), DisplayUtils.dip2px(10f));
reportTv.setCompoundDrawables(null, null, drawable, null);
}
complaintContainer.addView(reportTv);
reportTv.setOnClickListener(v -> {
if (option.equals("其它")) {
complaintContainer.setVisibility(View.GONE);
otherComplaintContainer.setVisibility(View.VISIBLE);
complaintCommentEt.requestFocus();
Util_System_Keyboard.showSoftKeyboard(finalContext, complaintCommentEt);
} else {
dialog.cancel();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("reason", reportTv.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
callback.onClicked(jsonObject.toString());
}
});
}
backTv.setOnClickListener(v -> {
Util_System_Keyboard.hideSoftKeyboard(finalContext, complaintCommentEt);
complaintContainer.setVisibility(View.VISIBLE);
otherComplaintContainer.setVisibility(View.GONE);
});
commitTv.setOnClickListener(v -> {
if (complaintCommentEt.getText().toString().isEmpty()) {
ToastUtils.INSTANCE.showToast("请先输入说明~");
return;
}
dialog.cancel();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("reason", "其它");
jsonObject.put("description", complaintCommentEt.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
callback.onClicked(jsonObject.toString());
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(view);
dialog.show();
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(40f);
window.setAttributes(params);
}
}
public static void showViewBadgeDialog(Context context, Badge badge, ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_view_badge, null);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
SimpleDraweeView badgeView = contentView.findViewById(R.id.dialog_badge);
ImageView badgeLightBg = contentView.findViewById(R.id.dialog_badge_light_bg);
ImageUtils.display(badgeView, badge.getIcon());
titleTv.setText(badge.getName());
// 领取条件文本超过一行就不显示
if (badge.getActions() == null || badge.getActions().isEmpty() || badge.getActions().size() > 1) {
contentTv.setVisibility(View.INVISIBLE);
} else {
contentTv.setText(badge.getActions().get(0).getText());
contentTv.post(() -> {
if (contentTv.getLineCount() > 1) contentTv.setVisibility(View.INVISIBLE);
});
}
Animation animation = AnimationUtils.loadAnimation(context, R.anim.anim_badge_light_bg);
badgeLightBg.startAnimation(animation);
contentView.findViewById(R.id.dialog_ok).setOnClickListener(v -> {
listener.onConfirm();
badgeLightBg.clearAnimation();
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showReceiveBadgeDialog(Context context, BadgeEntity badge, ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_receive_badge, null);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
SimpleDraweeView badgeView = contentView.findViewById(R.id.dialog_badge);
ImageView badgeLightBg = contentView.findViewById(R.id.dialog_badge_light_bg);
TextView receiveTv = contentView.findViewById(R.id.dialog_ok);
ImageUtils.display(badgeView, badge.getIcon());
titleTv.setText(badge.getName());
// 领取条件文本超过一行就不显示
if (badge.getActions() == null || badge.getActions().isEmpty() || badge.getActions().size() > 1) {
contentTv.setVisibility(View.INVISIBLE);
} else {
contentTv.setText(badge.getActions().get(0).getText());
contentTv.post(() -> {
if (contentTv.getLineCount() > 1) contentTv.setVisibility(View.INVISIBLE);
});
}
if ("self".equals(badge.getReceive().getType())) {
receiveTv.setText(R.string.receive_badge);
} else {
receiveTv.setText(R.string.apply_badge);
}
Animation animation = AnimationUtils.loadAnimation(context, R.anim.anim_badge_light_bg);
badgeLightBg.startAnimation(animation);
contentView.findViewById(R.id.dialog_ok).setOnClickListener(v -> {
listener.onConfirm();
badgeLightBg.clearAnimation();
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showPassRegulationDialog(Context context, String icon) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_pass_regulation, null);
SimpleDraweeView userIcon = contentView.findViewById(R.id.dialog_icon);
ImageUtils.display(userIcon, icon);
contentView.findViewById(R.id.dialog_ok).setOnClickListener(v -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showShortCutPermissionDialog(Context context) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_shortcut_permission, null);
Context finalContext = context;
contentView.findViewById(R.id.dialog_positive).setOnClickListener(v -> {
dialog.dismiss();
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + finalContext.getPackageName()));
finalContext.startActivity(intent);
});
contentView.findViewById(R.id.dialog_negative).setOnClickListener(v -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
/**
* @param context may be is application context
* @return activity context

View File

@ -6,22 +6,36 @@ import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.base.BaseActivity
import com.gh.base.BaseActivity_TabLayout
import com.gh.base.ToolBarActivity
import com.gh.base.fragment.BaseFragment_TabLayout
import com.gh.common.AppExecutor
import com.gh.common.constant.Config
import com.gh.common.constant.Constants
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureEvent.Companion.createEvent
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.common.exposure.ExposureType
import com.gh.common.util.EntranceUtils.*
import com.gh.gamecenter.*
import com.gh.gamecenter.amway.AmwayActivity
import com.gh.gamecenter.catalog.CatalogActivity
import com.gh.gamecenter.category.CategoryDirectoryActivity
import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBReuse
import com.gh.gamecenter.eventbus.EBSkip
import com.gh.gamecenter.forum.detail.ForumDetailActivity
import com.gh.gamecenter.fragment.MainWrapperFragment
import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailActivity
import com.gh.gamecenter.game.upload.GameSubmissionActivity
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
import com.gh.gamecenter.manager.UserManager
import com.gh.gamecenter.mygame.PlayedGameActivity
import com.gh.gamecenter.personalhome.UserHomeActivity
@ -32,17 +46,26 @@ import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.qa.column.detail.AskColumnDetailActivity
import com.gh.gamecenter.qa.questions.detail.QuestionsDetailActivity
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
import com.gh.gamecenter.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.suggest.SuggestType
import com.gh.gamecenter.tag.TagsActivity
import com.gh.gamecenter.video.data.VideoDataActivity
import com.gh.gamecenter.video.detail.VideoDetailActivity
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
import com.gh.gamecenter.video.game.GameVideoActivity
import com.gh.gamecenter.video.videomanager.VideoManagerActivity
import com.lightgame.utils.Util_System_ClipboardManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus
import retrofit2.HttpException
import java.net.URLEncoder
import java.util.*
import kotlin.math.roundToInt
/**
* 跳转用的方法
@ -79,9 +102,6 @@ object DirectUtils {
}
}
/**
* 跳转到特定页面,只支持App内部跳转
*/
@JvmStatic
fun directToLinkPage(context: Context, linkEntity: LinkEntity, entrance: String, path: String) {
directToLinkPage(context, linkEntity, entrance, path, null)
@ -113,7 +133,9 @@ object DirectUtils {
"server",
"top_game_comment",
"wechat_bind",
"video")
"video",
"catalog"
)
fun directToLinkPage(context: Context,
linkEntity: LinkEntity,
@ -124,30 +146,39 @@ object DirectUtils {
when (linkEntity.type) {
"article", "news", "文章" -> {
NewsUtils.statNewsViews(context, linkEntity.link) // 统计阅读量
context.startActivity(NewsDetailActivity.getIntentById(context, linkEntity.link, BaseActivity.mergeEntranceAndPath(entrance, path)))
directToArticle(context, linkEntity.link
?: "", BaseActivity.mergeEntranceAndPath(entrance, path))
}
"game", "游戏" -> {
if (exposureEvent != null) {
GameDetailActivity.startGameDetailActivity(context, linkEntity.link, BaseActivity.mergeEntranceAndPath(entrance, path), exposureEvent)
directToGameDetail(context, linkEntity.link
?: "", BaseActivity.mergeEntranceAndPath(entrance, path), traceEvent = exposureEvent)
} else {
GameDetailActivity.startGameDetailActivity(context, linkEntity.link, BaseActivity.mergeEntranceAndPath(entrance, path))
directToGameDetail(context, linkEntity.link
?: "", BaseActivity.mergeEntranceAndPath(entrance, path))
}
}
"column", "游戏专题" -> SubjectActivity.startSubjectActivity(context, linkEntity.link, linkEntity.text, false, BaseActivity.mergeEntranceAndPath(entrance, path))
"column", "游戏专题" -> directToSubject(context, linkEntity.link
?: "", linkEntity.text, BaseActivity.mergeEntranceAndPath(entrance, path))
"question", "社区问题" -> context.startActivity(QuestionsDetailActivity.getIntent(context, linkEntity.link, entrance, path))
"question", "社区问题" -> directToQuestionDetail(context, linkEntity.link
?: "", entrance, path)
"answer", "社区回答" -> context.startActivity(AnswerDetailActivity.getIntent(context, linkEntity.link, entrance, path))
"answer", "社区回答" -> directToAnswerDetail(context, linkEntity.link ?: "", entrance, path)
"community", "问答社区" -> directToCommunity(context, CommunityEntity(linkEntity.link!!, linkEntity.text!!))
"community", "问答社区" -> {
if (linkEntity.link.isNullOrEmpty()) return
directToCommunity(context, CommunityEntity(linkEntity.link!!, linkEntity.text!!))
}
"community_article", "社区文章" -> context.startActivity(ArticleDetailActivity.getIntent(context, linkEntity.community!!, linkEntity.link!!, entrance, path))
"community_article", "社区文章" -> directToCommunityArticle(context, linkEntity.community!!, linkEntity.link!!, entrance, path)
"community_column", "社区专题" -> directToCommunityColumn(context, linkEntity.community, linkEntity.link!!, entrance, path)
"community_special_column" -> context.startActivity(AskColumnDetailActivity.getIntentByColumnId(context, linkEntity.link, linkEntity.community!!, entrance, path))
"community_special_column" -> directAskColumnDetail(context, linkEntity.link
?: "", linkEntity.community!!, entrance, path)
"web", "inurl", "web链接" -> {
when {
@ -166,37 +197,33 @@ object DirectUtils {
"tag" -> context.startActivity(TagsActivity.getIntent(context, linkEntity.text!!, linkEntity.title, entrance, path))
"all_community_article" -> {
context.startActivity(SimpleArticleListActivity.getIntent(
context,
linkEntity.link ?: "",
entrance,
path))
}
"all_community_article" -> directSimpleArticleList(context, linkEntity.link
?: "", entrance, path)
"category", "分类" -> {
context.startActivity(CategoryDirectoryActivity.getIntent(context, linkEntity.link!!, linkEntity.text!!))
}
"category", "分类" -> directCategoryDirectory(context, linkEntity.link!!, linkEntity.text!!)
"catalog" -> directCatalog(context, linkEntity.link!!, linkEntity.text!!, entrance, path)
"block", "版块" -> {
context.startActivity(BlockActivity.getIntent(context, SubjectRecommendEntity(
link = linkEntity.link,
text = linkEntity.text,
name = linkEntity.name,
display = linkEntity.display ?: Display())))
if (linkEntity.link.isNullOrEmpty()) return
directToBlock(context,
SubjectRecommendEntity(
link = linkEntity.link,
text = linkEntity.text,
name = linkEntity.name,
display = linkEntity.display ?: Display()),
entrance)
}
"column_collection", "专题合集" -> directToColumnCollection(context, linkEntity.link!!, -1, entrance)
"server", "game_server" -> {
context.startActivity(GameServersActivity.getIntent(context, entrance, path))
}
"server", "game_server", "开服表" -> directToGameServers(context, entrance, path)
"top_game_comment" -> directToAmway(context, null, entrance, path)
"wechat_bind" -> context.startActivity(WebActivity.getBindWechatIntent(context))
"video", "video_stream" -> directToVideoDetail(context,
"video", "video_stream", "视频" -> directToVideoDetail(context,
videoId = linkEntity.link!!,
fromLocation = VideoDetailContainerViewModel.Location.VIDEO_CHOICENESS.value,
entrance = entrance,
@ -204,16 +231,23 @@ object DirectUtils {
"game_video" -> directToGameVideo(context, linkEntity.link ?: "", entrance, path)
"libao" -> directToGiftDetail(context, linkEntity.link ?: "", entrance)
"libao", "礼包" -> directToGiftDetail(context, linkEntity.link ?: "", entrance)
"feedback" -> directToFeedback(context, linkEntity.name, linkEntity.text, entrance)
"qa" -> directToQa(context, linkEntity.text ?: "", linkEntity.link ?: "")
"qa", "Q&A" -> directToQa(context, linkEntity.text ?: "", linkEntity.link ?: "")
"qa_collection" -> directToQaCollection(context, linkEntity.text ?: "", linkEntity.link
"qa_collection", "Q&A合集" -> directToQaCollection(context, linkEntity.text
?: "", linkEntity.link
?: "")
"anliwall" -> directToAmway(context, fixedTopAmwayCommentId = null, entrance = entrance, path = path)
"anliwall", "安利墙" -> directToAmway(context, fixedTopAmwayCommentId = null, entrance = entrance, path = path)
"game_detail_comment" -> directToGameDetail(context, linkEntity.link ?: "", entrance)
"game_upload", "游戏投稿" -> directGameUpload(context, entrance, path)
"bbs_detail" -> directForumDetail(context, linkEntity.link ?: "", entrance)
//"h5_game_center" -> directLetoGameCenter(context)
@ -233,15 +267,27 @@ object DirectUtils {
/**
* 跳转至QA
*/
fun directToQa(context: Context, text: String, id: String) {
context.startActivity(QaActivity.getIntent(context, navigationTitle = text, qaId = id))
@JvmStatic
fun directToQa(context: Context, text: String? = "", id: String) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, QaActivity::class.java.simpleName)
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_ID, id)
jumpActivity(context, bundle)
}
/**
* 跳转至QA合集
*/
@JvmStatic
fun directToQaCollection(context: Context, text: String, id: String) {
context.startActivity(QaActivity.getIntent(context, navigationTitle = text, qaCollectionId = id))
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, QaActivity::class.java.simpleName)
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_COLLECTION_ID, id)
jumpActivity(context, bundle)
}
/**
@ -249,7 +295,53 @@ object DirectUtils {
*/
@JvmStatic
fun directToColumnCollection(context: Context, id: String, position: Int = -1, entrance: String, columnName: String = "") {
context.startActivity(ColumnCollectionDetailActivity.getIntent(context, id, position, entrance, columnName))
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, ColumnCollectionDetailActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_COLLECTION_ID, id)
bundle.putString(KEY_COLUMNNAME, columnName)
bundle.putInt(KEY_POSITION, position)
jumpActivity(context, bundle)
}
/**
* 跳转至资讯文章列表
*/
@JvmStatic
fun directToGameNews(context: Context, gameId: String?, gameName: String?, entrance: String?) {
val bundle = Bundle()
bundle.putString(KEY_TO, GameNewsActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, gameId)
bundle.putString(KEY_GAMENAME, gameName)
jumpActivity(context, bundle)
}
/**
* 跳转至游戏日历表
*/
@JvmStatic
fun directToGameServerCalendar(context: Context, gameId: String?) {
val bundle = Bundle()
bundle.putString(KEY_TO, ServersCalendarActivity::class.java.name)
bundle.putParcelable(GameEntity::class.java.simpleName, GameEntity().apply {
id = gameId ?: ""
})
bundle.putParcelable(GameDetailServer::class.java.simpleName, GameDetailServer())
bundle.putParcelable(MeEntity::class.java.simpleName, MeEntity())
jumpActivity(context, bundle)
}
/**
* 跳转至游戏历史版本页面
*/
@JvmStatic
fun directToHistoryApk(context: Context, gameId: String?) {
val bundle = Bundle()
bundle.putString(KEY_TO, HistoryApkListActivity::class.java.name)
bundle.putString(KEY_GAMEID, gameId)
jumpActivity(context, bundle)
}
/**
@ -257,6 +349,7 @@ object DirectUtils {
*/
@JvmStatic
fun directToArticle(context: Context, id: String, entrance: String? = null) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, NewsDetailActivity::class.java.simpleName)
@ -299,19 +392,42 @@ object DirectUtils {
* 跳转到游戏详情
*/
@JvmStatic
fun directToGameDetail(context: Context, id: String, entrance: String? = null, autoDownload: Boolean? = null, scrollToLibao: Boolean = false) {
fun directToGameDetail(context: Context, id: String, entrance: String? = null, autoDownload: Boolean? = null, tab: String? = "", traceEvent: ExposureEvent? = null) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, GameDetailActivity::class.java.simpleName)
bundle.putString(KEY_GAMEID, id)
if (scrollToLibao) {
bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_TRENDES)
bundle.putBoolean(KEY_SCROLL_TO_LIBAO, scrollToLibao)
if (!TextUtils.isEmpty(tab)) {
when (tab) {
"comment" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_RATING)
"desc" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_DESC)
"forum" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_BBS)
"zone" -> bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_TRENDES)
}
}
if (traceEvent != null) {
val clickEvent = createEvent(GameEntity(id), traceEvent.source, appendTrace(traceEvent), ExposureType.CLICK)
log(clickEvent)
bundle.putParcelable(KEY_TRACE_EVENT, clickEvent)
}
bundle.putBoolean(KEY_AUTO_DOWNLOAD, autoDownload ?: false)
jumpActivity(context, bundle)
}
/**
* 跳转到游戏评分详情
*/
@JvmStatic
fun directToGameRatingDetail(context: Context, gameId: String? = "", commentId: String? = "", entrance: String? = null) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_GAMEID, gameId)
bundle.putString(KEY_COMMENTID, commentId)
bundle.putString(KEY_TO, RatingReplyActivity::class.java.name)
jumpActivity(context, bundle)
}
/**
* 跳转视频流-游戏介绍进入
*/
@ -323,7 +439,16 @@ object DirectUtils {
bundle.putString(KEY_GAMEID, id)
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
bundle.putInt(KEY_TARGET, GameDetailFragment.INDEX_DESC)
// GameDetailActivity.startGameDetailToVideoStreaming(context, id, entrance)
jumpActivity(context, bundle)
}
@JvmStatic
fun directToGameDetail(context: Context, id: String, defaultTab: Int = GameDetailFragment.INDEX_DESC, entrance: String? = null) {
val bundle = Bundle()
bundle.putString(KEY_TO, GameDetailActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, id)
bundle.putInt(KEY_TARGET, defaultTab)
jumpActivity(context, bundle)
}
@ -335,6 +460,7 @@ object DirectUtils {
// 专栏
@JvmStatic
fun directToSubject(context: Context, id: String, subjectName: String? = "", entrance: String? = null) {
if (id.isEmpty()) return
val bundle = Bundle()
val subjectData = SubjectData(subjectId = id, subjectName = subjectName, isOrder = false)
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
@ -411,6 +537,7 @@ object DirectUtils {
@JvmStatic
fun directToAnswerDetail(context: Context, id: String, entrance: String? = null, path: String? = null) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, AnswerDetailActivity::class.java.name)
@ -421,6 +548,7 @@ object DirectUtils {
@JvmStatic
fun directToQuestionDetail(context: Context, id: String, entrance: String? = null, path: String? = null) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, QuestionsDetailActivity::class.java.name)
@ -431,6 +559,7 @@ object DirectUtils {
@JvmStatic
fun directToWebView(context: Context, url: String, entrance: String? = null) {
if (url.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, WebActivity::class.java.simpleName)
@ -449,7 +578,11 @@ object DirectUtils {
@JvmStatic
fun directToExternalBrowser(context: Context, url: String) {
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
if (url.isEmpty()) return
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(Uri.decode(url)))
if (context !is AppCompatActivity) {
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(browserIntent)
}
@ -470,28 +603,39 @@ object DirectUtils {
chatType = "wpa"
}
val str = "mqqwpa://im/chat?chat_type=$chatType&uin=$qq&version=1&src_type=web"
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(str)))
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(str))
if (context !is AppCompatActivity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
} else {
// 没有安装QQ 复制账号
Util_System_ClipboardManager.setText(context, qq)
Utils.toast(context, "已复制 QQ $qq")
qq?.copyTextAndToast("已复制 QQ $qq")
}
}
// 跳转 QQ 群
@JvmStatic
fun directToQqGroup(context: Context, groupNumber: String? = null): Boolean {
val intent = Intent()
intent.data = Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D$groupNumber")
// 此Flag可根据具体产品需要自定义如设置则在加群界面按返回返回手Q主界面不设置按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
try {
context.startActivity(intent)
return true
} catch (e: Exception) {
// 未安装手Q或安装的版本不支持
if (groupNumber.isNullOrEmpty()) return false
if (ShareUtils.isQQClientAvailable(context)) {
val intent = Intent()
intent.data = Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D$groupNumber")
// 此Flag可根据具体产品需要自定义如设置则在加群界面按返回返回手Q主界面不设置按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
return try {
if (context !is AppCompatActivity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
true
} catch (e: Exception) {
false
}
} else {
Utils.toast(context, "请安装QQ客户端")
return false
}
}
/**
@ -499,10 +643,12 @@ object DirectUtils {
*/
@JvmStatic
fun directToGiftDetail(context: Context, giftId: String, entrance: String? = null) {
if (giftId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, LibaoDetailActivity::class.java.simpleName)
bundle.putString(EntranceUtils.KEY_ID, giftId)
HaloApp.put(LibaoEntity.TAG, null)
jumpActivity(context, bundle)
}
@ -551,11 +697,24 @@ object DirectUtils {
jumpActivity(context, bundle)
}
@JvmStatic
fun directToCommunityArticle(context: Context, community: CommunityEntity?, articleId: String?, entrance: String?, path: String?) {
if (articleId.isNullOrEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TO, ArticleDetailActivity::class.java.name)
bundle.putString(KEY_COMMUNITY_ARTICLE_ID, articleId)
bundle.putParcelable(KEY_COMMUNITY_DATA, community)
jumpActivity(context, bundle)
}
/**
* 跳转到社区专题
*/
@JvmStatic
fun directToCommunityColumn(context: Context, community: CommunityEntity?, subjectId: String, entrance: String?, path: String?) {
if (subjectId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TO, CommunitySubjectActivity::class.java.name)
@ -569,7 +728,8 @@ object DirectUtils {
* @param fromLocation 可见 [VideoDetailContainerViewModel.Location]
*/
@JvmStatic
fun directToVideoDetail(context: Context, videoId: String, fromLocation: String, showComment: Boolean = false, gameId: String = "", entrance: String? = null, path: String? = "", referer: String = "", type: String = "", act: String = "") {
fun directToVideoDetail(context: Context, videoId: String, fromLocation: String, showComment: Boolean = false, gameId: String = "", entrance: String? = null,
path: String? = "", referer: String = "", type: String = "", act: String = "", paginationType: String = "", fieldId: String = "", sectionName: String = "") {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
@ -582,6 +742,9 @@ object DirectUtils {
bundle.putString(KEY_REFERER, referer)
bundle.putString(KEY_TYPE, type)
bundle.putString(KEY_ACTIVITY_NAME, act)
bundle.putString(KEY_PAGINATION_TYPE, paginationType)
bundle.putString(KEY_FIELD_ID, fieldId)
bundle.putString(KEY_SECTION_NAME, sectionName)
jumpActivity(context, bundle)
} else {
DialogUtils.showLowSystemVersionDialog(context)
@ -612,27 +775,66 @@ object DirectUtils {
*/
@JvmStatic
fun directToBadgeWall(context: Context, userId: String?, name: String?, icon: String?) {
context.startActivity(WebActivity.getBadgeCenterIntent(context, userId, name, icon))
var url: String = if ("internal" == BuildConfig.FLAVOR) {
Constants.BADGE_ADDRESS_DEV
} else {
Constants.BADGE_ADDRESS
}
url = String.format(Locale.CHINA, "%s?user_id=%s&name=%s&icon=%s&timestamp=%d", url, userId, name, URLEncoder.encode(icon), (Date().time / 1000 / 1000.toFloat()).roundToInt())
directToFullScreenWebPage(context, url, true)
}
/**
* 跳转至徽章详情
*/
@JvmStatic
fun directToBadgeDetail(context: Context, userId: String?, badgeId: String?) {
var url: String = if ("internal" == BuildConfig.FLAVOR) {
Constants.BADGE_DETAIL_ADDRESS_DEV
} else {
Constants.BADGE_DETAIL_ADDRESS
}
url = String.format(Locale.CHINA, "%s?user_id=%s&badge_id=%s&timestamp=%d", url, userId, badgeId, (Date().time / 1000 / 1000.toFloat()).roundToInt())
directToFullScreenWebPage(context, url, true)
}
/**
* 跳转至上传视频
*/
@JvmStatic
fun directToVideoManager(context: Context, linkEntity: VideoLinkEntity, entrance: String? = null, path: String? = "") {
fun directToVideoManager(context: Context, linkEntity: VideoLinkEntity, simpleGameEntity: SimpleGameEntity, entrance: String? = null, path: String? = "") {
val bundle = Bundle()
bundle.putString(KEY_PATH, path)
bundle.putParcelable(VideoLinkEntity::class.java.simpleName, linkEntity)
bundle.putParcelable(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
bundle.putString(KEY_TO, VideoManagerActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
jumpActivity(context, bundle)
}
@JvmStatic
fun directToFullScreenWebPage(context: Context, url: String, webViewHandleBackPressed: Boolean = false) {
context.startActivity(FullScreenWebActivity.getIntent(context, url, webViewHandleBackPressed))
}
@JvmStatic
fun directToRegulationTestPage(context: Context) {
val url = if ("internal" == BuildConfig.FLAVOR) {
Constants.REGULATION_TEST_ADDRESS_DEV
} else {
Constants.REGULATION_TEST_ADDRESS
}
directToFullScreenWebPage(context, url, true)
}
/**
* 跳转视频合集
*/
@JvmStatic
fun directToGameVideo(context: Context, gameId: String, entrance: String? = null, path: String? = "") {
if (gameId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TO, GameVideoActivity::class.java.name)
@ -680,6 +882,7 @@ object DirectUtils {
*/
@JvmStatic
fun directCategoryDirectory(context: Context, categoryId: String, categoryTitle: String, entrance: String? = null, path: String? = "") {
if (categoryId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, CategoryDirectoryActivity::class.java.name)
bundle.putString(KEY_CATEGORY_ID, categoryId)
@ -689,6 +892,20 @@ object DirectUtils {
jumpActivity(context, bundle)
}
/**
* 跳转新分类
*/
@JvmStatic
fun directCatalog(context: Context, catalogId: String, catalogTitle: String, entrance: String? = null, path: String? = "") {
if (catalogId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, CatalogActivity::class.java.name)
bundle.putString(KEY_CATALOG_ID, catalogId)
bundle.putString(KEY_CATALOG_TITLE, catalogTitle)
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
jumpActivity(context, bundle)
}
/**
* 跳转到问题标签详情
*/
@ -708,6 +925,7 @@ object DirectUtils {
*/
@JvmStatic
fun directAskColumnDetail(context: Context, columnId: String, community: CommunityEntity, entrance: String? = null, path: String? = "") {
if (columnId.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, AskColumnDetailActivity::class.java.name)
bundle.putString(KEY_COLUMN_ID, columnId)
@ -716,4 +934,130 @@ object DirectUtils {
bundle.putString(KEY_PATH, path)
jumpActivity(context, bundle)
}
/**
* 跳转到板块
*/
@JvmStatic
fun directToBlock(context: Context, blockData: SubjectRecommendEntity, entrance: String) {
val bundle = Bundle()
bundle.putString(KEY_TO, BlockActivity::class.java.name)
bundle.putParcelable(KEY_BLOCK_DATA, blockData)
bundle.putString(KEY_ENTRANCE, entrance)
jumpActivity(context, bundle)
}
/**
* 跳转到开服表
*/
@JvmStatic
fun directToGameServers(context: Context, entrance: String, path: String) {
val bundle = Bundle()
bundle.putString(KEY_TO, GameServersActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, ToolBarActivity.mergeEntranceAndPath(entrance, path))
jumpActivity(context, bundle)
}
/**
* 跳转到游戏上传
*/
@JvmStatic
fun directGameUpload(context: Context, entrance: String? = null, path: String? = "") {
val bundle = Bundle()
bundle.putString(KEY_TO, GameSubmissionActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_PATH, path)
jumpActivity(context, bundle)
}
/**
* 社区文章
*/
@JvmStatic
fun directSimpleArticleList(context: Context, sortType: String, entrance: String? = null, path: String? = "") {
if (sortType.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_TO, SimpleArticleListActivity::class.java.name)
bundle.putString(KEY_TYPE, sortType)
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_PATH, path)
jumpActivity(context, bundle)
}
@JvmStatic
fun directGameZone(context: Context, gameId: String, url: String, entrance: String? = null) {
RetrofitManager.getInstance(HaloApp.getInstance().application)
.sensitiveApi
.getGameDigest(gameId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Response<GameEntity>() {
override fun onResponse(response: GameEntity?) {
response?.apply {
if (zone.status == "on") {
if (zone.style == "link") {
directToGameDetail(context, gameId, GameDetailFragment.INDEX_TRENDES, entrance)
} else {
directToWebView(context, url, entrance)
}
} else {
directToWebView(context, url, entrance)
}
}
}
override fun onFailure(e: HttpException?) {
}
})
}
@JvmStatic
fun directVideoData(context: Context, entrance: String? = null) {
val bundle = Bundle()
bundle.putString(KEY_TO, VideoDataActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance)
jumpActivity(context, bundle)
}
@JvmStatic
fun directForumDetail(context: Context, bbsId: String? = "", entrance: String? = null) {
val bundle = Bundle()
bundle.putString(KEY_TO, ForumDetailActivity::class.java.name)
bundle.putString(KEY_BBS_ID, bbsId)
bundle.putString(KEY_ENTRANCE, entrance)
jumpActivity(context, bundle)
}
/**
* 到首页论坛 tab
*/
@JvmStatic
fun directToForum(context: Context) {
if (RunningUtils.isRunning(context)
&& MainActivity::class.java.name == RunningUtils.getBaseActivity(context)) {
val intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
context.startActivity(intent)
// 这里换个线程操作是为了做一点延时
AppExecutor.ioExecutor.execute {
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_ASK))
}
} else {
jumpActivity(context, Bundle().apply { putInt(KEY_POSITION, MainWrapperFragment.INDEX_ASK) })
}
}
/**
* 跳转至使用帮助与反馈
* @param position 使用帮助:[HelpAndFeedbackActivity.HELP_ITEM],意见反馈:[HelpAndFeedbackActivity.SUGGESTION_ITEM]
*/
@JvmStatic
fun directToHelpAndFeedback(context: Context, position: Int = HelpAndFeedbackActivity.HELP_ITEM) {
val bundle = Bundle()
bundle.putString(KEY_TO, HelpAndFeedbackActivity::class.java.name)
bundle.putInt(BaseActivity_TabLayout.PAGE_INDEX, position)
jumpActivity(context, bundle)
}
}

View File

@ -9,6 +9,7 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.View;
@ -271,6 +272,26 @@ public class DisplayUtils {
return metrics.heightPixels;
}
public static int getToastOffset() {
try {
int i = Resources.getSystem().getIdentifier("toast_y_offset", "dimen", "android");
return HaloApp.getInstance().getApplication().getResources().getDimensionPixelSize(i);
} catch (Resources.NotFoundException e) {
e.printStackTrace();
return dip2px(24);
}
}
public static int getToastDefaultGravity() {
try {
int i = Resources.getSystem().getIdentifier("config_toastDefaultGravity", "integer", "android");
return HaloApp.getInstance().getApplication().getResources().getInteger(i);
} catch (Resources.NotFoundException e) {
e.printStackTrace();
return Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
}
}
public static boolean hasSoftKeys(Context context) {
if (!(context instanceof Activity)) return false;

View File

@ -1,5 +1,6 @@
package com.gh.common.util
import com.gh.common.filter.RegionSettingHelper
import com.gh.download.DownloadManager
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.retrofit.Response
@ -18,8 +19,12 @@ object DownloadHelper {
* @param block 成功添加下载任务后执行的代码块
*/
fun createABrandNewDownloadTaskQuietly(gameId: String? = "", packageName: String? = "", block: () -> Unit) {
if (RegionSettingHelper.shouldThisGameBeFiltered(gameId)) {
return
}
RetrofitManager.getInstance(HaloApp.getInstance().application)
.api
.sensitiveApi
.getGameDigest(gameId)
.map(ApkActiveUtils.filterMapper)
.subscribeOn(Schedulers.io())

View File

@ -8,13 +8,24 @@ import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.collection.ArrayMap;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.gh.common.constant.Config;
import com.gh.common.dialog.CertificationDialog;
import com.gh.common.dialog.DeviceRemindDialog;
import com.gh.common.dialog.PackageCheckDialogFragment;
import com.gh.common.dialog.ReserveDialogFragment;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.history.HistoryHelper;
import com.gh.common.repository.ReservationRepository;
import com.gh.common.simulator.SimulatorDownloadManager;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.xapk.XapkInstaller;
import com.gh.common.xapk.XapkUnzipStatus;
import com.gh.download.DownloadManager;
import com.gh.download.dialog.DownloadDialog;
import com.gh.gamecenter.DownloadManagerActivity;
@ -32,14 +43,9 @@ import com.lightgame.download.DownloadStatus;
import com.lightgame.download.FileUtils;
import com.lightgame.utils.Utils;
import java.io.File;
import java.util.concurrent.LinkedBlockingQueue;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.collection.ArrayMap;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
/**
* todo 下载判断不能以按钮文案为判断条件,否则按钮文案修改时又要修改判断逻辑
*/
@ -134,16 +140,23 @@ public class DownloadItemUtils {
public static void updateItem(Context context, GameEntity gameEntity, GameViewHolder holder,
boolean isShowPlatform) {
updateItem(context, gameEntity, holder, isShowPlatform, PluginLocation.only_game, false);
updateItem(context, gameEntity, holder, isShowPlatform, PluginLocation.only_game, false, null);
}
public static void updateItem(Context context, GameEntity gameEntity, GameViewHolder holder,
boolean isShowPlatform, boolean hideDownloadBtnIfNoAvailableContent) {
updateItem(context, gameEntity, holder, isShowPlatform, PluginLocation.only_game, hideDownloadBtnIfNoAvailableContent);
updateItem(context, gameEntity, holder, isShowPlatform, PluginLocation.only_game, hideDownloadBtnIfNoAvailableContent, null);
}
public static void updateItem(Context context, GameEntity gameEntity, GameViewHolder holder,
boolean isShowPlatform, PluginLocation pluginLocation, boolean hideDownloadBtnIfNoAvailableContent) {
boolean isShowPlatform, String briefStyle) {
updateItem(context, gameEntity, holder, isShowPlatform, PluginLocation.only_game, false, briefStyle);
}
public static void updateItem(Context context, GameEntity gameEntity, GameViewHolder holder,
boolean isShowPlatform, PluginLocation pluginLocation,
boolean hideDownloadBtnIfNoAvailableContent,
@Nullable String briefStyle) {
// 控制是否显示下载按钮
if (!Config.isShowDownload(gameEntity.getId()) || context.getString(R.string.app_name).equals(gameEntity.getName())) {
@ -154,9 +167,7 @@ public class DownloadItemUtils {
// 显示预约
if (gameEntity.isReservable()) {
holder.gameDes.setVisibility(View.VISIBLE);
holder.gameProgressbar.setVisibility(View.GONE);
holder.gameInfo.setVisibility(View.GONE);
updateItemViewStatus(holder, false, briefStyle);
if (!ReservationRepository.thisGameHasBeenReserved(gameEntity.getId())) {
holder.gameDownloadBtn.setText("预约");
holder.gameDownloadBtn.setTextColor(Color.WHITE);
@ -174,9 +185,7 @@ public class DownloadItemUtils {
LinkEntity h5LinkEntity = gameEntity.getH5Link();
String offStatus = gameEntity.getDownloadOffStatus();
holder.gameDes.setVisibility(View.VISIBLE);
holder.gameProgressbar.setVisibility(View.GONE);
holder.gameInfo.setVisibility(View.GONE);
updateItemViewStatus(holder, false, briefStyle);
if (h5LinkEntity != null) {
if ("play".equals(h5LinkEntity.getType())) {
@ -190,6 +199,10 @@ public class DownloadItemUtils {
holder.gameDownloadBtn.setText("查看");
holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.white));
holder.gameDownloadBtn.setBackgroundResource(R.drawable.game_item_btn_download_style);
} else if ("updating".equals(offStatus)) {
holder.gameDownloadBtn.setText("更新中");
holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.white));
holder.gameDownloadBtn.setBackgroundResource(R.drawable.download_button_updating_style);
} else {
holder.gameDownloadBtn.setText("暂无");
holder.gameDownloadBtn.setTextColor(ContextCompat.getColor(context, R.color.button_gray));
@ -201,16 +214,16 @@ public class DownloadItemUtils {
holder.gameDownloadBtn.setClickable(false);
}
} else if (gameEntity.getApk().size() == 1) {
updateNormalItem(context, holder, gameEntity, isShowPlatform, pluginLocation);
updateNormalItem(context, holder, gameEntity, isShowPlatform, pluginLocation, briefStyle);
} else {
updatePluginItem(context, holder, gameEntity, isShowPlatform, pluginLocation);
updatePluginItem(context, holder, gameEntity, isShowPlatform, pluginLocation, briefStyle);
}
}
// 更新正常的条目只有一个apk包
static void updateNormalItem(Context context, GameViewHolder holder, GameEntity gameEntity,
boolean isShowPlatform, PluginLocation pluginLocation) {
boolean isShowPlatform, PluginLocation pluginLocation, String briefStyle) {
final ArrayMap<String, DownloadEntity> entryMap = gameEntity.getEntryMap();
final ApkEntity apkEntity = gameEntity.getApk().get(0);
@ -218,22 +231,29 @@ public class DownloadItemUtils {
if (entryMap != null && !entryMap.isEmpty()) {
DownloadEntity downloadEntity = entryMap.get(apkEntity.getPlatform());
if (downloadEntity != null) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, true);
return;
if (ExtensionsKt.isSimulatorGame(downloadEntity)) {
if (downloadEntity.getStatus() != DownloadStatus.done) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, true);
return;
}
} else {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, true);
return;
}
}
}
GameUtils.setDownloadBtnStatus(context, gameEntity, holder.gameDownloadBtn, pluginLocation);
holder.gameDes.setVisibility(View.VISIBLE);
holder.gameProgressbar.setVisibility(View.GONE);
holder.gameInfo.setVisibility(View.GONE);
updateItemViewStatus(holder, false, briefStyle);
}
// 更新插件的条目有多个apk包
private static void updatePluginItem(Context context, GameViewHolder holder, GameEntity gameEntity,
boolean isShowPlatform, PluginLocation pluginLocation) {
boolean isShowPlatform, PluginLocation pluginLocation, String briefStyle) {
GameUtils.setDownloadBtnStatus(context, gameEntity, holder.gameDownloadBtn, pluginLocation);
ArrayMap<String, DownloadEntity> entryMap = gameEntity.getEntryMap();
@ -252,18 +272,15 @@ public class DownloadItemUtils {
return;
}
}
holder.gameDes.setVisibility(View.VISIBLE);
holder.gameProgressbar.setVisibility(View.GONE);
holder.gameInfo.setVisibility(View.GONE);
updateItemViewStatus(holder, false, briefStyle);
}
// 更改进度条和提示文本的状态
public static void changeStatus(Context context, GameViewHolder holder, DownloadEntity downloadEntity,
boolean isShowPlatform, boolean isNormal) {
holder.gameDes.setVisibility(View.GONE);
holder.gameProgressbar.setVisibility(View.VISIBLE);
holder.gameInfo.setVisibility(View.VISIBLE);
updateItemViewStatus(holder, true, null);
holder.gameProgressbar.setProgressDrawable(context.getResources().getDrawable(R.drawable.progressbar_bg_style));
String platform = PlatformUtils.getInstance(context).getPlatformName(downloadEntity.getPlatform());
@ -324,6 +341,17 @@ public class DownloadItemUtils {
holder.gameDownloadBtn.setTextColor(ContextCompat.getColorStateList(context, R.color.text_downloading_style));
}
} else if (status.equals(DownloadStatus.done)) {
String xapkStatus = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS);
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
String percent = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_PERCENT);
holder.gameProgressbar.setProgressDrawable(context.getResources().getDrawable(R.drawable.progressbar_xapk_style));
holder.gameDownloadSpeed.setText(R.string.unzipping);
holder.gameProgressbar.setProgress((int) (Float.valueOf(percent) * 10));
holder.gameDownloadPercentage.setText(percent + "%");
holder.gameDownloadBtn.setText(R.string.unzipping);
return;
}
holder.gameProgressbar.setProgress(1000);
if (isShowPlatform && platform != null) {
holder.gameDownloadSpeed.setText(String.format("%s - 下载完成", platform));
@ -345,6 +373,29 @@ public class DownloadItemUtils {
}
}
private static void updateItemViewStatus(GameViewHolder holder, boolean hasDownload, @Nullable String briefStyle) {
if (hasDownload) {
if (holder.gameRating != null) holder.gameRating.setVisibility(View.GONE);
holder.gameDes.setVisibility(View.GONE);
holder.gameProgressbar.setVisibility(View.VISIBLE);
holder.gameInfo.setVisibility(View.VISIBLE);
} else {
holder.gameProgressbar.setVisibility(View.GONE);
holder.gameInfo.setVisibility(View.GONE);
if (briefStyle != null && briefStyle.contains("star")) {
if (holder.gameRating != null) holder.gameRating.setVisibility(View.VISIBLE);
} else {
if (holder.gameRating != null) holder.gameRating.setVisibility(View.GONE);
}
if (TextUtils.isEmpty(briefStyle) || briefStyle.contains("brief")) {
holder.gameDes.setVisibility(View.VISIBLE);
} else {
holder.gameDes.setVisibility(View.GONE);
}
}
}
public static void setOnClickListener(final Context context,
final TextView downloadBtn,
final GameEntity gameEntity,
@ -369,7 +420,7 @@ public class DownloadItemUtils {
}
/**
* @param clickCallback 供那些需要知道点击回调的地方使用
* @param clickCallback 供那些需要知道点击回调的地方使用,触发具体响应才会回调
*/
public static void setOnClickListener(final Context context,
final TextView downloadBtn,
@ -381,27 +432,50 @@ public class DownloadItemUtils {
final ExposureEvent traceEvent,
@Nullable final EmptyCallback clickCallback) {
setOnClickListener(context, downloadBtn, gameEntity, position, adapter, entrance, location, traceEvent, clickCallback, null);
}
/**
* @param allStateClickCallback 供那些需要知道点击回调的地方使用,只要触发点击动作就会回调
*/
public static void setOnClickListener(final Context context,
final TextView downloadBtn,
final GameEntity gameEntity,
final int position,
final RecyclerView.Adapter<? extends RecyclerView.ViewHolder> adapter,
final String entrance,
final String location,
final ExposureEvent traceEvent,
@Nullable final EmptyCallback clickCallback,
@Nullable final EmptyCallback allStateClickCallback) {
if (gameEntity.isReservable()) {
if (!ReservationRepository.thisGameHasBeenReserved(gameEntity.getId())) {
downloadBtn.setOnClickListener(v -> {
if (allStateClickCallback != null) {
allStateClickCallback.onCallback();
}
CheckLoginUtils.checkLogin(context, entrance, () -> {
if (clickCallback != null) {
clickCallback.onCallback();
}
PermissionHelper.checkReadPhoneStatePermissionBeforeAction(context, () -> {
ReserveDialogFragment dialogFragment = ReserveDialogFragment.getInstance(
gameEntity,
() -> {
LogUtils.logReservation(gameEntity, traceEvent);
adapter.notifyItemChanged(position);
}
);
dialogFragment.show(((AppCompatActivity) context).getSupportFragmentManager(), "reserve");
});
ReserveDialogFragment dialogFragment = ReserveDialogFragment.getInstance(
gameEntity,
() -> {
LogUtils.logReservation(gameEntity, traceEvent);
adapter.notifyItemChanged(position);
}
);
dialogFragment.show(((AppCompatActivity) context).getSupportFragmentManager(), "reserve");
});
});
} else {
downloadBtn.setOnClickListener(v -> {
if (allStateClickCallback != null) {
allStateClickCallback.onCallback();
}
if (clickCallback != null) {
clickCallback.onCallback();
}
@ -425,21 +499,29 @@ public class DownloadItemUtils {
if (gameEntity.getApk().size() == 0 && gameEntity.getH5Link() != null) {
downloadBtn.setOnClickListener(v -> {
if (allStateClickCallback != null) {
allStateClickCallback.onCallback();
}
MtaHelper.onEvent("H5页面", "入口", "列表页_" + gameEntity.getName());
LinkEntity linkEntity = gameEntity.getH5Link();
boolean isPlay = "play".equals(linkEntity.getType()); // 是否为开始玩
boolean isPlay = "play".equals(linkEntity.getType()); // 是否为开始玩
if (isPlay) {
HistoryHelper.insertGameEntity(gameEntity);
}
Intent i = WebActivity.getIntentForWebGame(context, gameEntity.getH5Link().getLink(), gameEntity.getName(), isPlay);
Intent i = WebActivity.getIntentForWebGame(context, gameEntity.getH5Link().getLink(), gameEntity.getName(), isPlay, linkEntity.getCloseButton());
context.startActivity(i);
});
} else if (gameEntity.getApk().size() == 1) {
downloadBtn.setOnClickListener(v -> {
EmptyCallback clickRunnable = () -> {
if (allStateClickCallback != null) {
allStateClickCallback.onCallback();
}
if (clickCallback != null) {
clickCallback.onCallback();
}
@ -455,6 +537,10 @@ public class DownloadItemUtils {
});
} else {
downloadBtn.setOnClickListener(v -> {
if (allStateClickCallback != null) {
allStateClickCallback.onCallback();
}
if (clickCallback != null) {
clickCallback.onCallback();
}
@ -472,7 +558,6 @@ public class DownloadItemUtils {
});
});
}
}
public static void onNormalClick(final Context context,
@ -498,20 +583,28 @@ public class DownloadItemUtils {
if (str.equals(context.getString(R.string.download))) {
// 先弹下载弹窗(如果需要的话)
DownloadDialogHelper.findAvailableDialogAndShow(context, gameEntity, apk, () -> {
CertificationDialog.showCertificationDialog(context, gameEntity, () -> {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> download(context, gameEntity, downloadBtn, entrance, location, isSubscribe, traceEvent));
PackageCheckDialogFragment.show((AppCompatActivity) context, gameEntity.getPackageDialog(), () -> {
DownloadDialogHelper.findAvailableDialogAndShow(context, gameEntity, apk, () -> {
CertificationDialog.showCertificationDialog(context, gameEntity, () -> {
DialogUtils.showOverseaDownloadDialog(context, gameEntity, () -> {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> download(context, gameEntity, downloadBtn, entrance, location, isSubscribe, traceEvent));
});
});
});
});
DataLogUtils.uploadGameLog(context, gameEntity.getId(), gameEntity.getName(), entrance);
} else if (str.equals(context.getString(R.string.attempt))) {
DownloadDialogHelper.findAvailableDialogAndShow(context, gameEntity, apk, () -> {
CertificationDialog.showCertificationDialog(context, gameEntity, () -> {
DialogUtils.showVersionNumberDialog(context, gameEntity, () -> {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> download(context, gameEntity, downloadBtn, entrance, location, isSubscribe, traceEvent));
PackageCheckDialogFragment.show((AppCompatActivity) context, gameEntity.getPackageDialog(), () -> {
DownloadDialogHelper.findAvailableDialogAndShow(context, gameEntity, apk, () -> {
CertificationDialog.showCertificationDialog(context, gameEntity, () -> {
DialogUtils.showVersionNumberDialog(context, gameEntity, () -> {
DialogUtils.showOverseaDownloadDialog(context, gameEntity, () -> {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> download(context, gameEntity, downloadBtn, entrance, location, isSubscribe, traceEvent));
});
});
});
});
});
@ -532,17 +625,35 @@ public class DownloadItemUtils {
});
}
} else if (str.equals(context.getString(R.string.install))) {
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.getUrl());
if (gameEntity.getSimulator() != null) {
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(context, gameEntity.getSimulator().getApk().getPackageName());
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled) {
SimulatorDownloadManager.getInstance().showDownloadDialog(context, gameEntity.getSimulator(),
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.getId(), gameEntity.getName(), null);
return;
}
}
install(context, gameEntity, position, adapter);
} else if (str.equals(context.getString(R.string.launch))) {
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
if (!file.exists()) {
download(context, gameEntity, downloadBtn, entrance, location, false, traceEvent);
return;
}
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity);
}
return;
}
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "启动", gameEntity.getName());
}
DataUtils.onGameLaunchEvent(context, gameEntity.getName(), gameEntity.getApk().get(0).getPlatform(), location);
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk().get(0).getPackageName());
} else if (str.equals(context.getString(R.string.waiting))
|| str.equals(context.getString(R.string.downloading))) {
context.startActivity(DownloadManagerActivity.getDownloadMangerIntent(context,
apk.getUrl(), entrance + "+(" + location.split(":")[0] + ")"));
} else if (str.equals(context.getString(R.string.update))) {
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "更新", gameEntity.getName());
@ -551,6 +662,9 @@ public class DownloadItemUtils {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> update(context, gameEntity, entrance, location, isSubscribe, traceEvent));
});
} else {
context.startActivity(DownloadManagerActivity.getDownloadMangerIntent(context,
apk.getUrl(), entrance + "+(" + location.split(":")[0] + ")"));
}
}
@ -611,9 +725,9 @@ public class DownloadItemUtils {
}
adapter.notifyItemChanged(position);
} else if (PackageUtils.isCanPluggable(apkEntity)) {
DialogUtils.showPluginDialog(context, () -> context.startActivity(PackageUtils.getUninstallIntent(context, path)));
DialogUtils.showPluginDialog(context, () -> PackageInstaller.uninstall(context, path));
} else {
PackageUtils.launchSetup(context, downloadEntity);
PackageInstaller.install(context, downloadEntity);
}
}
}

View File

@ -10,10 +10,13 @@ import android.os.Build
import androidx.core.app.NotificationCompat
import com.gh.common.AppExecutor
import com.gh.common.constant.Constants
import com.gh.common.xapk.XapkInstaller
import com.gh.common.xapk.XapkUnzipStatus
import com.gh.gamecenter.R
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus
import com.walkud.rom.checker.RomIdentifier
object DownloadNotificationHelper {
@ -27,6 +30,7 @@ object DownloadNotificationHelper {
const val ACTION_DOWNLOAD = "com.gh.gamecenter.DOWNLOAD"
private val mNotifyMap: MutableMap<String, Long> = mutableMapOf()
private val mShouldUseAlternativeNotificationIcon by lazy { RomIdentifier.getRom().versionName == null }
private fun getNotificationManager(): NotificationManager {
return HaloApp.getInstance().application.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@ -38,9 +42,13 @@ object DownloadNotificationHelper {
var requireUpdateNotificationGroupDelay = false
val notificationManager = getNotificationManager()
val downloadNotificationId = (entity.gameId + entity.packageName).hashCode()
val xapkStatus = entity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (entity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) == Constants.SILENT_UPDATE) return
if (entity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) == Constants.SIMULATOR_DOWNLOAD) return
val intent = Intent()
if (entity.status == DownloadStatus.done) {
if (entity.status == DownloadStatus.done && xapkStatus != XapkUnzipStatus.FAILURE.name) {
intent.putExtra(EntranceUtils.KEY_DATA, entity.toJson())
intent.putExtra(EntranceUtils.KEY_PATH, entity.path)
intent.action = ACTION_INSTALL
@ -53,7 +61,6 @@ object DownloadNotificationHelper {
PendingIntent.FLAG_UPDATE_CURRENT)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// importance == IMPORTANCE_DEFAULT 时每次更新都会触发震动
val channel = NotificationChannel(DOWNLOAD_CHANNEL_ID, DOWNLOAD_CHANNEL_ID, NotificationManager.IMPORTANCE_LOW)
notificationManager.createNotificationChannel(channel)
}
@ -61,22 +68,26 @@ object DownloadNotificationHelper {
val whenTime = 1000 * 60 * (System.currentTimeMillis() / 1000 / 60)
val builder = NotificationCompat.Builder(HaloApp.getInstance().application, DOWNLOAD_CHANNEL_ID)
.setContentTitle(entity.name)
.setSmallIcon(R.mipmap.logo)
.setSmallIcon(getNotificationIcon())
.setContentIntent(pendingIntent)
.setGroup(DOWNLOAD_GROUP_KEY)
.setWhen(whenTime)
.setProgress(PROGRESS_MAX, entity.percent.toInt(), false)
when (entity.status) {
DownloadStatus.downloading -> builder.setContentText(String.format("%s(剩%s)",
SpeedUtils.getSpeed(entity.speed),
SpeedUtils.getRemainTime(entity.size, entity.progress, entity.speed * 1024)))
DownloadStatus.done -> builder.setContentText("下载完成,点击立即安装")
DownloadStatus.waiting -> builder.setContentText("等待中")
DownloadStatus.subscribe,
DownloadStatus.timeout,
DownloadStatus.neterror -> builder.setContentText("已暂停连接WiFi自动下载")
else -> builder.setContentText("暂停中")
if (xapkStatus == XapkUnzipStatus.FAILURE.name) {
builder.setContentText("" + entity.name + "》解压失败,点击查看详情~")
} else {
when (entity.status) {
DownloadStatus.downloading -> builder.setContentText(String.format("%s(剩%s)",
SpeedUtils.getSpeed(entity.speed),
SpeedUtils.getRemainTime(entity.size, entity.progress, entity.speed * 1024)))
DownloadStatus.done -> builder.setContentText("下载完成,点击立即安装")
DownloadStatus.waiting -> builder.setContentText("等待中")
DownloadStatus.subscribe,
DownloadStatus.timeout,
DownloadStatus.neterror -> builder.setContentText("已暂停连接WiFi自动下载")
else -> builder.setContentText("暂停中")
}
builder.setProgress(PROGRESS_MAX, entity.percent.toInt(), false)
}
when {
@ -88,30 +99,40 @@ object DownloadNotificationHelper {
else -> builder.setSortKey("C")
}
val notification = builder.build()
notification.flags = notification.flags or Notification.FLAG_NO_CLEAR
if (entity.status == DownloadStatus.delete
|| entity.status == DownloadStatus.cancel
|| entity.status == DownloadStatus.hijack
|| entity.status == DownloadStatus.notfound
|| entity.status == DownloadStatus.overflow
|| (entity.status == DownloadStatus.done // 触发安装事件以后也 cancel 掉通知
&& !entity.meta[Constants.MARK_ALREADY_TRIGGERED_INSTALLATION].isNullOrEmpty())) {
requireUpdateNotificationGroupDelay = true
notificationManager.cancel(entity.path, DOWNLOAD_NOTIFICATION_ID)
} else {
if (entity.status != DownloadStatus.downloading) {
notificationManager.notify(entity.path, DOWNLOAD_NOTIFICATION_ID, notification)
tryCatchInRelease {
val notification = builder.build() // 可能会抛出异常
notification.flags = notification.flags or Notification.FLAG_NO_CLEAR
if (xapkStatus == XapkUnzipStatus.FAILURE.name) {
notification.flags = notification.flags or Notification.FLAG_AUTO_CANCEL
} else {
val time = mNotifyMap[entity.path]
val curTime = System.currentTimeMillis()
if (time == null || curTime - time > 2000) {
mNotifyMap[entity.path] = curTime
notification.flags = notification.flags or Notification.FLAG_NO_CLEAR
}
if (entity.status == DownloadStatus.delete
|| entity.status == DownloadStatus.cancel
|| entity.status == DownloadStatus.hijack
|| entity.status == DownloadStatus.notfound
|| entity.status == DownloadStatus.overflow
|| (entity.status == DownloadStatus.done // 触发安装事件以后也 cancel 掉通知
&& !entity.meta[Constants.MARK_ALREADY_TRIGGERED_INSTALLATION].isNullOrEmpty()
&& xapkStatus != XapkUnzipStatus.FAILURE.name)
||entity.status == DownloadStatus.done && entity.isSimulatorGame()) {//模拟器游戏下载完需要cancel掉通知
requireUpdateNotificationGroupDelay = true
notificationManager.cancel(entity.path, DOWNLOAD_NOTIFICATION_ID)
} else {
if (entity.status != DownloadStatus.downloading) {
notificationManager.notify(entity.path, DOWNLOAD_NOTIFICATION_ID, notification)
} else {
val time = mNotifyMap[entity.path]
val curTime = System.currentTimeMillis()
if (time == null || curTime - time > 2000) {
mNotifyMap[entity.path] = curTime
notificationManager.notify(entity.path, DOWNLOAD_NOTIFICATION_ID, notification)
}
}
}
}
if (requireUpdateNotificationGroupDelay) {
// 虽然运行到这里时 notification 已经被 cancel 了,但在下面的 notificationManager.getActiveNotifications 里它有可能还是 active 状态,
// 这里延时 100 ms 避免出现所有的任务都取消了以后依旧有一条 notification group 常驻
@ -122,32 +143,35 @@ object DownloadNotificationHelper {
}
private fun updateNotificationGroup() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val notificationManager = getNotificationManager()
val activeNotifications = notificationManager.activeNotifications
var downloadNotificationSize = 0
var downloadGroupNotificationSize = 0
for (activeNotification in activeNotifications) {
if (activeNotification.id == DOWNLOAD_NOTIFICATION_ID) {
downloadNotificationSize++
// 部分华为设备调用 getActiveNotifications() 方法时会触发方法内的空指针,这里整体包裹处理了
tryCatchInRelease {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val notificationManager = getNotificationManager()
val activeNotifications = notificationManager.activeNotifications
var downloadNotificationSize = 0
var downloadGroupNotificationSize = 0
for (activeNotification in activeNotifications) {
if (activeNotification.id == DOWNLOAD_NOTIFICATION_ID) {
downloadNotificationSize++
}
if (activeNotification.id == DOWNLOAD_NOTIFICATION_FOLD_ID) {
downloadGroupNotificationSize++
}
}
if (activeNotification.id == DOWNLOAD_NOTIFICATION_FOLD_ID) {
downloadGroupNotificationSize++
}
}
if (downloadNotificationSize == 0 && downloadGroupNotificationSize != 0) {
// 删除组可能会把组内所有通知一并删除
notificationManager.cancel(DOWNLOAD_NOTIFICATION_FOLD_ID)
} else if (downloadNotificationSize != 0 && downloadGroupNotificationSize == 0) {
val groupBuilder = NotificationCompat.Builder(HaloApp.getInstance().application, DOWNLOAD_CHANNEL_ID)
.setSmallIcon(R.mipmap.logo)
.setGroup(DOWNLOAD_GROUP_KEY)
.setGroupSummary(true)
.setStyle(NotificationCompat.BigTextStyle().bigText("下载任务"))
val groupNotification = groupBuilder.build()
groupNotification.flags = groupNotification.flags or Notification.FLAG_NO_CLEAR
notificationManager.notify(DOWNLOAD_NOTIFICATION_FOLD_ID, groupNotification)
if (downloadNotificationSize == 0 && downloadGroupNotificationSize != 0) {
// 删除组可能会把组内所有通知一并删除
notificationManager.cancel(DOWNLOAD_NOTIFICATION_FOLD_ID)
} else if (downloadNotificationSize != 0 && downloadGroupNotificationSize == 0) {
val groupBuilder = NotificationCompat.Builder(HaloApp.getInstance().application, DOWNLOAD_CHANNEL_ID)
.setSmallIcon(getNotificationIcon())
.setGroup(DOWNLOAD_GROUP_KEY)
.setGroupSummary(true)
.setStyle(NotificationCompat.BigTextStyle().bigText("下载任务"))
val groupNotification = groupBuilder.build()
groupNotification.flags = groupNotification.flags or Notification.FLAG_NO_CLEAR
notificationManager.notify(DOWNLOAD_NOTIFICATION_FOLD_ID, groupNotification)
}
}
}
}
@ -158,4 +182,8 @@ object DownloadNotificationHelper {
addOrUpdateDownloadNotification(downloadTask)
}
}
private fun getNotificationIcon(): Int {
return if (mShouldUseAlternativeNotificationIcon) R.drawable.ic_notification else R.mipmap.logo
}
}

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