Compare commits

..

159 Commits

Author SHA1 Message Date
c3bc85dd56 fix: 优化开屏广告的显示,提高线程池的 core 线程数,限制视频开屏广告的触摸控制 2025-01-08 10:55:37 +08:00
945e034f88 Merge branch 'fix/bind_phone_toRequestBody' into 'dev'
fix: 修复 bindPhone 相关接口 toRequestBody 时没有附带正确 body 的问题; 还原原生 settings 实现

See merge request halo/android/assistant-android!2024
2025-01-06 15:52:23 +08:00
a5ca88729a fix: 修复 bindPhone 相关接口 toRequestBody 时没有附带正确 body 的问题; 还原原生 settings 实现 2025-01-06 15:51:40 +08:00
d4bb3835cf Merge branch 'revert-e30557e2' into 'dev'
Revert "fix:https://jira.shanqu.cc/browse/GHZSCY-7300 【光环助手】预约上线弹窗神策数据上报问题"

See merge request halo/android/assistant-android!2022
2024-12-31 18:13:23 +08:00
3c63b74900 Revert "fix:https://jira.shanqu.cc/browse/GHZSCY-7300 【光环助手】预约上线弹窗神策数据上报问题"
This reverts merge request !2020
2024-12-31 18:10:16 +08:00
712cd21f6e Merge branch 'feat/GHZSCY-7168' into 'dev'
feat:CPM微信小游戏“换一批”功能优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7168

See merge request halo/android/assistant-android!2012
2024-12-31 16:58:00 +08:00
2b9098faa7 feat:CPM微信小游戏“换一批”功能优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7168 2024-12-31 16:38:25 +08:00
c0fde44534 Merge branch 'feat/upload_route_doc' into 'dev'
feat: 光环助手跳转链接规则优化 (补充跳转文档上传的脚本)

See merge request halo/android/assistant-android!2021
2024-12-31 16:35:28 +08:00
785f99f0ef feat: 光环助手跳转链接规则优化 (补充跳转文档上传的脚本) 2024-12-31 16:34:59 +08:00
dbd733aec6 Merge branch 'fix/GHZSCY-7300' into 'dev'
fix:https://jira.shanqu.cc/browse/GHZSCY-7300 【光环助手】预约上线弹窗神策数据上报问题

See merge request halo/android/assistant-android!2020
2024-12-31 15:46:36 +08:00
e30557e261 fix:https://jira.shanqu.cc/browse/GHZSCY-7300 【光环助手】预约上线弹窗神策数据上报问题 2024-12-31 15:45:05 +08:00
e4352590e9 Merge branch 'feat/GHZSCY-7052' into 'dev'
feat: 游戏下载关闭状态新增“跳转第三方”—客户端 https://jira.shanqu.cc/browse/GHZSCY-7052

See merge request halo/android/assistant-android!2017
2024-12-26 10:41:37 +08:00
4f68a52d54 feat: 游戏下载关闭状态新增“跳转第三方”—客户端 https://jira.shanqu.cc/browse/GHZSCY-7052 2024-12-26 10:41:37 +08:00
93f87c8022 Merge branch 'feat/GHZSCY-6866' into 'dev'
feat: 样式组件优化汇总—客户端 https://jira.shanqu.cc/browse/GHZSCY-6866

See merge request halo/android/assistant-android!2016
2024-12-24 11:42:13 +08:00
a77beed7db feat: 样式组件优化汇总—客户端 https://jira.shanqu.cc/browse/GHZSCY-6866 2024-12-24 11:42:13 +08:00
112ddfda13 Merge branch 'feat/GHZSCY-6945' into 'dev'
feat: 消息通知:极光推送本地化—客户端 https://jira.shanqu.cc/browse/GHZSCY-6945

See merge request halo/android/assistant-android!2015
2024-12-24 11:41:36 +08:00
14cf39f10b feat: 消息通知:极光推送本地化—客户端 https://jira.shanqu.cc/browse/GHZSCY-6945 2024-12-24 11:41:36 +08:00
d775e804fd Merge branch 'feat/GHZSCY-6824' into 'dev'
feat: 新游开测相关功能优化(第四期)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6824

See merge request halo/android/assistant-android!2014
2024-12-24 10:11:27 +08:00
d65062af26 feat: 新游开测相关功能优化(第四期)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6824 2024-12-24 10:11:27 +08:00
2522bf5654 Merge branch 'fix/parallel_game_auth' into 'dev'
fix: 修复双开分身游戏无法授权登录的问题

See merge request halo/android/assistant-android!2013
2024-12-19 17:03:24 +08:00
92177ae5f2 fix: 修复双开分身游戏无法授权登录的问题 2024-12-19 17:03:24 +08:00
21ab15a907 Merge branch 'feat/GHZSCY-6335' into 'dev'
feat:【光环助手】实名认证-实名状态更新——畅玩助手 https://jira.shanqu.cc/browse/GHZSCY-6335

See merge request halo/android/assistant-android!2011
2024-12-16 14:38:15 +08:00
5bea92c08e feat:【光环助手】实名认证-实名状态更新——畅玩助手 https://jira.shanqu.cc/browse/GHZSCY-6335 2024-12-16 14:04:38 +08:00
da6725e444 Merge branch 'feat/GHZSCY-6335' into 'dev'
feat:【光环助手】实名认证-实名状态更新——畅玩助手 https://jira.shanqu.cc/browse/GHZSCY-6335

See merge request halo/android/assistant-android!2010
2024-12-16 11:51:21 +08:00
2a2e887ddf feat:【光环助手】实名认证-实名状态更新——畅玩助手 https://jira.shanqu.cc/browse/GHZSCY-6335 2024-12-16 11:41:22 +08:00
cc39a754db build: 合并 vasdk 在 release 分支相关的内容 2024-12-11 17:03:15 +08:00
b14cd3d143 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/SplashScreenActivity.kt
#	app/src/main/java/com/gh/vspace/VHelper.kt
#	dependencies.gradle
#	vasdk
2024-12-11 16:47:12 +08:00
dc5b354861 Merge branch 'feat/GHZSCY-7039' into 'dev'
fix: https://jira.shanqu.cc/browse/GHZSCY-7037 实名认证弹窗层级优化

See merge request halo/android/assistant-android!2009
2024-12-11 16:32:09 +08:00
64462ebdbe fix: https://jira.shanqu.cc/browse/GHZSCY-7037 实名认证弹窗层级优化 2024-12-11 16:31:23 +08:00
2e63257523 Merge branch 'fix/game_collection_square_crash' into 'release'
fix: 修复游戏单广场闪退问题...

See merge request halo/android/assistant-android!2007
2024-12-09 10:36:46 +08:00
c69d117ee7 Merge branch 'feat/remove-gitlab-test-branch' into 'dev'
feat:移除gitlab-ci测试分支

See merge request halo/android/assistant-android!2006
2024-12-09 10:30:56 +08:00
ddccb25559 feat:移除gitlab-ci测试分支 2024-12-09 10:30:27 +08:00
913ea39302 Merge branch 'feature-GHZS-5572' into 'dev'
feat: 搜索业务-新增搜索发现取代热门标签—客户端 https://jira.shanqu.cc/browse/GHZSCY-5572

See merge request halo/android/assistant-android!1922
2024-12-09 10:27:39 +08:00
1002d02f12 feat: 搜索业务-新增搜索发现取代热门标签—客户端 https://jira.shanqu.cc/browse/GHZSCY-5572 2024-12-09 10:27:39 +08:00
fa663cd2f6 fix: 修复游戏单广场闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/379887/?project=22&query=is%3Aunresolved+assigned%3Ame&referrer=issue-stream&statsPeriod=14d 2024-12-09 09:59:53 +08:00
19af061311 Merge branch 'feat/GHZSCY-7123' into 'release'
feat:【光环助手】游戏搜索-排序专题 显示问题 https://jira.shanqu.cc/browse/GHZSCY-7123

See merge request halo/android/assistant-android!2004
2024-12-06 17:22:38 +08:00
d643795fa3 feat:【光环助手】游戏搜索-排序专题 显示问题 https://jira.shanqu.cc/browse/GHZSCY-7123 2024-12-06 17:22:38 +08:00
44d93b7527 Merge branch 'fix/sentry-va' into 'dev'
fix: sentry 捕获的异常 https://sentry.shanqu.cc/organizations/lightgame/issues/398398/?project=22

