Compare commits

...

545 Commits

Author SHA1 Message Date
e20df1e0fb chore: 版本更新到 5.17.4 2023-01-12 20:47:03 +08:00
f60c907978 Merge branch 'hotfix-vspace_launch_error' into 'release'
修复畅玩游戏安装异常

See merge request halo/android/assistant-android!658
2023-01-12 20:46:00 +08:00
3f21d7d37c 修复畅玩游戏安装异常 2023-01-12 20:46:00 +08:00
e622d6a8ee Merge branch 'hotfix-v5.17.3-693-crashes' into 'release'
fix: 全量捕抓畅玩云存档下载的数据库异常

See merge request halo/android/assistant-android!657
2023-01-12 17:13:42 +08:00
e911588569 fix: 全量捕抓畅玩云存档下载的数据库异常 2023-01-12 17:04:36 +08:00
8b1c046475 Merge branch 'hotfix-v5.17.3-693-fix_vgame_update' into 'release'
fix: 修复畅玩游戏更新功能

See merge request halo/android/assistant-android!654
2023-01-12 09:21:06 +08:00
984a1ba517 fix: 修复畅玩游戏更新功能 2023-01-12 09:21:05 +08:00
a337494d22 chore: 版本更新到 5.17.3 2023-01-10 16:00:58 +08:00
6c5f9f2689 Merge branch 'hotfix-v5.17.2-692-crashes' into 'release'
修复闪退和畅玩连接异常

See merge request halo/android/assistant-android!649
2023-01-10 16:00:12 +08:00
7ad73b84f9 fix: 修复畅玩 contentProvider 写入闪退,修复畅玩服务断连后首次安装失败的问题 2023-01-10 15:53:34 +08:00
ad683b66d7 fix: 修复检查设备 webview 状态时 webview 列表为空时的闪退 2023-01-10 15:51:12 +08:00
fb719577cf chore: 版本更新到 5.17.2 2023-01-09 18:17:16 +08:00
7770f16565 Merge branch 'hotfix-v5.17.1-691-crashes' into 'release'
fix: 修复存储满了的闪退问题,尝试修复畅玩游戏写入数据时的闪退问题,捕抓畅玩时启动安装 activity 的闪退

See merge request halo/android/assistant-android!647
2023-01-09 18:16:37 +08:00
43fdd0d8d3 Merge branch 'revert-fbd61f37' into 'release'
Revert "Merge branch 'hotfix-v5.17.1-691-home_list_crash' into 'release'"

See merge request halo/android/assistant-android!648
2023-01-09 18:09:37 +08:00
0067ef2c40 Revert "Merge branch 'hotfix-v5.17.1-691-home_list_crash' into 'release'"
This reverts merge request !640
2023-01-09 18:08:07 +08:00
03a7f2bd89 fix: 修复存储满了的闪退问题,尝试修复畅玩游戏写入数据时的闪退问题,捕抓畅玩时启动安装 activity 的闪退 2023-01-09 17:57:47 +08:00
07d4865593 Merge branch 'feature-GHZS-954' into 'release'
fix: 部分机型帖子展示空白 https://jira.shanqu.cc/browse/GHZS-954

See merge request halo/android/assistant-android!646
2023-01-09 12:02:32 +08:00
ba49c9aa25 fix: 部分机型帖子展示空白 https://jira.shanqu.cc/browse/GHZS-954 2023-01-09 12:02:32 +08:00
f19a687eee Merge branch 'hotfix-v5.17.1-691-activity_floating_window_display_issue' into 'release'
fix: 修复返回活动悬浮窗在部分页面隐藏并禁用的问题(旧活动需要,但旧活动已下线)

See merge request halo/android/assistant-android!645
2023-01-09 10:27:03 +08:00
3fbec365a0 fix: 修复活动悬浮窗在部分页面隐藏自动禁用的问题(旧活动需要,但旧活动已下线) 2023-01-09 10:20:55 +08:00
d1dba07b6b Merge branch 'fix-GHZS-947' into 'release'
fix: 修复回到活动悬浮窗显示异常

See merge request halo/android/assistant-android!642
2023-01-06 20:39:03 +08:00
a53239afd8 Merge branch 'fix-vspace_install_issue' into 'release'
fix: 修复畅玩游戏安装时,因为没有成功或失败回调结果导致无法再次安装的问题

See merge request halo/android/assistant-android!643
2023-01-06 20:39:01 +08:00
26f2b161bd fix: 修复畅玩游戏安装时,因为没有成功或失败回调结果导致无法再次安装的问题 2023-01-06 20:31:40 +08:00
8b28b8de44 fix: 修复回到活动悬浮窗显示异常 2023-01-06 19:20:39 +08:00
81ab27d02a Merge branch 'hotfix-v5.17.1-691-vector_crash' into 'release'
fix: 修复5.0以下系统矢量图相关的闪退问题

See merge request halo/android/assistant-android!641
2023-01-06 17:07:46 +08:00
544c67c316 fix: 修复5.0以下系统矢量图相关的闪退问题 2023-01-06 17:02:27 +08:00
fbd61f3783 Merge branch 'hotfix-v5.17.1-691-home_list_crash' into 'release'
fix: 修复横向专题和多列横向专题数据变更时因为 DiffUtils 没有正确分发数据变更引起的闪退问题...

See merge request halo/android/assistant-android!640
2023-01-06 15:22:39 +08:00
5f4c0ab2df fix: 修复横向专题和多列横向专题数据变更时因为 DiffUtils 没有正确分发数据变更引起的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/34950/?project=22&query=is%3Aunresolved&statsPeriod=24h 2023-01-06 14:43:07 +08:00
ff245ad516 chore: 版本更新到 5.17.1 2023-01-05 15:59:11 +08:00
315523a27f Merge branch 'fix_vspace_wrong_install_status' into 'release'
fix: 修复畅玩游戏卸载再安装时会错误调用安装的问题

See merge request halo/android/assistant-android!638
2023-01-05 15:31:36 +08:00
a3ae5ecb7b fix: 修复畅玩游戏卸载再安装时会错误调用安装的问题 2023-01-05 15:27:35 +08:00
dfc7c918d7 Merge branch 'fix-vgame_backup' into 'release'
修复畅玩游戏备份问题

See merge request halo/android/assistant-android!633
2023-01-05 14:59:54 +08:00
d396deb94b 修复畅玩游戏备份问题 2023-01-05 14:59:54 +08:00
52bf1a85c5 Merge branch 'fix-horizontal_list_crash' into 'release'
fix: 尝试修复横向游戏专题数据变动触发的闪退问题

See merge request halo/android/assistant-android!635
2023-01-05 10:52:51 +08:00
762bed1ed5 fix: 尝试修复横向游戏专题数据变动触发的闪退问题 2023-01-05 10:45:55 +08:00
7d77ca9b35 Merge branch 'hotfix-rating_draft_not_display' into 'release'
fix: 修复进入编辑评论页有概率没有显示已保存草稿的问题

See merge request halo/android/assistant-android!630
2023-01-04 16:46:36 +08:00
cd7e3c7777 fix: 修复进入编辑评论页有概率没有显示已保存草稿的问题 2023-01-04 16:37:21 +08:00
44c6c5ad08 Merge branch 'feature-GHZS-885' into 'release'
feat: 云存档Tab标签—客户端 https://jira.shanqu.cc/browse/GHZS-885

See merge request halo/android/assistant-android!628
2023-01-04 16:16:03 +08:00
fca02bcb0b feat: 云存档Tab标签—客户端 https://jira.shanqu.cc/browse/GHZS-885 2023-01-04 16:16:03 +08:00
a4d3368567 Merge branch 'feature-update_tea' into 'release'
feat: 【光环助手】头条SDK更新及投放渠道重打包任务—客户端 https://jira.shanqu.cc/browse/GHZS-541

See merge request halo/android/assistant-android!626
2023-01-04 14:42:20 +08:00
210f2240a3 feat: 【光环助手】头条SDK更新及投放渠道重打包任务—客户端 https://jira.shanqu.cc/browse/GHZS-541 2023-01-04 14:42:20 +08:00
a6a2012e66 Merge branch 'fix-vspace_connect_no_response' into 'release'
fix: 修复畅玩启动无响应的问题

See merge request halo/android/assistant-android!624
2023-01-04 13:49:00 +08:00
d5ef24b1cc fix: 修复畅玩启动无响应的问题 2023-01-04 13:35:52 +08:00
92b658c304 fix: 更新畅玩服务依赖 2023-01-03 16:29:13 +08:00
8271126bf9 Merge branch 'fix-gamedetail_top_video' into 'release'
fix: 游戏详情是否显示顶部视频取消videoId为空的判断

See merge request halo/android/assistant-android!621
2023-01-03 09:44:15 +08:00
13bc07b0be fix: 游戏详情是否显示顶部视频取消videoId为空的判断 2023-01-03 09:41:10 +08:00
e19fcf5077 Merge branch 'feature-GHZS-877' into 'release'
feat: 视频类型的轮播图加上视频标识—客户端 https://jira.shanqu.cc/browse/GHZS-877

See merge request halo/android/assistant-android!620
2022-12-30 17:17:10 +08:00
dba49b090a feat: 视频类型的轮播图加上视频标识—客户端 https://jira.shanqu.cc/browse/GHZS-877 2022-12-30 17:03:40 +08:00
b964472619 Merge branch 'feature-GHZS-820' into 'release'
fix: 【光环助手】畅玩游戏下载文案问题 https://jira.shanqu.cc/browse/GHZS-820

See merge request halo/android/assistant-android!619
2022-12-30 15:27:47 +08:00
733be9e441 fix: 【光环助手】畅玩游戏下载文案问题 https://jira.shanqu.cc/browse/GHZS-820 2022-12-30 15:27:47 +08:00
c9d4bfadcf Merge branch 'feature-GHZS-857' into 'release'
fix:【畅玩助手】GID体系不一致问题 https://jira.shanqu.cc/browse/GHZS-857

See merge request halo/android/assistant-android!610
2022-12-30 15:22:22 +08:00
cd54c0967c fix:【畅玩助手】GID体系不一致问题 https://jira.shanqu.cc/browse/GHZS-857 2022-12-30 15:22:22 +08:00
d2bf534ca4 Merge branch 'hotfix-v5.17.0-690-game_server_type' into 'release'
fix:修复首页游戏开服标签与游戏名称之间存在空白的问题

See merge request halo/android/assistant-android!618
2022-12-30 14:57:25 +08:00
ff350e268a fix:修复首页游戏开服标签与游戏名称之间存在空白的问题 2022-12-30 14:46:01 +08:00
79cd610e41 Merge branch 'feature-GHZS-844' into 'release'
fix: 【光环助手】前端小编标识展示问题 https://jira.shanqu.cc/browse/GHZS-844

See merge request halo/android/assistant-android!617
2022-12-30 14:26:44 +08:00
4af47a71b7 fix: 【光环助手】前端小编标识展示问题 https://jira.shanqu.cc/browse/GHZS-844 2022-12-30 14:23:34 +08:00
9fed52ca0a Merge branch 'feature-GHZS-858' into 'release'
feat: 游戏单活动:游戏单征集计划vol.2—客户端-埋点文档19 https://jira.shanqu.cc/browse/GHZS-858

See merge request halo/android/assistant-android!611
2022-12-29 15:32:09 +08:00
f3c0e16cff feat: 游戏单活动:游戏单征集计划vol.2—客户端-埋点文档19 https://jira.shanqu.cc/browse/GHZS-858 2022-12-29 15:27:59 +08:00
0ee5c106c6 Merge branch 'hotfix-v5.17.0-690-download_button' into 'release'
fix:修复部分专题样式、首页视频、视频贴详情下载按钮显示异常的问题

See merge request halo/android/assistant-android!604
2022-12-28 14:53:17 +08:00
abc52f622c fix:修复部分专题样式、首页视频、视频贴详情下载按钮显示异常的问题 2022-12-28 14:45:36 +08:00
8ba82698d7 fix:修复部分专题样式、首页视频、视频贴详情下载按钮显示异常的问题 2022-12-28 14:19:39 +08:00
e74e700bcf fix:【光环助手】开服表的多版本下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-717 2022-12-28 11:01:43 +08:00
abb4c40499 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2022-12-28 10:28:18 +08:00
df79970eae chore: 版本更新至 5.16.1 2022-12-26 11:35:38 +08:00
d8775429d1 fix: 修复畅玩连接断开时可能的闪退 2022-12-26 11:32:52 +08:00
7fd7ac3523 Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/GameDownloadSettingFragment.kt
#	vspace-bridge
2022-12-26 11:29:21 +08:00
1729f3d688 Merge branch 'hotfix-game_download_setting_page_crash' into 'legacy-release'
fix: 修复游戏下载设置页获取文件uri时的闪退问题

See merge request halo/android/assistant-android!593
2022-12-26 10:59:25 +08:00
5c1498a8fd Merge branch 'hotfix-v5.15.3-653-vloading_crash' into 'legacy-release'
fix: 修复进入畅玩加载页面闪退

See merge request halo/android/assistant-android!591
2022-12-26 10:57:42 +08:00
9268181751 Merge branch 'hotfix-v5.15.3-653-forum_article_list_crash' into 'legacy-release'
fix:修复论坛帖子列表页切换深色模式出现空指针闪退的问题

See merge request halo/android/assistant-android!590
2022-12-26 10:46:29 +08:00
2d97319931 fix: 修复进入畅玩加载页面闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/248161/?project=22&query=dist%3A653+NullPointerException&statsPeriod=14d 2022-12-26 10:43:50 +08:00
9930673792 fix:修复论坛帖子列表页切换深色模式出现空指针闪退的问题 2022-12-26 10:40:12 +08:00
d7219431e6 fix: 修复游戏下载设置页获取文件uri时的闪退问题 2022-12-26 10:36:43 +08:00
d9311fcce0 Merge branch 'hotfix-quick_login_crash' into 'legacy-release'
fix: 修复一键登录跳转验证码登录因context为空导致的闪退问题

See merge request halo/android/assistant-android!589
2022-12-26 10:32:02 +08:00
88035b65ce fix: 修复畅玩连接断开时可能的闪退 2022-12-26 10:30:45 +08:00
e63e50f828 fix: 修复一键登录跳转验证码登录因context为空导致的闪退问题 2022-12-26 10:21:55 +08:00
e080d8ab6d Merge branch 'feature-GHZS-802' into 'dev'
feat:春节活动—集“萌兔福签”,得新年好礼—客户端 https://jira.shanqu.cc/browse/GHZS-802

See merge request halo/android/assistant-android!587
2022-12-22 13:50:02 +08:00
1dacab2000 feat:春节活动—集“萌兔福签”,得新年好礼—客户端 https://jira.shanqu.cc/browse/GHZS-802 2022-12-22 13:50:02 +08:00
754750a330 Merge branch 'hotfix-v5.16.0-670-varchive_database_add_game_version' into 'release'
fix: 添加云存档数据库游戏版本字段

See merge request halo/android/assistant-android!584
2022-12-21 12:32:31 +08:00
401f1c176a fix: 添加云存档数据库游戏版本字段 2022-12-21 12:32:31 +08:00
b10fac1371 Merge remote-tracking branch 'origin/release' into dev 2022-12-21 10:28:25 +08:00
f750682bff Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	dependencies.gradle
2022-12-21 10:28:02 +08:00
c7094a0476 chore: 版本更新至 5.15.3 2022-12-21 09:56:23 +08:00
f8cedcf737 Merge branch 'hotfix-5.15.2-652-list_not_display' into 'legacy-release'
fix: 修改选择活动标签弹窗列表不显示问题

See merge request halo/android/assistant-android!581
2022-12-20 17:10:06 +08:00
d1e04a5743 fix: 修改选择活动标签弹窗列表不显示问题 2022-12-20 16:57:31 +08:00
4659ebe064 Merge branch 'release' into 'dev'
fix: 更新畅玩 module 依赖

See merge request halo/android/assistant-android!578
2022-12-19 11:20:57 +08:00
9eded4d0ce fix: 更新畅玩 module 依赖 2022-12-19 09:46:58 +08:00
e93d95dc0d Merge branch 'dev' into 'dev-5.17.0'
fix: 更新畅玩 module 依赖

See merge request halo/android/assistant-android!572
2022-12-15 18:35:16 +08:00
5a7c316a2d fix: 更新畅玩 module 依赖 2022-12-15 18:34:34 +08:00
f55448a264 Merge branch 'hotfix-interested_game_type_dialog_ui' into 'dev-5.17.0'
fix: 微调游戏偏好-分类弹窗UI

See merge request halo/android/assistant-android!571
2022-12-15 17:11:23 +08:00
1c20bf9e02 fix: 微调游戏偏好-分类弹窗UI 2022-12-15 17:10:13 +08:00
69cb4865b2 Merge branch 'feature-GHZS-788' into 'dev-5.17.0'
fix: 【光环助手V5.17.0】APP闪退问题 https://jira.shanqu.cc/browse/GHZS-788

See merge request halo/android/assistant-android!570
2022-12-15 17:08:08 +08:00
d5e9e9f092 fix: 【光环助手V5.17.0】APP闪退问题 https://jira.shanqu.cc/browse/GHZS-788 2022-12-15 17:04:50 +08:00
20a60fb2b5 Merge branch 'hotfix-discovery_card_drak_mode' into 'dev-5.17.0'
fix: 首页发现页卡片和游戏偏好页适配深色模式

See merge request halo/android/assistant-android!569
2022-12-15 16:21:01 +08:00
deac181261 fix: 首页发现页卡片和游戏偏好页适配深色模式 2022-12-15 16:17:28 +08:00
5a4eb2ed65 Merge branch 'fix-GHZS-774' into 'dev-5.17.0'
fix: 【V5.17.0】游戏评价活动:光环星推官挑战赛—1214测试-第10点 (为网页下载添加畅玩游戏支持) https://jira.shanqu.cc/browse/GHZS-774

See merge request halo/android/assistant-android!567
2022-12-15 16:17:18 +08:00
634e897511 Merge branch 'dev' into 'dev-5.17.0'
fix: 更新畅玩 module 依赖

See merge request halo/android/assistant-android!568
2022-12-15 16:17:11 +08:00
305c6792f2 fix: 更新畅玩 module 依赖 2022-12-15 16:04:57 +08:00
0ae726d6b1 fix: 【V5.17.0】游戏评价活动:光环星推官挑战赛—1214测试-第10点 (为网页下载添加畅玩游戏支持) https://jira.shanqu.cc/browse/GHZS-774 2022-12-15 16:02:28 +08:00
6be4412ac6 Merge branch 'dev-fix-game_subtitle' into 'dev-5.17.0'
fix:修复首页游戏副标题超长时遮挡游戏图标的问题

See merge request halo/android/assistant-android!566
2022-12-15 15:56:52 +08:00
586e3deb9e fix:修复首页游戏副标题超长时遮挡游戏图标的问题 2022-12-15 15:45:09 +08:00
f02219b83b fix:【V5.17.0】发现页相关功能优化(第一期)—1212测试-第2点(游戏列表过滤已安装游戏) https://jira.shanqu.cc/browse/GHZS-650 2022-12-15 14:11:00 +08:00
1391ab730d Merge branch 'feature-GHZS-763' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1215UI测试 https://jira.shanqu.cc/browse/GHZS-763

See merge request halo/android/assistant-android!565
2022-12-15 11:46:43 +08:00
9eca2ab660 fix:【V5.17.0】发现页相关功能优化(第一期)—1215UI测试 https://jira.shanqu.cc/browse/GHZS-763 2022-12-15 11:38:08 +08:00
b58daea96f Merge branch 'feature-GHZS-700' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)-1214测试 https://jira.shanqu.cc/browse/GHZS-700

See merge request halo/android/assistant-android!564
2022-12-15 11:29:29 +08:00
f958787f9e fix:【V5.17.0】发现页相关功能优化(第一期)-1214测试 https://jira.shanqu.cc/browse/GHZS-700 2022-12-15 11:13:10 +08:00
5fbeff3158 Merge branch 'feature-GHZS-682' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1214UI测试 https://jira.shanqu.cc/browse/GHZS-682

See merge request halo/android/assistant-android!563
2022-12-14 15:34:13 +08:00
c03fcc7fde fix:【V5.17.0】发现页相关功能优化(第一期)—1214UI测试 https://jira.shanqu.cc/browse/GHZS-682 2022-12-14 15:27:22 +08:00
ce4c6c1ca3 Merge remote-tracking branch 'origin/dev' into dev-5.17.0 2022-12-14 15:21:45 +08:00
1294a13933 fix: 更新畅玩 submodule 依赖 2022-12-14 15:21:15 +08:00
1b07c28956 Merge branch 'hotfix-get_discovery_card_data_optimize' into 'dev-5.17.0'
fix:处理首页/板块首次今日会多次调用获取发现页数据接口的问题

See merge request halo/android/assistant-android!562
2022-12-14 14:41:13 +08:00
c0b2eb622c fix:处理首页/板块首次今日会多次调用获取发现页数据接口的问题 2022-12-14 14:27:51 +08:00
c4bed719f9 Merge branch 'feature-GHZS-691' into 'dev-5.17.0'
fix: 【V5.17.0】游戏详情-详情tab页面优化-专题游戏单推荐-1213测试-第1点 https://jira.shanqu.cc/browse/GHZS-691

See merge request halo/android/assistant-android!561
2022-12-14 11:56:26 +08:00
d022f03ef8 fix: 【V5.17.0】游戏详情-详情tab页面优化-专题游戏单推荐-1213测试-第1点 https://jira.shanqu.cc/browse/GHZS-691 2022-12-14 11:49:00 +08:00
7ab8f2c4c5 Merge branch 'feature-GHZS-657' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1213UI测试(修改分类弹窗遮罩) https://jira.shanqu.cc/browse/GHZS-657

See merge request halo/android/assistant-android!560
2022-12-14 11:03:30 +08:00
4f0480c7b4 fix:【V5.17.0】发现页相关功能优化(第一期)—1213UI测试(修改分类弹窗遮罩) https://jira.shanqu.cc/browse/GHZS-657 2022-12-14 10:58:03 +08:00
12818c322c Merge branch 'feature-GHZS-660' into 'dev-5.17.0'
fix: 【V5.17.0】发现页相关功能优化(第一期)—1212测试-第1点 https://jira.shanqu.cc/browse/GHZS-660

See merge request halo/android/assistant-android!559
2022-12-14 09:20:56 +08:00
92f08d1bb8 fix: 【V5.17.0】发现页相关功能优化(第一期)—1212测试-第1点 https://jira.shanqu.cc/browse/GHZS-660 2022-12-13 18:01:52 +08:00
db5fbded43 Merge branch 'feature-GHZS-650' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1212测试-第2/6点 https://jira.shanqu.cc/browse/GHZS-650

See merge request halo/android/assistant-android!558
2022-12-13 17:53:41 +08:00
e554b1681e fix:【V5.17.0】发现页相关功能优化(第一期)—1212测试-第2/6点 https://jira.shanqu.cc/browse/GHZS-650 2022-12-13 17:47:37 +08:00
8ae846df88 Merge branch 'feature-GHZS-656' into 'dev-5.17.0'
fix: 【V5.17.0】游戏详情-详情tab页面优化-大家都在玩-1212测试-第2点 https://jira.shanqu.cc/browse/GHZS-656

See merge request halo/android/assistant-android!557
2022-12-13 17:09:28 +08:00
10e7047eec fix: 【V5.17.0】游戏详情-详情tab页面优化-大家都在玩-1212测试-第2点 https://jira.shanqu.cc/browse/GHZS-656 2022-12-13 17:04:49 +08:00
32eefa9003 Merge branch 'feature-GHZS-417' into 'dev-5.17.0'
feat: 【V5.17.0】游戏评价活动:光环星推官挑战赛—大数据(补充网页来源) https://jira.shanqu.cc/browse/GHZS-417

See merge request halo/android/assistant-android!556
2022-12-13 16:59:56 +08:00
f95b091c58 feat: 【V5.17.0】游戏评价活动:光环星推官挑战赛—大数据(补充网页来源) https://jira.shanqu.cc/browse/GHZS-417 2022-12-13 16:55:50 +08:00
e810369ee2 Merge branch 'feature-GHZS-657' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1213UI测试 https://jira.shanqu.cc/browse/GHZS-657

See merge request halo/android/assistant-android!555
2022-12-13 16:51:24 +08:00
b090e7863f fix:【V5.17.0】发现页相关功能优化(第一期)—1213UI测试 https://jira.shanqu.cc/browse/GHZS-657 2022-12-13 16:34:30 +08:00
1fb27ab467 Merge branch 'feature-GHZS-606' into 'dev-5.17.0'
【V5.17.0】发帖图片限制相关优化—1207测试 https://jira.shanqu.cc/browse/GHZS-606

See merge request halo/android/assistant-android!553
2022-12-13 15:42:25 +08:00
772abccae5 【V5.17.0】发帖图片限制相关优化—1207测试 https://jira.shanqu.cc/browse/GHZS-606 2022-12-13 15:42:25 +08:00
b64bb8bcd8 Merge branch 'feature-GHZS-652' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1212测试-第3/4/5/7点 https://jira.shanqu.cc/browse/GHZS-652

See merge request halo/android/assistant-android!554
2022-12-13 15:31:03 +08:00
699f55313c fix:【V5.17.0】发现页相关功能优化(第一期)—1212测试-第3/4/5/7点 https://jira.shanqu.cc/browse/GHZS-652 2022-12-13 13:46:52 +08:00
32b51e899e Merge branch 'feature-GHZS-446' into 'dev-5.17.0'
增加游戏详情专题游戏单推荐"换一批"功能

See merge request halo/android/assistant-android!552
2022-12-13 09:42:16 +08:00
719caf99cd 增加游戏详情专题游戏单推荐"换一批"功能 2022-12-13 09:42:15 +08:00
ac49180f98 Merge branch 'feature-add_url_scheme' into 'dev-5.17.0'
feat: 添加跳转到用户主页-游戏相关子选项的 urlscheme

See merge request halo/android/assistant-android!551
2022-12-12 18:00:23 +08:00
356acc053e feat: 添加跳转到用户主页-游戏相关子选项的 urlscheme 2022-12-12 17:47:16 +08:00
78366cd647 Merge branch 'feature-GHZS-649' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—1212UI测试 https://jira.shanqu.cc/browse/GHZS-649

See merge request halo/android/assistant-android!550
2022-12-12 17:34:57 +08:00
926e917a1a fix:【V5.17.0】发现页相关功能优化(第一期)—1212UI测试 https://jira.shanqu.cc/browse/GHZS-649 2022-12-12 17:31:03 +08:00
b5eb376055 Merge branch 'dev-fix-game_download_tips_crash' into 'dev'
fix:修复gameDownloadTips为空导致发现页无法显示的问题

See merge request halo/android/assistant-android!549
2022-12-12 14:00:11 +08:00
4a321a6884 fix:修复gameDownloadTips为空导致发现页无法显示的问题 2022-12-12 13:54:24 +08:00
208ee23676 Merge branch 'feature-GHZS-420' into 'dev-5.17.0'
feat:【V5.17.0】发现页相关功能优化(第一期)—客户端 (游戏偏好页增加登录判断) https://jira.shanqu.cc/browse/GHZS-420

See merge request halo/android/assistant-android!548
2022-12-12 13:44:53 +08:00
a3f6464b1a feat:【V5.17.0】发现页相关功能优化(第一期)—客户端 (游戏偏好页增加登录判断) https://jira.shanqu.cc/browse/GHZS-420 2022-12-12 13:39:08 +08:00
8d4fbed5d9 Merge branch 'hotfix-forum_search_rank_icon' into 'dev'
fix:修复论坛搜索页-榜单显示多余缺省图标的问题

See merge request halo/android/assistant-android!547
2022-12-12 12:01:46 +08:00
93a8c24ad3 fix:修复论坛搜索页-榜单显示多余缺省图标的问题 2022-12-12 11:51:38 +08:00
4014572130 Merge branch 'feature-GHZS-432' into 'dev-5.17.0'
feat: 【V5.17.0】游戏详情-详情tab页面优化-数据埋点—客户端 https://jira.shanqu.cc/browse/GHZS-432

See merge request halo/android/assistant-android!546
2022-12-12 10:49:34 +08:00
3bf6a6eaf3 feat: 【V5.17.0】游戏详情-详情tab页面优化-数据埋点—客户端 https://jira.shanqu.cc/browse/GHZS-432 2022-12-12 10:46:07 +08:00
6397b4cfdd Merge branch 'feature-GHZS-420' into 'dev-5.17.0'
fix:【V5.17.0】发现页相关功能优化(第一期)—客户端(1.修改发现卡片类型值;2.微调UI;3.处理因gameDownloadTips为空的报错问...

See merge request halo/android/assistant-android!545
2022-12-09 17:05:02 +08:00
544e9458ee fix:【V5.17.0】发现页相关功能优化(第一期)—客户端(1.修改发现卡片类型值;2.微调UI;3.处理因gameDownloadTips为空的报错问题) https://jira.shanqu.cc/browse/GHZS-420 2022-12-09 17:02:42 +08:00
1b5b19fa76 Merge branch 'feature-GHZS-420' into 'dev-5.17.0'
feat:【V5.17.0】发现页相关功能优化(第一期)—客户端(增加埋点) https://jira.shanqu.cc/browse/GHZS-420

See merge request halo/android/assistant-android!544
2022-12-09 15:53:55 +08:00
00436dd3b9 Merge branch 'feature-GHZS-446' into 'dev-5.17.0'
feat: 【V5.17.0】游戏详情-详情tab页面优化-专题游戏单推荐—客户端 https://jira.shanqu.cc/browse/GHZS-446

See merge request halo/android/assistant-android!543
2022-12-09 15:50:49 +08:00
64b4a6bef0 feat: 【V5.17.0】游戏详情-详情tab页面优化-专题游戏单推荐—客户端 https://jira.shanqu.cc/browse/GHZS-446 2022-12-09 15:37:18 +08:00
b330ccc54d feat:【V5.17.0】发现页相关功能优化(第一期)—客户端(增加埋点) https://jira.shanqu.cc/browse/GHZS-420 2022-12-09 15:23:24 +08:00
7f460ac3df Merge branch 'feature-GHZS-420' into 'dev-5.17.0'
feat:【V5.17.0】发现页相关功能优化(第一期)—客户端 https://jira.shanqu.cc/browse/GHZS-420

See merge request halo/android/assistant-android!542
2022-12-09 11:57:07 +08:00
19fa7436c3 feat:【V5.17.0】发现页相关功能优化(第一期)—客户端 https://jira.shanqu.cc/browse/GHZS-420 2022-12-09 11:54:35 +08:00
9a5e529eeb Merge branch 'dev-5.17.0' into 'feature-GHZS-420'
# Conflicts:
#   app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java
2022-12-09 03:16:53 +00:00
faac45e719 feat:【V5.17.0】发现页相关功能优化(第一期)—客户端 https://jira.shanqu.cc/browse/GHZS-420 2022-12-09 11:09:18 +08:00
17e4624909 Merge branch 'feature-GHZS-603' into 'dev-5.17.0'
fix: 【V5.17.0】游戏详情-详情tab页面优化-游戏单推荐—1207UI测试 https://jira.shanqu.cc/browse/GHZS-603

See merge request halo/android/assistant-android!541
2022-12-09 09:20:47 +08:00
6cf3786799 fix: 【V5.17.0】游戏详情-详情tab页面优化-游戏单推荐—1207UI测试 https://jira.shanqu.cc/browse/GHZS-603 2022-12-09 09:20:46 +08:00
d6e713fd60 Merge branch 'feature-GHZS-390' into 'dev-5.17.0'
feat:【V5.17.0】论坛详情页-问答帖新增排序方式切换—客户端 https://jira.shanqu.cc/browse/GHZS-390

See merge request halo/android/assistant-android!540
2022-12-08 17:28:03 +08:00
830715f44b Merge branch 'feature-issues95_99' into 'dev-5.17.0'
refactor:整理副标题相关代码 https://git.shanqu.cc/halo/android/assistant-android/-/issues/95

See merge request halo/android/assistant-android!539
2022-12-08 14:51:14 +08:00
73470771fe refactor:整理副标题相关代码 https://git.shanqu.cc/halo/android/assistant-android/-/issues/95 2022-12-08 14:21:59 +08:00
b62ce00f7a fix:全局处理 Color.parseColor() 方法异常 https://git.shanqu.cc/halo/android/assistant-android/-/issues/99 2022-12-08 14:11:02 +08:00
963f7f9ee0 Merge branch 'feature-GHZS-415' into 'dev-5.17.0'
feat: 【V5.17.0】游戏评价活动:光环星推官挑战赛—客户端 https://jira.shanqu.cc/browse/GHZS-415

See merge request halo/android/assistant-android!538
2022-12-08 11:39:43 +08:00
5c606f8eb3 feat: 【V5.17.0】游戏评价活动:光环星推官挑战赛—客户端 https://jira.shanqu.cc/browse/GHZS-415 2022-12-08 11:22:13 +08:00
6fed28da75 Merge branch 'feature-GHZS-604' into 'dev-5.17.0'
fix: 【V5.17.0】游戏详情-详情tab页面优化-相关游戏—1207UI测试 https://jira.shanqu.cc/browse/GHZS-604

See merge request halo/android/assistant-android!537
2022-12-07 17:07:40 +08:00
823060320f fix: 【V5.17.0】游戏详情-详情tab页面优化-相关游戏—1207UI测试 https://jira.shanqu.cc/browse/GHZS-604 2022-12-07 17:07:39 +08:00
d0bf32db06 Merge branch 'feature-GHZS-386' into 'dev-5.17.0'
feat:【V5.17.0】发帖草稿箱相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-386

See merge request halo/android/assistant-android!536
2022-12-07 16:27:18 +08:00
d7fb0c86bb feat:【V5.17.0】发帖草稿箱相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-386 2022-12-07 16:20:39 +08:00
c69ececcb7 Merge branch 'hotfix-dev-cloud_archive_list_page' into 'dev'
fix:修复游戏详情-云存档列表未设置分页问题

See merge request halo/android/assistant-android!535
2022-12-07 15:27:51 +08:00
ec4eeb0219 fix:修复游戏详情-云存档列表未设置分页问题 2022-12-07 15:25:23 +08:00
35aabd0fd3 Merge branch 'dev' into 'dev-5.17.0'
合并累积修复

See merge request halo/android/assistant-android!534
2022-12-07 14:00:39 +08:00
e626eb193f Merge branch 'feature-GHZS-436' into 'dev-5.17.0'
feat: 【V5.17.0】游戏详情-详情tab页面优化-大家都在玩—客户端 https://jira.shanqu.cc/browse/GHZS-436

See merge request halo/android/assistant-android!533
2022-12-07 11:29:18 +08:00
51d42c96d3 feat: 【V5.17.0】游戏详情-详情tab页面优化-大家都在玩—客户端 https://jira.shanqu.cc/browse/GHZS-436 2022-12-07 11:29:18 +08:00
ea32d5a798 Merge branch 'feature-GHZS-308' into 'dev-5.17.0'
feat: 【光环助手V5.17.0】发帖图片限制相关优化 https://jira.shanqu.cc/browse/GHZS-308

See merge request halo/android/assistant-android!532
2022-12-06 12:00:11 +08:00
59a5ea9600 feat: 【光环助手V5.17.0】发帖图片限制相关优化 https://jira.shanqu.cc/browse/GHZS-308 2022-12-06 11:50:46 +08:00
8ff62a9f5e Merge branch 'fix-vgame_wrong_database_backup' into 'dev'
fix: 修复畅玩游戏因为跨数据库版本备份造成的闪退问题

See merge request halo/android/assistant-android!531
2022-12-06 11:02:59 +08:00
203c8db840 fix: 修复畅玩游戏因为跨数据库版本备份造成的闪退问题 2022-12-06 10:48:48 +08:00
90ab76aa48 chore: 版本更新至 5.17.0 2022-12-06 09:55:45 +08:00
f1e3a21191 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/search/SearchGameIndexItemViewHolder.kt
#	dependencies.gradle
2022-12-05 17:02:14 +08:00
cae48cb2b7 Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	dependencies.gradle
2022-12-05 17:00:22 +08:00
b91fa853ca Merge branch 'feature-GHZS-473' into 'dev-5.17.0'
feat:【V5.17.0】副标题客户端使用场景补充—客户端 https://jira.shanqu.cc/browse/GHZS-473

See merge request halo/android/assistant-android!529
2022-12-05 14:22:13 +08:00
0f0900033c feat:【V5.17.0】副标题客户端使用场景补充—客户端 https://jira.shanqu.cc/browse/GHZS-473 2022-12-05 14:16:47 +08:00
4fbc80ca38 Merge branch 'feature-GHZS-372' into 'dev-5.17.0'
feat:【光环助手V5.17.0】游戏列表-游戏卡片显示优化 https://jira.shanqu.cc/browse/GHZS-372

See merge request halo/android/assistant-android!528
2022-12-05 13:53:42 +08:00
7fbe32d2af feat:【光环助手V5.17.0】游戏列表-游戏卡片显示优化 https://jira.shanqu.cc/browse/GHZS-372 2022-12-05 13:53:42 +08:00
988b931170 chore: 版本更新到 5.14.8 2022-12-05 10:57:48 +08:00
50acd6998e Merge branch 'hotfix-v5.14.7-637-crash' into 'legacy-release'
fix: 临时修复跳转内容为空时的闪退...

See merge request halo/android/assistant-android!527
2022-12-05 10:56:15 +08:00
84faf3e0d5 Merge branch 'feature-GHZS-565' into 'dev'
fix:【光环助手V5.16.0】游戏广告管理功能(前端部分)-1202测试 https://jira.shanqu.cc/browse/GHZS-565

See merge request halo/android/assistant-android!526
2022-12-05 10:50:49 +08:00
d84c1f1f25 fix:【光环助手V5.16.0】游戏广告管理功能(前端部分)-1202测试 https://jira.shanqu.cc/browse/GHZS-565 2022-12-05 10:37:49 +08:00
52b6a429bc fix: 临时修复跳转内容为空时的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/237240/?project=22&query=skip&sort=freq&statsPeriod=14d 2022-12-05 10:28:42 +08:00
6492b41ad1 Merge branch 'feature-issues92' into 'dev'
fix:修复游戏单详情评论列表的滑动卡顿问题 https://git.shanqu.cc/halo/android/assistant-android/-/issues/92

See merge request halo/android/assistant-android!524
2022-12-02 15:37:12 +08:00
3e4faca388 fix:修复游戏单详情评论列表的滑动卡顿问题 https://git.shanqu.cc/halo/android/assistant-android/-/issues/92 2022-12-02 15:37:12 +08:00
15b3f7df2a Merge branch 'feature-GHZS-440' into 'dev-5.17.0'
feat: 【V5.17.0】游戏详情-详情tab页面优化-游戏单推荐—客户端 https://jira.shanqu.cc/browse/GHZS-440

See merge request halo/android/assistant-android!525
2022-12-02 15:34:16 +08:00
937109224c feat: 【V5.17.0】游戏详情-详情tab页面优化-游戏单推荐—客户端 https://jira.shanqu.cc/browse/GHZS-440 2022-12-02 15:30:14 +08:00
cd1609a3ef chore: 版本更新至 5.15.2 2022-12-02 15:18:22 +08:00
4fd9c7b36e Merge branch 'hotfix-v5.15.1-651-game_ratting_error' into 'release'
fix: 修改游戏评论闪退问题

See merge request halo/android/assistant-android!523
2022-12-02 14:29:22 +08:00
2bd8e0f96b fix: 修改游戏评论闪退问题 2022-12-02 14:25:06 +08:00
2d64f19f98 Merge branch 'hotfix-v5.15.1-651-simulator_crash' into 'release'
fix: 修复模拟器安装时的闪退

See merge request halo/android/assistant-android!521
2022-12-02 13:49:44 +08:00
15de55ceae fix: 修复模拟器安装时的闪退 2022-12-02 13:45:42 +08:00
2316bd1e18 Merge branch 'hotfix-v5.15.1-651-search_subject_crash' into 'release'
fix:修复搜索专题显示空白的问题

See merge request halo/android/assistant-android!520
2022-12-02 12:21:04 +08:00
6a4726650c fix:修复搜索专题显示空白的问题 2022-12-02 11:45:10 +08:00
e79e6f8ec8 Merge branch 'feature-GHZS-554' into 'dev'
fix:【光环助手V5.16.0】光环下载进度条优化-1201测试 https://jira.shanqu.cc/browse/GHZS-554

See merge request halo/android/assistant-android!519
2022-12-02 10:43:34 +08:00
894d962836 Merge branch 'feature-GHZS-549' into 'dev'
fix:【光环助手V5.16.0】游戏广告管理功能(前端部分)-1201测试- (2(2)、4) https://jira.shanqu.cc/browse/GHZS-549

See merge request halo/android/assistant-android!518
2022-12-02 10:42:29 +08:00
f48767c4bf fix:【光环助手V5.16.0】光环下载进度条优化-1201测试 https://jira.shanqu.cc/browse/GHZS-554 2022-12-02 10:32:17 +08:00
b5a64d1c36 fix:【光环助手V5.16.0】游戏广告管理功能(前端部分)-1201测试- (2(2)、4) https://jira.shanqu.cc/browse/GHZS-549 2022-12-02 09:55:25 +08:00
fb4936a553 feat:【V5.17.0】论坛详情页-问答帖新增排序方式切换—客户端 https://jira.shanqu.cc/browse/GHZS-390 2022-12-01 16:30:44 +08:00
001d062207 chore: 版本更新至 5.15.1 2022-12-01 16:27:31 +08:00
d4b1b822f4 Merge branch 'legacy-release' into 'release'
合并 5.14.X 闪退修复

See merge request halo/android/assistant-android!517
2022-12-01 16:26:32 +08:00
732765118e Merge branch 'hotfix-v5.14.7-637-crashes' into 'legacy-release'
修复一些线上闪退

See merge request halo/android/assistant-android!516
2022-12-01 16:25:36 +08:00
eeacae1fd2 fix: 修复历史游戏列表因为历史副标题颜色不存在引起的闪退 2022-12-01 16:08:17 +08:00
e982ae9125 fix: 修复双列通用合集专题因为获取到错误的位置造成的闪退 2022-12-01 16:03:20 +08:00
a7ee0c754b fix: 捕抓畅玩因为存储空间不足造成的闪退 2022-12-01 16:01:27 +08:00
b042b3433d Merge branch 'feature-GHZS-534' into 'dev'
fix:【光环助手V5.16.0】光环下载进度条优化-1130测试2 https://jira.shanqu.cc/browse/GHZS-534

See merge request halo/android/assistant-android!515
2022-12-01 15:05:24 +08:00
8ba70f4a7d fix:【光环助手V5.16.0】光环下载进度条优化-1130测试2 https://jira.shanqu.cc/browse/GHZS-534 2022-12-01 14:59:04 +08:00
094a85bfa4 Merge branch 'feature-GHZS-538' into 'release'
fix: 模拟器下载流程问题修改  https://jira.shanqu.cc/browse/GHZS-538

See merge request halo/android/assistant-android!514
2022-12-01 13:52:27 +08:00
54f0fa8dd8 fix: 模拟器下载流程问题修改 https://jira.shanqu.cc/browse/GHZS-538 2022-12-01 13:49:01 +08:00
30f4bcc422 Merge branch 'feature-GHZS-431' into 'dev-5.17.0'
feat: 【V5.17.0】游戏详情-详情tab页面优化-相关游戏—客户端 https://jira.shanqu.cc/browse/GHZS-431

See merge request halo/android/assistant-android!513
2022-12-01 11:44:00 +08:00
39820b2c8a feat: 【V5.17.0】游戏详情-详情tab页面优化-相关游戏—客户端 https://jira.shanqu.cc/browse/GHZS-431 2022-12-01 11:40:20 +08:00
1f331a20fa Merge branch 'feature-GHZS-538' into 'release'
fix: 模拟器下载流程问题  https://jira.shanqu.cc/browse/GHZS-538

See merge request halo/android/assistant-android!512
2022-12-01 11:40:15 +08:00
ad58699d2f fix: 模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-538 2022-12-01 11:30:21 +08:00
ecb73f9636 Merge branch 'feature-GHZS-373' into 'dev-5.17.0'
feat:【光环助手V5.17.0】游戏详情-分享面板文案更换 https://jira.shanqu.cc/browse/GHZS-373

See merge request halo/android/assistant-android!511
2022-12-01 10:46:35 +08:00
55e80c00de Merge branch 'fix-GHZS-535' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第6点 https://jira.shanqu.cc/browse/GHZS-535

See merge request halo/android/assistant-android!510
2022-12-01 10:34:41 +08:00
172b8cfa4c fix: 云存档第一期-测试问题-2022\11\30-第6点 https://jira.shanqu.cc/browse/GHZS-535 2022-12-01 10:24:40 +08:00
bf6b1f05b0 Merge branch 'feature-GHZS-531' into 'dev'
fix:【V5.16.0】游戏广告管理功能(前端部分)-1130测试(4) https://jira.shanqu.cc/browse/GHZS-531

See merge request halo/android/assistant-android!509
2022-12-01 10:15:14 +08:00
5e69aa2362 feat:【光环助手V5.17.0】游戏详情-分享面板文案更换 https://jira.shanqu.cc/browse/GHZS-373 2022-12-01 10:12:17 +08:00
a28ba2773e fix:【V5.16.0】游戏广告管理功能(前端部分)-1130测试(4) https://jira.shanqu.cc/browse/GHZS-531 2022-12-01 09:45:44 +08:00
a19b2c5dc8 Merge branch 'fix-wrong_backup' into 'dev'
fix: 修复云存档会被自动备份影响到下一次安装使用的问题

See merge request halo/android/assistant-android!508
2022-11-30 21:25:30 +08:00
a70156e272 fix: 修复云存档会被自动备份影响到下一次安装使用的问题 2022-11-30 21:21:47 +08:00
583e8c8eb8 Merge branch 'feature-GHZS-520' into 'dev'
fix:【光环助手V5.16.0】光环下载进度条优化-1130测试(1-3、5) https://jira.shanqu.cc/browse/GHZS-520

See merge request halo/android/assistant-android!505
2022-11-30 19:44:58 +08:00
b08b6bda3b fix:【光环助手V5.16.0】光环下载进度条优化-1130测试(1-3、5) https://jira.shanqu.cc/browse/GHZS-520 2022-11-30 19:44:58 +08:00
ef1d32b330 Merge branch 'feature-GHZS-513' into 'dev'
fix:【V5.16.0】云存档第一期—云存档管理-1130UI测试(4) https://jira.shanqu.cc/browse/GHZS-513

See merge request halo/android/assistant-android!506
2022-11-30 19:43:12 +08:00
98deb6c702 fix:【V5.16.0】云存档第一期—云存档管理-1130UI测试(4) https://jira.shanqu.cc/browse/GHZS-513 2022-11-30 19:43:12 +08:00
1aa23aeeae Merge branch 'fix-GHZS-524' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第5点 https://jira.shanqu.cc/browse/GHZS-524

See merge request halo/android/assistant-android!507
2022-11-30 18:54:13 +08:00
dd4f9918c9 fix: 云存档第一期-测试问题-2022\11\30-第5点 https://jira.shanqu.cc/browse/GHZS-524 2022-11-30 18:51:54 +08:00
da1d7b23c3 Merge branch 'fix-GHZS-489' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第4点 https://jira.shanqu.cc/browse/GHZS-489

See merge request halo/android/assistant-android!504
2022-11-30 18:29:24 +08:00
8fc324cbc3 fix: 云存档第一期-测试问题-2022\11\30-第4点 https://jira.shanqu.cc/browse/GHZS-489 2022-11-30 18:21:12 +08:00
cd83c0a267 Merge branch 'feature-GHZS-511' into 'dev'
fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试(6) https://jira.shanqu.cc/browse/GHZS-511

See merge request halo/android/assistant-android!503
2022-11-30 18:20:46 +08:00
d61eb01461 fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试(6) https://jira.shanqu.cc/browse/GHZS-511 2022-11-30 18:18:26 +08:00
546d692151 Merge branch 'feature-GHZS-511' into 'dev'
fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试(5) https://jira.shanqu.cc/browse/GHZS-511

See merge request halo/android/assistant-android!502
2022-11-30 17:50:50 +08:00
bc313422e2 fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试(5) https://jira.shanqu.cc/browse/GHZS-511 2022-11-30 17:50:14 +08:00
acc5bd6e8c Merge branch 'hotfix_game_detail_archive_ui' into 'dev'
fix: 游戏详情-云存档tab-用户icon去掉边框

See merge request halo/android/assistant-android!501
2022-11-30 17:09:01 +08:00
15c3aed5ba fix: 游戏详情-云存档tab-用户icon去掉边框 2022-11-30 17:07:42 +08:00
afc8f15048 Merge branch 'fix-GHZS-489' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第4点 https://jira.shanqu.cc/browse/GHZS-489

See merge request halo/android/assistant-android!500
2022-11-30 16:48:54 +08:00
de02ea7312 fix: 云存档第一期-测试问题-2022\11\30-第4点 https://jira.shanqu.cc/browse/GHZS-489 2022-11-30 16:44:23 +08:00
420b112576 Merge branch 'feature-GHZS-521' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第2点 https://jira.shanqu.cc/browse/GHZS-521

See merge request halo/android/assistant-android!499
2022-11-30 16:38:46 +08:00
f6a67350b4 fix: 云存档第一期-测试问题-2022\11\30-第2点 https://jira.shanqu.cc/browse/GHZS-521 2022-11-30 16:35:45 +08:00
5482322c28 Merge branch 'feature-GHZS-515' into 'dev'
fix: 云存档第一期-测试问题-2022\11\30-第3点 https://jira.shanqu.cc/browse/GHZS-515

See merge request halo/android/assistant-android!498
2022-11-30 16:15:24 +08:00
08236d4ddc fix: 云存档第一期-测试问题-2022\11\30-第3点 https://jira.shanqu.cc/browse/GHZS-515 2022-11-30 16:15:24 +08:00
9558c0b123 Merge branch 'feature-GHZS-511' into 'dev'
fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试 https://jira.shanqu.cc/browse/GHZS-511

See merge request halo/android/assistant-android!497
2022-11-30 15:03:07 +08:00
f68df0fce5 fix:【V5.16.0】云存档第一期—游戏详情-1130UI测试 https://jira.shanqu.cc/browse/GHZS-511 2022-11-30 14:59:50 +08:00
03401e5649 Merge branch 'feature-GHZS-503' into 'dev'
fix:【V5.16.0】游戏活动模板功能(第二期)-1124测试-第2点 https://jira.shanqu.cc/browse/GHZS-503

See merge request halo/android/assistant-android!496
2022-11-30 14:53:36 +08:00
86f6b0c108 fix:【V5.16.0】游戏活动模板功能(第二期)-1124测试-第2点 https://jira.shanqu.cc/browse/GHZS-503 2022-11-30 14:43:00 +08:00
fc9eea7a4e Merge branch 'feature-GHZS-513' into 'dev'
fix:【V5.16.0】云存档第一期—云存档管理-1130UI测试 https://jira.shanqu.cc/browse/GHZS-513

See merge request halo/android/assistant-android!494
2022-11-30 14:29:15 +08:00
bff56dc114 fix:【V5.16.0】云存档第一期—云存档管理-1130UI测试 https://jira.shanqu.cc/browse/GHZS-513 2022-11-30 14:29:15 +08:00
fddf52b0c3 Merge branch 'feature-GHZS-443' into 'dev'
fix:【V5.16.0】游戏广告管理功能(前端部分)-1128测试(3) https://jira.shanqu.cc/browse/GHZS-443

See merge request halo/android/assistant-android!495
2022-11-30 14:28:55 +08:00
5eb804d9d4 fix:【V5.16.0】游戏广告管理功能(前端部分)-1128测试(3) https://jira.shanqu.cc/browse/GHZS-443 2022-11-30 14:28:55 +08:00
d04e2b59e5 Merge branch 'feature_GHZS_93' into 'dev'
fix:修复已安装游戏tab-游戏卡片列表顶部(首个游戏上方)需增加8dp间距  https://jira.shanqu.cc/browse/GHZS-514

See merge request halo/android/assistant-android!493
2022-11-30 14:05:21 +08:00
558f4409af fix:修复已安装游戏tab-游戏卡片列表顶部(首个游戏上方)需增加8dp间距 https://jira.shanqu.cc/browse/GHZS-514 2022-11-30 14:05:21 +08:00
c21040f8f1 Merge branch 'feature-GHZS-488' into 'dev'
fix:【光环助手V5.16.0】游戏礼包优化(第三期)-1129测试-第2点 https://jira.shanqu.cc/browse/GHZS-488

See merge request halo/android/assistant-android!491
2022-11-30 14:00:26 +08:00
2f577c7ef1 Merge branch 'feature-GHZS-92' into 'dev'
feat:【V5.16.0】云存档第一期-云存档管理—客户端(添加使用帮助文章跳转) https://jira.shanqu.cc/browse/GHZS-92

See merge request halo/android/assistant-android!492
2022-11-30 13:51:28 +08:00
56ddf9a83b feat:【V5.16.0】云存档第一期-云存档管理—客户端(添加使用帮助文章跳转) https://jira.shanqu.cc/browse/GHZS-92 2022-11-30 13:51:28 +08:00
50e8071a31 fix:【光环助手V5.16.0】游戏礼包优化(第三期)-1129测试-第2点 https://jira.shanqu.cc/browse/GHZS-488 2022-11-30 13:05:41 +08:00
ca073c128d Merge branch 'fix-GHZS-483' into 'dev'
fix: 畅玩流程优化-测试问题 https://jira.shanqu.cc/browse/GHZS-483

See merge request halo/android/assistant-android!490
2022-11-30 10:45:35 +08:00
6e0dd3831b fix: 畅玩流程优化-测试问题 https://jira.shanqu.cc/browse/GHZS-483 2022-11-30 10:40:55 +08:00
a22e26aec3 Merge branch 'feature-GHZS-478' into 'dev'
fix:【光环助手V5.16.0】光环下载进度条优化-1128测试 https://jira.shanqu.cc/browse/GHZS-478

See merge request halo/android/assistant-android!488
2022-11-30 10:31:42 +08:00
fa33fe3d71 fix:【光环助手V5.16.0】光环下载进度条优化-1128测试 https://jira.shanqu.cc/browse/GHZS-478
fix:【光环助手V5.16.0】光环下载进度条优化-测试问题-2022\\11\\29 https://jira.shanqu.cc/browse/GHZS-484
fix:【光环助手V5.16.0】光环下载进度条优化-1129测试 https://jira.shanqu.cc/browse/GHZS-486
2022-11-30 10:31:42 +08:00
f9e16d1f32 Merge branch 'feature_GHZS_93' into 'dev'
fix:更换游戏存档-推荐游戏接口

See merge request halo/android/assistant-android!489
2022-11-30 09:55:18 +08:00
8584e12a7e fix:更换游戏存档-推荐游戏接口 2022-11-30 09:55:18 +08:00
5ffd28de1b Merge branch 'feature_GHZS_93' into 'dev'
fix:添加筛选云存档的游戏接口

See merge request halo/android/assistant-android!487
2022-11-29 16:22:17 +08:00
fff91052ff fix:添加筛选云存档的游戏接口 2022-11-29 16:22:17 +08:00
0e0812c00e Merge branch 'feature-GHZS-310' into 'dev'
feat:【光环助手V5.16.0】云存档第一期—数据埋点—客户端-1-10 https://jira.shanqu.cc/browse/GHZS-310

See merge request halo/android/assistant-android!485
2022-11-29 10:44:06 +08:00
efe0efa0f8 feat:【光环助手V5.16.0】云存档第一期—数据埋点—客户端-1-10 https://jira.shanqu.cc/browse/GHZS-310 2022-11-28 18:22:52 +08:00
bdb7336d16 Merge remote-tracking branch 'origin/release' into dev 2022-11-28 17:03:28 +08:00
2ee01a0819 Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	app/src/main/java/com/gh/common/history/HistoryDatabase.kt
#	app/src/main/java/com/gh/gamecenter/entity/AmwayCommentEntity.kt
#	app/src/main/java/com/gh/gamecenter/entity/HistoryGameEntity.kt
#	dependencies.gradle
2022-11-28 16:53:02 +08:00
d322c0c500 Merge branch 'hotfix-dev-game_detail_bbs_tab_click' into 'dev'
fix: 游戏详情页-跳转论坛Tab增加是否存在云存档Tab的判断

See merge request halo/android/assistant-android!484
2022-11-28 16:46:03 +08:00
be43470066 fix: 游戏详情页-跳转论坛Tab增加是否存在云存档Tab的判断 2022-11-28 16:41:15 +08:00
ade40c49ef Merge branch 'merge-from_dev_to_feature-GHZS-78' into 'dev'
合并云存档代码至 dev

See merge request halo/android/assistant-android!483
2022-11-28 16:24:27 +08:00
31d23a3a02 Merge remote-tracking branch 'origin/dev' into feature-GHZS-78
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt
2022-11-28 15:34:57 +08:00
22e56e838a Merge branch 'feature-GHZS-380' into 'dev'
fix: 【V5.16.0】启动广告图-1125测试结果反馈-第1/4点 https://jira.shanqu.cc/browse/GHZS-380

See merge request halo/android/assistant-android!480
2022-11-28 14:27:29 +08:00
2242de5f83 chore: 版本更新至 5.14.7-637 2022-11-28 14:26:48 +08:00
b684fff4f1 Merge branch 'hotfix-v5.14.6-636-subtitle' into 'legacy-release'
fix: 补充遗漏的副标题(游戏动态页) https://jira.shanqu.cc/browse/GHZS-344

See merge request halo/android/assistant-android!479
2022-11-28 14:22:37 +08:00
001a472b8e fix: 【V5.16.0】启动广告图-1125测试结果反馈-第1/4点 https://jira.shanqu.cc/browse/GHZS-380 2022-11-28 14:17:18 +08:00
0b0f575c41 fix: 补充遗漏的副标题(游戏动态页) https://jira.shanqu.cc/browse/GHZS-344 2022-11-28 14:05:15 +08:00
da25541147 fix:添加我的光环-游戏存档入口 2022-11-28 11:57:18 +08:00
e57ba6ed71 feat:【光环助手V5.16.0】云存档第一期—数据埋点—客户端-11-20 (12、19) https://jira.shanqu.cc/browse/GHZS-314 2022-11-28 11:37:44 +08:00
fad7083a2c Merge branch 'feature-GHZS-344' into 'legacy-release'
feat: 【光环助手】副标题遗漏场景补充 https://jira.shanqu.cc/browse/GHZS-344

See merge request halo/android/assistant-android!477
2022-11-28 11:25:05 +08:00
9254c9ef7d Merge branch 'feature_GHZS_93' into 'feature-GHZS-78'
feat:添加我的光环-游戏存档https://jira.shanqu.cc/browse/GHZS-93

See merge request halo/android/assistant-android!478
2022-11-28 10:41:47 +08:00
d3042b9199 feat:添加我的光环-游戏存档https://jira.shanqu.cc/browse/GHZS-93 2022-11-28 10:41:47 +08:00
0893a34dff feat:【光环助手V5.16.0】云存档第一期—数据埋点—客户端-11-20 (除12、19) https://jira.shanqu.cc/browse/GHZS-314 2022-11-25 16:49:27 +08:00
da22540af3 feat: 【光环助手】副标题遗漏场景补充 https://jira.shanqu.cc/browse/GHZS-344 2022-11-25 16:23:06 +08:00
fffc27e779 fix:【V5.16.0】云存档第一期-云存档管理—客户端(修改编辑存档接口,处理一些细节问题) https://jira.shanqu.cc/browse/GHZS-92 2022-11-25 15:00:58 +08:00
2f246da269 Merge branch 'feature-GHZS-348' into 'dev'
fix:【V5.16.0】游戏搜索-热门榜单功能优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-348

See merge request halo/android/assistant-android!476
2022-11-25 14:40:04 +08:00
c6137fc3c9 fix:【V5.16.0】游戏搜索-热门榜单功能优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-348 2022-11-25 14:36:23 +08:00
518eb222b9 fix:处理切换普通/深色模式时LazyListFragment页面变量未初始化导致的闪退问题 2022-11-25 14:26:43 +08:00
8bf7c61690 Merge branch 'fix-gamedetail_tab_error' into 'dev'
fix: 修改游戏详情tab跳转错误问题

See merge request halo/android/assistant-android!475
2022-11-25 14:11:05 +08:00
a28169eeae fix: 修改游戏详情tab跳转错误问题 2022-11-25 14:07:04 +08:00
fb1968b402 fix:处理合并遗漏 2022-11-25 13:56:54 +08:00
f479c789e9 Merge remote-tracking branch 'origin/dev' into feature-GHZS-78
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt
#	app/src/main/java/com/gh/gamecenter/retrofit/service/ApiService.java
2022-11-25 13:40:34 +08:00
67fb1948b4 feat:【V5.16.0】云存档第一期-云存档管理—客户端 https://jira.shanqu.cc/browse/GHZS-92 2022-11-24 17:51:14 +08:00
cd39a497e9 Merge branch 'feature-GHZS-336' into 'dev'
fix:【光环助手V5.16.0】游戏评分相关优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-336

See merge request halo/android/assistant-android!473
2022-11-24 17:49:13 +08:00
2398795438 fix:【光环助手V5.16.0】游戏评分相关优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-336 2022-11-24 17:45:50 +08:00
2d41122c1c Merge branch 'feature-GHZS-334' into 'dev'
fix:【光环助手V5.16.0】游戏评分相关优化-1124测试-第1点 https://jira.shanqu.cc/browse/GHZS-334

See merge request halo/android/assistant-android!472
2022-11-24 17:22:13 +08:00
ec576900e8 fix:【光环助手V5.16.0】游戏评分相关优化-1124测试-第1点 https://jira.shanqu.cc/browse/GHZS-334 2022-11-24 17:15:49 +08:00
47549d788b fix:【光环助手V5.16.0】游戏评分相关优化-1124测试-第1点 https://jira.shanqu.cc/browse/GHZS-334 2022-11-24 16:51:48 +08:00
34f1dd057c feat:【V5.16.0】云存档第一期-游戏详情—客户端(创建下载按钮辅助类)https://jira.shanqu.cc/browse/GHZS-80 2022-11-24 15:41:31 +08:00
20e8fa451c Merge branch 'feature-GHZS-282' into 'dev'
fix:【V5.16.0】游戏搜索-热门榜单功能优化-1118UI测试(修复动图设置圆角无效问题) https://jira.shanqu.cc/browse/GHZS-282

See merge request halo/android/assistant-android!471
2022-11-24 15:07:11 +08:00
f92fb6a1c7 fix:【V5.16.0】游戏搜索-热门榜单功能优化-1118UI测试(修复动图设置圆角无效问题) https://jira.shanqu.cc/browse/GHZS-282 2022-11-24 15:07:10 +08:00
0e71b917c5 Merge branch 'feature-GHZS-340' into 'dev'
fix:【光环助手V5.16.0】光环下载进度条优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-340

See merge request halo/android/assistant-android!470
2022-11-24 15:00:52 +08:00
d48947b256 fix:【光环助手V5.16.0】光环下载进度条优化-1124UI测试 https://jira.shanqu.cc/browse/GHZS-340 2022-11-24 14:46:47 +08:00
7f5605a1a7 Merge branch 'merge-dev_to_dev-5.16.0' into 'dev-5.16.0'
Merge dev to dev 5.16.0

See merge request halo/android/assistant-android!469
2022-11-24 13:43:42 +08:00
f0ed0ae612 fix: 处理合并冲突 2022-11-24 11:15:58 +08:00
2c7997aa57 Merge remote-tracking branch 'origin/dev' into dev-5.16.0
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt
#	app/src/main/java/com/gh/gamecenter/game/vertical/GameVerticalAdapter.kt
#	app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt
#	app/src/main/java/com/gh/vspace/VDownloadManagerAdapter.kt
#	module_common/src/main/java/com/gh/gamecenter/common/view/DrawableView.kt
2022-11-24 11:06:06 +08:00
0bc638a2f9 Merge branch 'merge-release_to_dev' into 'dev'
Merge release to dev

See merge request halo/android/assistant-android!468
2022-11-24 10:50:10 +08:00
1ae64c35b9 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt
#	dependencies.gradle
2022-11-24 10:38:48 +08:00
252566837a chore: 版本更新至 5.14.6 2022-11-24 10:06:24 +08:00
4cfa723a0e feat:【V5.16.0】云存档第一期-游戏详情—客户端(处理下载按钮)https://jira.shanqu.cc/browse/GHZS-80 2022-11-23 18:00:20 +08:00
6c74096302 Merge branch 'fix-wrong-activity_dependency_version' into 'dev-5.16.0'
fix: activity-ktx 回滚到够用的 1.2.3 (依赖版本升太高增加了 100K 压缩后的代码)

See merge request halo/android/assistant-android!467
2022-11-23 17:49:45 +08:00
53075a2eff fix: activity-ktx 回滚到够用的 1.2.3 (依赖版本升太高增加了 100K 压缩后的代码) 2022-11-23 17:48:30 +08:00
94d249312b Merge branch 'hotfix-v5.13.7-617-try_catch_subtitle_crash' into 'release'
fix:捕获游戏详情副标题的异常

See merge request halo/android/assistant-android!466
2022-11-23 17:03:28 +08:00
4855dda839 fix:捕获游戏详情副标题的异常 2022-11-23 17:03:28 +08:00
c5519fb160 Merge branch 'hotfix-v5.14.5-635-subtitle' into 'release'
fix: 修复模拟器上部分副标题不显示的问题,为分类页面和开服表页面添加副标题支持 https://jira.shanqu.cc/browse/GHZS-319

See merge request halo/android/assistant-android!463
2022-11-23 16:26:09 +08:00
5cd9197d0f fix: 修复模拟器上部分副标题不显示的问题,为分类页面和开服表页面添加副标题支持 https://jira.shanqu.cc/browse/GHZS-319 2022-11-23 16:26:09 +08:00
28a97b0441 Merge branch 'feature-issues93' into 'dev-5.16.0'
feat: 移除冗余的 Splitties 依赖

See merge request halo/android/assistant-android!464
2022-11-23 16:03:25 +08:00
d0cd3b4ac2 Merge branch 'feature-GHZS-144' into 'dev-5.16.0'
feat:【V5.16.0】游戏评分相关优化—客户端(草稿功能由本地改为使用接口) https://jira.shanqu.cc/browse/GHZS-144

See merge request halo/android/assistant-android!462
2022-11-23 11:44:21 +08:00
f87e0dfe3c feat:【V5.16.0】游戏评分相关优化—客户端(草稿功能由本地改为使用接口) https://jira.shanqu.cc/browse/GHZS-144 2022-11-23 11:44:21 +08:00
c838f1dc24 feat: 移除冗余的 Splitties 依赖 2022-11-23 11:26:22 +08:00
584512c2ae Merge branch 'merge-release_to_dev' into 'dev'
合并 release 变更至 dev

See merge request halo/android/assistant-android!461
2022-11-23 10:43:24 +08:00
22cfe03a30 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/entity/PrivacyPolicyEntity.kt
#	dependencies.gradle
2022-11-23 10:36:10 +08:00
3b178c0bbe chore: 版本更新至 5.14.5 2022-11-23 10:20:30 +08:00
6270f9fb98 Merge branch 'hotfix-v5.14.4-634-vgame_feedback' into 'release'
fix: 修复畅玩游戏反馈无法正常跳转的问题 https://jira.shanqu.cc/browse/GHZS-309

See merge request halo/android/assistant-android!460
2022-11-23 10:19:40 +08:00
0306caadb5 fix: 修复畅玩游戏反馈无法正常跳转的问题 https://jira.shanqu.cc/browse/GHZS-309 2022-11-23 10:19:40 +08:00
9c1e2f18fd fix: 修复数据升级异常 2022-11-22 17:17:56 +08:00
305ab1d0e2 fix: 统一方法描述 2022-11-22 16:49:38 +08:00
ad208538f6 feat: 提供创建游戏存档结果回调 2022-11-22 16:47:38 +08:00
308cf4b627 feat: 调整存档路径的可见性 2022-11-22 16:38:34 +08:00
4fd4086023 Merge branch 'feature-GHZS-282' into 'dev-5.16.0'
fix:【V5.16.0】游戏搜索-热门榜单功能优化-1118UI测试 https://jira.shanqu.cc/browse/GHZS-282

See merge request halo/android/assistant-android!459
2022-11-22 15:43:11 +08:00
858f213b19 fix:【V5.16.0】游戏搜索-热门榜单功能优化-1118UI测试 https://jira.shanqu.cc/browse/GHZS-282 2022-11-22 15:41:28 +08:00
5efb343599 feat: 提供根据 md5 删除对应存档的方法,调整部分变量命名 2022-11-22 15:10:40 +08:00
842f120de4 feat: 提供根据 md5 获取存档文件的方法 2022-11-22 15:04:14 +08:00
adf7795877 Merge branch 'feature-GHZS-28' into 'dev-5.16.0'
fix:【V5.16.0】游戏广告管理功能(前端部分)—客户端 (安利墙广场改为支持任意位置放置专题) https://jira.shanqu.cc/browse/GHZS-28

See merge request halo/android/assistant-android!458
2022-11-22 14:56:06 +08:00
095e533269 fix:【V5.16.0】游戏广告管理功能(前端部分)—客户端 (安利墙广场改为支持任意位置放置专题) https://jira.shanqu.cc/browse/GHZS-28 2022-11-22 14:48:36 +08:00
364e7d0588 Merge branch 'feature-GHZS-112' into 'dev-5.16.0'
feat:【V5.16.0】违规整合优化(第二期)—客户端 https://jira.shanqu.cc/browse/GHZS-112

See merge request halo/android/assistant-android!457
2022-11-22 14:28:41 +08:00
d3ce4b00ab feat: 提供简单的畅玩下载存档、保存存档、应用存档逻辑 2022-11-22 14:23:07 +08:00
bde4baa0d1 feat:【V5.16.0】违规整合优化(第二期)—客户端 https://jira.shanqu.cc/browse/GHZS-112 2022-11-22 14:12:18 +08:00
1fdb1bd24a Merge branch 'feature-GHZS-144' into 'dev-5.16.0'
feat:【V5.16.0】游戏评分相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-144

See merge request halo/android/assistant-android!455
2022-11-22 10:11:08 +08:00
4cba936bf2 Merge branch 'feature-GHZS-273' into 'dev-5.16.0'
fix: 【V5.16.0】游戏详情-内容卡片优化-1118测试-第1点 https://jira.shanqu.cc/browse/GHZS-273

See merge request halo/android/assistant-android!456
2022-11-22 10:04:42 +08:00
f33b5e1609 fix: 【V5.16.0】游戏详情-内容卡片优化-1118测试-第1点 https://jira.shanqu.cc/browse/GHZS-273 2022-11-22 10:00:15 +08:00
5881f70a9e feat:【V5.16.0】游戏评分相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-144 2022-11-21 17:57:23 +08:00
d56a63236e Merge branch 'dev-5.16.0' into feature-GHZS-78 2022-11-21 17:33:08 +08:00
714da89e9c Merge branch 'fix-startup_button_background' into 'dev-5.16.0'
fix: 修改启动广告图底部按钮背景

See merge request halo/android/assistant-android!454
2022-11-21 16:17:27 +08:00
5781629898 fix: 修改启动广告图底部按钮背景 2022-11-21 16:14:28 +08:00
00e6fc54ce Merge branch 'feature-GHZS-276' into 'dev-5.16.0'
fix: 【V5.16.0】多版本下载面板-求版本优化-1118测试 https://jira.shanqu.cc/browse/GHZS-276

See merge request halo/android/assistant-android!453
2022-11-21 15:48:37 +08:00
cf68f11cc7 fix: 【V5.16.0】多版本下载面板-求版本优化-1118测试 https://jira.shanqu.cc/browse/GHZS-276 2022-11-21 15:46:14 +08:00
50c77dfd11 Merge branch 'feature-GHZS-84' into 'dev-5.16.0'
feat:【V5.16.0】光环下载进度条优化—客户端 https://jira.shanqu.cc/browse/GHZS-84

See merge request halo/android/assistant-android!447
2022-11-21 15:28:01 +08:00
8564bc95e9 feat:【V5.16.0】光环下载进度条优化—客户端 https://jira.shanqu.cc/browse/GHZS-84 2022-11-21 15:28:01 +08:00
6244387c79 Merge branch 'feature-GHZS-285' into 'dev-5.16.0'
fix: 【V5.16.0】游戏开服类标签UI优化-1118测试 https://jira.shanqu.cc/browse/GHZS-285

See merge request halo/android/assistant-android!452
2022-11-21 14:17:38 +08:00
b3cbe02e40 fix: 【V5.16.0】游戏开服类标签UI优化-1118测试 https://jira.shanqu.cc/browse/GHZS-285 2022-11-21 14:16:05 +08:00
68a8933f62 Merge branch 'feature-GHZS-286' into 'dev-5.16.0'
fix: 【V5.16.0】启动广告图—1118UI测试 https://jira.shanqu.cc/browse/GHZS-286

See merge request halo/android/assistant-android!451
2022-11-21 14:03:44 +08:00
63a38f0dc6 fix: 【V5.16.0】启动广告图—1118UI测试 https://jira.shanqu.cc/browse/GHZS-286 2022-11-21 14:01:39 +08:00
ecbdbf57db Merge branch 'feature-GHZS-277' into 'dev-5.16.0'
fix: 【V5.16.0】猜你喜欢-发现页优化—1118UI测试 https://jira.shanqu.cc/browse/GHZS-277

See merge request halo/android/assistant-android!450
2022-11-21 11:55:01 +08:00
ba1a7d874f fix: 【V5.16.0】猜你喜欢-发现页优化—1118UI测试 https://jira.shanqu.cc/browse/GHZS-277 2022-11-21 11:52:17 +08:00
c70f1aa267 Merge branch 'feature-GHZS-138' into 'dev-5.16.0'
fix:【V5.16.0】通用弹窗UI优化—客户端(修复引导弹窗组件适配版本号弹窗问题) https://jira.shanqu.cc/browse/GHZS-138

See merge request halo/android/assistant-android!448
2022-11-21 11:39:38 +08:00
1189619bdd Merge branch 'feature-GHZS-279' into 'dev-5.16.0'
fix: 【V5.16.0】视频分享面板UI优化—1118UI测试 https://jira.shanqu.cc/browse/GHZS-279

See merge request halo/android/assistant-android!449
2022-11-21 11:33:41 +08:00
a7898ff9bd fix: 【V5.16.0】视频分享面板UI优化—1118UI测试 https://jira.shanqu.cc/browse/GHZS-279 2022-11-21 10:55:56 +08:00
9b90f5bcab fix:【V5.16.0】通用弹窗UI优化—客户端(修复引导弹窗组件适配版本号弹窗问题) https://jira.shanqu.cc/browse/GHZS-138 2022-11-21 10:40:34 +08:00
ec4d60b9f3 Merge remote-tracking branch 'origin/dev-5.16.0' into feature-GHZS-78 2022-11-18 16:36:06 +08:00
eac296a6fd fix:修复CloudArchiveFragment页面选择器监听报错问题 2022-11-18 16:32:01 +08:00
99c3f3e735 Merge branch 'feature-GHZS-119' into 'dev-5.16.0'
【V5.16.0】畅玩流程优化—客户端 https://jira.shanqu.cc/browse/GHZS-178

See merge request halo/android/assistant-android!446
2022-11-18 16:00:32 +08:00
67400bb4cc 【V5.16.0】畅玩流程优化—客户端 https://jira.shanqu.cc/browse/GHZS-178 2022-11-18 16:00:31 +08:00
e9f1346035 Merge branch 'feature-GHZS-140' into 'dev-5.16.0'
feat:【V5.16.0】退出登录弹窗UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-140

See merge request halo/android/assistant-android!444
2022-11-18 14:07:33 +08:00
4c40996a95 Merge branch 'feature-GHZS-256' into 'dev-5.16.0'
fix: 【光环助手V5.16.0】首页弹窗数据上报问题 https://jira.shanqu.cc/browse/GHZS-256

See merge request halo/android/assistant-android!445
2022-11-18 13:49:59 +08:00
bdf7c7fcc8 fix: 【光环助手V5.16.0】首页弹窗数据上报问题 https://jira.shanqu.cc/browse/GHZS-256 2022-11-18 13:47:27 +08:00
a51019ea8b feat:【V5.16.0】退出登录弹窗UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-140 2022-11-18 13:38:18 +08:00
319bb3ac2c Merge branch 'feature-GHZS-231' into 'dev-5.16.0'
feat: 【V5.16.0】游戏开服类标签UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-231

See merge request halo/android/assistant-android!443
2022-11-18 12:00:38 +08:00
c675cba035 feat: 【V5.16.0】游戏开服类标签UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-231 2022-11-18 11:45:08 +08:00
7f1a0351a9 Merge branch 'feature-GHZS-138' into 'dev-5.16.0'
feat:【V5.16.0】通用弹窗UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-138

See merge request halo/android/assistant-android!442
2022-11-18 09:57:54 +08:00
e120f22b57 feat:【V5.16.0】通用弹窗UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-138 2022-11-17 18:00:34 +08:00
6d64b26e3d Revert "Merge branch 'fix-remove_duplicated_splitties' into 'dev-5.16.0'"
This reverts merge request !441
2022-11-17 17:11:22 +08:00
7ced550195 Merge branch 'fix-remove_duplicated_splitties' into 'dev-5.16.0'
fix: 移除无用的 splitties 额外依赖(仅使用 DSL 相关对的依赖)

See merge request halo/android/assistant-android!441
2022-11-17 16:09:07 +08:00
ca1b812c30 Merge branch 'feature-issues-90' into 'dev-5.16.0'
refactor: 为 TextView 添加 setDrawable extensions,整理旧代码 https://git.shanqu.cc/halo/android/assistant-android/-/issues/90

See merge request halo/android/assistant-android!440
2022-11-17 15:57:30 +08:00
d306fb185c fix: 移除无用的 splitties 额外依赖(仅使用 DSL 相关对的依赖) 2022-11-17 15:25:44 +08:00
4b10019888 Merge branch 'feature-GHZS-136' into 'dev-5.16.0'
feat:【V5.16.0】游戏搜索-搜索榜单的曝光数据修改—客户端 https://jira.shanqu.cc/browse/GHZS-136

See merge request halo/android/assistant-android!439
2022-11-17 12:01:15 +08:00
640dce271c refactor: 为 TextView 添加 setDrawable extensions,整理旧代码 https://git.shanqu.cc/halo/android/assistant-android/-/issues/90 2022-11-17 11:55:16 +08:00
b7b4ce8c83 feat:【V5.16.0】游戏搜索-搜索榜单的曝光数据修改—客户端 https://jira.shanqu.cc/browse/GHZS-136 2022-11-17 11:44:53 +08:00
f689ef6228 feat:【V5.16.0】云存档第一期-游戏详情—客户端(剩余下载按钮处理)https://jira.shanqu.cc/browse/GHZS-80 2022-11-16 18:21:59 +08:00
c9911a1a22 Merge branch 'feature-GHZS-135' into 'dev-5.16.0'
feat: 【V5.16.0】猜你喜欢-发现页优化—客户端 https://jira.shanqu.cc/browse/GHZS-135

See merge request halo/android/assistant-android!438
2022-11-16 16:47:13 +08:00
b8fb3327b5 feat: 【V5.16.0】猜你喜欢-发现页优化—客户端 https://jira.shanqu.cc/browse/GHZS-135 2022-11-16 15:02:06 +08:00
259791faf0 feat: 添加简单文件下载的相关类 2022-11-16 10:32:50 +08:00
d20866a045 Merge branch 'feature-GHZS-244' into 'dev-5.16.0'
fix: 【V5.16.0】游戏搜索-搜索榜单的曝光数据不匹配问题 https://jira.shanqu.cc/browse/GHZS-244

See merge request halo/android/assistant-android!437
2022-11-15 16:40:48 +08:00
110de25099 fix: 【V5.16.0】游戏搜索-搜索榜单的曝光数据不匹配问题 https://jira.shanqu.cc/browse/GHZS-244 2022-11-15 16:37:32 +08:00
8e863bb7cc Merge branch 'feature-GHZS-179' into 'dev-5.16.0'
feat: 【V5.16.0】数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-179

See merge request halo/android/assistant-android!436
2022-11-15 15:48:56 +08:00
9cf044ee2e feat: 【V5.16.0】数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-179 2022-11-15 15:28:46 +08:00
04886fb265 Merge branch 'feature-GHZS-142' into 'dev-5.16.0'
feat: 【V5.16.0】视频分享面板UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-142

See merge request halo/android/assistant-android!435
2022-11-15 14:33:15 +08:00
ca26ccbecb feat: 【V5.16.0】视频分享面板UI优化—客户端 https://jira.shanqu.cc/browse/GHZS-142 2022-11-15 14:06:05 +08:00
30268a5cda chore: 版本更新至 5.14.4 2022-11-15 11:13:52 +08:00
5d4f489ddd Merge branch 'release-merge-legacy_release' into 'release'
合并 legacy-release 变更

See merge request halo/android/assistant-android!434
2022-11-15 11:13:03 +08:00
102d285c09 Merge remote-tracking branch 'origin/legacy-release' into release-merge-legacy_release
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/SplashScreenActivity.kt
#	dependencies.gradle
2022-11-15 10:57:41 +08:00
092092fd6f Merge branch 'hotfix-installed_framgent_duplicated_refresh' into 'dev-5.16.0'
fix: 统一安装事件字符串,修复下载管理-已安装列表多余的刷新问题

See merge request halo/android/assistant-android!433
2022-11-14 16:48:11 +08:00
97a54f1000 fix: 统一安装事件字符串,修复下载管理-已安装列表错误的刷新机制 2022-11-14 16:36:11 +08:00
6b0611e05f chore: 版本更新至 5.13.7 2022-11-14 15:29:23 +08:00
d3295f81f6 Merge branch 'feature-GHZS-132' into 'dev-5.16.0'
feat: 【V5.16.0】游戏详情-内容卡片优化—客户端 https://jira.shanqu.cc/browse/GHZS-132

See merge request halo/android/assistant-android!432
2022-11-14 15:27:19 +08:00
384469bcae Merge branch 'feature-GHZS-209' into 'legacy-release'
feat: 还原首次启动时的权限提示弹窗和权限获取 https://jira.shanqu.cc/browse/GHZS-209

See merge request halo/android/assistant-android!431
2022-11-14 15:22:06 +08:00
77a512852b feat: 【V5.16.0】游戏详情-内容卡片优化—客户端 https://jira.shanqu.cc/browse/GHZS-132 2022-11-14 14:46:54 +08:00
0aeb37a5eb feat: 还原首次启动时的权限提示弹窗和权限获取 https://jira.shanqu.cc/browse/GHZS-209 2022-11-14 14:27:10 +08:00
50b5b1d8ac feat: 添加新的下载模块 2022-11-11 17:14:21 +08:00
de08c5dc98 Merge branch 'feature-GHZS-106' into 'dev-5.16.0'
fix: 【光环助手V5.16.0】游戏搜索-历史搜索显示问题 https://jira.shanqu.cc/browse/GHZS-106

See merge request halo/android/assistant-android!430
2022-11-11 14:36:27 +08:00
c2abe5be34 fix: 【光环助手V5.16.0】游戏搜索-历史搜索显示问题 https://jira.shanqu.cc/browse/GHZS-106 2022-11-11 14:21:18 +08:00
1222b4cde4 Merge branch 'feature-GHZS-43' into 'dev-5.16.0'
feat:【V5.16.0】游戏礼包优化(第三期)—客户端 https://jira.shanqu.cc/browse/GHZS-43

See merge request halo/android/assistant-android!429
2022-11-11 11:38:13 +08:00
a3cf98196d feat:【V5.16.0】游戏礼包优化(第三期)—客户端 https://jira.shanqu.cc/browse/GHZS-43 2022-11-11 11:32:31 +08:00
4839ee4aca Merge branch 'feature-GHZS-43' into 'dev-5.16.0'
feat:【V5.16.0】游戏礼包优化(第三期)—客户端 https://jira.shanqu.cc/browse/GHZS-43

See merge request halo/android/assistant-android!428
2022-11-11 11:00:28 +08:00
115dc8ffab feat:【V5.16.0】游戏礼包优化(第三期)—客户端 https://jira.shanqu.cc/browse/GHZS-43 2022-11-10 18:03:51 +08:00
e174c882e6 Merge branch 'feature-GHZS-128' into 'dev-5.16.0'
feat: 【V5.16.0】多版本下载面板-求版本优化—客户端 https://jira.shanqu.cc/browse/GHZS-128

See merge request halo/android/assistant-android!427
2022-11-10 16:17:21 +08:00
546f7fc122 feat: 【V5.16.0】多版本下载面板-求版本优化—客户端 https://jira.shanqu.cc/browse/GHZS-128 2022-11-10 16:00:30 +08:00
900ee8e641 chore:版本更新至 5.13.6 2022-11-10 15:14:16 +08:00
bad1e32fda Merge branch 'feature-GHZS-163' into 'legacy-release'
feat:【光环助手】存储权限授权弹窗埋点补充 https://jira.shanqu.cc/browse/GHZS-163

See merge request halo/android/assistant-android!426
2022-11-10 15:11:40 +08:00
b602960882 feat:【光环助手】存储权限授权弹窗埋点补充 https://jira.shanqu.cc/browse/GHZS-163 2022-11-10 15:05:05 +08:00
6be3798b36 Merge branch 'feature-GHZS-116' into 'dev'
fix:【光环助手V5.15.0同步正式问题】登录闪退 https://jira.shanqu.cc/browse/GHZS-116

See merge request halo/android/assistant-android!424
2022-11-10 12:11:21 +08:00
5cf7ab8159 Merge branch 'dev-fix-vector_crash' into 'dev'
fix: 修复5.0以下系统矢量图的闪退问题

See merge request halo/android/assistant-android!425
2022-11-10 11:00:43 +08:00
1e7c56221a fix: 修复5.0以下系统矢量图的闪退问题 2022-11-10 10:52:09 +08:00
73a473b1c1 Merge branch 'feature-GHZS-16' into 'dev-5.16.0'
feat: 【V5.16.0】启动广告图—客户端 https://jira.shanqu.cc/browse/GHZS-16

See merge request halo/android/assistant-android!420
2022-11-10 10:25:45 +08:00
258ada53af fix: 启动广告图跳转按钮箭头改为用代码设置 2022-11-10 10:21:52 +08:00
128f0e0e82 feat: 【V5.16.0】启动广告图—客户端 https://jira.shanqu.cc/browse/GHZS-16 2022-11-09 18:00:08 +08:00
424efdafcf fix:【光环助手V5.15.0同步正式问题】登录闪退 https://jira.shanqu.cc/browse/GHZS-116 2022-11-09 17:22:59 +08:00
08e90bf923 Merge branch 'dev-5.16.0' into feature-GHZS-16
# Conflicts:
#	app/src/main/java/com/gh/common/constant/Config.java
2022-11-09 16:53:05 +08:00
60c967808d Merge branch 'dev' into 'dev-5.16.0'
合并dev分支的改动

See merge request halo/android/assistant-android!423
2022-11-09 16:43:45 +08:00
44b776a156 Merge branch 'fixes-from-release' into 'dev'
合并 release 分支的改动

See merge request halo/android/assistant-android!422
2022-11-09 16:26:24 +08:00
b17fa55f94 fix: 处理合并冲突 2022-11-09 16:06:23 +08:00
5d1bc4aedd Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/constant/Config.java
#	app/src/main/java/com/gh/gamecenter/entity/NewSettingsEntity.kt
#	dependencies.gradle
#	module_common/src/main/java/com/gh/gamecenter/common/utils/Extensions.kt
2022-11-09 15:07:15 +08:00
b5c265e0d6 Merge branch 'feature-module_setting' into 'dev-5.16.0'
refactor: 组件化设置功能 https://git.shanqu.cc/halo/android/assistant-android/-/issues/87

See merge request halo/android/assistant-android!411
2022-11-09 14:35:41 +08:00
5b266c91da refactor: 组件化设置功能 https://git.shanqu.cc/halo/android/assistant-android/-/issues/87 2022-11-09 14:35:41 +08:00
fadd165e68 Merge branch 'hotfix-v5.14.3-633-setting_datas_error' into 'release'
fix: 修改设置接口数据保存错误问题

See merge request halo/android/assistant-android!421
2022-11-09 14:34:50 +08:00
255b6ea141 fix: 修改设置接口数据保存错误问题 2022-11-09 13:46:20 +08:00
7712039804 chore: 版本更新至 5.14.3 2022-11-08 15:15:57 +08:00
fee65172d1 Merge branch 'hotfix-v5.14.2-632-delete_apk_crash' into 'release'
fix: 捕抓清理安装包时的 concurrent 异常

See merge request halo/android/assistant-android!419
2022-11-08 15:13:36 +08:00
89846e04f3 Merge branch 'dev-5.16.0' into feature-GHZS-16 2022-11-08 15:07:00 +08:00
b09f0cde18 fix: 捕抓清理安装包时的 concurrent 异常 2022-11-08 15:04:12 +08:00
0e16aa7dd4 feat: 【V5.16.0】启动广告图—客户端 https://jira.shanqu.cc/browse/GHZS-16 2022-11-08 15:03:10 +08:00
cb355b2490 Merge branch 'hotfix-v5.14.2-632-wrong_dark_mode_setting' into 'release'
fix: 修复错误的深色模式切换开关配置

See merge request halo/android/assistant-android!418
2022-11-08 12:01:27 +08:00
806ceee7e7 Merge branch 'hotfix-v5.14.2-632-super_did_not_called_crash' into 'release'
fix: 修复因为混淆问题导致 onConfigurationChanged 没有调用 super.onConfigurationChanged 而造成的闪退

See merge request halo/android/assistant-android!417
2022-11-08 11:55:35 +08:00
0cc8904852 fix: 修复错误的深色模式切换开关配置 2022-11-08 11:33:33 +08:00
1ffb58feea fix: 修复因为混淆问题导致 onConfigurationChanged 没有调用 super.onConfigurationChanged 而造成的闪退 2022-11-08 11:09:32 +08:00
b0ad6ff8c5 chore: 版本更新至 5.16.0 2022-11-08 10:37:46 +08:00
ccbe6650d1 Merge branch 'feature-GHZS-28' into 'dev-5.16.0'
feat:【V5.16.0】游戏广告管理功能(前端部分)—客户端 https://jira.shanqu.cc/browse/GHZS-28

See merge request halo/android/assistant-android!416
2022-11-08 10:14:18 +08:00
f99b3af9c6 feat:【V5.16.0】游戏广告管理功能(前端部分)—客户端 https://jira.shanqu.cc/browse/GHZS-28 2022-11-08 10:14:18 +08:00
e80c8d76cd Merge branch 'dev-fix-issues2125-gt' into 'dev'
fix:修复模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-122

See merge request halo/android/assistant-android!415
2022-11-08 09:26:58 +08:00
f47b0326f4 fix:修复模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-122 2022-11-08 09:26:58 +08:00
a5ce8f389c Merge branch 'feature-GHZS-55' into 'dev-5.16.0'
feat:【V5.16.0】游戏搜索-热门榜单功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-55

See merge request halo/android/assistant-android!414
2022-11-08 09:19:55 +08:00
8f5daed7a7 feat:【V5.16.0】游戏搜索-热门榜单功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-55 2022-11-08 09:19:55 +08:00
a1aada02d6 Merge branch 'dev-fix-issues2125-gt' into 'dev'
光环助手V5.15.0同步正式问题】游戏卡片UI问题

See merge request halo/android/assistant-android!413
2022-11-07 16:19:54 +08:00
659469aabc 光环助手V5.15.0同步正式问题】游戏卡片UI问题 2022-11-07 16:19:54 +08:00
9ee743c14f Merge branch 'feature-issues91' into 'dev'
清理冗余无用资源

See merge request halo/android/assistant-android!412
2022-11-03 16:34:17 +08:00
8be8430543 fix: 清理冗余无用资源 #91 2022-11-03 16:32:00 +08:00
de2c0dc0c3 fix: 清理冗余无用资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/91 2022-11-03 14:03:32 +08:00
e961642cf7 fix: 清理冗余无用资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/91 2022-11-03 10:51:57 +08:00
fb8bd8b440 Merge branch 'fix-ci-chucker' into 'dev'
ci: 更新含 chucker 的编译脚本

See merge request halo/android/assistant-android!410
2022-11-02 17:29:30 +08:00
ed19677568 ci: 更新含 chucker 的编译脚本 2022-11-02 17:12:48 +08:00
c4cf232d35 fix: 清理冗余无用资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/91 2022-11-02 16:35:37 +08:00
5fe552ad91 fix:清理无用资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/91 2022-11-02 16:20:46 +08:00
1db87a4152 Merge branch 'dev-fix-compress_resource' into 'dev'
fix:压缩我的光环背景资源

See merge request halo/android/assistant-android!409
2022-11-02 16:16:33 +08:00
1bd741be9c fix:压缩我的光环背景资源 2022-11-02 15:28:10 +08:00
7570e3e14e Merge branch 'feature-issues89' into 'dev'
refactor: 移除废弃的旧问答相关代码和资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/89

See merge request halo/android/assistant-android!408
2022-11-02 11:29:04 +08:00
ca009fb1b2 refactor: 移除废弃的旧问答相关代码和资源 https://git.shanqu.cc/halo/android/assistant-android/-/issues/89 2022-11-02 11:29:04 +08:00
872ac7bb85 Merge branch 'feature-issuess81' into 'dev'
feat:数据解析异常以 toast 形式抛出 https://git.shanqu.cc/halo/android/assistant-android/-/issues/81

See merge request halo/android/assistant-android!400
2022-11-02 10:53:42 +08:00
8ce13fd0db feat:数据解析异常以 toast 形式抛出 https://git.shanqu.cc/halo/android/assistant-android/-/issues/81 2022-11-02 10:53:42 +08:00
3ae27ebdb6 chore: 版本更新至 5.14.2 2022-11-01 17:20:30 +08:00
aab422662a Merge branch 'hotfix-v5.14.1-631-onConfigurationChanged' into 'release'
fix: 添加 onConfigurationChanged 日志辅助闪退确定问题

See merge request halo/android/assistant-android!407
2022-11-01 17:19:23 +08:00
bb80862d19 Merge branch 'feature-issues83' into 'dev'
refactor: 整理接口 timestamp 相关的内容 https://git.shanqu.cc/halo/android/assistant-android/-/issues/83

See merge request halo/android/assistant-android!405
2022-11-01 17:09:27 +08:00
02eea04cdc Merge branch 'dev-fix-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1101测试问题:3) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!406
2022-11-01 17:05:21 +08:00
133b3aec96 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1101测试问题:3) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-11-01 17:01:10 +08:00
4b974e3278 refactor: 整理接口 timestamp 相关的内容 https://git.shanqu.cc/halo/android/assistant-android/-/issues/83 2022-11-01 16:33:14 +08:00
8193b9ec9f fix: 添加 onConfigurationChanged 日志辅助闪退确定问题 2022-11-01 16:23:54 +08:00
13929f4dc5 Merge branch 'hotfix-v5.14.1-631-webview_dark_error' into 'release'
fix: 修复web页面开启夜间模式闪退问题

See merge request halo/android/assistant-android!404
2022-11-01 16:18:12 +08:00
0ea0834140 fix: 修复web页面开启夜间模式闪退问题 2022-11-01 16:09:05 +08:00
927e0e2468 Merge branch 'dev-fix-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题:5) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!403
2022-11-01 15:25:23 +08:00
be3d509c9c fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题:5) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-11-01 15:20:31 +08:00
40bd4a1adf Merge branch 'dev-fix-issues2065' into 'dev'
fix: 修复猜你喜欢-发现页骨架屏显示异常

See merge request halo/android/assistant-android!402
2022-11-01 11:53:25 +08:00
b6bb3bf794 fix: 修复猜你喜欢-发现页骨架屏显示异常 2022-11-01 11:05:01 +08:00
ef6ef5c584 Merge branch 'dev-fix-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题3,4) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!401
2022-11-01 10:15:24 +08:00
a600a9f0b0 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题3,4) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-11-01 10:12:10 +08:00
31d0ce1302 Merge branch 'feature-issues2065' into 'dev'
fix:【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试:15(3)) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!399
2022-10-31 21:03:38 +08:00
bffa36bc5d fix:【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试:15(3)) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 20:49:31 +08:00
716a32a2b5 Merge branch 'feature-issues2065' into 'dev'
fix:【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!395
2022-10-31 19:56:42 +08:00
70c09648a8 fix: 规范修改 2022-10-31 19:55:44 +08:00
a7cdade878 Merge branch 'dev' into feature-issues2065 2022-10-31 19:38:43 +08:00
b479048a87 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试问题复测:1,2,12) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 19:38:05 +08:00
714d975602 Merge branch 'dev_merge_release' into 'dev'
合并 5.14.X 发布分支的问题修复

See merge request halo/android/assistant-android!398
2022-10-31 19:35:51 +08:00
a363090e4e Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/qa/answer/BaseAnswerOrArticleItemViewHolder.kt
#	app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameViewModel.kt
#	dependencies.gradle
2022-10-31 19:24:55 +08:00
f07b37ff01 Merge branch 'fix-user-home-paging' into 'dev'
fix: 修复用户主页的用户历史列表分页问题

See merge request halo/android/assistant-android!396
2022-10-31 19:16:55 +08:00
d0efdccb1d fix: 修复用户主页的用户历史列表分页问题 2022-10-31 19:07:59 +08:00
7efdb5e432 Merge branch 'hotfix-v5.14.1-631-simulator_sync_error' into 'release'
fix: 修复模拟器游戏列表可能出现的服务端为空,本地不为空的问题

See merge request halo/android/assistant-android!393
2022-10-31 18:51:40 +08:00
e5d73e5c73 fix:【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试:14) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 17:23:27 +08:00
e2f5de67a7 Merge branch 'feature-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试:1,2,4,10,12) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!394
2022-10-31 15:57:37 +08:00
c34cacb5d0 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031测试:1,2,4,10,12) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 15:50:22 +08:00
681ba37c4e Merge branch 'hotfix-v5.14.1-631-simulator_sync_error' into 'release'
fix: 修复模拟器游戏列表可能出现的服务端为空,本地不为空的问题

See merge request halo/android/assistant-android!393
2022-10-31 14:23:57 +08:00
d4d71d27ce fix: 修复模拟器游戏列表可能出现的服务端为空,本地不为空的问题 2022-10-31 13:47:10 +08:00
609b2805cc Merge branch 'feature-issues2049' into 'dev'
fix:【光环助手V5.15.0】登录相关优化(埋点事件发生部分变更) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175334

See merge request halo/android/assistant-android!391
2022-10-31 13:37:38 +08:00
987ab1ccc9 Merge branch 'hotfix-v5.14.1-631-clean_apk_crash' into 'release'
修复清理 APK 时因为原图标过大导致的闪退

See merge request halo/android/assistant-android!392
2022-10-31 12:41:56 +08:00
93a77df0dc fix:【光环助手V5.15.0】登录相关优化(埋点事件发生部分变更) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175334 2022-10-31 11:42:01 +08:00
e1c365ffe5 Merge branch 'dev-fix-issues2132-lyr' into 'dev'
fix:【光环助手V5.15.0】前端优化汇总10月第3周(8) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2132

See merge request halo/android/assistant-android!389
2022-10-31 11:41:50 +08:00
8863b02c7a fix: 修复安装包清理遇到原始图标过大而造成的闪退问题 2022-10-31 11:41:02 +08:00
89b97d274b Merge branch 'feature-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题1,2)

See merge request halo/android/assistant-android!390
2022-10-31 11:34:41 +08:00
bbe3f9c741 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1031UI测试问题1,2) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 11:28:22 +08:00
e7d0c15a0a fix:【光环助手V5.15.0】前端优化汇总10月第3周(8) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2132 2022-10-31 10:38:31 +08:00
ddfb474624 Merge branch 'feature-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1028测试) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!388
2022-10-31 10:18:02 +08:00
b15b8c1237 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1028测试) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-31 10:11:58 +08:00
0af8660b14 Merge branch 'feature-issues2065' into 'dev'
fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1028测试:5) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!387
2022-10-28 17:53:14 +08:00
4ea2f8d5af fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(1028测试:5) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-28 17:49:28 +08:00
66c727c874 Merge branch 'dev-fix-issues2125-gt' into 'dev'
fix:去除模拟器游戏合集TextView的默认内边距

See merge request halo/android/assistant-android!386
2022-10-28 16:53:02 +08:00
619abb9805 fix:去除模拟器游戏合集TextView的默认内边距 2022-10-28 16:53:02 +08:00
a94bb4dcb5 fix: 修复模拟器运行即闪退的问题 2022-10-28 16:22:29 +08:00
195d9343eb chore: 版本更新至 5.14.1 2022-10-28 15:45:09 +08:00
5a847970b2 Merge branch 'dev-fix-issues2125-gt' into 'dev'
fix:修复模拟器下载流程20221027测试反馈  https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2125

See merge request halo/android/assistant-android!385
2022-10-28 15:43:29 +08:00
ccd70b6087 fix:修复模拟器下载流程20221027测试反馈 https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2125 2022-10-28 15:43:29 +08:00
bd9fea1551 Merge branch 'dev-fix-issues2114-zyj' into 'dev'
fix: 【光环助手V5.15.0】前端优化汇总10月第1周(1025测试:第2点(2))

See merge request halo/android/assistant-android!384
2022-10-28 15:07:09 +08:00
f8c7bf5f64 Merge branch 'dev' into dev-fix-issues2114-zyj 2022-10-28 15:02:53 +08:00
7b71adc3fa Merge branch 'dev-fix-issues2132-yzw' into 'dev'
fix:【光环助手V5.15.0】前端优化汇总10月第3周(7)(修改分隔线实现方式)

See merge request halo/android/assistant-android!383
2022-10-28 14:56:31 +08:00
1882707e56 fix:【光环助手V5.15.0】前端优化汇总10月第3周(7)(修改分隔线实现方式) 2022-10-28 14:56:31 +08:00
49cafeb8bd fix: 【光环助手V5.15.0】前端优化汇总10月第1周(1025测试:第2点(2)) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2114 2022-10-28 14:52:31 +08:00
072cf65af4 Merge branch 'fix-emulator_crash' into 'dev'
fix: 修复模拟器运行即闪退的问题

See merge request halo/android/assistant-android!381
2022-10-28 11:41:17 +08:00
2f7277e410 fix: 修复模拟器运行即闪退的问题 2022-10-28 11:11:36 +08:00
f10a88a5a4 Merge branch 'feature-issues2049' into 'dev'
fix:【光环助手V5.15.0】前端优化汇总10月第2周(1024UI测试问题-第6点补充问题) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175728

See merge request halo/android/assistant-android!380
2022-10-28 11:00:13 +08:00
45b5030ab5 fix:【光环助手V5.15.0】前端优化汇总10月第2周(1024UI测试问题-第6点补充问题) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175728 2022-10-28 10:59:08 +08:00
fa35d98d5b Merge branch 'feature-issues2049' into 'dev'
fix:【光环助手V5.15.0】前端优化汇总10月第2周(1024UI测试问题-遗留第6点) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2121#note_175635

See merge request halo/android/assistant-android!379
2022-10-28 10:29:51 +08:00
d4e79a7b47 fix:【光环助手V5.15.0】前端优化汇总10月第2周(1024UI测试问题-遗留第6点) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2121#note_175635 2022-10-28 10:28:59 +08:00
d9fb9bcc2f Merge branch 'feature-issues2121' into 'dev'
fix:【光环助手V5.15.0】前端优化汇总10月第2周(发布手机埋点统一添加前缀publish_) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2121#note_175635

See merge request halo/android/assistant-android!377
2022-10-28 09:37:19 +08:00
13f7ca9f7d Merge branch 'dev-fix-issues2114-zyj' into 'dev'
fix: 【光环助手V5.15.0】前端优化汇总10月第1周(1025测试:第2点(1)(2))...

See merge request halo/android/assistant-android!378
2022-10-28 09:17:17 +08:00
cabe3055cb Merge branch 'dev' into dev-fix-issues2114-zyj 2022-10-27 20:46:38 +08:00
64e45521a6 fix: 【光环助手V5.15.0】前端优化汇总10月第1周(1025测试:第2点(1)(2)) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2114 2022-10-27 20:44:43 +08:00
b6d035f3a9 fix:【光环助手V5.15.0】前端优化汇总10月第2周(发布手机埋点统一添加前缀publish_) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2121#note_175635 2022-10-27 17:55:14 +08:00
313ed74939 Merge branch 'feature-issues2049' into 'dev'
fix:【光环助手V5.15.0】登录相关优化(1027UI测试问题) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175516

See merge request halo/android/assistant-android!376
2022-10-27 17:49:54 +08:00
c79e5edc7a fix:【光环助手V5.15.0】登录相关优化(1027UI测试问题) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2049#note_175516 2022-10-27 17:47:44 +08:00
b4ccdcb8fa Merge branch 'feature-update_chucker' into 'dev'
build: 将 chucker 依赖从 jitpack 搬回自有 nexus

See merge request halo/android/assistant-android!375
2022-10-27 17:45:17 +08:00
1ed50c2626 build: 将 chucker 依赖从 jitpack 搬回自有 nexus 2022-10-27 17:35:22 +08:00
7ad6395bab Merge branch 'feature-issues2065' into 'dev'
feat: 【光环助手V5.15.0】新增 猜你喜欢-发现页 https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065

See merge request halo/android/assistant-android!374
2022-10-27 17:04:43 +08:00
28d2a9442c fix: 规范修改 2022-10-27 16:38:15 +08:00
997bfdf93d Merge branch 'hotfix-v5.14.0-630-vector_crash' into 'release'
fix:修复5.0以下系统部分矢量图加载出错导致无法显示的问题

See merge request halo/android/assistant-android!373
2022-10-27 15:34:53 +08:00
8eceb571ca Merge branch 'dev' into feature-issues2065
# Conflicts:
#	app/src/main/java/com/gh/common/util/NewFlatLogUtils.kt
2022-10-27 15:27:02 +08:00
68f8619d09 feat: 【光环助手V5.15.0】新增 猜你喜欢-发现页(数据埋点) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-27 15:06:30 +08:00
de712065f5 Merge branch 'hotfix-v5.14.0-630-soft_keyboard' into 'release'
fix: 修复评论页面发表评论内容跳转登录页面返回时软键盘消失的问题

See merge request halo/android/assistant-android!372
2022-10-27 14:56:33 +08:00
511449c709 fix:修复5.0以下系统部分矢量图加载出错导致无法显示的问题 2022-10-27 14:50:24 +08:00
e79d5d1dfb Merge branch 'feature-issues2125' into 'dev'
feat: 模拟器下载流程调整 https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2125

See merge request halo/android/assistant-android!368
2022-10-27 14:40:07 +08:00
da8717693d feat: 模拟器下载流程调整 https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2125 2022-10-27 14:40:06 +08:00
03095b682b fix: 修复评论页面发表评论内容跳转登录页面返回时软键盘消失的问题 2022-10-27 14:32:48 +08:00
8437bfe1e3 Merge branch 'hotfix-v5.14.0-630-soft_keyboard' into 'release'
fix: 修复评论页面发表评论内容跳转登录页面返回时软键盘消失的问题

See merge request halo/android/assistant-android!369
2022-10-27 11:34:54 +08:00
a169ce1989 fix: 修复评论页面发表评论内容跳转登录页面返回时软键盘消失的问题 2022-10-27 10:48:14 +08:00
c327fcaf99 fix: 【光环助手V5.15.0】新增 猜你喜欢-发现页(UI优化) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-26 17:05:51 +08:00
b032f054f9 feat: 【光环助手V5.15.0】新增 猜你喜欢-发现页(完成UI、接口对接) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2065 2022-10-26 12:06:00 +08:00
9690429e95 Merge branch 'hotfix-v5.14.0-630-banned_vote_error' into 'release'
【光环助手V5.15.0】违规整合-正式环境运营验收问题(19) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2129

See merge request halo/android/assistant-android!367
2022-10-25 16:58:08 +08:00
b1dff15234 fix: 【光环助手V5.15.0】违规整合-正式环境运营验收问题(19) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2129 2022-10-25 15:45:48 +08:00
868 changed files with 20418 additions and 10647 deletions

3
.gitmodules vendored
View File

@ -8,3 +8,6 @@
[submodule "module_common/src/debug/assets/assistant-android-mock"]
path = module_common/src/debug/assets/assistant-android-mock
url = git@git.shanqu.cc:halo/android/assistant-android-mock.git
[submodule "ndownload"]
path = ndownload
url = git@git.shanqu.cc:android/ndownload.git

View File

@ -260,6 +260,7 @@ dependencies {
compileOnly "com.github.axen1314.lancet:lancet-base:${lancet_version}"
kapt "com.alibaba:arouter-compiler:$arouterVersion"
implementation project(':ndownload')
implementation project(':vspace-bridge:vspace')
implementation (project(':module_common')) {
@ -268,6 +269,9 @@ dependencies {
implementation(project(':module_login')) {
exclude group: 'androidx.swiperefreshlayout'
}
implementation(project(':module_setting')) {
exclude group: 'androidx.swiperefreshlayout'
}
// 默认不接入光能模块,提高编译速度
// debugImplementation(project(':module_energy')) {
// exclude group: 'androidx.swiperefreshlayout'
@ -391,7 +395,6 @@ andResGuard {
"R.drawable.suggest_type_function_suggest",
"R.drawable.suggest_type_article_collect",
"R.drawable.suggest_type_copyright",
"R.drawable.help_result_empty",
"R.drawable.news_comment_detail_read",
"R.drawable.news_comment_detail_comment",
"R.drawable.news_comment_detail_share",

View File

@ -1,14 +1,16 @@
package com.gh.gamecenter.provider
import android.app.Activity
import android.app.Application
import android.text.TextUtils
import com.gh.gamecenter.common.constant.Config
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.core.provider.IFlavorProvider
import com.gh.gamecenter.core.utils.SPUtils
import com.leon.channel.helper.ChannelReaderUtil
class ChannelProviderImp : ChannelProvider {
class FlavorProviderImp : IFlavorProvider {
override fun getChannelStr(application: Application): String {
var channel = ChannelReaderUtil.getChannel(application)
if (channel == null || TextUtils.isEmpty(channel.trim())) {
@ -23,4 +25,12 @@ class ChannelProviderImp : ChannelProvider {
}
return channel
}
override fun init(application: Application, activity: Activity) {
// do nothing
}
override fun logEvent(content: String) {
// do nothing
}
}

View File

@ -6,6 +6,11 @@
<queries>
<package android:name="com.gh.gamecenter" />
</queries>
<queries>
<package android:name="com.lg.vspace" />
</queries>
<!-- 允许应用程序访问网络连接 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 允许应用程序写入外部存储如SD卡上写文件 -->
@ -148,10 +153,6 @@
android:name="com.gh.gamecenter.NewsDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.SettingActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.ConcernActivity"
android:screenOrientation="portrait" />
@ -219,18 +220,6 @@
android:name="com.gh.gamecenter.SelectUserIconActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.AboutActivity"
android:screenOrientation="portrait" />
<activity
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"
@ -344,10 +333,6 @@
android:name="com.gh.gamecenter.amway.AmwayActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.NetworkDiagnosisActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.personalhome.fans.FansActivity"
android:screenOrientation="portrait" />
@ -586,14 +571,6 @@
android:name=".qa.video.publish.VideoPublishActivity"
android:screenOrientation="portrait" />
<activity
android:name=".setting.GameDownloadSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".setting.VideoSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".qa.video.detail.ForumVideoDetailActivity"
android:screenOrientation="portrait" />
@ -733,6 +710,23 @@
android:name=".BbsCertificationActivity"
android:screenOrientation="portrait" />
<activity
android:name=".discovery.DiscoveryActivity"
android:screenOrientation="portrait" />
<activity
android:name=".cloudarchive.CloudArchiveManagerActivity"
android:screenOrientation="portrait" />
<activity
android:name=".savegame.GameArchiveListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".discovery.interestedgame.InterestedGameActivity"
android:screenOrientation="portrait" />
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->
<!-- android:launchMode="singleTask"-->
@ -755,6 +749,26 @@
android:enabled="true"
android:exported="true" />
<provider
android:name="com.gh.vspace.VFileProvider"
android:authorities="${applicationId}.virtual_file_provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<service
android:name=".aidl.CommunicationService"
android:enabled="true"
android:exported="true" >
<intent-filter>
<action android:name="com.gh.gamecenter.aidl.CommunicationService"/>
</intent-filter>
</service>
<!-- <provider-->
<!-- android:name="androidx.startup.InitializationProvider"-->
<!-- android:authorities="${applicationId}.androidx-startup"-->

View File

@ -0,0 +1 @@
{"v":"5.9.1","fr":60,"ip":0,"op":100,"w":64,"h":64,"nm":"多版本下载提示_dark","ddd":0,"assets":[{"id":"comp_0","nm":"arrow 合成_dark","fr":60,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"arrow","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.333],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":24,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":76,"s":[100]},{"t":100,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.333,"y":1},"o":{"x":0.364,"y":0},"t":0,"s":[28,-12,0],"to":[0,6.382,0],"ti":[0,-0.284,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"t":24,"s":[28,28,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.667,"y":0},"t":76,"s":[28,28,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"t":100,"s":[28,68,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0,2],[0,-2]],"c":false},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-2,0],[0,2]],"c":false},"ix":2},"nm":"路径 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[2,0],[0,2]],"c":false},"ix":2},"nm":"路径 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.333,0.333],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"t":0,"s":[80,120]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":24,"s":[100,100]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":76,"s":[100,100]},{"t":100,"s":[80,120]}],"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":"组 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.156862750649,0.533333361149,0.878431379795,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"stroke","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[400,400],"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":"Vector 97","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":100,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"arrow 合成_dark","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[32,32,0],"ix":2,"l":2},"a":{"a":0,"k":[28,28,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"w":56,"h":56,"ip":0,"op":100,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"base","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[32,32,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[15,15],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.156862750649,0.533333361149,0.878431379795,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"stroke","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0.137254908681,0.137254908681,0.137254908681,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"filling","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":[400,400],"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":"Ellipse 44","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":100,"st":0,"bm":0}],"markers":[]}

View File

@ -0,0 +1 @@
{"v":"5.9.1","fr":60,"ip":0,"op":100,"w":64,"h":64,"nm":"多版本下载提示_light","ddd":0,"assets":[{"id":"comp_0","nm":"arrow 合成_light","fr":60,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"arrow","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.333],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":24,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":76,"s":[100]},{"t":100,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.333,"y":1},"o":{"x":0.364,"y":0},"t":0,"s":[28,-12,0],"to":[0,6.382,0],"ti":[0,-0.284,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.333,"y":0.333},"t":24,"s":[28,28,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.667,"y":0},"t":76,"s":[28,28,0],"to":[0,6.667,0],"ti":[0,-6.667,0]},{"t":100,"s":[28,68,0]}],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[0,2],[0,-2]],"c":false},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-2,0],[0,2]],"c":false},"ix":2},"nm":"路径 2","mn":"ADBE Vector Shape - Group","hd":false},{"ind":2,"ty":"sh","ix":3,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[2,0],[0,2]],"c":false},"ix":2},"nm":"路径 3","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.333,0.333],"y":[1,1]},"o":{"x":[0.333,0.333],"y":[0,0]},"t":0,"s":[80,120]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":24,"s":[100,100]},{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":76,"s":[100,100]},{"t":100,"s":[80,120]}],"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":"组 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.141176477075,0.588235318661,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"stroke","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[400,400],"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":"Vector 97","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":100,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"arrow 合成_light","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[32,32,0],"ix":2,"l":2},"a":{"a":0,"k":[28,28,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"w":56,"h":56,"ip":0,"op":100,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"base","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[32,32,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[15,15],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.141176477075,0.588235318661,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":1,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"stroke","mn":"ADBE Vector Graphic - Stroke","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":"filling","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":[400,400],"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":"Ellipse 44","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":100,"st":0,"bm":0}],"markers":[]}

View File

@ -1 +0,0 @@
{"v":"5.6.9","fr":60,"ip":0,"op":36,"w":120,"h":66,"nm":"开关动画-关闭","ddd":0,"assets":[],"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":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.667,"y":0},"t":0,"s":[87,33,0],"to":[7.682,0,0],"ti":[-13.443,0,0]},{"i":{"x":0.333,"y":1},"o":{"x":0.333,"y":0},"t":18,"s":[31,33,0],"to":[2.306,0,0],"ti":[-1.318,0,0]},{"t":24,"s":[33,33,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":[{"d":1,"ty":"el","s":{"a":0,"k":[16,16],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","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":37,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"指示器-on","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[100]},{"t":18,"s":[0]}],"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":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":0,"s":[6.5,6.5]},{"t":18,"s":[4.5,4.5]}],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.966666666667,0.966666666667,0.966666666667,0.420000005762],"ix":3},"o":{"a":0,"k":40,"ix":4},"w":{"a":0,"k":1.5,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","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":37,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"指示器-off","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[87,33,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":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":0,"s":[1.5,4]},{"t":18,"s":[1.5,6]}],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0.75,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":5,"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":90,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[0]},{"t":18,"s":[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":37,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"按钮背景","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[60,33,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"sy":[{"c":{"a":0,"k":[0,0,0,1],"ix":2},"o":{"a":0,"k":5,"ix":3},"a":{"a":0,"k":120,"ix":5},"s":{"a":0,"k":1,"ix":8},"d":{"a":0,"k":0,"ix":6},"ch":{"a":0,"k":100,"ix":7},"bm":{"a":0,"k":5,"ix":1},"no":{"a":0,"k":0,"ix":9},"ty":2,"nm":"内阴影"}],"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[40,22],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[0.141176477075,0.588235318661,1,1]},{"t":18,"s":[0.933333337307,0.933333337307,0.933333337307,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"filling","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0.118,0.006],"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":37,"st":0,"bm":0}],"markers":[]}

View File

@ -473,14 +473,14 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
private fun chooseImage() {
MtaHelper.onEvent(mtaEventName(), "插入图片", "插入图片")
val imageCount = mViewModel.quoteCountEntity.imageCount
if (imageCount >= MAX_MEDIA_COUNT) {
if (imageCount >= MAX_IMAGE_COUNT) {
toast(R.string.answer_edit_max_img_hint)
return
}
try {
PermissionHelper.checkStoragePermissionBeforeAction(this, object : EmptyCallback {
override fun onCallback() {
val maxChooseCount = if (imageCount + 10 <= MAX_MEDIA_COUNT) 10 else MAX_MEDIA_COUNT - imageCount
val maxChooseCount = if (imageCount + 10 <= MAX_IMAGE_COUNT) 10 else MAX_IMAGE_COUNT - imageCount
val intent = LocalMediaActivity.getIntent(
this@BaseRichEditorActivity,
LocalMediaActivity.ChooseType.IMAGE,
@ -770,6 +770,7 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
const val INSERT_VIDEO_CODE = 415
const val MAX_INPUT_TEXT_NUM = 10000
const val MAX_MEDIA_COUNT = 20
const val MAX_IMAGE_COUNT = 35
const val REQUEST_CODE_IMAGE = 120
const val INSERT_MEDIA_VIDEO_CODE = 121

View File

@ -9,16 +9,17 @@ import android.text.TextUtils
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.MutableLiveData
import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.ErrorEntity
import com.gh.gamecenter.entity.LocalVideoEntity
import com.gh.gamecenter.entity.QuoteCountEntity
import com.gh.gamecenter.qa.BbsType
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.retrofit.service.ApiService
import com.gh.gamecenter.video.upload.OnUploadListener
@ -32,20 +33,12 @@ import okhttp3.ResponseBody
import retrofit2.HttpException
import java.io.File
import java.io.FileOutputStream
import java.util.*
import kotlin.collections.HashMap
import kotlin.collections.LinkedHashMap
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.find
import kotlin.collections.forEach
import kotlin.collections.set
// TODO: 移动到module_bbs模块
abstract class BaseRichEditorViewModel(application: Application) : AndroidViewModel(application) {
val mApi: ApiService = RetrofitManager.getInstance().api
val processDialog = MediatorLiveData<WaitingDialogFragment.WaitingDialogData>()
val uploadingImage = ArrayList<LinkedHashMap<String, String>>()
val chooseImagesUpload = MutableLiveData<LinkedHashMap<String, String>>()
val chooseImagesUploadSuccess = MutableLiveData<LinkedHashMap<String, String>>()
var uploadImageSubscription: Disposable? = null
@ -70,7 +63,10 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
//检查图片是否符合规则并上传图片
fun uploadPic(data: Intent) {
val uris = Matisse.obtainResult(data)
val pictureList = ArrayList<String>()
val rawImgUrlList = ArrayList<String>() // 需要上传图片的原始地址列表
val uploadingImgList = ArrayList<String>() // 正在上传图片的地址列表(已压缩处理)
val compressedImgUrlList = ArrayList<String>() // 压缩处理后图片的地址列表
for (uri in uris) {
val picturePath = PathUtils.getPath(getApplication(), uri)
if (picturePath != null) {
@ -84,12 +80,12 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
continue
}
Utils.log("picturePath = $picturePath")
pictureList.add(picturePath)
rawImgUrlList.add(picturePath)
} else {
Utils.log("picturePath is null")
}
}
if (pictureList.size == 0) return
if (rawImgUrlList.size == 0) return
val imageType = when (getRichType()) {
RichType.ARTICLE -> UploadImageUtils.UploadType.community_article
RichType.QUESTION -> UploadImageUtils.UploadType.question
@ -97,7 +93,7 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
}
uploadImageSubscription = UploadImageUtils.compressAndUploadImageList(
imageType,
pictureList,
rawImgUrlList,
false,
object : UploadImageUtils.OnUploadImageListListener {
override fun onProgress(total: Long, progress: Long) {}
@ -107,87 +103,108 @@ abstract class BaseRichEditorViewModel(application: Application) : AndroidViewMo
imageUrls.forEach {
chooseImageMd5Map[MD5Utils.getUrlMD5(it)] = ""
}
uploadingImage.add(chooseImageMd5Map)
uploadingImgList.addAll(imageUrls)
compressedImgUrlList.addAll(imageUrls)
chooseImagesUpload.postValue(chooseImageMd5Map)
}
override fun onSingleSuccess(imageUrl: Map<String, String>) {
val map = LinkedHashMap<String, String>()
for (key in imageUrl.keys) {
map[MD5Utils.getUrlMD5(key)] = FILE_HOST + key.decodeURI()
mapImages[TextUtils.htmlEncode(key).decodeURI()] = imageUrl[key] ?: ""
override fun onSingleSuccess(imageUrlMap: Map<String, String>) {
imageUrlMap.forEach {
if (uploadingImgList.contains(it.key)) {
uploadingImgList.remove(it.key)
}
}
chooseImagesUploadSuccess.postValue(map)
val map = LinkedHashMap<String, String>()
for (key in imageUrlMap.keys) {
map[MD5Utils.getUrlMD5(key)] = FILE_HOST + key.decodeURI()
mapImages[TextUtils.htmlEncode(key).decodeURI()] = imageUrlMap[key] ?: ""
}
chooseImagesUploadSuccess.value = map
}
override fun onSuccess(
imageUrl: LinkedHashMap<String, String>,
errorMap: Map<String, Exception>
) {
val uploadMap = uploadingImage.find {
it.containsKey(
MD5Utils.getUrlMD5(
imageUrl.entries.iterator().next().key
)
)
}
uploadMap?.let {
uploadingImage.remove(uploadMap)
}
val errorSize = pictureList.size - imageUrl.size
if (errorSize > 0) {
val map = LinkedHashMap<String, String>()
for (key in errorMap.keys) {
map[MD5Utils.getUrlMD5(key)] = ""
override fun onSuccess(imageUrlMap: LinkedHashMap<String, String>, errorMap: Map<String, Exception>) {
imageUrlMap.forEach {
if (uploadingImgList.contains(it.key)) {
uploadingImgList.remove(it.key)
}
//value为空会删除PlaceholderImage
chooseImagesUploadSuccess.postValue(map)
}
for (error in errorMap.values) {
if (error is HttpException && error.code() == 403) {
Utils.toast(getApplication(), errorSize.toString() + "张违规图片上传失败")
return
var errorSize = compressedImgUrlList.size - imageUrlMap.size
if (errorSize > 0 || uploadingImgList.isNotEmpty()) {
val errorImageMap = LinkedHashMap<String, String>()
for (key in errorMap.keys) {
errorImageMap[MD5Utils.getUrlMD5(key)] = ""
}
for (rawImgUrl in compressedImgUrlList) {
if (!imageUrlMap.containsKey(rawImgUrl)) {
errorImageMap[MD5Utils.getUrlMD5(rawImgUrl)] = ""
}
}
Utils.toast(getApplication(), errorSize.toString() + "张图片上传失败")
errorSize = if (errorMap.isEmpty()) {
errorImageMap.size
} else {
errorMap.size + errorImageMap.size
}
// value为空会删除PlaceholderImage
chooseImagesUploadSuccess.value = errorImageMap
if (handleUploadError(errorSize, errorMap)) return
if (errorSize > 0) {
ToastUtils.showToast(errorSize.toString() + "张图片上传失败")
}
}
}
override fun onError(errorMap: Map<String, Exception>) {
val errorSize = errorMap.size
if (errorSize > 0) {
val errorSize = uploadingImgList.size
if (uploadingImgList.size > 0) {
val map = LinkedHashMap<String, String>()
for (key in errorMap.keys) {
for (key in uploadingImgList) {
map[MD5Utils.getUrlMD5(key)] = ""
}
//value为空会删除PlaceholderImage
chooseImagesUploadSuccess.postValue(map)
// value为空会删除PlaceholderImage
chooseImagesUploadSuccess.value = map
}
for (error in errorMap.values) {
if (error is HttpException && error.code() == 403) {
val e = error.response()?.errorBody()?.string()?.toObject<ErrorEntity>()
if (e != null && e.code == 403017) {
Utils.toast(
getApplication(),
errorSize.toString() + "张图片的宽或高超过限制,请裁剪后上传"
)
} else {
Utils.toast(getApplication(), errorSize.toString() + "张违规图片上传失败")
}
return
}
}
if (handleUploadError(errorSize, errorMap)) return
if (errorSize == 0) return
if (errorSize == 1) {
Utils.toast(getApplication(), "图片上传失败")
ToastUtils.showToast("图片上传失败")
} else {
Utils.toast(getApplication(), errorSize.toString() + "张图片上传失败")
ToastUtils.showToast(errorSize.toString() + "张图片上传失败")
}
}
})
}
/**
* 处理上传错误 (包括超时 cancel 的异常)
* @return 如果 toast 过了就返回 true
*/
private fun handleUploadError(
errorSize: Int,
errorMap: Map<String, Exception>
): Boolean {
for (error in errorMap.values) {
if (error is HttpException && error.code() == 403) {
val e = error.response()?.errorBody()?.string()?.toObject<ErrorEntity>()
if (e != null && e.code == 403017) {
ToastUtils.showToast(errorSize.toString() + "张图片的宽或高超过限制,请裁剪后上传")
} else {
ToastUtils.showToast(errorSize.toString() + "张违规图片上传失败")
}
return true
}
}
return false
}
fun uploadPoster(picturePath: String) {
processDialog.postValue(WaitingDialogFragment.WaitingDialogData("封面上传中...", true))
uploadImageSubscription =

View File

@ -6,14 +6,9 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.util.FloatingBackViewManager
import com.gh.download.DownloadManager
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.SplashScreenActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.forum.detail.ForumDetailActivity
import com.gh.gamecenter.forum.list.ForumListActivity
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
@ -35,7 +30,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_TASK
) {
FloatingBackViewManager.disableBackView()
} else if (!shouldShowActivityBackView(activity)
} else if (activity is WebActivity
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_ACTIVITY
) {
FloatingBackViewManager.disableBackView()
@ -65,15 +60,6 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
}
}
private fun shouldShowActivityBackView(activity: Activity): Boolean {
return (activity is MainActivity
|| activity is ArticleDetailActivity
|| activity is ForumVideoDetailActivity
|| activity is ForumDetailActivity
|| activity is ForumListActivity
|| activity is NewQuestionDetailActivity)
}
override fun onActivityPaused(activity: Activity) {
FloatingBackViewManager.dismissBackView()
if (PackageFlavorHelper.IS_TEST_FLAVOR && activity is AppCompatActivity) {

View File

@ -4,13 +4,20 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.util.Base64
import android.view.View
import android.webkit.JavascriptInterface
import androidx.annotation.Keep
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.gh.common.util.*
import com.gh.common.util.LogUtils
import com.gh.gamecenter.*
import com.gh.download.DownloadManager
import com.gh.download.PackageObserver
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.NotificationUgc
@ -21,23 +28,27 @@ import com.gh.gamecenter.common.view.dsbridge.CompletionHandler
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.MtaEvent
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.help.QaFeedbackDialogFragment
import com.gh.gamecenter.login.entity.Badge
import com.gh.gamecenter.login.user.LoginTag
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.login.user.UserRepository
import com.gh.gamecenter.login.utils.LoginHelper
import com.gh.gamecenter.login.utils.QuickLoginHelper
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.setting.view.AboutActivity
import com.gh.gamecenter.setting.view.security.BindPhoneActivity
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus.*
import com.lightgame.utils.Utils
import org.json.JSONObject
import java.io.BufferedOutputStream
@ -45,9 +56,18 @@ import java.io.File
import java.io.FileOutputStream
import java.util.*
class DefaultJsApi(var context: Context, val entrance: String = "") {
class DefaultJsApi(var context: Context, val entrance: String = "", private var mFragment: Fragment? = null) {
private var mLoginHandler: CompletionHandler<Any>? = null
private var mDownloadWatcher: DataWatcher? = null
private var mDownloadUrlSet: HashSet<String>? = null
private var mDownloadHandler: CompletionHandler<Any>? = null
init {
if (mFragment != null) {
autoUnregisterDownloadObserverIfNeeded(mFragment)
}
}
@JavascriptInterface
fun isGhzs(msg: Any): String {
@ -164,7 +184,16 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
@JavascriptInterface
fun startApp(msg: Any) {
val packageName = msg.toString()
PackageUtils.launchApplicationByPackageName(HaloApp.getInstance().application, packageName)
val context = HaloApp.getInstance().application
// 若畅玩列表中安装了,优先启动畅玩游戏
if (VHelper.isInstalled(packageName)) {
if (!VHelper.showDialogIfVSpaceIsNeeded(context)) {
VHelper.launch(context, packageName)
}
} else {
PackageUtils.launchApplicationByPackageName(context, packageName)
}
}
@JavascriptInterface
@ -436,7 +465,175 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
@JavascriptInterface
fun getEntrance(msg: Any): String {
return entrance
return when {
entrance.contains("论坛-活动") -> "社区-活动tab-活动banner"
entrance.contains("启动弹窗") -> "首页_弹窗"
entrance.contains("新首页-轮播图") -> "首页banner"
entrance.contains("论坛banner") -> "社区banner"
entrance.contains("启动广告") -> "app_开屏文案"
// entrance.contains("资讯广场-轮播图") -> "资讯_活动banner"
entrance.contains("通用链接合集") -> "资讯_活动banner"
entrance.contains("视频流广告位") -> "视频流_广告位"
entrance.contains("我的光环banner") -> "我的光环_banner"
entrance.contains("论坛详情页置顶栏") -> "社区_论坛置顶"
else -> entrance
}
}
@JavascriptInterface
fun getInstallStatus(event: Any): String {
val localInstalledPackageList = PackageUtils.getAllPackageName(HaloApp.getInstance().application)
val packageNameList: ArrayList<String> = event.toString().toObject() ?: ArrayList()
val installStatusMap: HashMap<String, Boolean> = hashMapOf()
for (packageName in packageNameList) {
installStatusMap[packageName] =
localInstalledPackageList.contains(packageName) || VHelper.isInstalled(packageName)
}
return installStatusMap.toJson()
}
@JavascriptInterface
fun installDownloadedGame(event: Any) {
val url = event.toString()
val vUrl = VHelper.getVUrl(url)
val downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(url, null, false)
?: DownloadManager.getInstance().getDownloadEntitySnapshot(vUrl, null, false)
downloadEntity?.let {
PackageInstaller.install(context, it, showUnzipToast = false)
}
}
@JavascriptInterface
fun registerDownloadCallback(msg: Any, handler: CompletionHandler<Any>) {
val downloadUrlSet: HashSet<String> = msg.toString().toObject() ?: return
mDownloadHandler = handler
mDownloadUrlSet = downloadUrlSet
if (mDownloadWatcher == null) {
mDownloadWatcher = object : DataWatcher() {
override fun onDataInit(downloadEntity: DownloadEntity) {
onDataChanged(downloadEntity)
}
override fun onDataChanged(downloadEntity: DownloadEntity?) {
val url = VHelper.getOriginalUrl(downloadEntity?.url)
if (downloadEntity != null) {
if (mDownloadUrlSet?.contains(url) == true) {
mDownloadHandler?.setProgressData(
SimpleDownloadEntity.fromDownloadEntity(downloadEntity).toJson()
)
}
}
}
}
DownloadManager.getInstance().addObserver(mDownloadWatcher)
}
}
@JavascriptInterface
fun registerPackageChangesCallback(msg: Any, handler: CompletionHandler<Any>) {
PackageObserver.registerPackageChangeChangeListener(object : PackageObserver.PackageChangeListener {
override fun onChanged(data: EBPackage) {
handler.setProgressData(data.toJson())
}
})
}
@JavascriptInterface
fun startDownload(msg: Any) {
val gameEntity: GameEntity? = msg.toString().toObject()
if (gameEntity == null) {
ToastUtils.toast("下载异常,请稍后重试")
return
}
runOnUiThread {
// 用一个假的 view 来当 downloadView
val stubView = View(context)
DownloadItemUtils.setOnClickListener(
position = 0,
context = context,
downloadBtn = stubView,
gameEntity = gameEntity,
adapter = null,
entrance = "(网页活动)",
location = "",
traceEvent = null,
clickCallback = null,
refreshCallback = null,
allStateClickCallback = null
)
stubView.performClick()
}
}
@JavascriptInterface
fun resumeDownload(msg: Any) {
val url = msg.toString()
DownloadManager.getInstance().resumeDownload(url)
}
@JavascriptInterface
fun pauseDownload(msg: Any) {
val url = msg.toString()
DownloadManager.getInstance().pause(url)
}
@JavascriptInterface
fun shareText(event: Any) {
val textShareEvent = event.toString().toObject() ?: TextShareEvent()
if (textShareEvent.text.isNotEmpty() && textShareEvent.type.isNotEmpty()) {
val activity = CurrentActivityHolder.getCurrentActivity()
MessageShareUtils.getInstance(activity).shareTextFromWeb(activity, textShareEvent.text, textShareEvent.type)
}
}
private fun autoUnregisterDownloadObserverIfNeeded(fragment: Fragment?) {
fragment?.parentFragmentManager?.registerFragmentLifecycleCallbacks(
object : FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentViewDestroyed(fm: FragmentManager, f: Fragment) {
super.onFragmentViewDestroyed(fm, f)
if (f === fragment) {
fragment.parentFragmentManager.unregisterFragmentLifecycleCallbacks(this)
if (mDownloadWatcher != null) {
DownloadManager.getInstance().removeObserver(mDownloadWatcher)
}
}
}
override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {
super.onFragmentResumed(fm, f)
if (f === fragment) {
if (mDownloadWatcher != null) {
DownloadManager.getInstance().addObserver(mDownloadWatcher)
}
}
}
override fun onFragmentPaused(fm: FragmentManager, f: Fragment) {
super.onFragmentPaused(fm, f)
if (f === fragment) {
if (mDownloadWatcher != null) {
DownloadManager.getInstance().removeObserver(mDownloadWatcher)
}
}
}
}, false
)
}
@Keep
@ -445,6 +642,9 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
@Keep
internal data class ImageShareEvent(var image: String = "", var type: String = "")
@Keep
internal data class TextShareEvent(var text: String = "", var type: String = "")
@Keep
internal data class InviteFriendsEvent(
var type: String = "",
@ -466,4 +666,39 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
var activityId: String = "",
var platform: String = ""
)
@Keep
data class SimpleDownloadEntity(
var url: String = "",
var progress: Float = 0F,
var status: String = "" // DOWNLOADING, PAUSED, DOWNLOADED, ERROR, UNKNOWN
) {
companion object {
fun fromDownloadEntity(downloadEntity: DownloadEntity): SimpleDownloadEntity {
val status: String = when (downloadEntity.status) {
add,
download,
downloading -> "DOWNLOADING"
done -> "DOWNLOADED"
pause,
resume,
subscribe,
waiting -> "PAUSED"
cancel,
delete -> "UNKNOWN"
else -> "ERROR"
}
return SimpleDownloadEntity(
url = VHelper.getOriginalUrl(downloadEntity.url),
progress = downloadEntity.percent.toFloat(),
status = status
)
}
}
}
}

View File

@ -15,25 +15,26 @@ import com.gh.common.util.DirectUtils.directToGameVideo
import com.gh.common.util.DirectUtils.directToLegacyVideoDetail
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.DirectUtils.directToQa
import com.gh.gamecenter.*
import com.gh.gamecenter.core.utils.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.common.constant.EntranceConsts
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.EnvHelper
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBSkip
import com.gh.gamecenter.fragment.MainWrapperFragment
import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity
import com.gh.gamecenter.qa.BbsType
import com.gh.gamecenter.qa.video.publish.VideoPublishActivity
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
import com.lightgame.utils.Utils
import org.greenrobot.eventbus.EventBus
import java.nio.charset.Charset
object DefaultUrlHandler {
@ -185,10 +186,12 @@ object DefaultUrlHandler {
EntranceConsts.HOST_USERHOME -> {
val position = uri.getQueryParameter("position")
val subtype = uri.getQueryParameter("sub_type") ?: ""
val subGameType = uri.getQueryParameter("sub_game_type") ?: "game_collection"
DirectUtils.directToHomeActivity(
context,
id,
subtype,
subGameType,
if (position.isNullOrEmpty()) -1 else position.toInt(),
entrance,
""
@ -490,6 +493,18 @@ object DefaultUrlHandler {
)
}
EntranceConsts.HOST_GAME_LIBRARY -> {
DirectUtils.directToMainActivity(context)
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_GAME))
}
EntranceConsts.HOST_HOME_GAME_COLLECTION_SQUARE -> {
DirectUtils.directToMainActivity(context)
EventBus.getDefault()
.post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_HOME))
EventBus.getDefault().post(EBReuse(host))
}
else -> {
if (bringAppToFront) {
DirectUtils.directToMainActivity(context)

View File

@ -2,14 +2,15 @@ package com.gh.common
import com.gh.common.exposure.ExposureManager
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.common.loghub.LoghubUtils
import com.gh.gamecenter.common.utils.doOnMainProcessOnly
import com.gh.gamecenter.common.utils.tryCatchInRelease
import com.gh.common.util.AdHelper
import com.gh.common.videolog.VideoRecordUtils
import com.gh.download.DownloadDataHelper
import com.gh.gamecenter.entity.TimeEntity
import com.gh.gamecenter.common.loghub.LoghubUtils
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.doOnMainProcessOnly
import com.gh.gamecenter.common.utils.tryCatchInRelease
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.entity.TimeEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.schedulers.Schedulers
@ -25,6 +26,7 @@ object FixedRateJobHelper {
private const val DOWNLOAD_HEARTBEAT_PERIOD: Long = 60 * 1000L
private const val DOWNLOAD_HEARTBEAT_SHEET_PERIOD: Long = 15 * 1000L
private const val STARTUP_AD: Long = 30 * 60 * 1000L
private var mExecuteCount: Int = 0
@ -82,6 +84,11 @@ object FixedRateJobHelper {
VideoRecordUtils.commitVideoRecord()
}
// 获取启动广告
if ((mExecuteCount * CHECKER_PERIOD) % STARTUP_AD == 0L) {
AdHelper.getSettingAdCache()
}
// ExposureUtils.logADownloadCompleteExposureEvent(GameEntity(id = mExecuteCount.toString(), name = "测试曝光上传"), platform = "", trace = null, downloadType = ExposureUtils.DownloadType.DOWNLOAD)
mExecuteCount++
}

View File

@ -0,0 +1,35 @@
package com.gh.common.chain
import android.content.Context
import com.gh.common.simulator.NewSimulatorGameManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.gamecenter.entity.GameEntity
class UpdateNewSimulatorHandler: ChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity) {
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(context) {
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity)
} else {
processEndCallback?.invoke(null)
}
}
}
else{
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity)
}
}
}
else{
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity)
}
}
}
}

View File

@ -7,7 +7,7 @@ import com.gh.vspace.VHelper
class ValidateVSpaceHandler : ChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity) {
VHelper.validateVSpaceBeforeAction(context, gameEntity, true) {
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity)
} else {

View File

@ -1,18 +1,33 @@
package com.gh.common.chain
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.entity.GameEntity
class VersionNumberHandler : ChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity) {
DialogUtils.showVersionNumberDialog(context, gameEntity) {
val confirmCallback = {
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity)
} else {
processEndCallback?.invoke(null)
}
}
if (!gameEntity.isShowVersionNumber()) {
confirmCallback.invoke()
} else {
DialogHelper.showGuideDialog(
context,
"温馨提示",
gameEntity.getVersionNumberString(),
"继续下载",
R.string.cancel.toResString(),
{ confirmCallback.invoke() },
extraConfig = DialogHelper.Config(titleIcon = R.drawable.ic_dialog_tips)
)
}
}
}

View File

@ -8,23 +8,26 @@ import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.EnvHelper;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.common.util.AdHelper;
import com.gh.common.util.PackageHelper;
import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.SuggestionActivity;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.EnvHelper;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.GameGuidePopupEntity;
import com.gh.gamecenter.entity.NewApiSettingsEntity;
import com.gh.gamecenter.entity.NewSettingsEntity;
import com.gh.gamecenter.entity.NewsEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.entity.SimulatorEntity;
import com.gh.gamecenter.entity.VSetting;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.vspace.VHelper;
import com.halo.assistant.HaloApp;
@ -63,8 +66,10 @@ public class Config {
private static SettingsEntity mSettingsEntity;
private static NewSettingsEntity mNewSettingsEntity;
private static NewApiSettingsEntity mNewApiSettingsEntity;
private static NewSettingsEntity.NightMode mNightModeSetting;
private static NewApiSettingsEntity.NightMode mNightModeSetting;
private static SimulatorEntity mNewSimulatorEntity;
private static VSetting mVSetting;
private static GameGuidePopupEntity mGameGuidePopupEntity;
private static SharedPreferences mDefaultSharedPreferences;
@ -202,7 +207,7 @@ public class Config {
PackageHelper.initList();
// 初始化畅玩相关的东西
VHelper.init(HaloApp.getInstance());
VHelper.init(HaloApp.getInstance(), false);
}
@Nullable
@ -220,17 +225,37 @@ public class Config {
return mSettingsEntity;
}
//新模拟器
@Nullable
public static NewSettingsEntity.NightMode getNightModeSetting() {
if (mNightModeSetting != null) {
return mNightModeSetting;
} else if (mNewSettingsEntity != null && mNewSettingsEntity.getNightMode() != null) {
return mNewSettingsEntity.getNightMode();
public static SimulatorEntity getNewSimulatorEntitySetting() {
if (mNewSimulatorEntity != null) {
return mNewSimulatorEntity;
} else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getSimulator() != null) {
return mNewApiSettingsEntity.getSimulator();
} else {
return null;
}
}
@Nullable
public static NewApiSettingsEntity.NightMode getNightModeSetting() {
if (mNightModeSetting != null) {
return mNightModeSetting;
} else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getNightMode() != null) {
return mNewApiSettingsEntity.getNightMode();
} else {
return null;
}
}
public static boolean getUserInterestedGame() {
if (mNewApiSettingsEntity != null) {
return mNewApiSettingsEntity.getUserInterestedGame();
} else {
return false;
}
}
@Nullable
public static NewSettingsEntity getNewSettingsEntity() {
if (mNewSettingsEntity == null) {
@ -246,6 +271,26 @@ public class Config {
return mNewSettingsEntity;
}
@Nullable
public static NewApiSettingsEntity getNewApiSettingsEntity() {
if (mNewApiSettingsEntity == null) {
try {
String json = SPUtils.getString(Constants.SP_NEW_API_SETTINGS);
if (!TextUtils.isEmpty(json)) {
mNewApiSettingsEntity = GsonUtils.fromJson(json, NewApiSettingsEntity.class);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return mNewApiSettingsEntity;
}
public static void updateNewApiSettings(NewApiSettingsEntity settingsEntity) {
mNewApiSettingsEntity = settingsEntity;
SPUtils.setString(Constants.SP_NEW_API_SETTINGS, GsonUtils.toJson(settingsEntity));
}
@Nullable
public static VSetting getVSettingEntity() {
if (mVSetting == null) {
@ -295,26 +340,6 @@ public class Config {
return mDefaultSharedPreferences;
}
public static boolean isExistHideFunction() {
SharedPreferences preferences = getPreferences();
if (!preferences.getBoolean(FIX_DOWNLOAD_KEY, false)) return true;
if (!preferences.getBoolean(FIX_PLUGIN_KEY, false)) return true;
if (!preferences.getBoolean(FIX_COMMUNITY_KEY, false)) return true;
if (!preferences.getBoolean(FIX_ARTICLE_KEY, false)) return true;
return false;
}
public static void fixHideFunction() {
SharedPreferences preferences = PreferenceManager.
getDefaultSharedPreferences(HaloApp.getInstance().getApplication());
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Config.FIX_DOWNLOAD_KEY, true);
editor.putBoolean(Config.FIX_ARTICLE_KEY, true);
editor.putBoolean(Config.FIX_COMMUNITY_KEY, true);
editor.putBoolean(Config.FIX_PLUGIN_KEY, true);
editor.apply();
}
@SuppressLint("CheckResult")
public static void getGhzsSettings() {
String channel = HaloApp.getInstance().getChannel();
@ -350,9 +375,6 @@ public class Config {
@Override
public void onSuccess(NewSettingsEntity data) {
mNewSettingsEntity = data;
if (mNightModeSetting != null) {
mNewSettingsEntity.setNightMode(mNightModeSetting);
}
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
}
});
@ -370,25 +392,23 @@ public class Config {
});
}
if (mNightModeSetting == null) {
if (mNewApiSettingsEntity == null) {
RetrofitManager.getInstance()
.getNewApi().getNewSettings(PackageUtils.getGhVersionName(), channel)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BiResponse<NewSettingsEntity>() {
.subscribe(new BiResponse<NewApiSettingsEntity>() {
@Override
public void onSuccess(NewSettingsEntity data) {
public void onSuccess(NewApiSettingsEntity data) {
mNewApiSettingsEntity = data;
mNightModeSetting = data.getNightMode();
mNewSimulatorEntity = data.getSimulator();
if (HaloApp.getInstance().isNewForThisVersion && mNightModeSetting != null && mNightModeSetting.getInstall()) {
DarkModeUtils.INSTANCE.updateFollowSystemDarkModeToSp(true);
DarkModeUtils.INSTANCE.updateAppDarkModeStatusToSp(true);
DarkModeUtils.INSTANCE.initDarkMode();
}
if (mNewSettingsEntity != null) {
mNewSettingsEntity.setNightMode(mNightModeSetting);
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
}
AdHelper.prefetchStartUpAd(mNewApiSettingsEntity);
SPUtils.setString(Constants.SP_NEW_API_SETTINGS, GsonUtils.toJson(data));
}
});
}

View File

@ -50,6 +50,7 @@ import com.gh.common.util.PlatformUtils;
import com.gh.common.util.ReservationHelper;
import com.gh.common.view.DownloadButton;
import com.gh.common.view.GameIconView;
import com.gh.common.view.NoEllipsizeSpaceTextView;
import com.gh.download.DownloadManager;
import com.gh.download.dialog.DownloadDialog;
import com.gh.gamecenter.DownloadManagerActivity;
@ -784,7 +785,7 @@ public class BindingAdapters {
}
}
public static void setGameName(TextView view, GameEntity game, boolean isShowPlatform, @Nullable Boolean isShowSuffix) {
public static void setGameName(NoEllipsizeSpaceTextView 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", !isShowSuffix ? game.getNameWithoutSuffix() : game.getName(),
@ -842,7 +843,7 @@ public class BindingAdapters {
int start = index;
int end = start + tag.getName().length() + ((i != showCount - 1) ? 1 : 0);
index = end;
span.setSpan(new ForegroundColorSpan(Color.parseColor("#" + tag.getColor())),
span.setSpan(new ForegroundColorSpan(ExtensionsKt.hexStringToIntColor("#" + tag.getColor(), Color.WHITE)),
start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
view.setText(span);
@ -850,11 +851,11 @@ public class BindingAdapters {
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);
ExtensionsKt.setDrawableStart(view, ContextCompat.getDrawable(view.getContext(), R.drawable.ic_video_data_up), null, null);
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.text_EA3333));
view.setText(count + "");
} else {
view.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
ExtensionsKt.removeDrawable(view);
view.setTextColor(ContextCompat.getColor(view.getContext(), R.color.text_subtitleDesc));
view.setText("-");
}

View File

@ -29,8 +29,8 @@ import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.databinding.DialogDeviceRemindBinding
import com.gh.gamecenter.entity.DeviceDialogEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment
import com.google.gson.reflect.TypeToken
import com.gh.gamecenter.setting.GameDownloadSettingFragment.Companion.AUTO_INSTALL_SP_KEY
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus
@ -53,7 +53,7 @@ class DeviceRemindDialog(context: Context, val entity: DeviceDialogEntity, val g
private val dataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
if (downloadEntity.status == DownloadStatus.done && downloadEntity.name == gameEntity.name) {
val autoInstall = SPUtils.getBoolean(AUTO_INSTALL_SP_KEY, true)
val autoInstall = SPUtils.getBoolean(GameDownloadSettingFragment.AUTO_INSTALL_SP_KEY, true)
if (autoInstall) {
dismiss()
}

View File

@ -13,13 +13,11 @@ import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentTransaction
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.base.fragment.BaseDialogFragment
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.view.CustomLinkMovementMethod
import com.gh.gamecenter.databinding.DialogPrivacyProtocolNewBinding
import com.gh.gamecenter.entity.DialogEntity
import splitties.bundle.put
class NewPrivacyPolicyDialogFragment : BaseDialogFragment() {
@ -161,7 +159,7 @@ class NewPrivacyPolicyDialogFragment : BaseDialogFragment() {
}
}
privacyDialogFragment.arguments = Bundle().apply {
put(KEY_DATA, privacyPolicyEntity)
putParcelable(KEY_DATA, privacyPolicyEntity)
}
privacyDialogFragment.show(
activity.supportFragmentManager,

View File

@ -303,7 +303,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
//安装、卸载事件
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(busFour: EBPackage) {
if ("安装" == busFour.type || "卸载" == busFour.type) {
if (busFour.isInstalledOrUninstalled()) {
mAllInstalledPackages = PackageUtils.getInstalledPackages(HaloApp.getInstance().application, 0)
mAdapter?.notifyDataSetChanged()
}

View File

@ -23,7 +23,6 @@ import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.databinding.DialogPrivacyProtocolBinding
import com.gh.gamecenter.entity.DialogEntity
import com.lightgame.utils.AppManager
import splitties.bundle.put
class PrivacyPolicyDialogFragment : BaseDialogFragment() {
@ -184,7 +183,7 @@ class PrivacyPolicyDialogFragment : BaseDialogFragment() {
}
}
privacyDialogFragment.arguments = Bundle().apply {
put(KEY_DATA, privacyPolicyEntity)
putParcelable(KEY_DATA, privacyPolicyEntity)
}
privacyDialogFragment.show(
activity.supportFragmentManager,

View File

@ -29,7 +29,7 @@ data class ExposureEvent(
var timeInMillisecond: Long = System.currentTimeMillis(),
@PrimaryKey
var id: String = UUID.randomUUID().toString(),
) : Parcelable {
) : Parcelable, Cloneable {
@Transient
@IgnoredOnParcel
@ -45,6 +45,9 @@ data class ExposureEvent(
eTrace: List<ExposureEvent>? = null,
event: ExposureType = ExposureType.EXPOSURE
) {
if (gameEntity?.adIconActive == true) {
gameEntity.isAdData = true
}
this.payload = ExposureEntity(
gameId = gameEntity?.id?.getFirstElementDividedByDivider(DownloadEntity.GAME_ID_DIVIDER),
gameName = eTrace?.firstOrNull()?.payload?.gameName
@ -70,7 +73,8 @@ data class ExposureEvent(
welcomeDialogId = gameEntity?.welcomeDialogId
?: eTrace?.firstOrNull()?.payload?.welcomeDialogId,
welcomeDialogLinkTitle = gameEntity?.welcomeDialogTitle
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle,
isAdData = gameEntity?.isAdData ?: eTrace?.firstOrNull()?.payload?.isAdData ?: false
)
this.id = UUID.randomUUID().toString()
this.timeInMillisecond = System.currentTimeMillis()
@ -123,6 +127,10 @@ data class ExposureEvent(
return flags == FLAG_IN_USE
}
fun deepCopy(): ExposureEvent {
return super.clone() as ExposureEvent
}
companion object {
private val sPoolSync = Any()
private var sPool: ExposureEvent? = null

View File

@ -6,11 +6,13 @@ object ExposureTraceUtils {
val traceList = arrayListOf<ExposureEvent>()
event?.let {
if (event.eTrace == null) {
traceList.add(event)
//这里使用deepCopy是为了防止循环引用调用hashCode方法触发StackOverflowError错误
val deepCopy = it.deepCopy()
if (deepCopy.eTrace == null) {
traceList.add(deepCopy)
} else {
traceList.addAll(event.eTrace!!)
traceList.add(flattenTrace(event))
traceList.addAll(deepCopy.eTrace!!)
traceList.add(flattenTrace(deepCopy))
}
}

View File

@ -18,7 +18,7 @@ import com.halo.assistant.HaloApp
@Database(
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class],
version = 11,
version = 12,
exportSchema = false
)
@TypeConverters(
@ -28,6 +28,7 @@ import com.halo.assistant.HaloApp
AnswerUserConverter::class,
ThumbnailConverter::class,
TagStyleListConverter::class,
TagStyleConverter::class,
StringArrayListConverter::class,
ListStringConverter::class,
CommunityVideoConverter::class,
@ -127,6 +128,13 @@ abstract class HistoryDatabase : RoomDatabase() {
}
}
val MIGRATION_11_12: Migration = object : Migration(11, 12) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("Alter TABLE HistoryGameEntity add subtitle TEXT NOT NULL DEFAULT ''")
database.execSQL("Alter TABLE HistoryGameEntity add subtitleStyle TEXT")
}
}
val instance by lazy {
Room.databaseBuilder(
HaloApp.getInstance().application,
@ -142,6 +150,7 @@ abstract class HistoryDatabase : RoomDatabase() {
.addMigrations(MIGRATION_8_9)
.addMigrations(MIGRATION_9_10)
.addMigrations(MIGRATION_10_11)
.addMigrations(MIGRATION_11_12)
.build()
}
}

View File

@ -71,6 +71,8 @@ object HistoryHelper {
historyGame.name = gameEntity.name
historyGame.tagStyle = gameEntity.tagStyle
historyGame.tag = gameEntity.getTag()
historyGame.subtitle = gameEntity.subtitle
historyGame.subtitleStyle = gameEntity.subtitleStyle
return historyGame
}

View File

@ -5,6 +5,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IAppProvider
import com.gh.gamecenter.core.provider.IFlavorProvider
import com.halo.assistant.HaloApp
@Route(path = RouteConsts.provider.app, name = "Application暴露服务")
@ -33,6 +34,10 @@ class AppProviderImpl : IAppProvider {
return HaloApp.getInstance().channel ?: ""
}
override fun setChannel(channel: String) {
HaloApp.getInstance().channel = channel
}
override fun getUserAgent(): String {
return HaloApp.getInstance().userAgent ?: ""
}
@ -52,4 +57,8 @@ class AppProviderImpl : IAppProvider {
override fun isUserAcceptPrivacyPolicy(context: Context): Boolean {
return HaloApp.isUserAcceptPrivacyPolicy(context)
}
override fun getFlavorProvider(): IFlavorProvider {
return HaloApp.getInstance().flavorProvider
}
}

View File

@ -0,0 +1,23 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.server.BrowserInstallHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IBrowserInstallHelperProvider
@Route(path = RouteConsts.provider.browserInstallHelper, name = "BrowserInstallHelper暴露服务")
class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun isUseBrowserToInstallEnabled(): Boolean = BrowserInstallHelper.isUseBrowserToInstallEnabled()
override fun shouldUseBrowserToInstall(): Boolean = BrowserInstallHelper.shouldUseBrowserToInstall()
override fun logSwitchInstallSettingEvent() {
BrowserInstallHelper.logOrdinaryBrowserEvent(BrowserInstallHelper.Type.SWITCH_INSTALL_SETTING)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -72,6 +72,10 @@ class ConfigProviderImpl : IConfigProvider {
return Config.WEIBO_APPKEY
}
override fun getNightModeSetting(): Boolean {
return Config.getNightModeSetting()?.setting ?: false
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -1,5 +1,6 @@
package com.gh.common.provider
import android.app.Dialog
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DialogUtils
@ -22,6 +23,46 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
})
}
override fun showWaitDialog(context: Context, string: String): Dialog = DialogUtils.showWaitDialog(context, string)
override fun showForceDialog(
context: Context,
title: String,
message: CharSequence,
positive: String,
negative: String,
confirm: () -> Unit,
cancel: () -> Unit
) {
DialogUtils.showForceDialog(context, title, message, positive, negative,
{ confirm.invoke() }, object :CancelListener{
override fun onCancel() {
cancel.invoke()
}
})
}
override fun showUsageStatsDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
DialogUtils.showUsageStatsDialog(context,
{ confirm.invoke() }, object :CancelListener{
override fun onCancel() {
cancel.invoke()
}
})
}
override fun showNoticeDialog(
context: Context,
title: String,
content: String,
confirm: () -> Unit
) {
DialogUtils.showNoticeDialog(context, title, content
) { confirm.invoke() }
}
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog = DialogUtils.showBindPhoneDialog(context) { confirm.invoke() }
override fun init(context: Context?) {
// Do nothing
}

View File

@ -49,6 +49,14 @@ class DirectProviderImpl : IDirectProvider {
DirectUtils.directToLotteryParadisePage(context)
}
override fun directDouyin(context: Context, userId: String) {
DirectUtils.directDouyin(context, userId)
}
override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) {
DirectUtils.directToSuggestion(context, diagnosis = diagnosis)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -0,0 +1,18 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.history.HistoryHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IHistoryHelperProvider
@Route(path = RouteConsts.provider.historyHelper, name = "HistoryHelper暴露服务")
class HistoryHelperProviderImpl : IHistoryHelperProvider {
override fun emptyDatabase() {
HistoryHelper.emptyDatabase()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,20 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMainProvider
@Route(path = RouteConsts.provider.mainActivity, name = "MainActivity暴露服务")
class MainProviderImpl : IMainProvider {
override fun skipToMainActivity(context: Context, position: Int) {
MainActivity.skipToMainActivity(context, position)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,19 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import android.os.Parcelable
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShellActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IShellProvider
@Route(path = RouteConsts.provider.shellActivity, name = "ShellActivity暴露服务")
class ShellProviderImpl : IShellProvider {
override fun getSwitchInstallMethodIntent(context: Context, extraParcelable: Parcelable?): Intent =
ShellActivity.getIntent(context, ShellActivity.Type.SWITCH_INSTALL_METHOD, extraParcelable)
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,19 @@
package com.gh.common.provider
import android.content.Context
import android.os.Handler
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUpdateManagerProvider
import com.gh.gamecenter.manager.UpdateManager
@Route(path = RouteConsts.provider.updateManager, name = "UpdateManager暴露服务")
class UpdateManagerProviderImpl: IUpdateManagerProvider {
override fun checkUpdate(context: Context, isAutoCheck: Boolean, handler: Handler) {
UpdateManager.getInstance(context).checkUpdate(isAutoCheck, handler)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,23 @@
package com.gh.common.provider
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.UsageStatsHelper
import com.gh.common.util.WechatBindHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider
@Route(path = RouteConsts.provider.usageStatsHelper, name = "UsageStatsHelper暴露服务")
class UsageStatsHelperProviderImpl : IUsageStatsHelperProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP_MR1)
override fun checkForPermission(): Boolean = UsageStatsHelper.checkForPermission()
override fun skipToUsageStats(context: Context, requestCode: Int) {
UsageStatsHelper.skipToUsageStats(context, requestCode)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -17,6 +17,14 @@ class WebProviderImpl : IWebProvider {
return WebActivity.getWebIntent(context, title, url)
}
override fun getBindWechatIntent(context: Context): Intent {
return WebActivity.getBindWechatIntent(context)
}
override fun getSecurityCertificationIntent(context: Context): Intent {
return WebActivity.getSecurityCertificationIntent(context)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -8,8 +8,10 @@ import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
class WechatHelperProviderImpl : IWechatBindHelperProvider {
override fun getWechatConfig() {
WechatBindHelper.getWechatConfig()
override fun getWechatConfig(callback: (() -> Unit)?) {
WechatBindHelper.getWechatConfig {
callback?.invoke()
}
}
override fun init(context: Context?) {

View File

@ -0,0 +1,165 @@
package com.gh.common.simulator
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.view.Gravity
import androidx.core.content.FileProvider
import com.g00fy2.versioncompare.Version
import com.gh.common.constant.Config
import com.gh.common.util.DownloadItemUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.GameEntity
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.AppManager
import io.reactivex.Single
import java.io.ByteArrayOutputStream
import java.io.File
object NewSimulatorGameManager {
private const val KEY_GAME_ICON = "GAME_ICON"
private const val KEY_GAME_ID = "GAME_ID"
private const val KEY_GAME_NAME = "GAME_NAME"
private const val KEY_GAME_PACKAGE_NAME = "GAME_PACKAGE_NAME"
private const val KEY_GAME_PACKAGE_PATH = "GAME_PACKAGE_PATH"
private const val KEY_GAME_PACKAGE_LAST_MODIFICATION = "GAME_PACKAGE_LAST_MODIFICATION"
private const val KEY_GAME_PACKAGE_EXTENSION = "GAME_PACKAGE_EXTENSION"
private const val KEY_GAME_PACKAGE_SDCARD_PATH = "GAME_PACKAGE_SDCARD_PATH" // boolean 是否sdcard文件路径
private const val KEY_GAME_EMU_SYSTEM = "GAME_EMU_SYSTEM"
private const val KEY_EMU_ID = "EMU_ID"
private const val KEY_EMU_NAME = "EMU_NAME"
private const val KEY_USE_DEBUG_API = "USE_DEBUG_API"
private const val KEY_META = "META"
// private const val GH_RETRO_EMU_APP_PACKAGE_NAME = "com.gh.retroemu"
private const val GH_RETRO_EMU_APP_LAUNCHER_ACTIVITY_NAME = "com.gh.retroemu.ui.SplashActivity"
private const val NEW_SIMULATOR_SHOW_ALERT_TAG = "-news-simulator-show-alert"
/**
* 后台模拟器管理上传新版本模拟器(显示状态),且检测用户有安装旧版本模拟器 每日弹出一次更新弹框
*/
@JvmStatic
fun shouldShowUpdateNewSimulatorAlert(context: Context): Boolean {
val isUploadNewsSimulator = Config.getNewSimulatorEntitySetting()?.active ?: false
val isInstallOld = SimulatorGameManager.isOldSimulatorInstalled(context)
val showAlertTag = SPUtils.getString(NEW_SIMULATOR_SHOW_ALERT_TAG, "")
val todayIsShow = showAlertTag == TimeUtils.getToday()//当天是否弹出过一次
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
return (isUploadNewsSimulator && !todayIsShow && isInstallOld && !isInstalledNewSimulator)
}
/**
* 弹出更新弹框
*/
@JvmStatic
fun showUpdateNewsSimulator(context: Context, callback: EmptyCallback? = null){
NewFlatLogUtils.logSimulatorUpdateAlertShow()
DialogHelper.showDialog(
context,
"更新提示",
"光环助手近期对模拟器进行升级,优化游戏体验!\n但更新后可能会导致原先的游戏存档数据无法使用(可在模拟器管理中安装新版本模拟器)",
"更新",
"取消",
confirmClickCallback = {
NewFlatLogUtils.logSimulatorUpdateAlertClick("更新")
val simulator = Config.getNewSimulatorEntitySetting()
if (simulator != null) {
SimulatorDownloadManager.getInstance().showDownloadingDialog(context, simulator)
}
},
cancelClickCallback = {
callback?.onCallback()
NewFlatLogUtils.logSimulatorUpdateAlertClick("取消")
},
uiModificationCallback = { binding ->
binding.contentTv.gravity = Gravity.START
binding.contentTv.setTextColor(R.color.text_subtitle.toColor(context))
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
SPUtils.setString(NEW_SIMULATOR_SHOW_ALERT_TAG, TimeUtils.getToday())
}
/**
* 通过模拟器启动游戏
*/
@SuppressLint("CheckResult")
@JvmStatic
fun launchGameViaSimulator(downloadEntity: DownloadEntity, gameEntity: GameEntity) {
val newSimulator = Config.getNewSimulatorEntitySetting() ?: return
val gameIcon = gameEntity.icon ?: gameEntity.rawIcon ?: ""
Single.just(ImageUtils.getCachedUrl(gameIcon))
.flatMap {
SimulatorGameManager.getBitmapFormCache(it)
}.map {
BitmapUtils.compressBitmap(it, 100)
}.map {
val baos = ByteArrayOutputStream()
it.compress(Bitmap.CompressFormat.WEBP, 90, baos)
baos.toByteArray()
}
.compose(singleToMain())
.subscribe({
val gamePackageFileUri = FileProvider.getUriForFile(
HaloApp.getInstance(),
BuildConfig.APPLICATION_ID,
File(downloadEntity.path)
)
HaloApp.getInstance().grantUriPermission(
SimulatorGameManager.NEW_SIMULATOR_PACKAGE_NAME,
gamePackageFileUri,
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION or
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION // 冗余,以备不时之需
)
val intent = Intent()
intent.setClassName(SimulatorGameManager.NEW_SIMULATOR_PACKAGE_NAME, GH_RETRO_EMU_APP_LAUNCHER_ACTIVITY_NAME)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.data = gamePackageFileUri
gameEntity.getApk().safelyGetInRelease(0)?.let { apk ->
intent.putExtra(KEY_GAME_PACKAGE_NAME, apk.packageName)
intent.putExtra(KEY_GAME_PACKAGE_EXTENSION, apk.format)
}
intent.putExtra(KEY_GAME_NAME, downloadEntity.name)
intent.putExtra(KEY_GAME_ICON, it)
intent.putExtra(KEY_GAME_PACKAGE_PATH, downloadEntity.path) // 游戏包文件路径,冗余参数)
intent.putExtra(KEY_GAME_PACKAGE_SDCARD_PATH, true)
intent.putExtra(KEY_GAME_PACKAGE_LAST_MODIFICATION, File(downloadEntity.path).lastModified()) // 游戏包文件修改时间
intent.putExtra(KEY_GAME_EMU_SYSTEM, gameEntity.simulatorType) // 模拟器类型
intent.putExtra(KEY_GAME_ID, gameEntity.id)
// TODO 补充光环模拟器的游戏 id
intent.putExtra(KEY_EMU_ID, newSimulator.apk?.id) // 光环模拟器.apk gameId
intent.putExtra(KEY_EMU_NAME, "光环模拟器") // 光环模拟器.apk name
intent.putExtra(KEY_USE_DEBUG_API, EnvHelper.isDevEnv) // // 游戏来源是否为dev后台 (是否来源于测试环境)
intent.putExtra(KEY_META, LogUtils.getMetaObject().toString())
try {
AppManager.getInstance().recentActiveActivity?.startActivity(intent)
} catch (e: ActivityNotFoundException) {
ToastUtils.showToast("模拟器安装错误")
}
SimulatorGameManager.recordPlaySimulatorGames(gameEntity.id)
}, {
ToastUtils.showToast("跳转失败")
})
}
}

View File

@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import com.g00fy2.versioncompare.Version
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageInstaller
import com.gh.common.util.PackageUtils
import com.gh.download.DownloadManager
@ -138,7 +139,6 @@ class SimulatorDownloadManager private constructor() {
) {
if (context == null) return
mContextRef = WeakReference(context)
this.simulatorLocation = location
this.simulator = simulator
this.gameId = gameId
@ -146,26 +146,46 @@ class SimulatorDownloadManager private constructor() {
PermissionHelper.checkGetInstalledAppsListBeforeAction(context, object : EmptyCallback {
override fun onCallback() {
//判断是否隐藏
if (simulator?.active == false) {
val isInstalledNewSimulator =
SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
//当没有安装新版本模拟器时候 判断是否隐藏
if (simulator?.active == false && !isInstalledNewSimulator) {
showNoneEmulatorDialog(context)
return
}
val isInstalled = PackageUtils.isInstalledFromAllPackage(context, simulator?.apk?.packageName)
val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(simulator?.apk?.packageName)
val shouldShowUpdate = Version(simulator?.apk?.version).isHigherThan(versionFromInstalledApp)
var isInstalled = PackageUtils.isInstalledFromAllPackage(
context,
simulator?.apk?.packageName
)
//模拟器管理界面还是用之前的逻辑
if (isInstalledNewSimulator && location != SimulatorLocation.SIMULATOR_MANAGE) {
isInstalled = isInstalledNewSimulator
}
// val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(simulator?.apk?.packageName)
val shouldShowUpdate =
PackageUtils.isInstalledApkMatchedMd5(simulator?.apk?.packageName, simulator?.apk?.md5)
val showAlertTag = SPUtils.getString(SimulatorGameManager.SIMULATOR_UPDATE_SHOW_ALERT_TAG, "") //当天是否弹过
val todayIsShow = showAlertTag == TimeUtils.getToday()
downloadType = if (shouldShowUpdate && isInstalled) "update" else "download"
if (downloadType == "update" && todayIsShow && location != SimulatorLocation.SIMULATOR_MANAGE) {
return
}
if (downloadType == "download" && isInstalled) {
return
}
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
)
if (shouldShowUpdate && isInstalled) {
NewFlatLogUtils.logSimulatorUpdateAlertShow()
}
DialogHelper.showDialog(
context,
title,
@ -176,11 +196,13 @@ class SimulatorDownloadManager private constructor() {
cancelClickCallback = {
if (shouldShowUpdate && isInstalled) {
cancelCallback?.invoke()
NewFlatLogUtils.logSimulatorUpdateAlertClick("取消")
MtaHelper.onEvent(trackableEntity.event, trackableEntity.key, "点击下次再说")
}
},
confirmClickCallback = {
showDownloadingDialog(context, simulator)
NewFlatLogUtils.logSimulatorUpdateAlertClick("更新")
MtaHelper.onEvent(
trackableEntity.event,
trackableEntity.key,
@ -190,11 +212,15 @@ class SimulatorDownloadManager private constructor() {
mtaEvent = trackableEntity.event, mtaKey = trackableEntity.key,
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
if (downloadType == "update" && location != SimulatorLocation.SIMULATOR_MANAGE) {
SPUtils.setString(SimulatorGameManager.SIMULATOR_UPDATE_SHOW_ALERT_TAG, TimeUtils.getToday())
}
}
})
}
private fun showDownloadingDialog(context: Context, simulator: SimulatorEntity?) {
fun showDownloadingDialog(context: Context, simulator: SimulatorEntity?) {
mContextRef = WeakReference(context)
val msg = FileUtils.isCanDownload(context, simulator?.apk?.size)
if (!msg.isNullOrEmpty()) {
Utils.toast(context, msg)

View File

@ -2,11 +2,12 @@ package com.gh.common.simulator
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.net.Uri
import android.text.TextUtils
import com.g00fy2.versioncompare.Version
import com.gh.common.constant.Config
import com.gh.common.util.ApkActiveUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.PackageUtils
@ -17,6 +18,8 @@ import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.retrofit.EmptyResponse
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.core.utils.UrlFilterUtils
import com.gh.gamecenter.entity.GameEntity
@ -36,13 +39,48 @@ import okhttp3.ResponseBody
import org.json.JSONArray
import java.io.ByteArrayOutputStream
import java.io.File
import java.util.*
object SimulatorGameManager {
private val gamePath by lazy { FileUtils.getDownloadPath(HaloApp.getInstance().application, "emulator_game") }
private val mGamePath by lazy { FileUtils.getDownloadPath(HaloApp.getInstance().application, "emulator_game") }
const val SIMULATOR_UPDATE_SHOW_ALERT_TAG = "simulator-update-show-alert"
private val mSimulatorPackageNames by lazy {
listOf(
"com.gh.fbnemu",
"com.gh.mame4droid",
"com.gh.nesemu",
"com.gh.ppsspp",
"com.gh.gbaemu",
"com.gh.gbcemu",
"com.gh.snes9xplus"
)
}
const val NEW_SIMULATOR_PACKAGE_NAME = "com.gh.retroemu" //新版本模拟器包名
@JvmStatic
fun getPathByType(type: String) = "${gamePath}/${type}"
//是否安装了新模拟器
fun isNewSimulatorInstalled(context: Context?): Boolean {
return PackageUtils.isInstalledFromAllPackage(context, NEW_SIMULATOR_PACKAGE_NAME)
}
@JvmStatic
//是否安装了旧模拟器
fun isOldSimulatorInstalled(context: Context?): Boolean {
for (packageName in mSimulatorPackageNames) {
if (PackageUtils.isInstalledFromAllPackage(context, packageName)) {
return true
}
}
return false
}
@JvmStatic
fun getPathByType(type: String) = "${mGamePath}/${type}"
@JvmStatic
fun deleteLocalGames(names: List<String>) {
@ -90,16 +128,33 @@ object SimulatorGameManager {
@JvmStatic
fun launchSimulatorGame(downloadEntity: DownloadEntity, gameEntity: GameEntity) {
val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(gameEntity.simulator?.apk?.packageName)
val shouldShowUpdate = Version(gameEntity.simulator?.apk?.version).isHigherThan(versionFromInstalledApp)
val isInstalledNewSimulator = isNewSimulatorInstalled(HaloApp.getInstance().application)
var packageName = gameEntity.simulator?.apk?.packageName
var simulator = gameEntity.simulator
if (isInstalledNewSimulator) {
packageName = NEW_SIMULATOR_PACKAGE_NAME
if (Config.getNewSimulatorEntitySetting() == null) {
return
}
simulator = Config.getNewSimulatorEntitySetting()
}
// val version = simulator?.apk?.version
// val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(packageName)
val shouldShowUpdate = PackageUtils.isInstalledApkMatchedMd5(packageName, simulator?.apk?.md5)
updateSimulatorConfigFile(gameId = gameEntity.id)
if (shouldShowUpdate) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
AppManager.getInstance().recentActiveActivity, gameEntity.simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name
?: ""
) {
val showAlertTag = SPUtils.getString(SIMULATOR_UPDATE_SHOW_ALERT_TAG, "")
val todayIsShow = showAlertTag == TimeUtils.getToday() //当天是否弹过
if (!todayIsShow) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
AppManager.getInstance().recentActiveActivity, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name
?: ""
) {
jumpToSimulator(downloadEntity, gameEntity)
}
} else {
jumpToSimulator(downloadEntity, gameEntity)
}
} else {
@ -109,6 +164,11 @@ object SimulatorGameManager {
@SuppressLint("CheckResult")
private fun jumpToSimulator(downloadEntity: DownloadEntity, gameEntity: GameEntity) {
val isInstalledNewSimulator = isNewSimulatorInstalled(HaloApp.getInstance().application)
if (isInstalledNewSimulator){
NewSimulatorGameManager.launchGameViaSimulator(downloadEntity,gameEntity)
return
}
val gameIcon = gameEntity.icon ?: gameEntity.rawIcon ?: ""
Single.just(ImageUtils.getCachedUrl(gameIcon))
.flatMap {
@ -152,7 +212,7 @@ object SimulatorGameManager {
})
}
private fun getBitmapFormCache(url: String): Single<Bitmap> {
fun getBitmapFormCache(url: String): Single<Bitmap> {
return Single.create {
ImageUtils.getBitmap(url, object : BiCallback<Bitmap, Boolean> {
override fun onFirst(first: Bitmap) {

View File

@ -1,15 +1,15 @@
package com.gh.common.util
import android.annotation.SuppressLint
import androidx.lifecycle.MutableLiveData
import com.gh.common.constant.Config
import com.gh.gamecenter.common.utils.NetworkUtils
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.observableToMain
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.NewApiSettingsEntity
import com.gh.gamecenter.entity.SettingsEntity
import com.gh.gamecenter.entity.StartupAdEntity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.schedulers.Schedulers
object AdHelper {
@ -19,24 +19,40 @@ object AdHelper {
const val LOCATION_SUGGESTION_FUNCTION = "suggestion_function"
const val LOCATION_SIMULATOR_GAME = "simulator_game"
@JvmField
var startupAd = MutableLiveData<StartupAdEntity>()
@JvmStatic
fun getStartUpAd(): StartupAdEntity? {
return Config.getNewApiSettingsEntity()?.startAd
}
@JvmStatic
@SuppressLint("CheckResult")
fun getStartUpAd() {
if (!NetworkUtils.isNetworkConnected(HaloApp.getInstance())) {
startupAd.postValue(null)
return
}
fun getStartUp(): StartupAdEntity? {
return Config.getNewApiSettingsEntity()?.startup
}
RetrofitManager.getInstance()
.api
.getSplashAd(HaloApp.getInstance().channel)
.subscribeOn(Schedulers.io())
.subscribe(object : BiResponse<StartupAdEntity>() {
override fun onSuccess(data: StartupAdEntity) {
startupAd.postValue(data)
@JvmStatic
fun prefetchStartUpAd(settingsEntity: NewApiSettingsEntity) {
if (settingsEntity.startAd != null && !settingsEntity.startAd?.img.isNullOrEmpty()) {
val screenWidth = DisplayUtils.getScreenWidth()
val transformedUrl = ImageUtils.getTransformedUrl(settingsEntity.startAd?.img, screenWidth) ?: return
ImageUtils.prefetchToDiskCache(transformedUrl)
}
}
fun getSettingAdCache() {
RetrofitManager.getInstance().newApi
.getSettingAdCache(HaloApp.getInstance().channel)
.compose(observableToMain())
.subscribe(object : Response<NewApiSettingsEntity>() {
override fun onResponse(response: NewApiSettingsEntity?) {
super.onResponse(response)
val settings = Config.getNewApiSettingsEntity()
if (settings != null) {
settings.startAd = response?.startAd
Config.updateNewApiSettings(settings)
if (response != null) {
prefetchStartUpAd(response)
}
}
}
})
}

View File

@ -0,0 +1,250 @@
package com.gh.common.util
import android.app.Dialog
import android.content.Context
import android.view.View
import android.view.Window
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.gh.download.simple.AutoUnregisteredSimpleDownloadListener
import com.gh.download.simple.DownloadListener
import com.gh.gamecenter.R
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.roundTo
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.databinding.DialogArchiveLoadingBinding
import com.gh.gamecenter.entity.ArchiveEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.vspace.VArchiveHelper
import com.gh.vspace.VHelper
import com.lg.download.DownloadError
import com.lg.download.DownloadStatus
import io.reactivex.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus
import splitties.systemservices.layoutInflater
/**
* 云存档下载按钮辅助类
*/
object ArchiveDownloadButtonHelper {
fun bindItem(
context: Context,
entrance: String,
fragment: Fragment,
packageName: String,
archiveEntity: ArchiveEntity,
downloadBtn: TextView,
downloadCompletedListener: (() -> Unit)? = null
) {
downloadBtn.text = if (VArchiveHelper.isArchiveDownloaded(archiveEntity.md5)) {
R.string.archive_apply.toResString()
} else {
R.string.archive_download.toResString()
}
downloadBtn.setOnClickListener {
when {
// 检查是否已安装畅玩助手
!VHelper.isVSpaceInstalled(context) -> showVspaceTipDialog(context)
// 检查是否已安装游戏
!VHelper.isInstalled(packageName) -> {
// 检查游戏是否在安装中
if (!VHelper.isInstalling(packageName)) {
showDownloadTipDialog(context)
} else {
ToastUtils.toast("游戏正在安装中,请稍候")
}
}
// 检查本地是否已下载存档
VArchiveHelper.isArchiveDownloaded(archiveEntity.md5) -> showApplyArchiveTipDialog(
context,
entrance,
packageName,
archiveEntity
)
// 检查完毕下载存档
else -> downloadArchive(
context,
entrance,
fragment,
packageName,
archiveEntity,
downloadBtn,
downloadCompletedListener
)
}
}
}
private fun showVspaceTipDialog(context: Context) {
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogShow()
DialogHelper.showDialog(
context,
R.string.archive_dialog_title.toResString(),
R.string.archive_vspace_dialog_content.toResString(),
R.string.archive_vspace_dialog_confirm.toResString(),
R.string.cancel.toResString(),
{
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogClick(R.string.archive_vspace_dialog_confirm.toResString())
VHelper.showVspaceDialog(context)
},
{
NewFlatLogUtils.logCloudArchiveVSpaceDownloadDialogClick(R.string.cancel.toResString())
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
}
private fun showDownloadTipDialog(context: Context) {
NewFlatLogUtils.logCloudArchiveGameDownloadDialogShow()
DialogHelper.showDialog(
context,
R.string.archive_dialog_title.toResString(),
R.string.archive_download_dialog_content.toResString(),
R.string.archive_download_dialog_confirm.toResString(),
R.string.cancel.toResString(),
{
NewFlatLogUtils.logCloudArchiveGameDownloadDialogClick(R.string.archive_download_dialog_confirm.toResString())
VHelper.disableLaunchGameAfterInstallation()
EventBus.getDefault().post(EBReuse("download"))
},
{
NewFlatLogUtils.logCloudArchiveGameDownloadDialogClick(R.string.cancel.toResString())
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
}
private fun applyArchive(
context: Context,
entrance: String,
packageName: String,
archiveEntity: ArchiveEntity
) {
VArchiveHelper.getArchiveFile(archiveEntity.md5)?.run {
RetrofitManager.getInstance().newApi
.postArchiveUsage(archiveEntity.gameId, archiveEntity.id)
.subscribeOn(Schedulers.io())
.subscribe()
VArchiveHelper.applyGameArchive(context, packageName, this) { packageName, isSuccess ->
if (isSuccess) {
VHelper.launch(context, packageName)
} else {
ToastUtils.toast(R.string.archive_apply_fail.toResString())
}
}
}
NewFlatLogUtils.logCloudArchiveDownloadOrApply(archiveEntity.name, entrance)
}
private fun downloadArchive(
context: Context,
entrance: String,
fragment: Fragment,
packageName: String,
archiveEntity: ArchiveEntity,
downloadBtn: TextView,
downloadCompletedListener: (() -> Unit)? = null
) {
// 执行下载
VArchiveHelper.downloadArchive(archiveEntity)
// 下载进度弹窗
val archiveLoadingDialog = Dialog(context, R.style.DialogWindowTransparent)
val archiveLoadingBinding = DialogArchiveLoadingBinding.inflate(context.layoutInflater)
showArchiveLoadingDialog(archiveLoadingDialog, archiveLoadingBinding.root)
// 下载进度监听
AutoUnregisteredSimpleDownloadListener(archiveEntity.id, fragment, object : DownloadListener {
override fun onError(error: DownloadError) {
dismissArchiveLoadingDialog(archiveLoadingDialog)
ToastUtils.toast(R.string.archive_download_fail.toResString())
}
override fun onProgress(progress: Float) {
archiveLoadingBinding.run {
progressTv.text = "${progress.roundTo(1)}%"
progressBar.progress = progress.toInt()
}
}
override fun onSizeReceived(fileSize: Long) {
// Do nothing
}
override fun onStatusChanged(status: DownloadStatus) {
when (status) {
DownloadStatus.COMPLETED -> {
dismissArchiveLoadingDialog(archiveLoadingDialog)
downloadBtn.text = R.string.archive_apply.toResString()
showApplyArchiveTipDialog(context, entrance, packageName, archiveEntity)
downloadCompletedListener?.invoke()
}
else -> {
// Do nothing
}
}
}
override fun onSpeedChanged(speed: Float) {
// Do nothing
}
})
NewFlatLogUtils.logCloudArchiveDownloadOrApply(archiveEntity.name, entrance)
}
private fun showArchiveLoadingDialog(
archiveLoadingDialog: Dialog,
contentView: View
) {
archiveLoadingDialog.run {
setCancelable(false)
setCanceledOnTouchOutside(false)
requestWindowFeature(Window.FEATURE_NO_TITLE)
setContentView(contentView)
show()
}
archiveLoadingDialog.window?.attributes?.apply {
width = DisplayUtils.getScreenWidth() - 120F.dip2px()
archiveLoadingDialog.window?.attributes = this
}
}
private fun showApplyArchiveTipDialog(
context: Context,
entrance: String,
packageName: String,
archiveEntity: ArchiveEntity
) {
DialogHelper.showDialog(
context,
R.string.archive_dialog_title.toResString(),
R.string.archive_apply_dialog_content.toResString(),
R.string.archive_apply.toResString(),
R.string.cancel.toResString(),
{
applyArchive(context, entrance, packageName, archiveEntity)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "使用")
},
{ NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "取消") },
extraConfig = DialogHelper.Config(centerTitle = true)
)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_show")
}
private fun dismissArchiveLoadingDialog(archiveLoadingDialog: Dialog) {
if (archiveLoadingDialog.isShowing) {
archiveLoadingDialog.dismiss()
}
}
}

View File

@ -2,17 +2,14 @@ package com.gh.common.util;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import com.gh.base.GlobalActivityManager;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.base.activity.BaseActivity;
import com.gh.gamecenter.common.constant.Constants;
@ -126,6 +123,16 @@ public class DataUtils {
// 避免初始化顺序问题导致 MetaUtil 一直持有空的 gid
MetaUtil.INSTANCE.refreshMeta();
ContentValues values = new ContentValues();
values.put(GhContentProvider.KEY_GID, gid);
values.put(GhContentProvider.KEY_ANDROID_ID, MetaUtil.getBase64EncodedAndroidId());
try {
HaloApp.getInstance().getContentResolver().insert(Uri.parse("content://com.gh.gamecenter.provider/device"), values);
} catch (Exception exception) {
SentryHelper.INSTANCE.onEvent("DEVICE_INSERT_ERROR", "exception_digest", exception.getLocalizedMessage());
exception.printStackTrace();
}
}
@Override

View File

@ -15,12 +15,14 @@ import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.viewholder.DetailViewHolder;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.vspace.VHelper;
import com.lightgame.download.DownloadEntity;
import com.lightgame.download.DownloadStatus;
/**
* Created by khy on 27/06/17.
@ -36,6 +38,10 @@ public class DetailDownloadUtils {
viewHolder.getOverlayTv().setVisibility(View.GONE);
}
if (viewHolder.mMultiVersionDownloadTv != null) {
viewHolder.mMultiVersionDownloadTv.setVisibility(View.GONE);
}
if (viewHolder.gameEntity != null
&& Config.isShowDownload(viewHolder.gameEntity.getId())
&& !"光环助手".equals(viewHolder.gameEntity.getName())) {
@ -171,8 +177,34 @@ public class DetailDownloadUtils {
}
viewHolder.mDownloadPb.setText(downloadText);
} else {
viewHolder.mDownloadPb.setText("选择下载你的版本" + (TextUtils.isEmpty(downloadAddWord) ? "" : "-" + downloadAddWord) + " >");
viewHolder.mMultiVersionDownloadTv.setText("选择下载你的版本" + (TextUtils.isEmpty(downloadAddWord) ? "" : "-" + downloadAddWord));
viewHolder.mMultiVersionDownloadTv.setVisibility(View.VISIBLE);
viewHolder.mDownloadPb.setText("");
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.NORMAL);
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(viewHolder.gameEntity);
if (downloadEntity != null) {
switch (downloadEntity.getStatus()) {
case downloading:
viewHolder.mDownloadTips.setVisibility(View.VISIBLE);
ExtensionsKt.setDownloadTipsAnimation(viewHolder.mDownloadTips, true);
break;
case done:
case pause:
case waiting:
case timeout:
case subscribe:
case neterror:
case overflow:
viewHolder.mDownloadTips.setVisibility(View.VISIBLE);
ExtensionsKt.setDownloadTipsAnimation(viewHolder.mDownloadTips, false);
break;
default:
viewHolder.mDownloadTips.setVisibility(View.GONE);
break;
}
} else {
viewHolder.mDownloadTips.setVisibility(View.GONE);
}
}
if (isCheck && viewHolder.gameEntity.getApk().size() == 1) {
@ -203,10 +235,14 @@ public class DetailDownloadUtils {
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
String percent = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_PERCENT);
viewHolder.mDownloadPb.setText("解压中" + percent + "%");
viewHolder.mDownloadPb.setText("游戏解压中 " + percent + "%");
viewHolder.mDownloadPb.setProgress((int) (Float.valueOf(percent) * 10));
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.XAPK_UNZIPPING);
return;
} else if (XapkUnzipStatus.FAILURE.name().equals(xapkStatus)) {
viewHolder.mDownloadPb.setText(R.string.install);
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.XAPK_FAILURE);
return;
}
viewHolder.mDownloadPb.setProgress((int) (viewHolder.downloadEntity.getPercent() * 10));
@ -220,35 +256,35 @@ public class DetailDownloadUtils {
}
switch (downloadEntity.getStatus()) {
case timeout:
case neterror:
case subscribe:
case downloading:
case redirected:
case pause:
case overflow:
if (SPUtils.getBoolean(Constants.SP_USE_BROWSER_TO_INSTALL)) {
viewHolder.mDownloadPb.setText(R.string.browser_install_downloading);
} else {
viewHolder.mDownloadPb.setText(R.string.downloading);
}
String downloadingText = "游戏加载中 " + downloadEntity.getPercent() + "%";
String resumeText = "继续加载 " + downloadEntity.getPercent() + "%";
viewHolder.mDownloadPb.setText((downloadEntity.getStatus() == DownloadStatus.downloading || downloadEntity.getStatus() == DownloadStatus.redirected) ? downloadingText : resumeText);
if (downloadEntity.isPluggable() && PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN);
} else {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
}
break;
case timeout:
case neterror:
case waiting:
case subscribe:
viewHolder.mDownloadPb.setText(R.string.waiting);
if (downloadEntity.isPluggable() && PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN);
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
} else {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
}
break;
case done:
if (SimulatorGameManager.isSimulatorGame(viewHolder.gameEntity)) {
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(viewHolder.context, viewHolder.gameEntity.getSimulator().getApk().getPackageName());
if (isInstalled) {
boolean isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(viewHolder.context);
if (isInstalled || isInstalledNewSimulator) {
viewHolder.mDownloadPb.setText(R.string.launch);
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.LAUNCH_OR_OPEN);
} else {
@ -303,18 +339,19 @@ public class DetailDownloadUtils {
private static void updateVStyleButton(DetailViewHolder viewHolder) {
switch (viewHolder.downloadEntity.getStatus()) {
case redirected:
case downloading:
case overflow:
viewHolder.mDownloadPb.setText("游戏加载中 " + viewHolder.downloadEntity.getPercent() + "%");
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
break;
case timeout:
case neterror:
case waiting:
case subscribe:
viewHolder.mDownloadPb.setText(R.string.waiting);
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
break;
case overflow:
case timeout:
case neterror:
case subscribe:
case pause:
viewHolder.mDownloadPb.setText("继续加载 " + viewHolder.downloadEntity.getPercent() + "%");
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);

View File

@ -6,13 +6,10 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
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.Spannable;
@ -95,8 +92,8 @@ import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.SimpleGameEntity;
import com.gh.gamecenter.entity.TrackableEntity;
import com.gh.gamecenter.login.entity.Badge;
import com.gh.gamecenter.security.BindPhoneActivity;
import com.gh.gamecenter.setting.GameDownloadSettingFragment;
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment;
import com.gh.gamecenter.setting.view.security.BindPhoneActivity;
import com.gh.gamecenter.suggest.SuggestType;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
@ -1254,38 +1251,6 @@ public class DialogUtils {
dialog.show();
}
public static void showVersionNumberDialog(Context context, GameEntity gameEntity, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
if (!gameEntity.isShowVersionNumber()) {
listener.onConfirm();
} else {
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_version_number, null);
TextView contentTv = contentView.findViewById(R.id.contentTv);
TextView cancelTv = contentView.findViewById(R.id.cancelTv);
TextView continueTv = contentView.findViewById(R.id.continueTv);
contentTv.setText(gameEntity.getVersionNumberString());
cancelTv.setOnClickListener(v -> dialog.dismiss());
continueTv.setOnClickListener(v -> {
listener.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 showOverseaDownloadDialog(Context context, GameEntity gameEntity, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
@ -1620,7 +1585,7 @@ public class DialogUtils {
TextView commitTv = view.findViewById(R.id.commitTv);
Context finalContext = context;
//添加透明阴影,实现类似 clipPadding=false 效果
complaintCommentEt.setShadowLayer(complaintCommentEt.getExtendedPaddingBottom(), 0f, 0f, Color.TRANSPARENT);
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_subtitleDesc : R.color.theme_font));
@ -1630,7 +1595,7 @@ public class DialogUtils {
for (String option : options) {
TextView reportTv = new TextView(context);
reportTv.setText(option);
reportTv.setTextSize(16f);
reportTv.setTextSize(16F);
if (disabledOptions != null && disabledOptions.contains(option)) {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.btn_gray));
} else {
@ -1639,12 +1604,10 @@ public class DialogUtils {
}
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));
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);
ExtensionsKt.setDrawableEnd(reportTv, R.drawable.ic_complaint_arrow_right, DisplayUtils.dip2px(6F), DisplayUtils.dip2px(6F));
}
complaintContainer.addView(reportTv);
@ -1907,13 +1870,21 @@ public class DialogUtils {
}
}
@SuppressLint("SetTextI18n")
public static void showReportReasonDialog(Context context, ArrayList<String> items, ReportReasonCallBack callBack) {
showReportReasonDialog(context, items, "", callBack);
}
@SuppressLint("SetTextI18n")
public static void showReportReasonDialog(Context context, ArrayList<String> items, String title, ReportReasonCallBack callBack) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
DialogReportReasonBinding binding = DialogReportReasonBinding.inflate(LayoutInflater.from(context));
if (!title.isEmpty()) {
binding.reasonTitle.setText(title);
}
ReportReasonAdapter reportReasonAdapter = new ReportReasonAdapter(context, items, reason -> {
if (reason.equals("其他原因")) {
binding.reasonTitle.setText(R.string.report_reason_other_title);
@ -2045,7 +2016,7 @@ public class DialogUtils {
binding.confirmTv.setText("我知道了");
binding.centerDivider.setVisibility(View.GONE);
binding.cancelTv.setVisibility(View.GONE);
binding.titleTv.setCompoundDrawablesWithIntrinsicBounds(ExtensionsKt.toDrawable(R.drawable.ic_reserve_success), null, null, null);
ExtensionsKt.setDrawableStart(binding.titleTv, R.drawable.ic_reserve_success, null, null);
binding.confirmTv.setOnClickListener(v -> dialog.dismiss());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(binding.getRoot());

View File

@ -9,32 +9,33 @@ import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.constant.Config
import com.gh.gamecenter.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.gamecenter.common.constant.EntranceConsts.*
import com.gh.common.util.EntranceUtils.*
import com.gh.common.util.EntranceUtils.jumpActivity
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.category2.CategoryV2Activity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.entity.Display
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.discovery.DiscoveryActivity
import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBSkip
@ -62,9 +63,10 @@ import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.servers.GameServerTestActivity
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.setting.view.security.BindPhoneActivity
import com.gh.gamecenter.setting.view.SettingActivity
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.suggest.SuggestType
import com.gh.gamecenter.tag.TagsActivity
@ -143,6 +145,7 @@ object DirectUtils {
directToLinkPage(context, linkEntity, entrance, path, null)
}
@JvmStatic
fun directToLinkPage(
context: Context,
linkEntity: LinkEntity,
@ -181,7 +184,8 @@ object DirectUtils {
"common_collection",
"game_list",
"game_list_detail",
"bbs_video"
"bbs_video",
"explore_column"
)
fun directToLinkPage(
@ -434,6 +438,8 @@ object DirectUtils {
"game_list_detail" -> directToGameCollectionDetail(context, linkEntity.link ?: "", entrance)
"explore_column" -> context.startActivity(DiscoveryActivity.getIntent(context, entrance))
"" -> {
// do nothing
}
@ -585,19 +591,21 @@ object DirectUtils {
entrance: String? = null,
path: String? = null
) {
directToHomeActivity(context, userId, "", position, entrance, path)
directToHomeActivity(context, userId, "", "", position, entrance, path)
}
/**
* 跳转至个人主页
* @param position 定位到某个tab 0游戏 1发布
* @param type 类型
* @param type 类型 (发布)
* @param game_type 类型 (游戏)
*/
@JvmStatic
fun directToHomeActivity(
context: Context,
userId: String? = "",
type: String? = "",
game_type: String? = "",
position: Int? = 0,
entrance: String? = null,
path: String? = null
@ -610,6 +618,7 @@ object DirectUtils {
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
bundle.putString(KEY_GAME, game_type)
bundle.putInt(KEY_POSITION, position ?: 0)
jumpActivity(context, bundle)
}
@ -767,6 +776,36 @@ object DirectUtils {
jumpActivity(context, bundle)
}
@JvmStatic
fun directToFeedbackCompat(
context: Context,
content: String? = null,
hintType: String? = null,
isQaFeedback: Boolean = false,
qaContentId: String? = "",
entrance: String? = null
) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
if (isQaFeedback) {
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
} else {
bundle.putString(KEY_CONTENT, content)
if (TextUtils.isEmpty(hintType)) {
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion)
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
} else {
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType)
}
}
EntranceUtils.jumpActivityCompat(context, bundle)
}
@JvmStatic
fun directToDownloadManager(context: Context, entrance: String? = null) {
val bundle = Bundle()

View File

@ -14,30 +14,30 @@ import com.gh.common.exposure.ExposureEvent
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.history.HistoryHelper
import com.gh.common.repository.ReservationRepository
import com.gh.common.simulator.NewSimulatorGameManager
import com.gh.common.simulator.SimulatorDownloadManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.common.view.DownloadButton
import com.gh.common.xapk.XapkInstaller
import com.gh.common.xapk.XapkInstaller.cancelUnzipTask
import com.gh.common.xapk.XapkUnzipStatus
import com.gh.download.DownloadManager
import com.gh.download.dialog.DownloadDialog
import com.gh.gamecenter.DownloadManagerActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.PluginLocation
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
import com.gh.gamecenter.manager.PackagesManager
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
import com.gh.vspace.VDownloadManagerActivity
import com.gh.vspace.VHelper
import com.lightgame.download.DownloadConfig
import com.lightgame.download.DownloadEntity
@ -119,13 +119,13 @@ object DownloadItemUtils {
fun updateItemWithReserveStatus(holder: GameViewHolder, gameEntity: GameEntity) {
if ("download" == gameEntity.reserveStatus) {
// 已上线
updateItem(holder.gameDes.context, gameEntity, holder, false)
updateItem(holder.gameDownloadBtn.context, gameEntity, holder, false)
} else if ("appointment" == gameEntity.reserveStatus) {
// 已预约
holder.gameDownloadBtn.text = "已预约"
holder.gameDownloadBtn.visibility = View.VISIBLE
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.RESERVED
updateItemViewStatus(holder, false, null, null)
updateItemViewStatus(holder, null, null)
}
}
@ -165,7 +165,8 @@ object DownloadItemUtils {
) {
// 显示预约
if (gameEntity.isReservable) {
updateItemViewStatus(holder, false, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
holder.multiVersionDownloadTv?.visibility = View.GONE
updateItemViewStatus(holder, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
updateDownloadButton(
context,
holder.gameDownloadBtn,
@ -176,11 +177,16 @@ object DownloadItemUtils {
return
}
if (gameEntity.getApk().isEmpty() || gameEntity.downloadOffStatus != null) {
updateItemViewStatus(holder, false, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
holder.multiVersionDownloadTv?.visibility = View.GONE
holder.gameDownloadTips?.visibility = View.GONE
updateItemViewStatus(holder, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
} else if (gameEntity.getApk().size == 1) {
updateNormalItem(context, holder, gameEntity, isShowPlatform, briefStyle, isShowRecommendStar)
holder.multiVersionDownloadTv?.visibility = View.GONE
holder.gameDownloadTips?.visibility = View.GONE
updateNormalItem(context, holder, gameEntity, briefStyle, isShowRecommendStar)
} else {
updatePluginItem(context, holder, gameEntity, isShowPlatform, briefStyle, isShowRecommendStar)
holder.multiVersionDownloadTv?.visibility = View.VISIBLE
updatePluginItem(context, holder, gameEntity, briefStyle, isShowRecommendStar)
}
updateDownloadButton(
context,
@ -261,42 +267,56 @@ object DownloadItemUtils {
downloadEntity = VHelper.getDownloadEntitySnapshot(gameEntity.id, gameEntity.getUniquePackageName())
}
if (downloadEntity == null) {
val entryMap: ArrayMap<String, DownloadEntity> = gameEntity.getEntryMap()
val apkEntity = gameEntity.getApk()[0]
if (entryMap.isNotEmpty()) {
downloadEntity = entryMap[apkEntity.getPlatform()]
}
}
if (downloadEntity != null) {
downloadBtn.apply {
val status = downloadEntity.status
if (status == DownloadStatus.downloading) {
setText(R.string.downloading)
buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
} else if (status == DownloadStatus.waiting) {
setText(R.string.waiting)
buttonStyle = DownloadButton.ButtonStyle.WAITING
} else if (status == DownloadStatus.pause || status == DownloadStatus.timeout || status == DownloadStatus.neterror || status == DownloadStatus.subscribe || status == DownloadStatus.overflow) {
setText(R.string.downloading)
buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
} else if (status == DownloadStatus.done) {
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (XapkUnzipStatus.UNZIPPING.name == xapkStatus) {
setText(R.string.unzipping)
when (downloadEntity.status) {
DownloadStatus.done -> {
if (downloadEntity.isSimulatorGame() && gameEntity.simulator != null) {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
} else if (downloadEntity.isVGame()) {
buttonStyle =
if (PackagesManager.isCanUpdate(
downloadEntity.gameId,
downloadEntity.packageName
)
) {
setText(R.string.update)
DownloadButton.ButtonStyle.NORMAL
} else {
setText(R.string.launch)
DownloadButton.ButtonStyle.LAUNCH_OR_OPEN
}
} else {
buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
setText(R.string.install)
}
buttonStyle =
if (downloadEntity.isPluggable && PackagesManager.isInstalled(downloadEntity.packageName)) {
DownloadButton.ButtonStyle.PLUGIN
} else {
DownloadButton.ButtonStyle.NORMAL
}
}
DownloadStatus.pause,
DownloadStatus.timeout,
DownloadStatus.neterror,
DownloadStatus.subscribe,
DownloadStatus.overflow -> {
buttonStyle = DownloadButton.ButtonStyle.NORMAL
return
setText(R.string.resume)
}
if (downloadEntity.isSimulatorGame() && gameEntity.simulator != null) {
DownloadStatus.cancel -> {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
} else if (downloadEntity.isVGame()) {
if (PackagesManager.isCanUpdate(downloadEntity.gameId, downloadEntity.packageName)) {
setText(R.string.update)
} else {
setText(R.string.launch)
}
} else {
setText(R.string.install)
}
buttonStyle =
if (downloadEntity.isPluggable && PackagesManager.isInstalled(downloadEntity.packageName)) {
DownloadButton.ButtonStyle.PLUGIN
} else {
DownloadButton.ButtonStyle.NORMAL
}
else -> {}
}
}
} else {
@ -309,192 +329,184 @@ object DownloadItemUtils {
// 更新正常的条目只有一个apk包
private fun updateNormalItem(
context: Context, holder: GameViewHolder, gameEntity: GameEntity,
isShowPlatform: Boolean, briefStyle: String?,
context: Context,
holder: GameViewHolder,
gameEntity: GameEntity,
briefStyle: String?,
isShowRecommendStar: Boolean = false
) {
val entryMap: ArrayMap<String, DownloadEntity> = gameEntity.getEntryMap()
val apkEntity = gameEntity.getApk()[0]
var downloadEntity: DownloadEntity? = null
if (entryMap.isNotEmpty()) {
val downloadEntity = entryMap[apkEntity.getPlatform()]
if (downloadEntity != null) {
if (downloadEntity.isSimulatorGame()) {
if (downloadEntity.status != DownloadStatus.done) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, true)
return
}
} else {
downloadEntity = entryMap[apkEntity.getPlatform()]
}
if (downloadEntity == null) {
downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
}
if (downloadEntity != null) {
if (downloadEntity.isSimulatorGame()) {
if (downloadEntity.status != DownloadStatus.done) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, true, isShowRecommendStar)
changeStatus(context, holder, downloadEntity)
return
}
} else {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity)
return
}
}
updateItemViewStatus(holder, false, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
updateItemViewStatus(holder, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
}
// 更新插件的条目有多个apk包
private fun updatePluginItem(
context: Context, holder: GameViewHolder, gameEntity: GameEntity,
isShowPlatform: Boolean, briefStyle: String?,
context: Context,
holder: GameViewHolder,
gameEntity: GameEntity,
briefStyle: String?,
isShowRecommendStar: Boolean = false
) {
val entryMap = gameEntity.getEntryMap()
var downloadEntity: DownloadEntity? = null
if (entryMap.isNotEmpty()) {
val queue = DownloadManager.getInstance().getQueue(gameEntity.name)
val downloadEntity = if (queue != null && !queue.isEmpty()) {
downloadEntity = if (queue != null && !queue.isEmpty()) {
entryMap[queue.peek()]
} else {
entryMap[entryMap.keyAt(0)]
}
if (downloadEntity != null) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, isShowPlatform, false, isShowRecommendStar)
return
}
}
updateItemViewStatus(holder, false, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
if (downloadEntity == null) {
downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
}
if (downloadEntity != null) {
// 更改进度条和提示文本的状态
changeStatus(context, holder, downloadEntity, gameEntity.getApk().size > 1)
return
}
updateItemViewStatus(holder, briefStyle, gameEntity.columnRecommend, isShowRecommendStar)
}
// 更改进度条和提示文本的状态
fun changeStatus(
context: Context, holder: GameViewHolder, downloadEntity: DownloadEntity,
isShowPlatform: Boolean, isNormal: Boolean, isShowRecommendStar: Boolean = false
context: Context,
holder: GameViewHolder,
downloadEntity: DownloadEntity,
isMultiVersion: Boolean = false
) {
val status = downloadEntity.status
// 畅玩游戏下载完成时不再需要显示进度条
val shouldShowDownload = !(downloadEntity.isVGame() && status == DownloadStatus.done)
val platform = PlatformUtils.getInstance(context).getPlatformName(downloadEntity.platform)
updateItemViewStatus(holder, shouldShowDownload, null, null, isShowRecommendStar)
holder.gameProgressbar.progressDrawable = R.drawable.progressbar_bg_style.toDrawable()
if (status == DownloadStatus.downloading) {
if (DownloadStatus.pause != DownloadManager.getInstance().getStatus(downloadEntity.url)) {
holder.gameProgressbar.progress = (downloadEntity.percent * 10).toInt()
if (isShowPlatform && platform != null) {
holder.gameDownloadSpeed.text = String.format(
"%s - %s(剩%s)", platform,
SpeedUtils.getSpeed(downloadEntity.speed),
SpeedUtils.getRemainTime(
downloadEntity.size,
downloadEntity.progress,
downloadEntity.speed * 1024
)
)
when (downloadEntity.status) {
DownloadStatus.redirected,
DownloadStatus.downloading -> {
if (isMultiVersion) {
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
val darkMode = (holder.gameDownloadTips?.getTag(R.string.is_dark_mode_on_id) as? Boolean) ?: false
val isDarkModeChanged = DarkModeUtils.isDarkModeOn(context) != darkMode
if (holder.gameDownloadTips?.visibility == View.GONE || holder.gameDownloadTips?.isAnimating == false || isDarkModeChanged) {
holder.gameDownloadTips?.visibility = View.VISIBLE
holder.gameDownloadTips?.setDownloadTipsAnimation(true)
}
holder.gameDownloadTips?.setTag(R.string.is_dark_mode_on_id, DarkModeUtils.isDarkModeOn(context))
} else {
holder.gameDownloadSpeed.text = String.format(
"%s(剩%s)", SpeedUtils.getSpeed(downloadEntity.speed),
SpeedUtils.getRemainTime(
downloadEntity.size,
downloadEntity.progress,
downloadEntity.speed * 1024
)
)
holder.gameDownloadTips?.visibility = View.GONE
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
holder.gameDownloadBtn.progress = (downloadEntity.percent * 10).toInt()
holder.gameDownloadBtn.text = downloadEntity.percent.toString() + "%"
}
holder.gameDownloadPercentage.text = downloadEntity.percent.toString() + "%"
}
} else if (status == DownloadStatus.waiting) {
holder.gameProgressbar.progress = (downloadEntity.percent * 10).toInt()
if (isShowPlatform && platform != null) {
holder.gameDownloadSpeed.text = String.format("%s - 等待", platform)
} else {
holder.gameDownloadSpeed.text = "等待"
DownloadStatus.waiting -> {
if (isMultiVersion) {
holder.gameDownloadTips?.visibility = View.VISIBLE
holder.gameDownloadTips?.setDownloadTipsAnimation(false)
}
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.WAITING
holder.gameDownloadBtn.text = context.getString(R.string.waiting)
}
holder.gameDownloadPercentage.text = downloadEntity.percent.toString() + "%"
} else if (status == DownloadStatus.pause || status == DownloadStatus.timeout || status == DownloadStatus.neterror || status == DownloadStatus.subscribe || status == DownloadStatus.overflow) {
holder.gameProgressbar.progress = (downloadEntity.percent * 10).toInt()
if (isShowPlatform && platform != null) {
holder.gameDownloadSpeed.text = String.format("%s - 暂停", platform)
} else {
holder.gameDownloadSpeed.text = "暂停"
DownloadStatus.pause,
DownloadStatus.timeout,
DownloadStatus.neterror,
DownloadStatus.subscribe,
DownloadStatus.overflow -> {
if (isMultiVersion) {
holder.gameDownloadTips?.visibility = View.VISIBLE
holder.gameDownloadTips?.setDownloadTipsAnimation(false)
}
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
holder.gameDownloadBtn.text = context.getString(R.string.resume)
}
holder.gameDownloadPercentage.text = downloadEntity.percent.toString() + "%"
} else if (status == DownloadStatus.done) {
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (XapkUnzipStatus.UNZIPPING.name == xapkStatus) {
val percent = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_PERCENT]
holder.gameProgressbar.progressDrawable =
context.resources.getDrawable(R.drawable.progressbar_xapk_style)
holder.gameDownloadSpeed.setText(R.string.unzipping)
holder.gameProgressbar.progress = (java.lang.Float.valueOf(percent) * 10).toInt()
holder.gameDownloadPercentage.text = "$percent%"
return
DownloadStatus.done -> {
if (isMultiVersion) {
holder.gameDownloadTips?.visibility = View.VISIBLE
holder.gameDownloadTips?.setDownloadTipsAnimation(false)
}
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (XapkUnzipStatus.UNZIPPING.name == xapkStatus) {
val percent = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_PERCENT]
holder.gameDownloadBtn.progress = (java.lang.Float.valueOf(percent) * 10).toInt()
holder.gameDownloadBtn.text = "$percent%"
return
} else if (XapkUnzipStatus.FAILURE.name == xapkStatus) {
holder.gameDownloadBtn.setText(R.string.install)
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
return
}
holder.gameDownloadBtn.progress = 1000
holder.gameDownloadBtn.setText(R.string.hundred_percent)
}
holder.gameProgressbar.progress = 1000
if (isShowPlatform && platform != null) {
holder.gameDownloadSpeed.text = String.format("%s - 下载完成", platform)
} else {
holder.gameDownloadSpeed.text = "下载完成"
else -> {
holder.gameDownloadTips?.visibility = View.GONE
}
holder.gameDownloadPercentage.setText(R.string.hundred_percent)
}
}
private fun updateItemViewStatus(
holder: GameViewHolder,
showDownload: Boolean,
briefStyle: String?,
recommendStyle: LinkEntity?,
isShowRecommendStar: Boolean = false
) {
if (showDownload) {
holder.gameDownloadTips?.visibility = View.GONE
// 推荐指数优先,现暂时为游戏单详情列表游戏使用
if (isShowRecommendStar && holder.recommendStarInfo != null) {
holder.recommendStarInfo!!.visibility = View.VISIBLE
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
holder.gameDes.visibility = View.GONE
holder.gameProgressbar.visibility = View.VISIBLE
holder.gameInfo.visibility = View.VISIBLE
holder.gameDes?.visibility = View.GONE
return
}
// 推荐优先,有推荐内容时不执行下面的 star 和 brief 代码块
if (briefStyle != null && recommendStyle != null && briefStyle.contains("recommend")) {
if (holder.recommendContainer != null) {
holder.recommendContainer!!.visibility = View.VISIBLE
}
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
holder.gameDes?.visibility = View.GONE
holder.recommendTv?.text = recommendStyle.text
if (TextUtils.isEmpty(recommendStyle.icon)) {
holder.recommendIv?.visibility = View.GONE
holder.recommendContainer?.setPadding(6F.dip2px(), 0, 8F.dip2px(), 0)
} else {
holder.recommendIv?.visibility = View.VISIBLE
ImageUtils.display(holder.recommendIv, recommendStyle.icon)
}
return
} else {
if (holder.recommendContainer != null) {
holder.recommendContainer!!.visibility = View.GONE
}
if (holder.recommendStarInfo != null) {
holder.recommendStarInfo!!.visibility = View.GONE
}
}
if (briefStyle != null && briefStyle.contains("star")) {
if (holder.gameRating != null) holder.gameRating!!.visibility = View.VISIBLE
} else {
holder.gameProgressbar.visibility = View.GONE
holder.gameInfo.visibility = View.GONE
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
}
// 推荐指数优先,现暂时为游戏单详情列表游戏使用
if (isShowRecommendStar && holder.recommendStarInfo != null) {
holder.recommendStarInfo!!.visibility = View.VISIBLE
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
holder.gameDes.visibility = View.GONE
return
}
// 推荐优先,有推荐内容时不执行下面的 star 和 brief 代码块
if (briefStyle != null && recommendStyle != null && briefStyle.contains("recommend")) {
if (holder.recommendContainer != null) {
holder.recommendContainer!!.visibility = View.VISIBLE
}
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
holder.gameDes.visibility = View.GONE
holder.recommendTv.text = recommendStyle.text
if (TextUtils.isEmpty(recommendStyle.icon)) {
holder.recommendIv.visibility = View.GONE
holder.recommendContainer?.setPadding(6F.dip2px(), 0, 8F.dip2px(), 0)
} else {
holder.recommendIv.visibility = View.VISIBLE
ImageUtils.display(holder.recommendIv, recommendStyle.icon)
}
return
} else {
if (holder.recommendContainer != null) {
holder.recommendContainer!!.visibility = View.GONE
}
}
if (briefStyle != null && briefStyle.contains("star")) {
if (holder.gameRating != null) holder.gameRating!!.visibility = View.VISIBLE
} else {
if (holder.gameRating != null) holder.gameRating!!.visibility = View.GONE
}
// 缺省情况下回落到游戏简介
if (TextUtils.isEmpty(briefStyle) || briefStyle!!.contains("brief") || briefStyle.contains("recommend")) {
holder.gameDes.visibility = View.VISIBLE
} else {
holder.gameDes.visibility = View.GONE
}
// 缺省情况下回落到游戏简介
if (TextUtils.isEmpty(briefStyle) || briefStyle!!.contains("brief") || briefStyle.contains("recommend")) {
holder.gameDes?.visibility = View.VISIBLE
} else {
holder.gameDes?.visibility = View.GONE
}
}
@ -561,7 +573,7 @@ object DownloadItemUtils {
@JvmStatic
fun setOnClickListener(
context: Context,
downloadBtn: DownloadButton,
downloadBtn: View,
gameEntity: GameEntity,
position: Int,
adapter: RecyclerView.Adapter<out RecyclerView.ViewHolder?>?,
@ -641,30 +653,22 @@ object DownloadItemUtils {
allStateClickCallback?.onCallback()
clickCallback?.onCallback()
if ("download" == gameEntity.reserveStatus) {
ReservationHelper.showDeleteReservationDialog(context, object : EmptyCallback {
override fun onCallback() {
ReservationHelper.deleteReservation(gameEntity, object : EmptyCallback {
override fun onCallback() {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
})
ReservationHelper.showDeleteReservationDialog(context) {
ReservationHelper.deleteReservation(gameEntity) {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
})
}
} else {
ReservationHelper.showCancelReservationDialog(context, object : EmptyCallback {
override fun onCallback() {
NewFlatLogUtils.logMyGameCancelReserveDialogClick(
"确定取消",
gameEntity.id,
gameEntity.name ?: ""
)
ReservationHelper.cancelReservation(gameEntity, object : EmptyCallback {
override fun onCallback() {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
})
ReservationHelper.showCancelReservationDialog(context, {
NewFlatLogUtils.logMyGameCancelReserveDialogClick(
"确定取消",
gameEntity.id,
gameEntity.name ?: ""
)
ReservationHelper.cancelReservation(gameEntity) {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
}, object : CancelListener {
override fun onCancel() {
@ -707,26 +711,24 @@ object DownloadItemUtils {
}
} else if (gameEntity.getApk().size == 1) {
downloadBtn.setOnClickListener {
val clickRunnable = object : EmptyCallback {
override fun onCallback() {
allStateClickCallback?.onCallback()
clickCallback?.onCallback()
onNormalClick(
context,
downloadBtn,
gameEntity,
position,
adapter,
entrance,
location,
traceEvent,
refreshCallback
)
}
val clickRunnable = EmptyCallback {
allStateClickCallback?.onCallback()
clickCallback?.onCallback()
onNormalClick(
context,
downloadBtn,
gameEntity,
position,
adapter,
entrance,
location,
traceEvent,
refreshCallback
)
}
// 启动不需要请求存储权限
if (downloadBtn.text.toString() == context.getString(R.string.launch)) {
if (downloadBtn is DownloadButton && downloadBtn.text == context.getString(R.string.launch)) {
clickRunnable.onCallback()
} else {
PermissionHelper.checkStoragePermissionBeforeAction(context, clickRunnable)
@ -755,7 +757,7 @@ object DownloadItemUtils {
@JvmOverloads
fun onNormalClick(
context: Context,
downloadBtn: DownloadButton,
downloadBtn: View?,
gameEntity: GameEntity,
position: Int,
adapter: RecyclerView.Adapter<out RecyclerView.ViewHolder?>?,
@ -764,11 +766,12 @@ object DownloadItemUtils {
traceEvent: ExposureEvent? = null,
refreshCallback: EmptyCallback? = null
) {
val str = downloadBtn.text.toString()
val str = if (downloadBtn is DownloadButton) downloadBtn.text else context.getString(R.string.download)
if (gameEntity.getApk().isEmpty()) return
val apk = gameEntity.getApk().safelyGetInRelease(0) ?: return
if (str == context.getString(R.string.download)) {
ChainBuilder().apply {
addHandler(UpdateNewSimulatorHandler())
addHandler(GamePermissionHandler())
addHandler(BrowserInstallHandler())
addHandler(PackageCheckHandler())
@ -785,6 +788,7 @@ object DownloadItemUtils {
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
} else if (str == context.getString(R.string.attempt)) {
ChainBuilder().apply {
addHandler(UpdateNewSimulatorHandler())
addHandler(GamePermissionHandler())
addHandler(BrowserInstallHandler())
addHandler(PackageCheckHandler())
@ -839,9 +843,18 @@ object DownloadItemUtils {
if (gameEntity.simulator != null) {
val isInstalled =
PackageUtils.isInstalledFromAllPackage(context, gameEntity.simulator!!.apk!!.packageName)
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled) {
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator
val newSimulator = Config.getNewSimulatorEntitySetting()
if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (newSimulator.active) {
simulator = newSimulator
}
}
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
context, gameEntity.simulator,
context, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name!!, null
)
return
@ -855,9 +868,12 @@ object DownloadItemUtils {
}
} else if (str == context.getString(R.string.launch)) {
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(context, null)
return
}
val downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk()[0].url)
if (downloadEntity != null) {
val file = File(downloadEntity.path)
@ -865,6 +881,7 @@ object DownloadItemUtils {
download(context, gameEntity, downloadBtn, entrance, location, false, traceEvent)
return
}
NewFlatLogUtils.logSimulatorGameCardClick("启动")
SimulatorGameManager.launchSimulatorGame(downloadEntity, gameEntity)
}
return
@ -895,15 +912,31 @@ object DownloadItemUtils {
}
})
} else {
if (gameEntity.isVGame()) {
context.startActivity(VDownloadManagerActivity.getIntent(context, true))
} else {
context.startActivity(
DownloadManagerActivity.getDownloadMangerIntent(
context,
apk.url, entrance + "+(" + location.split(":").toTypedArray()[0] + ")"
)
)
var downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
if (downloadEntity == null && gameEntity.getApk().size == 1) {
val entryMap: ArrayMap<String, DownloadEntity> = gameEntity.getEntryMap()
val apkEntity = gameEntity.getApk()[0]
if (entryMap.isNotEmpty()) {
downloadEntity = entryMap[apkEntity.getPlatform()]
}
}
if (downloadEntity != null) {
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (XapkUnzipStatus.UNZIPPING.name == xapkStatus) {
cancelUnzipTask(downloadEntity)
return
}
when (str) {
context.getString(R.string.resume) -> {
DownloadManager.getInstance().resume(downloadEntity, true)
}
context.getString(R.string.waiting) -> {
Utils.toast(context, "最多只能同时下载三个任务,请稍等")
}
else -> {
DownloadManager.getInstance().pause(downloadEntity.url)
}
}
}
}
}
@ -912,7 +945,7 @@ object DownloadItemUtils {
private fun download(
context: Context,
gameEntity: GameEntity,
downloadBtn: DownloadButton,
downloadBtn: View?,
entrance: String,
location: String,
isSubscribe: Boolean,
@ -932,8 +965,10 @@ object DownloadItemUtils {
traceEvent
)
Utils.toast(context, gameEntity.name + "已加入下载队列")
downloadBtn.setText(R.string.downloading)
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
if (downloadBtn is DownloadButton) {
downloadBtn.text = "0%"
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
}
DeviceRemindDialog.showDeviceRemindDialog(context, gameEntity)
} else {
Utils.toast(context, msg)
@ -942,15 +977,22 @@ object DownloadItemUtils {
//插件化
private fun plugin(
context: Context, gameEntity: GameEntity, downloadBtn: DownloadButton, entrance: String,
location: String, isSubscribe: Boolean, traceEvent: ExposureEvent?
context: Context,
gameEntity: GameEntity,
downloadBtn: View?,
entrance: String,
location: String,
isSubscribe: Boolean,
traceEvent: ExposureEvent?
) {
val msg = FileUtils.isCanDownload(context, gameEntity.getApk()[0].size)
if (TextUtils.isEmpty(msg)) {
DownloadManager.createDownload(context, gameEntity, "插件化", entrance, location, isSubscribe, traceEvent)
Utils.toast(context, gameEntity.name + "已加入下载队列")
downloadBtn.setText(R.string.downloading)
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN
if (downloadBtn is DownloadButton) {
downloadBtn.setText(R.string.downloading)
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN
}
} else {
Utils.toast(context, msg)
}
@ -958,8 +1000,11 @@ object DownloadItemUtils {
//安装
private fun install(
context: Context, gameEntity: GameEntity, position: Int,
adapter: RecyclerView.Adapter<out RecyclerView.ViewHolder?>?, refreshCallback: EmptyCallback?
context: Context,
gameEntity: GameEntity,
position: Int,
adapter: RecyclerView.Adapter<out RecyclerView.ViewHolder?>?,
refreshCallback: EmptyCallback?
) {
val apkEntity = gameEntity.getApk()[0]
val downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)

View File

@ -1,6 +1,7 @@
package com.gh.common.util
import android.preference.PreferenceManager
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureUtils
import com.gh.common.simulator.SimulatorDownloadManager
import com.gh.common.simulator.SimulatorGameManager
@ -22,7 +23,7 @@ import com.gh.gamecenter.entity.SimpleGameEntity
import com.gh.gamecenter.entity.SimulatorEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.GameDownloadSettingFragment
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment
import com.gh.gamecenter.suggest.SuggestType
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
@ -47,6 +48,8 @@ object DownloadObserver {
// TODO 修复因为更改内存对象造成的双重下载完成事件问题,具体触发代码见 DownloadDao.updateSnapshotList
private var mDoneDebouncePair: Pair<String, Long>? = null
private const val TEA_EVENT_DOWNLOAD_COMPLETE = "game_addiction"
// 如果在WIFI状态下,下载自动暂停,则再重试一遍
@JvmStatic
fun initObserver() {
@ -200,6 +203,11 @@ object DownloadObserver {
} else {
statDoneEvent(downloadEntity)
if (!SPUtils.getBoolean(TEA_EVENT_DOWNLOAD_COMPLETE)) {
HaloApp.getInstance().flavorProvider.logEvent(TEA_EVENT_DOWNLOAD_COMPLETE)
SPUtils.setBoolean(TEA_EVENT_DOWNLOAD_COMPLETE, true)
}
GameActivityDownloadHelper.clear()
EnergyBridge.postEnergyTask("download_game", downloadEntity.gameId, downloadEntity.packageName)
@ -239,20 +247,27 @@ object DownloadObserver {
val simulatorJson = downloadEntity.getMetaExtra(Constants.SIMULATOR)
val gameName = downloadEntity.getMetaExtra(Constants.GAME_NAME)
if (simulatorJson.isEmpty()) return
val simulator = GsonUtils.fromJson(simulatorJson, SimulatorEntity::class.java)
var simulator = GsonUtils.fromJson(simulatorJson, SimulatorEntity::class.java)
val isInstalled = PackageUtils.isInstalledFromAllPackage(
HaloApp.getInstance().application,
simulator.apk?.packageName
)
if (!isInstalled) {
val currentActivity = AppManager.getInstance().currentActivity()
?: return
SimulatorDownloadManager.getInstance().showDownloadDialog(
currentActivity, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, downloadEntity.gameId, gameName, null
)
val isInstalledNewSimulator =
SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
val isInstalledOldSimulator =
SimulatorGameManager.isOldSimulatorInstalled(HaloApp.getInstance().application)
// if (!isInstalled && !isInstalledNewSimulator) {
val currentActivity = AppManager.getInstance().currentActivity()
?: return
val newSimulator = Config.getNewSimulatorEntitySetting()
if ((!isInstalledOldSimulator && newSimulator != null && newSimulator.active) || isInstalledNewSimulator) { //如果没有安装任一旧的模拟器 或者下载了新模拟器 则使用新版本模拟器
simulator = newSimulator ?: simulator
}
SimulatorDownloadManager.getInstance().showDownloadDialog(
currentActivity, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, downloadEntity.gameId, gameName, null
)
// }
SimulatorGameManager.recordDownloadSimulatorGame(downloadEntity.gameId, simulator.type)
SimulatorGameManager.postPlayedGame(downloadEntity.gameId, downloadEntity.packageName)
} else {

View File

@ -37,6 +37,32 @@ import java.util.Set;
public class EntranceUtils {
public static void jumpActivityCompat(Context context, Bundle bundle) {
bundle.putBoolean(KEY_REQUIRE_REDIRECT, true);
if (HaloApp.getInstance().isRunningForeground || HaloApp.getInstance().isAlreadyUpAndRunning) {
// 应用正在运行,前台或后台
String to = bundle.getString(KEY_TO);
Class<?> clazz = ClassUtils.forName(to);
if (clazz == null) clazz = MainActivity.class;
if (ToolbarFragment.class.isAssignableFrom(clazz)) { // 兼容ToolbarFragment
ToolBarActivity.startFragmentNewTask(context, (Class<? extends ToolbarFragment>) clazz, bundle);
} else {
Intent intent1 = new Intent(context, clazz);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 如果 activity 名称有 singleton 的就添加 reorder_to_front 标签 (有点粗暴有点蠢,但暂时就先这样吧 :C )
if (clazz.getSimpleName().toLowerCase().contains("singleton")) {
intent1.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
}
intent1.putExtras(bundle);
context.startActivity(intent1);
}
} else {
// 应用未在运行
context.startActivity(SplashScreenActivity.getSplashScreenIntent(context, bundle));
}
}
public static void jumpActivity(Context context, Bundle bundle) {
bundle.putBoolean(KEY_REQUIRE_REDIRECT, true);

View File

@ -183,6 +183,11 @@ object ErrorHelper {
403210 -> handleVerifyPhoneError(context, errorEntity, realNameConfirmListener, entrance)
// 禁言(发布内容)
403402 -> Utils.toast(context, "您的账号存在违规,不允许发布内容")
// 禁言(点赞)
403403 -> Utils.toast(context, "您的账号存在违规,不允许点赞")
else -> Utils.toast(context, R.string.post_failure_hint)
}
}
@ -403,15 +408,16 @@ object ErrorHelper {
val errorEntity: ErrorEntity? =
httpException?.response()?.errorBody()?.string()?.toObject()
when {
errorEntity?.code == 403099 -> {
Utils.toast(context, "当前账号正在注销,禁止登录")
}
errorEntity?.code == 403401 -> {//禁止登录
Utils.toast(context, "网络异常")
}
errorEntity?.toast?.isNotEmpty() == true -> {
Utils.toast(context, errorEntity.toast)
}
errorEntity?.code == 403099 -> Utils.toast(context, "当前账号正在注销,禁止登录")
// 用户禁止登录
errorEntity?.code == 403401 -> Utils.toast(context, "您的账号存在违规,不允许登录")
// 设备禁止登录
errorEntity?.code == 403404 -> Utils.toast(context, "您的设备存在违规,不允许登录")
errorEntity?.toast?.isNotEmpty() == true -> Utils.toast(context, errorEntity.toast)
else -> Utils.toast(context, R.string.login_failure)
}
} catch (e: Exception) {

View File

@ -3,10 +3,10 @@ package com.gh.common.util
import android.app.Activity
import android.os.Build
import android.view.Gravity
import android.view.View
import android.widget.TextView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.energy.EnergyBridge
import com.lightgame.utils.Util_System_Keyboard
import com.lzf.easyfloat.EasyFloat
@ -67,23 +67,14 @@ object FloatingBackViewManager {
}
dragEnd { view ->
val statusBarHeight = DisplayUtils.getStatusBarHeight(activity.resources)
// 记录停止拖动的最后位置
val outLocation = IntArray(2)
view.getLocationInWindow(outLocation)
val yOffset = outLocation[1]
view.findViewById<View>(R.id.titleTv)?.apply {
val outLocation = IntArray(2)
getLocationOnScreen(outLocation)
val yOffset = outLocation[1]
if (yOffset <= statusBarHeight) {
// 判断状态栏是否被消费
if (yOffset == view.y.toInt()) {
view.y = statusBarHeight.toFloat()
} else {
view.y = 0F
}
mLastPositionY = yOffset
}
mLastPositionY = yOffset
}
}
.show()
@ -113,8 +104,6 @@ object FloatingBackViewManager {
/**
* 停用返回小浮窗
* @param type 类型
* @param activityUrl 类型为活动的时候用的地址
*/
@JvmStatic
fun disableBackView() {

View File

@ -5,6 +5,7 @@ import android.content.Context
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.DefaultJsApi
import com.gh.common.constant.Config
import com.gh.common.dialog.CertificationDialog
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureManager
@ -12,6 +13,9 @@ import com.gh.common.exposure.ExposureSource
import com.gh.common.exposure.ExposureType
import com.gh.common.history.HistoryHelper
import com.gh.common.repository.ReservationRepository
import com.gh.common.simulator.NewSimulatorGameManager
import com.gh.common.simulator.SimulatorDownloadManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.download.DownloadManager
import com.gh.download.dialog.DownloadDialog
import com.gh.gamecenter.R
@ -27,8 +31,10 @@ import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.view.dsbridge.CompletionHandler
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.PluginLocation
@ -37,7 +43,10 @@ import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
import com.gh.vspace.VHelper
import com.lightgame.download.DownloadEntity
import com.lightgame.download.FileUtils
import com.lightgame.utils.Utils
import java.io.File
/**
* 游戏活动下载辅助类
@ -168,10 +177,13 @@ object GameActivityDownloadHelper {
) {
val apk = getApk(gameEntity, event, true) ?: return
val downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
if (downloadEntity != null) {
val str = GameUtils.getDownloadBtnText(context, gameEntity, PluginLocation.only_game)
if (downloadEntity != null &&
str != context.getString(R.string.install) &&
str != context.getString(R.string.launch)
) {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
} else {
val str = GameUtils.getDownloadBtnText(context, gameEntity, PluginLocation.only_game)
if (str == context.getString(R.string.download) || str == context.getString(R.string.attempt)) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
@ -182,7 +194,7 @@ object GameActivityDownloadHelper {
}
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
} else if (str == context.getString(R.string.smooth)) {
VHelper.validateVSpaceBeforeAction(context, gameEntity, true) {
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
@ -201,12 +213,73 @@ object GameActivityDownloadHelper {
}
}
}
} else if (str == context.getString(R.string.install) || str == context.getString(R.string.launch)) {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
} else if (str == context.getString(R.string.install)) {
val simulatorDownloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.url)
if (gameEntity.simulator != null) {
val isInstalled =
PackageUtils.isInstalledFromAllPackage(context, gameEntity.simulator!!.apk!!.packageName)
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator
val newSimulator = Config.getNewSimulatorEntitySetting()
if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (newSimulator.active) {
simulator = newSimulator
}
}
if (simulatorDownloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
context, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name!!, null
)
return
}
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
} else {
downloadEntity?.run {
install(context, gameEntity, apk, this)
}
}
} else if (str == context.getString(R.string.launch)) {
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(context, null)
return
}
val simulatorDownloadEntity =
SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk()[0].url)
if (simulatorDownloadEntity != null) {
val file = File(simulatorDownloadEntity.path)
if (!file.exists()) {
download(context, gameEntity, apk, false, entrance, location, traceEvent)
return
}
NewFlatLogUtils.logSimulatorGameCardClick("启动")
SimulatorGameManager.launchSimulatorGame(simulatorDownloadEntity, gameEntity)
}
return
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
return
}
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "启动", gameEntity.name)
}
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk()[0].packageName)
} else if (str == context.getString(R.string.update)) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
update(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
}
} else {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
}
}
}
@ -294,6 +367,29 @@ object GameActivityDownloadHelper {
}
}
// 安装
private fun install(
context: Context,
gameEntity: GameEntity,
apkEntity: ApkEntity,
downloadEntity: DownloadEntity
) {
val path = downloadEntity.path
when {
FileUtils.isEmptyFile(path) -> {
Utils.toast(context, R.string.install_failure_hint)
DownloadManager.getInstance().cancel(downloadEntity.url)
gameEntity.getEntryMap().remove(apkEntity.getPlatform())
}
PackageUtils.isCanPluggable(apkEntity) -> {
DialogHelper.showPluginDialog(context) { PackageInstaller.uninstall(context, path) }
}
else -> {
PackageInstaller.install(context, downloadEntity)
}
}
}
// 更新
private fun update(
context: Context,

View File

@ -1,16 +1,17 @@
package com.gh.common.util;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.widget.TextView;
import com.gh.common.view.DownloadButton;
import com.gh.gamecenter.core.AppExecutor;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import com.gh.common.constant.Config;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.view.DownloadButton;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.ApkLink;
import com.gh.gamecenter.entity.GameCollectionEntity;
@ -26,9 +27,6 @@ import com.lightgame.download.DownloadStatus;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
public class GameUtils {
/**
@ -80,7 +78,7 @@ public class GameUtils {
@WorkerThread
public static String getDownloadBtnText(Context context, GameEntity gameEntity, PluginLocation pluginLocation) {
if (gameEntity.getApk().size() > 1) {
return context.getString(R.string.expand);
return "";
}
int doneCount = 0; // 下载完成数量
@ -89,7 +87,7 @@ public class GameUtils {
int installCount = 0; // 已安装数量
boolean isRelatedEmulatorInstalled = false; // 若该游戏是模拟器游戏时其对应的模拟器是否已经安装
boolean isInstalledNewSimulator = false;// 是否安装新模拟器
DownloadEntity downloadEntity = null;
Object gh_id;
apkFor:
@ -138,6 +136,7 @@ public class GameUtils {
}
}
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context);
DownloadEntity simulatorDownloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apkEntity.getUrl());
if (simulatorDownloadEntity != null && gameEntity.getSimulator() != null) {
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(context, gameEntity.getSimulator().getApk().getPackageName());
@ -150,8 +149,7 @@ public class GameUtils {
}
}
}
if (isRelatedEmulatorInstalled && doneCount != 0) {
if ((isRelatedEmulatorInstalled || isInstalledNewSimulator) && doneCount != 0) {
return context.getString(R.string.launch);
}
@ -182,7 +180,17 @@ public class GameUtils {
if (gameEntity.isVGame()) {
return context.getString(R.string.smooth);
} else {
return context.getString(R.string.download);
if ("smooth".equals(gameEntity.getDownloadStatus())) {
GameEntity.GameCategory gameCategory = gameEntity.getGameCategory();
if (gameCategory.equals(GameEntity.GameCategory.ONLINE_GAME)
|| gameCategory.equals(GameEntity.GameCategory.INTERNATIONAL_ONLINE_GAME)) {
return context.getString(R.string.download);
} else {
return context.getString(R.string.attempt);
}
} else {
return context.getString(R.string.download);
}
}
}
}

View File

@ -12,6 +12,7 @@ import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.R;
@ -125,8 +126,8 @@ public class GameViewUtils {
DisplayUtils.dip2px(context, 4),
DisplayUtils.dip2px(context, 1));
textView.setTextColor(Color.parseColor("#" + tagEntity.getColor()));
textView.setBackground(DrawableView.getServerDrawable(Color.parseColor("#" + tagEntity.getBackground())));
textView.setTextColor(ExtensionsKt.hexStringToIntColor("#" + tagEntity.getColor(), Color.WHITE));
textView.setBackground(DrawableView.getServerDrawable(ExtensionsKt.hexStringToIntColor("#" + tagEntity.getBackground(), Color.WHITE)));
}
private static TextView getGameTagView(Context context, String tagStr, int rightMargin, String tagType, TagStyleEntity tagEntity) {
@ -149,10 +150,10 @@ public class GameViewUtils {
if ("border".equals(tagEntity.getStyle())) {
gradientDrawable.setColor(Color.TRANSPARENT);
gradientDrawable.setStroke(DisplayUtils.dip2px(context, 1f), Color.parseColor(colorStr));
tag.setTextColor(Color.parseColor(colorStr));
gradientDrawable.setStroke(DisplayUtils.dip2px(context, 1f), ExtensionsKt.hexStringToIntColor(colorStr, Color.WHITE));
tag.setTextColor(ExtensionsKt.hexStringToIntColor(colorStr, Color.WHITE));
} else {
gradientDrawable.setColor(Color.parseColor(colorStr));
gradientDrawable.setColor(ExtensionsKt.hexStringToIntColor(colorStr, Color.WHITE));
gradientDrawable.setShape(GradientDrawable.RECTANGLE);
tag.setTextColor(Color.WHITE);
}
@ -163,7 +164,7 @@ public class GameViewUtils {
if (colorStr == null) {
return null;
}
int color = Color.parseColor(colorStr);
int color = ExtensionsKt.hexStringToIntColor(colorStr, Color.WHITE);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.TRANSPARENT);
gradientDrawable.setStroke(DisplayUtils.dip2px(context, 1f), color);

View File

@ -70,7 +70,7 @@ public class InstallUtils {
if (!TextUtils.isEmpty(installVersion) && downloadEntity != null &&
installVersion.equals(downloadEntity.getVersionName())) {
if (!downloadEntity.isPluggable() || PackageUtils.isSignedByGh(context, packageName)) {
EventBus.getDefault().post(new EBPackage("安装", packageName, installVersion));
EventBus.getDefault().post(new EBPackage(EBPackage.TYPE_INSTALLED, packageName, installVersion));
}
}
}

View File

@ -18,7 +18,6 @@ import com.gh.gamecenter.adapter.LibaoDetailAdapter;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.NotificationHelper;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.core.utils.UrlFilterUtils;
import com.gh.gamecenter.entity.ApkEntity;
@ -165,6 +164,12 @@ public class LibaoUtils {
String status = shouldUpdateStatus ? updateStatus(libaoEntity) : libaoEntity.getStatus();
libaoBtn.setTextColor(Color.WHITE);
if (status == null || TextUtils.isEmpty(status)) return;
// 领取限制为活动发放且未领取显示查看
if (ExtensionsKt.toResString(R.string.libao_activity_grant).equals(libaoEntity.getReceiveLimit()) && !status.equals("linged")) {
libaoBtn.setText(R.string.libao_check);
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_style);
return;
}
switch (status) {
case "ling":
libaoBtn.setText(R.string.libao_ling);
@ -355,7 +360,14 @@ public class LibaoUtils {
Utils.toast(context, "还没到开始领取时间");
break;
case "查看":
if (!TextUtils.isEmpty(libaoEntity.getDes())) {
if (ExtensionsKt.toResString(R.string.libao_activity_grant).equals(libaoEntity.getReceiveLimit())) {
String url = libaoEntity.getActivityLink().getUrl();
DialogHelper.showLibaoActivityDialog(
v.getContext(),
TextUtils.isEmpty(url),
() -> DirectUtils.directToWebView(v.getContext(), url, "查看礼包码弹窗-查看活动详情")
);
} else if (!TextUtils.isEmpty(libaoEntity.getDes())) {
DialogHelper.showCenterDialog(v.getContext(), "使用说明", Html.fromHtml(libaoEntity.getDes()), "关闭", "", () -> {
}, () -> {
});

View File

@ -409,7 +409,7 @@ public class LogUtils {
public static void uploadWelcomeDialog(String action, String dialogId, String linkTitle) {
ExposureEntity payload = new ExposureEntity();
payload.setWelcomeDialogId(dialogId);
payload.setWelcomeDialogId(linkTitle);
payload.setWelcomeDialogLinkTitle(linkTitle);
SimpleLogContainerEntity entity = new SimpleLogContainerEntity();
entity.setEvent("dialog");
@ -553,7 +553,7 @@ public class LogUtils {
}
public static void uploadSearchGame(String event, String location, String key, String searchType) {
uploadSearchClick(event, location, key, searchType, "", "", false);
uploadSearchClick(event, location, key, searchType, "", "", false, false);
}
public static void uploadSearchClick(String event,
@ -562,7 +562,8 @@ public class LogUtils {
String searchType,
String gameId,
String gameName,
Boolean isMirrorData) {
Boolean isMirrorData,
Boolean isAdData) {
JSONObject object = new JSONObject();
JSONObject payload = new JSONObject();
try {
@ -576,6 +577,7 @@ public class LogUtils {
payload.put("game_id", gameId); //event为search_click才取值
payload.put("game_name", gameName); //event为search_click才取值
payload.put("is_mirror_data", isMirrorData);
payload.put("is_ad_data", isAdData);
object.put("payload", payload);
} catch (JSONException e) {
e.printStackTrace();

View File

@ -43,6 +43,7 @@ import com.tencent.connect.share.QQShare;
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
import com.tencent.mm.opensdk.modelmsg.WXImageObject;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import com.tencent.mm.opensdk.modelmsg.WXTextObject;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.tencent.open.TDialog;
@ -311,6 +312,51 @@ public class MessageShareUtils {
}
}
public void shareTextFromWeb(Activity activity, String text, String type) {
switch (type) {
case "qq":
Utils.toast(mContext, "分享跳转中...");
if (ShareUtils.isQQClientAvailable(activity)) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, text);
intent.setType("text/plain");
intent.setPackage("com.tencent.mobileqq");
intent.setClassName("com.tencent.mobileqq", "com.tencent.mobileqq.activity.JumpActivity");
try {
activity.startActivity(intent);
} catch (Exception e) {
Utils.toast(mContext, "分享失败");
}
} else {
Utils.toast(mContext, "请安装QQ客户端");
}
break;
case "wechat":
Utils.toast(mContext, "分享跳转中...");
if (!mIWXAPI.isWXAppInstalled() && !PermissionHelper.isGetInstalledListPermissionDisabled(mContext)) {
Utils.toast(mContext, mContext.getString(R.string.share_no_wechat_hint));
return;
}
WXTextObject textObj = new WXTextObject();
textObj.text = text;
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = textObj;
msg.description = text;
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("text");
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
mIWXAPI.sendReq(req);
break;
}
}
//QQ分享
private void qqShare() {
Utils.toast(mContext, "分享跳转中...");

View File

@ -461,17 +461,6 @@ object NewFlatLogUtils {
log(json, "event", false)
}
//设置点击深色模式跟随系统切换开关
@JvmStatic
fun logHaloSelfNightModeOsSwitch(isOn: Boolean) {
val json = json {
"event" to "halo_self_night_mode_os_switch"
"is_on" to isOn
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//触发关闭深色模式跟随系统切换弹窗
@JvmStatic
fun logHaloSelfNightModeOsDialog(buttonText: String) {
@ -558,7 +547,7 @@ object NewFlatLogUtils {
//手机号验证弹窗点击事件
fun logPhoneNumberVerifyDialogClick(entrance: String, text: String) {
val json = json {
"event" to "phone_number_verify_dialog_click"
"event" to "publish_phone_number_verify_dialog_click"
"entrance" to entrance
"text" to text
parseAndPutMeta().invoke(this)
@ -569,7 +558,7 @@ object NewFlatLogUtils {
//手机号验证界面展示事件
fun logPhoneNumberVerifyDialogShow(entrance: String) {
val json = json {
"event" to "phone_number_verify_dialog_show"
"event" to "publish_phone_number_verify_dialog_show"
"entrance" to entrance
parseAndPutMeta().invoke(this)
}
@ -580,7 +569,7 @@ object NewFlatLogUtils {
//完成手机号验证
fun logPhoneNumberVerifyDialogSuccess() {
val json = json {
"event" to "phone_number_verify_dialog_success"
"event" to "publish_phone_number_verify_dialog_success"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
@ -607,4 +596,625 @@ object NewFlatLogUtils {
}
log(json, "event", false)
}
//模拟器更新弹窗展示事件
@JvmStatic
fun logSimulatorUpdateAlertShow() {
val json = json {
"event" to "simulator_update_pop_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器更新弹窗按钮点击事件
@JvmStatic
fun logSimulatorUpdateAlertClick(buttonText: String) {
val json = json {
"event" to "simulator_update_pop_click"
"button_type" to buttonText
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器游戏页面展示事件
@JvmStatic
fun logSimulatorGamePageShow() {
val json = json {
"event" to "simulator_game_page_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器游戏类型Tab展示事件
@JvmStatic
fun logSimulatorGamePageTabClick(tabName: String) {
val json = json {
"event" to "simulator_game_tag_show"
"tab_name" to tabName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器游戏卡片点击事件
@JvmStatic
fun logSimulatorGameCardClick(buttonText: String) {
val json = json {
"event" to "simulator_game_card_click"
"button_type" to buttonText
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器游戏合集点击事件
@JvmStatic
fun logSimulatorGameCollectionClick() {
val json = json {
"event" to "simulator_game_collection_click"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏删除提示弹窗展示事件
@JvmStatic
fun logSimulatorGameDeleteAlertShow() {
val json = json {
"event" to "simulator_delete_game_pop_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏删除提示弹窗点击事件
@JvmStatic
fun logSimulatorGameDeleteAlertClick(buttonText: String) {
val json = json {
"event" to "simulator_delete_game_pop_click"
"button_type" to buttonText
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器管理页面展示事件
@JvmStatic
fun logSimulatorManagerClick() {
val json = json {
"event" to "simulator_manger_page_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器列表相关点击事件
fun logSimulatorListClick(buttonText: String, simulatorType: String) {
val json = json {
"event" to "simulator_list_click"
"button_type" to buttonText
"simulator_name" to simulatorType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器卸载提示弹窗展示事件
fun logSimulatorUninstallAlertShow(simulatorType: String) {
val json = json {
"event" to "simulator_uninstall_pop_show"
"simulator_name" to simulatorType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//模拟器卸载提示弹窗展示事件
fun logSimulatorUninstallAlertClick(buttonText: String) {
val json = json {
"event" to "simulator_uninstall_pop_click"
"button_type" to buttonText
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//进入发现页面
fun logDiscoverPageEnter() {
val json = json {
"event" to "discover_page_enter"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//离开发现页面
fun logDiscoverPageQuit(sequence: Int) {
val json = json {
"event" to "discover_page_quit"
"sequence" to sequence
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//发现页面可见事件
fun logDiscoverPageVisible() {
val json = json {
"event" to "discover_page_visible"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//发现页面不可见事件
fun logDiscoverPageInvisible(sequence: Int) {
val json = json {
"event" to "discover_page_invisible"
"sequence" to sequence
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//页面顶部露出
fun logDiscoverPageTopVisible(countNum: Int) {
val json = json {
"event" to "discover_page_top_visible"
"count_num" to countNum
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//页面底部停留
fun logDiscoverPageBottomStay(countNum: Int) {
val json = json {
"event" to "discover_page_bottom_stay"
"count_num" to countNum
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//点击兴趣推荐卡片
fun logDiscoverPageRecommendedInterestCardClick(sequence: Int, linkText: String, linkType: String, linkId: String) {
val json = json {
"event" to "discover_page_recommended_interest_card_click"
"sequence" to sequence
"link_text" to linkText
"link_type" to linkType
"link_id" to linkId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//点击跳转游戏库
fun logDiscoverPageJumpGamesLibraries() {
val json = json {
"event" to "discover_page_jump_games_libraries"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//触发不感兴趣
fun logDiscoverPageNotInterest(gameId: String, gameName: String) {
val json = json {
"event" to "discover_page_not_interest"
"game_id" to gameId
"game_name" to gameName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//跳过广告
@JvmStatic
fun logOpenScreenAdSkip(adId: String, linkText: String, linkType: String, linkId: String) {
val json = json {
"event" to "open_screen_ad_skip"
"ad_id" to adId
"link_text" to linkText
"link_type" to linkType
"link_id" to linkId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏单广场浏览时长
fun logGameCollectSquareStayTime(interval: Long) {
val json = json {
"event" to "game_collect_square_stay_time"
"interval" to interval
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏单浏览时长
fun logGameCollectStayTime(interval: Long, id: String, title: String) {
val json = json {
"event" to "game_collect_stay_time"
"interval" to interval
"game_collect_id" to id
"game_collect_title" to title
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 游戏存档页面展示事件
fun logGameArchivePageShow(tabName: String) {
val json = json {
"event" to "cloud_save_game_save_page_show"
"tab_name" to tabName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 云存档管理页面展示事件
fun logCloudArchiveManagePageShow(gameId: String, gameName: String, entrance: String) {
val json = json {
"event" to "cloud_save_manage_page_show"
"game_id" to gameId
"game_name" to gameName
"entrance" to entrance
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 云存档Tab页面展示事件
fun logCloudArchiveTabShow(gameId: String, gameName: String, tabName: String) {
val json = json {
"event" to "cloud_save_tab_page_show"
"game_id" to gameId
"game_name" to gameName
"tab_name" to tabName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档分享弹窗展示事件
fun logCloudArchiveShareDialogShow() {
val json = json {
"event" to "cloud_save_share_dialog_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档分享弹窗点击事件
fun logCloudArchiveShareDialogClick(buttonType: String) {
val json = json {
"event" to "cloud_save_share_dialog_click"
"button_type" to buttonType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档分享弹窗分享结果事件
fun logCloudArchiveShareDialogResult(shareResult: String) {
val json = json {
"event" to "cloud_save_share_dialog_result"
"share_result" to shareResult
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档删除弹窗展示事件
fun logCloudArchiveDeleteDialogShow() {
val json = json {
"event" to "cloud_save_delete_dialog_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档删除弹窗点击事件
fun logCloudArchiveDeleteDialogClick(buttonType: String) {
val json = json {
"event" to "cloud_save_delete_dialog_click"
"button_type" to buttonType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 上传存档弹窗展示事件
fun logCloudArchiveUploadDialogShow() {
val json = json {
"event" to "cloud_save_upload_dialog_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 上传存档弹窗点击事件
fun logCloudArchiveUploadDialogClick(buttonType: String) {
val json = json {
"event" to "cloud_save_upload_dialog_click"
"button_type" to buttonType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 畅玩助手下载提示弹窗展示事件
fun logCloudArchiveVSpaceDownloadDialogShow() {
val json = json {
"event" to "cloud_save_halo_fun_download_dialog_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 畅玩助手下载提示弹窗点击事件
fun logCloudArchiveVSpaceDownloadDialogClick(buttonType: String) {
val json = json {
"event" to "cloud_save_halo_fun_download_dialog_click"
"button_type" to buttonType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 游戏下载提示弹窗展示事件
fun logCloudArchiveGameDownloadDialogShow() {
val json = json {
"event" to "cloud_save_game_download_dialog_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 游戏下载提示弹窗点击事件
fun logCloudArchiveGameDownloadDialogClick(buttonType: String) {
val json = json {
"event" to "cloud_save_game_download_dialog_click"
"button_type" to buttonType
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 推荐游戏页面下载游戏事件
fun logCloudArchiveRecommendGameDownload(gameId: String, gameName: String) {
val json = json {
"event" to "cloud_save_recommend_game_page_download"
"game_id" to gameId
"game_name" to gameName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 搜索功能关键词上传事件
fun logCloudArchiveSearchKeyUpload(gameId: String, gameName: String, key: String) {
val json = json {
"event" to "cloud_save_search_key_upload"
"game_id" to gameId
"game_name" to gameName
"key" to key
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 云存档Tab展示事件/云存档Tab展示事件
fun logCloudArchiveGameDetailTabRelated(event: String, gameId: String, gameName: String) {
val json = json {
"event" to event
"game_id" to gameId
"game_name" to gameName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 云存档下载/使用事件
fun logCloudArchiveDownloadOrApply(archiveName: String, entrance: String) {
val json = json {
"event" to "cloud_save_download"
"cloud_save_name" to archiveName
"entrance" to entrance
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 存档覆盖风险提示弹窗展示事件/存档覆盖风险提示弹窗点击事件
fun logCloudArchiveApplyDialogRelated(event: String, buttonType: String = "") {
val json = json {
"event" to event
if (buttonType.isNotBlank()) {
"button_type" to buttonType
}
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 进入发现页详情
fun logDiscoverDetailPageEnter(entrance: String, blockName: String = "") {
val json = json {
"event" to "discover_detail_page_enter"
"entrance" to entrance
if (blockName.isNotBlank()) {
"block_name" to blockName
}
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 点击设置偏好
fun logInterestedGameClick(entrance: String, blockName: String = "") {
val json = json {
"event" to "discover_preference_settings_click"
"entrance" to entrance
if (blockName.isNotBlank()) {
"block_name" to blockName
}
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 进入游戏偏好页面
fun logInterestedGamePageEnter(frequency: String, prefer: String, tendency: String, typeTags: JSONArray) {
val json = json {
"event" to "discover_preference_game_page_enter"
"frequency" to frequency
"prefer" to prefer
"tendency" to tendency
"type_tags" to typeTags
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 离开游戏偏好页面
fun logInterestedGamePageExit(
frequency: String,
prefer: String,
tendency: String,
typeTags: JSONArray,
) {
val json = json {
"event" to "discover_preference_game_page_quit"
"frequency" to frequency
"prefer" to prefer
"tendency" to tendency
"type_tags" to typeTags
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 浏览游戏偏好页面
fun logInterestedGamePageBrowse(
frequency: String,
prefer: String,
tendency: String,
typeTags: JSONArray,
interval: Long
) {
val json = json {
"event" to "discover_preference_game_view"
"frequency" to frequency
"prefer" to prefer
"tendency" to tendency
"type_tags" to typeTags
"interval" to interval
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 展开感兴趣的分类弹窗
fun logInterestedGameTypeDialogShow(typeTags: JSONArray) {
val json = json {
"event" to "discover_preference_type_tags_dialog_show"
"type_tags" to typeTags
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 关闭感兴趣的分类弹窗
fun logInterestedGameTypeDialogClose(typeTags: JSONArray) {
val json = json {
"event" to "discover_preference_type_tags_dialog_close"
"type_tags" to typeTags
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 浏览感兴趣的分类弹窗
fun logInterestedGameTypeDialogBrowse(typeTags: JSONArray, interval: Long) {
val json = json {
"event" to "discover_preference_type_tags_dialog_view"
"type_tags" to typeTags
"interval" to interval
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏详情-游戏单推荐,点击右上角进入游戏单广场时触发
fun logGameDetailGameListRecommendSquareJump(gameName: String, gameId: String) {
val json = json {
"event" to "game_detail_game_list_recommend_square_jump"
"game_name" to gameName
"game_id" to gameId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//游戏详情-专题推荐,点击右上角时触发
fun logGameDetailColumnRecommendUpperRightClick(
gameName: String,
gameId: String,
buttonType: String,
columnName: String,
columnId: String,
linkText: String,
linkType: String,
linkId: String
) {
val json = json {
"event" to "game_detail_column_recommend_upper_right_click"
"game_name" to gameName
"game_id" to gameId
"button_type" to buttonType
"column_name" to columnName
"column_id" to columnId
"link_text" to linkText
"link_type" to linkType
"link_id" to linkId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//用户通过活动页的“立即投稿/添加”成功创建游戏单时上报
fun logActivityGameListCreateSuccessV2(
entrance: String,
gameId: String,
gameName: String,
gameCollectId: String,
gameCollectTitle: String,
activityId: String,
activityName: String,
) {
val json = json {
"event" to "activity_game_list_create_success_v2"
"entrance" to entrance
if (gameId.isNotEmpty()) {
"game_id" to gameId
}
if (gameName.isNotEmpty()) {
"game_name" to gameName
}
"game_collect_id" to gameCollectId
"game_collect_title" to gameCollectTitle
"activity_id" to activityId
"activity_name" to activityName
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
}

View File

@ -1,6 +1,7 @@
package com.gh.common.util
import android.annotation.SuppressLint
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.common.json.JsonObjectBuilder
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.loghub.LoghubUtils
@ -8,12 +9,10 @@ import com.gh.gamecenter.common.retrofit.EmptyResponse
import com.gh.gamecenter.common.tracker.Tracker
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.entity.QuoteCountEntity
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.lightgame.utils.Utils
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import org.json.JSONArray
import org.json.JSONObject
object NewLogUtils {
@ -1896,20 +1895,6 @@ object NewLogUtils {
log(json, "appointment", false)
}
//点击微信提醒
@JvmStatic
fun logWechatRemindConfigClick(wechatConfigEntity: WechatConfigEntity) {
val json = json {
"event" to "appointment_wechat_remind_config_click"
"wechat_is_bind" to wechatConfigEntity.bind
"wechat_is_follow" to wechatConfigEntity.follow
"wechat_is_remind" to wechatConfigEntity.notice
"timestamp" to System.currentTimeMillis() / 1000
parseAndPutMeta().invoke(this)
}
log(json, "appointment", false)
}
//选择图片上传方式
@JvmStatic
fun logShowGameCollectionCoverTypeDialog() {

View File

@ -55,11 +55,11 @@ object PackageInstaller {
fun install(context: Context, downloadEntity: DownloadEntity, showUnzipToast: Boolean) {
val pkgPath = downloadEntity.path
val isXapk = XapkInstaller.XAPK_EXTENSION_NAME == pkgPath.getExtension()
val isSmoothGame = downloadEntity.getMetaExtra(Constants.SMOOTH_GAME) == "true"
val isVGame = downloadEntity.getMetaExtra(Constants.SMOOTH_GAME) == "true"
val currentActivity = CurrentActivityHolder.getCurrentActivity() ?: return
if (isSmoothGame) {
if (isVGame) {
VHelper.install(currentActivity, downloadEntity)
return
}

View File

@ -28,6 +28,8 @@ import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.PackageFlavorHelper;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.utils.MD5Utils;
import com.gh.gamecenter.core.utils.SentryHelper;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
@ -55,6 +57,7 @@ import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
@ -72,6 +75,36 @@ public class PackageUtils {
private static final String TAG = "PackageUtils";
public static String getInstallPackageInfoSourceDir(String packageName) {
try {
return HaloApp.getInstance().getApplication().getPackageManager().getPackageInfo(packageName,
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).applicationInfo.sourceDir;
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return null;
}
/**
* 根据packageName和模拟器apk文件的MD5去判断目标文件是否需要更新
*
* @param packageName 包名
* @param MD5Str 文件MD5
*/
public static boolean isInstalledApkMatchedMd5(String packageName, String MD5Str) {
if (MD5Str == null){
Utils.log("MD5Str is null");
return false;
}
String path = getInstallPackageInfoSourceDir(packageName);
if (path == null){
Utils.log("File path null");
return false;
}
File file = new File(path);
return !(MD5Str.equals(MD5Utils.calculateMD5(file)));
}
/*
* 判断是否可以更新只判断gh_version的大小
*/
@ -984,7 +1017,7 @@ public class PackageUtils {
public static boolean checkWebViewIsAvailable(Context context) {
List<String> webViewAbiList = HaloApp.getInstance().getWebViewAbiList();
if (webViewAbiList != null) {
if (webViewAbiList != null && !webViewAbiList.isEmpty()) {
if (webViewAbiList.size() == 2 && webViewAbiList.contains("x86") && webViewAbiList.contains("x86_64")) {
return true;
}

View File

@ -8,9 +8,9 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.retrofit.RetrofitManager

View File

@ -3,11 +3,11 @@ package com.gh.common.util
import android.annotation.SuppressLint
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.utils.createRequestBody
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager

View File

@ -12,9 +12,10 @@ import android.widget.PopupWindow
import android.widget.TextView
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.visibleIf
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.CatalogEntity
import com.gh.gamecenter.entity.SubjectSettingEntity
import com.google.android.flexbox.FlexboxLayout
@ -94,13 +95,8 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectTypePopupWindow(containerView: View, typeTv: TextView, typeText: String) {
val drawableUp = ContextCompat.getDrawable(typeTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(typeTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
typeTv.setTextColor(R.color.theme_font.toColor(context))
typeTv.setCompoundDrawables(null, null, drawableUp, null)
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(typeTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -145,7 +141,7 @@ class CatalogFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
typeTv.setTextColor(R.color.text_757575.toColor(context))
typeTv.setCompoundDrawables(null, null, drawableDown, null)
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mTypePopupWindow = null
}
@ -156,13 +152,8 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectCatalogPopupWindow(containerView: View, catalogTv: TextView, catalogText: String) {
val drawableUp = ContextCompat.getDrawable(catalogTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(catalogTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
catalogTv.setTextColor(R.color.theme_font.toColor(context))
catalogTv.setCompoundDrawables(null, null, drawableUp, null)
catalogTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(catalogTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -209,7 +200,7 @@ class CatalogFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
catalogTv.setTextColor(R.color.text_757575.toColor(context))
catalogTv.setCompoundDrawables(null, null, drawableDown, null)
catalogTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mCatalogPopupWindow = null
}
@ -220,13 +211,8 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectSizePopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
val drawableUp = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
sizeTv.setTextColor(R.color.theme_font.toColor(context))
sizeTv.setCompoundDrawables(null, null, drawableUp, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -281,7 +267,7 @@ class CatalogFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
sizeTv.setTextColor(R.color.text_757575.toColor(context))
sizeTv.setCompoundDrawables(null, null, drawableDown, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mSizePopupWindow = null
}

View File

@ -11,9 +11,10 @@ import android.widget.PopupWindow
import android.widget.TextView
import androidx.annotation.ColorInt
import androidx.core.content.ContextCompat
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.entity.SubjectSettingEntity
import com.google.android.flexbox.FlexboxLayout
@ -89,13 +90,8 @@ class CategoryFilterView @JvmOverloads constructor(
}
private fun showSelectTypePopupWindow(containerView: View, typeTv: TextView, typeText: String) {
val drawableUp = ContextCompat.getDrawable(typeTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(typeTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
typeTv.setTextColor(R.color.theme_font.toColor(context))
typeTv.setCompoundDrawables(null, null, drawableUp, null)
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(typeTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -141,7 +137,7 @@ class CategoryFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
typeTv.setTextColor(R.color.text_757575.toColor(context))
typeTv.setCompoundDrawables(null, null, drawableDown, null)
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mTypePopupWindow = null
}
@ -152,13 +148,8 @@ class CategoryFilterView @JvmOverloads constructor(
}
private fun showSelectSizePopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
val drawableUp = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
sizeTv.setTextColor(R.color.theme_font.toColor(context))
sizeTv.setCompoundDrawables(null, null, drawableUp, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -214,7 +205,7 @@ class CategoryFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
sizeTv.setTextColor(R.color.text_757575.toColor(context))
sizeTv.setCompoundDrawables(null, null, drawableDown, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mSizePopupWindow = null
}

View File

@ -9,8 +9,8 @@ import android.widget.LinearLayout
import android.widget.PopupWindow
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.entity.SubjectSettingEntity
@ -112,14 +112,8 @@ class ConfigFilterView @JvmOverloads constructor(
}
private fun showSelectionPopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
val drawableUp = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown =
ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
sizeTv.setTextColor(R.color.theme_font.toColor(sizeTv.context))
sizeTv.setCompoundDrawables(null, null, drawableUp, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -178,7 +172,7 @@ class ConfigFilterView @JvmOverloads constructor(
popupWindow.setOnDismissListener {
sizeTv.setTextColor(R.color.text_757575.toColor(sizeTv.context))
sizeTv.setCompoundDrawables(null, null, drawableDown, null)
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
mPopupWindow = null
}

View File

@ -45,12 +45,7 @@ class DownloadButton @JvmOverloads constructor(
}
var text: String
get() {
if (showProgress && mText.contains("%")) {
return context.getString(R.string.downloading)
}
return mText
}
get() = mText
set(value) {
mText = value
invalidate()
@ -123,11 +118,7 @@ class DownloadButton @JvmOverloads constructor(
}
fun setText(@StringRes res: Int) {
text = if (mShowPercent && res == R.string.downloading) {
"${progress / 10}%"
} else {
context.getString(res)
}
text = context.getString(res)
invalidate()
}
@ -156,6 +147,7 @@ class DownloadButton @JvmOverloads constructor(
when (buttonStyle) {
ButtonStyle.NORMAL,
ButtonStyle.INSTALL_NORMAL,
ButtonStyle.XAPK_FAILURE,
ButtonStyle.NONE_WITH_HINT,
ButtonStyle.H5_GAME,
ButtonStyle.SPECIAL_DOWNLOAD,
@ -187,6 +179,7 @@ class DownloadButton @JvmOverloads constructor(
progress = 0
mDefaultColor = R.color.white.toColor(context)
}
ButtonStyle.FAILURE,
ButtonStyle.NONE,
ButtonStyle.RESERVED -> {
progressDrawable = null
@ -201,6 +194,8 @@ class DownloadButton @JvmOverloads constructor(
progress = 0
mDefaultColor = R.color.white.toColor(context)
}
ButtonStyle.XAPK_SUCCESS,
ButtonStyle.XAPK_UNZIPPING,
ButtonStyle.DOWNLOADING_NORMAL -> {
if (showProgress) {
progressDrawable =
@ -239,18 +234,6 @@ class DownloadButton @JvmOverloads constructor(
progress = 0
mDefaultColor = R.color.theme_font.toColor(context)
}
ButtonStyle.FAILURE -> {
progressDrawable = null
background = R.drawable.game_item_btn_pause_style.toDrawable(context)
progress = 0
mDefaultColor = R.color.white.toColor(context)
}
ButtonStyle.XAPK_FAILURE,
ButtonStyle.XAPK_SUCCESS,
ButtonStyle.XAPK_UNZIPPING -> {
mDefaultColor = R.color.white.toColor(context)
progressDrawable = R.drawable.progressbar_xapk_detail_style.toDrawable(context)
}
}
mPaintColor = mDefaultColor
}

View File

@ -14,9 +14,10 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.databinding.ItemFilterBinding
import com.gh.gamecenter.databinding.LayoutFilterBinding
@ -107,13 +108,8 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
subFilterText: String,
selectedCallback: ((String) -> Unit)
) {
val drawableUp = ContextCompat.getDrawable(subFilterTv.context, R.drawable.ic_filter_arrow_up)
val drawableDown = ContextCompat.getDrawable(subFilterTv.context, R.drawable.ic_filter_arrow_down)
drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight)
drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight)
subFilterTv.setTextColor(R.color.theme_font.toColor(context))
subFilterTv.setCompoundDrawables(null, null, drawableUp, null)
subFilterTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(subFilterTv.context)
val layout = inflater.inflate(R.layout.layout_filter_size, null)
@ -163,7 +159,7 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
}
popupWindow.setOnDismissListener {
subFilterTv.setCompoundDrawables(null, null, drawableDown, null)
subFilterTv.setDrawableEnd(R.drawable.ic_filter_arrow_down)
}
popupWindow.isTouchable = true

View File

@ -6,18 +6,19 @@ import android.graphics.drawable.GradientDrawable
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import androidx.cardview.widget.CardView
import androidx.annotation.ColorRes
import com.facebook.drawee.generic.RoundingParams
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.RadiusCardView
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.GameEntity
import splitties.views.dsl.core.add
import splitties.views.dsl.core.lParams
import splitties.views.dsl.core.matchParent
class GameIconView : CardView {
class GameIconView : RadiusCardView {
private var mCornerRadius = 0
private var mBorderColor = 0
@ -28,6 +29,7 @@ class GameIconView : CardView {
private var mGameIconIv: SimpleDraweeView? = null
private var mGameIconDecorationIv: SimpleDraweeView? = null
private var mBorderView: View? = null
private var mIsRemoveCrevice = false
constructor(context: Context) : super(context, null) {
initView(null)
@ -58,6 +60,7 @@ class GameIconView : CardView {
mGameIconOverlayColor = ta.getColor(R.styleable.GameIconView_gameIconOverlayColor, 0)
mBorderWidth = ta.getDimensionPixelSize(R.styleable.GameIconView_gameIconBorderWidth, 1)
mFadeDuration = ta.getInt(R.styleable.GameIconView_gameIconFadeDuration, -1)
mIsRemoveCrevice = ta.getBoolean(R.styleable.GameIconView_gameIconRemoveCrevice, false)
ta.recycle()
}
@ -112,14 +115,17 @@ class GameIconView : CardView {
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
setBorder(w)
}
private fun setBorder(width: Int) {
val cornerRadius = if (!isInEditMode) {
getCornerRadius(w)
getCornerRadius(width)
} else {
0F
}
radius = cornerRadius
setRadiusPx(cornerRadius, cornerRadius, cornerRadius, cornerRadius)
cardElevation = 0F
// 一些设备(没错,又是 vivo),代码设置 CardView 的 radius 无效(xml 设置有效)
@ -131,16 +137,24 @@ class GameIconView : CardView {
if (mBorderColor != 0) {
// 当图片为动图时设置边框无效所以改为增加一个View专门用来设置边框
// roundingParams.setBorder(mBorderColor, mBorderWidth.toFloat())
//roundingParams.setBorder(mBorderColor, mBorderWidth.toFloat())
val drawable = GradientDrawable().apply {
shape = GradientDrawable.RECTANGLE
setCornerRadius(cornerRadius)
//骚操作~ 这里加这个操作是为了防止图片和边框有间隙
setCornerRadius(cornerRadius - if (mIsRemoveCrevice) mBorderWidth else 0)
setColor(R.color.transparent.toColor())
setStroke(mBorderWidth, mBorderColor)
}
mBorderView?.background = drawable
}
//骚操作~ 这里加这个操作是为了防止图片和边框有间隙、防止右上角的静态小标签都被挡住
if (mBorderWidth != 0) {
val halfBorderWidth = (mBorderWidth / 2F).toInt()
mGameIconIv?.setPadding(halfBorderWidth, halfBorderWidth, halfBorderWidth, halfBorderWidth)
mGameIconDecorationIv?.setPadding(halfBorderWidth, halfBorderWidth, halfBorderWidth, halfBorderWidth)
}
mGameIconIv?.hierarchy?.roundingParams = roundingParams
mGameIconDecorationIv?.hierarchy?.roundingParams = roundingParams
}
@ -149,6 +163,11 @@ class GameIconView : CardView {
mCornerRadius = cornerRadius
}
fun setBorderColor(@ColorRes color: Int) {
mBorderColor = color.toColor(context)
setBorder(measuredWidth)
}
private fun getCornerRadius(width: Int): Float {
// 预设的圆角设置优先级更高
if (mCornerRadius != 0) {

View File

@ -0,0 +1,38 @@
package com.gh.common.view
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView
/**
* 去除省略号后面空白的TextView
*/
class NoEllipsizeSpaceTextView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) :
AppCompatTextView(context, attrs, defStyleAttr) {
override fun setText(text: CharSequence?, type: BufferType?) {
super.setText(text, type)
post {
if (layout != null) {
val rawText = layout.text.toString()
if (rawText.contains(ELLIPSIS_NORMAL)) {
val index = rawText.indexOf(ELLIPSIS_BLANK)
var trimText = rawText
if (index > 0) {
trimText = rawText.substring(0, index)
}
trimText = rawText.substring(0, trimText.length - 1) + ELLIPSIS_NORMAL
setText(trimText)
}
}
}
}
companion object {
private const val ELLIPSIS_NORMAL = "\u2026" // 省略号字符(...)
private const val ELLIPSIS_BLANK = "\uFEFF" // 空白字符
}
}

View File

@ -36,6 +36,7 @@ import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.core.utils.SentryHelper;
import com.gh.gamecenter.download.DownloadedGameIdAndPackageNameDao;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
@ -389,12 +390,16 @@ public class DownloadManager implements DownloadStatusListener {
* 清理不存在本地 APK 文件的任务
*/
public void clearTasksThatFileBeenDeleted() {
for (DownloadEntity entity : getAllDownloadEntity()) {
if (entity.getStatus() == DownloadStatus.done) {
if (FileUtils.isEmptyFile(entity.getPath())) {
cancel(entity.getUrl());
try {
for (DownloadEntity entity : getAllDownloadEntity()) {
if (entity.getStatus() == DownloadStatus.done) {
if (FileUtils.isEmptyFile(entity.getPath())) {
cancel(entity.getUrl());
}
}
}
} catch (Exception e) {
SentryHelper.INSTANCE.onEvent("CLEAR_DELETED_TASK_ERROR", "exception_digest", e.getLocalizedMessage());
}
}
@ -574,7 +579,7 @@ public class DownloadManager implements DownloadStatusListener {
* @return null表示下载列表中不存在该任务否则返回下载任务
*/
@Nullable
private DownloadEntity getDownloadEntitySnapshot(String url, String gameId, boolean isVGame) {
public DownloadEntity getDownloadEntitySnapshot(String url, String gameId, boolean isVGame) {
DownloadEntity snapshot = null;
if (isVGame && !TextUtils.isEmpty(gameId)) {
@ -688,6 +693,14 @@ public class DownloadManager implements DownloadStatusListener {
return filterSilentDownloadTask(all);
}
/**
* 获取下载列表中除下载状态为完成以外的任务
*/
public List<DownloadEntity> getAllDownloadEntityExcludeDoneTask() {
List<DownloadEntity> all = getAllDownloadEntity();
return filterDoneDownloadTask(all);
}
/**
* 获取下载列表中的畅玩下载任务快照
*/
@ -728,6 +741,20 @@ public class DownloadManager implements DownloadStatusListener {
return filteredDownloadEntityList;
}
private ArrayList<DownloadEntity> filterDoneDownloadTask(List<DownloadEntity> downloadEntityList) {
ArrayList<DownloadEntity> filteredDownloadEntityList = new ArrayList<>();
if (downloadEntityList == null) return filteredDownloadEntityList;
for (DownloadEntity downloadEntity : downloadEntityList) {
if (downloadEntity.getStatus() != DownloadStatus.done) {
filteredDownloadEntityList.add(downloadEntity);
}
}
return filteredDownloadEntityList;
}
public ArrayMap<String, DownloadEntity> getEntryMap(String name) {
return gameMap.get(name);
}
@ -868,7 +895,7 @@ public class DownloadManager implements DownloadStatusListener {
Utils.log(DownloadManager.class.getSimpleName(), "addObserver");
DataChanger.INSTANCE.addObserver(dataWatcher);
notifyDownloadedStatusASAP(dataWatcher);
notifyDownloadStatusASAP(dataWatcher);
}
/**
@ -880,13 +907,11 @@ public class DownloadManager implements DownloadStatusListener {
}
/**
* 立马通知 dataWatcher 更新下载完的任务状态,这里的下载完成是持久状态,不是瞬时状态
* 立马通知 dataWatcher 更新下载任务状态
*/
private void notifyDownloadedStatusASAP(DataWatcher dataWatcher) {
private void notifyDownloadStatusASAP(DataWatcher dataWatcher) {
for (DownloadEntity downloadEntity : getAllDownloadEntitySnapshots()) {
if (downloadEntity.getStatus() == DownloadStatus.done) {
dataWatcher.onDataInit(downloadEntity);
}
dataWatcher.onDataInit(downloadEntity);
}
}
@ -951,7 +976,7 @@ public class DownloadManager implements DownloadStatusListener {
public void checkAndRetryDownload() {
if (!NetworkUtils.isWifiConnected(mContext)) return;
for (DownloadEntity downloadEntity : DownloadManager.getInstance().getAllDownloadEntityExcludeSilentTask()) {
for (DownloadEntity downloadEntity : DownloadManager.getInstance().getAllDownloadEntityExcludeDoneTask()) {
if (DownloadStatus.neterror.equals(downloadEntity.getStatus())
|| DownloadStatus.timeout.equals(downloadEntity.getStatus())
|| DownloadStatus.subscribe.equals(downloadEntity.getStatus())) {

View File

@ -22,7 +22,7 @@ import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.packagehelper.PackageRepository
import com.gh.gamecenter.packagehelper.PackageViewModel
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.GameDownloadSettingFragment.Companion.CONCERN_GAME_SP_KEY
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.download.FileUtils
@ -91,7 +91,7 @@ object PackageObserver {
gameId = approximateGameId
}
if ("安装" == busFour.type) {
if (EBPackage.TYPE_INSTALLED == busFour.type) {
mPackageViewModel.addInstalledGame(packageName)
BrowserInstallHelper.onApkInstalled(mDownloadEntity?.path)
@ -109,7 +109,7 @@ object PackageObserver {
DownloadManager.getInstance().cancel(mDownloadEntity.url, false, true, false)
if (SPUtils.getBoolean(CONCERN_GAME_SP_KEY, true)) { //设置页面控制是否安装后自动关注
if (SPUtils.getBoolean(GameDownloadSettingFragment.CONCERN_GAME_SP_KEY, true)) { //设置页面控制是否安装后自动关注
// 安装后关注游戏
val finalDownloadEntity = mDownloadEntity
RetrofitManager.getInstance().api

View File

@ -14,17 +14,19 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.*
import androidx.recyclerview.widget.RecyclerView.SmoothScroller
import com.gh.gamecenter.core.utils.TimeElapsedHelper
import com.gh.gamecenter.common.base.fragment.BaseDraggableDialogFragment
import com.gh.common.exposure.ExposureEvent
import com.gh.common.util.*
import com.gh.download.DownloadManager
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseDraggableDialogFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.observeNonNull
import com.gh.gamecenter.common.utils.throwExceptionInDebug
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.TimeElapsedHelper
import com.gh.gamecenter.databinding.DialogDownloadBinding
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.GameEntity
@ -48,6 +50,9 @@ class DownloadDialog : BaseDraggableDialogFragment() {
private var mAdapter: DownloadDialogAdapter? = null
private var mTraceEvent: ExposureEvent? = null
private var mPlatformName: String = ""
private var mPackageName: String = ""
private var mParentBundle: Bundle? = null
// 合集页面保持和后台一样的顺序
private var mCollectionAdapter: DownloadDialogAdapter? = null
@ -91,6 +96,9 @@ class DownloadDialog : BaseDraggableDialogFragment() {
EventBus.getDefault().register(this)
super.onCreate(savedInstanceState)
mParentBundle = requireActivity().intent.extras?.getBundle(ToolBarActivity.NORMAL_FRAGMENT_BUNDLE)
mPlatformName = mParentBundle?.getString(EntranceConsts.KEY_PLATFORM, "") ?: ""
mPackageName = mParentBundle?.getString(EntranceConsts.KEY_PACKAGENAME, "") ?: ""
mGameEntity = requireArguments().getParcelable(GameEntity::class.java.simpleName)!!
mEntrance = requireArguments().getString(EntranceConsts.KEY_ENTRANCE) ?: ""
mLocation = requireArguments().getString(EntranceConsts.KEY_LOCATION) ?: ""
@ -106,6 +114,7 @@ class DownloadDialog : BaseDraggableDialogFragment() {
DownloadDialogAdapter(requireContext(), mViewModel, itemList, false, mTraceEvent, mEntrance, mLocation)
mBinding.contentList.layoutManager = createLayoutManager(itemList)
mBinding.contentList.adapter = mAdapter
performAutoDownload(itemList, mBinding.contentList)
})
mViewModel.collectionLiveData.observe(this, Observer { collection ->
@ -145,7 +154,7 @@ class DownloadDialog : BaseDraggableDialogFragment() {
)
mBinding.collectionList.layoutManager = createLayoutManager(itemList)
mBinding.collectionList.adapter = mCollectionAdapter
performAutoDownload(itemList, mBinding.collectionList)
if (mAdapter != null) collectionEnterAnimation()
} else {
mBinding.title.text = ("选择下载" + mGameEntity?.pluginDesc + "版本")
@ -161,6 +170,41 @@ class DownloadDialog : BaseDraggableDialogFragment() {
mElapsedHelper = TimeElapsedHelper()
}
//自动下载
private fun performAutoDownload(itemList: List<DownloadDialogItemData>, recyclerView: RecyclerView) {
if (mPlatformName.isEmpty() && mPackageName.isEmpty()) return
AppExecutor.uiExecutor.executeWithDelay({
recyclerView.adapter?.let {
for (i in 0 until it.itemCount) {
val apkEntity = itemList[i].normal ?: continue
val apkCollection = apkEntity.apkCollection
if (apkCollection != null) {
if (apkCollection.name == mPlatformName) {
scrollAndDownload(recyclerView, false, i)
break
}
}
if (apkEntity.getPlatformName() == mPlatformName || apkEntity.packageName == mPackageName) {
scrollAndDownload(recyclerView, true, i)
break
}
}
}
}, 200)
}
private fun scrollAndDownload(recyclerView: RecyclerView, isResetBundle: Boolean, position: Int) {
recyclerView.scrollToPosition(position)
AppExecutor.uiExecutor.executeWithDelay({
val viewHolder = recyclerView.findViewHolderForAdapterPosition(position)
viewHolder?.itemView?.performClick()
if (isResetBundle) {
mParentBundle?.putString(EntranceConsts.KEY_PLATFORM, "")
mParentBundle?.putString(EntranceConsts.KEY_PACKAGENAME, "")
}
}, 200)
}
@SuppressLint("ClickableViewAccessibility")
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
mBinding = DialogDownloadBinding.bind(layoutInflater.inflate(R.layout.dialog_download, container, false))

View File

@ -83,7 +83,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
binding.containerView.setBackgroundResource(R.drawable.download_dialog_item_background)
binding.status.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
binding.status.removeDrawable()
changeRecommendUI(apkEntity, listData, position)
if (apkLink != null) {
@ -95,12 +95,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
binding.remark.goneIf(apkLink.remark.isEmpty())
binding.status.text = "点击查看"
binding.status.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(binding.status.context, R.drawable.download_dialog_collection_status_link),
null
)
binding.status.setDrawableEnd(R.drawable.download_dialog_collection_status_link)
binding.containerView.setBackgroundResource(R.drawable.download_dialog_installed_background)
itemView.setTag(DownloadDialogAdapter.ITEM_TAG_KEY, DownloadDialogItemStatus.LINK)
} else if (apkCollection != null || (!isCollectionPage && apkEntity.downloadInstruction.isNotEmpty())) {
@ -149,15 +144,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
binding.status.visibility = View.VISIBLE
binding.status.text = "可更新"
binding.status.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(
binding.status.context,
R.drawable.download_dialog_collection_status_update
),
null
)
binding.status.setDrawableEnd(R.drawable.download_dialog_collection_status_update)
binding.downloadStatusIcon.visibility = View.GONE
itemView.setTag(DownloadDialogAdapter.ITEM_TAG_KEY, DownloadDialogItemStatus.UPDATE)
} else if (PackageUtils.getGhId(apkEntity.packageName) == gameEntity.id ||
@ -184,15 +171,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
// 点击启动
binding.status.text = "点击启动"
itemView.setTag(DownloadDialogAdapter.ITEM_TAG_KEY, DownloadDialogItemStatus.LAUNCH)
binding.status.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
ContextCompat.getDrawable(
binding.status.context,
R.drawable.download_dialog_collection_status_launch
),
null
)
binding.status.setDrawableEnd(R.drawable.download_dialog_collection_status_launch)
}
} else {
binding.downloadStatusIcon.visibility = View.VISIBLE

View File

@ -0,0 +1,25 @@
package com.gh.download.simple
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
class AutoUnregisteredSimpleDownloadListener(var id: String, fragment: Fragment, var listener: DownloadListener) {
init {
fragment.parentFragmentManager.registerFragmentLifecycleCallbacks(
object : FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentViewDestroyed(fm: FragmentManager, f: Fragment) {
super.onFragmentViewDestroyed(fm, f)
if (f === fragment) {
DownloadMessageHandler.unregisterListener(id, listener)
fragment.parentFragmentManager.unregisterFragmentLifecycleCallbacks(this)
}
}
}, false
)
DownloadMessageHandler.registerListener(id, listener)
}
fun unregisteredListener() {
DownloadMessageHandler.unregisterListener(id, listener)
}
}

View File

@ -0,0 +1,105 @@
package com.gh.download.simple
import com.lg.download.DownloadError
import com.lg.download.DownloadStatus
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.roundTo
import com.gh.gamecenter.common.utils.setDebouncedClickListener
import com.gh.gamecenter.core.utils.ToastUtils
import com.lightgame.utils.Utils
open class DownloadButtonHelper(
private val mDownloadId: String,
private val mProgressView: SimpleProgressView,
) : DownloadListener {
private var mProgressText = ""
init {
mProgressView.setTag(R.string.app_name, mDownloadId)
mProgressView.setTextSize(12F.dip2px().toFloat())
}
override fun onError(error: DownloadError) {
Utils.log(error)
}
override fun onProgress(progress: Float) {
if (mProgressView.getTag(R.string.app_name) == mDownloadId) {
val realTimeDownloadEntity = DownloadMessageHandler.findEntity(mDownloadId)
mProgressText = "${progress.roundTo(1)}%"
mProgressView.progress = (progress).toInt()
if (realTimeDownloadEntity?.status == DownloadStatus.DOWNLOADING) {
mProgressView.text = mProgressText
}
}
}
override fun onSizeReceived(fileSize: Long) {
//nothing for sonar
}
override fun onStatusChanged(status: DownloadStatus) {
if (mProgressView.getTag(R.string.app_name) == mDownloadId) {
when (status) {
DownloadStatus.PAUSED -> {
mProgressView.text = "继续"
mProgressView.setDebouncedClickListener {
SimpleDownloadManager.resume(mDownloadId)
}
updateProgressViewStyle(mProgressView)
}
DownloadStatus.QUEUED,
DownloadStatus.WAITINGWIFI -> {
mProgressView.text = "等待"
mProgressView.setOnClickListener {
}
updateProgressViewStyle(mProgressView, isWaiting = true)
}
DownloadStatus.DOWNLOADING -> {
mProgressView.setOnClickListener {
SimpleDownloadManager.pause(mDownloadId)
onStatusChanged(status = DownloadStatus.PAUSED)
}
updateProgressViewStyle(mProgressView)
}
DownloadStatus.COMPLETED -> {
mProgressView.text = "安装"
mProgressView.progress = 100
mProgressView.setOnClickListener {
ToastUtils.toast("安装")
}
updateProgressViewStyle(mProgressView)
}
else -> {
mProgressView.text = "下载"
// do nothing
}
}
}
}
override fun onSpeedChanged(speed: Float) {}
private fun updateProgressViewStyle(
progressView: SimpleProgressView,
isEmpty: Boolean = false,
isWaiting: Boolean = false
) {
when {
isEmpty -> {
// do nothing
}
isWaiting -> {
// do nothing
}
else -> {
// do nothing
}
}
}
}

View File

@ -0,0 +1,37 @@
package com.gh.download.simple
import androidx.lifecycle.LiveData
import androidx.room.*
import io.reactivex.Single
@Dao
interface DownloadDao {
@Query("select * from SimpleDownloadEntity where id = :id")
fun getDownloadEntityById(id: String): SimpleDownloadEntity?
@Query("select * from SimpleDownloadEntity")
fun getAllDownloadEntity(): List<SimpleDownloadEntity>
@Query("select * from SimpleDownloadEntity where status == 1")
fun getAllDownloadingEntity(): List<SimpleDownloadEntity>
@Query("select * from SimpleDownloadEntity where status == 3")
fun getAllDownloadedEntity(): List<SimpleDownloadEntity>
@Query("select * from SimpleDownloadEntity")
fun getAllDownloadEntityLiveData(): LiveData<List<SimpleDownloadEntity>>
@Query("select * from SimpleDownloadEntity")
fun getAllDownloadEntitySingle(): Single<List<SimpleDownloadEntity>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertDownloadEntity(entity: SimpleDownloadEntity)
@Update(onConflict = OnConflictStrategy.REPLACE)
fun updateDownloadEntity(entity: SimpleDownloadEntity)
@Delete
fun deleteDownloadEntity(entity: SimpleDownloadEntity)
}

View File

@ -0,0 +1,16 @@
package com.gh.download.simple
import com.lg.download.DownloadError
import com.lg.download.DownloadStatus
interface DownloadListener {
fun onError(error: DownloadError)
fun onProgress(progress: Float)
fun onSizeReceived(fileSize: Long)
fun onStatusChanged(status: DownloadStatus)
fun onSpeedChanged(speed: Float)
}

View File

@ -0,0 +1,302 @@
package com.gh.download.simple
import android.annotation.SuppressLint
import android.database.sqlite.SQLiteException
import com.gh.gamecenter.core.utils.ToastUtils
import com.lg.download.*
import com.lg.download.listener.InnerDownloadListener
import com.lg.ndownload.DownloadConfig
import java.net.URLConnection
import java.util.concurrent.ConcurrentHashMap
import kotlin.collections.ArrayList
/**
* 下载信息管理类
*/
object DownloadMessageHandler : InnerDownloadListener {
// 单页可订阅的监听数最少从 3 开始, 如果值为 5 的话有可能出现状态无法更新的情况 (fragment onDestroy 回调慢)
private const val MAX_LISTENER_SIZE = 5
private lateinit var mDownloadDao: DownloadDao
private val mGlobalStatusChangedListenerList by lazy {
arrayListOf<((SimpleDownloadEntity, DownloadStatus) -> Unit)>()
}
/**
* map key: 下载 id
*
* map value:
* pair first-> 下载实体
* pair second-> 对应页面的下载回调
*/
private var mListenerMap: ConcurrentHashMap<String, FixedSizeStack<DownloadListener>> = ConcurrentHashMap()
var downloadList = arrayListOf<SimpleDownloadEntity>()
@SuppressLint("CheckResult")
fun init(downloadDao: DownloadDao) {
mDownloadDao = downloadDao
updateDownloadList()
}
/**
* 注册全局回调(为避免影响下载性能,目前仅对接了状态变更回调)
*/
fun registerGlobalStatusChangedListener(listener: ((SimpleDownloadEntity, DownloadStatus) -> Unit)) {
mGlobalStatusChangedListenerList.add(listener)
}
/**
* 状态回调
* @param id 下载 id
* @param status 下载状态
*/
override fun onStatusChanged(id: String, status: DownloadStatus) {
val entity = findEntity(id)
if (entity != null) {
entity.status = status
if (status == DownloadStatus.COMPLETED) {
SimpleDownloadManager.resumeQueuedTask()
}
ExecutorProvider.getInstance().backgroundExecutor.execute {
updateDownloadToDatabase(entity)
updateDownloadList()
}
}
for (listener in mGlobalStatusChangedListenerList) {
listener.invoke(entity!!, status)
}
val listenerList = mListenerMap[id] ?: return
ExecutorProvider.getInstance().mainThreadExecutor.execute {
safeIteratorList(listenerList) {
it.onStatusChanged(status)
}
}
}
/**
* 重定向中的回调
* @param id 下载 id
* @param connection 未重定向前的原始连接
* @param config 下载配置
*/
override fun onRedirectingUrl(id: String?, connection: URLConnection?, config: DownloadConfig?) {
}
/**
* 重定向完成后的回调
* @param id 下载 id
* @param connection 重定向完成后的连接
* @param redirectedUrl 重定向完成的最终地址
*/
override fun onRedirectedUrl(id: String, connection: URLConnection, redirectedUrl: String) {
val entity = findEntity(id) ?: return
entity.url = redirectedUrl
// 更新数据库数据
updateDownloadToDatabase(entity, updateDownloadList = true)
}
/**
* 进度回调,带频率控制,适合用来更新 UI
* @param id 下载 id
* @param progress 进度 0~1
*/
override fun onProgress(id: String, progress: Float) {
val entity = findEntity(id) ?: return
entity.progress = progress * 100
updateDownloadToDatabase(entity)
val listenerList = mListenerMap[id] ?: return
ExecutorProvider.getInstance().mainThreadExecutor.execute {
safeIteratorList(listenerList) {
it.onProgress(progress * 100)
}
}
updateDownloadList()
}
/**
* 没有频率控制的进度回调,适合做一些轻度的操作
* @param id 下载 id
* @param progress 进度 0~1
*/
override fun onProgressWithoutThrottle(id: String?, progress: Float) {
}
/**
* 速度回调,带频率控制,适合用来更新 UI
* @param id 下载 id
* @param speed 下载速度,单位为字节
*/
override fun onSpeedChanged(id: String, speed: Float) {
val listenerList = mListenerMap[id] ?: return
ExecutorProvider.getInstance().mainThreadExecutor.execute {
safeIteratorList(listenerList) {
it.onSpeedChanged(speed)
}
}
findEntity(id)?.run {
this.speed = speed
}
}
/**
* 错误回调
* @param id 下载 id
* @param error 错误类型
* @param exception 包裹错误的 Exception
*/
override fun onError(id: String, error: DownloadError?, exception: Exception) {
error ?: return
when (error) {
DownloadError.EMPTY_URL,
DownloadError.HTTP_NOT_FOUND,
DownloadError.CONTENT_LENGTH_IS_ZERO -> {
ToastUtils.toast("下载链接异常,请检查")
}
else -> {
// 想怎么处理就怎么处理
}
}
val listenerList = mListenerMap[id] ?: return
ExecutorProvider.getInstance().mainThreadExecutor.execute {
safeIteratorList(listenerList) {
it.onError(error)
}
}
}
/**
* 文件大小获取成功回调
* @param id 下载 id
* @param fileSize 文件大小,单位为字节
*/
override fun onSizeReceived(id: String, fileSize: Long) {
val entity = findEntity(id) ?: return
entity.totalBytes = fileSize
updateDownloadToDatabase(entity, updateDownloadList = true)
val listenerList = mListenerMap[id] ?: return
ExecutorProvider.getInstance().mainThreadExecutor.execute {
safeIteratorList(listenerList) {
it.onSizeReceived(fileSize)
}
}
updateDownloadList()
}
fun registerListener(id: String, listener: DownloadListener) {
var listenerList = mListenerMap[id]
if (listenerList == null) {
listenerList = FixedSizeStack(MAX_LISTENER_SIZE)
listenerList.push(listener)
mListenerMap[id] = listenerList
} else {
listenerList.push(listener)
}
// Post download status if it could be obtain from database.
val entityFromDatabase = findEntity(id)
if (entityFromDatabase != null) {
listener.onProgress(entityFromDatabase.progress)
listener.onStatusChanged(entityFromDatabase.status)
}
}
fun unregisterListener(id: String, listener: DownloadListener) {
ExecutorProvider.getInstance().mainThreadExecutor.execute {
mListenerMap[id]?.remove(listener)
}
}
/**
* 从下载列表中取 downloadEntity
* TODO 不应该直接修改 downloadEntity 内存的值,不然会有莫名其妙的问题
*/
fun findEntity(id: String): SimpleDownloadEntity? {
try {
return downloadList.firstOrNull { it.id == id }
} catch (e: Exception) {
e.printStackTrace()
}
return null
}
private fun updateDownloadList() {
downloadList = try {
ArrayList(mDownloadDao.getAllDownloadEntity())
} catch (e: SQLiteException) {
arrayListOf()
}
}
fun insertDownloadToDatabase(downloadEntity: SimpleDownloadEntity) {
mDownloadDao.insertDownloadEntity(downloadEntity)
updateDownloadList()
}
fun updateDownloadToDatabase(
downloadEntity: SimpleDownloadEntity,
updateDownloadList: Boolean = false
) {
mDownloadDao.updateDownloadEntity(downloadEntity)
if (updateDownloadList) {
updateDownloadList()
}
}
fun deleteDownloadOfDatabase(downloadEntity: SimpleDownloadEntity) {
mDownloadDao.deleteDownloadEntity(downloadEntity)
updateDownloadList()
}
/*****
* 迭代的时候针对temp Stack进行迭代
*/
private fun safeIteratorList(
sourceList: FixedSizeStack<DownloadListener>?,
function: (arg: DownloadListener) -> (Unit)
) {
sourceList?.apply {
if (this.size > 0) {
// FIXME 高频遍历时会产生巨量临时的 FixedSizeStack
val tempStack = FixedSizeStack<DownloadListener>(MAX_LISTENER_SIZE)
tempStack.addAll(sourceList)
tempStack.forEach { listener ->
listener?.apply {
function(this)
}
}
}
}
}
}

View File

@ -0,0 +1,35 @@
package com.gh.download.simple
import androidx.room.TypeConverter
import com.lg.download.DownloadStatus
class DownloadStatusConverter {
@TypeConverter
fun fromGameStatus(status: DownloadStatus): Int {
return when (status) {
DownloadStatus.UNKNOWN -> 0
DownloadStatus.DOWNLOADING -> 1
DownloadStatus.PAUSED -> 2
DownloadStatus.COMPLETED -> 3
DownloadStatus.CANCELLED -> 4
DownloadStatus.AUTOPAUSED -> 5
DownloadStatus.WAITINGWIFI -> 6
DownloadStatus.QUEUED -> 7
}
}
@TypeConverter
fun toGameStatus(status: Int): DownloadStatus {
return when (status) {
0 -> DownloadStatus.UNKNOWN
1 -> DownloadStatus.DOWNLOADING
2 -> DownloadStatus.PAUSED
3 -> DownloadStatus.COMPLETED
4 -> DownloadStatus.CANCELLED
5 -> DownloadStatus.AUTOPAUSED
6 -> DownloadStatus.WAITINGWIFI
7 -> DownloadStatus.QUEUED
else -> DownloadStatus.UNKNOWN
}
}
}

View File

@ -0,0 +1,19 @@
package com.gh.download.simple
import java.util.*
/**
* A stack that holds fixed size listeners.
*
* You may wonder why using a stack.
* I just can't find a proper way to handle these listeners.
* If you do have a simple and easy way to achieve the same goal, let me know, please. :)
*/
class FixedSizeStack<T>(private var maxSize: Int) : Stack<T>() {
override fun push(item: T): T {
while (this.size >= maxSize) {
this.removeAt(0)
}
return super.push(item)
}
}

View File

@ -0,0 +1,30 @@
package com.gh.download.simple
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.halo.assistant.HaloApp
@Database(
entities = [SimpleDownloadEntity::class],
version = 1,
exportSchema = false
)
@TypeConverters(DownloadStatusConverter::class)
abstract class SimpleDownloadDatabase : RoomDatabase() {
abstract fun downloadDao(): DownloadDao
companion object {
@JvmStatic
val instance by lazy {
Room.databaseBuilder(
HaloApp.getInstance().application,
SimpleDownloadDatabase::class.java,
"SIMPLE_DOWNLOAD_DATABASE"
).build()
}
}
}

View File

@ -0,0 +1,29 @@
package com.gh.download.simple
import android.os.Parcelable
import androidx.annotation.Keep
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.lg.download.DownloadStatus
import kotlinx.parcelize.Parcelize
@Keep
@Entity(tableName = "SimpleDownloadEntity")
@Parcelize
data class SimpleDownloadEntity(
@PrimaryKey(autoGenerate = false)
var id: String,
var desc: String = "",
var url: String = "",
var dirPath: String = "",
var fileName: String = "",
var displayName: String = "",
var packageName: String = "",
var downloadedBytes: Long = 0,
var totalBytes: Long = 0,
var progress: Float = 0F,
var status: DownloadStatus = DownloadStatus.UNKNOWN,
var speed: Float = 0F,
var version: String = "",
var icon: String = "",
) : Parcelable

View File

@ -0,0 +1,95 @@
package com.gh.download.simple
import com.halo.assistant.HaloApp
import com.lg.download.*
import com.lg.ndownload.DownloadConfig
import com.lg.ndownload.DownloadDbManager
import com.lg.ndownload.DownloadQueue
import com.lightgame.download.FileUtils
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
object SimpleDownloadManager {
private const val MAX_DOWNLOADING_TASK = 2
private val mDownloadQueue by lazy { DownloadQueue.getInstance() }
private val mExecutor by lazy { Executors.newCachedThreadPool() }
fun init() {
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadDbManager.init(HaloApp.getInstance())
}
// 设置最大同时下载任务数 (可选)
DownloadQueue.getInstance().setMaxDownloadingTask(MAX_DOWNLOADING_TASK)
}
/**
* 继续任务
*/
fun resume(id: String) {
mDownloadQueue.resume(id)
}
/**
* 下载任务
*/
fun download(config: DownloadConfig) {
val downloadStatus = mDownloadQueue.getStatus(config.uniqueId)
if (downloadStatus != DownloadStatus.PAUSED) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
} else {
resume(config.uniqueId)
}
}
private fun getDownloadEntity(config: DownloadConfig): SimpleDownloadEntity {
return SimpleDownloadEntity(
id = config.uniqueId,
url = config.url,
fileName = config.fileName,
dirPath = config.pathToStore,
displayName = config.fileName,
icon = "",
)
}
/**
* 暂停任务
*/
fun pause(id: String) {
mDownloadQueue.pause(id)
}
/**
* 继续排队中的任务
*/
fun resumeQueuedTask() {
mDownloadQueue.resumeQueuedTask()
}
/**
* 取消任务
*/
fun cancel(id: String) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
mDownloadQueue.pause(id)
mDownloadQueue.cancel(id)
DownloadMessageHandler.findEntity(id)?.let {
FileUtils.deleteFile(it.dirPath + it.fileName)
DownloadMessageHandler.deleteDownloadOfDatabase(it)
}
// 清除下载数据库那边的 id
DownloadDbManager.getInstance().delete(id)
}
}
fun getExecutor(): ExecutorService = mExecutor
}

View File

@ -0,0 +1,81 @@
package com.gh.download.simple
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.widget.ProgressBar
import androidx.annotation.Keep
import com.gh.gamecenter.core.utils.DisplayUtils
@Keep
class SimpleProgressView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
ProgressBar(context, attrs, defStyle) {
private var mWidth = 0
private var mHalfWidth = 0
private val mMatrix: Matrix
private var mHalfTextWidth = 0F
private val mTextPaint: Paint
private var mTextSize = 0F
private var mTextColor = Color.WHITE
private var mText: String? = "打开"
init {
max = MAX_LENGTH
mTextSize = DisplayUtils.sp2px(context, 12F).toFloat()
mMatrix = Matrix()
mTextPaint = Paint()
mTextPaint.isAntiAlias = true
mTextPaint.color = mTextColor
mTextPaint.style = Paint.Style.FILL_AND_STROKE
mTextPaint.typeface = Typeface.DEFAULT_BOLD
mTextPaint.textSize = mTextSize
mTextPaint.textAlign = Paint.Align.CENTER
}
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
super.onLayout(changed, left, top, right, bottom)
mWidth = width
mHalfWidth = mWidth / 2
}
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (mText != null) {
setProgressByPixels(mWidth * progress / MAX_LENGTH)
val fontMetrics = mTextPaint.fontMetricsInt
val baseline = (height - fontMetrics.bottom - fontMetrics.top) / 2
canvas.drawText(mText!!, mHalfWidth.toFloat(), baseline.toFloat(), mTextPaint)
}
}
var text: String?
get() = mText
set(text) {
mText = text
postInvalidate()
}
fun setTextColor(color: Int) {
mTextColor = color
mTextPaint.color = color
}
fun setTextSize(size: Float) {
mTextSize = size
mTextPaint.textSize = size
}
private fun setProgressByPixels(pixels: Int) {
if (pixels >= mHalfWidth - mHalfTextWidth) {
mMatrix.setTranslate(pixels - (mHalfWidth - mHalfTextWidth), 0F)
} else {
mMatrix.setTranslate(0F, 0F)
}
}
companion object {
const val MAX_LENGTH = 100
}
}

View File

@ -6,13 +6,16 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.halo.assistant.fragment.ApkCleanerFragment;
/**
* Created by khy on 2017/1/24.
*/
@Route(path = RouteConsts.activity.cleanApkActivity)
public class CleanApkActivity extends ToolBarActivity {
@NonNull
@ -34,4 +37,9 @@ public class CleanApkActivity extends ToolBarActivity {
bundle.putString(EntranceConsts.KEY_PLATFORM_REQUESTS_ID, platformRequestsId);
return getTargetIntent(context, CleanApkActivity.class, ApkCleanerFragment.class, bundle);
}
@Override
protected Intent provideNormalIntent() {
return getIntent(this);
}
}

View File

@ -6,15 +6,14 @@ import android.content.Intent
import android.os.Bundle
import android.view.View
import com.gh.base.DownloadToolbarActivity
import com.gh.gamecenter.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.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.halo.assistant.HaloApp
@ -166,6 +165,33 @@ class GameDetailActivity : DownloadToolbarActivity() {
startGameDetailActivity(context, gameId, entrance, -1, traceEvent = traceEvent)
}
@JvmStatic
fun startGameDetailActivity(
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int = -1,
isSkipGameComment: Boolean = false,
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
openPlatformWindow: Boolean = false,
traceEvent: ExposureEvent? = null
) {
startGameDetailActivity(
context,
gameId,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
openVideoStreaming,
openPlatformWindow,
null,
null,
traceEvent
)
}
/**
* @param gameId 游戏Id
* @param defaultTab 默认定位到哪个tab
@ -173,6 +199,8 @@ class GameDetailActivity : DownloadToolbarActivity() {
* @param scrollToLibao 滚动到礼包区域
* @param openVideoStreaming 是否打开视频流
* @param openPlatformWindow 打开多版本下载弹窗
* @param platformName 平台名称
* @param packageName 包名
* @param traceEvent 曝光事件
*/
@JvmStatic
@ -185,6 +213,8 @@ class GameDetailActivity : DownloadToolbarActivity() {
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
openPlatformWindow: Boolean = false,
platformName: String? = null,
packageName: String? = null,
traceEvent: ExposureEvent? = null
) {
val bundle = Bundle()
@ -224,6 +254,12 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
if (openPlatformWindow) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
if (!platformName.isNullOrEmpty()) {
bundle.putString(EntranceConsts.KEY_PLATFORM, platformName)
}
if (!packageName.isNullOrEmpty()) {
bundle.putString(EntranceConsts.KEY_PACKAGENAME, packageName)
}
}
if (scrollToLibao) {
bundle.putInt(EntranceConsts.KEY_TARGET, GameDetailFragment.INDEX_TRENDES)

View File

@ -1,7 +1,7 @@
package com.gh.gamecenter;
import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG;
import static com.gh.gamecenter.common.constant.Constants.LOGOUT_TAG;
import static com.gh.gamecenter.login.utils.LoginHelper.WEIBO_SCOPE;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_LAUNCH_SIMULATOR_GAME;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_QQ;
@ -14,7 +14,7 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TO;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_TYPE;
import static com.gh.gamecenter.common.utils.ExtensionsKt.observableToMain;
import static com.gh.gamecenter.fragment.MainWrapperFragment.INDEX_PERSONAL;
import static com.gh.gamecenter.common.constant.Constants.LOGIN_TAG;
import static com.gh.gamecenter.login.utils.LoginHelper.WEIBO_SCOPE;
import android.annotation.SuppressLint;
import android.app.Activity;
@ -26,6 +26,7 @@ import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.preference.PreferenceManager;
import android.text.Html;
@ -39,9 +40,15 @@ import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProviders;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.common.DefaultUrlHandler;
import com.gh.common.constant.Config;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureManager;
import com.gh.common.exposure.ExposureSource;
import com.gh.common.exposure.ExposureType;
import com.gh.common.history.HistoryDatabase;
import com.gh.common.history.HistoryHelper;
import com.gh.common.repository.ReservationRepository;
@ -58,8 +65,7 @@ import com.gh.common.util.ErrorHelper;
import com.gh.common.util.HomePluggableHelper;
import com.gh.common.util.LogUtils;
import com.gh.common.util.LunchType;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.utils.NotificationHelper;
import com.gh.common.util.NewFlatLogUtils;
import com.gh.common.util.PackageInstaller;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
@ -72,12 +78,17 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment_ViewPager;
import com.gh.gamecenter.common.base.fragment.ToolbarFragment;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.entity.NotificationUgc;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DeviceUtils;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.NotificationHelper;
import com.gh.gamecenter.common.utils.ShareUtils;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.utils.ClassUtils;
@ -86,21 +97,21 @@ import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.core.utils.SentryHelper;
import com.gh.gamecenter.core.utils.TimeUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.core.utils.UrlFilterUtils;
import com.gh.gamecenter.download.DownloadFragment;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.InnerMetaInfoEntity;
import com.gh.gamecenter.common.entity.NotificationUgc;
import com.gh.gamecenter.entity.StartupAdEntity;
import com.gh.gamecenter.eventbus.EBNetworkState;
import com.gh.gamecenter.eventbus.EBSkip;
import com.gh.gamecenter.fragment.MainWrapperFragment;
import com.gh.gamecenter.home.skip.PackageSkipActivity;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.login.utils.QuickLoginHelper;
import com.gh.gamecenter.manager.DataCollectionManager;
import com.gh.gamecenter.manager.UpdateManager;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.packagehelper.PackageViewModel;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.room.AppDatabase;
@ -136,6 +147,7 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
@ -159,6 +171,9 @@ public class MainActivity extends BaseActivity {
public final static String SWITCH_TO_COMMUNITY = "switch_to_community";
public final static String SWITCH_TO_VIDEO = "switch_to_video";
public final static String SHOW_AD = "show_ad";
private final static int COUNTDOWN_AD = 100;
private final static int countdownMaxCount = 3;
private int countdownCount = 0;
private final static String CURRENT_PAGE = "current_page";
@ -180,6 +195,7 @@ public class MainActivity extends BaseActivity {
showAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null;
HaloApp.getInstance().initFresco();
HaloApp.getInstance().isAlreadyUpAndRunning = true;
super.onCreate(savedInstanceState);
setStatusBarColor(Color.TRANSPARENT);
@ -292,7 +308,7 @@ public class MainActivity extends BaseActivity {
}
if (showAd) {
observeAd();
observeStartUp();
} else {
checkDialog();
}
@ -474,38 +490,95 @@ public class MainActivity extends BaseActivity {
}
}
private void observeAd() {
AdHelper.startupAd.observe(this, startupAdEntity -> {
if (showAd) {
if (startupAdEntity == null) {
hideAd(true);
} else {
showAd(startupAdEntity);
AppExecutor.getUiExecutor().execute(() -> {
AppExecutor.getUiExecutor().executeWithDelay(() -> hideAd(true), 2000);
});
}
}
});
AppExecutor.getUiExecutor().executeWithDelay(() -> hideAd(false), 950);
private void observeStartUp() {
if (!showAd) {
hideStartUp();
hideStartUpAd();
return;
}
final StartupAdEntity startUp = AdHelper.getStartUp();
if (startUp != null) {
showStartUp(startUp);
AppExecutor.getUiExecutor().executeWithDelay(() -> {
hideStartUp();
observeStartUpAd();
}, 2000);
} else {
observeStartUpAd();
}
}
private void hideAd(boolean forceToHide) {
if (forceToHide || AdHelper.startupAd.getValue() == null) {
showAd = false;
getIntent().putExtra(SHOW_AD, false);
View view = findViewById(R.id.maskContainer);
if (view != null) {
view.setVisibility(View.GONE);
ExtensionsKt.removeFromParent(view);
private void observeStartUpAd() {
final StartupAdEntity startUpAd = AdHelper.getStartUpAd();
if (startUpAd != null && !TextUtils.isEmpty(startUpAd.getImg())) {
final String showedTodayTimestamp = SPUtils.getString(Constants.SP_STARTUP_AD_TIMESTAMP, "");
final String rule = startUpAd.getRule();
switch (rule) {
case "each":
showStartUpAd(startUpAd);
break;
case "once":
if (TextUtils.isEmpty(showedTodayTimestamp)
|| !showedTodayTimestamp.contains(startUpAd.getId())) {
showStartUpAd(startUpAd);
} else {
hideStartUpAd();
}
break;
case "everyday":
final String today = TimeUtils.getToday();
if (TextUtils.isEmpty(showedTodayTimestamp)
|| !showedTodayTimestamp.contains(today)
|| !showedTodayTimestamp.contains(startUpAd.getId())) {
showStartUpAd(startUpAd);
} else {
hideStartUpAd();
}
break;
default:
hideStartUpAd();
break;
}
checkDialog();
SPUtils.setString(Constants.SP_STARTUP_AD_TIMESTAMP, startUpAd.getId() + TimeUtils.getToday());
} else {
hideStartUpAd();
}
}
@Override
protected void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == COUNTDOWN_AD) {
countdownCount++;
TextView jumpBtn = findViewById(R.id.jumpBtn);
jumpBtn.setText(String.format(Locale.CHINA, "跳过 %d", countdownMaxCount - countdownCount));
if (countdownMaxCount < countdownCount) {
hideStartUpAd();
} else {
mBaseHandler.sendEmptyMessageDelayed(COUNTDOWN_AD, 1000);
}
}
}
private void hideStartUp() {
View maskContainer = findViewById(R.id.maskContainer);
if (maskContainer != null) {
maskContainer.setVisibility(View.GONE);
ExtensionsKt.removeFromParent(maskContainer);
}
}
private void hideStartUpAd() {
showAd = false;
getIntent().putExtra(SHOW_AD, false);
View startAdContainer = findViewById(R.id.startAdContainer);
if (startAdContainer != null) {
startAdContainer.setVisibility(View.GONE);
ExtensionsKt.removeFromParent(startAdContainer);
}
checkDialog();
}
private void checkDialog() {
// 检查通知权限
checkNotificationPermission();
@ -517,9 +590,53 @@ public class MainActivity extends BaseActivity {
});
}
private void showAd(StartupAdEntity ad) {
private void showStartUpAd(StartupAdEntity ad) {
View startAdContainer = findViewById(R.id.startAdContainer);
View jumpBtn = findViewById(R.id.jumpBtn);
TextView jumpDetailBtn = findViewById(R.id.jumpDetailBtn);
SimpleDraweeView adImage = findViewById(R.id.adImage);
startAdContainer.setVisibility(View.VISIBLE);
jumpDetailBtn.setText(ad.getDesc());
ExtensionsKt.setDrawableEnd(jumpDetailBtn, VectorDrawableCompat.create(getResources(), R.drawable.ic_startup_ad_arrow, null), null, null);
ImageUtils.display(adImage, ad.getImg());
startAdContainer.setOnClickListener(v -> {
// do nothing 只是为了点击拦截事件,避免传递到下面的页面
});
jumpBtn.setOnClickListener(v -> {
mBaseHandler.removeMessages(COUNTDOWN_AD);
hideStartUpAd();
LinkEntity linkEntity = ad.getJump();
NewFlatLogUtils.logOpenScreenAdSkip(
ad.getId(),
linkEntity.getText() != null ? linkEntity.getText() : "",
linkEntity.getType() != null ? linkEntity.getType() : "",
linkEntity.getLink() != null ? linkEntity.getLink() : ""
);
});
List<ExposureSource> sources = new ArrayList<>();
sources.add(new ExposureSource("开屏广告", ad.getId()));
final ExposureEvent event = ExposureEvent.createEvent(null, sources, null, ExposureType.EXPOSURE);
ExposureManager.INSTANCE.log(event);
if (ad.getButton()) {
jumpDetailBtn.setOnClickListener(v -> {
DirectUtils.directToLinkPage(this, ad.getJump(), "(启动广告)", "", event);
v.postDelayed(() -> {
mBaseHandler.removeMessages(COUNTDOWN_AD);
hideStartUpAd();
}, 1000);
});
jumpDetailBtn.setVisibility(View.VISIBLE);
LogUtils.logStartAd("watch_start_ads", ad);
} else {
LogUtils.logStartAd("start_ads", ad);
}
mBaseHandler.sendEmptyMessageDelayed(COUNTDOWN_AD, 1000);
}
private void showStartUp(StartupAdEntity ad) {
TextView adContentTv = findViewById(R.id.adContentTv);
View containerView = findViewById(R.id.maskContainer);
containerView.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
containerView.setElevation(500F);
}
@ -529,12 +646,12 @@ public class MainActivity extends BaseActivity {
adContentTv.setText(ad.getDesc());
adContentTv.setVisibility(View.VISIBLE);
if (ad.getButton()) {
View btn = findViewById(R.id.adBtn);
btn.setOnClickListener((v) -> {
View adBtn = findViewById(R.id.adBtn);
adBtn.setOnClickListener(v -> {
DirectUtils.directToLinkPage(this, ad.getJump(), "(启动广告)", "");
LogUtils.logStartAd("click_watch_start_ads", ad);
});
btn.setVisibility(View.VISIBLE);
adBtn.setVisibility(View.VISIBLE);
LogUtils.logStartAd("watch_start_ads", ad);
} else {
LogUtils.logStartAd("start_ads", ad);

View File

@ -59,7 +59,7 @@ import com.gh.gamecenter.eventbus.EBPackage;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.newsdetail.NewsDetailAdapter;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.halo.assistant.fragment.SettingsFragment;
import com.gh.gamecenter.setting.view.SettingsFragment;
import com.lightgame.download.DataWatcher;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.Utils;

View File

@ -137,7 +137,7 @@ public class SkipActivity extends BaseActivity {
if (!TextUtils.isEmpty(qaId)) {
DirectUtils.directToQa(this, qaTitle, qaId);
} else if ("vgame".equals(suggestionType)) {
DirectUtils.directToFeedback(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
DirectUtils.directToFeedbackCompat(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
} else {
DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
}
@ -291,8 +291,9 @@ public class SkipActivity extends BaseActivity {
case HOST_USERHOME:
String position = uri.getQueryParameter("position");
String subTypeString = uri.getQueryParameter("sub_type");
String subGameType = uri.getQueryParameter("sub_game_type");
DirectUtils.directToHomeActivity(this, path, subTypeString, TextUtils.isEmpty(position) ? -1 : Integer.parseInt(position), ENTRANCE_BROWSER, "浏览器");
DirectUtils.directToHomeActivity(this, path, subTypeString, subGameType, TextUtils.isEmpty(position) ? -1 : Integer.parseInt(position), ENTRANCE_BROWSER, "浏览器");
break;
case HOST_COMMUNITY_COLUMN:
CommunityEntity community = new CommunityEntity();

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
@ -25,6 +26,7 @@ import com.gh.common.util.GameSubstituteRepositoryHelper.updateGameSubstituteRep
import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.SimpleCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger
@ -60,6 +62,8 @@ class SplashScreenActivity : BaseActivity() {
private var mShouldPrefetchData = true
private val mPermissions = arrayOf(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
PermissionHelper.PERMISSION_GET_INSTALLED_LIST
)
@ -150,42 +154,41 @@ class SplashScreenActivity : BaseActivity() {
private fun showPrivacyDialog(guideLayout: ViewPager) {
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
if (isSuccess) {
guideLayout.visibility = View.VISIBLE
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
// guideLayout.visibility = View.VISIBLE
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
//
// // 恢复畅玩数据
// VHelper.recoverVDataIfPossible()
//
// requestPermission()
//
// // 检查是否有旧版本光环,有就删掉
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
// if (mStartMainActivityDirectly) {
// launchMainActivity()
// }
// 恢复畅玩数据
VHelper.recoverVDataIfPossible()
mShouldPrefetchData = false
prefetchData()
requestPermission()
// 检查是否有旧版本光环,有就删掉
AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
if (mStartMainActivityDirectly) {
launchMainActivity()
} else {
mShouldPrefetchData = false
prefetchData()
val callback = object : SimpleCallback<Boolean> {
override fun onCallback(arg: Boolean) {
// Dialog dismiss 后的回调
guideLayout.visibility = View.VISIBLE
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
if (arg) {
requestPermission()
} else {
mStartMainActivityDirectly = false
}
}
}
// val callback = object : SimpleCallback<Boolean> {
// override fun onCallback(arg: Boolean) {
// // Dialog dismiss 后的回调
// guideLayout.visibility = View.VISIBLE
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
// if (arg) {
// requestPermission()
// } else {
// mStartMainActivityDirectly = false
// }
// }
// }
//
// mViewModel?.showPrivacyPolicy({
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
// }, {
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
// })
mViewModel?.showPrivacyPolicy({
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
}, {
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
})
} else {
DialogUtils.showPrivacyPolicyDisallowDialog(
this,
@ -255,7 +258,6 @@ class SplashScreenActivity : BaseActivity() {
SPUtils.setLong(Constants.SP_GH_LAST_UPDATE_TIME, PackageUtils.getHaloLastUpdateTime())
HaloApp.getInstance().postInit(true)
TrackerLogger.logAppLaunchSuccessful()
AdHelper.getStartUpAd()
if (mShouldPrefetchData) {
prefetchData()
}
@ -267,10 +269,14 @@ class SplashScreenActivity : BaseActivity() {
intent.putExtra(MainActivity.SHOW_AD, !mIsNewForThisVersion)
overridePendingTransition(0, 0)
startActivity(intent)
uploadTeaData()
doFlavorInit()
finish()
}
private fun doFlavorInit() {
HaloApp.getInstance().flavorProvider.init(HaloApp.getInstance(), this)
}
private fun getGitLogString(): String {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
val stringBuilder = StringBuilder()
@ -341,20 +347,6 @@ class SplashScreenActivity : BaseActivity() {
}
}
private fun uploadTeaData() {
if ("tea" == BuildConfig.FLAVOR) {
// 在可能获取了相关权限后才初始化SDK/发送激活数据
// TeaHelper.init(getApplication(), HaloApp.getInstance().getChannel());
try {
val clazz = Class.forName("com.gh.gamecenter.TeaHelper")
val method = clazz.getMethod("init", Context::class.java, String::class.java)
method.invoke(null, application, HaloApp.getInstance().channel)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
private fun prefetchData() {
AppExecutor.ioExecutor.execute {
Config.getGhzsSettings()
@ -385,10 +377,10 @@ class SplashScreenActivity : BaseActivity() {
private fun checkAndRequestPermission() {
if (EasyPermissions.hasPermissions(this, *mPermissions)) {
// 恢复畅玩数据
// VHelper.recoverVDataIfPossible()
VHelper.recoverVDataIfPossible()
// 检查是否有旧版本光环,有就删掉
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
if (mStartMainActivityDirectly) {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
@ -477,7 +469,7 @@ class SplashScreenActivity : BaseActivity() {
intent.action = Intent.ACTION_MAIN
intent.addCategory(Intent.CATEGORY_LAUNCHER)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtras(bundle!!)
intent.putExtras(bundle ?: Bundle())
return intent
}
}

View File

@ -7,7 +7,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Build;
@ -1108,16 +1107,16 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
}
@Override
public void onSingleSuccess(@NotNull Map<String, String> imageUrl) {
public void onSingleSuccess(@NotNull Map<String, String> imageUrlMap) {
}
@Override
public void onSuccess(@NotNull LinkedHashMap<String, String> imageUrl, @NotNull Map<String, ? extends Exception> errorMap) {
public void onSuccess(@NotNull LinkedHashMap<String, String> imageUrlMap, @NotNull Map<String, ? extends Exception> errorMap) {
Utils.log("意见反馈:图片上传完成");
final JSONArray picArray = new JSONArray();
for (String s : imageUrl.keySet()) {
picArray.put(imageUrl.get(s));
for (String s : imageUrlMap.keySet()) {
picArray.put(imageUrlMap.get(s));
}
initPostData(email, picArray);
}

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.view.View;
@ -117,7 +118,8 @@ public class CleanApkAdapter extends BaseRecyclerAdapter<KcSelectGameViewHolder>
appInfo.sourceDir = apk_path;
appInfo.publicSourceDir = apk_path;
Drawable apk_icon = appInfo.loadIcon(pm);
apkEntity.setGameBm(BitmapUtils.drawableToBitmap(apk_icon, true));
Bitmap originalBitmap = BitmapUtils.drawableToBitmap(apk_icon, true);
apkEntity.setGameBm(BitmapUtils.compressBitmap(originalBitmap, 100));
/** apk的绝对路劲 */
apkEntity.setGamePath(apk_path);
/** apk的版本名称 String */

View File

@ -12,20 +12,20 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.gamecenter.common.entity.ExposureEntity;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureSource;
import com.gh.common.exposure.ExposureType;
import com.gh.gamecenter.common.utils.DataLogUtils;
import com.gh.common.util.DirectUtils;
import com.gh.gamecenter.MainActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.common.entity.ExposureEntity;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.utils.DataLogUtils;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
import com.gh.gamecenter.core.utils.StringUtils;
import com.gh.gamecenter.MainActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.entity.SubjectRecommendEntity;
import com.gh.gamecenter.game.data.GameItemData;
@ -79,7 +79,7 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
@Override
public View getView(final int position, View view, ViewGroup container) {
if (view == null) {
view = new SimpleDraweeView(mContext);
view = View.inflate(mContext, R.layout.game_slide_list_item, null);
}
int index = getPosition(position);
@ -87,7 +87,15 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter {
final LinkEntity slideEntity = mSlideEntityList.get(index);
ImageUtils.display(mContext.getResources(), (SimpleDraweeView) view, slideEntity.getImage(), R.drawable.preload);
SimpleDraweeView slideImage = (SimpleDraweeView) view.findViewById(R.id.slideImage);
ImageUtils.display(slideImage, slideEntity.getImage());
View playIv = view.findViewById(R.id.playIv);
if ("video".equals(slideEntity.getType())) {
playIv.setVisibility(View.VISIBLE);
} else {
playIv.setVisibility(View.GONE);
}
ExposureEvent exposureEvent = null;
if ("game".equals(slideEntity.getType())) {

View File

@ -5,18 +5,22 @@ import android.content.Context;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.gh.common.util.DirectUtils;
import com.gh.common.view.DownloadButton;
import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
import com.gh.gamecenter.common.utils.ExtensionsKt;
@ -42,6 +46,7 @@ import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserDataLibaoEntity;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.suggest.SuggestType;
import com.lightgame.adapter.BaseRecyclerAdapter;
@ -196,6 +201,8 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.background_white);
if (mLibaoEntity.getGame() != null) {
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript());
GameEntity gameEntity = mLibaoEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false, null);
} else {
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getIcon(), null);
}
@ -321,6 +328,32 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
}
holder.binding.libaodetailCondition.setVisibility(View.VISIBLE);
holder.binding.libaodetailCondition.setText(content);
} else if (ExtensionsKt.toResString(R.string.libao_activity_grant).equals(mLibaoEntity.getReceiveLimit())) {
holder.binding.libaodetailCondition.setVisibility(View.VISIBLE);
String url = mLibaoEntity.getActivityLink().getUrl();
if (TextUtils.isEmpty(url)) {
holder.binding.libaodetailCondition.setText("领取条件:通过活动获得");
} else {
SpannableStringBuilder content = new SpannableStringBuilder("领取条件:通过活动获得,查看详情");
content.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ExtensionsKt.toColor(R.color.theme_font, mContext));
ds.setUnderlineText(false);
}
@Override
public void onClick(@NonNull View widget) {
DirectUtils.directToWebView(mContext, url, "礼包详情-领取条件-查看活动详情");
}
}, 12, content.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
holder.binding.libaodetailCondition.setText(content);
holder.binding.libaodetailCondition.setMovementMethod(new LinkMovementMethod());
ExtensionsKt.setDrawableEnd(holder.binding.libaodetailCondition, com.gh.gamecenter.common.R.drawable.ic_libao_activity_arrow, null, null);
holder.binding.libaodetailCondition.setCompoundDrawablePadding(DisplayUtils.dip2px(4F));
}
}
if (mLibaoDetailEntity.getTime() != null) {
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm", Locale.CHINA);

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
@ -11,6 +12,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
import com.airbnb.lottie.LottieAnimationView;
import com.gh.common.chain.BrowserInstallHandler;
import com.gh.common.chain.CertificationHandler;
import com.gh.common.chain.ChainBuilder;
@ -21,18 +23,23 @@ import com.gh.common.chain.DownloadDialogHelperHandler;
import com.gh.common.chain.GamePermissionHandler;
import com.gh.common.chain.OverseaDownloadHandler;
import com.gh.common.chain.PackageCheckHandler;
import com.gh.common.chain.UpdateNewSimulatorHandler;
import com.gh.common.chain.ValidateVSpaceHandler;
import com.gh.common.chain.VersionNumberHandler;
import com.gh.common.constant.Config;
import com.gh.common.dialog.DeviceRemindDialog;
import com.gh.common.dialog.GameOffServiceDialogFragment;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.filter.RegionSetting;
import com.gh.common.filter.RegionSettingHelper;
import com.gh.common.history.HistoryHelper;
import com.gh.common.simulator.NewSimulatorGameManager;
import com.gh.common.simulator.SimulatorDownloadManager;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.util.CheckLoginUtils;
import com.gh.common.util.DirectUtils;
import com.gh.common.xapk.XapkInstaller;
import com.gh.common.xapk.XapkUnzipStatus;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.utils.DataLogUtils;
import com.gh.common.util.DetailDownloadUtils;
@ -58,9 +65,11 @@ import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.entity.SimulatorEntity;
import com.gh.gamecenter.eventbus.EBScroll;
import com.gh.gamecenter.gamedetail.GameDetailFragment;
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.gamecenter.teenagermode.TeenagerModeActivity;
import com.gh.vspace.VDownloadManagerActivity;
import com.gh.vspace.VHelper;
@ -92,14 +101,18 @@ public class DetailViewHolder {
public View downloadBottom;
public DownloadButton mDownloadPb;
public LottieAnimationView mDownloadTips;
public TextView mOverlayTv; // 额外的文字 (用于一些含图片的情况)
public TextView mMultiVersionDownloadTv; // 多版本下载文字
// 注意View的命名
public DetailViewHolder(View view, GameEntity gameEntity, DownloadEntity downloadEntity,
boolean isNewsDetail, String entrance, String name, String title, @Nullable ExposureEvent traceEvent) {
downloadBottom = view.findViewById(R.id.detail_ll_bottom);
mDownloadPb = view.findViewById(R.id.detail_progressbar);
mDownloadTips = view.findViewById(R.id.downloadTipsLottie);
mOverlayTv = view.findViewById(R.id.overlayTv);
mMultiVersionDownloadTv = view.findViewById(R.id.multiVersionDownloadTv);
this.gameEntity = gameEntity;
this.downloadEntity = downloadEntity;
@ -189,6 +202,43 @@ public class DetailViewHolder {
}
v.setTag(null);
if (mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.INSTALL_NORMAL
&& mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.INSTALL_PLUGIN
&& mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.LAUNCH_OR_OPEN) {
if (mGameEntity.isVGame() && !VHelper.INSTANCE.shouldLaunchGameAfterInstallation()) {
// 畅玩游戏的非真实点击下载按钮下载不需要滚动到特定地方
} else {
EventBus.getDefault().post(new EBScroll(Constants.EB_GAME_DETAIL, mGameEntity.getId()));
}
}
if (mDownloadEntity == null) {
mDownloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(mGameEntity);
}
if (mDownloadEntity != null) {
String xapkStatus = mDownloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS);
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
XapkInstaller.cancelUnzipTask(mDownloadEntity);
return;
} else if (XapkUnzipStatus.FAILURE.name().equals(xapkStatus)) {
PermissionHelper.checkStoragePermissionBeforeAction(mViewHolder.context, () -> {
if (mDownloadEntity != null) {
final String path = mDownloadEntity.getPath();
if (FileUtils.isEmptyFile(path)) {
Utils.toast(mViewHolder.context, R.string.install_failure_hint);
DownloadManager.getInstance().cancel(mDownloadEntity.getUrl());
} else {
PackageInstaller.install(mViewHolder.context, mDownloadEntity);
}
}
});
return;
}
}
switch (mViewHolder.mDownloadPb.getButtonStyle()) {
case NONE_WITH_HINT:
case NONE:
@ -216,13 +266,15 @@ public class DetailViewHolder {
DataLogUtils.uploadGameLog(mViewHolder.context, mGameEntity.getId(), mGameEntity.getName(), mEntrance);
}
case PLUGIN:
ChainBuilder builder = new ChainBuilder();
builder.addHandler(new UpdateNewSimulatorHandler());
builder.addHandler(new ValidateVSpaceHandler());
builder.addHandler(new GamePermissionHandler());
builder.addHandler(new CheckStoragePermissionHandler());
if (mGameEntity.getApk().size() == 1) {
ApkEntity apk = mGameEntity.getApk().get(0);
builder.addHandler(new BrowserInstallHandler());
builder.addHandler(new PackageCheckHandler());
builder.addHandler(new DownloadDialogHelperHandler());
@ -232,7 +284,7 @@ public class DetailViewHolder {
builder.addHandler(new CheckDownloadHandler());
builder.setProcessEndCallback(o -> {
DialogUtils.checkDownload(mViewHolder.context, apk.getSize(), this::download);
download((boolean) o);
return null;
});
final ChainHandler chainHandler = builder.buildHandlerChain();
@ -262,6 +314,10 @@ public class DetailViewHolder {
if (mGameEntity.getApk().size() == 1) {
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(mGameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(mViewHolder.context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(mViewHolder.context, null);
return;
}
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(mGameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
File file = new File(downloadEntity.getPath());
@ -301,8 +357,18 @@ public class DetailViewHolder {
DownloadEntity downloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.getUrl());
if (mGameEntity.getSimulator() != null) {
boolean isInstalled = PackageUtils.isInstalledFromAllPackage(mViewHolder.context, mGameEntity.getSimulator().getApk().getPackageName());
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(mGameEntity) && !isInstalled) {
SimulatorDownloadManager.getInstance().showDownloadDialog(mViewHolder.context, mGameEntity.getSimulator(),
boolean isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(mViewHolder.context);
boolean isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(mViewHolder.context);
SimulatorEntity simulator = mGameEntity.getSimulator();
SimulatorEntity newSimulator = Config.getNewSimulatorEntitySetting();
if (!isInstalledOldSimulator && newSimulator != null) {
if (newSimulator.getActive()) {
simulator = newSimulator;
}
}
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(mGameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(mViewHolder.context, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, mGameEntity.getId(), mGameEntity.getName(), null);
return;
}
@ -315,7 +381,7 @@ public class DetailViewHolder {
PermissionHelper.checkStoragePermissionBeforeAction(mViewHolder.context, () -> {
if (mDownloadEntity == null) {
mDownloadEntity = DownloadManager.getInstance().getDownloadEntityByUrl(mGameEntity.getApk().get(0).getUrl());
mDownloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(mGameEntity);
}
if (mDownloadEntity != null) {
@ -391,6 +457,24 @@ public class DetailViewHolder {
DirectUtils.directForumDetail(mViewHolder.context, info.getBbsId(), mEntrance);
}
break;
case WAITING:
Utils.toast(mViewHolder.context, "最多只能同时下载三个任务,请稍等");
break;
case DOWNLOADING_NORMAL:
case DOWNLOADING_PLUGIN:
if (mDownloadEntity == null) {
mDownloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(mGameEntity);
}
if (mDownloadEntity != null) {
if (downloadText.contains("继续加载")) {
DownloadManager.getInstance().resume(mDownloadEntity, true);
} else {
DownloadManager.getInstance().pause(mDownloadEntity.getUrl());
mViewHolder.mDownloadPb.setText("继续加载 " + mDownloadEntity.getPercent() + "%");
}
}
break;
default:
if (mGameEntity.isVGame()) {
mViewHolder.context.startActivity(VDownloadManagerActivity.getIntent(mViewHolder.context, true));
@ -402,12 +486,6 @@ public class DetailViewHolder {
}
break;
}
if (mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.INSTALL_NORMAL
&& mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.INSTALL_PLUGIN
&& mViewHolder.mDownloadPb.getButtonStyle() != DownloadButton.ButtonStyle.LAUNCH_OR_OPEN) {
EventBus.getDefault().post(new EBScroll(Constants.EB_GAME_DETAIL, mGameEntity.getId()));
}
}
private void showOffServiceDialog(GameEntity.Dialog dialog) {
@ -452,7 +530,7 @@ public class DetailViewHolder {
DownloadButton.ButtonStyle.DOWNLOADING_PLUGIN : DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
DeviceRemindDialog.Companion.showDeviceRemindDialog(mViewHolder.context, mGameEntity);
if (mGameEntity.isVGame() && mViewHolder.context.getString(R.string.download).equals(method)) {
if (mGameEntity.isVGame() && mViewHolder.context.getString(R.string.download).equals(method) && VHelper.INSTANCE.shouldLaunchGameAfterInstallation()) {
mViewHolder.context.startActivity(VSpaceLoadingActivity.getIntent(mViewHolder.context, mGameEntity, false));
}
} else {

View File

@ -6,6 +6,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.databinding.GameHeadItemBinding
import com.gh.gamecenter.entity.SubjectEntity
@ -64,5 +65,6 @@ class GameHeadViewHolder(var binding: GameHeadItemBinding) :
binding.arrowIv.visibility = View.VISIBLE
}
binding.headTitle.setTextColor(R.color.text_title.toColor(binding.root.context))
binding.adLabelTv.goneIf(!subject.adIconActive)
}
}

View File

@ -15,11 +15,9 @@ public class GameTestViewHolder extends GameViewHolder {
gameDownloadBtn = binding.home2DownloadBtn;
gameDes = binding.home2GameDes;
gameLabelList = binding.home2LabelList;
gameInfo = binding.home2GameLlInfo;
gameProgressbar = binding.home2GameProgressbar;
gameDownloadSpeed = binding.home2DownloadSpeed;
gameDownloadPercentage = binding.home2DownloadPercentage;
gameServerType = binding.home2GameServerType;
multiVersionDownloadTv = binding.multiVersionDownloadTv;
gameDownloadTips = binding.downloadTipsLottie;
}

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