See merge request halo/android/assistant-android!2005
2024-12-06 16:55:03 +08:00
c3d55d4ff9 fix: sentry crash[https://sentry.shanqu.cc/organizations/lightgame/issues/399032/?project=22] 2024-12-06 16:46:46 +08:00
d6f35c5942 Merge branch 'fix/GHZSCY-7121' into 'dev'
fix: 【光环助手】深色模式显示问题 https://jira.shanqu.cc/browse/GHZSCY-7121

See merge request halo/android/assistant-android!2003
2024-12-05 11:07:45 +08:00
c53c1b8228 fix: 【光环助手】深色模式显示问题 https://jira.shanqu.cc/browse/GHZSCY-7121 2024-12-05 11:07:45 +08:00
61b967e533 fix: sentry 捕获的异常 https://sentry.shanqu.cc/organizations/lightgame/issues/398398/?project=22
https://sentry.shanqu.cc/organizations/lightgame/issues/397892/?project=22
2024-12-03 18:01:30 +08:00
b1f2d0a303 Merge branch 'fix/sentry-621063' into 'release'
fix: Sentry-421063 畅玩游戏启动弹窗异步更新下载游戏数量UI时导致的崩溃问题...

See merge request halo/android/assistant-android!2002
2024-12-03 14:10:47 +08:00
bb906f0bb8 fix: Sentry-421063 畅玩游戏启动弹窗异步更新下载游戏数量UI时导致的崩溃问题... 2024-12-03 14:10:47 +08:00
6f242dcc95 Merge branch 'fix/view_stub_crash' into 'release'
fix: 补充ViewStub闪退Sentry埋点

See merge request halo/android/assistant-android!2001
2024-12-03 13:42:44 +08:00
b47a64c63d fix: 补充ViewStub闪退Sentry埋点 2024-12-03 13:40:45 +08:00
948df2582c Merge branch 'fix/view_stub_crash' into 'release'
fix: 捕获ViewStub偶发的空指针闪退问题...

See merge request halo/android/assistant-android!2000
2024-12-03 12:04:31 +08:00
35edcf1d68 fix: 捕获ViewStub偶发的空指针闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418647/events/1d426e3ceda5477c9afbc6712d335b22/?project=22 2024-12-03 11:40:14 +08:00
286d7650f2 Merge branch 'hotfix/v5.38.6-1116/crashes' into 'release'
修复部分线上闪退问题

See merge request halo/android/assistant-android!1999
2024-12-03 10:43:39 +08:00
e566ab838f fix: 捕抓磁盘满了时的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/397785 2024-12-03 09:31:09 +08:00
cae720d4ec Merge branch 'fix/auth' into 'release'
fix: 修复未打开过光环时无法获取登录状态并授权的问题

See merge request halo/android/assistant-android!1998
2024-12-02 17:21:28 +08:00
925516724f fix: 修复未打开过光环时无法获取登录状态并授权的问题 2024-12-02 17:21:27 +08:00
a5f807c038 fix: 修复下载完成清理资源时因为磁盘满了引起的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/397443/ 2024-12-02 14:52:37 +08:00
f442a70bd3 Merge branch 'fix/delete_appointment_crash' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423693/?project=22...

See merge request halo/android/assistant-android!1997
2024-12-02 14:42:27 +08:00
9b3dab9897 fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423693/?project=22... 2024-12-02 14:42:27 +08:00
d939aae901 fix: 移除为了能正常收取 BroadcastReceiver 而创建的 InstallService (后续已改为回到应用刷新列表) https://sentry.shanqu.cc/organizations/lightgame/issues/389377/ 2024-12-02 14:31:29 +08:00
028974ec0d fix: 捕抓磁盘已满时下载简单内容造成的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/401379 2024-12-02 11:42:18 +08:00
ecd4610186 fix: 捕抓磁盘已满时下载广告插件造成的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/418801/ 2024-12-02 11:17:02 +08:00
21e5f2c98d Merge branch 'fix/webview_crash' into 'release'
fix: 修复某些机型启用WebView深色模式出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/421910

See merge request halo/android/assistant-android!1996
2024-12-02 10:57:52 +08:00
71c0cfe350 fix: 修复某些机型启用WebView深色模式出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/421910 2024-12-02 10:55:37 +08:00
3b8b60bc6b Merge branch 'fix/GHZSCY-7019' into 'release'
fix:【光环助手】自定义页面的搜索显示问题 https://jira.shanqu.cc/browse/GHZSCY-7019

See merge request halo/android/assistant-android!1995
2024-11-27 14:07:54 +08:00
ac59158dbb fix:【光环助手】自定义页面的搜索显示问题 https://jira.shanqu.cc/browse/GHZSCY-7019 2024-11-27 14:07:54 +08:00
5becdf2095 chore: 版本更新至 5.38.6 2024-11-27 11:42:36 +08:00
a88b49344f Merge branch 'hotfix/v5.38.5-1115/remove_registeraion_id' into 'release'
fix: 移除极光 registration_id

See merge request halo/android/assistant-android!1994
2024-11-27 10:43:19 +08:00
f34646cde8 fix: 移除极光 registration_id 2024-11-27 10:42:15 +08:00
bc4bb9b7c6 feat: 关于投诉邮箱部分数据遗失的对外说明 https://jira.shanqu.cc/browse/GHZSCY-7033 2024-11-25 17:46:05 +08:00
9e8ffce772 Merge branch 'hotfix/v5.38.5-1115/vgame_config' into 'release'
fix: 修复接口请求失败时会把畅玩入口关闭的问题

See merge request halo/android/assistant-android!1993
2024-11-25 16:07:13 +08:00
008985489a fix: 修复接口请求失败时会把畅玩入口关闭的问题 2024-11-25 16:01:07 +08:00
2f3fbd3e7c Merge branch 'fix/custom_page_missing_required_view_id' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/408589/events/edfa...

See merge request halo/android/assistant-android!1992
2024-11-25 09:26:26 +08:00
abef224830 fix:https://sentry.shanqu.cc/organizations/lightgame/issues/408589/events/edfa... 2024-11-25 09:26:26 +08:00
8feb9b788e Merge branch 'hotfix/v5.35.5-1115/auth_crash' into 'release'
fix: 修复授权登录页面的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/373402/?project=22

See merge request halo/android/assistant-android!1991
2024-11-25 09:22:52 +08:00
0a059deb44 fix: 修复授权登录页面的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/373402/?project=22 2024-11-22 10:14:27 +08:00
448160d255 Merge branch 'hotfix/v5.38.4-1114/va' into 'release'
fix: 修复混淆把这个方法移除了。

See merge request halo/android/assistant-android!1990
2024-11-21 14:45:54 +08:00
533f93a340 fix: 修复混淆把这个方法移除了。 2024-11-21 14:44:58 +08:00
d80b8a97a3 chore: 版本更新至 5.38.5 2024-11-21 11:50:17 +08:00
f2e6d98788 Merge branch 'feat/GHZSCY-6923' into 'release'
feat: CPM微信小游戏优化第二期—客户端 https://jira.shanqu.cc/browse/GHZSCY-6923

See merge request halo/android/assistant-android!1986
2024-11-21 11:27:25 +08:00
238a83c5fe feat: CPM微信小游戏优化第二期—客户端 https://jira.shanqu.cc/browse/GHZSCY-6923 2024-11-21 11:27:25 +08:00
ca71f23363 Merge branch 'hotfix/v5.38.4-1114/GHZSCY-7004' into 'release'
fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004

See merge request halo/android/assistant-android!1989
2024-11-21 09:57:59 +08:00
c96b41c621 fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004 2024-11-21 09:57:59 +08:00
9afb35bbb9 feat: 将与服务器校对时间的间隔改为 24 小时一次 2024-11-20 16:49:04 +08:00
e8ee63d52c Merge branch 'hotfix/v5.38.4-1114/GHZSCY-7004' into 'release'
fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004

See merge request halo/android/assistant-android!1987
2024-11-20 11:34:56 +08:00
90359cfffd fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004 2024-11-20 10:05:28 +08:00
a3da883033 Merge branch 'revert-8c95286f' into 'release'
Revert "Merge branch 'feat/GHZSCY-6923' into 'release'"

See merge request halo/android/assistant-android!1984
2024-11-19 18:16:53 +08:00
a9f1437a52 Revert "Merge branch 'feat/GHZSCY-6923' into 'release'" 2024-11-19 18:16:53 +08:00
8c95286fe5 Merge branch 'feat/GHZSCY-6923' into 'release'
feat: CPM微信小游戏优化第二期—客户端 https://jira.shanqu.cc/browse/GHZSCY-6923

See merge request halo/android/assistant-android!1982
2024-11-19 18:12:55 +08:00
8a835a94e3 feat: CPM微信小游戏优化第二期—客户端 https://jira.shanqu.cc/browse/GHZSCY-6923 2024-11-19 16:46:05 +08:00
14ec4aed3a Merge branch 'hotfix/v5.38.4-1114/GHZSCY-7004' into 'release'
fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004

See merge request halo/android/assistant-android!1981
2024-11-19 15:37:52 +08:00
07f956a1f0 fix: 神策数据库部分字段超存储上线的问题 https://jira.shanqu.cc/browse/GHZSCY-7004 2024-11-19 15:26:12 +08:00
6ef8d04e57 Merge branch 'fix/jg_push' into 'release'
fix: 神策上报极光推送ID改为profileSet方法

See merge request halo/android/assistant-android!1980
2024-11-18 18:21:45 +08:00
30248ef205 fix: 神策上报极光推送ID改为profileSet方法 2024-11-18 18:20:40 +08:00
87b9bb0bf3 fix: 修复下载过程中 response code 为 304 时造成下载异常的问题 2024-11-18 11:35:56 +08:00
b346882bfa Merge branch 'fix/GHZSCY-6939-merge' into 'release'
fix:【光环助手】“视频横屏滑动”专题视频播放问题 https://jira.shanqu.cc/browse/GHZSCY-6939

See merge request halo/android/assistant-android!1979
2024-11-15 17:51:24 +08:00
eeddb5ea51 fix:【光环助手】“视频横屏滑动”专题视频播放问题 https://jira.shanqu.cc/browse/GHZSCY-6939 2024-11-15 16:55:35 +08:00
2ccdd93e47 build: 处理编译问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-11-14 16:31:49 +08:00
d98466f60f build: 路由文档仅手动启用时生成 2024-11-14 16:19:42 +08:00
2afc2bc9d6 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/search/viewmodel/SearchGameListViewModel.kt
#	dependencies.gradle
#	feature/floating-window/src/demo/java/com/gh/gamecenter/feedback/view/help/QaFeedbackDialogFragment.kt
#	vasdk
2024-11-14 15:21:44 +08:00
243b0ccbd4 Merge branch 'fix/GHZSCY-6575' into 'dev'
fix: 下载按钮由双下载切换回单下载时的问题 https://jira.shanqu.cc/browse/GHZSCY-6575

See merge request halo/android/assistant-android!1878
2024-11-14 15:15:46 +08:00
78f9aa3ee4 Merge branch 'hotfix/v5.38.4-1114/GHZSCY-6927' into 'release'
fix: 深色模式下富文本指定颜色无法显示的问题 https://jira.shanqu.cc/browse/GHZSCY-6927

See merge request halo/android/assistant-android!1978
2024-11-14 10:21:48 +08:00
f355eae99b Merge branch 'feat/GHZSCY-6985' into 'dev'
fix:【光环助手】包名检测及搜索页面在深色模式下的显示问题 https://jira.shanqu.cc/browse/GHZSCY-6985

See merge request halo/android/assistant-android!1977
2024-11-13 17:39:06 +08:00
3c1af6e02d fix:【光环助手】包名检测及搜索页面在深色模式下的显示问题 https://jira.shanqu.cc/browse/GHZSCY-6985 2024-11-13 17:37:23 +08:00
57a8b96f56 Merge branch 'feat/GHZSCY-6984' into 'dev'
feat:搜索业务:神策埋点相关搜索结果点击事件新增序号属性position—客户端 https://jira.shanqu.cc/browse/GHZSCY-6984

See merge request halo/android/assistant-android!1976
2024-11-13 16:49:15 +08:00
71265e0ea7 feat:搜索业务:神策埋点相关搜索结果点击事件新增序号属性position—客户端 https://jira.shanqu.cc/browse/GHZSCY-6984 2024-11-13 16:46:09 +08:00
b007e63b5e Merge branch 'fix/GHZSCY-6971' into 'dev'
fix:【光环助手】2410后台优化-游戏专题-1112-测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-6971

See merge request halo/android/assistant-android!1975
2024-11-12 17:40:35 +08:00
c281ea7ac5 fix:【光环助手】2410后台优化-游戏专题-1112-测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-6971 2024-11-12 17:39:02 +08:00
f34ad0675d Merge branch 'hotfix/v5.38.4-1114/va' into 'release'
feat: 1. Android 8.0 以下不初始化VA。2.去掉VA的javahook。3. 去掉VA外部应用监听。

See merge request halo/android/assistant-android!1974
2024-11-12 17:24:03 +08:00
36abcc9f19 feat: 1. Android 8.0 以下不初始化VA。2.去掉VA的javahook。3. 去掉VA外部应用监听。 2024-11-12 11:17:02 +08:00
d6443a401a Merge branch 'feat/GHZSCY-5738' into 'dev'
fix:【光环助手】客户端UI组件规范更新同步2024/06/17 https://jira.shanqu.cc/browse/GHZSCY-5738

See merge request halo/android/assistant-android!1973
2024-11-12 09:28:36 +08:00
6c8ea6ffb2 fix:【光环助手】客户端UI组件规范更新同步2024/06/17 https://jira.shanqu.cc/browse/GHZSCY-5738 2024-11-11 18:04:22 +08:00
ae878eddf1 Merge branch 'hotfix/v5.38.4-1114/remove_useless_import' into 'release'
fix: 移除无用 import

See merge request halo/android/assistant-android!1971
2024-11-11 18:03:45 +08:00
ece519115b fix: 移除无用 import 2024-11-11 18:03:01 +08:00
b9e0a8e37a Merge branch 'hotfix/v5.38.4-1114/deadobject-crash' into 'release'
fix: 修复部分调用 PackageManager 相关的方法的闪退(提供异常时的回落)...

See merge request halo/android/assistant-android!1970
2024-11-11 17:35:26 +08:00
34ca8896ae fix: 修复部分调用 PackageManager 相关的方法的闪退(提供异常时的回落) https://sentry.shanqu.cc/organizations/lightgame/issues/418276/ https://sentry.shanqu.cc/organizations/lightgame/issues/417950/ 2024-11-11 17:24:40 +08:00
d6e19bfaff Merge branch 'fix/GHZSCY-6944' into 'release'
fix:【光环助手】神策埋点游戏单搜索结果点击事件游戏单标题的内容错误 https://jira.shanqu.cc/browse/GHZSCY-6944

See merge request halo/android/assistant-android!1969
2024-11-08 09:26:58 +08:00
943fb4d4e0 fix:【光环助手】神策埋点游戏单搜索结果点击事件游戏单标题的内容错误 https://jira.shanqu.cc/browse/GHZSCY-6944 2024-11-08 09:23:42 +08:00
2c5471d524 Merge branch 'fix/sentry-418688' into 'release'
fix: Sentry-418688 SearchActivity回调onSavedInstance后,调用FragmentManager的popBackStack引发的崩溃问题

See merge request halo/android/assistant-android!1968
2024-11-07 13:42:39 +08:00
cf527db60e fix: Sentry-418688 SearchActivity回调onSavedInstance后,调用FragmentManager的popBackStack引发的崩溃问题 2024-11-07 13:42:39 +08:00
f261991a55 fix: 深色模式下富文本指定颜色无法显示的问题 https://jira.shanqu.cc/browse/GHZSCY-6927
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-11-06 15:49:31 +08:00
0f9f0b7c9a Merge branch 'feat/GHZSCY-6645' into 'dev'
feat:媒体文件上传控件优化 (二、三)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6645

See merge request halo/android/assistant-android!1967
2024-11-06 15:09:48 +08:00
c29efbefd7 feat:媒体文件上传控件优化 (二、三)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6645 2024-11-06 15:09:47 +08:00
ab66621751 chore: 版本更新至 5.38.4 2024-11-04 17:59:19 +08:00
af262c624a Merge branch 'feat/GHZSCY-6904' into 'release'
feat:【光环助手】搜索bug https://jira.shanqu.cc/browse/GHZSCY-6904

See merge request halo/android/assistant-android!1966
2024-11-04 16:28:48 +08:00
d2813ecbda feat:【光环助手】搜索bug https://jira.shanqu.cc/browse/GHZSCY-6904 2024-11-04 16:28:48 +08:00
0ea932e36d Merge branch 'hotfix/v5.38.3-1113/aidl_npe_crash' into 'release'
fix: 尝试修复aidl获取对象为空导致NPE。https://sentry.shanqu.cc/organizations/lightgame/issues/399032/?project=22

See merge request halo/android/assistant-android!1965
2024-11-04 14:35:50 +08:00
68151ed6f9 fix: 尝试修复aidl获取对象为空导致NPE。https://sentry.shanqu.cc/organizations/lightgame/issues/399032/?project=22 2024-11-04 14:34:53 +08:00
e6d2361008 Merge branch 'hotfix/v5.38.3-1113/concurrent_crash' into 'release'
fix: 修复部分 5.38.3 的线上闪退问题

See merge request halo/android/assistant-android!1964
2024-11-04 13:43:00 +08:00
570b777c8e Merge branch 'hotfix/v5.38.3-1113/crashes' into 'release'
修复Sentry上的闪退问题

See merge request halo/android/assistant-android!1963
2024-11-04 11:50:45 +08:00
0e557b2246 fix: 修复启动游戏时多线程操作闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/406116/?project=22
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-11-04 11:50:41 +08:00
f155440814 fix: 修复下载 exception 异常为空时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/416995/?project=22
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-11-04 11:49:57 +08:00
62ba9fc7bf fix: 修复游戏详情评论页面重建时出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/379887/events/aa3bbc5102ed4a57b66c3c7fed5d7b34/?project=22 2024-11-04 11:26:00 +08:00
4637aa8808 fix: 修复下拉推送偶发的空指针闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418647/events/1d426e3ceda5477c9afbc6712d335b22/?project=22 2024-11-04 11:24:08 +08:00
81998e3aad Merge branch 'fix/sentry-418235' into 'release'
fix: 畅玩启动提示弹窗游戏列表数组越界问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418304/?project=22

See merge request halo/android/assistant-android!1962
2024-11-01 16:15:14 +08:00
82a8aa03ba fix: 畅玩启动提示弹窗游戏列表数组越界问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418304/?project=22 2024-11-01 16:13:05 +08:00
c876711578 chore: 版本更新至 5.38.3 2024-11-01 09:37:56 +08:00
41fcee7f4d Merge branch 'feat/GHZSCY-6876' into 'release'
Resolve GHZSCY-6876 "Feat/"

See merge request halo/android/assistant-android!1961
2024-11-01 09:37:04 +08:00
0ccbc4d581 feat:一键登录SDK更新—客户端 https://jira.shanqu.cc/browse/GHZSCY-6876 2024-11-01 09:37:04 +08:00
56151bc38d Merge branch 'fix/va-test-install' into 'dev'
fix: 1. 测试版本没有 从SD卡安装 的问题。2. 重复卸载安装不生效的bug

See merge request halo/android/assistant-android!1960
2024-10-31 16:07:30 +08:00
b7a0f3e74b fix: 1. 测试版本没有 从SD卡安装 的问题。2. 重复卸载安装不生效的bug 2024-10-31 16:06:12 +08:00
f05fc73e3a Merge branch 'hotfix/v5.38.2-1112/binding_crash' into 'release'
fix: 修复 SearchToolbarTabWrapperFragment 页面 binding bindView 时的闪退问题...

See merge request halo/android/assistant-android!1959
2024-10-31 10:31:26 +08:00
ca3c545f26 Merge branch 'hotfix/v5.38.1-1111/GHZSCY-6855' into 'release'
fix: 神策下载按钮点击事件相关字段上报异常排查 https://jira.shanqu.cc/browse/GHZSCY-6855

See merge request halo/android/assistant-android!1958
2024-10-31 10:28:28 +08:00
226539328e fix: 修复 SearchToolbarTabWrapperFragment 页面 binding bindView 时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418028/?project=22
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-31 10:13:36 +08:00
bb7db78b0c Merge branch 'hotfix/v5.38.2-1112/va_launch_crash' into 'release'
fix: 修复点击畅玩启动插屏广告出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418073/?project=22

See merge request halo/android/assistant-android!1957
2024-10-31 09:47:03 +08:00
ede62c5363 fix: 修复点击畅玩启动插屏广告出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/418073/?project=22 2024-10-31 09:44:40 +08:00
12bb6824ea Merge branch 'fix/wx_subscribe_msg_response_handle' into 'release'
fix: 修复微信开服提醒消息回调处理异常问题

See merge request halo/android/assistant-android!1955
2024-10-30 14:44:16 +08:00
15c0950754 fix: 修复微信开服提醒消息回调处理异常问题 2024-10-30 14:42:55 +08:00
f86b7fe12a Merge branch 'hotfix/v5.38.2-1112/emulator_auth' into 'release'
fix: 修复雷电模拟器网游插件登录后跳转回游戏出现的闪退问题

See merge request halo/android/assistant-android!1954
2024-10-30 14:31:22 +08:00
d12cdbd34b fix: 修复雷电模拟器网游插件登录后跳转回游戏出现的闪退问题 2024-10-30 14:31:22 +08:00
8436d4eda3 Merge branch 'hotfix/v5.38.2-1112/multi_tab_loading' into 'release'
fix: 修复多tab导航页loading动画没有显示的问题

See merge request halo/android/assistant-android!1952
2024-10-29 13:51:10 +08:00
be832037a7 fix: 修复多tab导航页loading动画没有显示的问题 2024-10-29 13:41:36 +08:00
c75a7444a9 Merge branch 'feat/GHZSCY-5889-therouter' into 'dev'
feat: 光环助手跳转链接规则优化(路由框架切换至 theRouter) https://jira.shanqu.cc/browse/GHZSCY-5889

See merge request halo/android/assistant-android!1925
2024-10-28 17:42:56 +08:00
0ae6279d60 feat: 光环助手跳转链接规则优化(路由框架切换至 theRouter) https://jira.shanqu.cc/browse/GHZSCY-5889 2024-10-28 17:42:56 +08:00
b620257825 Merge branch 'hotfix/v5.38.2-1112/GHZSCY-6859' into 'release'
fix:【光环助手】深色模式切换显示问题 https://jira.shanqu.cc/browse/GHZSCY-6859

See merge request halo/android/assistant-android!1951
2024-10-28 17:13:30 +08:00
6c88cace99 fix:【光环助手】深色模式切换显示问题 https://jira.shanqu.cc/browse/GHZSCY-6859 2024-10-28 17:11:23 +08:00
f875fa1b14 Merge branch 'feat/GHZSCY-6828' into 'release'
feat: CPM微信小游戏一期优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-6828

See merge request halo/android/assistant-android!1948
2024-10-28 14:54:49 +08:00
8076c3a70a feat: CPM微信小游戏一期优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-6828 2024-10-28 14:54:49 +08:00
bebab317a3 fix: 神策下载按钮点击事件相关字段上报异常排查 https://jira.shanqu.cc/browse/GHZSCY-6855 2024-10-28 14:38:06 +08:00
c450ca570d Merge branch 'hotfix/v5.38.2-1112/GHZSCY-6854' into 'release'
fix:【光环助手】切换深色/普通模式tab字体颜色变化问题 https://jira.shanqu.cc/browse/GHZSCY-6854

See merge request halo/android/assistant-android!1950
2024-10-28 10:23:56 +08:00
d239b0755f fix:【光环助手】切换深色/普通模式tab字体颜色变化问题 https://jira.shanqu.cc/browse/GHZSCY-6854 2024-10-28 10:20:53 +08:00
f4b54cbfa0 chore: 版本更新至 5.39.0
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-25 11:23:43 +08:00
0a187b2242 fix: 下载按钮由双下载切换回单下载时的问题 https://jira.shanqu.cc/browse/GHZSCY-6575
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-08-26 14:16:37 +08:00
700 changed files with 7604 additions and 10634 deletions

View File

@ -72,7 +72,6 @@ android_build:
only:
- dev
- release
- pack/update_sentry_plugin_cache
# 代码检查
sonarqube_analysis:
@ -158,4 +157,3 @@ oss-upload&send-email:
only:
- dev
- release
- pack/update_sentry_plugin_cache

View File

@ -2,7 +2,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' // kotlin
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.devtools.ksp'
apply plugin: 'kotlin-kapt'
apply plugin: 'therouter'
import groovy.xml.XmlUtil
@ -51,6 +53,10 @@ android {
}
}
ksp {
arg("ROUTER_MODULE_NAME", project.getName())
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
@ -123,12 +129,6 @@ android {
}
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.name)
}
}
packagingOptions {
// exclude 部分冗余的文件
exclude 'META-INF/gradle/incremental.annotation.processors'
@ -197,7 +197,7 @@ android {
java.srcDirs = ['src/main/java', "src/default/java"]
}
internal {
java.srcDirs = ['src/main/java', "src/default/java"]
java.srcDirs = ['src/main/java', "src/default/java", "src/internal/java"]
}
tea {
java.srcDirs = ['src/main/java', 'src/tea/java']
@ -378,7 +378,7 @@ dependencies {
implementation "androidx.annotation:annotation:${annotation}"
implementation "androidx.viewpager2:viewpager2:${viewpager2}"
kapt "androidx.room:room-compiler:${room}"
ksp("androidx.room:room-compiler:${room}")
implementation "com.tencent.vasdolly:helper:${apkChannelPackage}"
implementation "com.tencent.vasdolly:writer:${apkChannelPackage}"
@ -428,7 +428,8 @@ dependencies {
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:${desugarJdkLibs}"
kapt "com.alibaba:arouter-compiler:$arouterVersion"
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
ksp "cn.therouter:apt:${routerVersion}"
implementation project(':ndownload')
implementation project(':vspace-bridge:vspace')
@ -450,9 +451,9 @@ dependencies {
exclude group: 'androidx.swiperefreshlayout'
}
// implementation(project(':module_setting_compose')) {
// exclude group: 'androidx.swiperefreshlayout'
// }
// implementation(project(':module_setting_compose')) {
// exclude group: 'androidx.swiperefreshlayout'
// }
if (!gradle.ext.excludeOptionalModules || gradle.ext.enablePkg) {
implementation(project(':feature:pkg'))
@ -509,6 +510,10 @@ dependencies {
implementation(project(':feature:sentry'))
}
if (gradle.ext.enableRouteDoc) {
ksp project(":feature:route_doc")
}
implementation(project(':feature:media_select'))
implementation(project(":module_va_api"))

View File

@ -68,6 +68,9 @@
<!-- 悬浮窗 -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- 适配 双开/分身 游戏授权登录 -->
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-sdk tools:overrideLibrary="
com.shuyu.gsyvideoplayer,
com.shuyu.gsyvideoplayer.lib,
@ -517,10 +520,6 @@
android:name=".video.data.VideoDataActivity"
android:screenOrientation="portrait" />
<activity
android:name=".video.poster.PosterEditActivity"
android:screenOrientation="portrait" />
<activity
android:name=".forum.detail.ForumDetailActivity"
android:screenOrientation="portrait" />
@ -638,8 +637,9 @@
<!-- android:theme="@android:style/Theme.Translucent" />-->
<activity
android:name="com.gh.gamecenter.SkipActivity"
android:name="com.gh.gamecenter.SkipCompatActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/Theme.AppCompat.Light.Fullscreen.Transparent">
<intent-filter>
<data android:scheme="ghzhushou" />
@ -663,7 +663,8 @@
android:name=".authorization.AuthorizationActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:taskAffinity=".auth">
<intent-filter>
<data android:scheme="ghzhushou_authorization" />
<category android:name="android.intent.category.DEFAULT" />
@ -809,6 +810,10 @@
android:screenOrientation="portrait"
android:theme="@style/AppCompatTheme.APP" />
<activity
android:name=".video.poster.PosterEditActivity"
android:screenOrientation="portrait" />
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->
<!-- android:launchMode="singleTask"-->
@ -864,10 +869,6 @@
<!-- tools:node="remove" />-->
<!-- </provider>-->
<service android:name="com.gh.gamecenter.install.InstallService" />
<service android:name="com.gh.download.suspendwindow.DownloadSuspendWindowService" />
<receiver
android:name="com.gh.gamecenter.receiver.DownloadReceiver"
android:exported="false">

View File

@ -12,7 +12,7 @@ import android.widget.FrameLayout
import android.widget.TextView
import androidx.appcompat.content.res.AppCompatResources
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.DirectUtils.directToLinkPage
@ -94,8 +94,7 @@ object AdDelegateHelper {
private fun initAdSdkInternal(context: Context) {
// 初始化穿山甲
if (mCsjAdImpl == null) {
mCsjAdImpl =
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
mCsjAdImpl = TheRouter.get(ICsjAdProvider::class.java)
val csjAppId = if (EnvHelper.isDevEnv) BuildConfig.DEV_CSJ_APPID else BuildConfig.CSJ_APPID
mCsjAdImpl?.initSDK(context, csjAppId, HaloApp.getInstance().oaid)
// 监听亮色/暗色模式切换

View File

@ -1,13 +1,10 @@
package com.gh.ad
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.view.ViewStub
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.provider.ILaunchAd
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.goneIf
@ -15,10 +12,8 @@ import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.entity.AdConfig
@Route(path = RouteConsts.provider.vaAd, name = "畅玩启动页广告")
@com.therouter.inject.ServiceProvider
class LaunchAdImpl : ILaunchAd {
override fun init(context: Context?) {
}
override fun requestAd(fragment: Fragment, container: ViewGroup, maskView: View, topViewStub: ViewStub, bottomViewStub: ViewStub, adClickAction: () -> Unit): View {
if (AdDelegateHelper.shouldShowHelperLaunchAd()) {
@ -104,4 +99,4 @@ class LaunchAdImpl : ILaunchAd {
companion object {
private const val AD_PLACEMENT = "畅玩启动"
}
}
}

View File

@ -44,6 +44,10 @@ class SplashAdVideoView @JvmOverloads constructor(
return R.layout.layout_splash_ad_video
}
override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) {
// no nothing
}
override fun onAutoCompletion() {
setStateAndUi(CURRENT_STATE_AUTO_COMPLETE);

View File

@ -21,26 +21,31 @@ import com.gh.common.view.RichEditor
import com.gh.gamecenter.CropImageActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.LocalVideoEntity
import com.gh.gamecenter.feature.selector.LocalMediaActivity
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.qa.editor.*
import com.gh.gamecenter.entity.GamesCollectionEntity
import com.gh.gamecenter.entity.MyVideoEntity
import com.gh.gamecenter.entity.VideoEntity
import com.gh.gamecenter.feature.entity.AnswerEntity
import com.gh.gamecenter.feature.entity.ArticleEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.selector.ChooseType
import com.gh.gamecenter.feature.selector.LocalMediaActivity
import com.gh.gamecenter.qa.editor.*
import com.gh.gamecenter.qa.entity.EditorInsertEntity
import com.gh.gamecenter.video.poster.PosterEditActivity
import com.gh.gamecenter.video.poster.video.VideoPosterFragment
import com.gh.gamecenter.video.upload.UploadManager
import com.google.gson.JsonObject
import com.halo.assistant.HaloApp
import com.lightgame.utils.Util_System_Keyboard
import com.lightgame.utils.Utils
import com.lightgame.view.CheckableImageView
import com.therouter.TheRouter
import io.reactivex.disposables.Disposable
import org.json.JSONArray
import org.json.JSONObject
@ -229,6 +234,7 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> constructor(
@SuppressLint("AddJavascriptInterface", "ClickableViewAccessibility")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
VideoPosterFragment.createVideoCoverFile(this)
findView()
onRichClick()
mViewModel = provideViewModel()
@ -739,9 +745,9 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> constructor(
mViewModel.id = id
mViewModel.videoId = videoId
val videoEntity = VideoEntity(url = url)
val intent =
PosterEditActivity.getIntentByVideo(this@BaseRichEditorActivity, videoEntity)
startActivityForResult(intent, REQUEST_CODE_IMAGE_CROP)
TheRouter.build(RouteConsts.activity.videoCoverEditActivity)
.withParcelable(EntranceConsts.KEY_VIDEO_ENTITY, videoEntity)
.navigation(this@BaseRichEditorActivity, REQUEST_CODE_IMAGE_CROP)
}
@JavascriptInterface

View File

@ -4,7 +4,7 @@ import android.app.Activity
import android.app.Application
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.ad.AdDelegateHelper
import com.gh.common.util.FloatingBackViewManager
import com.gh.common.xapk.XapkInstaller
@ -53,7 +53,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
if (GlobalActivityManager.activityCount == 1) {
// 清除桌面角标
if (activity !is SplashScreenActivity && activity !is AuthorizationActivity) {
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val pushProvider = TheRouter.get(IPushProvider::class.java)
pushProvider?.cleanBadgeNumber(activity.applicationContext)
}
}
@ -126,9 +126,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
}
private fun isSuggestionActivity(activity: Activity): Boolean {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
return helpAndFeedbackProvider?.isSuggestionActivity(activity) ?: false
}

View File

@ -11,7 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.*
import com.gh.common.util.LogUtils
@ -345,7 +345,7 @@ class DefaultJsApi(
@JavascriptInterface
fun getPushId(): String {
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val pushProvider = TheRouter.get(IPushProvider::class.java)
return pushProvider?.getRegistrationId(HaloApp.getInstance()) ?: "unknown"
}
@ -424,8 +424,7 @@ class DefaultJsApi(
@JavascriptInterface
fun showQaFeedbackDialog(msg: Any) {
val mHelpAndFeedbackHelp =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback).navigation() as? IHelpAndFeedbackProvider
val mHelpAndFeedbackHelp = TheRouter.get(IHelpAndFeedbackProvider::class.java)
mHelpAndFeedbackHelp?.showQaFeedbackDialogFragment(context as AppCompatActivity, msg.toString())
}

View File

@ -15,6 +15,7 @@ import com.gh.common.util.DirectUtils.directToLegacyVideoDetail
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.DirectUtils.directToQa
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.SkipCompatActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
@ -66,6 +67,10 @@ object DefaultUrlHandler {
bringAppToFront: Boolean = false,
sourceEntrance: String = ""): Boolean {
val uri = Uri.parse(url)
// 优先交给新的路由拦截处理
if (SkipCompatActivity.handleSkip(context, uri)) return true
if ("ghzhushou" == uri.scheme) {
Utils.log("url = $url")
Utils.log("url = " + uri.scheme!!)

View File

@ -17,7 +17,7 @@ import kotlin.concurrent.fixedRateTimer
object FixedRateJobHelper {
private const val CHECKER_PERIOD: Long = 15 * 1000L
private const val TIME_PERIOD: Long = 10 * 60 * 1000L
private const val TIME_PERIOD: Long = 24 * 60 * 60 * 1000L
private const val LOGHUB_PERIOD: Long = 2 * 60 * 1000L
private const val EXPOSURE_PERIOD: Long = 1 * 60 * 1000L
private const val REGION_SETTING_PERIOD: Long = 60 * 1000L
@ -35,7 +35,7 @@ object FixedRateJobHelper {
// 时间检查每15秒检查一次
fixedRateTimer("Global-Fixed-Rate-Timer", initialDelay = 100, period = CHECKER_PERIOD) {
val elapsedTime = mExecuteCount * CHECKER_PERIOD
// 时间校对,10分钟一次
// 时间校对,24 小时一次
if (elapsedTime % TIME_PERIOD == 0L) {
RetrofitManager.getInstance().api.time
.subscribeOn(Schedulers.io())

View File

@ -114,8 +114,6 @@ public class Config {
if (!TextUtils.isEmpty(json)) {
mSettingsEntity = GsonUtils.fromJson(json, SettingsEntity.class);
}
mSettingsEntity.setGameSmooth("off");
} catch (Exception e) {
e.printStackTrace();
}
@ -263,8 +261,7 @@ public class Config {
public void onSuccess(VSetting data) {
mVSetting = data;
SPUtils.setString(Constants.SP_V_SETTINGS, GsonUtils.toJson(data));
VHelper.init(HaloApp.getInstance());
VHelper.checkVspaceUpdate(HaloApp.getInstance());
}
});
}

View File

@ -15,10 +15,10 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.gh.common.chain.BrowserInstallHandler;
import com.gh.common.chain.DownloadChainBuilder;
import com.gh.common.chain.DownloadChainHandler;
import com.gh.common.chain.CheckDownloadHandler;
import com.gh.common.chain.CheckStoragePermissionHandler;
import com.gh.common.chain.DownloadChainBuilder;
import com.gh.common.chain.DownloadChainHandler;
import com.gh.common.chain.DownloadDialogHelperHandler;
import com.gh.common.chain.GamePermissionHandler;
import com.gh.common.chain.LandPageAddressHandler;
@ -287,19 +287,11 @@ public class BindingAdapters {
});
break;
case RESERVED:
if ("download".equals(gameEntity.getReserveStatus())) {
ReservationHelper.showDeleteReservationDialog(progressBar.getContext(), () -> {
ReservationHelper.deleteReservation(gameEntity, () -> {
updateReservation(progressBar, gameEntity);
});
ReservationHelper.showCancelReservationDialog(progressBar.getContext(),gameEntity, () -> {
ReservationHelper.cancelReservation(gameEntity, () -> {
updateReservation(progressBar, gameEntity);
});
} else {
ReservationHelper.showCancelReservationDialog(progressBar.getContext(),gameEntity, () -> {
ReservationHelper.cancelReservation(gameEntity, () -> {
updateReservation(progressBar, gameEntity);
});
});
}
});
break;
case H5_GAME:
LinkEntity linkEntity = gameEntity.getH5Link();
@ -345,9 +337,9 @@ public class BindingAdapters {
}
progressBar.setButtonStyle(DownloadButton.ButtonStyle.H5_GAME);
} else {
if (offStatus != null && "dialog".equals(offStatus)) {
if (("dialog".equals(offStatus) || "third_party".equals(offStatus))) {
progressBar.setText("查看");
progressBar.setButtonStyle(DownloadButton.ButtonStyle.NONE);
progressBar.setButtonStyle(DownloadButton.ButtonStyle.NONE_WITH_HINT);
} else if ("updating".equals(offStatus)) {
progressBar.setText("更新中");
progressBar.setButtonStyle(DownloadButton.ButtonStyle.UPDATING);

View File

@ -31,6 +31,7 @@ class ExposureListener(var fragment: Fragment, var exposable: IExposable) : Recy
override fun onFragmentPaused(fm: FragmentManager, f: Fragment) {
if (fragment == f) {
visibleState?.let { commitExposure(it) }
visibleState?.let { commitWXCPMExposure(it) }
throttleBus.clear()
}
}

View File

@ -0,0 +1,74 @@
package com.gh.common.fragment
import androidx.fragment.app.FragmentManager
import java.lang.reflect.Field
fun FragmentManager.popBackStackAllowStateLoss() {
popBackStackAllowStateLoss(-1, 0)
}
fun FragmentManager.popBackStackAllowStateLoss(id: Int, flags: Int) {
if (!isStateSaved) {
popBackStack(id, flags)
} else {
hook { popBackStack(id, flags) }
}
}
fun FragmentManager.popBackStackAllowStateLoss(name: String?, flags: Int) {
if (!isStateSaved) {
popBackStack(name, flags)
} else {
hook { popBackStack(name, flags) }
}
}
fun FragmentManager.popBackStackImmediateAllowStateLoss() = popBackStackAllowStateLoss(-1, 0)
fun FragmentManager.popBackStackImmediateAllowStateLoss(id: Int, flags: Int) =
if (!isStateSaved) {
popBackStackImmediate(id, flags)
} else {
hook { popBackStackImmediate(id, flags) }
}
fun FragmentManager.popBackStackImmediateAllowStateLoss(name: String?, flags: Int): Boolean =
if (!isStateSaved) {
popBackStackImmediate(name, flags)
} else {
hook { popBackStackImmediate(name, flags) }
}
/**
* 通过反射将FragmentManager的mStateSaved和mStopped设为false否则Activity在回调onSavedInstance以后
* 调用Fragment的popBackStack和popBackStackImmediate方法会触发“java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState”的异常。
* @see <a href="https://sentry.shanqu.cc/organizations/lightgame/issues/418688/?project=22">Sentry-418688</a>
*/
private fun <T> FragmentManager.hook(callback: FragmentManager.() -> T): T {
val mStateSavedField = getField(this::class.java,"mStateSaved")
val stateSaved = mStateSavedField.get(this);
mStateSavedField.set(this, false)
val mStoppedField = getField(this::class.java,"mStopped")
val stopped = mStateSavedField.get(this);
mStoppedField.set(this, false)
val result = callback.invoke(this)
mStateSavedField.set(this, stateSaved)
mStoppedField.set(this, stopped)
return result
}
@Throws(NoSuchFieldException::class)
private fun getField(clazz: Class<*>, name: String): Field {
var cls: Class<*>? = clazz
while (cls != null) {
try {
val declaredField = cls.getDeclaredField(name)
declaredField.isAccessible = true
return declaredField
} catch (e: NoSuchFieldException) {
e.printStackTrace()
}
cls = cls.superclass
}
throw NoSuchFieldException()
}

View File

@ -1,12 +1,9 @@
package com.gh.common.iinterface
interface ISmartRefreshContent {
/**
* 启用/关闭 页面滑动
* @param isScrollEnabled 是否启用
*/
fun setScrollEnabled(isScrollEnabled: Boolean)
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.constant.RefreshState
interface ISmartRefreshContent {
fun onRefresh()
/**
@ -14,4 +11,6 @@ interface ISmartRefreshContent {
* @param isSwipeRefreshEnabled 是否启用
*/
fun setSwipeRefreshEnabled(isSwipeRefreshEnabled: Boolean)
fun onStateChanged(refreshLayout: RefreshLayout, oldState: RefreshState, newState: RefreshState)
}

View File

@ -103,7 +103,6 @@ class AccelerateNotificationHandler(priority: Int) : PriorityChainHandler(priori
context = activity,
gameId = gameEntity.id,
entrance = "首页插件上架弹窗",
defaultTab = -1,
isSkipGameComment = false,
scrollToLibao = false,
openVideoStreaming = false,

View File

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

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.AdHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.provider.IAdHelperProvider
@Route(path = RouteConsts.provider.adHelper, name = "AdHelper暴露服务")
class AdHelperProviderImpl : IAdHelperProvider {
override fun getSuggestionFunctionAd(): SettingsEntity.AD? {
return AdHelper.getAd(AdHelper.LOCATION_SUGGESTION_FUNCTION)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,15 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.BuildConfig
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.gh.gamecenter.va.VCore
import com.halo.assistant.HaloApp
@Route(path = RouteConsts.provider.app, name = "Application暴露服务")
@com.therouter.inject.ServiceProvider
class AppProviderImpl : IAppProvider {
override fun init(context: Context?) {
// Do nothing
}
override fun getAppName(): String {
return HaloApp.getInstance().getString(R.string.app_name)
@ -93,4 +88,5 @@ class AppProviderImpl : IAppProvider {
override fun initImageLoaderIfNeeded() {
HaloApp.getInstance().initFresco()
}
}

View File

@ -1,16 +1,13 @@
package com.gh.common.provider
import android.content.Context
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
@Route(path = RouteConsts.provider.bindingAdapters, name = "BindingAdapters暴露服务")
@com.therouter.inject.ServiceProvider
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGameName(
view: TextView,
@ -31,8 +28,4 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGame(view: View, gameEntity: GameEntity) {
BindingAdapters.setGame(view, gameEntity)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,9 @@
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暴露服务")
@com.therouter.inject.ServiceProvider
class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun isUseBrowserToInstallEnabled(): Boolean = BrowserInstallHelper.isUseBrowserToInstallEnabled()
@ -15,9 +12,4 @@ class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun logSwitchInstallSettingEvent() {
BrowserInstallHelper.logOrdinaryBrowserEvent(BrowserInstallHelper.Type.SWITCH_INSTALL_SETTING)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,17 +1,10 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IBuildConfigProvider
@Route(path = RouteConsts.provider.buildConfig, name = "BuildConfig暴露服务")
@com.therouter.inject.ServiceProvider
class BuildConfigImpl : IBuildConfigProvider {
override fun init(context: Context?) {
// Do nothing
}
override fun getApplicationId(): String = BuildConfig.APPLICATION_ID
override fun getVersionName(): String = BuildConfig.VERSION_NAME

View File

@ -1,18 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.CheckLoginUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ICheckLoginProvider
@Route(path = RouteConsts.provider.checkLogin, name = "CheckLoginUtils暴露服务")
@com.therouter.inject.ServiceProvider
class CheckLoginProviderImpl : ICheckLoginProvider {
override fun checkLogin(context: Context, entrance: String, action: (() -> Unit)?) {
CheckLoginUtils.checkLogin(context, entrance, action)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,20 +3,16 @@ 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.therouter.router.Route
import com.gh.gamecenter.CommentDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ICommentDetailProvider
import com.gh.gamecenter.feature.entity.MessageEntity
@Route(path = RouteConsts.provider.commentDetail, name = "CommentDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class CommentDetailProviderImpl : ICommentDetailProvider {
override fun getIntent(context: Context, commentId: String?, message: Parcelable): Intent {
return CommentDetailActivity.getIntent(context, commentId, message as MessageEntity.Article)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -1,18 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ICommentManagerProvider
import com.gh.gamecenter.manager.CommentManager
@Route(path = RouteConsts.provider.commentManager, name = "CommentManager暴露服务")
@com.therouter.inject.ServiceProvider
class CommentManagerProviderImpl : ICommentManagerProvider {
override fun addUrl(ids: String) {
CommentManager.getInstance().addUrl(ids)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,12 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.CommentUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ICommentUtilsProvider
@Route(path = RouteConsts.provider.commentUtils, name = "CommentUtils暴露服务")
@com.therouter.inject.ServiceProvider
class CommentUtilsProviderImpl : ICommentUtilsProvider {
override fun setCommentTime(textView: TextView, time: Long) {
CommentUtils.setCommentTime(textView, time)
@ -16,8 +16,4 @@ class CommentUtilsProviderImpl : ICommentUtilsProvider {
override fun getCommentTime(timestamp: Long): String {
return CommentUtils.getCommentTime(timestamp)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -8,7 +8,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.viewbinding.ViewBinding
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.util.ConcernContentUtils
import com.gh.common.view.ImageContainerView
@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.toArrayList
import com.gh.gamecenter.core.provider.IConcernArticleUtilsProvider
import com.gh.gamecenter.databinding.RecyclerGameArticleBinding
@Route(path = RouteConsts.provider.concernContentUtils, name = "ConcernContentUtils暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
override fun addContentPic(
context: Context,
@ -95,8 +95,4 @@ class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
override fun getTvComment(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvComment
override fun getTvShare(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvShare
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -6,14 +6,14 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.viewbinding.ViewBinding
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.core.provider.IConcernGiftPackUtilsProvider
import com.gh.gamecenter.databinding.RecyclerGiftPackBinding
@Route(path = RouteConsts.provider.concernGiftPackUtils, name = "ConcernGiftPackUtils暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
override fun createBinding(parent: ViewGroup): ViewBinding {
val inflater = LayoutInflater.from(parent.context)
@ -48,7 +48,4 @@ class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
override fun getTvGiftPackContent(viewBinding: ViewBinding) =
(viewBinding as RecyclerGiftPackBinding).tvGiftPackContent
override fun init(context: Context?) {
// Do Nothing
}
}
}

View File

@ -2,19 +2,15 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.ConcernActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConcernProvider
@Route(path = RouteConsts.provider.concernActivity, name = "ConcernActivity暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernProviderImpl : IConcernProvider {
override fun getIntent(context: Context, entrance: String): Intent {
return ConcernActivity.getIntent(context, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,18 +2,14 @@ package com.gh.common.provider
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConcernShareNewsProvider
import com.gh.gamecenter.newsdetail.NewsShareDialog
@Route(path = RouteConsts.provider.concernShareNews, name = "ConcernShareNews暴露服务")
@com.therouter.inject.ServiceProvider
class ConcernShareNewsProviderImpl : IConcernShareNewsProvider {
override fun share(activity: AppCompatActivity, shortId: String?, id: String?, gameIcon: String?, title: String?) {
NewsShareDialog.show(activity, shortId, id, gameIcon, title)
}
override fun init(context: Context?) {
// Do Nothing
}
}

View File

@ -1,12 +1,9 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IConfigProvider
@Route(path = RouteConsts.provider.config, name = "Config暴露服务")
@com.therouter.inject.ServiceProvider
class ConfigProviderImpl : IConfigProvider {
override fun getTencentAppId(): String {
return Config.TENCENT_APPID
@ -103,8 +100,4 @@ class ConfigProviderImpl : IConfigProvider {
override fun isJiguangSwitch(): Boolean {
return Config.getNewApiSettingsEntity()?.jiguangSwitch ?: false
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.provider.IConfigSettingProvider
@Route(path = RouteConsts.provider.configSetting, name = "Config.getSettings暴露服务")
@com.therouter.inject.ServiceProvider
class ConfigSettingProviderImpl : IConfigSettingProvider {
override fun getSettings(): SettingsEntity? {
return Config.getSettings()
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -0,0 +1,58 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import android.net.Uri
import com.gh.gamecenter.CropImageActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.core.provider.ICropImageProvider
import com.gh.gamecenter.personalhome.background.BackgroundClipActivity
import com.halo.assistant.fragment.user.UserPortraitCropImageActivity
import com.lightgame.utils.Utils
import com.zhihu.matisse.internal.utils.PathUtils
@com.therouter.inject.ServiceProvider
class CropImageProviderImpl : ICropImageProvider {
override fun getCropImageIntent(data: List<Uri>, imageType: Int, entrance: String, context: Context): Intent? {
if (data.isEmpty()) {
return null
}
val picturePath = PathUtils.getPath(context, data[0])
Utils.log("picturePath = $picturePath")
return when (imageType) {
IMAGE_TYPE_AVATAR -> {// 上传头像
UserPortraitCropImageActivity.getIntent(
context,
picturePath,
"我的光环(选择头像)"
)
}
IMAGE_TYPE_GAME_COLLECTION_COVER -> {// 游戏单封面
CropImageActivity.getIntent(
context,
picturePath,
142 / 328F,
false,
R.layout.layout_game_collection_crop_image_assist,
entrance
)
}
IMAGE_TYPE_PERSONAL_BACKGROUND -> { // 用户主页背景
BackgroundClipActivity.getIntent(context, picturePath, entrance)
}
else ->
null
}
}
companion object {
const val IMAGE_TYPE_AVATAR = 1
const val IMAGE_TYPE_GAME_COLLECTION_COVER = 2
const val IMAGE_TYPE_PERSONAL_BACKGROUND = 3
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DataCollectionUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IDataCollectionProvider
@Route(path = RouteConsts.provider.dataCollection, name = "DataCollectionUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DataCollectionProviderImpl : IDataCollectionProvider {
override fun uploadClick(context: Context, vararg args: String) {
DataCollectionUtils.uploadClick(context, *args)
@ -15,8 +15,4 @@ class DataCollectionProviderImpl : IDataCollectionProvider {
override fun uploadConcern(context: Context, vararg args: String) {
DataCollectionUtils.uploadConcern(context, *args)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DataUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDataUtilsProvider
import com.halo.assistant.HaloApp
@Route(path = RouteConsts.provider.dataUtils, name = "DataUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DataUtilsProviderImpl : IDataUtilsProvider {
override fun getDeviceCertification() {
DataUtils.getDeviceCertification(HaloApp.getInstance().gid)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.DefaultUrlHandler
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider
@Route(path = RouteConsts.provider.defaultUrlHandler, name = "DefaultUrlHandler暴露服务")
@com.therouter.inject.ServiceProvider
class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
override fun interceptUrl(
@ -19,7 +19,4 @@ class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
return DefaultUrlHandler.interceptUrl(context, url, null, entrance, bringAppToFront, sourceEntrance)
}
override fun init(context: Context?) {
// Do nothing
}
}
}

View File

@ -2,14 +2,12 @@ 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
import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDialogUtilsProvider
@Route(path = RouteConsts.provider.dialogUtils, name = "DialogUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DialogUtilsProviderImpl : IDialogUtilsProvider {
override fun showRegulationTestDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
DialogUtils.showRegulationTestDialog(context, object : ConfirmListener {
@ -45,8 +43,4 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
}
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog = DialogUtils.showBindPhoneDialog(context) { confirm.invoke() }
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,12 +3,12 @@ package com.gh.common.provider
import android.app.Activity
import android.content.Context
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDirectProvider
@Route(path = RouteConsts.provider.directUtils, name = "DirectUtils暴露服务")
@com.therouter.inject.ServiceProvider
class DirectProviderImpl : IDirectProvider {
override fun directToWebView(context: Context, url: String, entrance: String?) {
@ -96,8 +96,4 @@ class DirectProviderImpl : IDirectProvider {
override fun directToExternalBrowser(context: Context, url: String) {
DirectUtils.directToExternalBrowser(context, url)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,10 +1,7 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.entity.GameUpdateEntity
@ -17,7 +14,7 @@ import com.gh.gamecenter.packagehelper.PackageRepository
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
@Route(path = RouteConsts.provider.downloadButtonClickedHandler, name = "DownloadButton点击事件暴露服务")
@com.therouter.inject.ServiceProvider
class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
override fun onClicked(downloadButton: DownloadButton) {
var gameId = ""
@ -115,6 +112,12 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
"本地下载"
}
// 小游戏的启动不需要上报下载点击事件
// @see https://jira.shanqu.cc/browse/GHZSCY-7013
if (boundedObject is GameEntity && boundedObject.isMiniGame()) {
return
}
// 上报神策点击事件
val customPageKV = customPageTrackData?.toKV() ?: arrayOf()
SensorsBridge.trackEventWithExposureSource(
@ -124,7 +127,7 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
"game_name", gameName,
"game_type", gameTypeInChinese,
"download_status", downloadStatusInChinese,
"button_name", downloadButton.text,
"button_name", text,
"game_schema_type", gameSchemaType,
"download_type", downloadType,
"page_name", GlobalActivityManager.getCurrentPageEntity().pageName,
@ -139,8 +142,4 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
}
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,13 +1,10 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IDownloadManagerProvider
import com.lightgame.download.DownloadEntity
@Route(path = RouteConsts.provider.downloadManager, name = "DownloadManager暴露服务")
@com.therouter.inject.ServiceProvider
class DownloadManagerProviderImpl : IDownloadManagerProvider {
override fun getDownloadEntityByUrl(url: String): DownloadEntity? {
@ -18,8 +15,4 @@ class DownloadManagerProviderImpl : IDownloadManagerProvider {
DownloadManager.getInstance().resumeAllInvisiblePendingTask()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -5,15 +5,16 @@ import android.content.Intent
import android.os.Build
import android.os.Bundle
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.common.avoidcallback.Callback
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IEntranceUtilsProvider
import com.lightgame.utils.AppManager
@Route(path = RouteConsts.provider.entranceUtils, name = "EntranceUtils暴露服务")
@com.therouter.inject.ServiceProvider
class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
override fun jumpActivity(context: Context, bundle: Bundle) {
EntranceUtils.jumpActivity(context, bundle)
}
@ -32,10 +33,6 @@ class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
} else {
EntranceUtils.jumpActivityCompat(AppManager.getInstance().currentActivity(), bundle)
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,14 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.ErrorHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IErrorHelperProvider
import com.gh.gamecenter.login.user.LoginTag
import retrofit2.HttpException
@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务")
@com.therouter.inject.ServiceProvider
class ErrorHelperProviderImpl : IErrorHelperProvider {
override fun handleError(
@ -28,7 +25,4 @@ class ErrorHelperProviderImpl : IErrorHelperProvider {
ErrorHelper.handleLoginError(context, httpException, loginTagChinese, isCertificate)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,20 +1,15 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.exposure.ExposureManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IExposureManagerProvider
@Route(path = RouteConsts.provider.exposureManager, name = "ExposureManager暴露服务")
@com.therouter.inject.ServiceProvider
class ExposureManagerProviderImpl: IExposureManagerProvider {
override fun logExposure(exposureEvent: ExposureEvent) {
ExposureManager.log(exposureEvent)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,18 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.FixedRateJobHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IFixedRateJobHelperProvider
@Route(path = RouteConsts.provider.fixedRateJobHelper, name = "FixedRateJobHelper暴露服务")
@com.therouter.inject.ServiceProvider
class FixedRateJobHelperProviderImpl : IFixedRateJobHelperProvider {
override fun getTimeDeltaBetweenServerAndClient(): Long {
return FixedRateJobHelper.timeDeltaBetweenServerAndClient
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,23 +2,16 @@ 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.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
@Route(path = RouteConsts.provider.gameCollectionDetail, name = "GameCollectionDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean): Intent {
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare)
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean, entrance: String): Intent {
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare, entrance)
}
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId)
}
override fun init(context: Context?) {
// Do nothing
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String, entrance: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId, entrance)
}
}

View File

@ -1,14 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IGameDetailProvider
@Route(path = RouteConsts.provider.gameDetail, name = "GameDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class GameDetailProviderImpl : IGameDetailProvider {
override fun startGameDetailActivity(
context: Context,
@ -54,7 +52,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int,
isSkipGameComment: Boolean,
scrollToLibao: Boolean,
openVideoStreaming: Boolean,
@ -65,7 +62,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
context,
gameId,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
openVideoStreaming,
@ -73,8 +69,4 @@ class GameDetailProviderImpl : IGameDetailProvider {
traceEvent
)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,18 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.GameTrendsHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IGameTrendsHelperProvider
@Route(path = RouteConsts.provider.gameTrendsHelper, name = "GameTrendsHelper暴露服务")
@com.therouter.inject.ServiceProvider
class GameTrendsHelperProviderImpl : IGameTrendsHelperProvider {
override fun updateReadPostTime() {
GameTrendsHelper.updateReadPostTime()
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,17 +1,14 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.countOccurrences
import com.gh.gamecenter.core.provider.IHandleGameResponseProvider
import com.gh.gamecenter.feature.entity.GameEntity
@Route(path = RouteConsts.provider.handleGameResponse, name = "处理游戏类型返回")
@com.therouter.inject.ServiceProvider
class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
override fun handleGameResponse(response: List<Any>, entrance: String): List<Any> {
@ -37,8 +34,4 @@ class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
return response
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,18 +1,11 @@
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暴露服务")
@com.therouter.inject.ServiceProvider
class HistoryHelperProviderImpl : IHistoryHelperProvider {
override fun emptyDatabase() {
HistoryHelper.emptyDatabase()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.LibaoUtils
import com.gh.common.util.LibaoUtils.PostLibaoListener
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ILibaoUtilsProvider
@Route(path = RouteConsts.provider.libaoUtils, name = "LibaoUtils暴露服务")
@com.therouter.inject.ServiceProvider
class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
override fun getLibaoStatus(ids: String, successCallback: ((Any?) -> Unit)?, failureCallback: (() -> Unit)?) {
LibaoUtils.getLibaoStatus(ids, object : PostLibaoListener {
@ -20,8 +20,4 @@ class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
}
})
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,7 +1,7 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.CommunityEntity
@ -10,7 +10,7 @@ import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.ILinkDirectUtilsProvider
@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务主要是暴露directToLinkPage方法")
@com.therouter.inject.ServiceProvider
class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
override fun directToLinkPage(
@ -61,7 +61,4 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
DirectUtils.directToCommunityColumn(context, community, subjectId, entrance, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.*
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.*
@Route(path = RouteConsts.provider.logUtils, name = "LogUtils暴露服务")
@com.therouter.inject.ServiceProvider
class LogUtilsProviderImpl : ILogUtilsProvider {
override fun login(loginStep: String, loginType: String, entrance: String) {
LogUtils.login(loginStep, loginType, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.MainActivity
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, type: String) {
DirectUtils.directToHomeDefaultTab(context)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,13 +2,13 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.MessageDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IMessageDetailProvider
@Route(path = RouteConsts.provider.messageDetail, name = "MessageDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class MessageDetailProviderImpl : IMessageDetailProvider {
override fun getIntentById(
@ -24,8 +24,4 @@ class MessageDetailProviderImpl : IMessageDetailProvider {
override fun getIntentByEntity(context: Context, concernEntity: ConcernEntity, entrance: String): Intent? {
return MessageDetailActivity.getIntentByEntity(context, concernEntity, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,16 +1,13 @@
package com.gh.common.provider
import android.content.Context
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.MutableLiveData
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.MessageUnreadCount
import com.gh.gamecenter.feature.entity.MessageUnreadEntity
import com.gh.gamecenter.feature.provider.IMessageUnreadRepositoryProvider
import com.gh.gamecenter.message.MessageUnreadRepository
@Route(path = RouteConsts.provider.messageUnreadRepository, name = "MessageUnreadRepository暴露服务")
@com.therouter.inject.ServiceProvider
class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
override fun loadMessageUnreadData() {
@ -33,7 +30,4 @@ class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
return MessageUnreadRepository.messageUnreadCountLiveData
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,13 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMiniGameRecentlyPlayedProvider
import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
@Route(path = RouteConsts.provider.miniGameRecentPlayed, name = "MiniGameRecentlyPlayed暴露服务")
@com.therouter.inject.ServiceProvider
class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
override fun clearMiniGameRecentlyPlayed(gameType: String) {
MiniGameRecentlyPlayUseCase.clearRecentlyPlayedMiniGameList(gameType)
@ -16,8 +16,4 @@ class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
override fun refreshQQMiniRecentPlayed() {
MiniGameRecentlyPlayUseCase.loadRecentlyPlayedMiniGameList(Constants.QQ_MINI_GAME)
}
override fun init(context: Context?) {
// no implement
}
}

View File

@ -2,12 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.INewCommentDetailProvider
import com.gh.gamecenter.qa.comment.NewCommentDetailActivity
@Route(path = RouteConsts.provider.newCommentDetail, name = "NewCommentDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class NewCommentDetailProviderImpl : INewCommentDetailProvider {
override fun getAnswerCommentIntent(
@ -76,8 +76,4 @@ class NewCommentDetailProviderImpl : INewCommentDetailProvider {
path
)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageHelperProvider
@Route(path = RouteConsts.provider.packageHelper, name = "PackageHelper暴露服务")
class PackageHelperProviderImpl : IPackageHelperProvider {
override fun getLocalPackageNameSet(): Set<String> {
return PackageHelper.localPackageNameSet
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageInstaller
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageInstallerProvider
import com.lightgame.download.DownloadEntity
@Route(path = RouteConsts.provider.packageInstaller, name = "PackageInstaller暴露服务")
@com.therouter.inject.ServiceProvider
class PackageInstallerProviderImpl : IPackageInstallerProvider {
override fun install(context: Context, downloadEntity: DownloadEntity, showUnzipToast: Boolean) {
@ -18,7 +16,4 @@ class PackageInstallerProviderImpl : IPackageInstallerProvider {
PackageInstaller.uninstall(context, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,14 +2,12 @@ package com.gh.common.provider
import android.content.Context
import android.content.pm.PackageInfo
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.PackageHelper
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
import com.gh.gamecenter.core.utils.ProcessUtil
@Route(path = RouteConsts.provider.packageUtils, name = "PackageUtils暴露服务")
@com.therouter.inject.ServiceProvider
class PackageUtilsProviderImpl : IPackageUtilsProvider {
override fun obtainProcessName(): String? {
return ProcessUtil.getCurrentProcessName()
@ -50,8 +48,4 @@ class PackageUtilsProviderImpl : IPackageUtilsProvider {
override fun getVersionNameByPackageName(packageName: String): String {
return PackageUtils.getVersionNameByPackageName(packageName) ?: ""
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,13 +1,10 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameInstall
import com.gh.gamecenter.feature.provider.IPackagesManagerProvider
import com.gh.gamecenter.manager.PackagesManager
@Route(path = RouteConsts.provider.packagesManager, name = "PackagesManager暴露服务")
@com.therouter.inject.ServiceProvider
class PackagesManagerProviderImpl: IPackagesManagerProvider {
override fun isCanPluggable(gameId: String?, packageName: String?): Boolean {
return PackagesManager.isCanPluggable(gameId, packageName)
@ -16,8 +13,4 @@ class PackagesManagerProviderImpl: IPackagesManagerProvider {
override fun getFilterSameApkInstalledList(): ArrayList<GameInstall> {
return PackagesManager.getFilterSameApkInstalledList()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,14 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.IpInfo
import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
@Route(path = RouteConsts.provider.regionSettingHelper, name = "RegionSettingHelper暴露服务")
@com.therouter.inject.ServiceProvider
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
@ -33,8 +30,4 @@ class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameBeFiltered(gameId: String?): Boolean {
return RegionSettingHelper.shouldThisGameBeFiltered(gameId)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,9 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.repository.ReservationRepository
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IReservationRepositoryProvider
@Route(path = RouteConsts.provider.reservationRepository, name = "ReservationRepository暴露服务")
@com.therouter.inject.ServiceProvider
class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
override fun refreshReservations() {
@ -16,8 +13,4 @@ class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
override fun clearReservations() {
ReservationRepository.clearReservations()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -5,12 +5,12 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ISearchTabUtilsProvider
import com.gh.gamecenter.search.viewmodel.SearchTabViewModel
@Route(path = RouteConsts.provider.searchTabUtils, name = "SearchTabUtils暴露服务")
@com.therouter.inject.ServiceProvider
class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
override fun obtainParentViewModel(fragment: Fragment): ViewModel {
@ -29,8 +29,4 @@ class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
null
}
override fun init(context: Context?) {
// no implement
}
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShareCardPicActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IShareCardPicProvider
@Route(path = RouteConsts.provider.shareCardPicActivity, name = "ShareCardPicActivity暴露服务")
class ShareCardPicProviderImpl : IShareCardPicProvider {
override fun startShareCardPicActivity(context: Context, concernEntity: ConcernEntity, entrance: String) {
ShareCardPicActivity.startShareCardPicActivity(context, concernEntity, entrance)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -1,20 +0,0 @@
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.ShareCardActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.ConcernEntity
import com.gh.gamecenter.feature.provider.IShareCardProvider
@Route(path = RouteConsts.provider.shareCardActivity, name = "ShareCardActivity暴露服务")
class ShareCardProviderImpl : IShareCardProvider {
override fun getIntent(context: Context, concernEntity: ConcernEntity, shareContent: String): Intent {
return ShareCardActivity.getIntent(context, concernEntity, shareContent)
}
override fun init(context: Context?) {
// do nothing
}
}

View File

@ -3,17 +3,11 @@ 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暴露服务")
@com.therouter.inject.ServiceProvider
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

@ -2,19 +2,15 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ISimpleAnswerDetailProvider
import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity
@Route(path = RouteConsts.provider.simpleAnswerDetail, name = "SimpleAnswerDetailActivity暴露服务")
@com.therouter.inject.ServiceProvider
class SimpleAnswerDetailProviderImpl : ISimpleAnswerDetailProvider {
override fun getIntent(context: Context, answerId: String, entrance: String, path: String): Intent {
return SimpleAnswerDetailActivity.getIntent(context, answerId, entrance, path)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.ISubjectProvider
import com.gh.gamecenter.subject.SubjectActivity
@Route(path = RouteConsts.provider.subject, name = "SubjectActivity暴露服务")
@com.therouter.inject.ServiceProvider
class SubjectProviderImpl : ISubjectProvider {
override fun startSubjectActivity(
context: Context,
@ -17,8 +17,4 @@ class SubjectProviderImpl : ISubjectProvider {
) {
SubjectActivity.startSubjectActivity(context, id, name, isOrder, null, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,19 +0,0 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.feature.exposure.time.TimeUtil
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ITimeUtilProvider
@Route(path = RouteConsts.provider.timeUtil, name = "TimeUtil暴露服务")
class TimeUtilProviderImpl : ITimeUtilProvider {
override fun currentTimeMillis() = TimeUtil.currentTimeMillis()
override fun currentTime() = TimeUtil.currentTime()
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,15 +1,12 @@
package com.gh.common.provider
import android.content.Context
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUpdateManagerProvider
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.update.UpdateHelper
@Route(path = RouteConsts.provider.updateManager, name = "UpdateManager暴露服务")
@com.therouter.inject.ServiceProvider
class UpdateManagerProviderImpl: IUpdateManagerProvider {
override fun checkUpdate(activity: FragmentActivity, ignoreSuppressOption: Boolean) {
val dialog = DialogUtils.showWaitDialog(activity, "检查更新中...")
@ -26,8 +23,4 @@ class UpdateManagerProviderImpl: IUpdateManagerProvider {
}
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,20 +3,16 @@ 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.therouter.router.Route
import com.gh.common.util.UsageStatsHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider
@Route(path = RouteConsts.provider.usageStatsHelper, name = "UsageStatsHelper暴露服务")
@com.therouter.inject.ServiceProvider
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

@ -1,13 +1,11 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.InstallGameEntity
import com.gh.gamecenter.feature.provider.IVHelperProvider
import com.gh.vspace.VHelper
@Route(path = RouteConsts.provider.vhelper, name = "VHelper暴露服务")
@com.therouter.inject.ServiceProvider
class VHelperProviderImpl: IVHelperProvider {
override fun isVGameOn(): Boolean {
return VHelper.isVGameOn()
@ -20,8 +18,4 @@ class VHelperProviderImpl: IVHelperProvider {
override fun launch(context: Context, packageName: String, ignoreGApps: Boolean, showLoading: Boolean) {
VHelper.launch(context, packageName, ignoreGApps, showLoading)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,12 +1,12 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IVisitManagerProvider
import com.gh.gamecenter.manager.VisitManager
@Route(path = RouteConsts.provider.visitManager, name = "VisitManager暴露服务")
@com.therouter.inject.ServiceProvider
class VisitManagerProviderImpl : IVisitManagerProvider {
override fun updateOkhttpCache(context: Context, newsId: String) {
VisitManager.updateOkhttpCache(context, newsId)
@ -15,8 +15,4 @@ class VisitManagerProviderImpl : IVisitManagerProvider {
override fun addUrl(ids: String) {
VisitManager.getInstance().addUrl(ids)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,12 +2,10 @@ 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.WebActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IWebProvider
@Route(path = RouteConsts.provider.webActivity, name = "WebActivity暴露服务")
@com.therouter.inject.ServiceProvider
class WebProviderImpl : IWebProvider {
override fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent {
return WebActivity.getIntent(context, url, autoCompletionTitle)
@ -40,8 +38,4 @@ class WebProviderImpl : IWebProvider {
): Intent {
return WebActivity.getIntentByNews(context, concernLink, concernGameName, concernId, entrance)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -1,23 +1,15 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.WechatBindHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
class WechatHelperProviderImpl : IWechatBindHelperProvider<WechatConfigEntity> {
@com.therouter.inject.ServiceProvider
class WechatHelperProviderImpl : IWechatBindHelperProvider {
override fun getWechatConfig(callback: ((WechatConfigEntity) -> Unit)?) {
override fun getWechatConfig(callback: ((Any) -> Unit)?) {
WechatBindHelper.getWechatConfig {
callback?.invoke(it)
}
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -4,6 +4,8 @@ import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.database.sqlite.SQLiteDiskIOException
import android.database.sqlite.SQLiteException
import android.graphics.Bitmap
import android.net.Uri
import android.text.TextUtils
@ -284,7 +286,11 @@ object SimulatorGameManager {
entity.isRecentlyPlayed = it.id == gameId
simulatorGameRecordList.add(entity)
}
simulatorGameDao.addSimulatorGameList(simulatorGameRecordList)
try {
simulatorGameDao.addSimulatorGameList(simulatorGameRecordList)
} catch (e: SQLiteException) {
e.printStackTrace()
}
}
})
}

View File

@ -52,7 +52,7 @@ public class CheckLoginUtils {
}
if (context != null) {
QuickLoginHelper.startLogin(context, entrance, callback);
QuickLoginHelper.startLogin(context, entrance, null, callback);
}
}

View File

@ -9,13 +9,14 @@ import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.therouter.TheRouter;
import com.gh.ad.AdDelegateHelper;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.provider.ISentryProvider;
import com.gh.gamecenter.core.utils.GsonUtils;
@ -39,6 +40,11 @@ import io.reactivex.schedulers.Schedulers;
*/
public class DataUtils {
// 神策 OAID 是否已绑定
private static boolean isSensorOAIDBounded = false;
// 原始的 OAID 是否已成功获取
private static boolean originalOAIDIsReceived = false;
private DataUtils() {
throw new IllegalStateException("Utility class");
}
@ -55,7 +61,7 @@ public class DataUtils {
}
private static void initSentry(Context context, String channel) {
ISentryProvider sentryProvider = (ISentryProvider) ARouter.getInstance().build(RouteConsts.provider.sentry).navigation();
ISentryProvider sentryProvider = TheRouter.get(ISentryProvider.class);
if (sentryProvider != null) {
sentryProvider.init(context, channel, BuildConfig.FLAVOR, BuildConfig.VERSION_NAME);
}
@ -65,7 +71,6 @@ public class DataUtils {
// 默认用 APP 级已存储的 GID 来使用,不使用外部 GID
String savedGid = SPUtils.getString(Constants.GID);
if (!TextUtils.isEmpty(savedGid)) {
HaloApp.getInstance().setGid(savedGid);
onGidReceived(savedGid);
} else {
GidHelper.getInstance().registerDevice(HaloApp.getInstance().getApplication(), new GidCallback() {
@ -89,6 +94,8 @@ public class DataUtils {
}
private static void onGidReceived(String gid) {
bindValidOaidToSensor(false);
HaloApp.getInstance().setGid(gid);
// 更新广告配置
AdDelegateHelper.INSTANCE.requestAdConfig(false, "", null);
@ -111,6 +118,35 @@ public class DataUtils {
});
}
/**
* 为神策绑定有效的 OAID
*/
public static void bindValidOaidToSensor(boolean fromOaidResult) {
if (isSensorOAIDBounded) return;
String oaid = HaloApp.getInstance().getOAID();
// 来自于 oaid 获取回调,或者说原始 oaid 已经获取成功
if (fromOaidResult || originalOAIDIsReceived) {
originalOAIDIsReceived = true;
// 遇到异常的 OAID
if (Constants.INVALID_OAID_1.equals(oaid)
|| Constants.INVALID_OAID_2.equals(oaid)
|| Constants.INVALID_OAID_3.equals(oaid)
|| TextUtils.isEmpty(oaid)) {
// 若 gid 不为空,那么整合 gid 作为 oaid https://jira.shanqu.cc/browse/GHZSCY-7004
if (HaloApp.getInstance().getGid() != null) {
oaid = "GID" + HaloApp.getInstance().getGid();
SensorsBridge.INSTANCE.setOAID(oaid);
isSensorOAIDBounded = true;
}
} else {
SensorsBridge.INSTANCE.setOAID(oaid);
isSensorOAIDBounded = true;
}
}
}
/**
* 获取应用 gid 绑定的实名信息
*/

View File

@ -139,6 +139,7 @@ public class DetailDownloadUtils {
// 游戏包含多 APK 的情况
viewHolder.getMultiVersionDownloadTv().setText("选择下载你的版本" + (TextUtils.isEmpty(downloadAddWord) ? "" : "-" + downloadAddWord));
viewHolder.getMultiVersionDownloadTv().setVisibility(View.VISIBLE);
viewHolder.getDownloadPb().setTag(com.gh.gamecenter.feature.R.string.download, viewHolder.getMultiVersionDownloadTv().getText());
viewHolder.getDownloadPb().setText("");
viewHolder.getDownloadPb().setButtonStyle(DownloadButton.ButtonStyle.NORMAL);
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity);
@ -457,7 +458,7 @@ public class DetailDownloadUtils {
}
viewHolder.getDownloadPb().setButtonStyle(DownloadButton.ButtonStyle.H5_GAME);
} else {
if ("dialog".equals(gameEntity.getDownloadOffStatus())) {
if ("dialog".equals(gameEntity.getDownloadOffStatus()) || "third_party".equals(gameEntity.getDownloadOffStatus())) {
viewHolder.getDownloadPb().setText(TextUtils.isEmpty(gameEntity.getDownloadOffText()) ? "查看详情" : gameEntity.getDownloadOffText());
viewHolder.getDownloadPb().setButtonStyle(DownloadButton.ButtonStyle.NONE_WITH_HINT);
} else if ("updating".equals(gameEntity.getDownloadOffStatus())) {

View File

@ -11,7 +11,6 @@ import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import com.alibaba.android.arouter.launcher.ARouter
import com.gh.ad.AdPluginDownloadHelper
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureManager.log
@ -56,9 +55,7 @@ import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionHotListActivity
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionListDetailActivity
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareActivity
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarManagementActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersSubscribedGameListActivity
import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
@ -69,7 +66,6 @@ import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
import com.gh.gamecenter.minigame.MiniGameSearchActivity
import com.gh.gamecenter.minigame.qq.QGameHomeWrapperActivity
import com.gh.gamecenter.newsdetail.NewsDetailActivity
import com.gh.gamecenter.personalhome.UserHomeActivity
import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.personalhome.home.UserHistoryViewModel
@ -79,7 +75,6 @@ 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.SearchActivity
import com.gh.gamecenter.servers.GameServerTestActivity
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.servers.gametest2.GameServerTestV2Activity
@ -100,6 +95,7 @@ import com.halo.assistant.fragment.WebFragment
import com.lightgame.utils.Utils
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.therouter.TheRouter
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import retrofit2.HttpException
@ -180,7 +176,23 @@ object DirectUtils {
"qa",
"feedback",
"toolkit",
"float_window_game"
"float_window_game",
"my_halo",
"my_game",
"server_manager",
"receiving_information",
"game_archive",
"game_dynamics",
"game_upload",
"certification",
"wechat_reminder",
"apk_clean",
"personal_center",
"video_upload",
"account_security",
"simulator",
"teen_mode",
"message_center",
)
fun directToLinkPage(
@ -385,8 +397,8 @@ object DirectUtils {
}
}
"authentication" -> {
context.startActivity(ShellActivity.getIntent(context, ShellActivity.Type.REAL_NAME_INFO, null))
"authentication", "certification" -> {
directToRealName(context)
}
"user_background" -> {
@ -444,7 +456,7 @@ object DirectUtils {
} ?: ""
}
"halo_tab" -> directToHomeMyHaloTab(context)
"my_halo", "halo_tab" -> directToHomeMyHaloTab(context)
"common_collection" -> directToCommonCollectionDetail(
context,
@ -526,7 +538,8 @@ object DirectUtils {
ToolbarWrapperActivity.getMultiTabNavIntent(
context,
linkEntity.link ?: "",
linkEntity.text ?: ""
linkEntity.text ?: "",
entrance
)
)
@ -534,16 +547,20 @@ object DirectUtils {
ToolbarWrapperActivity.getCustomPageIntent(
context,
linkEntity.link ?: "",
linkEntity.text ?: ""
linkEntity.text ?: "",
entrance
)
)
// 选中首页底部 tab
"bottom_tab" -> {
val intent = Intent(context, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
if (HaloApp.getInstance().isRunningForeground) {
val intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
context.startActivity(intent)
} else {
jumpActivity(context, Bundle())
}
context.startActivity(intent)
if (linkEntity is LaunchRedirect) {
MainWrapperRepository.getInstance().sendSelectTabEvent(linkEntity)
@ -570,6 +587,32 @@ object DirectUtils {
}
}
"my_game" -> directToMyGame(0, entrance)
"server_manager" -> directToServersCalendarManagement(entrance)
"receiving_information" -> directToDeliveryInfo(entrance)
"game_archive" -> directToGameArchive(entrance)
"game_dynamics" -> directToConcernInfo(context, entrance)
"wechat_reminder" -> CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(WebActivity.getBindWechatIntent(context))
}
"apk_clean" -> directToCleanApk(context, entrance)
"personal_center" -> directToUserInfo(entrance)
"simulator" -> directToSimulatorGame(entrance)
"account_security" -> directToAccountSecurity(entrance)
"teen_mode" -> directToTeenMode(entrance)
"message_center" -> directToMessageCenter(0, entrance)
"" -> {
// do nothing
}
@ -590,12 +633,16 @@ object DirectUtils {
@JvmStatic
fun directToQa(context: Context, text: String? = "", id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_ID, id)
jumpActivity(context, bundle)
TheRouter.build(RouteConsts.activity.qaActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
/**
@ -604,12 +651,16 @@ object DirectUtils {
@JvmStatic
fun directToQaCollection(context: Context, text: String, id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_COLLECTION_ID, id)
jumpActivity(context, bundle)
TheRouter.build(RouteConsts.activity.qaActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
/**
@ -720,7 +771,7 @@ object DirectUtils {
*/
@JvmStatic
fun directToHomeActivity(context: Context, userId: String?, entrance: String? = null, path: String? = null) {
context.startActivity(UserHomeActivity.getIntent(context, userId ?: "", entrance, path))
directToHomeActivity(context, userId, entrance, path, 0)
}
@JvmStatic
@ -759,17 +810,20 @@ object DirectUtils {
entrance: String? = null,
path: String? = null
) {
IntegralLogHelper.log("view_homepage", "个人主页")
val bundle = Bundle()
bundle.putString(KEY_USER_ID, userId)
bundle.putString(KEY_TO, UserHomeActivity::class.java.name)
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, gameType)
bundle.putInt(KEY_POSITION, position ?: 0)
jumpActivity(context, bundle)
val uri = Uri.Builder()
.path(RouteConsts.activity.userHomeActivity)
.appendQueryParameter(KEY_USER_ID, userId)
.appendQueryParameter(KEY_TAB_INDEX, position.toString())
.appendQueryParameter(KEY_PATH, BaseActivity.mergeEntranceAndPath(entrance, path))
.appendQueryParameter(KEY_COMMUNITY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
.appendQueryParameter(KEY_GAME_TYPE, gameType)
.build()
TheRouter
.build(uri.toString())
.navigation(context)
}
@ -801,10 +855,10 @@ object DirectUtils {
bundle.putString(KEY_GAMEID, id)
if (!TextUtils.isEmpty(tab)) {
when (tab) {
"comment" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_RATING)
"desc" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
"forum" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_BBS)
"zone" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_TRENDS)
"comment" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_RATING)
"desc" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
"forum" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_BBS)
"zone" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_TRENDS)
}
}
if (traceEvent != null) {
@ -849,7 +903,7 @@ object DirectUtils {
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, id)
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
jumpActivity(context, bundle)
}
@ -857,7 +911,7 @@ object DirectUtils {
fun directToGameDetail(
context: Context,
id: String,
defaultTab: String = GameDetailFragment.TAB_DESC,
defaultTab: String = EntranceConsts.TAB_TYPE_DESC,
entrance: String? = null
) {
val bundle = Bundle()
@ -1515,7 +1569,7 @@ object DirectUtils {
response?.apply {
if (zone.status == "on") {
if (zone.style == "link") {
directToGameDetail(context, gameId, GameDetailFragment.TAB_TRENDS, entrance)
directToGameDetail(context, gameId, EntranceConsts.TAB_TYPE_TRENDS, entrance)
} else {
directToWebView(context, url, entrance)
}
@ -1626,11 +1680,11 @@ object DirectUtils {
*/
@JvmStatic
fun directToHelpAndFeedback(context: Context, bundle: Bundle? = null) {
val destination = RouteConsts.activity.helpAndFeedbackActivity.toDestinationClass()
val newBundle = Bundle()
newBundle.putString(KEY_TO, destination?.name ?: "")
bundle?.let { newBundle.putAll(it) }
jumpActivityCompat(context, newBundle)
TheRouter.build(RouteConsts.activity.helpAndFeedbackActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
@ -1727,8 +1781,7 @@ object DirectUtils {
@JvmStatic
fun directToConcernInfo(context: Context, entrance: String) {
context.startActivity(
(ARouter.getInstance().build(RouteConsts.provider.concernInfo)
.navigation() as? IConcernInfoProvider)?.getIntent(context, entrance)
TheRouter.get(IConcernInfoProvider::class.java)?.getIntent(context, entrance)
)
}
@ -1985,10 +2038,7 @@ object DirectUtils {
return
}
val qGameProvider = ARouter
.getInstance()
.build(RouteConsts.provider.qGame)
.navigation() as? IQGameProvider
val qGameProvider = TheRouter.get(IQGameProvider::class.java)
if (qGameProvider == null) return
@ -2037,8 +2087,14 @@ object DirectUtils {
}
@JvmStatic
fun directToMessageCenter(defaultTabIndex: Int) {
ARouter.getInstance().build(RouteConsts.activity.messageWrapperActivity)
fun directToMessageCenter(defaultTabIndex: Int, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.messageWrapperActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
.navigation()
}
@ -2072,13 +2128,17 @@ object DirectUtils {
/**
* 跳转到开服订阅页面
* @param context 上下文
*/
@JvmStatic
fun directToServersCalendarManagement(context: Context, entrance: String) {
CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(ServersCalendarManagementActivity.getIntent(context))
}
fun directToServersCalendarManagement(entrance: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.serversCalendarManagementActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, entrance)
.build()
TheRouter.build(uri.toString())
.navigation()
}
fun directToSearch(
@ -2138,4 +2198,100 @@ object DirectUtils {
)
}
}
@JvmStatic
fun directToMyGame(defaultTabIndex: Int, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.myGameActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
.navigation()
}
@JvmStatic
fun directToDeliveryInfo(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.deliveryInfoActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToGameArchive(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.gameArchiveListActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToSimulatorGame(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.simulatorGameActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToTeenMode(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.teenagerModeActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToUserInfo(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.userInfoActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToCleanApk(context: Context, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.cleanApkActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
PermissionHelper.checkManageAllFilesOrStoragePermissionBeforeAction(context) {
TheRouter.build(uri.toString())
.navigation()
}
}
@JvmStatic
fun directToAccountSecurity(source: String, isLogoutStyle: Boolean = false) {
val uri = Uri.Builder()
.path(RouteConsts.activity.securityActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withString(KEY_ENTRANCE, source)
.withBoolean(KEY_DISPLAY_TYPE, isLogoutStyle)
.navigation()
}
}

View File

@ -280,9 +280,9 @@ object DownloadItemUtils {
isClickable = true
buttonStyle = DownloadButton.ButtonStyle.NORMAL
} else {
if ("dialog" == offStatus) {
if ("dialog" == offStatus || "third_party" == offStatus) {
text = context.getString(com.gh.gamecenter.feature.R.string.check)
buttonStyle = DownloadButton.ButtonStyle.NORMAL
buttonStyle = DownloadButton.ButtonStyle.NONE_WITH_HINT
} else if ("updating" == offStatus) {
text = context.getString(com.gh.gamecenter.feature.R.string.updating)
buttonStyle = DownloadButton.ButtonStyle.UPDATING
@ -839,34 +839,25 @@ object DownloadItemUtils {
} else {
allStateClickCallback?.onCallback()
clickCallback?.onCallback()
if ("download" == gameEntity.reserveStatus) {
ReservationHelper.showDeleteReservationDialog(context) {
ReservationHelper.deleteReservation(gameEntity) {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
ReservationHelper.showCancelReservationDialog(context, gameEntity, {
NewFlatLogUtils.logMyGameCancelReserveDialogClick(
"确定取消",
gameEntity.id,
gameEntity.name ?: ""
)
ReservationHelper.cancelReservation(gameEntity) {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
} else {
ReservationHelper.showCancelReservationDialog(context, gameEntity,{
}, object : CancelListener {
override fun onCancel() {
NewFlatLogUtils.logMyGameCancelReserveDialogClick(
"确定取消",
"关闭弹窗",
gameEntity.id,
gameEntity.name ?: ""
)
ReservationHelper.cancelReservation(gameEntity) {
adapter?.notifyItemChanged(position)
refreshCallback?.onCallback()
}
}, object : CancelListener {
override fun onCancel() {
NewFlatLogUtils.logMyGameCancelReserveDialogClick(
"关闭弹窗",
gameEntity.id,
gameEntity.name ?: ""
)
}
})
}
}
})
}
}
return

View File

@ -135,12 +135,16 @@ object GameUtils {
// 畅玩状态优先,且畅玩实体不为空时将 downloadEntity 置为畅玩实体
if (performAsVGame && vGameDownloadEntity != null) {
downloadEntity = vGameDownloadEntity
} else if (!performAsVGame && !isFromList && downloadEntity?.isVGameDownloadInDualDownloadMode() == true) {
// 下载的任务是由畅玩触发的,游戏详情页不需判定为需要安装
downloadEntity = null
} else if (performAsVGame && !isFromList && downloadEntity?.isLocalDownloadInDualDownloadMode() == true) {
// 下载的任务是由下载安装触发的,游戏详情页不需判定为需要安装
downloadEntity = null
} else if (!isFromList) {
if (!performAsVGame
&& gameEntity.isDualBtnModeEnabled()
&& downloadEntity?.isVGameDownloadInDualDownloadMode() == true) {
// 下载的任务是由畅玩触发的,并且双下载按钮启用,游戏详情页不需判定为需要安装
downloadEntity = null
} else if (performAsVGame && downloadEntity?.isLocalDownloadInDualDownloadMode() == true) {
// 下载的任务是由下载安装触发的,游戏详情页不需判定为需要安装
downloadEntity = null
}
}
if (downloadEntity != null) {

View File

@ -18,7 +18,6 @@ import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.install.InstallService
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
@ -194,12 +193,6 @@ object PackageInstaller {
private fun install(context: Context, pkgPath: String, pkgName: String?) {
HaloApp.put(Constants.LAST_INSTALL_GAME, pkgPath)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU && Build.MANUFACTURER.lowercase().contains("xiaomi")) {
val foregroundServiceIntent = Intent(context, InstallService::class.java)
foregroundServiceIntent.putExtra(InstallService.KEY_SERVICE_ACTION, InstallService.START_FOREGROUND)
context.startForegroundService(foregroundServiceIntent)
}
val installIntent = getInstallIntent(context, pkgPath)
context.startActivity(installIntent)
@ -284,7 +277,12 @@ object PackageInstaller {
installIntent.setDataAndType(uri, "application/vnd.android.package-archive")
}
updateSystemInstallerIfAvailable(context, installIntent)
// 优选系统的安装器(遇到 Exception 就回落到正常的安装器)
try {
updateSystemInstallerIfAvailable(context, installIntent)
} catch (ignored: Exception) {
// ignored
}
InstallUtils.getInstance()
.addInstall(PackageUtils.getPackageNameByPath(context, path))

View File

@ -7,7 +7,7 @@ import com.gh.gamecenter.common.utils.isVGameDownloadInDualDownloadMode
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameInstall
import com.gh.gamecenter.packagehelper.PackageRepository
import com.gh.gamecenter.manager.PackagesManager
import com.gh.vspace.VHelper
object PackageLauncher {
@ -91,7 +91,7 @@ object PackageLauncher {
val gameInstall = if (gameEntity != null) {
GameInstall.transformGameInstall(gameEntity, packageName)
} else {
PackageRepository.gameInstalled.find { it.packageName == packageName }
PackagesManager.getInstalledList().find { it.packageName == packageName }
}
if (gameInstall != null) {

View File

@ -14,7 +14,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.text.TextUtils;
import android.util.AndroidException;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -29,9 +28,9 @@ import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.utils.MD5Utils;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.feature.utils.SentryHelper;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.vspace.VHelper;
@ -542,10 +541,8 @@ public class PackageUtils {
try {
Intent intent = context.getApplicationContext().getPackageManager().getLaunchIntentForPackage(packageName);
return intent != null;
} catch (IllegalArgumentException exception) {
// 一些设备调用获取 intent 的时候会触发 Parcel.readException !
exception.printStackTrace();
return false;
} catch (Exception exception) {
return PackageHelper.INSTANCE.getLocalPackageNameSet().contains(packageName);
}
}
@ -645,6 +642,19 @@ public class PackageUtils {
return 0;
}
/*
* 获取应用的名称
*/
public static CharSequence getNameByPackageName(Context context, String packageName) {
try {
PackageManager packageManager = context.getApplicationContext().getPackageManager();
return packageManager.getApplicationLabel(packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA));
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
/*
* 获取应用的 icon

View File

@ -2,7 +2,7 @@ package com.gh.common.util
import android.annotation.SuppressLint
import android.content.Context
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.repository.ReservationRepository
import com.gh.gamecenter.WebActivity
@ -29,53 +29,31 @@ import okhttp3.ResponseBody
object ReservationHelper {
@JvmStatic
fun deleteReservation(game: GameEntity, refreshCallback: EmptyCallback) {
deleteOrCancelReservation(game, true, refreshCallback)
}
@JvmStatic
fun cancelReservation(game: GameEntity, refreshCallback: EmptyCallback) {
deleteOrCancelReservation(game, false, refreshCallback)
}
@SuppressLint("CheckResult")
private fun deleteOrCancelReservation(
@JvmStatic
fun cancelReservation(
game: GameEntity,
deleteReservation: Boolean,
refreshCallback: EmptyCallback
) {
val retrofit = RetrofitManager.getInstance()
val single = if (deleteReservation) {
retrofit.newApi
.deleteGameReservation(
game.id,
getReserveRequestBody(game, context = HaloApp.getInstance().application)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
} else {
retrofit.newApi
.cancelGameReservation(
game.id,
getReserveRequestBody(game, context = HaloApp.getInstance().application)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
}
retrofit.newApi
.cancelGameReservation(
game.id,
getReserveRequestBody(game, context = HaloApp.getInstance().application)
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
ReservationRepository.removeReservationFromMemoryAndRefresh(game.id)
refreshCallback.onCallback()
}
single.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
ReservationRepository.removeReservationFromMemoryAndRefresh(game.id)
refreshCallback.onCallback()
}
override fun onFailure(exception: Exception) {
Utils.toast(HaloApp.getInstance().application, exception.message)
exception.printStackTrace()
}
})
override fun onFailure(exception: Exception) {
Utils.toast(HaloApp.getInstance().application, exception.message)
exception.printStackTrace()
}
})
}
@JvmStatic
@ -146,21 +124,6 @@ object ReservationHelper {
})
}
@JvmStatic
fun showDeleteReservationDialog(context: Context, emptyCallback: EmptyCallback) {
DialogUtils.showCancelOrDeleteReservationDialog(
context,
"删除预约",
"游戏已上线,你可以删除此预约记录,确定删除吗?",
"确定删除",
"暂不删除", object : ConfirmListener {
override fun onConfirm() {
emptyCallback.onCallback()
}
}, null
)
}
@JvmStatic
fun showCancelReservationDialog(context: Context, game: GameEntity?, emptyCallback: EmptyCallback) {
showCancelReservationDialog(context, game, emptyCallback, null)
@ -231,7 +194,7 @@ object ReservationHelper {
@JvmStatic
fun getReserveRequestBody(game: GameEntity?, context: Context): RequestBody {
val jPushId =
(ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider)
(TheRouter.get(IPushProvider::class.java))
?.getRegistrationId(context) ?: ""
var mirrorPosition = game?.getMirrorPosition() ?: 0
if (mirrorPosition == -1) {

View File

@ -2,7 +2,7 @@ package com.gh.common.util
import android.os.Bundle
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.TheRouter
import com.gh.common.iinterface.ISuperiorChain
import com.gh.gamecenter.amway.AmwayFragment
import com.gh.gamecenter.category2.CategoryV2Fragment
@ -129,9 +129,7 @@ object ViewPagerFragmentHelper {
}
// 帮助与反馈
TYPE_FEEDBACK -> {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
if (helpAndFeedbackProvider != null) {
helpAndFeedbackProvider.getHelpAndFeedbackFragment().with(bundle)
} else {
@ -250,9 +248,7 @@ object ViewPagerFragmentHelper {
}
// QA
TYPE_QA -> {
val helpAndFeedbackProvider =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
.navigation() as? IHelpAndFeedbackProvider
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
helpAndFeedbackProvider?.let {
className = it.getHelpContainerFragmentClass()

View File

@ -2,6 +2,7 @@ package com.gh.download.simple
import android.annotation.SuppressLint
import android.database.sqlite.SQLiteException
import android.database.sqlite.SQLiteFullException
import com.gh.gamecenter.core.utils.ToastUtils
import com.lg.download.*
import com.lg.download.listener.InnerDownloadListener
@ -174,6 +175,9 @@ object DownloadMessageHandler : InnerDownloadListener {
DownloadError.CONTENT_LENGTH_IS_ZERO -> {
ToastUtils.toast("下载链接异常,请检查")
}
DownloadError.DISK_IS_FULL -> {
ToastUtils.toast("磁盘已满,请清理空间后获得更好的体验")
}
else -> {
// 想怎么处理就怎么处理
}
@ -264,18 +268,30 @@ object DownloadMessageHandler : InnerDownloadListener {
}
fun insertDownloadToDatabase(downloadEntity: SimpleDownloadEntity) {
mDownloadDao.insertDownloadEntity(downloadEntity)
updateDownloadList()
try {
mDownloadDao.insertDownloadEntity(downloadEntity)
updateDownloadList()
} catch (e: SQLiteException) {
if (e is SQLiteFullException) {
ToastUtils.showToast("磁盘已满,请清理空间获得更好的体验")
}
e.printStackTrace()
}
}
fun updateDownloadToDatabase(
downloadEntity: SimpleDownloadEntity,
updateDownloadList: Boolean = false
) {
mDownloadDao.updateDownloadEntity(downloadEntity)
try {
mDownloadDao.updateDownloadEntity(downloadEntity)
if (updateDownloadList) {
updateDownloadList()
if (updateDownloadList) {
updateDownloadList()
}
} catch (e: SQLiteFullException) {
// 底层的下载服务遇到 SQLiteFullException 时会自动暂停下载任务,上层这里就不用纠结处理方式了
e.printStackTrace()
}
}

View File

@ -6,7 +6,7 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.therouter.router.Route;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;

View File

@ -3,26 +3,25 @@ package com.gh.gamecenter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.utils.BitmapUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.utils.BitmapUtils;
import com.gh.gamecenter.common.view.CropImageCustom;
import com.gh.gamecenter.common.view.cropbox.CropBoxStyle;
import com.gh.gamecenter.core.utils.DisplayUtils;
import java.io.File;
import java.lang.ref.SoftReference;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
/**
* 裁剪图片
*/
@ -32,6 +31,8 @@ public class CropImageActivity extends ToolBarActivity {
public static final String RESULT_CLIP_PATH = "result_clip_path";
public static final String RESULT_ORIGINAL_PATH = "result_original_path";
private SoftReference<Bitmap> reference;
protected boolean mBlackTheme = false;
@ -51,7 +52,7 @@ public class CropImageActivity extends ToolBarActivity {
Intent intent = new Intent(context, CropImageActivity.class);
intent.putExtra(EntranceConsts.KEY_PATH, picturePath);
intent.putExtra(EntranceConsts.KEY_ENTRANCE, entrance);
intent.putExtra(EntranceConsts.KEY_IMAGE_CROP_RATIO, cropRatio);
intent.putExtra(EntranceConsts.KEY_IMAGE_CROP_STYLE, new CropBoxStyle.Rectangle(cropRatio));
intent.putExtra(EntranceConsts.KEY_BLACK_THEME, isBlackTheme);
intent.putExtra(EntranceConsts.KEY_ASSIST_RES, assistRes);
return intent;
@ -68,20 +69,14 @@ public class CropImageActivity extends ToolBarActivity {
super.onCreate(savedInstanceState);
mCropImageCustom = findViewById(R.id.cropimage_custom);
View statusBarView = findViewById(R.id.status_bar);
TextView tvCancel = findViewById(R.id.tv_cancel);
TextView tvSubmit = findViewById(R.id.tv_submit);
mTitleTv.setTextColor(mBlackTheme ? Color.WHITE : Color.BLACK);
mToolbar.setBackgroundColor(getResources().getColor(mBlackTheme ? com.gh.gamecenter.common.R.color.text_28282E : com.gh.gamecenter.common.R.color.white));
statusBarView.setBackgroundColor(getResources().getColor(mBlackTheme ? com.gh.gamecenter.common.R.color.text_28282E : com.gh.gamecenter.common.R.color.white));
setNavigationTitle(getString(R.string.title_crop_image));
setToolbarMenu(R.menu.menu_positive);
MenuItem menuItem = getMenuItem(R.id.layout_menu_positive);
TextView menuButton = menuItem.getActionView().findViewById(R.id.menu_answer_post);
menuButton.setTextColor(getResources().getColor(com.gh.gamecenter.common.R.color.text_theme));
float ratio = getIntent().getFloatExtra(EntranceConsts.KEY_IMAGE_CROP_RATIO, 1F);
mCropImageCustom.setCropRatio(ratio);
CropBoxStyle boxStyle = getIntent().getParcelableExtra(EntranceConsts.KEY_IMAGE_CROP_STYLE);
if (boxStyle == null) {
boxStyle = new CropBoxStyle.Rectangle(1F);
}
mCropImageCustom.setCropBoxStyle(boxStyle);
int assistRes = getIntent().getIntExtra(EntranceConsts.KEY_ASSIST_RES, -1);
if (assistRes > 0) {
@ -89,8 +84,21 @@ public class CropImageActivity extends ToolBarActivity {
addAssistView(view);
}
DisplayUtils.setLightStatusBar(this, !mBlackTheme);
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mBlackTheme);
DisplayUtils.setLightStatusBar(this, false);
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, false);
tvCancel.setOnClickListener(v -> finish());
tvSubmit.setOnClickListener(v -> saveImage());
}
protected void saveImage() {
Intent data = new Intent();
String clipPath = getCacheDir().getAbsolutePath() + File.separator + System.currentTimeMillis() + ".jpg";
mCropImageCustom.savePicture(clipPath);
data.putExtra(RESULT_CLIP_PATH, clipPath);
setResult(RESULT_OK, data);
finish();
}
@Override
@ -98,20 +106,6 @@ public class CropImageActivity extends ToolBarActivity {
return mBlackTheme ? com.gh.gamecenter.common.R.drawable.ic_toolbar_back_white : com.gh.gamecenter.common.R.drawable.ic_bar_back;
}
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.layout_menu_positive) {
Intent data = new Intent();
String clipPath = getCacheDir().getAbsolutePath() + File.separator + System.currentTimeMillis() + ".jpg";
mCropImageCustom.savePicture(clipPath);
data.putExtra(RESULT_CLIP_PATH, clipPath);
setResult(RESULT_OK, data);
finish();
}
return super.onMenuItemClick(item);
}
public void addAssistView(View view) {
mCropImageCustom.addAssistView(view);
}

View File

@ -5,12 +5,17 @@ import android.content.ContextWrapper
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.therouter.router.Autowired
import com.therouter.router.Route
import com.therouter.TheRouter
import com.gh.base.DownloadToolbarActivity
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureManager
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.base.activity.ToolBarActivity.NORMAL_FRAGMENT_BUNDLE
import com.gh.gamecenter.common.base.activity.ToolBarActivity.NORMAL_FRAGMENT_NAME
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.toArrayList
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.GamePlatform
@ -20,15 +25,54 @@ import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.exposure.ExposureEvent.Companion.createEvent
import com.gh.gamecenter.feature.exposure.ExposureType
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.halo.assistant.HaloApp
/**
* Created by khy on 2017/3/24.
* 游戏详情页
*/
@Route(
path = RouteConsts.activity.gameDetailActivity,
description = "游戏详情页"
)
class GameDetailActivity : DownloadToolbarActivity() {
@JvmField
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏 id", required = true)
var gameId: String? = null
@JvmField
@Autowired(name = EntranceConsts.KEY_GAME_ENTITY, description = "游戏摘要实体,如果你不懂这个是什么,那么不要用它,直接传入游戏 id 即可")
var gameEntity: GameEntity? = null
@JvmField
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
var entrance: String? = ""
@JvmField
@Autowired(name = EntranceConsts.KEY_DEFAULT_TAB, description = "默认选中 tab 的类型(目前可选的有五个类型 `详情`, `专区``云存档``评价``论坛`),首次进入匹配并切换至对应 tab")
var defaultTab: String = ""
@JvmField
@Autowired(name = EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, description = "跳转到评论 tab首次进入直接跳转到评论 tab")
var commentAsDefaultTab: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_LIBAO, description = "滚动到礼包区域,首次进入滚动到礼包区域")
var scrollToLibao: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_SERVER, description = "滚动到开服表区域,首次进入滚动到开服表区域")
var scrollToServer: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_OPEN_VIDEO_STREAMING, description = "打开视频流,首次进入打开视频流")
var openVideoStreaming: Boolean = false
@JvmField
@Autowired(name = EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, description = "打开多版本窗口,首次进入打开多版本窗口")
var openPlatformWindow: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
TheRouter.inject(this)
generateDataFromRoute()
super.onCreate(savedInstanceState)
DisplayUtils.transparentStatusBar(this)
}
@ -37,37 +81,21 @@ class GameDetailActivity : DownloadToolbarActivity() {
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailFragment::class.java)
}
override fun getLayoutId(): Int {
return R.layout.activity_game_detail
}
override fun getLayoutId() = R.layout.activity_game_detail
override fun showToolbarAtLeft(): Boolean {
return true
}
override fun showToolbarAtLeft() = true
override fun showDownloadMenu() = true
override fun showDownloadMenu(): Boolean {
return true
}
override fun onDestroy() {
super.onDestroy()
HaloApp.remove(Constants.GAME_DETAIL_COME_IN)
}
override fun getActivityNameInChinese(): String {
return "游戏详情"
}
override fun getActivityNameInChinese() = "游戏详情"
override fun getBusinessId(): Pair<String, String> {
val fragment = targetFragment as? GameDetailFragment?
return if (fragment?.arguments != null) {
Pair(fragment.requireArguments().getString(EntranceConsts.KEY_GAMEID) ?: "", "")
return if (!gameId.isNullOrEmpty()) {
Pair(gameId ?: "", "")
} else {
super.getBusinessId()
}
}
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(object : ContextWrapper(newBase) {
override fun getSystemService(name: String): Any? {
@ -96,6 +124,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
}
private fun generateDataFromRoute() {
val bundle = intent.extras
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailFragment::class.java.canonicalName)
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
}
companion object {
@JvmStatic
@ -131,9 +166,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
if (traceEvent != null) {
val clickEvent = createEvent(gameEntity, traceEvent.source, appendTrace(traceEvent), ExposureType.CLICK)
log(clickEvent)
ExposureManager.log(clickEvent)
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
}
if (gameEntity != null && traceEvent != null && gameEntity.id != traceEvent.payload.gameId) {
// 当游戏 ID 跟曝光 traceEvent 的游戏ID 不一样的时候更新 traceEvent 的游戏ID
val (payload) = createEvent(
@ -144,31 +180,35 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
traceEvent.payload = payload
}
if (defaultTab.isNotEmpty()) {
bundle.putString(EntranceConsts.KEY_TARGET, defaultTab)
}
if (isSkipGameComment) {
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
if (scrollToServer) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, true)
}
bundle.putString(EntranceConsts.KEY_GAMEID, gameEntity?.id)
bundle.putString(EntranceConsts.KEY_GAME_ID, gameEntity?.id)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
bundle.putParcelable(GameEntity.TAG, gameEntity)
context.startActivity(
getTargetIntent(
context,
GameDetailActivity::class.java,
GameDetailFragment::class.java,
bundle
)
)
bundle.putParcelable(EntranceConsts.KEY_GAME_ENTITY, gameEntity)
TheRouter
.build(RouteConsts.activity.gameDetailActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
@JvmStatic
@ -178,7 +218,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
entrance: String?,
traceEvent: ExposureEvent?
) {
startGameDetailActivity(context, gameId, entrance, -1, traceEvent = traceEvent)
startGameDetailActivity(context, gameId, entrance, isSkipGameComment = false, traceEvent = traceEvent)
}
@JvmStatic
@ -186,7 +226,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int = -1,
isSkipGameComment: Boolean = false,
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
@ -197,7 +236,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context,
gameId,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
openVideoStreaming,
@ -211,7 +249,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
/**
* @param gameId 游戏Id
* @param defaultTab 默认定位到哪个tab
* @param isSkipGameComment 是否跳转到评论tab
* @param scrollToLibao 滚动到礼包区域
* @param openVideoStreaming 是否打开视频流
@ -225,7 +262,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
context: Context,
gameId: String,
entrance: String?,
defaultTab: Int = -1,
isSkipGameComment: Boolean = false,
scrollToLibao: Boolean = false,
openVideoStreaming: Boolean = false,
@ -248,7 +284,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
appendTrace(traceEvent),
ExposureType.CLICK
)
log(clickEvent)
ExposureManager.log(clickEvent)
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
}
if (traceEvent != null && gameId != traceEvent.payload.gameId) {
@ -261,15 +297,12 @@ class GameDetailActivity : DownloadToolbarActivity() {
)
traceEvent.payload = payload
}
if (defaultTab != -1) {
bundle.putInt(EntranceConsts.KEY_TARGET, defaultTab)
}
if (isSkipGameComment) {
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
}
if (openVideoStreaming) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
}
if (openPlatformWindow) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
@ -283,10 +316,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
bundle.putString(EntranceConsts.KEY_GAMEID, gameId)
bundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
bundle.putParcelable(EntranceConsts.KEY_CUSTOM_PAGE_TRACK_DATA, customPageTrackData)
bundle.putString(EntranceConsts.KEY_LAST_PAGE_ID, GlobalActivityManager.getLastPageEntity().pageId)
@ -295,14 +328,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
EntranceConsts.KEY_LAST_PAGE_BUSINESS_ID,
GlobalActivityManager.getLastPageEntity().pageBusinessId
)
context.startActivity(
getTargetIntent(
context,
GameDetailActivity::class.java,
GameDetailFragment::class.java,
bundle
)
)
TheRouter
.build(RouteConsts.activity.gameDetailActivity)
.fillParams {
it.putAll(bundle)
}
.navigation(context)
}
}

View File

@ -34,7 +34,7 @@ import androidx.transition.*
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
import com.alibaba.android.arouter.facade.annotation.Route
import com.therouter.router.Route
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.imagepipeline.core.ImagePipeline

View File

@ -166,8 +166,13 @@ public class MainActivity extends BaseActivity {
private final Handler handler = new Handler();
private boolean mShouldShowAd = false; // 是否显示广告
private Bundle mTempSavedInstanceState;
private boolean mFragmentIsCreated = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
mTempSavedInstanceState = savedInstanceState;
mShouldShowAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null
&& !HaloApp.getInstance().isAlreadyUpAndRunning;
HaloApp.getInstance().isAlreadyUpAndRunning = true;
@ -175,21 +180,12 @@ public class MainActivity extends BaseActivity {
mMainWrapperViewModel = new ViewModelProvider(this, new MainWrapperViewModel.Factory(HaloApp.getInstance()))
.get(MainWrapperViewModel.class);
DisplayUtils.transparentStatusBar(this);
DisplayUtils.updateGlobalScreen(this);
super.onCreate(savedInstanceState);
setStatusBarColor(Color.TRANSPARENT);
Fragment fragmentFromFM = getSupportFragmentManager().findFragmentById(com.gh.gamecenter.selector.R.id.layout_activity_content);
mMainWrapperFragment = fragmentFromFM != null ? (MainWrapperFragment) fragmentFromFM : new MainWrapperFragment();
if (savedInstanceState != null) {
mMainWrapperFragment.setArguments(savedInstanceState);
} else if (getIntent() != null) {
mMainWrapperFragment.setArguments(getIntent().getExtras());
}
replaceFragment(mMainWrapperFragment);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (HaloApp.getInstance().isNewForThisVersion) {
LunchType lunchType = HaloApp.getInstance().getLaunchType();
@ -215,7 +211,6 @@ public class MainActivity extends BaseActivity {
DataUtils.getGid();
}
mPackageViewModel = ViewModelProviders.of(this, new PackageViewModel.Factory()).get(PackageViewModel.class);
final boolean containsErrorMsg = com.gh.gamecenter.common.constant.Config.isContainsErrorMsg();
@ -273,6 +268,7 @@ public class MainActivity extends BaseActivity {
if (mShouldShowAd) {
showAd();
} else {
doInitMainFragment(mTempSavedInstanceState);
hideTextAd();
hideSplashAd();
}
@ -328,6 +324,23 @@ public class MainActivity extends BaseActivity {
CertificationSwitchHelper.getCertificationSwitch();
}
private void doInitMainFragment(Bundle savedInstanceState) {
if (mFragmentIsCreated) return;
mTempSavedInstanceState = null;
Fragment fragmentFromFM = getSupportFragmentManager().findFragmentById(com.gh.gamecenter.selector.R.id.layout_activity_content);
mMainWrapperFragment = fragmentFromFM != null ? (MainWrapperFragment) fragmentFromFM : new MainWrapperFragment();
if (savedInstanceState != null) {
mMainWrapperFragment.setArguments(savedInstanceState);
} else if (getIntent() != null) {
mMainWrapperFragment.setArguments(getIntent().getExtras());
}
replaceFragment(mMainWrapperFragment);
mFragmentIsCreated = true;
}
@SuppressLint("CheckResult")
private void getTeenagerMode() {
RetrofitManager.getInstance()
@ -543,6 +556,12 @@ public class MainActivity extends BaseActivity {
if (msg.what == COUNTDOWN_AD || msg.what == COUNTDOWN_SDK_AD) {
mCountdownCount++;
int maxCount;
// 第三秒的时候初始化 Fragment
if (mCountdownCount == 3) {
doInitMainFragment(mTempSavedInstanceState);
}
if (msg.what == COUNTDOWN_AD) {
maxCount = mCountdownMaxCount;
} else {
@ -633,10 +652,11 @@ public class MainActivity extends BaseActivity {
ExtensionsKt.removeFromParent(startSdkAdIcpContainer, true);
}
onSplashHidden();
onAdHidden();
}
private void onSplashHidden() {
private void onAdHidden() {
doInitMainFragment(mTempSavedInstanceState);
// 通知全局弹窗可以进行显示
AppExecutor.getUiExecutor().execute(GlobalPriorityChainHelper.INSTANCE::start);
}
@ -854,7 +874,9 @@ public class MainActivity extends BaseActivity {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && !mMainWrapperFragment.onHandleBackPressed()) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0
&& mMainWrapperFragment != null
&& !mMainWrapperFragment.onHandleBackPressed()) {
DownloadEntity downloadEntity = null;
for (DownloadEntity entity : DownloadManager.getInstance().getAllDownloadEntityExcludeSilentTask()) {
if (entity.getStatus().equals(DownloadStatus.done)) {
@ -1045,6 +1067,7 @@ public class MainActivity extends BaseActivity {
blackList.add(R.id.historyTv);
blackList.add(R.id.myCollectionTv);
blackList.add(R.id.searchTv);
blackList.add(R.id.subject_tab);
updateStaticView(view, blackList);
View communityHomeWrapper = view.findViewById(R.id.communityHomeContainer);

View File

@ -15,6 +15,7 @@ import androidx.core.widget.doAfterTextChanged
import androidx.core.widget.doOnTextChanged
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.gh.common.fragment.popBackStackAllowStateLoss
import com.gh.common.util.DataCollectionUtils
import com.gh.common.util.LogUtils
import com.gh.gamecenter.DisplayType.*
@ -190,6 +191,7 @@ open class SearchActivity : BaseActivity() {
when (type) {
SearchType.AUTO -> handleAutoSearch(key)
SearchType.DEFAULT -> handleDefaultSearch(key)
SearchType.DISCOVERY -> handleDiscoverySearch(key)
SearchType.RANK -> handleRankSearch(key)
SearchType.HOT -> handleHotSearch(key)
SearchType.HISTORY -> handleHistorySearch(key)
@ -243,6 +245,22 @@ open class SearchActivity : BaseActivity() {
)
}
protected open fun handleDiscoverySearch(key: String?) {
mSearchKey = key
searchEt.setText(key)
searchEt.setSelection(searchEt.text.length)
updateDisplayType(GAME_DETAIL)
LogUtils.uploadSearchGame("searching", "搜索页", key, "搜索发现")
SensorsBridge.trackSearchButtonClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
key ?: "",
TRACK_SEARCH_TYPE_DISCOVERY,
mSourceEntrance
)
}
protected open fun handleDefaultSearch(key: String?) {
mSearchKey = key
searchEt.setText(key)
@ -381,7 +399,7 @@ open class SearchActivity : BaseActivity() {
}
protected fun popBackToFragment(tag: String) {
supportFragmentManager.popBackStack(tag, 0)
supportFragmentManager.popBackStackAllowStateLoss(tag, 0)
}
@Subscribe(threadMode = ThreadMode.MAIN)
@ -390,6 +408,7 @@ open class SearchActivity : BaseActivity() {
SearchType.HISTORY.value -> search(SearchType.HISTORY, search.key)
SearchType.HOT.value -> search(SearchType.HOT, search.key)
SearchType.RANK.value -> search(SearchType.RANK, search.key)
SearchType.DISCOVERY.value -> search(SearchType.DISCOVERY, search.key)
"click" -> DataCollectionUtils.uploadSearchClick(
this, mSearchKey, mSearchType.value, "搜索页面",
@ -434,6 +453,7 @@ open class SearchActivity : BaseActivity() {
const val TRACK_SEARCH_TYPE_DEFAULT = "默认搜索"
const val TRACK_SEARCH_TYPE_HISTORY = "历史搜索"
const val TRACK_SEARCH_TYPE_RANK = "榜单搜索"
const val TRACK_SEARCH_TYPE_DISCOVERY = "搜索发现"
@JvmStatic
fun toTrackSearchType(type: String) = when (type) {
@ -441,6 +461,7 @@ open class SearchActivity : BaseActivity() {
SearchType.MANUAL.value -> TRACK_SEARCH_TYPE_INPUT
SearchType.HISTORY.value -> TRACK_SEARCH_TYPE_HISTORY
SearchType.RANK.value -> TRACK_SEARCH_TYPE_RANK
SearchType.DISCOVERY.value -> TRACK_SEARCH_TYPE_DISCOVERY
else -> TRACK_SEARCH_TYPE_DEFAULT
}
@ -490,7 +511,8 @@ enum class SearchType(var value: String) {
HISTORY("history"),
MANUAL("initiative"),
HOT("remen"),
RANK("rank");
RANK("rank"),
DISCOVERY("dicovery");
fun toChinese() = when (this) {
AUTO -> "自动搜索"
@ -499,6 +521,7 @@ enum class SearchType(var value: String) {
MANUAL -> "主动搜索"
HOT -> "热门搜索"
RANK -> "榜单搜索"
DISCOVERY -> "搜索发现"
}
companion object {

View File

@ -62,16 +62,16 @@ import com.gh.gamecenter.common.base.activity.BaseActivity;
import com.gh.gamecenter.common.constant.Constants;
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.entity.LaunchRedirect;
import com.gh.gamecenter.common.entity.SimpleGameEntity;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.entity.SubjectData;
import com.gh.gamecenter.entity.SubjectRecommendEntity;
import com.gh.gamecenter.entity.VideoLinkEntity;
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper;
import com.gh.gamecenter.feature.utils.PlatformUtils;
import com.gh.gamecenter.login.view.LoginActivity;
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper;
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel;
import com.gh.gamecenter.video.videomanager.VideoManagerActivity;
import com.gh.vspace.VHelper;
@ -356,8 +356,8 @@ public class SkipActivity extends BaseActivity {
if (!TextUtils.isEmpty(dataString)) {
byte[] linkData = Base64.decode(dataString, Base64.DEFAULT);
String linkDataString = new String(linkData, "UTF-8");
LinkEntity le = GsonUtils.INSTANCE.getGson().fromJson(linkDataString, LinkEntity.class);
DirectUtils.directToLinkPage(this, le, entrance, "", "");
LaunchRedirect launchRedirect = GsonUtils.fromJson(linkDataString, LaunchRedirect.class);
DirectUtils.directToLinkPage(this, launchRedirect, entrance, "", "");
}
} catch (Exception e) {
e.printStackTrace();
@ -445,24 +445,6 @@ public class SkipActivity extends BaseActivity {
break;
}
}
} else if ("market".equals(uri.getScheme())) {
String host = uri.getHost();
String id = "";
try {
id = uri.getQueryParameter("id");
} catch (UnsupportedOperationException e) {
e.printStackTrace();
}
if (host != null) {
if ("details".equals(host)) {
bundle = new Bundle();
bundle.putString(KEY_TO, EntranceConsts.KEY_MARKET_DETAILS);
bundle.putString(KEY_DATA, id);
EntranceUtils.jumpActivity(this, bundle);
} else {
EntranceUtils.jumpActivity(this, new Bundle()); // 跳转至首页
}
}
}
}

View File

@ -0,0 +1,107 @@
package com.gh.gamecenter
import android.app.Activity
import android.content.Context
import android.net.Uri
import android.os.Bundle
import com.therouter.router.Navigator
import com.therouter.router.interceptor.NavigationCallback
import com.therouter.TheRouter
import com.gh.common.util.EntranceUtils
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.dropSchemeAndHost
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
class SkipCompatActivity : SkipActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val uri = intent.data
if (handleSkip(this, uri)) {
intent.setData(null)
}
super.onCreate(savedInstanceState)
finish()
}
companion object {
const val TAG = "SkipCompat"
const val HOST = "app"
const val SCHEME = "ghzhushou"
const val MARKET = "market"
fun handleSkip(context: Context, uri: Uri?): Boolean {
if (uri == null) return false
// Handle skip
if (uri.scheme == SCHEME) {
Utils.log(TAG, "handleSkip: $uri")
val host = uri.host
if (host == HOST) {
TheRouter
.build(uri.dropSchemeAndHost())
.navigation(context, object : NavigationCallback() {
override fun onFound(postcard: Navigator) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onFound" )
}
override fun onLost(postcard: Navigator, requestCode: Int) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onLost" )
if (HaloApp.getInstance().isAlreadyUpAndRunning) {
// 在光环应用内时,显示不支持弹窗
// 显示不支持弹窗
DialogHelper.showUpgradeDialog(context)
} else {
// 在光环应用外跳转时,重定向至首页
EntranceUtils.jumpActivity(context, Bundle())
}
}
override fun onArrival(postcard: Navigator) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onArrival" )
}
override fun onActivityCreated(postcard: Navigator, activity: Activity) {
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onActivityCreated" )
}
})
return true
}
} else if (uri.scheme == MARKET) {
val host = uri.host
var id = ""
try {
id = uri.getQueryParameter("id") ?: ""
} catch (e: Exception) {
e.printStackTrace()
}
if (host != null) {
if ("details" == host) {
val bundle = Bundle()
bundle.putString(
EntranceConsts.KEY_TO,
EntranceConsts.KEY_MARKET_DETAILS
)
bundle.putString(EntranceConsts.KEY_DATA, id)
EntranceUtils.jumpActivity(context, bundle)
} else {
EntranceUtils.jumpActivity(context, Bundle()) // 跳转至首页
}
return true
}
}
return false
}
}
}

View File

@ -14,8 +14,8 @@ import androidx.core.app.NotificationCompat
import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import androidx.core.text.color
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.therouter.router.Route
import com.therouter.TheRouter
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
import com.gh.common.util.DeviceTokenUtils
import com.gh.common.util.DialogUtils
@ -29,6 +29,7 @@ import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.iinterface.ISplashScreen
import com.gh.gamecenter.core.provider.IAppProvider
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
import com.gh.gamecenter.core.provider.IPushProvider
@ -47,7 +48,7 @@ import java.util.*
* 引导页面
*/
@Route(path = RouteConsts.activity.splashActivity)
class SplashScreenActivity : BaseActivity() {
class SplashScreenActivity : BaseActivity(), ISplashScreen {
private var mSharedPreferences: SharedPreferences? = null
private var mIsNewForThisVersion = false
@ -136,9 +137,8 @@ class SplashScreenActivity : BaseActivity() {
}
private fun logAppLaunch() {
val packageUtilsConfig =
ARouter.getInstance().build(RouteConsts.provider.packageUtils).navigation() as? IPackageUtilsProvider
val appProvider = ARouter.getInstance().build(RouteConsts.provider.app).navigation() as? IAppProvider
val packageUtilsConfig = TheRouter.get(IPackageUtilsProvider::class.java)
val appProvider = TheRouter.get(IAppProvider::class.java)
val signatureHash = packageUtilsConfig?.getApkSignatureByPackageName(this, packageName)?.get(0)
val sideLoadInfo = packageUtilsConfig?.getSideLoadedInfo()
val trackEvent = JSONObject()
@ -282,11 +282,11 @@ class SplashScreenActivity : BaseActivity() {
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
SensorsBridge.setOAID(HaloApp.getInstance().oaid)
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
val registrationId = pushProvider?.getRegistrationId(this)
if (!registrationId.isNullOrEmpty()) {
SensorsBridge.profileAppend(KEY_REGISTRATION_ID, registrationId)
}
// val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
// val registrationId = pushProvider?.getRegistrationId(this)
// if (!registrationId.isNullOrEmpty()) {
// SensorsBridge.profileSet(KEY_REGISTRATION_ID, registrationId)
// }
}
private fun prefetchData() {

View File

@ -4,12 +4,15 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.halo.assistant.fragment.user.UserInfoFragment
import com.therouter.router.Route
/**
* 编辑资料
*/
@Route(
path = RouteConsts.activity.userInfoActivity,
description = "个人中心"
)
class UserInfoActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@ -17,6 +20,14 @@ class UserInfoActivity : ToolBarActivity() {
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
}
override fun provideNormalIntent(): Intent {
return getTargetIntent(
this,
UserInfoActivity::class.java,
UserInfoFragment::class.java
)
}
companion object {
fun getIntent(context: Context?): Intent? {
return getTargetIntent(

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