Compare commits

..

390 Commits

Author SHA1 Message Date
06f932af14 Revert 畅玩实名认证特殊字符 2025-03-25 17:29:13 +08:00
c2fe3bb64a Merge branch 'hotfix/GHZSCY-7702' into 'release'
Revert "fix: "点"符号设置颜色"

See merge request halo/android/assistant-android!2134
2025-03-25 17:24:30 +08:00
b1b231a309 Revert "feat: 【光环助手】实名认证特殊字符输入优化 https://jira.shanqu.cc/browse/GHZSCY-7702"
This reverts commit cc05dabb93.
2025-03-25 17:23:29 +08:00
e5161ae350 Revert "fix: "点"符号设置颜色"
This reverts commit 2ba39188f7.
2025-03-25 17:22:58 +08:00
4dfa7733ad Merge branch 'feat/va-relative' into 'dev'
feat: 5.40.0 va相关的更新

See merge request halo/android/assistant-android!2133
2025-03-25 14:32:58 +08:00
3906d9b84b feat: 5.40.0 va相关的更新 2025-03-25 14:31:39 +08:00
775e6cc689 Merge branch 'feat/remove-duplicate-log' into 'dev'
删除多余的日志上报

See merge request halo/android/assistant-android!2132
2025-03-25 14:25:39 +08:00
019b9f3f82 删除多余的日志上报 2025-03-25 14:24:05 +08:00
49f752dab5 Merge branch 'fix/jg_push_source_entrance' into 'dev'
fix: 修复极光推送跳转没有携带来源信息的问题

See merge request halo/android/assistant-android!2131
2025-03-25 10:45:05 +08:00
0cbda119d4 fix: 修复极光推送跳转没有携带来源信息的问题 2025-03-25 10:43:59 +08:00
aed8e50db3 feat: 重新启用在华为 Android 10 上的开屏广告,测试闪退情况 2025-03-25 10:17:57 +08:00
da5bb9eaf3 Merge branch 'feat/GHZSCY-7525' into 'dev'
feat: 头条推广包转化归因优化及SDK更新 https://jira.shanqu.cc/browse/GHZSCY-7525.cc/browse/GHZSCY-7525

See merge request halo/android/assistant-android!2130
2025-03-25 09:57:44 +08:00
d7593de98b feat: 头条推广包转化归因优化及SDK更新 https://jira.shanqu.cc/browse/GHZSCY-7525.cc/browse/GHZSCY-7525 2025-03-25 09:57:08 +08:00
69d2d699fe Merge branch 'feat/GHZSCY-7712' into 'dev'
feat: 后台功能面板组件交互优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7712

See merge request halo/android/assistant-android!2129
2025-03-24 14:31:32 +08:00
a438ef16c0 feat: 后台功能面板组件交互优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7712 2025-03-24 14:31:32 +08:00
d5a2cecd29 Merge branch 'fix/GHZSCY-7737' into 'dev'
fix:【光环助手】游戏详情下载触发跳转异常 https://jira.shanqu.cc/browse/GHZSCY-7737

See merge request halo/android/assistant-android!2128
2025-03-24 11:30:23 +08:00
65a4e675fa fix:【光环助手】游戏详情下载触发跳转异常 https://jira.shanqu.cc/browse/GHZSCY-7737 2025-03-24 11:30:23 +08:00
ec3e6d5f7b Merge branch 'fix/GHZSCY-7691' into 'dev'
fix: 2025/3/14 - 埋点补充 https://jira.shanqu.cc/browse/GHZSCY-7691

See merge request halo/android/assistant-android!2116
2025-03-24 10:03:53 +08:00
07b0afce03 fix: 2025/3/14 - 埋点补充 https://jira.shanqu.cc/browse/GHZSCY-7691 2025-03-24 10:03:53 +08:00
852a6d32d6 Merge branch 'fix/GHZSCY-7736' into 'dev'
fix: 间距显示问题-客户端 https://jira.shanqu.cc/browse/GHZSCY-7736

See merge request halo/android/assistant-android!2127
2025-03-24 09:44:19 +08:00
55022d8b1c fix: 间距显示问题-客户端 https://jira.shanqu.cc/browse/GHZSCY-7736 2025-03-24 09:42:26 +08:00
eb7d407e92 Merge branch 'fix/GHZSCY-7735' into 'dev'
fix: 版本求更新显示优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7735

See merge request halo/android/assistant-android!2126
2025-03-21 18:02:02 +08:00
733cd1e198 fix: 版本求更新显示优化—客户端 https://jira.shanqu.cc/browse/GHZSCY-7735 2025-03-21 17:57:02 +08:00
1d767018f6 Merge branch 'fix/va/unity-crash' into 'dev'
fix: 部分unity游戏启动闪退

See merge request halo/android/assistant-android!2125
2025-03-21 17:36:55 +08:00
0a3616a1c0 fix: 部分unity游戏启动闪退 2025-03-21 17:36:09 +08:00
05108ab478 Merge branch 'fix/crash-in-splash' into 'dev'
fix:java.lang.RuntimeException: Unable to start activity...

See merge request halo/android/assistant-android!2124
2025-03-21 11:23:33 +08:00
508c90cc63 fix:java.lang.RuntimeException: Unable to start activity... 2025-03-21 11:23:33 +08:00
6242f79f80 Merge branch 'fix/GHZSCY-7728' into 'dev'
fix: 部分位置跳转到游戏开服表无【新增】功能 https://jira.shanqu.cc/browse/GHZSCY-7728

See merge request halo/android/assistant-android!2123
2025-03-20 16:29:36 +08:00
71dd964440 fix: 部分位置跳转到游戏开服表无【新增】功能 https://jira.shanqu.cc/browse/GHZSCY-7728 2025-03-20 16:25:22 +08:00
63fc720c40 Merge remote-tracking branch 'origin/release' into dev 2025-03-20 15:42:57 +08:00
5da02c4b64 Merge branch 'hotfix/v5.39.5-1195/rank_text_width_issue' into 'release'
fix: 修复搜索页推荐榜单文字宽度问题

See merge request halo/android/assistant-android!2122
2025-03-20 15:16:40 +08:00
f94b28a085 fix: 修复搜索页推荐榜单文字宽度问题 2025-03-20 15:15:24 +08:00
e8a199b5c0 Merge branch 'feat/GHZSCY-7702' into 'dev'
fix: "点"符号设置颜色

See merge request halo/android/assistant-android!2121
2025-03-20 11:06:51 +08:00
2ba39188f7 fix: "点"符号设置颜色 2025-03-20 11:06:37 +08:00
963074d5d8 Merge branch 'feat/GHZSCY-7704' into 'dev'
fix: “点”符号大小和颜色设置

See merge request halo/android/assistant-android!2120
2025-03-20 10:51:39 +08:00
cc629819d9 fix: “点”符号大小和颜色设置 2025-03-20 10:51:13 +08:00
d82505ab5d Merge branch 'feat/GHZSCY-7704' into 'dev'
feat: [畅玩]实名认证特殊符号以及字符限制优化 https://jira.shanqu.cc/browse/GHZSCY-7704

See merge request halo/android/assistant-android!2119
2025-03-20 09:46:54 +08:00
a917214b36 feat: [畅玩]实名认证特殊符号以及字符限制优化 https://jira.shanqu.cc/browse/GHZSCY-7704 2025-03-20 09:46:34 +08:00
bdf9094799 Merge branch 'feat/common-chips' into 'dev'
feat:添加通用组件:选项标签Chips

See merge request halo/android/assistant-android!2118
2025-03-20 09:45:39 +08:00
df0d0604b9 feat:添加通用组件:选项标签Chips 2025-03-20 09:39:51 +08:00
f100d906ab Merge branch 'feat/GHZSCY-7702' into 'dev'
feat: 【光环助手】实名认证特殊字符输入优化 https://jira.shanqu.cc/browse/GHZSCY-7702

See merge request halo/android/assistant-android!2117
2025-03-19 17:51:51 +08:00
cc05dabb93 feat: 【光环助手】实名认证特殊字符输入优化 https://jira.shanqu.cc/browse/GHZSCY-7702 2025-03-19 17:45:52 +08:00
bd39ac2eaf Merge branch 'fix/drop_font_color_in_dark_mode' into 'dev'
fix: 修复部分富文本中的颜色在深色模式下没有去除的问题

See merge request halo/android/assistant-android!2115
2025-03-19 17:10:52 +08:00
31903d21c0 fix: 修复部分富文本中的颜色在深色模式下没有去除的问题 2025-03-19 17:03:45 +08:00
266fcc4c38 Merge branch 'feat/GHZSCY-7642' into 'dev'
feat: 优化汉化UI

See merge request halo/android/assistant-android!2114
2025-03-19 11:31:34 +08:00
075ed04191 feat: 优化汉化UI 2025-03-19 11:30:55 +08:00
c804c2f7fd Merge branch 'feat/GHZSCY-7642' into 'dev'
feat: 畅玩汉化翻译功能

See merge request halo/android/assistant-android!2113
2025-03-18 11:39:09 +08:00
882f0a7b3e feat: 畅玩汉化翻译功能 2025-03-18 11:37:18 +08:00
3cf86a500b Merge branch 'feat/GHZSCY-7568' into 'dev'
feat: 游戏详情改版补充优化1—客户端(1) https://jira.shanqu.cc/browse/GHZSCY-7568

See merge request halo/android/assistant-android!2112
2025-03-18 11:14:49 +08:00
3cd70b5b8f feat: 游戏详情改版补充优化1—客户端(1) https://jira.shanqu.cc/browse/GHZSCY-7568 2025-03-18 11:14:49 +08:00
60f35a89b4 Merge branch 'feat/GHZSCY-6982-2' into 'dev'
feat:【光环助手】搜索业务:神策埋点相关搜索结果点击事件新增序号属性position https://jira.shanqu.cc/browse/GHZSCY-6982

See merge request halo/android/assistant-android!2111
2025-03-17 15:43:10 +08:00
1503c23246 feat:【光环助手】搜索业务:神策埋点相关搜索结果点击事件新增序号属性position https://jira.shanqu.cc/browse/GHZSCY-6982 2025-03-17 15:38:01 +08:00
ea9e91618f Merge branch 'fix/GHZSCY-7685' into 'dev'
fix:游戏预约功能(第六期)—0313运营测试-客户端...

See merge request halo/android/assistant-android!2110
2025-03-17 11:12:07 +08:00
d52fcc2185 fix:游戏预约功能(第六期)—0313运营测试-客户端... 2025-03-17 11:12:07 +08:00
db047c36d7 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2025-03-14 15:22:00 +08:00
1e58bec4a0 Merge branch 'feat/GHZSCY-7668' into 'dev'
feat: 光环助手测试包增加相关快捷功能 https://jira.shanqu.cc/browse/GHZSCY-7668

See merge request halo/android/assistant-android!2109
2025-03-14 15:19:22 +08:00
87ff1a64b3 Merge branch 'fix/improper-router' into 'release'
fix: 修复光环未正常启动也能使用路由跳转至指定页面的问题

See merge request halo/android/assistant-android!2108
2025-03-14 15:16:21 +08:00
b3678d7a54 fix: 修复光环未正常启动也能使用路由跳转至指定页面的问题 2025-03-14 14:28:53 +08:00
c7fa04792b chore: 版本更新至 5.39.5 2025-03-14 10:14:08 +08:00
76ea531419 Merge branch 'fix/GHZSCY-7687' into 'release'
fix:【光环助手】搜索内容标签点击跳转异常 https://jira.shanqu.cc/browse/GHZSCY-7687

See merge request halo/android/assistant-android!2107
2025-03-13 18:20:31 +08:00
d821da0b2c fix:【光环助手】搜索内容标签点击跳转异常 https://jira.shanqu.cc/browse/GHZSCY-7687 2025-03-13 18:20:31 +08:00
d9b137504a Merge branch 'fix/GHZSCY-7661' into 'release'
fix:【光环助手】游戏详情自定义tab关联自定义页面的视频播放问题 https://jira.shanqu.cc/browse/GHZSCY-7661

See merge request halo/android/assistant-android!2105
2025-03-13 16:36:39 +08:00
93369f5676 fix:【光环助手】游戏详情自定义tab关联自定义页面的视频播放问题 https://jira.shanqu.cc/browse/GHZSCY-7661 2025-03-13 16:36:39 +08:00
b109c3bf6f Merge branch 'fix/GHZSCY-7681' into 'dev'
fix: 视频/图片上传问题 https://jira.shanqu.cc/browse/GHZSCY-7681

See merge request halo/android/assistant-android!2106
2025-03-13 16:03:36 +08:00
bb80560a49 fix: 视频/图片上传问题 https://jira.shanqu.cc/browse/GHZSCY-7681 2025-03-13 16:02:48 +08:00
c43a9e3b6e feat: 光环助手测试包增加相关快捷功能 https://jira.shanqu.cc/browse/GHZSCY-7668 2025-03-13 14:53:03 +08:00
34d255d258 Merge branch 'feat/GHZSCY-7676' into 'release'
fix: 新游开测相关功能优化(第四期)—0313运营测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-7676

See merge request halo/android/assistant-android!2104
2025-03-13 13:43:15 +08:00
3ca17cea07 fix: 新游开测相关功能优化(第四期)—0313运营测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-7676 2025-03-13 13:40:10 +08:00
d3e23bfbb5 Merge branch 'feat/GHZSCY-6834' into 'dev'
feat:游戏预约功能(第六期)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6834

See merge request halo/android/assistant-android!2102
2025-03-11 16:53:11 +08:00
273a9f010d feat:游戏预约功能(第六期)—客户端 https://jira.shanqu.cc/browse/GHZSCY-6834 2025-03-11 16:53:11 +08:00
e8cbaf89ff Merge branch 'feat/GHZSCY-6817' into 'dev'
feat:游戏专题新增“竖式图文列表”样式—客户端 https://jira.shanqu.cc/browse/GHZSCY-6817

See merge request halo/android/assistant-android!2101
2025-03-11 14:45:23 +08:00
0e3586a556 Merge branch 'feat/GHZSCY-7048' into 'dev'
feat: 推广包快手API新增次留上报 https://jira.shanqu.cc/browse/GHZSCY-7048

See merge request halo/android/assistant-android!2099
2025-03-11 14:38:02 +08:00
d546651c06 feat:游戏专题新增“竖式图文列表”样式—客户端 https://jira.shanqu.cc/browse/GHZSCY-6817 2025-03-11 14:24:46 +08:00
815f567f44 Merge branch 'feat/GHZSCY-6812' into 'dev'
feat:https://jira.shanqu.cc/browse/GHZSCY-6812 发表内容输入规则优化—客户端

See merge request halo/android/assistant-android!2100
2025-03-11 14:20:41 +08:00
ba3e9357a1 feat:https://jira.shanqu.cc/browse/GHZSCY-6812 发表内容输入规则优化—客户端 2025-03-11 14:20:41 +08:00
312448daae Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2025-03-11 10:53:15 +08:00
a00a1ced7e Merge branch 'fix/message_link_skip' into 'release'
fix: 修复消息中心跳转问题

See merge request halo/android/assistant-android!2098
2025-03-11 10:42:18 +08:00
1587ca8e6a fix: 修复消息中心跳转问题 2025-03-11 10:35:39 +08:00
86b4761a1c Merge branch 'fix/game_detail_dark_mode' into 'release'
fix: 修复游戏详情页闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/379887/events/0f296b9965884a4f944867479ad7d6c7/?project=22

See merge request halo/android/assistant-android!2097
2025-03-10 10:04:15 +08:00
0446d87b24 fix: 修复游戏详情切换深色模式出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/440456/events/3cfa315cbb734e9688984dddf75fefbd/?project=22 2025-03-10 09:48:04 +08:00
6338fb4dd0 Merge branch 'fix/game_detail_video' into 'release'
fix: 修复游戏详情部分16:9视频存在黑边的问题

See merge request halo/android/assistant-android!2096
2025-03-07 11:54:32 +08:00
6056b7ce1f fix: 修复游戏详情部分16:9视频存在黑边的问题 2025-03-07 11:50:08 +08:00
d51d3c16fe Merge branch 'fix/GHZSCY-7609' into 'release'
fix:【光环助手】UI显示问题 https://jira.shanqu.cc/browse/GHZSCY-7609

See merge request halo/android/assistant-android!2095
2025-03-07 11:34:56 +08:00
d3858ba38f fix:【光环助手】UI显示问题 https://jira.shanqu.cc/browse/GHZSCY-7609 2025-03-07 11:31:21 +08:00
3cbee34b8a chore: 版本更新至 5.39.4 2025-03-07 09:31:21 +08:00
ec88f52603 Merge branch 'fix/GHZSCY-7625' into 'release'
fix: 2025/3/6 - 验收问题 - 客户端 https://jira.shanqu.cc/browse/GHZSCY-7625

See merge request halo/android/assistant-android!2094
2025-03-06 17:46:23 +08:00
b669e216c4 fix: 2025/3/6 - 验收问题 - 客户端 https://jira.shanqu.cc/browse/GHZSCY-7625 2025-03-06 17:46:06 +08:00
8a6d476636 Merge branch 'feat/GHZSCY-7541' into 'dev'
feat:客户端穿山甲广告SDK升级新版本—客户端 https://jira.shanqu.cc/browse/GHZSCY-7541

See merge request halo/android/assistant-android!2093
2025-03-06 14:33:05 +08:00
17b34c9e6f feat:客户端穿山甲广告SDK升级新版本—客户端 https://jira.shanqu.cc/browse/GHZSCY-7541 2025-03-06 14:31:16 +08:00
795b640870 Merge branch 'feat/GHZSCY-7623' into 'release'
feat: 神策埋点事件优化 https://jira.shanqu.cc/browse/GHZSCY-7622

See merge request halo/android/assistant-android!2092
2025-03-06 14:10:31 +08:00
099d026e73 feat: 神策埋点事件优化 https://jira.shanqu.cc/browse/GHZSCY-7622 2025-03-06 14:09:22 +08:00
162381527c Merge branch 'fix/fix-set-acct-token-failed' into 'release'
https://sentry.shanqu.cc/organizations/lightgame/issues/440135 此bug为奇游sdk setToken失败,errro_message为The SDK is not initialized, please call init in Application to initialize the SDK

See merge request halo/android/assistant-android!2091
2025-03-06 11:26:00 +08:00
dedbe1d18c https://sentry.shanqu.cc/organizations/lightgame/issues/440135 此bug为奇游sdk setToken失败,errro_message为The SDK is not initialized, please call init in Application to initialize the SDK 2025-03-06 11:26:00 +08:00
b775c2f0a9 Merge branch 'fix/game_detail_dark_mode_crash' into 'release'
fix: 修复游戏详情切换深色模式出现的闪退问题...

See merge request halo/android/assistant-android!2090
2025-03-06 09:38:36 +08:00
7e079bc8fa fix: 修复游戏详情切换深色模式出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/440241/?project=22&referrer=issue-stream&statsPeriod=14d 2025-03-06 09:33:48 +08:00
b719763f2d Merge branch 'fix/GHZSCY-7613' into 'release'
Revert "ci"

See merge request halo/android/assistant-android!2089
2025-03-05 17:23:50 +08:00
fdc04bf8cb fix:【光环助手】轮播banner背景显示问题 https://jira.shanqu.cc/browse/GHZSCY-7613 2025-03-05 17:23:50 +08:00
27811b027f chore: 版本更新至 5.39.3 2025-03-05 15:07:47 +08:00
4e8b8435b8 Merge branch 'hotfix/v5.39.2-1132/remove_useless_sentry_event' into 'release'
build: 移除无用的 sentry 事件

See merge request halo/android/assistant-android!2088
2025-03-05 15:04:58 +08:00
a7efd9528e build: 移除无用的 sentry 事件 2025-03-05 15:04:21 +08:00
982e3a9739 Merge branch 'fix/empty_stack_crash' into 'release'
fix: 修复更新页面BusinessId出现的闪退问题...

See merge request halo/android/assistant-android!2087
2025-03-05 14:50:21 +08:00
a942cdbe51 fix: 修复更新页面BusinessId出现的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/440154/?project=22 2025-03-05 14:43:29 +08:00
f6f0a54cb4 Merge branch 'fix/game_detail_crash' into 'release'
fix: 修复游戏详情页闪退问题...

See merge request halo/android/assistant-android!2086
2025-03-05 14:01:40 +08:00
e26856220a fix: 修复游戏详情页闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/379887/events/0f296b9965884a4f944867479ad7d6c7/?project=22 2025-03-05 13:49:38 +08:00
0f36d7ccfa Merge branch 'fix/GHZSCY-7608' into 'release'
fix:【光环助手】奇游加速器第二期迭代-03/04测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-7608

See merge request halo/android/assistant-android!2084
2025-03-05 11:30:06 +08:00
d0c6a499f8 Merge branch 'fix/GHZSCY-7612' into 'release'
fix:【光环助手】功能标签引导的出现时机问题 https://jira.shanqu.cc/browse/GHZSCY-7612

See merge request halo/android/assistant-android!2085
2025-03-05 11:25:25 +08:00
c56963fab3 fix:【光环助手】功能标签引导的出现时机问题 https://jira.shanqu.cc/browse/GHZSCY-7612 2025-03-05 11:19:43 +08:00
0faa0b490a fix:【光环助手】奇游加速器第二期迭代-03/04测试-客户端 https://jira.shanqu.cc/browse/GHZSCY-7608 2025-03-05 11:19:27 +08:00
51cc1e3104 Merge branch 'fix/game_detail_web' into 'release'
fix: 修复游戏详情网页不能左右滑动切换Tab的问题

See merge request halo/android/assistant-android!2083
2025-03-05 10:50:11 +08:00
ae0ef717d5 fix: 修复游戏详情网页不能左右滑动切换Tab的问题 2025-03-05 10:40:21 +08:00
02ed9c247a Merge branch 'fix/game_detail_divider' into 'release'
fix: 修复光环助手的游戏详情页分割线显示问题

See merge request halo/android/assistant-android!2082
2025-03-04 17:03:23 +08:00
a747917370 fix: 修复光环助手的游戏详情页分割线显示问题 2025-03-04 17:01:02 +08:00
69241c489b chore: 版本更新至 5.40.0 2025-03-04 16:23:00 +08:00
66ffb5cedc chore: 版本更新值 5.39.2 2025-03-04 16:13:30 +08:00
97b3efc968 Merge branch 'fix/wrong_global_screen_width' into 'dev'
fix: 修复页面重建时全局屏幕宽度的值为 0 的问题

See merge request halo/android/assistant-android!2081
2025-03-04 15:57:35 +08:00
288f7370aa fix: 修复页面重建时全局屏幕宽度的值为 0 的问题 2025-03-04 15:56:46 +08:00
f9db7068f2 Merge branch 'fix/game_detail' into 'dev'
fix: 游戏详情Dialog入参改为使用Arguments传递

See merge request halo/android/assistant-android!2080
2025-03-04 15:36:48 +08:00
b4390f2811 fix: 游戏详情Dialog入参改为使用Arguments传递 2025-03-04 15:24:56 +08:00
dbc2be5bc6 Merge branch 'feat/GHZSCY-7568' into 'dev'
游戏详情页补充优化

See merge request halo/android/assistant-android!2079
2025-03-04 11:55:02 +08:00
dec2c35ff4 游戏详情页补充优化 2025-03-04 11:55:02 +08:00
77514aa2a9 Merge branch 'feat/GHZSCY-7446' into 'dev'
feat:【光环助手】一键登录相关UI优化-UI https://jira.shanqu.cc/browse/GHZSCY-7445

See merge request halo/android/assistant-android!2078
2025-03-04 11:07:51 +08:00
40cdda7bae feat:【光环助手】一键登录相关UI优化-UI https://jira.shanqu.cc/browse/GHZSCY-7445 2025-03-04 11:07:51 +08:00
4917b1d4ff Merge branch 'fix/GHZSCY-7589' into 'dev'
fix:【光环助手】游戏单广场遮罩错位问题 https://jira.shanqu.cc/browse/GHZSCY-7589

See merge request halo/android/assistant-android!2077
2025-03-04 10:49:09 +08:00
d646e971f7 fix:【光环助手】游戏单广场遮罩错位问题 https://jira.shanqu.cc/browse/GHZSCY-7589 2025-03-04 10:48:32 +08:00
af9ba8a4d0 Merge branch 'feat/GHZSCY-7458-rebase-from-dev' into 'dev'
feat:https://jira.shanqu.cc/browse/GHZSCY-6976 奇游加速SDK接入—客户端

See merge request halo/android/assistant-android!2075
2025-03-04 10:44:00 +08:00
738dfd3b4d feat:https://jira.shanqu.cc/browse/GHZSCY-6976 奇游加速SDK接入—客户端 2025-03-04 10:44:00 +08:00
0f0962b261 Merge branch 'feat/GHZSCY-7544' into 'dev'
feat: 实名认证相关优化 https://jira.shanqu.cc/browse/GHZSCY-7544

See merge request halo/android/assistant-android!2074
2025-03-04 09:58:57 +08:00
ffa61e8b96 feat: 实名认证相关优化 https://jira.shanqu.cc/browse/GHZSCY-7544 2025-03-04 09:54:51 +08:00
b460750f5a Merge branch 'feat/va-relative' into 'dev'
feat: 预防进程组被杀时,server_dead的误报

See merge request halo/android/assistant-android!2073
2025-02-28 17:22:31 +08:00
528d7511f9 feat: 预防进程组被杀时,server_dead的误报
feat: 启动前台服务的兼容代码
2025-02-28 17:22:01 +08:00
02523b9e33 Merge branch 'refactor/add-comment' into 'dev'
refactor: 添加关于前台服务的提示性注释

See merge request halo/android/assistant-android!2072
2025-02-28 15:24:37 +08:00
bfc4083544 refactor: 添加关于前台服务的提示性注释 2025-02-28 15:24:07 +08:00
18e14d3811 Merge branch 'feat/va-relative' into 'dev'
fix: 停止前台服务的正确使用方法

See merge request halo/android/assistant-android!2071
2025-02-28 14:30:42 +08:00
89901028ea fix: 停止前台服务的正确使用方法 2025-02-28 14:30:21 +08:00
20c3f5cf46 Merge branch 'feat/va-relative' into 'dev'
feat: 恢复VA服务进程保活机制

See merge request halo/android/assistant-android!2070
2025-02-28 10:03:07 +08:00
9bc155816a feat: 恢复VA服务进程保活机制 2025-02-28 10:02:31 +08:00
92366c5629 Merge branch 'feat/va-relative' into 'dev'
chore: va组件升级 2.0.8

See merge request halo/android/assistant-android!2069
2025-02-27 15:48:27 +08:00
a1fd894dde chore: va组件升级 2.0.8
feat: 同步商业版 b370a11df7f0c3dbe4074024b1890c015136267e
feat: 优化crash上报逻辑
2025-02-27 15:47:21 +08:00
03757b22c7 Merge branch 'fix/GHZSCY-7539' into 'dev'
fix: 处理部分华为设备 APP 闪退问题 https://jira.shanqu.cc/browse/GHZSCY-7539

See merge request halo/android/assistant-android!2068
2025-02-26 16:33:39 +08:00
ce10d82a8f Merge branch 'fix/GHZSCY-5855' into 'dev'
feat: 游戏详情页改版优化 https://jira.shanqu.cc/browse/GHZSCY-5855

See merge request halo/android/assistant-android!2067
2025-02-26 14:17:16 +08:00
74a4feee9e feat: 游戏详情页改版优化 https://jira.shanqu.cc/browse/GHZSCY-5855 2025-02-26 14:17:16 +08:00
9cb0736e30 fix: 部分华为设备APP闪退问题 https://jira.shanqu.cc/browse/GHZSCY-7539 2025-02-24 17:54:01 +08:00
b954df3267 Merge branch 'fix/GHZSCY-7530' into 'dev'
fix:【光环助手】游戏单热搜榜 显示问题 https://jira.shanqu.cc/browse/GHZSCY-7530

See merge request halo/android/assistant-android!2066
2025-02-21 10:51:33 +08:00
0607a37256 fix:【光环助手】游戏单热搜榜 显示问题 https://jira.shanqu.cc/browse/GHZSCY-7530 2025-02-21 10:48:47 +08:00
00e4c7f1bd Merge branch 'fix/GHZSCY-7470' into 'dev'
fix: 修复部分设备安装xapk时提示解压失败 https://jira.shanqu.cc/browse/GHZSCY-7470

See merge request halo/android/assistant-android!2065
2025-02-20 14:16:24 +08:00
7d94250914 fix: 修复部分设备安装xapk时提示解压失败 https://jira.shanqu.cc/browse/GHZSCY-7470 2025-02-20 11:46:10 +08:00
7b8634aa40 Merge branch 'feat/GHZSCY-5855' into 'dev'
feat: 游戏详情页改版优化 https://jira.shanqu.cc/browse/GHZSCY-5855

See merge request halo/android/assistant-android!2047
2025-02-19 10:31:33 +08:00
210e18eb34 feat: 游戏详情页改版优化 https://jira.shanqu.cc/browse/GHZSCY-5855 2025-02-19 10:31:33 +08:00
957eff3c1e Merge branch 'fix/usage_stats_crash' into 'dev'
fix: 捕抓游戏游玩时长功能接口返回内容为空时的闪退问题

See merge request halo/android/assistant-android!2064
2025-02-17 14:28:30 +08:00
72b953b7c8 fix: 捕抓游戏游玩时长功能接口返回内容为空时的闪退问题 2025-02-17 14:26:57 +08:00
53fb77d2dc Merge branch 'fix/game_collection_square_fab' into 'dev'
fix: 修复首页游戏单列表滑动过程中快速切换tab错误显示右下角按钮的问题

See merge request halo/android/assistant-android!2063
2025-02-14 15:44:55 +08:00
f78e7a10a6 fix: 修复首页游戏单列表滑动过程中快速切换tab错误显示右下角按钮的问题 2025-02-14 15:42:10 +08:00
6aebea14bc Merge branch 'feat/add_push_id_to_debug_info' into 'dev'
feat: 我的页面 debug 数据增加推送 id

See merge request halo/android/assistant-android!2062
2025-02-14 15:30:25 +08:00
fd0fc31fc3 feat: 我的页面 debug 数据增加推送 id 2025-02-14 15:28:24 +08:00
889558eb4b Merge branch 'fix/GHZSCY-7461' into 'dev'
feat: 注销页面支持由网页端管理返回操作

See merge request halo/android/assistant-android!2060
2025-02-14 13:59:33 +08:00
37ec9ae66c feat: 注销页面支持由网页端管理返回操作 2025-02-14 10:39:30 +08:00
f4d34a635a Merge branch 'fix/search_fragment_recreate_culprit' into 'dev'
fix: 修复搜索页回收重建后不能正确刷新显示内容的问题

See merge request halo/android/assistant-android!2059
2025-02-14 09:52:35 +08:00
024895838c fix: 修复搜索页回收重建后不能正确刷新显示内容的问题 2025-02-13 15:58:44 +08:00
740bdbf79a Merge branch 'fix/GHZSCY-7405' into 'dev'
游戏显示异常问题 https://jira.shanqu.cc/browse/GHZSCY-7405

See merge request halo/android/assistant-android!2058
2025-02-12 15:36:24 +08:00
73f7bee3cc fix: 游戏显示异常问题 https://jira.shanqu.cc/browse/GHZSCY-7405 2025-02-12 14:51:35 +08:00
b37f247b14 Merge branch 'fix/GHZSCY-7349' into 'dev'
fix: 游戏大小显示问题 https://jira.shanqu.cc/browse/GHZSCY-7349

See merge request halo/android/assistant-android!2054
2025-02-12 14:50:30 +08:00
811378f411 Merge branch 'fix/va-proxy-npe' into 'dev'
fix: BindService代理NPE的问题。

See merge request halo/android/assistant-android!2057
2025-02-12 13:53:43 +08:00
f910cb67da fix: BindService代理NPE的问题。 2025-02-12 13:53:27 +08:00
4f2874877c Merge branch 'fix/va-proxy-npe' into 'dev'
fix: BindService代理NPE的问题。

See merge request halo/android/assistant-android!2056
2025-02-12 11:16:42 +08:00
15b35fd6b7 Merge branch 'fix/sentry-436163' into 'dev'
fix: 多进程下没有初始化mApp导致的闪退

See merge request halo/android/assistant-android!2055
2025-02-12 11:15:08 +08:00
cd64bb79a2 fix: 多进程下没有初始化mApp导致的闪退 2025-02-12 11:14:22 +08:00
d57c03b1f8 fix: BindService代理NPE的问题。 2025-02-12 11:12:16 +08:00
1895977d4c fix: 游戏大小显示问题 https://jira.shanqu.cc/browse/GHZSCY-7349 2025-02-12 10:03:32 +08:00
08571998b6 Merge branch 'fix/search_rank_icon_reuse_culprit' into 'dev'
fix: 修复搜索页面榜单的 icon 复用问题

See merge request halo/android/assistant-android!2053
2025-02-11 10:47:22 +08:00
21cdadca13 Merge remote-tracking branch 'origin/release' into dev 2025-02-11 10:39:29 +08:00
54dfa46204 fix: 修复搜索页面榜单的 icon 复用问题 2025-02-11 10:38:13 +08:00
c9f14641c9 Merge branch 'fix/GHZSCY-7440' into 'dev'
fix: 视频合集返回按钮点击无响应 https://jira.shanqu.cc/browse/GHZSCY-7440

See merge request halo/android/assistant-android!2052
2025-02-10 16:58:52 +08:00
0e95c0cbf6 fix: 视频合集返回按钮点击无响应 https://jira.shanqu.cc/browse/GHZSCY-7440 2025-02-10 16:23:51 +08:00
2a93af56ee Merge branch 'fix/GHZSCY-7435' into 'release'
Revert "ci"

See merge request halo/android/assistant-android!2051
2025-02-08 15:41:32 +08:00
28e785745b Revert "ci" 2025-02-08 15:41:32 +08:00
317620daf4 Merge branch 'feat/make_download_more_reponsive' into 'dev'
feat: 第一次包名列表获取成功时初始化浏览器安装条件,提高下载按钮反应速度

See merge request halo/android/assistant-android!2046
2025-02-07 17:41:48 +08:00
bf95a00bc6 Merge branch 'fix/game_update_crashes' into 'release'
fix: 修复游戏更新相关多线程并发操作引起的闪退问题

See merge request halo/android/assistant-android!2050
2025-02-06 16:03:48 +08:00
cb05c8a020 fix: 修复游戏更新相关多线程并发操作引起的闪退问题 2025-02-06 15:15:07 +08:00
d458898eb1 Merge branch 'chen/fix-search-page-crash' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/431718/?project=22

See merge request halo/android/assistant-android!2049
2025-02-06 11:18:48 +08:00
f4f422b089 fix:https://sentry.shanqu.cc/organizations/lightgame/issues/431718/?project=22 2025-02-06 11:11:02 +08:00
e48b11f19d Merge branch 'hotfix/v5.38.8-1118/quick_back_pressed_crashed' into 'release'
fix: 启动应用时快速返回可能会闪退的问题 https://sentry.shanqu.cc/organizations/lightgame/issues/432602/

See merge request halo/android/assistant-android!2048
2025-02-06 10:34:07 +08:00
b6fe834406 fix: 启动应用时快速返回可能会闪退的问题 https://sentry.shanqu.cc/organizations/lightgame/issues/432602/ 2025-02-06 10:31:19 +08:00
d0bf23ae48 Merge remote-tracking branch 'origin/release' into dev 2025-01-17 14:15:55 +08:00
8b1f35516d feat: 第一次包名列表获取成功时初始化浏览器安装条件,提高下载按钮反应速度 2025-01-17 14:14:49 +08:00
b2fde1e0af Merge branch 'hotfix/v5.38.8-1118/meta_build_script_channel_issue' into 'release'
fix: 修复推广打包渠道不生效的问题

See merge request halo/android/assistant-android!2045
2025-01-16 16:01:39 +08:00
ab1350ff46 fix: 修复推广打包渠道不生效的问题 2025-01-16 16:00:25 +08:00
7f991e29d4 Merge branch 'fix/xiaomi_parallel_game_auth' into 'dev'
fix: 修复小米部分机型双开由于缺少权限无法授权登录的问题

See merge request halo/android/assistant-android!2044
2025-01-16 11:04:40 +08:00
40edf76aed fix: 修复小米部分机型双开由于缺少权限无法授权登录的问题 2025-01-16 11:04:40 +08:00
aaeb83c5df Merge branch 'fix/splash_flicker_on_miui' into 'dev'
fix: 修复部分小米设备修改状态栏颜色导致开屏广告闪烁的问题

See merge request halo/android/assistant-android!2043
2025-01-16 09:29:05 +08:00
5739f0a800 fix: 修复部分小米设备修改状态栏颜色导致开屏广告闪烁的问题 2025-01-15 17:58:16 +08:00
10cc81e7fc Merge branch 'feat/va-relative' into 'dev'
feat: 同步va的release代码

See merge request halo/android/assistant-android!2042
2025-01-15 15:00:42 +08:00
60a50f5722 feat: 同步va的release代码 2025-01-15 14:58:32 +08:00
644881c14f Merge branch 'fix/package_check_stuck_issue' into 'dev'
fix: 修复包名检测弹窗弹出较慢的问题

See merge request halo/android/assistant-android!2041
2025-01-15 14:48:19 +08:00
a0e43930a0 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/ad/AdDelegateHelper.kt
#	dependencies.gradle
#	module_login/src/main/java/com/gh/gamecenter/login/user/UserRepository.java
#	vasdk
2025-01-15 14:27:40 +08:00
aa5f6f4f24 fix: 修复包名检测弹窗弹出较慢的问题 2025-01-15 14:22:22 +08:00
ab7668fd81 chore: 版本更新至 5.38.8 2025-01-15 09:19:40 +08:00
c6f014c984 Merge branch 'hotfix/v5.38.7-1117/pre_download_error' into 'release'
fix: 修复预下载获取资源时,服务端报错未能正确处理的问题

See merge request halo/android/assistant-android!2040
2025-01-14 16:30:31 +08:00
c215bd195e fix: 修复预下载获取资源时,服务端报错未能正确处理的问题 2025-01-14 16:27:43 +08:00
bb73598a87 Merge branch 'hotfix/va-relative' into 'release'
fix: va_core进程没有启动导致aidl的NPE问题。

See merge request halo/android/assistant-android!2039
2025-01-14 16:24:52 +08:00
c6f70d1b4c fix: va_core进程没有启动导致aidl的NPE问题。 2025-01-14 16:23:01 +08:00
ce7f75976c Merge branch 'fix/GHZSCY-7371' into 'dev'
fix: 游戏详情-多版本插件下载问题 https://jira.shanqu.cc/browse/GHZSCY-7371

See merge request halo/android/assistant-android!2038
2025-01-14 13:45:06 +08:00
c8a7999990 fix: 游戏详情-多版本插件下载问题 https://jira.shanqu.cc/browse/GHZSCY-7371 2025-01-14 10:49:52 +08:00
0cd281a53c Merge branch 'hotfix/va-relative' into 'release'
fix: 手机不支持armeabi-v7a架构时,根据游戏来选择架构

See merge request halo/android/assistant-android!2037
2025-01-10 18:01:24 +08:00
e92d89d498 fix: 手机不支持armeabi-v7a架构时,根据游戏来选择架构 2025-01-10 17:44:03 +08:00
a22858389b chore: 版本更新至 5.38.7 2025-01-10 13:55:24 +08:00
e9d091043d Merge branch 'hotfix/va-relative' into 'release'
feat: 同步商业版VA,修复权限问题。

See merge request halo/android/assistant-android!2036
2025-01-10 11:25:46 +08:00
db4ac95094 feat: 同步商业版VA,修复权限问题。
fix: 实名认证超大UI问题
fix: sentry va relative log.
2025-01-10 11:24:45 +08:00
13be47d440 Merge branch 'fix/search-page-crash' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423398/?project=22

See merge request halo/android/assistant-android!2035
2025-01-10 11:21:43 +08:00
beee098cfe fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423398/?project=22 2025-01-10 11:17:26 +08:00
d67aaf956b Merge branch 'feat/GHZSCY-7046' into 'release'
feat: 补充启动广告图相关广告加载事件埋点—客户端 https://jira.shanqu.cc/browse/GHZSCY-7046

See merge request halo/android/assistant-android!2034
2025-01-09 17:29:21 +08:00
1ed9151b1f feat: 补充启动广告图相关广告加载事件埋点—客户端 https://jira.shanqu.cc/browse/GHZSCY-7046 2025-01-09 16:43:54 +08:00
13f20f6883 Merge branch 'hotfix/v5.38.6-1116/ad_view_background' into 'release'
fix: 还原自有开屏广告的背景颜色 https://jira.shanqu.cc/browse/GHZSCY-7360

See merge request halo/android/assistant-android!2033
2025-01-09 15:28:06 +08:00
78e320a192 fix: 还原自有开屏广告的背景颜色 https://jira.shanqu.cc/browse/GHZSCY-7360 2025-01-09 15:27:34 +08:00
e51db47fad Merge branch 'cherry-pick-f8a26ece' into 'release'
Merge branch 'fix/GHZSCY-7277' into 'dev'

See merge request halo/android/assistant-android!2032
2025-01-09 15:24:18 +08:00
ac02ea88b9 Merge branch 'fix/GHZSCY-7277' into 'dev'
修复错误的下载错误提示 https://jira.shanqu.cc/browse/GHZSCY-7277

See merge request halo/android/assistant-android!2025

(cherry picked from commit f8a26ece01)

54ee3ea3 fix: 游戏下载异常提示 https://jira.shanqu.cc/browse/GHZSCY-7277

Co-authored-by: 陈君陶 <chenjuntao@ghzhushou.com>
2025-01-09 15:23:53 +08:00
f60004fc81 Merge branch 'feat/GHZSCY-7359' into 'release'
需求合并

See merge request halo/android/assistant-android!2031
2025-01-09 15:05:29 +08:00
0cf39a82e2 Merge branch 'fix/viewstub_crashes' into 'release'
fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/422108/events/?project=22 https://sentry.shanqu.cc/organizations/lightgame/issues/425087/?project=22

See merge request halo/android/assistant-android!2030
2025-01-09 15:03:51 +08:00
315f244153 fix:【光环助手】包名检测及搜索页面在深色模式下的显示问题 https://jira.shanqu.cc/browse/GHZSCY-6985 2025-01-09 14:54:37 +08:00
f4bdc02d70 fix: 【光环助手】深色模式显示问题 https://jira.shanqu.cc/browse/GHZSCY-7121 2025-01-09 14:54:17 +08:00
aef39eb481 feat: 样式组件优化汇总—客户端 https://jira.shanqu.cc/browse/GHZSCY-6866 2025-01-09 14:53:37 +08:00
dc2e7147d9 fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/422108/events/?project=22 https://sentry.shanqu.cc/organizations/lightgame/issues/425087/?project=22 2025-01-09 14:49:58 +08:00
fdcb6342bf Merge branch 'hotfix/v5.38.6-1116/crashes' into 'release'
修复部分 5.38.6 线上闪退

See merge request halo/android/assistant-android!2029
2025-01-09 14:37:49 +08:00
b0da4f8986 Merge branch 'hotfix/v5.38.6-1116/blank_ad_view' into 'release'
fix: 优化开屏广告的显示,提高线程池的 core 线程数,限制视频开屏广告的触摸控制

See merge request halo/android/assistant-android!2028
2025-01-09 14:37:40 +08:00
f7cc906cc5 fix: 优化开屏广告的显示,提高线程池的 core 线程数,限制视频开屏广告的触摸控制 2025-01-09 14:37:40 +08:00
795fbabd90 Merge branch 'hotfix/v5.38.6-1116/login_culprit' into 'release'
修复`我的光环`页面在用户信息接口异常时的显示问题 https://jira.shanqu.cc/browse/GHZSCY-7340

See merge request halo/android/assistant-android!2027
2025-01-09 14:34:25 +08:00
e770f8a359 fix: 修复安装完成后更新安装信息时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/395511 2025-01-09 11:49:38 +08:00
dd12b103be fix: 捕抓上报游戏启动日志的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/406179 2025-01-09 09:59:32 +08:00
21f4a398d5 fix: 处理数组越界闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/408904 2025-01-09 09:45:22 +08:00
f8a26ece01 Merge branch 'fix/GHZSCY-7277' into 'dev'
修复错误的下载错误提示 https://jira.shanqu.cc/browse/GHZSCY-7277

See merge request halo/android/assistant-android!2025
2025-01-08 10:10:32 +08:00
54ee3ea376 fix: 游戏下载异常提示 https://jira.shanqu.cc/browse/GHZSCY-7277 2025-01-07 17:56:09 +08:00
8dfb1644a8 fix: 登录状态显示问题 https://jira.shanqu.cc/browse/GHZSCY-7340 2025-01-07 17:48:53 +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
9744b95126 Merge branch 'fix/viewstub_crash' into 'release'
fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/423818/?project=22

See merge request halo/android/assistant-android!2019
2024-12-27 15:14:25 +08:00
009608165c Merge branch 'fix-issues-421826' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/421826/?project=22

See merge request halo/android/assistant-android!2018
2024-12-27 14:02:39 +08:00
98356a7dd7 fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/423818/?project=22 2024-12-27 13:56:10 +08:00
8389041379 fix:https://sentry.shanqu.cc/organizations/lightgame/issues/421826/?project=22 2024-12-27 13:49:29 +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
5d4648b3d2 feat: 推广包快手API新增次留上报 https://jira.shanqu.cc/browse/GHZSCY-7048 2024-11-27 15:59:53 +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
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
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
0a187b2242 fix: 下载按钮由双下载切换回单下载时的问题 https://jira.shanqu.cc/browse/GHZSCY-6575
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-08-26 14:16:37 +08:00
732 changed files with 31990 additions and 10887 deletions

View File

@ -346,7 +346,7 @@ repositories {
android.applicationVariants.configureEach { variant ->
variant.mergeAssets.doLast {
def assetDir = variant.mergeAssetsProvider.get().outputDir.get()
def unwantedAssets = ['2011394667', 'gdt_plugin/gdtadv2.jar']
def unwantedAssets = ['1832823466', 'gdt_plugin/gdtadv2.jar']
unwantedAssets.each { assetPath ->
def file = new File([assetDir, assetPath].join(File.separator))
@ -372,8 +372,6 @@ dependencies {
// debugImplementation "com.gu.android:toolargetool:${toolargetool}" // 需要使用调试时才启用
debugImplementation "com.github.nichbar:WhatTheStack:${whatTheStack}"
ksp project(":feature:route_doc")
implementation "androidx.multidex:multidex:${multiDex}"
implementation "androidx.fragment:fragment-ktx:${fragment}"
@ -404,7 +402,7 @@ dependencies {
exclude module: "gsyvideoplayer-androidvideocache"
exclude group: "tv.danmaku.ijk.media"
})
implementation ("com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-exo_player2:$gsyVideo") {
implementation("com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-exo_player2:$gsyVideo") {
exclude group: 'com.google.android.exoplayer', module: 'extension-rtmp'
}
@ -449,14 +447,14 @@ dependencies {
exclude group: 'androidx.swiperefreshlayout'
}
// implementation(project(':module_setting')) {
implementation(project(':module_setting')) {
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'))
}
@ -512,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"))
@ -524,6 +526,18 @@ dependencies {
debugImplementation 'com.bytedance.android:shadowhook:1.0.9'
debugImplementation 'io.github.shiqos:wytrace:1.0.1'
if (!gradle.ext.excludeOptionalModules || gradle.ext.enableAccelerator) {
implementation(project(":feature:accelerator"))
}
if (!gradle.ext.excludeOptionalModules || gradle.ext.enableAliPay) {
implementation(project(":feature:ali_pay"))
}
if(!gradle.ext.excludeOptionalModules || gradle.ext.enableWechatPay){
implementation(project(":feature:wechat_pay"))
}
}
File propFile = file('sign.properties')

View File

@ -20,6 +20,7 @@
-keep class com.gh.gamecenter.db.info.* {*;}
-keep class com.gh.gamecenter.entity.** {<fields>;}
-keep class com.gh.gamecenter.qa.entity.** {<fields>;}
-keep class com.gh.gamecenter.gamedetail.entity.** {<fields>;}
-keep class com.gh.download.DownloadDataSimpleEntity {<fields>;}
-keep class com.gh.gamecenter.floatingwindow.FloatingWindowEntity {<fields>;}
-keep class com.gh.gamecenter.BR
@ -76,6 +77,7 @@
### TEA
-keep class com.gh.gamecenter.TeaHelper { *; }
-keep class com.bytedance.ads.convert.broadcast.common.EncryptionTools {*;}
### EasyFloat
-keep class com.lzf.easyfloat.* {*;}

Binary file not shown.

View File

@ -10,9 +10,9 @@
<queries>
<package android:name="com.gh.toolmap" />
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="ghtoolmap"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="ghtoolmap" />
</intent>
</queries>
@ -68,6 +68,13 @@
<!-- 悬浮窗 -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- 适配 双开/分身 游戏授权登录 -->
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<!-- 日历 -->
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-sdk tools:overrideLibrary="
com.shuyu.gsyvideoplayer,
com.shuyu.gsyvideoplayer.lib,
@ -194,7 +201,9 @@
android:name="io.sentry.breadcrumbs.system-events"
android:value="false" />
<meta-data android:name="module_version" android:value="${VA_VERSION_NAME}" />
<meta-data
android:name="module_version"
android:value="${VA_VERSION_NAME}" />
<service android:name="com.gh.ndownload.NDownloadService" />
@ -517,10 +526,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" />
@ -640,6 +645,7 @@
<activity
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 +669,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 +816,14 @@
android:screenOrientation="portrait"
android:theme="@style/AppCompatTheme.APP" />
<activity
android:name=".video.poster.PosterEditActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.halo.assistant.accelerator.MyAssetsActivity"
android:screenOrientation="portrait" />
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->
<!-- android:launchMode="singleTask"-->
@ -864,10 +879,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

@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.SharedPreferences
import android.graphics.drawable.Animatable
import android.os.Message
import android.text.TextUtils
import android.view.View
@ -13,19 +14,21 @@ import android.widget.TextView
import androidx.appcompat.content.res.AppCompatResources
import androidx.fragment.app.Fragment
import com.therouter.TheRouter
import com.facebook.drawee.controller.BaseControllerListener
import com.facebook.drawee.view.SimpleDraweeView
import com.facebook.imagepipeline.image.ImageInfo
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils.logOpenScreenAdSkip
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.exposure.meta.MetaUtil
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor
@ -59,6 +62,8 @@ object AdDelegateHelper {
private val mGameSearchAdList: ArrayList<AdConfig> by lazy { arrayListOf() }
private var mVGameLaunchAd: AdConfig? = null
private var ownerSplashAdLoadTime = 0L
val vGameLaunchAd: AdConfig?
get() = mVGameLaunchAd
@ -76,6 +81,7 @@ object AdDelegateHelper {
}
var isShowingSplashAd = false // 是否正在显示开屏广告
var isOwnerSplashAdShown = false // 自有开屏广告是否展示
var gameSearchKeyword = ""
fun initAdSdk(context: Context) {
@ -172,6 +178,15 @@ object AdDelegateHelper {
when (config.location) {
"halo_launch" -> {
config.ownerAd?.startAd?.let { it.id = config.ownerAd.id }
// HarmonyOS 2.2.0 版本不展示第三方开屏广告 (因为会引起奇怪的闪退)
// if (MetaUtil.getRom().name == "HarmonyOS"
// && MetaUtil.getRom().versionName == "2.2.0"
// && config.displayRule.adSource == "third_party_ads") {
//
// return
// }
mSplashAd = config
}
@ -302,6 +317,7 @@ object AdDelegateHelper {
) {
val hideCallback = {
isShowingSplashAd = false
isOwnerSplashAdShown = false
hideAction.invoke()
}
if (mSplashAd != null) {
@ -574,6 +590,8 @@ object AdDelegateHelper {
handler: BaseActivity.BaseHandler,
hideCallback: () -> Unit
) {
isOwnerSplashAdShown = false
val jumpBtn = startAdContainer.findViewById<TextView>(R.id.jumpBtn)
val jumpDetailBtn: TextView = startAdContainer.findViewById(R.id.jumpDetailBtn)
val adImage: SimpleDraweeView = startAdContainer.findViewById(R.id.adImage)
@ -592,38 +610,62 @@ object AdDelegateHelper {
)
adImage.visibleIf(true)
ImageUtils.display(adImage, ad.img)
ImageUtils.displayWithCallback(adImage, ad.img, true, object : BaseControllerListener<ImageInfo>() {
override fun onSubmit(id: String?, callerContext: Any?) {
super.onSubmit(id, callerContext)
adImage.post {
ownerSplashAdLoadTime = System.currentTimeMillis()
NewFlatLogUtils.logSplashAdLoad(ad.id)
}
}
override fun onFinalImageSet(id: String?, imageInfo: ImageInfo?, animatable: Animatable?) {
isOwnerSplashAdShown = true
adImage.post {
NewFlatLogUtils.logSplashAdShow(ad.id, System.currentTimeMillis() - ownerSplashAdLoadTime)
}
}
override fun onFailure(id: String?, throwable: Throwable?) {
super.onFailure(id, throwable)
NewFlatLogUtils.logSplashAdFail(ad.id, "启动广告图加载失败")
}
})
if (ad.isImageType) {
adVideo.visibleIf(false)
} else {
adVideo.visibleIf(true)
adVideo.startPlay(ad.video.url)
}
startAdContainer.setOnClickListener {
// 拦截点击事件传递
}
jumpBtn.setOnClickListener {
handler.removeMessages(MainActivity.COUNTDOWN_AD)
hideCallback.invoke()
val linkEntity = ad.jump
logOpenScreenAdSkip(
ad.id,
(if (linkEntity.text != null) linkEntity.text else "")!!,
(if (linkEntity.type != null) linkEntity.type else "")!!,
(if (linkEntity.link != null) linkEntity.link else "")!!
)
SensorsBridge.trackEvent(
"SplashAdOwnSkip",
"splash_ad_id",
ad.id,
"link_type",
linkEntity.type ?: "",
"link_id",
linkEntity.link ?: "",
"link_text",
linkEntity.text ?: ""
)
it.debounceActionWithInterval(1000L) {
if (!isOwnerSplashAdShown) {
NewFlatLogUtils.logSplashAdFail(ad.id, "加载过程中点击跳过广告")
}
handler.removeMessages(MainActivity.COUNTDOWN_AD)
hideCallback.invoke()
val linkEntity = ad.jump
NewFlatLogUtils.logOpenScreenAdSkip(
ad.id,
(if (linkEntity.text != null) linkEntity.text else "")!!,
(if (linkEntity.type != null) linkEntity.type else "")!!,
(if (linkEntity.link != null) linkEntity.link else "")!!
)
SensorsBridge.trackEvent(
"SplashAdOwnSkip",
"splash_ad_id",
ad.id,
"link_type",
linkEntity.type ?: "",
"link_id",
linkEntity.link ?: "",
"link_text",
linkEntity.text ?: ""
)
}
}
val sources: MutableList<ExposureSource> = ArrayList()
sources.add(ExposureSource("开屏广告", ad.id))

View File

@ -19,10 +19,10 @@ import java.net.URLConnection
object AdPluginDownloadHelper : InnerDownloadListener {
private const val CSJ_FILE_NAME = "2011394667"
private const val CSJ_FILE_NAME = "1832823466"
private const val GDT_FILE_NAME = "gdt_plugin/gdtadv2.jar"
private const val CSJ_PLUGIN_URL = "https://and-static.ghzs66.com/android/static/2011394667"
private const val CSJ_PLUGIN_URL = "https://and-static.ghzs66.com/android/static/1832823466"
private const val GDT_PLUGIN_URL = "https://and-static.ghzs66.com/android/static/gdtadv2.jar"
private var csjDownloadedCallback: (() -> Unit)? = null

View File

@ -44,6 +44,16 @@ class SplashAdVideoView @JvmOverloads constructor(
return R.layout.layout_splash_ad_video
}
override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) {
// no nothing
}
override fun onPrepared() {
super.onPrepared()
visibility = VISIBLE
}
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

@ -2,9 +2,9 @@ package com.gh.base
import android.app.Activity
import android.app.Application
import android.content.res.Configuration
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.therouter.TheRouter
import com.gh.ad.AdDelegateHelper
import com.gh.common.util.FloatingBackViewManager
import com.gh.common.xapk.XapkInstaller
@ -15,27 +15,45 @@ import com.gh.gamecenter.SplashAdActivity
import com.gh.gamecenter.SplashScreenActivity
import com.gh.gamecenter.authorization.AuthorizationActivity
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.provider.IHelpAndFeedbackProvider
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.core.provider.IPushProvider
import com.gh.gamecenter.login.utils.QuickLoginHelper
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.va.VCore
import com.gh.gamecenter.login.utils.QuickLoginHelper
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.therouter.TheRouter
// TODO移动到对应的模块
class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
private var isFromBackgroundToForeground = false // 是否后台回到前台
override fun onActivityPreCreated(activity: Activity, savedInstanceState: Bundle?) {
if (QuickLoginHelper.isLoginAuthPage(activity)) {
try {
val resources = activity.resources
val config = Configuration(resources.configuration)
config.fontScale = 1.0f
// 更新Resources配置
val metrics = resources.displayMetrics
metrics.scaledDensity = metrics.density
resources.updateConfiguration(config, metrics)
} catch (e: Exception) {
// 设置字体失败
}
}
}
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
// do nothing
}
override fun onActivityStarted(activity: Activity) {
GlobalActivityManager.currentActivity = activity
GlobalActivityManager.activityCount ++
GlobalActivityManager.activityCount++
if (GlobalActivityManager.activityCount == 1 && isFromBackgroundToForeground) {
if (AdDelegateHelper.shouldShowStartUpAd(true)
&& !HaloApp.getInstance().isDisableSplashAdTemporarily
@ -111,7 +129,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
}
override fun onActivityStopped(activity: Activity) {
GlobalActivityManager.activityCount --
GlobalActivityManager.activityCount--
isFromBackgroundToForeground = GlobalActivityManager.activityCount <= 0
}

View File

@ -3,6 +3,8 @@ package com.gh.common
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.util.Base64
import android.view.View
import android.webkit.JavascriptInterface
@ -11,7 +13,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.therouter.TheRouter
import androidx.lifecycle.Lifecycle
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.*
import com.gh.common.util.LogUtils
@ -19,10 +21,12 @@ import com.gh.download.DownloadManager
import com.gh.download.PackageObserver
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.constant.Constants.SP_MEMBER_PAYMENT_BUTTON_CLICK
import com.gh.gamecenter.common.constant.Constants.SP_MEMBER_RECHARGE_BUTTON_CLICK
import com.gh.gamecenter.common.entity.NotificationUgc
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.loghub.LoghubUtils
@ -30,20 +34,22 @@ import com.gh.gamecenter.common.provider.IHelpAndFeedbackProvider
import com.gh.gamecenter.common.tracker.Tracker
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.utils.NewFlatLogUtils
import com.gh.gamecenter.common.utils.SensorsBridge.EVENT_MEMBER_RECHARGE_BUTTON_CLICK
import com.gh.gamecenter.common.utils.SensorsBridge.EVENT_NAME
import com.gh.gamecenter.common.utils.SensorsBridge.KEY_IS_FIRST_TIME
import com.gh.gamecenter.common.view.dsbridge.CompletionHandler
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.provider.IPushProvider
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.SensorsEvent
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.feature.entity.AcctRecordEntity
import com.gh.gamecenter.feature.entity.Badge
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.OrderEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.login.user.LoginTag
import com.gh.gamecenter.login.user.UserManager
@ -55,10 +61,14 @@ import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.setting.SettingBridge
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.halo.assistant.accelerator.repository.AccelerationRepository.Companion.PAYMENT_TYPE_ALIPAY
import com.halo.assistant.accelerator.repository.AccelerationRepository.Companion.PAYMENT_TYPE_WECHAT
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus.*
import com.lightgame.utils.Utils
import com.therouter.TheRouter
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@ -71,10 +81,11 @@ import java.util.*
class DefaultJsApi(
var context: Context,
val entrance: String = "",
private var mFragment: Fragment? = null,
private val mFragment: Fragment? = null,
private var mBbsId: String? = "",
private var mOriginUrl: String? = "",
private val mForumName: String? = "",
private val listener: OnWebClickListener? = null
) {
companion object {
@ -87,6 +98,8 @@ class DefaultJsApi(
private var mDownloadHandler: CompletionHandler<Any>? = null // 下载信息回调
private var mExposureEvent: ExposureEvent? = null // 活动曝光实体
private val handler = Handler(Looper.getMainLooper())
init {
if (mFragment != null) {
EventBus.getDefault().register(this)
@ -233,6 +246,12 @@ class DefaultJsApi(
VHelper.launch(context, packageName)
}
} else {
val wechatPkgName = "com.tencent.mm"
if (packageName == wechatPkgName && !PackageUtils.isInstalled(context, wechatPkgName)) {
// 如果是微信客户端,需要检查是否安装微信
ToastUtils.showToast(R.string.wechat_app_not_install_tips.toResString())
return@runOnUiThread
}
PackageLauncher.launchApp(context, packageName = packageName)
}
}
@ -495,6 +514,44 @@ class DefaultJsApi(
}
}
@JavascriptInterface
fun saveWechatQRCode(msg: Any) {
val base64StringData = msg.toString()
runOnUiThread {
(context as? FragmentActivity)?.checkStoragePermissionBeforeAction {
runOnIoThread {
val base64String = base64StringData.replace("data:image/png;base64", "")
tryWithDefaultCatch {
val imageFile =
File(HaloApp.getInstance().cacheDir.absolutePath + File.separator + System.currentTimeMillis() + ".png")
val decodedString = Base64.decode(base64String, Base64.DEFAULT)
val bos = BufferedOutputStream(FileOutputStream(imageFile))
bos.write(decodedString)
bos.flush()
bos.close()
ImageUtils.saveImageToFile(imageFile, "", true) {
// 这里是 ui 线程
// 保存微信二维码成功1s 以后跳转微信
if (mFragment != null && mFragment.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
handler.removeCallbacksAndMessages(null)
handler.postDelayed({
val wechatPkgName = "com.tencent.mm"
if (!PackageUtils.isInstalled(context, wechatPkgName)) {
ToastUtils.showToast(R.string.wechat_app_not_install_tips.toResString())
return@postDelayed
}
PackageLauncher.launchApp(context, packageName = wechatPkgName)
}, 1000)
}
}
}
}
}
}
}
@JavascriptInterface
fun loginWithCallback(msg: Any, handler: CompletionHandler<Any>) {
mLoginHandler = handler
@ -699,6 +756,78 @@ class DefaultJsApi(
}
}
@JavascriptInterface
fun preOrderWithAli(json: Any) {
val order = json.toString().toObject<OrderEntity>() ?: return
trackMemberPaymentButtonClick(order, PAYMENT_TYPE_ALIPAY)
listener?.onPreOrderWithAli(order)
}
@JavascriptInterface
fun preOrderWithWechat(json: Any) {
val order = json.toString().toObject<OrderEntity>() ?: return
trackMemberPaymentButtonClick(order, PAYMENT_TYPE_WECHAT)
listener?.onPreOrderWithWechat(order)
}
private fun trackMemberPaymentButtonClick(order: OrderEntity, paymentType: String) {
val isFirstTime = SPUtils.getBoolean(SP_MEMBER_PAYMENT_BUTTON_CLICK, true)
SPUtils.setBoolean(SP_MEMBER_PAYMENT_BUTTON_CLICK, false)
SensorsBridge.trackMemberPaymentButtonClick(
isFirstTime,
paymentType,
order.setMenuName,
order.paymentAmount
)
}
@JavascriptInterface
fun startGameAccelerate(acctJson: Any) {
if (acctJson is String) {
val acctRecord = GsonUtils.fromJson(acctJson, AcctRecordEntity::class.java)
val accInfo = acctRecord.accInfo
listener?.onStartGameAccelerate(accInfo)
}
}
@JavascriptInterface
fun getCurAcctGameId(): String {
return AcceleratorDataHolder.instance.getAcceleratingGameId()
}
@JavascriptInterface
fun stopGameAccelerate() {
listener?.onStopGameAccelerate()
}
@JavascriptInterface
fun refreshToken(token: Any, handler: CompletionHandler<Any>) {
val accessToken = token.toString()
UserManager.getInstance().refreshToken(accessToken, object : UserManager.refreshCallBack {
override fun onLogin() {
handler.complete(true)
}
override fun onLoginFailure(errorMessage: String?) {
handler.complete(false)
}
})
}
@JavascriptInterface
fun trackSensorsAnalytics(json: Any) {
val hashMap = json.toString().toObject<HashMap<String, Any>>() ?: return
val eventName = hashMap.remove(EVENT_NAME) ?: return
when (eventName) {
EVENT_MEMBER_RECHARGE_BUTTON_CLICK -> {
hashMap[KEY_IS_FIRST_TIME] = SPUtils.getBoolean(SP_MEMBER_RECHARGE_BUTTON_CLICK, true)
SPUtils.setBoolean(SP_MEMBER_RECHARGE_BUTTON_CLICK, false)
}
}
SensorsBridge.trackSensorsAnalyticsFromWeb(eventName.toString(), hashMap)
}
/**
* 获取 ExposureEvent可能为空
*/
@ -719,6 +848,8 @@ class DefaultJsApi(
}
EventBus.getDefault().unregister(this@DefaultJsApi)
handler.removeCallbacksAndMessages(null)
}
}
@ -815,4 +946,15 @@ class DefaultJsApi(
}
}
}
interface OnWebClickListener {
fun onPreOrderWithAli(order: OrderEntity)
fun onPreOrderWithWechat(order: OrderEntity)
fun onStartGameAccelerate(accInfo: AcctRecordEntity.AccInfo)
fun onStopGameAccelerate()
}
}

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

@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.PackageChangeHelper
import com.gh.common.util.TempCertificationUtils
import com.gh.gamecenter.feature.entity.GameEntity
@ -25,6 +26,10 @@ class LandPageAddressHandler : DownloadChainHandler() {
processEndCallback?.invoke(asVGame, null)
}
} else {
val packageName = gameEntity.getApk().firstOrNull()?.packageName
if (packageName?.isNotEmpty() == true) {
PackageChangeHelper.addInstallPendingPackage(packageName)
}
DirectUtils.directToExternalBrowser(context, gameEntity.landPageAddressDialog!!.link!!)
}
}

View File

@ -8,12 +8,21 @@ import com.gh.gamecenter.feature.entity.GameEntity
class PackageCheckHandler : DownloadChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity, asVGame: Boolean) {
PackageCheckDialogFragment.show((context as AppCompatActivity), gameEntity) {
fun nextOrProcessEnd() {
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity, asVGame)
} else {
processEndCallback?.invoke(asVGame, null)
}
}
if (gameEntity.canSpeed) {
nextOrProcessEnd()
} else {
PackageCheckDialogFragment.show((context as AppCompatActivity), gameEntity) {
nextOrProcessEnd()
}
}
}
}

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

@ -1,5 +1,10 @@
package com.gh.common.databind;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_SELLING_POINT;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_TEST;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_TYPE;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_UPDATE;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
@ -15,10 +20,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;
@ -48,6 +53,7 @@ import com.gh.download.server.BrowserInstallHelper;
import com.gh.gamecenter.DownloadManagerActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.WebActivity;
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.ExtensionsKt;
@ -55,6 +61,7 @@ import com.gh.gamecenter.common.utils.FileUtils;
import com.gh.gamecenter.common.utils.NewFlatLogUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.TimeUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
@ -201,7 +208,8 @@ public class BindingAdapters {
gameEntity,
traceEvent,
entrance,
location + ":" + gameEntity.getName());
location + ":" + gameEntity.getName(),
null);
return null;
});
final DownloadChainHandler chainHandler = builder.buildHandlerChain();
@ -246,7 +254,8 @@ public class BindingAdapters {
gameEntity,
traceEvent,
entrance,
location + ":" + gameEntity.getName());
location + ":" + gameEntity.getName(),
null);
}
break;
case INSTALL_PLUGIN:
@ -287,19 +296,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 +346,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);
@ -478,39 +479,37 @@ public class BindingAdapters {
}
}
// 包含测试开服标签
public static void setGameTags(LinearLayout layout, GameEntity gameEntity) {
/**
* 包含测试开服标签
*
* @param layout
* @param gameEntity
* @param subjectTag 默认为 “”只有游戏专题可以配置subjectTag
*/
public static void setGameTags(LinearLayout layout, GameEntity gameEntity, String subjectTag) {
try {
if (layout.getVisibility() == View.GONE) return;
ArrayList<TagStyleEntity> tagStyle = new ArrayList<>();
TestEntity test = gameEntity.getTest();
if (test != null
// 这个判断用于开测表列表
&& !"type_tag".equals(test.getGameTag())) {
if ("custom".equals(test.getGameTag())) {
TagStyleEntity typeTag = new TagStyleEntity();
if (!TextUtils.isEmpty(test.getText())) {
typeTag.setName(test.getText() != null ? test.getText() : "");
} else {
typeTag.setName(test.getType() != null ? test.getType() : "");
}
typeTag.setBackground("E8F3FF");
typeTag.setColor("1383EB");
tagStyle.add(typeTag);
} else {
TagStyleEntity typeTag = new TagStyleEntity();
boolean isDarkModeOn = DarkModeUtils.INSTANCE.isDarkModeOn(layout.getContext());
typeTag.setName(test.getType() != null ? test.getType() : "");
typeTag.setBackground("1AFFA142");
typeTag.setColor(isDarkModeOn ? "EB9238" : "FFA142");
tagStyle.add(typeTag);
if (test != null && subjectTag.equals(SUBJECT_TAG_TEST)) {
// 显示开测表标签
TagStyleEntity typeTag = new TagStyleEntity();
boolean isDarkModeOn = DarkModeUtils.INSTANCE.isDarkModeOn(layout.getContext());
typeTag.setName(test.getType() != null ? test.getType() : "");
typeTag.setBackground("1AFFA142");
typeTag.setColor(isDarkModeOn ? "EB9238" : "FFA142");
tagStyle.add(typeTag);
TagStyleEntity timeTag = new TagStyleEntity();
TagStyleEntity timeTag = new TagStyleEntity();
if (test.getStartPending()) {
timeTag.setName(test.getStartText());
} else {
timeTag.setName(GameViewUtils.getGameTestDate(test.getStart()));
timeTag.setBackground("1A06CEA8");
timeTag.setColor(isDarkModeOn ? "07A385" : "06CEA8");
tagStyle.add(timeTag);
}
timeTag.setBackground("1A06CEA8");
timeTag.setColor(isDarkModeOn ? "07A385" : "06CEA8");
tagStyle.add(timeTag);
} else {
tagStyle = gameEntity.getTagStyle();
}
@ -520,6 +519,59 @@ public class BindingAdapters {
}
}
public static void setGameTagsWithSellingPoint(LinearLayout layout, LayoutGameItemSellingPointBinding binding, GameEntity gameEntity, String subjectTag) {
if (subjectTag.equals(SUBJECT_TAG_SELLING_POINT)) {
layout.setVisibility(View.GONE);
binding.getRoot().setVisibility(View.VISIBLE);
GameEntity.SellingPoints sellingPoints = gameEntity.getSellingPoints();
if (sellingPoints != null) {
binding.tvSellingPoints.setVisibility(View.VISIBLE);
binding.tvSellingPoints.setText(sellingPoints.getText());
} else {
binding.tvSellingPoints.setVisibility(View.GONE);
}
Context context = layout.getContext();
binding.gtcvTags.removeAllViews();
ArrayList<TagStyleEntity> tagStyle = gameEntity.getTagStyle();
for (int i = 0; i < tagStyle.size(); i++) {
if (i < 3) {
TextView textView = new TextView(layout.getContext());
textView.setTextColor(ExtensionsKt.toColor(com.gh.gamecenter.common.R.color.text_tertiary, context));
textView.setTextSize(10);
textView.setText((i == 0 ? "" : "·") + tagStyle.get(i).getName());
binding.gtcvTags.addView(textView);
}
}
} else {
layout.setVisibility(View.VISIBLE);
binding.getRoot().setVisibility(View.GONE);
switch (subjectTag) {
case SUBJECT_TAG_UPDATE:
List<TagStyleEntity> updateTags = new ArrayList<>();
TagStyleEntity updateTag = new TagStyleEntity(
"local_generated",
TimeUtils.getFormatTime(gameEntity.getUpdateTime(), "MM-dd") + " 更新",
"",
"1383EB",
"E8F3FF",
"1383EB",
false
);
updateTags.add(updateTag);
GameViewUtils.setLabelList(layout.getContext(), layout, updateTags);
break;
case SUBJECT_TAG_TYPE:
GameViewUtils.setLabelList(layout.getContext(), layout, gameEntity.getTagStyle());
break;
default:
setGameTags(layout, gameEntity, subjectTag);
break;
}
}
}
public static void setVideoDetailGameTags(LinearLayout layout, GameEntity gameEntity) {
try {
ArrayList<TagStyleEntity> tagStyle = new ArrayList<>();

View File

@ -3,7 +3,6 @@ package com.gh.common.dialog
import android.animation.ValueAnimator
import android.content.Context
import android.content.DialogInterface
import android.content.pm.PackageInfo
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@ -19,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.DirectUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.PackageHelper
import com.gh.common.util.PackageUtils
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
@ -59,7 +57,6 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
private val mDuration = 3000
private var mDisposable: Disposable? = null
private var mAdapter: PackageCheckAdapter? = null
private var mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
var gameEntity: GameEntity? = null
var callBack: ConfirmListener? = null
@ -195,7 +192,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
if (binding.noRemindAgainCb.isChecked) {
saveRecord(entity)
}
val isAllPackageInstalled = isAllPackageInstalled(mAllInstalledPackages, entity)
val isAllPackageInstalled = isAllPackageInstalled(entity)
if (isAllPackageInstalled) {
mDismissByTouchInside = true
callBack?.onConfirm()
@ -299,7 +296,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
private fun getNotInstalledLink(packageDialogEntity: PackageDialogEntity): LinkEntity? {
val links = LinkedHashSet<LinkEntity>()
packageDialogEntity.detectionObjects.forEach { obj ->
if (!checkDetectionsInstalled(mAllInstalledPackages, obj.packages)) {
if (!checkDetectionsInstalled(obj.packages)) {
obj.assignDownload.forEach {
links.add(packageDialogEntity.links[it])
}
@ -325,9 +322,8 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
override fun onResume() {
super.onResume()
mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
gameEntity?.packageDialog?.let {
if (isAllPackageInstalled(mAllInstalledPackages, it)) {
if (isAllPackageInstalled(it)) {
callBack?.onConfirm()
dismissAllowingStateLoss()
}
@ -363,7 +359,6 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(busFour: EBPackage) {
if (busFour.isInstalledOrUninstalled()) {
mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
mAdapter?.notifyDataSetChanged()
}
}
@ -388,7 +383,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
val entity = entities[position]
holder.binding.gameNameTv.text = entity.text
if (position <= index) {
val isAllInstalled = checkDetectionsInstalled(mAllInstalledPackages, entity.packages)
val isAllInstalled = checkDetectionsInstalled(entity.packages)
if (isAllInstalled) {
holder.binding.statusTv.text = "已安装"
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.text_theme))
@ -416,8 +411,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
return
}
val allInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
if (isAllPackageInstalled(allInstalledPackages, packageDialogEntity)) {
if (isAllPackageInstalled(packageDialogEntity)) {
callBack.onConfirm()
return
}
@ -453,13 +447,11 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
}
private fun checkDetectionsInstalled(
allInstalledPackages: List<String>,
packages: ArrayList<String>
): Boolean {
var isPackagesInstalled = false
packages.forEach { packageName ->
val isInstalled = allInstalledPackages.find { it == packageName } != null
if (isInstalled) {
if (PackageUtils.isInstalledFromAllPackage(HaloApp.getInstance(), packageName)) {
isPackagesInstalled = true
return@forEach
}
@ -469,17 +461,14 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
fun isAllPackageInstalled(
allInstalledPackages: List<String>,
packageDialogEntity: PackageDialogEntity
): Boolean {
var isAllInstalled = true
packageDialogEntity.detectionObjects.forEach loop@{ obj ->
if (!checkDetectionsInstalled(allInstalledPackages, obj.packages)) {
isAllInstalled = false
return isAllInstalled
if (!checkDetectionsInstalled(obj.packages)) {
return false
}
}
return isAllInstalled
return true
}
}
}

View File

@ -16,6 +16,7 @@ import com.gh.common.pop.EditBindWechatPop
import com.gh.common.pop.RealNameTipsPop
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toObject
@ -83,79 +84,90 @@ class ReserveSuccessReminderDialog(
handlers.clear()
binding.flContentContainer.removeAllViews()
val smsConfig = reserveReminder.smsConfig
val wechatConfig = reserveReminder.wechatConfig
when {
reserveReminder.onlyShowWechatReminder && !wechatConfig.isReminderEnable -> { // 只显示微信:未开启
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
arrayListOf(OnlyWechatReminderUnableHandler(16.dp, binding.flContentContainer, this))
val configTypes = mutableListOf<Int>()
// 短信
if (reserveReminder.hasSmsConfig) {
if (reserveReminder.smsConfig.notice) {
configTypes.add(SMS_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(SMS_REMINDER_UNABLE_TYPE)
}
reserveReminder.onlyShowWechatReminder && wechatConfig.isReminderEnable -> { // 只显示微信:已开
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
WechatReminderEnableHandler(
reserveReminder.wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
)
)
}
!smsConfig.notice && !wechatConfig.isReminderEnable -> { // 短信,微信未开启
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
arrayListOf(
SmsReminderUnableHandler(16.dp, binding.flContentContainer, this),
WechatReminderUnableHandler(8.dp, binding.flContentContainer, this)
)
}
smsConfig.notice && wechatConfig.isReminderEnable -> {// 短信,微信已开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
SmsReminderEnableHandler(reserveReminder.smsConfig, 8.dp, binding.flContentContainer, this),
WechatReminderEnableHandler(
reserveReminder.wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
)
)
}
smsConfig.notice && !wechatConfig.isReminderEnable -> { // 短信开启,微信未开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
SmsReminderEnableHandler(smsConfig, 8.dp, binding.flContentContainer, this),
WechatReminderUnableHandler(16.dp, binding.flContentContainer, this)
)
}
!smsConfig.notice && wechatConfig.isReminderEnable -> { // 微信开启,短信未开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
WechatReminderEnableHandler(
wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
),
SmsReminderUnableHandler(16.dp, binding.flContentContainer, this)
)
}
else -> {
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
arrayListOf()
}
}.let {
handlers.clear()
handlers.addAll(it)
}
// 微信
if (reserveReminder.wechatConfig.isReminderEnable) {
configTypes.add(WECHAT_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(WECHAT_REMINDER_UNABLE_TYPE)
}
// 日历
if (reserveReminder.hasCalendarConfig) {
if (reserveReminder.calendarConfig.notice) {
configTypes.add(CALENDAR_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(CALENDAR_REMINDER_UNABLE_TYPE)
}
}
if (configTypes.size == 1) {
// 只有微信提醒
if (configTypes.first() == WECHAT_REMINDER_ENABLE_TYPE) {
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
handlers.add(
WechatReminderEnableHandler(reserveReminder.wechatConfig, 8.dp, binding.flContentContainer, this)
)
} else {
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
handlers.add(OnlyWechatReminderUnableHandler(16.dp, binding.flContentContainer, this))
}
} else {
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
var isLargerSpacing = true
fun getPaddingTop(): Int {
val paddingTop = if (isLargerSpacing) 16.dp else 8.dp
isLargerSpacing = false
return paddingTop
}
configTypes.sorted().forEach {
when (it) {
SMS_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
SmsReminderEnableHandler(reserveReminder.smsConfig, 8.dp, binding.flContentContainer, this)
}
SMS_REMINDER_UNABLE_TYPE -> {
SmsReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
}
WECHAT_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
WechatReminderEnableHandler(
reserveReminder.wechatConfig,
8.dp,
binding.flContentContainer,
this
)
}
WECHAT_REMINDER_UNABLE_TYPE ->
WechatReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
CALENDAR_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
CalendarReminderEnableHandler(8.dp, binding.flContentContainer, this)
}
CALENDAR_REMINDER_UNABLE_TYPE ->
CalendarReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
else -> null
}?.let(handlers::add)
}
}
handlers.forEach {
binding.flContentContainer.addView(it.init())
}
@ -220,9 +232,14 @@ class ReserveSuccessReminderDialog(
listener.changeWechatBinding()
}
override fun updateCalendarReminder() {
listener.updateCalendarReminder()
}
override fun onStart() {
super.onStart()
window?.let {
it.setDimAmount(0.4F)
it.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
val params = it.attributes
params.width = DisplayUtils.dip2px(300F)
@ -244,6 +261,13 @@ class ReserveSuccessReminderDialog(
private val Int.dp: Int
get() = DisplayUtils.dip2px(this.toFloat())
private const val SMS_REMINDER_ENABLE_TYPE = 1
private const val WECHAT_REMINDER_ENABLE_TYPE = 2
private const val CALENDAR_REMINDER_ENABLE_TYPE = 3
private const val SMS_REMINDER_UNABLE_TYPE = 4
private const val WECHAT_REMINDER_UNABLE_TYPE = 5
private const val CALENDAR_REMINDER_UNABLE_TYPE = 6
fun create(context: Context, listener: OnReserveReminderListener) =
ReserveSuccessReminderDialog(
context,
@ -360,7 +384,7 @@ class ReserveSuccessReminderDialog(
}
class WechatReminderEnableHandler(
private val nickName: String,
private val wechatConfig: WechatConfigEntity,
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
@ -380,7 +404,7 @@ class ReserveSuccessReminderDialog(
}.root
override fun initView() {
binding.tvWechat.text = nickName
binding.tvWechat.text = wechatConfig.nickName
binding.vModifyWechat.setOnClickListener {
editWechatPop.showAsDropDown(
binding.ivModifyWechat,
@ -411,6 +435,51 @@ class ReserveSuccessReminderDialog(
}
class CalendarReminderUnableHandler(
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
) : ReminderContentHandler(topMargin, parent, listener) {
private lateinit var binding: LayoutReserveWechatReminderUnableBinding
// 复用微信提醒未开启状态布局
override fun createView(inflater: LayoutInflater) =
LayoutReserveWechatReminderUnableBinding.inflate(inflater, parent, false)
.also {
binding = it
}.root
override fun initView() {
binding.tvWechatReminderTitle.setText(R.string.calendar_reminders)
binding.tvWechatReminderDescription.setText(R.string.calendar_reminders_description)
binding.vWechatAdd.setOnClickListener {
listener.updateCalendarReminder()
}
}
}
class CalendarReminderEnableHandler(
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
) : ReminderContentHandler(topMargin, parent, listener) {
private lateinit var binding: LayoutReserveCalendarReminderUnableBinding
override fun createView(inflater: LayoutInflater) =
LayoutReserveCalendarReminderUnableBinding.inflate(inflater, parent, false)
.also {
binding = it
}.root
override fun initView() {
}
}
}
@ -425,4 +494,6 @@ interface OnReserveSuccessListener {
fun verifyPhoneNumber()
fun changeWechatBinding()
fun updateCalendarReminder()
}

View File

@ -17,7 +17,7 @@ import com.gh.gamecenter.common.entity.ErrorEntity
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.databinding.DialogWechatBindingFailedBinding
import com.gh.gamecenter.login.user.UserRepository
import com.gh.gamecenter.login.user.UserManager
import com.lightgame.utils.Utils
class WechatBindingFailedDialogFragment : BaseDialogFragment() {
@ -48,10 +48,10 @@ class WechatBindingFailedDialogFragment : BaseDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
UserRepository.getInstance().loginUserInfo.observe(viewLifecycleOwner) {
currentUserId = it.data.getShortUserId()
binding.tvCurrentName.text = it.data.name
binding.ivCurrentAvatar.displayAvatar(it.data.icon)
UserManager.getInstance().userInfoEntity?.let {
currentUserId = it.getShortUserId()
binding.tvCurrentName.text = it.name ?: ""
binding.ivCurrentAvatar.displayAvatar(it.icon)
binding.tvUserId.text = getString(R.string.user_id, currentUserId)
}

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

@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.common.utils.debounceActionWithInterval
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
@ -123,10 +124,16 @@ object RegionSettingHelper {
mIsInit = false
}
val fakeIp = if (PackageFlavorHelper.IS_TEST_FLAVOR) {
SPUtils.getString(Constants.SP_TEST_FLAVOR_IP)
} else {
""
}
// 使用默认的 Schdulers.io() 可能会触发 OOM
RetrofitManager.getInstance()
.api
.getRegionSetting(HaloApp.getInstance().channel)
.getRegionSetting(HaloApp.getInstance().channel, fakeIp)
.subscribeOn(Schedulers.io())
.subscribe(object : BiResponse<RegionSetting>() {
override fun onSuccess(data: RegionSetting) {

View File

@ -0,0 +1,45 @@
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)
}
}
fun FragmentManager.popBackStackAllowStateLoss(name: String?, flags: Int) {
if (!isStateSaved) {
popBackStack(name, flags)
}
}
fun FragmentManager.popBackStackImmediateAllowStateLoss() = popBackStackAllowStateLoss(-1, 0)
fun FragmentManager.popBackStackImmediateAllowStateLoss(id: Int, flags: Int) =
if (!isStateSaved) {
popBackStackImmediate(id, flags)
} else {
false
}
@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

@ -7,19 +7,20 @@ import androidx.room.TypeConverters
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import com.gh.gamecenter.entity.GamesCollectionEntity
import com.gh.gamecenter.entity.HistoryGameDetailEntity
import com.gh.gamecenter.entity.HistoryGameEntity
import com.gh.gamecenter.entity.MyVideoEntity
import com.gh.gamecenter.feature.entity.NewsEntity
import com.gh.gamecenter.feature.entity.AnswerEntity
import com.gh.gamecenter.feature.entity.ArticleEntity
import com.gh.gamecenter.feature.entity.NewsEntity
import com.gh.gamecenter.feature.room.converter.*
import com.gh.gamecenter.room.converter.*
import com.gh.gamecenter.room.dao.*
import com.halo.assistant.HaloApp
@Database(
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class],
version = 14,
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class, HistoryGameDetailEntity::class],
version = 15,
exportSchema = false
)
@TypeConverters(
@ -53,6 +54,7 @@ abstract class HistoryDatabase : RoomDatabase() {
abstract fun gameDao(): GameDao
abstract fun videoHistoryDao(): VideoHistoryDao
abstract fun gamesCollectionDao(): GamesCollectionDao
abstract fun gameDetailDao(): GameDetailHistoryDao
companion object {
@ -152,6 +154,12 @@ abstract class HistoryDatabase : RoomDatabase() {
}
}
val MIGRATION_14_15: Migration = object : Migration(14, 15) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE HistoryGameDetailEntity (id TEXT NOT NULL PRIMARY KEY, name TEXT DEFAULT '')")
}
}
val instance by lazy {
Room.databaseBuilder(
HaloApp.getInstance().application,
@ -170,6 +178,7 @@ abstract class HistoryDatabase : RoomDatabase() {
.addMigrations(MIGRATION_11_12)
.addMigrations(MIGRATION_12_13)
.addMigrations(MIGRATION_13_14)
.addMigrations(MIGRATION_14_15)
.build()
}
}

View File

@ -44,6 +44,20 @@ object HistoryHelper {
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) } }
}
@JvmStatic
fun insertGameDetail(gameEntity: GameEntity) {
val historyGameDetailEntity = HistoryGameDetailEntity(gameEntity.id, gameEntity.name)
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDetailDao().addGame(historyGameDetailEntity) } }
}
@JvmStatic
fun getHistoryGameDetailById(id: String): HistoryGameDetailEntity? =
try {
HistoryDatabase.instance.gameDetailDao().getHistoryGameDetailById(id)
} catch (e: Throwable) {
null
}
private fun convertGameUpdateEntityToHistoryGameEntity(updateEntity: GameUpdateEntity): HistoryGameEntity {
val historyGame = HistoryGameEntity()
@ -142,6 +156,15 @@ object HistoryHelper {
}
}
@JvmStatic
fun deleteGameDetailEntity(gameId: String) {
runOnIoThread {
tryCatchInRelease {
HistoryDatabase.instance.gameDetailDao().deleteGame(HistoryGameDetailEntity(id = gameId))
}
}
}
@JvmStatic
fun emptyDatabase() {

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

@ -0,0 +1,29 @@
package com.gh.common.interceptor
import com.gh.gamecenter.common.constant.RouteConsts
import com.halo.assistant.HaloApp
import com.therouter.router.RouteItem
import com.therouter.router.interceptor.RouterReplaceInterceptor
import com.therouter.router.matchRouteMap
/**
* 主拦截器
*/
class MainInterceptor: RouterReplaceInterceptor() {
override fun replace(routeItem: RouteItem?): RouteItem? {
if (routeItem == null) return null
// 用户是否已经同意隐私政策
val isUserAcceptPrivacyPolicy = HaloApp.isUserAcceptPrivacyPolicy(HaloApp.getInstance())
// 如果用户已经同意隐私政策并且应用已经启动,直接返回 routeItem ,运行跳转
if (isUserAcceptPrivacyPolicy && HaloApp.getInstance().isAlreadyUpAndRunning) {
return routeItem
}
// 指向调整为 SplashScreenActivity
return matchRouteMap(RouteConsts.activity.splashActivity)
}
}

View File

@ -4,8 +4,10 @@ import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
import com.gh.gamecenter.home.custom.adapter.CustomViewExt
@com.therouter.inject.ServiceProvider
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
@ -18,7 +20,7 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
}
override fun setGameTags(layout: LinearLayout, gameEntity: GameEntity) {
BindingAdapters.setGameTags(layout, gameEntity)
BindingAdapters.setGameTags(layout, gameEntity, "")
}
override fun setMessageUnread(view: TextView, unreadCount: Int) {
@ -28,4 +30,17 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGame(view: View, gameEntity: GameEntity) {
BindingAdapters.setGame(view, gameEntity)
}
override fun setGameTagsWithSellingPoints(
layout: LinearLayout,
sellingPointsBinding: LayoutGameItemSellingPointBinding,
gameEntity: GameEntity,
subjectTag: String
) {
BindingAdapters.setGameTagsWithSellingPoint(layout, sellingPointsBinding, gameEntity, subjectTag)
}
override fun setGameDescription(tvDesc: TextView, briefStyle: String, game: GameEntity) {
CustomViewExt.setDescription(tvDesc, briefStyle, game)
}
}

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

@ -2,6 +2,8 @@ package com.gh.common.provider
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.entity.GameUpdateEntity
@ -11,6 +13,7 @@ import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IDownloadButtonClickedProvider
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.packagehelper.PackageRepository
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
@ -27,6 +30,9 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
var packageName = ""
var exposureSourceList: List<ExposureSource>? = null
var customPageTrackData: CustomPageTrackData? = null
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
val boundedObject = downloadButton.getObject()
@ -112,6 +118,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(
@ -121,7 +133,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,
@ -130,6 +142,9 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
"last_page_name", GlobalActivityManager.getLastPageEntity().pageName,
"last_page_id", GlobalActivityManager.getLastPageEntity().pageId,
"last_page_business_id", GlobalActivityManager.getLastPageEntity().pageBusinessId,
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
*customPageKV
)
}

View File

@ -2,18 +2,16 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
import com.gh.gamecenter.gamecollection.detail.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 getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String, entrance: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId, entrance)
}
}

View File

@ -0,0 +1,26 @@
package com.gh.common.provider
import com.gh.gamecenter.core.provider.IAcceleratorDataHolderProvider
import com.gh.gamecenter.feature.entity.VipEntity
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder
@com.therouter.inject.ServiceProvider
class IAcceleratorDataHolderProviderImpl : IAcceleratorDataHolderProvider {
override fun setVipEntity(vip: Any) {
if (vip is VipEntity) {
AcceleratorDataHolder.instance.setVipEntity(vip)
}
}
override fun addInitFunResult(result: String) {
AcceleratorDataHolder.instance.addInitFunResult(result)
}
override fun getInitFunResults(): List<String> {
return AcceleratorDataHolder.instance.initResults
}
override fun clear() {
AcceleratorDataHolder.instance.clear()
}
}

View File

@ -7,9 +7,6 @@ import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
@com.therouter.inject.ServiceProvider
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
}
override fun getMirrorPosition(gameId: String): Int {
return RegionSettingHelper.getMirrorPosition(gameId)

View File

@ -0,0 +1,54 @@
package com.gh.common.provider
import android.annotation.SuppressLint
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.core.provider.IWechatPayResultProvider
import com.gh.gamecenter.feature.entity.OrderEntity
import com.gh.gamecenter.feature.entity.VipEntity
import com.gh.gamecenter.feature.eventbus.EBPayState
import com.halo.assistant.accelerator.repository.AccelerationRepository
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder
import org.greenrobot.eventbus.EventBus
@com.therouter.inject.ServiceProvider
class WechatPayResultProviderImpl : IWechatPayResultProvider {
private val repository = AccelerationRepository.newInstance()
@SuppressLint("CheckResult")
override fun onPayComplete(nonceStr: String, order: Any?) {
val orderEntity = order as? OrderEntity
repository.getWechatPayResult(nonceStr)
.compose(singleToMain())
.subscribe({
// 支付成功
EventBus.getDefault().post(EBPayState.PaySuccess)
// 先刷新本地状态,支付成功,肯定是付费会员
AcceleratorDataHolder.instance.setVipEntity(
VipEntity(
_vipStatus = true,
_isNewUser = false,
_isTryVip = false
)
)
SensorsBridge.trackMemberRechargeResult(
AccelerationRepository.PAYMENT_TYPE_WECHAT,
orderEntity?.setMenuName ?: "",
orderEntity?.paymentAmount ?: "",
AccelerationRepository.RECHARGE_RESULT_SUCCESS
)
}, {
// 支付失败
EventBus.getDefault().post(EBPayState.PayFail)
SensorsBridge.trackMemberRechargeResult(
AccelerationRepository.PAYMENT_TYPE_WECHAT,
orderEntity?.setMenuName ?: "",
orderEntity?.paymentAmount ?: "",
AccelerationRepository.RECHARGE_RESULT_FAILURE
)
})
}
}

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

@ -2,6 +2,7 @@ package com.gh.common.util
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
@ -12,15 +13,18 @@ import okhttp3.ResponseBody
object ActivationHelper {
private const val HAS_SENT_ACTIVATED_INFO = "has_sent_activated_info"
private const val SENT_ACTIVATED_INFO_TIME = "sent_activated_info_time"
private const val HAS_SENT_RETENTION_INFO = "has_sent_retention_info"
var mHasSentActivatedInfo = SPUtils.getBoolean(HAS_SENT_ACTIVATED_INFO, false)
private var hasSentActivatedInfo = SPUtils.getBoolean(HAS_SENT_ACTIVATED_INFO, false)
private var hasSentRetentionInfo = SPUtils.getBoolean(HAS_SENT_RETENTION_INFO, false)
/**
* 发送激活信息 (用于推广)
*/
@JvmStatic
fun sendActivationInfo() {
if (!mHasSentActivatedInfo) {
if (!hasSentActivatedInfo) {
RetrofitManager.getInstance()
.api.postActivationInfo()
.subscribeOn(Schedulers.io())
@ -28,8 +32,36 @@ object ActivationHelper {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
mHasSentActivatedInfo = true
hasSentActivatedInfo = true
SPUtils.setBoolean(HAS_SENT_ACTIVATED_INFO, true)
SPUtils.setLong(SENT_ACTIVATED_INFO_TIME, System.currentTimeMillis())
}
})
}
}
/**
* 发送次日留存信息 (用于推广)
*/
@JvmStatic
fun sendRetentionInfo() {
if (hasSentActivatedInfo && !hasSentRetentionInfo) {
val activateTimeMillis = SPUtils.getLong(SENT_ACTIVATED_INFO_TIME, 0)
val currentTimeMillis = System.currentTimeMillis()
if (!TimeUtils.isNextDay(activateTimeMillis, currentTimeMillis)) {
return
}
RetrofitManager.getInstance()
.api.postRetentionInfo()
.subscribeOn(Schedulers.io())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
hasSentRetentionInfo = true
SPUtils.setBoolean(HAS_SENT_RETENTION_INFO, true)
}
})
}

View File

@ -13,9 +13,9 @@ 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 +39,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");
}
@ -65,7 +70,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 +93,8 @@ public class DataUtils {
}
private static void onGidReceived(String gid) {
bindValidOaidToSensor(false);
HaloApp.getInstance().setGid(gid);
// 更新广告配置
AdDelegateHelper.INSTANCE.requestAdConfig(false, "", null);
@ -105,15 +111,44 @@ public class DataUtils {
try {
HaloApp.getInstance().getContentResolver().insert(Uri.parse("content://com.gh.gamecenter.provider/device"), values);
} catch (Exception exception) {
SentryHelper.INSTANCE.onEvent("DEVICE_INSERT_ERROR", "exception_digest", exception.getLocalizedMessage());
exception.printStackTrace();
}
});
}
/**
* 为神策绑定有效的 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 绑定的实名信息
*/
// TODO 这个方法启动时会被调用多次,后面考虑优化优化
@SuppressLint("CheckResult")
public static void getDeviceCertification(String gid) {
RetrofitManager.getInstance()
@ -160,7 +195,6 @@ public class DataUtils {
// TODO 将 com.gh.gamecenter 改成 BuildConfig.ApplicationID
HaloApp.getInstance().getContentResolver().insert(Uri.parse("content://com.gh.gamecenter.provider/certification"), values);
} catch (Exception exception) {
SentryHelper.INSTANCE.onEvent("CERTIFICATION_INSERT_ERROR", "exception_digest", exception.getLocalizedMessage());
exception.printStackTrace();
}
}

View File

@ -41,7 +41,8 @@ public class DetailDownloadUtils {
/**
* 更新底部下载区域
* @param viewHolder 下载区域的包裹
*
* @param viewHolder 下载区域的包裹
* @param ignoreDownloadEntity 忽略下载实体(往往用于下载异常时)
*/
public static void updateViewHolder(DetailViewHolder viewHolder, boolean ignoreDownloadEntity) {
@ -53,6 +54,8 @@ public class DetailDownloadUtils {
viewHolder.getMultiVersionDownloadTv().setVisibility(View.GONE);
}
viewHolder.setSpeedViewsVisible(false);
// 根据预置的配置更新 ViewHolder 的状态 (譬如青少年模式、下载内容为空等)
if (updateViewHolderWithPredefinedConfig(viewHolder, gameEntity)) {
return;
@ -135,10 +138,17 @@ public class DetailDownloadUtils {
showDualDownloadButton,
downloadEntity
);
if(!showVGame){
String rawBtnText = GameUtils.getDownloadBtnText(viewHolder.getContext(), gameEntity, false, showVGame, PluginLocation.only_game);
viewHolder.checkIfShowSpeedUi(rawBtnText);
}
} else {
// 游戏包含多 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);
@ -218,7 +228,7 @@ public class DetailDownloadUtils {
downloadButton.setText("");
}
} else {
decoratedBtnText = rawBtnText + (containsAddWord? "" : downloadAddWord) + getWrappedDownloadSizeText(viewHolder);
decoratedBtnText = rawBtnText + (containsAddWord ? "" : downloadAddWord) + getWrappedDownloadSizeText(viewHolder);
if (overlayTv != null && downloadButton.getVisibility() != View.GONE) {
if (context.getString(com.gh.gamecenter.feature.R.string.launch).equals(rawBtnText)
@ -260,7 +270,7 @@ public class DetailDownloadUtils {
viewHolder.getLocalDownloadSizeTv().setVisibility(View.GONE);
String size = viewHolder.getGameEntity().getApk().isEmpty() ? "" : viewHolder.getGameEntity().getApk().get(0).getSize();
if (size != null) {
String sizeWithoutDigit = size.replaceAll("(?<=\\d)\\.[0-9]+(?!\\d)", "");
String sizeWithoutDigit = convertSizeString(size);
viewHolder.getLocalDownloadSizeTv().setText(sizeWithoutDigit);
}
@ -457,7 +467,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())) {
@ -600,6 +610,30 @@ public class DetailDownloadUtils {
return (int) Math.ceil(downloadEntity.getPercent());
}
private static String convertSizeString(String sizeString) {
String numberPart;
String indicator;
// Check if the string ends with "MB"
if (sizeString.endsWith("MB")) {
numberPart = sizeString.substring(0, sizeString.length() - 2);
indicator = "MB";
} else if (sizeString.endsWith("G")) {
numberPart = sizeString.substring(0, sizeString.length() - 1);
indicator = "G";
} else {
return sizeString;
}
// Round number
double number = Double.parseDouble(numberPart);
long roundedNumber = Math.round(number);
// Combine rounded number and size indicator
return roundedNumber + indicator;
}
private static boolean handleDownloadButtonAsXapk(DownloadEntity downloadEntity, DownloadButton downloadButton) {
String xapkStatus = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_STATUS);

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.therouter.TheRouter
import com.gh.ad.AdPluginDownloadHelper
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureManager.log
@ -19,6 +18,7 @@ import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.common.util.EntranceUtils.jumpActivity
import com.gh.common.util.EntranceUtils.jumpActivityCompat
import com.gh.gamecenter.*
import com.gh.gamecenter.ShellActivity.Type
import com.gh.gamecenter.amway.AmwayActivity
import com.gh.gamecenter.category2.CategoryV2Activity
import com.gh.gamecenter.common.base.activity.BaseActivity
@ -56,8 +56,8 @@ 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.entity.GameDetailTabEntity
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
@ -77,7 +77,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
@ -98,6 +97,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
@ -178,7 +178,25 @@ 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",
"archive",
"my_assets",
)
fun directToLinkPage(
@ -383,8 +401,8 @@ object DirectUtils {
}
}
"authentication" -> {
context.startActivity(ShellActivity.getIntent(context, ShellActivity.Type.REAL_NAME_INFO, null))
"authentication", "certification" -> {
directToRealName(context)
}
"user_background" -> {
@ -442,7 +460,7 @@ object DirectUtils {
} ?: ""
}
"halo_tab" -> directToHomeMyHaloTab(context)
"my_halo", "halo_tab" -> directToHomeMyHaloTab(context)
"common_collection" -> directToCommonCollectionDetail(
context,
@ -524,7 +542,8 @@ object DirectUtils {
ToolbarWrapperActivity.getMultiTabNavIntent(
context,
linkEntity.link ?: "",
linkEntity.text ?: ""
linkEntity.text ?: "",
entrance
)
)
@ -532,16 +551,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)
@ -568,6 +591,36 @@ 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)
"archive" -> directToCloudArchive(context, linkEntity.link ?: "", linkEntity.text ?: "", "", entrance)
"my_assets" -> navigateToMyAssetsPage(context, entrance)
"" -> {
// do nothing
}
@ -801,33 +854,42 @@ object DirectUtils {
entrance: String? = null,
autoDownload: Boolean? = null,
tab: String? = "",
traceEvent: ExposureEvent? = null
traceEvent: ExposureEvent? = null,
from: String? = null
) {
if (id.isEmpty()) return
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, GameDetailActivity::class.java.simpleName)
bundle.putString(KEY_GAMEID, id)
if (!TextUtils.isEmpty(tab)) {
when (tab) {
"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)
val uri = Uri.Builder()
.path(RouteConsts.activity.gameDetailActivity)
.appendQueryParameter(KEY_ENTRANCE, entrance)
.appendQueryParameter(KEY_GAME_ID, id)
.appendQueryParameter(KEY_FROM, from)
.build()
TheRouter
.build(uri.toString())
.fillParams { bundle ->
if (!TextUtils.isEmpty(tab)) {
when (tab) {
"comment" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_COMMENT)
"desc" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
"forum" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_BBS)
"zone" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_ZONE)
}
}
if (traceEvent != null) {
val clickEvent = createEvent(
GameEntity(id = id, name = name),
traceEvent.source,
appendTrace(traceEvent),
ExposureType.CLICK
)
log(clickEvent)
bundle.putParcelable(KEY_TRACE_EVENT, clickEvent)
}
bundle.putBoolean(KEY_AUTO_DOWNLOAD, autoDownload ?: false)
}
}
if (traceEvent != null) {
val clickEvent = createEvent(
GameEntity(id = id, name = name),
traceEvent.source,
appendTrace(traceEvent),
ExposureType.CLICK
)
log(clickEvent)
bundle.putParcelable(KEY_TRACE_EVENT, clickEvent)
}
bundle.putBoolean(KEY_AUTO_DOWNLOAD, autoDownload ?: false)
jumpActivity(context, bundle)
.navigation(context)
}
/**
@ -858,7 +920,7 @@ object DirectUtils {
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, id)
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
jumpActivity(context, bundle)
}
@ -866,15 +928,21 @@ object DirectUtils {
fun directToGameDetail(
context: Context,
id: String,
defaultTab: String = EntranceConsts.TAB_TYPE_DESC,
defaultTab: String = GameDetailTabEntity.TYPE_DETAIL,
entrance: String? = null
) {
val bundle = Bundle()
bundle.putString(KEY_TO, GameDetailActivity::class.java.name)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putString(KEY_GAMEID, id)
bundle.putString(KEY_TARGET, defaultTab)
jumpActivity(context, bundle)
val uri = Uri.Builder()
.path(RouteConsts.activity.gameDetailActivity)
.appendQueryParameter(KEY_ENTRANCE, entrance)
.appendQueryParameter(KEY_GAME_ID, id)
.build()
TheRouter
.build(uri.toString())
.fillParams { bundle ->
bundle.putString(KEY_TARGET, defaultTab)
}
.navigation(context)
}
// 专栏
@ -1524,7 +1592,7 @@ object DirectUtils {
response?.apply {
if (zone.status == "on") {
if (zone.style == "link") {
directToGameDetail(context, gameId, EntranceConsts.TAB_TYPE_TRENDS, entrance)
directToGameDetail(context, gameId, GameDetailTabEntity.TYPE_ZONE, entrance)
} else {
directToWebView(context, url, entrance)
}
@ -1637,7 +1705,7 @@ object DirectUtils {
fun directToHelpAndFeedback(context: Context, bundle: Bundle? = null) {
TheRouter.build(RouteConsts.activity.helpAndFeedbackActivity)
.fillParams {
it.putAll(bundle)
bundle?.run { it.putAll(this) }
}
.navigation(context)
}
@ -2083,13 +2151,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(
@ -2149,4 +2221,128 @@ 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()
}
// 跳转云存档详情页
@JvmStatic
fun directToCloudArchive(
context: Context,
gameId: String,
gameName: String,
configUrl: String = "",
entrance: String = ""
) {
val bundle = Bundle()
val gameEntity = GameEntity(id = gameId, name = gameName)
bundle.putParcelable(KEY_GAME_ENTITY, gameEntity)
bundle.putString(KEY_ARCHIVE_CONFIG_URL, configUrl)
bundle.putString(KEY_ENTRANCE, entrance)
bundle.putBoolean(KEY_USE_ALTERNATIVE_LAYOUT, true)
context.startActivity(ShellActivity.getIntent(context, Type.CLOUD_ARCHIVE, bundle))
}
@JvmStatic
fun navigateToMyAssetsPage(context: Context, entrance: String?) {
if (CheckLoginUtils.isLogin()) {
TheRouter.build(RouteConsts.activity.myAssetsActivity).navigation(context)
} else {
CheckLoginUtils.checkLogin(context, entrance, null)
}
}
}

View File

@ -176,7 +176,8 @@ object DownloadItemUtils {
pluginLocation: PluginLocation? = PluginLocation.only_game,
hideDownloadBtnIfNoAvailableContent: Boolean = false,
briefStyle: String? = null,
isShowRecommendStar: Boolean = false
isShowRecommendStar: Boolean = false,
listener: DownloadButton.OnUpdateListener? = null
) {
holder.gameDownloadBtn.putObject(gameEntity)
@ -189,7 +190,8 @@ object DownloadItemUtils {
holder.gameDownloadBtn,
gameEntity,
hideDownloadBtnIfNoAvailableContent,
pluginLocation
pluginLocation,
listener
)
return
}
@ -210,7 +212,8 @@ object DownloadItemUtils {
holder.gameDownloadBtn,
gameEntity,
hideDownloadBtnIfNoAvailableContent,
pluginLocation
pluginLocation,
listener
)
}
@ -219,7 +222,8 @@ object DownloadItemUtils {
downloadBtn: DownloadButton,
gameEntity: GameEntity,
hideDownloadBtnIfNoAvailableContent: Boolean = false,
pluginLocation: PluginLocation? = PluginLocation.only_game
pluginLocation: PluginLocation? = PluginLocation.only_game,
listener: DownloadButton.OnUpdateListener?
) {
// 控制是否显示下载按钮
downloadBtn.goneIf(context.getString(R.string.app_name) == gameEntity.name)
@ -227,6 +231,7 @@ object DownloadItemUtils {
if (SPUtils.getBoolean(Constants.SP_TEENAGER_MODE) || gameEntity.isSpecialDownload()) {
downloadBtn.text = "查看"
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.TEENAGER_MODE
listener?.completion(downloadBtn.text)
return
}
if (gameEntity.isReservable) {
@ -239,6 +244,7 @@ object DownloadItemUtils {
buttonStyle = DownloadButton.ButtonStyle.RESERVED
}
}
listener?.completion(downloadBtn.text)
return
}
if (RegionSettingHelper.getGameH5DownloadByGameId(gameEntity.id) != null) {
@ -248,6 +254,7 @@ object DownloadItemUtils {
setBackgroundResource(com.gh.gamecenter.common.R.drawable.download_button_normal_style)
setTextColor(com.gh.gamecenter.common.R.color.white.toColor(context))
}
listener?.completion(downloadBtn.text)
return
}
if (gameEntity.isMiniGame()) {
@ -265,6 +272,7 @@ object DownloadItemUtils {
text = context.getString(com.gh.gamecenter.feature.R.string.quick_play)
}
}
listener?.completion(downloadBtn.text)
return
}
if (gameEntity.getApk().isEmpty() || gameEntity.downloadOffStatus != null) {
@ -280,9 +288,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
@ -296,6 +304,7 @@ object DownloadItemUtils {
downloadBtn.isClickable = false
}
}
listener?.completion(downloadBtn.text)
} else if (gameEntity.getApk().size == 1) {
// 来自于下载管理的实体快照
val entityFromDownloadManager = DownloadManager.getInstance().getDownloadEntitySnapshot(gameEntity)
@ -354,43 +363,60 @@ object DownloadItemUtils {
downloadBtn.apply {
when (downloadEntity.status) {
DownloadStatus.done -> {
if (downloadEntity.isSimulatorGame() && gameEntity.simulator != null) {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
} else if (isVGamePreferred) {
buttonStyle =
if (PackagesManager.isCanUpdate(
downloadEntity.gameId,
downloadEntity.packageName,
asVGame = true
)
) {
setText(com.gh.gamecenter.feature.R.string.update)
DownloadButton.ButtonStyle.NORMAL
} else {
setText(com.gh.gamecenter.feature.R.string.launch)
DownloadButton.ButtonStyle.LAUNCH_OR_OPEN
}
} else {
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
if (XapkUnzipStatus.SUCCESS.name == xapkStatus && isInstalling(downloadEntity.path)) {
val xapkStatus = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_STATUS]
when {
downloadEntity.isSimulatorGame() && gameEntity.simulator != null -> {
GameUtils.setDownloadBtnStatus(
context,
gameEntity,
downloadBtn,
pluginLocation,
listener
)
}
isVGamePreferred -> {
buttonStyle =
if (PackagesManager.isCanUpdate(
downloadEntity.gameId,
downloadEntity.packageName,
asVGame = true
)
) {
setText(com.gh.gamecenter.feature.R.string.update)
DownloadButton.ButtonStyle.NORMAL
} else {
setText(com.gh.gamecenter.feature.R.string.launch)
DownloadButton.ButtonStyle.LAUNCH_OR_OPEN
}
listener?.completion(downloadBtn.text)
}
XapkUnzipStatus.SUCCESS.name == xapkStatus && isInstalling(downloadEntity.path) -> {
progress = 100
setText(com.gh.gamecenter.feature.R.string.installing)
buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
listener?.completion(downloadBtn.text)
return
}
if (XapkUnzipStatus.UNZIPPING.name == xapkStatus) {
XapkUnzipStatus.UNZIPPING.name == xapkStatus -> {
val percent = downloadEntity.meta[XapkInstaller.XAPK_UNZIP_PERCENT]
progress = (java.lang.Float.valueOf(percent) * 10).toInt()
text = "$percent%"
buttonStyle = DownloadButton.ButtonStyle.XAPK_UNZIPPING
return
} else if (XapkUnzipStatus.FAILURE.name == xapkStatus) {
setText(com.gh.gamecenter.feature.R.string.install)
buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
listener?.completion(downloadBtn.text)
return
}
if (PackagesManager.isInstalled(downloadEntity.packageName) && !downloadEntity.isUpdate) {
XapkUnzipStatus.FAILURE.name == xapkStatus -> {
setText(com.gh.gamecenter.feature.R.string.install)
buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
listener?.completion(downloadBtn.text)
return
}
PackagesManager.isInstalled(downloadEntity.packageName) && !downloadEntity.isUpdate -> {
// 双下载按钮快速安装时存在已下载的安装包过时,需要重新下载的情况
if (PackagesManager.isCanUpdate(
downloadEntity.gameId,
@ -403,9 +429,13 @@ object DownloadItemUtils {
buttonStyle = DownloadButton.ButtonStyle.LAUNCH_OR_OPEN
setText(com.gh.gamecenter.feature.R.string.launch)
}
} else {
listener?.completion(downloadBtn.text)
}
else -> {
buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
setText(com.gh.gamecenter.feature.R.string.install)
listener?.completion(downloadBtn.text)
}
}
buttonStyle =
@ -425,22 +455,24 @@ object DownloadItemUtils {
DownloadStatus.overflow -> {
buttonStyle = DownloadButton.ButtonStyle.NORMAL
setText(com.gh.gamecenter.feature.R.string.resume)
listener?.completion(downloadBtn.text)
}
DownloadStatus.cancel -> {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation, listener)
}
else -> {
// do nothing
listener?.completion(downloadBtn.text)
}
}
}
} else {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation, listener)
}
} else {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation, listener)
}
}
@ -510,13 +542,18 @@ object DownloadItemUtils {
DownloadStatus.downloading -> {
if (isMultiVersion) {
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
val darkMode = (holder.gameDownloadTips?.getTag(com.gh.gamecenter.common.R.string.is_dark_mode_on_id) as? Boolean) ?: false
val darkMode =
(holder.gameDownloadTips?.getTag(com.gh.gamecenter.common.R.string.is_dark_mode_on_id) as? Boolean)
?: false
val isDarkModeChanged = DarkModeUtils.isDarkModeOn(context) != darkMode
if (holder.gameDownloadTips?.visibility == View.GONE || holder.gameDownloadTips?.isAnimating == false || isDarkModeChanged) {
holder.gameDownloadTips?.visibility = View.VISIBLE
holder.gameDownloadTips?.setDownloadTipsAnimation(true)
}
holder.gameDownloadTips?.setTag(com.gh.gamecenter.common.R.string.is_dark_mode_on_id, DarkModeUtils.isDarkModeOn(context))
holder.gameDownloadTips?.setTag(
com.gh.gamecenter.common.R.string.is_dark_mode_on_id,
DarkModeUtils.isDarkModeOn(context)
)
} else {
holder.gameDownloadTips?.visibility = View.GONE
holder.gameDownloadBtn.buttonStyle = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
@ -618,7 +655,11 @@ object DownloadItemUtils {
}
// 缺省情况下回落到游戏简介
if (TextUtils.isEmpty(briefStyle) || briefStyle!!.contains("brief") || briefStyle.contains("recommend")) {
if (TextUtils.isEmpty(briefStyle)
|| briefStyle!!.contains("brief")
|| briefStyle.contains("recommend")
|| briefStyle.contains("test&appointment")
) {
holder.gameDes?.visibility = View.VISIBLE
} else {
holder.gameDes?.visibility = View.GONE
@ -839,34 +880,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
@ -970,7 +1002,8 @@ object DownloadItemUtils {
traceEvent: ExposureEvent? = null,
refreshCallback: EmptyCallback? = null
) {
val str = if (downloadBtn is DownloadButton) downloadBtn.text else context.getString(com.gh.gamecenter.feature.R.string.download)
val str =
if (downloadBtn is DownloadButton) downloadBtn.text else context.getString(com.gh.gamecenter.feature.R.string.download)
if (gameEntity.getApk().isEmpty()) return
val apk = gameEntity.getApk().safelyGetInRelease(0) ?: return
@ -989,7 +1022,16 @@ object DownloadItemUtils {
addHandler(CheckDownloadHandler())
}
.setProcessEndCallback(gameEntity.id) { asVGame, isSubscribe ->
download(context, gameEntity, downloadBtn, entrance, location, asVGame, isSubscribe as Boolean, traceEvent)
download(
context,
gameEntity,
downloadBtn,
entrance,
location,
asVGame,
isSubscribe as Boolean,
traceEvent
)
}
.buildHandlerChain()
?.handleRequest(context, gameEntity, shouldPerformAsVGame)
@ -1008,7 +1050,16 @@ object DownloadItemUtils {
addHandler(CheckDownloadHandler())
}
.setProcessEndCallback(gameEntity.id) { asVGame, isSubscribe ->
download(context, gameEntity, downloadBtn, entrance, location, asVGame, isSubscribe as Boolean, traceEvent)
download(
context,
gameEntity,
downloadBtn,
entrance,
location,
asVGame,
isSubscribe as Boolean,
traceEvent
)
}
.buildHandlerChain()
?.handleRequest(context, gameEntity, shouldPerformAsVGame)
@ -1027,7 +1078,16 @@ object DownloadItemUtils {
addHandler(CheckDownloadHandler())
}
.setProcessEndCallback(gameEntity.id) { asVGame, isSubscribe ->
download(context, gameEntity, downloadBtn, entrance, location, asVGame, isSubscribe as Boolean, traceEvent)
download(
context,
gameEntity,
downloadBtn,
entrance,
location,
asVGame,
isSubscribe as Boolean,
traceEvent
)
}
.buildHandlerChain()
?.handleRequest(context, gameEntity, shouldPerformAsVGame)

View File

@ -14,6 +14,7 @@ import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.entity.SimpleGameEntity
import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.common.eventbus.EBShowDialog
@ -53,6 +54,7 @@ object DownloadObserver {
private const val CORE_EVENT_DOWNLOAD_COMPLETE_LOGGED = "CORE_EVENT_DOWNLOAD_COMPLETE_LOGGED"
private val mRetryableHashMap = hashMapOf<String, Boolean>()
private val mRetryableProgressMap = hashMapOf<String, Long>()
/**
* 当下载任务是 预约上线提醒 触发的,则所有弹窗均不显示
@ -146,7 +148,8 @@ object DownloadObserver {
|| DownloadStatus.timeout == status
) {
if (mRetryableHashMap[downloadEntity.url] == true
&& NetworkUtils.isWifiConnected(HaloApp.getInstance().application)
&& (NetworkUtils.isWifiConnected(HaloApp.getInstance().application)
|| NDownloadBridge.isDownloadViaTrafficAllowed(downloadEntity))
) {
downloadManager.resumeDownload(downloadEntity.url)
mRetryableHashMap[downloadEntity.url] = false
@ -257,6 +260,7 @@ object DownloadObserver {
}
mRetryableHashMap.remove(downloadEntity.url)
mRetryableProgressMap.remove(downloadEntity.url)
EventBus.getDefault().post(EBDownloadStatus("done", "", "", "", downloadEntity.packageName, ""))
}
@ -264,7 +268,9 @@ object DownloadObserver {
DownloadNotificationHelper.addOrUpdateDownloadNotification(downloadEntity)
// 如果已下载大小发生变化,表示成功恢复下载,则重置重试标记
if (status == DownloadStatus.downloading) {
if (status == DownloadStatus.downloading
&& downloadEntity.progress != mRetryableProgressMap[downloadEntity.url]) {
mRetryableProgressMap[downloadEntity.url] = downloadEntity.progress
mRetryableHashMap[downloadEntity.url] = true
}
}
@ -551,6 +557,10 @@ object DownloadObserver {
} else {
arrayOf()
}
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
SensorsBridge.trackEventWithExposureSource(
"DownloadProcessFinish",
exposureEvent?.source,
@ -567,6 +577,9 @@ object DownloadObserver {
"last_page_business_id", getLastPageEntity().pageBusinessId,
"download_status", downloadEntity.meta[Constants.DOWNLOAD_STATUS_IN_CHINESE] ?: "",
"download_type", if (downloadEntity.asVGame()) "畅玩下载" else "本地下载",
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
*kvs
)
}

View File

@ -25,7 +25,10 @@ object GameUtils {
/**
* 去除与重复sourceList相同的数据
*/
fun removeDuplicateData(sourceList: MutableList<GameEntity>?, rawList: MutableList<GameEntity>?): MutableList<GameEntity>? {
fun removeDuplicateData(
sourceList: MutableList<GameEntity>?,
rawList: MutableList<GameEntity>?
): MutableList<GameEntity>? {
if (sourceList.isNullOrEmpty() || rawList.isNullOrEmpty()) {
return rawList
}
@ -52,7 +55,8 @@ object GameUtils {
context: Context,
gameEntity: GameEntity,
downloadBtn: DownloadButton,
pluginLocation: PluginLocation?
pluginLocation: PluginLocation?,
listener: DownloadButton.OnUpdateListener? = null
) {
// getDownloadBtnText 里包括查询数据库、根据包名读取包体 meta 信息等
lightWeightIoExecutor.execute {
@ -73,6 +77,7 @@ object GameUtils {
} else {
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
}
listener?.completion(downloadBtn.text)
}
}
}
@ -85,11 +90,13 @@ object GameUtils {
*/
@WorkerThread
@JvmStatic
fun getDownloadBtnText(context: Context,
gameEntity: GameEntity,
isFromList: Boolean,
fixedAsVGame: Boolean,
pluginLocation: PluginLocation?): String {
fun getDownloadBtnText(
context: Context,
gameEntity: GameEntity,
isFromList: Boolean,
fixedAsVGame: Boolean,
pluginLocation: PluginLocation?
): String {
if (gameEntity.getApk().size > 1) {
return ""
}
@ -135,12 +142,17 @@ 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

@ -14,25 +14,26 @@ import androidx.core.content.ContextCompat;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.LibaoDetailAdapter;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.NotificationUgc;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.JSONObjectResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.NotificationHelper;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.core.utils.UrlFilterUtils;
import com.gh.gamecenter.eventbus.EBUISwitch;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.LibaoEntity;
import com.gh.gamecenter.feature.entity.LibaoStatusEntity;
import com.gh.gamecenter.feature.entity.MeEntity;
import com.gh.gamecenter.common.entity.NotificationUgc;
import com.gh.gamecenter.feature.entity.UserDataLibaoEntity;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.eventbus.EBUISwitch;
import com.gh.gamecenter.feature.utils.PlatformUtils;
import com.gh.gamecenter.geetest.GeetestUtils;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.common.retrofit.JSONObjectResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Utils;
@ -480,7 +481,7 @@ public class LibaoUtils {
UserDataLibaoEntity me = new UserDataLibaoEntity(libaoCode, "ling", Utils.getTime(context));
initLibaoCode(libaoEntity, me);
if (adapter != null) adapter.initLibaoCode(me);
EventBus.getDefault().post(new EBReuse("libaoChanged"));
EventBus.getDefault().post(new EBReuse(Constants.LIBAO_CHANGED_TAG));
if (listener != null) listener.onLibaoStatusChange();
uploadEvent(libaoEntity, true, entrance);
String des;
@ -620,7 +621,7 @@ public class LibaoUtils {
UserDataLibaoEntity me = new UserDataLibaoEntity(libaoCode, "ling", Utils.getTime(context));
initLibaoCode(libaoEntity, me);
if (listener != null) listener.onLibaoStatusChange();
EventBus.getDefault().post(new EBReuse("libaoChanged"));
EventBus.getDefault().post(new EBReuse(Constants.LIBAO_CHANGED_TAG));
uploadEvent(libaoEntity, false, entrance);
if (adapter != null) {

View File

@ -2778,4 +2778,34 @@ object NewFlatLogUtils {
parseAndPutMeta()(this)
}.let(::log)
}
// 自有开屏广告加载
fun logSplashAdLoad(id: String) {
json {
KEY_EVENT to "splash_ad_load"
"ad_id" to id
parseAndPutMeta()(this)
}.let(::log)
}
// 自有开屏广告展示
fun logSplashAdShow(id: String, duration: Long) {
json {
KEY_EVENT to "splash_ad_show"
"ad_id" to id
"duration" to duration
parseAndPutMeta()(this)
}.let(::log)
}
// 自有开屏广告加载/展示失败
@JvmStatic
fun logSplashAdFail(id: String, error: String) {
json {
KEY_EVENT to "splash_ad_fail"
"ad_id" to id
"error" to error
parseAndPutMeta()(this)
}.let(::log)
}
}

View File

@ -12,6 +12,7 @@ import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.gh.common.constant.Config
import com.gh.download.server.BrowserInstallHelper
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.PermissionHelper
@ -24,7 +25,6 @@ import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.entity.WhitePackageListEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.feature.utils.SentryHelper
import com.gh.gamecenter.manager.PackagesManager
import com.gh.gamecenter.packagehelper.PackageRepository
import com.gh.gamecenter.retrofit.RetrofitManager
@ -459,6 +459,9 @@ object PackageHelper {
PackageRepository.initData {
refreshLocalPackageList()
refreshPackageNameList()
// 初始化使用浏览器安装的条件
BrowserInstallHelper.initIfConditionMatched(Config.getNewSettingsEntity())
}
}
@ -578,7 +581,6 @@ object PackageHelper {
Utils.log(TAG, "refreshWrongInstallStatus 检查安装状态异常的应用")
val uninstalledButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
val updatedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
for (packageName in packageNameSet) {
val installedVersionName = PackageUtils.getVersionNameByPackageName(packageName)
@ -587,18 +589,9 @@ object PackageHelper {
&& installedVersionName == null
) {
uninstalledButKeepingWrongStatusPackageNameSet.add(packageName)
} else if (PackagesManager.isInstalled(packageName)
&& installedVersionName != null
&& !PackagesManager.isInstalledWithSpecificVersion(packageName, installedVersionName)
) {
updatedButKeepingWrongStatusPackageNameSet.add(packageName)
}
}
Utils.log(
TAG,
"refreshWrongInstallStatus 需要更新已更新状态的包数量为 ${updatedButKeepingWrongStatusPackageNameSet.size}"
)
Utils.log(
TAG,
"refreshWrongInstallStatus 需要移除已安装的包数量为 ${uninstalledButKeepingWrongStatusPackageNameSet.size}"
@ -616,12 +609,6 @@ object PackageHelper {
additionalWhiteListPackageNameSet.toString()
)
}
if (updatedButKeepingWrongStatusPackageNameSet.isNotEmpty()) {
for (packageName in updatedButKeepingWrongStatusPackageNameSet) {
PackageChangeHelper.addUpdate(packageName)
}
}
}
}
}
@ -635,7 +622,6 @@ object PackageHelper {
val installedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
val uninstalledButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
val updatedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
for (game in gameEntityList) {
for (apk in game.getApk()) {
@ -651,13 +637,6 @@ object PackageHelper {
&& installedVersionName == null
) {
uninstalledButKeepingWrongStatusPackageNameSet.add(packageName)
} else if (PackagesManager.isInstalled(packageName)
&& installedVersionName != null
&& !PackagesManager.isInstalledWithSpecificVersion(packageName, installedVersionName)
&& !PackagesManager.isCanUpdate(game.id, packageName, false)
) {
cachedPkgNameAndGameEntityMap.put(packageName, game)
updatedButKeepingWrongStatusPackageNameSet.add(packageName)
}
}
}
@ -666,10 +645,6 @@ object PackageHelper {
TAG,
"refreshWrongInstallStatus 需要更新已安装状态的包数量为 ${installedButKeepingWrongStatusPackageNameSet.size}"
)
Utils.log(
TAG,
"refreshWrongInstallStatus 需要更新已更新状态的包数量为 ${updatedButKeepingWrongStatusPackageNameSet.size}"
)
Utils.log(
TAG,
"refreshWrongInstallStatus 需要移除已安装的包数量为 ${uninstalledButKeepingWrongStatusPackageNameSet.size}"
@ -699,12 +674,6 @@ object PackageHelper {
additionalWhiteListPackageNameSet.toString()
)
}
if (updatedButKeepingWrongStatusPackageNameSet.isNotEmpty()) {
for (packageName in updatedButKeepingWrongStatusPackageNameSet) {
PackageChangeHelper.addUpdate(packageName, cachedPkgNameAndGameEntityMap.remove(packageName))
}
}
}
}
}

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
@ -70,18 +69,24 @@ object PackageInstaller {
val isDownloadAsVGame = downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) == Constants.VGAME
|| downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) == Constants.DUAL_DOWNLOAD_VGAME
val currentActivity = AppManager.getInstance().currentActivity() ?: return
val properContext = if (context is AppCompatActivity && !context.isFinishing) {
context
} else {
AppManager.getInstance().currentActivity()
}
properContext ?: return
if (!ignoreAsVGame && isDownloadAsVGame) {
VHelper.install(currentActivity, downloadEntity)
VHelper.install(properContext, downloadEntity)
return
}
// 已知问题
// 1. 此处可能遇到 activity 是 WXEntryActivity因为 WXEntryActivity 不是 AppCompatActivity 调不起弹窗
// 2. 当 activity 全部出栈,但是应用还在下载游戏,下载完会唤不起安装
if (currentActivity is AppCompatActivity && !currentActivity.isFinishing) {
InstallPermissionDialogFragment.show(currentActivity, downloadEntity) { isFromPermissionGrantedCallback ->
if (properContext is AppCompatActivity && !properContext.isFinishing) {
InstallPermissionDialogFragment.show(properContext, downloadEntity) { isFromPermissionGrantedCallback ->
// 取消状态栏下载完成的通知,若存在
downloadEntity.meta[Constants.MARK_ALREADY_TRIGGERED_INSTALLATION] = "YES"
DownloadNotificationHelper.addOrUpdateDownloadNotification(downloadEntity)
@ -194,12 +199,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 +283,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 {
@ -81,28 +81,11 @@ object PackageLauncher {
gameEntity: GameEntity? = null,
packageName: String?
) {
if (packageName.isNullOrEmpty()) {
ToastUtils.toast("启动失败")
return
}
// 获取 GameInstall 实体,用于记录启动日志用
val gameInstall = if (gameEntity != null) {
GameInstall.transformGameInstall(gameEntity, packageName)
} else {
PackageRepository.gameInstalled.find { it.packageName == packageName }
}
if (gameInstall != null) {
NewFlatLogUtils.logGameLaunch(
gameId = gameInstall.id ?: "unknown",
gameName = gameInstall.name ?: "unknown",
gameCategory = gameInstall.category ?: "unknown",
downloadStatus = if (gameInstall.downloadStatus == "demo") "试玩" else "下载"
)
}
try {
val intent = context.applicationContext.packageManager.getLaunchIntentForPackage(packageName)
if (intent != null) {
@ -113,6 +96,26 @@ object PackageLauncher {
} catch (e: Exception) {
ToastUtils.toast( "启动失败")
}
try {
// 获取 GameInstall 实体,用于记录启动日志用
val gameInstall = if (gameEntity != null) {
GameInstall.transformGameInstall(gameEntity, packageName)
} else {
PackagesManager.getInstalledList().find { it.packageName == packageName }
}
if (gameInstall != null) {
NewFlatLogUtils.logGameLaunch(
gameId = gameInstall.id ?: "unknown",
gameName = gameInstall.name ?: "unknown",
gameCategory = gameInstall.category ?: "unknown",
downloadStatus = if (gameInstall.downloadStatus == "demo") "试玩" else "下载"
)
}
} catch (e: RuntimeException) {
// 都 DeadSystemException 了,还想啥日志上报
}
}
}

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;
@ -302,7 +301,7 @@ public class PackageUtils {
Signature[] signatures = packageInfo.signatures;
// 使用幸运破解器破解安卓签名认证可能会出现不用签名也能装的情况,这里有可能是空的
if (signatures[0] != null) {
if (signatures.length > 0 && signatures[0] != null) {
return parseSignature(signatures[0].toByteArray());
} else {
return new String[]{null, null};
@ -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

@ -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
@ -117,7 +95,8 @@ object ReservationHelper {
it.categoryChinese,
data.wechatConfig.isReminderEnable,
if (data.hasSmsConfig) data.smsConfig.notice else null,
if (data.isEnableAutoDownload) data.wifiAutoDownload else null
if (data.isEnableAutoDownload) data.wifiAutoDownload else null,
if (data.hasCalendarConfig) false else null
)
}
@ -146,21 +125,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)

View File

@ -6,6 +6,7 @@ import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.ndownload.NHttpClient
import com.lightgame.utils.AppManager
import org.json.JSONObject
@ -89,4 +90,12 @@ object TempCertificationUtils {
return stringBuffer.toString()
}
/**
* 检测光环是否实名
*/
fun isUserVerified(): Boolean {
val idCard = UserManager.getInstance().userInfoEntity?.idCard
// 账号已实名
return idCard != null && idCard.status == 0
}
}

View File

@ -32,6 +32,7 @@ import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.ResponseBody
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import java.util.*
@ -229,15 +230,19 @@ object UsageStatsHelper {
mApi.getUsageStatusUpdateTime(HaloApp.getInstance().gid)
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
val body = JSONObject(data.string())
val lastPostTime = body.getLong("update_time") * 1000
try {
val body = JSONObject(data.string())
val lastPostTime = body.getLong("update_time") * 1000
val beginTime = if (lastPostTime == 0L) {
getDefaultBeginTime()
} else {
lastPostTime
val beginTime = if (lastPostTime == 0L) {
getDefaultBeginTime()
} else {
lastPostTime
}
postUsageStats(beginTime)
} catch (e: JSONException) {
Utils.log("UsageStats: 获取上次上传时间失败,错误信息:${e.message}")
}
postUsageStats(beginTime)
}
})
}

View File

@ -19,7 +19,7 @@ import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailFrag
import com.gh.gamecenter.game.commoncollection.detail.CustomCommonCollectionDetailFragment
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionHotListWrapperFragment
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareFragment
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.GameDetailWrapperFragment
import com.gh.gamecenter.info.InfoWrapperFragment
import com.gh.gamecenter.libao.LibaoDetailFragment
import com.gh.gamecenter.libao.LibaoFragment
@ -88,7 +88,7 @@ object ViewPagerFragmentHelper {
// 游戏详情页
TYPE_GAME -> {
bundle.putString(EntranceConsts.KEY_GAMEID, linkEntity.link)
GameDetailFragment().with(bundle)
GameDetailWrapperFragment().with(bundle)
}
// 我的光环
TYPE_MY_HALO -> {
@ -149,11 +149,11 @@ object ViewPagerFragmentHelper {
NewQuestionDetailFragment().with(bundle)
}
// 其他原来带Toolbar的Fragment
else -> createToolbarWrapperFragment(parentFragment, bundle, linkEntity, isTabWrapper)
else -> createToolbarWrapperFragment(bundle, linkEntity, isTabWrapper)
}
}
private fun createToolbarWrapperFragment(parentFragment: Fragment?, bundle: Bundle, entity: LinkEntity, isTabWrapper: Boolean): Fragment {
private fun createToolbarWrapperFragment(bundle: Bundle, entity: LinkEntity, isTabWrapper: Boolean): Fragment {
var className = ReloadFragment::class.java.name
when (entity.type) {

View File

@ -32,6 +32,7 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
private var mLastItemWidth = 0//最后更多按钮宽度
private var mTotalWidth = 0
private var mStrokeWidth = 0
private var mShowMore = true
var onClickListener: OnItemClickListener? = null
init {
@ -44,11 +45,12 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
mTextSize = ta.getDimension(R.styleable.FlexLinearLayout_itemTextSize, 10F.sp2px().toFloat())
mLastItemWidth = ta.getDimensionPixelSize(R.styleable.FlexLinearLayout_lastItemWidth, 18F.dip2px())
mStrokeWidth = ta.getDimensionPixelSize(R.styleable.FlexLinearLayout_strokeWidth, 0.5F.dip2px())
mShowMore = ta.getBoolean(R.styleable.FlexLinearLayout_showMore, true)
ta.recycle()
}
fun setTags(tags: ArrayList<TagStyleEntity>) {
fun setTags(tags: List<TagStyleEntity>) {
mTags.clear()
mTotalCount = tags.size
mTotalWidth = measuredWidth
@ -86,7 +88,7 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
mTags.forEachIndexed { index, tag ->
addView(createView(tag, index))
}
if (mTotalCount != mTags.size) {
if (mShowMore && mTotalCount != mTags.size) {
val imageView = ImageView(context).apply {
val params = LayoutParams(mLastItemWidth, mItemHeight)
layoutParams = params

View File

@ -3,9 +3,15 @@ package com.gh.common.xapk
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.DocumentsContract
import android.provider.Settings
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.documentfile.provider.DocumentFile
import com.gh.common.constant.Config
import com.gh.common.util.DirectUtils
import com.gh.common.util.DownloadNotificationHelper
@ -24,6 +30,7 @@ import com.gh.gamecenter.xapk.core.XApkUnZipCallback
import com.gh.gamecenter.xapk.core.XApkUnZipEntry
import com.gh.gamecenter.xapk.core.XApkUnZipOutputFactory
import com.gh.gamecenter.xapk.io.NonSplitApksOutput
import com.gh.gamecenter.xapk.io.OBBDocOutput
import com.gh.gamecenter.xapk.io.OBBFileOutput
import com.gh.gamecenter.xapk.io.SplitApksOutput
import com.gh.gamecenter.xapk.io.XApkFileOutput
@ -34,6 +41,8 @@ import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
import java.io.File
import java.util.*
import androidx.core.net.toUri
import com.gh.gamecenter.core.utils.SPUtils
/**
* 目前已知的Xapk内容是:只有一个apk包和一个或做多个obb数据包(多余文件不解压,如果存在多个apk包,则以下安装无效)
@ -65,6 +74,10 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
systemMatched && fileListMatched
}
// 是否使用 DocumentUi 的方式访问 obb 文件夹
private var useDocStyleToUnzip = false
private var tempLauncher: ActivityResultLauncher<Uri>? = null
private const val GUIDE_TYPE_MIUI_OPTIMIZATION = "miui_optimization"
private const val MIUI_OPTIMIZATION_WARNING_DIALOG_ENTRANCE = "MIUI优化关闭提示弹窗"
@ -121,13 +134,39 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
}
PermissionHelper.checkManageAllFilesOrStoragePermissionBeforeAction(context) {
DownloadManager.getInstance().getDownloadEntitySnapshot(downloadEntity.url, downloadEntity.gameId)
?.let {
unzipXapkFile(it)
if (showUnzipToast) {
Utils.toast(mContext, "解压过程请勿退出光环助手!")
val unzipAction = {
DownloadManager.getInstance().getDownloadEntitySnapshot(downloadEntity.url, downloadEntity.gameId)
?.let {
unzipXapkFile(it)
if (showUnzipToast) {
Utils.toast(mContext, "解压过程请勿退出光环助手!")
}
}
}
// XAPK (apks) 格式,不在乎 obb 文件夹是否可读
if (downloadEntity.format == Constants.XAPK_APKS_FORMAT) {
unzipAction.invoke()
return@checkManageAllFilesOrStoragePermissionBeforeAction
}
// 以 file 的方式访问 obb 文件夹是否可行
val isFileStyleObbFolderReadable =
if (systemHasFlaw) {
File(Environment.getExternalStorageDirectory().path, "\u200bAndroid/obb").list() != null
} else {
File(Environment.getExternalStorageDirectory().path, "Android/obb").list() != null
}
// 如果是文件夹风格的 obb 文件夹可读,或当前上下文不是 AppCompatActivity或当前上下文已经被销毁则直接解压
if (isFileStyleObbFolderReadable
|| context !is AppCompatActivity
|| context.isFinishing
) {
unzipAction.invoke()
} else {
unzipWithCulpritHandled(context, downloadEntity.url, unzipAction)
}
}
} else {
throwExceptionInDebug("如果是Apk包请使用PackageInstaller进行安装")
@ -135,6 +174,82 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
}
}
/**
* 兜底解压方案,适用于一些奇葩系统
*/
private fun unzipWithCulpritHandled(activity: AppCompatActivity, xApkUrl: String, unzipAction: () -> Unit?) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R
|| Build.VERSION.SDK_INT == Build.VERSION_CODES.S
) {
val isDocStyleObbFolderReadable = isDocStyleObbFolderReadable(activity)
if (isDocStyleObbFolderReadable) {
useDocStyleToUnzip = true
unzipAction.invoke()
} else {
DialogHelper.showDialog(
context = activity,
title = "安装提示",
content = "为了安装 XAPK 文件,请授予 OBB 文件夹的访问权限",
confirmText = "确定",
cancelText = "取消",
confirmClickCallback = {
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)
intent.setFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION
and Intent.FLAG_GRANT_WRITE_URI_PERMISSION
and Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
and Intent.FLAG_GRANT_PREFIX_URI_PERMISSION
)
val obbUri = OBBDocOutput.ANDROID_OBB_DOC_STYLE_URI.toUri()
val df = DocumentFile.fromTreeUri(activity, obbUri)
if (df != null) {
intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, df.uri)
}
tempLauncher =
activity.registerActivityResultLauncher(ActivityResultContracts.OpenDocumentTree()) { uri ->
if (uri != null) {
activity.contentResolver.takePersistableUriPermission(
uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
)
useDocStyleToUnzip = true
unzipAction.invoke()
}
tempLauncher?.unregister()
}
tempLauncher?.launch(obbUri)
},
cancelClickCallback = {
unzipAction.invoke()
}
)
}
} else {
PermissionHelper.checkStoragePermissionBeforeAction(activity) {
// 设备大于 12需要重启才能生效 (是的,我们又重启了!)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// 记录应用重启前需要重解压的信息
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, activity.javaClass.name)
SPUtils.setString(Constants.SP_XAPK_URL, xApkUrl)
val pm = activity.packageManager
val intent = pm.getLaunchIntentForPackage(activity.packageName)
val mainIntent = Intent.makeRestartActivityTask(intent!!.component)
activity.startActivity(mainIntent)
Runtime.getRuntime().exit(0)
} else {
unzipAction.invoke()
}
}
}
}
private fun unzipXapkFile(downloadEntity: DownloadEntity) {
mXApkUnZipper.unzip(
XApkUnZipEntry(
@ -324,7 +439,7 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
}
override fun onCreateOBBOutput(apk: XApkFile): XApkFileOutput<Unit> {
return OBBFileOutput()
return if (useDocStyleToUnzip) OBBDocOutput(mContext) else OBBFileOutput()
}
override fun onCreateApkOutput(apk: XApkFile): XApkFileOutput<IPackageInstaller> {
@ -340,6 +455,16 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
}
}
/**
* 是否能以 DocumentUi 的方式访问 obb 文件夹
*/
private fun isDocStyleObbFolderReadable(context: Context): Boolean {
return context
.contentResolver
.persistedUriPermissions
.any { it.uri == OBBDocOutput.ANDROID_OBB_URI.toUri() }
}
private class SplitApksInstaller(
private val xApkFile: XApkFile,
private val sessionId: Int,
@ -351,7 +476,12 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
mPendingSessionInfoMap[downloadEntity.path] = XapkPendingSessionInfo(downloadEntity.path, sessionId)
AppExecutor.ioExecutor.execute {// 有可能卡顿造成anr
PackageInstaller.installMultiple(applicationContext, downloadEntity.packageName, downloadEntity.path, sessionId)
PackageInstaller.installMultiple(
applicationContext,
downloadEntity.packageName,
downloadEntity.path,
sessionId
)
NDataChanger.notifyDataChanged(downloadEntity)
}
}

View File

@ -17,15 +17,6 @@ import androidx.collection.ArrayMap;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.gh.gamecenter.common.base.GlobalActivityManager;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.core.GHThreadFactory;
import com.gh.gamecenter.feature.entity.TagStyleEntity;
import com.gh.gamecenter.feature.entity.CustomPageTrackData;
import com.gh.gamecenter.feature.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureUtils;
import com.gh.common.history.HistoryHelper;
import com.gh.common.simulator.SimulatorGameManager;
@ -36,10 +27,17 @@ import com.gh.common.util.LunchType;
import com.gh.common.util.PackageInstaller;
import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.base.GlobalActivityManager;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.utils.DeviceUtils;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.FileUtils;
import com.gh.gamecenter.common.utils.NetworkUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.GHThreadFactory;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
import com.gh.gamecenter.core.utils.SPUtils;
@ -48,8 +46,11 @@ import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.entity.HomePluggableFilterEntity;
import com.gh.gamecenter.eventbus.EBDownloadStatus;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.CustomPageTrackData;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.feature.entity.PluginLocation;
import com.gh.gamecenter.feature.entity.TagStyleEntity;
import com.gh.gamecenter.feature.exposure.ExposureEvent;
import com.gh.gamecenter.feature.utils.SentryHelper;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.manager.PackagesManager;
@ -451,8 +452,15 @@ public class DownloadManager implements DownloadStatusListener {
trackDownloadType = "本地下载";
}
String pushMessageId = HaloApp.get(Constants.PUSH_MESSAGE_ID, false) instanceof String
? (String) HaloApp.get(Constants.PUSH_MESSAGE_ID, false)
: "";
String pushLinkId = HaloApp.get(Constants.PUSH_LINK_ENTITY, false) instanceof LinkEntity
? ((LinkEntity) HaloApp.get(Constants.PUSH_LINK_ENTITY, false)).getLink()
: "";
boolean isFromPush = !pushMessageId.isEmpty();
String[] arrayKv = {
Object[] arrayKv = {
"game_id", gameEntity.getId(),
"game_name", gameEntity.getName(),
"game_type", gameEntity.getCategoryChinese(),
@ -465,16 +473,19 @@ public class DownloadManager implements DownloadStatusListener {
"last_page_id", GlobalActivityManager.getLastPageEntity().getPageId(),
"last_page_business_id", GlobalActivityManager.getLastPageEntity().getPageBusinessId(),
"download_status", gameEntity.getDownloadStatusChinese(),
"download_type", trackDownloadType
"download_type", trackDownloadType,
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
};
List<String> kvs = new ArrayList<>(Arrays.asList(arrayKv));
List<Object> kvs = new ArrayList<>(Arrays.asList(arrayKv));
if (customPageTrackData != null) {
kvs.addAll(Arrays.asList(customPageTrackData.toKV()));
}
SensorsBridge.trackEventWithExposureSource("DownloadProcessBegin",
downloadExposureEvent.getSource(), kvs.toArray(new String[0])
downloadExposureEvent.getSource(), kvs.toArray(new Object[0])
);
//TODO remove
@ -1296,7 +1307,7 @@ public class DownloadManager implements DownloadStatusListener {
getInstance().packageExecutor.execute(() -> {
boolean markHasChanged = false;
ArrayList<GameUpdateEntity> updates = PackageRepository.INSTANCE.getGameUpdate();
List<GameUpdateEntity> updates = PackageRepository.INSTANCE.getGameUpdate();
for (GameUpdateEntity update : updates) {
if (update == null) continue;
String mark = update.getId() + update.getPackageName();
@ -1317,7 +1328,7 @@ public class DownloadManager implements DownloadStatusListener {
* 将可用更新标记为已读的事件
*/
public void saveUpdateMarkToStorage() {
ArrayList<GameUpdateEntity> updates = PackageRepository.INSTANCE.getGameUpdate();
List<GameUpdateEntity> updates = PackageRepository.INSTANCE.getGameUpdate();
if (updates.size() == mUpdateMarks.size()) {
SPUtils.setStringSet(UPDATE_IS_READ_MARK, mUpdateMarks);
return;

View File

@ -15,7 +15,8 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.*
import androidx.recyclerview.widget.RecyclerView.SmoothScroller
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.download.DownloadManager
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
@ -30,9 +31,9 @@ import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.TimeElapsedHelper
import com.gh.gamecenter.databinding.DialogDownloadBinding
import com.gh.gamecenter.entity.GamePlatform
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.feature.entity.ApkEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.halo.assistant.HaloApp
import com.lightgame.download.DataWatcher
@ -70,6 +71,8 @@ class DownloadDialog : BaseDraggableDialogFragment() {
private var mEntrance: String = "" // 入口位置
private var mLocation: String = "" // 最终位置
private var onDownloadClickAction: ((Boolean) -> Unit)? = null
private val mDataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
@ -122,7 +125,7 @@ class DownloadDialog : BaseDraggableDialogFragment() {
}
mViewModel.listLiveData.observeNonNull(this, callback = { itemList ->
mAdapter =
DownloadDialogAdapter(requireContext(), mViewModel, itemList, false, mTraceEvent, mEntrance, mLocation)
DownloadDialogAdapter(requireContext(), mViewModel, itemList, false, mTraceEvent, mEntrance, mLocation, onDownloadClickAction)
mBinding.contentList.layoutManager = createLayoutManager(itemList)
mBinding.contentList.adapter = mAdapter
performAutoDownload(itemList, mBinding.contentList)
@ -161,7 +164,8 @@ class DownloadDialog : BaseDraggableDialogFragment() {
true,
mTraceEvent,
mEntrance,
mLocation
mLocation,
onDownloadClickAction
)
mBinding.collectionList.layoutManager = createLayoutManager(itemList)
mBinding.collectionList.adapter = mCollectionAdapter
@ -426,7 +430,8 @@ class DownloadDialog : BaseDraggableDialogFragment() {
gameEntity: GameEntity,
traceEvent: ExposureEvent?,
entrance: String?,
location: String?
location: String?,
onDownloadClickAction: ((Boolean) -> Unit)? = null
) {
val fragmentActivity: FragmentActivity = if (context is FragmentActivity) {
context
@ -452,6 +457,7 @@ class DownloadDialog : BaseDraggableDialogFragment() {
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, traceEvent)
arguments = bundle
}
downloadDialog.onDownloadClickAction = onDownloadClickAction
downloadDialog.show(fragmentActivity.supportFragmentManager, DownloadDialog::class.java.name)
}

View File

@ -24,7 +24,8 @@ class DownloadDialogAdapter(
val isCollectionPage: Boolean,
private val mTraceEvent: ExposureEvent?,
private val mEntrance: String,
private val mLocation: String
private val mLocation: String,
private val onDownloadClickAction: ((Boolean) -> Unit)? = null
) : BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
private val mPath = if (isCollectionPage) {
@ -170,7 +171,8 @@ class DownloadDialogAdapter(
mTraceEvent,
mEntrance,
mPath,
mLocation
mLocation,
onDownloadClickAction
)
}
}

View File

@ -41,7 +41,8 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
traceEvent: ExposureEvent?,
entrance: String,
path: String,
location: String
location: String,
onDownloadClickAction: ((Boolean) -> Unit)? = null
) {
val apkEntity = listData[position].normal!!
@ -181,7 +182,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
}
}
setDownloadClickListener(itemView, apkEntity, viewModel, traceEvent, entrance, path, location)
setDownloadClickListener(itemView, apkEntity, viewModel, traceEvent, entrance, path, location, onDownloadClickAction)
}
private fun changeRecommendUI(apkEntity: ApkEntity, listData: List<DownloadDialogItemData>, position: Int) {
@ -226,7 +227,8 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
traceEvent: ExposureEvent?,
entrance: String,
path: String,
location: String
location: String,
onDownloadClickAction: ((Boolean) -> Unit)? = null
) {
val gameEntity = viewModel.gameEntity
@ -234,6 +236,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
when (itemView.getTag(DownloadDialogAdapter.ITEM_TAG_KEY)) {
DownloadDialogItemStatus.DOWNLOAD -> {
createDownloadTask(it.context, apkEntity, gameEntity, traceEvent, entrance, location)
onDownloadClickAction?.invoke(false)
}
DownloadDialogItemStatus.LAUNCH -> {
PackageLauncher.launchApp(it.context, gameEntity, apkEntity.packageName)
@ -291,6 +294,7 @@ class DownloadDialogItemViewHolder(val binding: DownloadDialogItemBinding) : Bas
}
DownloadDialogItemStatus.UPDATE -> {
createDownloadTask(it.context, apkEntity, gameEntity, traceEvent, entrance, location)
onDownloadClickAction?.invoke(true)
}
DownloadDialogItemStatus.COLLECTION -> {
val apkCollection = apkEntity.apkCollection

View File

@ -3,6 +3,7 @@ package com.gh.download.server
import android.content.Context
import android.os.Build
import android.util.Base64
import androidx.annotation.WorkerThread
import com.gh.common.constant.Config
import com.gh.common.util.DirectUtils
import com.gh.common.util.LogUtils
@ -246,6 +247,19 @@ object BrowserInstallHelper {
}
}
/**
* 初始化是否满足开启浏览器安装的条件(后续会使用缓存来判断)
* @param settingsEntity 服务器返回的配置
*
* 因为可能需要查询已安装的应用,所以需要在子线程中调用
*/
@WorkerThread
fun initIfConditionMatched(settingsEntity: NewSettingsEntity?) {
settingsEntity?.let {
isConditionMatched(it)
}
}
/**
* 是否满足开启浏览器安装的条件
*/

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

@ -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,15 +5,10 @@ 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
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.gamecenter.common.base.GlobalActivityManager
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
@ -24,7 +19,11 @@ import com.gh.gamecenter.feature.entity.GameEntity
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.gh.gamecenter.gamedetail.GameDetailWrapperFragment
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
import com.therouter.TheRouter
import com.therouter.router.Autowired
import com.therouter.router.Route
@Route(
path = RouteConsts.activity.gameDetailActivity,
@ -74,11 +73,11 @@ class GameDetailActivity : DownloadToolbarActivity() {
generateDataFromRoute()
super.onCreate(savedInstanceState)
DisplayUtils.transparentStatusBar(this)
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn)
}
override fun provideNormalIntent(): Intent {
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailFragment::class.java)
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailWrapperFragment::class.java)
}
override fun getLayoutId() = R.layout.activity_game_detail
@ -127,10 +126,15 @@ class GameDetailActivity : DownloadToolbarActivity() {
private fun generateDataFromRoute() {
val bundle = intent.extras
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailFragment::class.java.canonicalName)
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailWrapperFragment::class.java.canonicalName)
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
}
override fun onDarkModeChanged() {
super.onDarkModeChanged()
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn)
}
companion object {
@JvmStatic
@ -190,12 +194,12 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
if (scrollToServer) {
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, true)
}
@ -302,7 +306,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
if (openVideoStreaming) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, true)
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
}
if (openPlatformWindow) {
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
@ -316,7 +320,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
}
}
if (scrollToLibao) {
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
}
bundle.putString(EntranceConsts.KEY_GAME_ID, gameId)

View File

@ -119,6 +119,7 @@ import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.openapi.IWBAPI;
import com.sina.weibo.sdk.openapi.WBAPIFactory;
import com.therouter.TheRouter;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
@ -136,6 +137,7 @@ import io.reactivex.SingleSource;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import okhttp3.RequestBody;
@ -166,8 +168,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 +182,11 @@ public class MainActivity extends BaseActivity {
mMainWrapperViewModel = new ViewModelProvider(this, new MainWrapperViewModel.Factory(HaloApp.getInstance()))
.get(MainWrapperViewModel.class);
DisplayUtils.updateGlobalScreen(this);
DisplayUtils.transparentStatusBar(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 +212,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();
@ -227,7 +223,7 @@ public class MainActivity extends BaseActivity {
DialogHelper.showCenterWarningDialog(this, "发生闪退", "光环助手发生了闪退,建议安装到最新版本修复异常"
, "马上反馈", "马上安装修复",
() -> {
DirectUtils.directToGameDetail(this, Constants.GHZS_GAME_ID, "", "crash", true, "desc", null);
DirectUtils.directToGameDetail(this, Constants.GHZS_GAME_ID, "", "crash", true, "desc", null, "");
return null;
},
() -> {
@ -260,9 +256,12 @@ public class MainActivity extends BaseActivity {
// 跳转至其它页面
if (getIntent() != null
&& getIntent().getExtras() != null
&& getIntent().getBooleanExtra(EntranceConsts.KEY_REQUIRE_REDIRECT, false)) {
doSkip();
&& getIntent().getExtras() != null) {
if (getIntent().getBooleanExtra(EntranceConsts.KEY_REQUIRE_REDIRECT, false)) {
doSkip();
} else if (!TextUtils.isEmpty(getIntent().getStringExtra(EntranceConsts.KEY_THE_ROUTER_PATH))) {
doRedirect(getIntent().getStringExtra(EntranceConsts.KEY_THE_ROUTER_PATH));
}
}
// debug 模式下的快速跳转页面
@ -273,6 +272,7 @@ public class MainActivity extends BaseActivity {
if (mShouldShowAd) {
showAd();
} else {
doInitMainFragment(mTempSavedInstanceState);
hideTextAd();
hideSplashAd();
}
@ -328,6 +328,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()
@ -443,6 +460,10 @@ public class MainActivity extends BaseActivity {
handler.removeCallbacksAndMessages(null);
releaseExoSourceCache();
// 移除推送触发启动记录
HaloApp.remove(Constants.PUSH_MESSAGE_ID);
HaloApp.remove(Constants.PUSH_LINK_ENTITY);
}
/**
@ -541,19 +562,31 @@ public class MainActivity extends BaseActivity {
protected void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == COUNTDOWN_AD || msg.what == COUNTDOWN_SDK_AD) {
mCountdownCount++;
int maxCount;
if (msg.what == COUNTDOWN_AD) {
maxCount = mCountdownMaxCount;
} else {
maxCount = COUNTDOWN_SDK_MAX_COUNT;
}
// 读秒到一半的时候初始化 MainWrapperFragment
if (mCountdownCount == maxCount / 2) {
doInitMainFragment(mTempSavedInstanceState);
}
mCountdownCount++;
if (maxCount < mCountdownCount) {
AdDelegateHelper.INSTANCE.setShowingSplashAd(false);
hideSplashAd();
if (msg.what == COUNTDOWN_AD && msg.obj instanceof StartupAdEntity) {
StartupAdEntity ad = (StartupAdEntity) msg.obj;
if (!AdDelegateHelper.INSTANCE.isOwnerSplashAdShown()) {
com.gh.common.util.NewFlatLogUtils.logSplashAdFail(ad.getId(), "广告加载超时");
}
AdDelegateHelper.INSTANCE.setOwnerSplashAdShown(false);
LinkEntity linkEntity = ad.getJump();
SensorsBridge.trackEvent(
"SplashAdOwnSkip",
@ -633,10 +666,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);
}
@ -794,6 +828,19 @@ public class MainActivity extends BaseActivity {
}, 500);
}
/**
* 重定向至 TheRouter 配置的页面
*/
private void doRedirect(String path) {
if (getIntent().getExtras() != null) {
// 更新 intent 数据,避免页面重建重新跳转
getIntent().getExtras().putString(EntranceConsts.KEY_THE_ROUTER_PATH, "");
AppExecutor.getUiExecutor().executeWithDelay(() -> {
TheRouter.build(path).navigation(this);
}, 500L);
}
}
@NonNull
private Function0<Unit> launchGame(String gamePackageName) {
return () -> {
@ -854,7 +901,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 +1094,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);
@ -1055,4 +1105,12 @@ public class MainActivity extends BaseActivity {
}
}
}
@Override
public Pair<String, String> getBusinessId() {
if (mMainWrapperFragment != null) {
return mMainWrapperFragment.getBusinessId();
}
return super.getBusinessId();
}
}

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.*
@ -90,7 +91,6 @@ open class SearchActivity : BaseActivity() {
mSourceEntrance = intent.getStringExtra(EntranceConsts.KEY_SOURCE_ENTRANCE) ?: ""
val hint = intent.getStringExtra(EntranceConsts.KEY_HINT)
val searchImmediately = intent.getBooleanExtra(KEY_SEARCH_IMMEDIATELY, false)
var ignoreTextChanges = savedInstanceState != null
mPublishSubject = PublishSubject.create()
@ -101,12 +101,9 @@ open class SearchActivity : BaseActivity() {
.subscribe {
if (searchEt.text.isNotEmpty()
&& searchEt.text != searchEt.hint
&& !ignoreTextChanges
) {
search(SearchType.AUTO, it)
}
ignoreTextChanges = false
}
initSearchBar()
@ -190,6 +187,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)
@ -200,7 +198,6 @@ open class SearchActivity : BaseActivity() {
protected open fun handleEmptySearch(newSearchKey: String) {
popBackToFragment(SearchDefaultFragment::class.java.name)// 回退到搜索首页
updateDisplayType(DisplayType.DEFAULT)
mPublishSubject?.onNext(newSearchKey)
}
@ -243,6 +240,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)
@ -311,6 +324,19 @@ open class SearchActivity : BaseActivity() {
// MtaHelper.onEvent("游戏搜索", "主动搜索", newSearchKey)
}
override fun onResume() {
super.onResume()
val newSearchKey = searchEt.text.toString().trim { it <= ' ' }
if (newSearchKey.isBlank()) {
try {
popBackToFragment(SearchDefaultFragment::class.java.name)
} catch (e: Exception) {
// no implement
}
}
}
protected open fun provideDao(): ISearchHistoryDao = SearchHistoryDao(this)
open fun updateDisplayType(type: DisplayType) {
@ -381,7 +407,7 @@ open class SearchActivity : BaseActivity() {
}
protected fun popBackToFragment(tag: String) {
supportFragmentManager.popBackStack(tag, 0)
supportFragmentManager.popBackStackAllowStateLoss(tag, 0)
}
@Subscribe(threadMode = ThreadMode.MAIN)
@ -390,6 +416,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 +461,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 +469,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 +519,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 +529,7 @@ enum class SearchType(var value: String) {
MANUAL -> "主动搜索"
HOT -> "热门搜索"
RANK -> "榜单搜索"
DISCOVERY -> "搜索发现"
}
companion object {

View File

@ -5,11 +5,12 @@ import android.content.Intent
import android.os.Bundle
import android.os.Parcelable
import android.view.View
import com.gh.gamecenter.amway.AmwaySuccessFragment
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.amway.AmwaySuccessFragment
import com.gh.gamecenter.gamedetail.LibaoListFragment
import com.gh.gamecenter.gamedetail.cloudarchive.CloudArchiveFragment
import com.gh.gamecenter.gamedetail.libao.LibaoListFragment
import com.halo.assistant.fragment.SwitchInstallMethodFragment
import com.halo.assistant.fragment.user.ManuallyRealNameFragment
import com.halo.assistant.fragment.user.RealNameInfoFragment
@ -38,6 +39,7 @@ class ShellActivity : ToolBarActivity() {
Type.REAL_NAME_INFO -> startFragment(RealNameInfoFragment().with(bundle))
Type.MANUALLY_REAL_NAME -> startFragment(ManuallyRealNameFragment().with(extraData))
Type.SIMPLE_LIBAO_LIST -> startFragment(LibaoListFragment.newInstance(extraData))
Type.CLOUD_ARCHIVE -> startFragment(CloudArchiveFragment().with(extraData))
}
}
@ -72,7 +74,8 @@ class ShellActivity : ToolBarActivity() {
SWITCH_INSTALL_METHOD("switch_install_method"),
REAL_NAME_INFO("real_name_info"),
MANUALLY_REAL_NAME("manually_real_name"),
SIMPLE_LIBAO_LIST("simple_libao_list");
SIMPLE_LIBAO_LIST("simple_libao_list"),
CLOUD_ARCHIVE("cloud_archive");
companion object {
fun fromString(typeString: String): Type {

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_OTHER;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_PUSH;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ANSWER;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ARCHIVE_LOGIN;
@ -35,6 +36,7 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_VIDEO_STREAM
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_VIDEO_STREAMING_HOME;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_WEB;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_DATA;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_FROM;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_GAME_NAME;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_NAME;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_PACKAGENAME;
@ -62,16 +64,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;
@ -100,7 +102,6 @@ public class SkipActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri uri = getIntent().getData();
Bundle bundle;
if (uri != null) {
@ -160,7 +161,8 @@ public class SkipActivity extends BaseActivity {
DirectUtils.directToArticle(this, path, entrance);
break;
case HOST_GAME:
DirectUtils.directToGameDetail(this, path, "", entrance, "true".equals(uri.getQueryParameter("auto_download")), to, null);
String from = uri.getQueryParameter(KEY_FROM);
DirectUtils.directToGameDetail(this, path, "", entrance, "true".equals(uri.getQueryParameter("auto_download")), to, null, from);
break;
case HOST_COLUMN:
DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), entrance, null, SubjectData.SubjectType.NORMAL);
@ -180,7 +182,7 @@ public class SkipActivity extends BaseActivity {
DirectUtils.directToAnswerDetail(this, path, entrance, pathName);
break;
case HOST_QUESTION:
DirectUtils.directToQuestionDetail(this, path, entrance, pathName, "");
DirectUtils.directToQuestionDetail(this, path, entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
case HOST_TOOLBOX:
DirectUtils.directToToolbox(this, uri.getQueryParameter("gameId"), uri.getQueryParameter("toolboxUrl"), entrance);
@ -190,7 +192,7 @@ public class SkipActivity extends BaseActivity {
break;
// 社区文章格式一
case "community.article":
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), entrance, pathName, "");
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
// 社区文章格式二
case "communities":
@ -211,13 +213,13 @@ public class SkipActivity extends BaseActivity {
}
}
if ("articles".equals(type)) {
DirectUtils.directToCommunityArticle(this, typeId, communityId, entrance, pathName, "");
DirectUtils.directToCommunityArticle(this, typeId, communityId, entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
}
break;
case HOST_VIDEO:
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.HOTTEST_GAME_VIDEO.getValue(),
false, id, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
false, id, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
case HOST_UPLOAD_VIDEO://跳转上传视频
String titleParameter = uri.getQueryParameter("title");
@ -237,7 +239,7 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_VIDEO_SINGLE:
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.getValue(),
false, "", entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
false, "", entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
case HOST_VIDEO_MORE:
gameId = uri.getQueryParameter("gameId");
@ -294,7 +296,7 @@ public class SkipActivity extends BaseActivity {
EntranceUtils.jumpActivityCompat(this, bundle);
break;
case EntranceConsts.HOST_VIDEO_DETAIL:
DirectUtils.directToVideoDetail(this, path, entrance, "", "");
DirectUtils.directToVideoDetail(this, path, entrance, "", isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
break;
case HOST_LIBAO:
DirectUtils.directToGiftDetail(this, path, entrance);
@ -315,7 +317,7 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_COLUMN_COLLECTION:
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null,false);
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null, false);
break;
case EntranceConsts.HOST_BLOCK:
name = uri.getQueryParameter("name");
@ -356,8 +358,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, "", isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
}
} catch (Exception e) {
e.printStackTrace();
@ -414,13 +416,13 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_ARCHIVE_LOGIN:
String gamePkg = uri.getQueryParameter(EntranceConsts.KEY_GAME_PKG);
if(CheckLoginUtils.isLogin()) {
if (CheckLoginUtils.isLogin()) {
VHelper.INSTANCE.updateAuthorizeInfo(true);
} else {
Bundle newBundle = new Bundle();
newBundle.putString(EntranceConsts.KEY_TO, LoginActivity.class.getName());
EntranceUtils.jumpActivityCompat(this, newBundle, null, (resultCode, data) -> {
if(CheckLoginUtils.isLogin()) {
if (CheckLoginUtils.isLogin()) {
VHelper.INSTANCE.updateAuthorizeInfo(true);
}
VHelper.launch(this, gamePkg, false, false);

View File

@ -5,6 +5,7 @@ import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
@ -14,8 +15,8 @@ import androidx.core.app.NotificationCompat
import androidx.core.text.bold
import androidx.core.text.buildSpannedString
import androidx.core.text.color
import com.therouter.router.Route
import com.therouter.TheRouter
import com.therouter.router.Route
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
import com.gh.common.util.DeviceTokenUtils
import com.gh.common.util.DialogUtils
@ -26,6 +27,9 @@ import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_FROM
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_GAMEID
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger
import com.gh.gamecenter.common.utils.*
@ -90,8 +94,10 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
showPrivacyDialog()
} else {
val spanBuilder = buildSpannedString {
append("这个弹窗只会在右上角有环境标签的测试包出现" +
"\n进入应用以后还可以到关于我们页面长按应用图标重新选择")
append(
"这个弹窗只会在右上角有环境标签的测试包出现" +
"\n进入应用以后还可以到关于我们页面长按应用图标重新选择"
)
bold {
color(com.gh.gamecenter.common.R.color.text_theme.toColor(this@SplashScreenActivity)) {
append("\n点击这里进行预设置渠道")
@ -103,7 +109,7 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
executeDex2OatInAdvance()
DialogHelper.showDialog(
context = this,
title ="选择环境",
title = "选择环境",
content = spanBuilder,
confirmText = "正式环境",
cancelText = "测试环境",
@ -144,6 +150,10 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
val trackEvent = JSONObject()
// 是否首次使用神策
val isFirstTime = SPUtils.getBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, true)
val therouterPath = intent.extras?.getString(EntranceConsts.KEY_THE_ROUTER_PATH) ?: ""
val uri = Uri.parse(therouterPath)
val isFromWechat = WECHAT_APPOINTMENT == if (!uri.isOpaque) uri.getQueryParameter(KEY_FROM) else false
val gameId = if (!uri.isOpaque) uri.getQueryParameter(KEY_GAMEID) else ""
tryCatchInRelease {
trackEvent.run {
put("\$is_first_time", isFirstTime)
@ -153,6 +163,10 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
put("signature", signatureHash)
put("app_name", appProvider?.getAppName())
put("install_first_time", if (HaloApp.getInstance().isBrandNewInstall) "" else "")
if (isFromWechat) {
put("source_entrance", WECHAT_NOTIFICATION)
put("page_business_id", gameId)
}
}
}
SensorsBridge.trackEvent("AppLaunch", trackEvent)
@ -282,11 +296,11 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
SensorsBridge.setOAID(HaloApp.getInstance().oaid)
val pushProvider = TheRouter.get(IPushProvider::class.java)
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() {
@ -323,6 +337,9 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
const val HONOR_CULPRIT_ID = 12324
const val HONOR_CULPRIT_CHANNEL = "荣耀通道"
private const val WECHAT_APPOINTMENT = "wechat_appointment"
private const val WECHAT_NOTIFICATION = "微信通知"
@JvmStatic
fun getSplashScreenIntent(context: Context?, bundle: Bundle?): Intent {
val intent = Intent(context, SplashScreenActivity::class.java)

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(

View File

@ -2,6 +2,7 @@ package com.gh.gamecenter.adapter;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.text.Html;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
@ -12,6 +13,7 @@ import android.text.style.ClickableSpan;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
@ -20,9 +22,14 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
import com.facebook.drawee.generic.RoundingParams;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.common.util.DirectUtils;
import com.gh.common.util.LibaoUtils;
import com.gh.gamecenter.GameDetailActivity;
import com.gh.gamecenter.ImageViewerActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.adapter.viewholder.LibaoDetailContentViewHolder;
import com.gh.gamecenter.adapter.viewholder.LibaoDetailTopViewHolder;
@ -31,6 +38,7 @@ import com.gh.gamecenter.common.entity.SimpleGameEntity;
import com.gh.gamecenter.common.entity.SuggestType;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.PicassoImageGetter;
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
import com.gh.gamecenter.core.utils.DisplayUtils;
@ -79,6 +87,7 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
private String mEntrance;
private final int TYPE_FOOTER = 100;
public LibaoDetailTopViewHolder libaoDetailTopViewHolder;
private ArrayList<View> mImageViewList = new ArrayList<>();
public LibaoDetailAdapter(Context context, OnRequestCallBackListener onRequestCallBackListener,
OnCodeScrollListener onCodeScrollListener, LibaoEntity libaoEntity,
@ -317,6 +326,35 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
holder.binding.libaodetailContentLl.setVisibility(View.VISIBLE);
holder.binding.libaodetailContent.setText(Html.fromHtml(mLibaoEntity.getContent()));
}
if (mLibaoEntity.getMaterials().isEmpty()) {
holder.binding.horizontalScrollView.setVisibility(View.GONE);
} else {
holder.binding.horizontalScrollView.setVisibility(View.VISIBLE);
holder.binding.imagesContainer.removeAllViews();
mImageViewList.clear();
for (int i = 0; i < mLibaoEntity.getMaterials().size(); i++) {
String imageUrl = mLibaoEntity.getMaterials().get(i).getImg();
SimpleDraweeView imageView = new SimpleDraweeView(mContext);
RoundingParams roundingParams = new RoundingParams();
roundingParams.setCornersRadius(DisplayUtils.dip2px(4F));
roundingParams.setOverlayColor(ContextCompat.getColor(mContext, com.gh.gamecenter.common.R.color.ui_surface));
imageView.setHierarchy(new GenericDraweeHierarchyBuilder(mContext.getResources())
.setFadeDuration(500)
.setRoundingParams(roundingParams)
.setPlaceholderImage(com.gh.gamecenter.common.R.drawable.occupy, ScalingUtils.ScaleType.FIT_XY)
.build());
ImageUtils.display(imageView, imageUrl);
final int index = i;
imageView.setOnClickListener(v -> {
Intent intent = ImageViewerActivity.getIntent(mContext, mLibaoEntity.getMaterialImgList(), index, mImageViewList, mEntrance);
mContext.startActivity(intent);
});
mImageViewList.add(imageView);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(DisplayUtils.dip2px(24F), DisplayUtils.dip2px(24F));
layoutParams.setMargins(DisplayUtils.dip2px(i == 0 ? 8F : 16F), 0, 0, 0);
holder.binding.imagesContainer.addView(imageView, layoutParams);
}
}
if (mLibaoDetailEntity != null) {
holder.binding.libaodetailTimeLl.setVisibility(View.VISIBLE);

View File

@ -4,8 +4,11 @@ import android.content.Context
import android.content.Intent
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.Group
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity
import com.airbnb.lottie.LottieAnimationView
@ -13,6 +16,7 @@ import com.gh.common.chain.*
import com.gh.common.constant.Config
import com.gh.common.dialog.DeviceRemindDialog
import com.gh.common.dialog.GameOffServiceDialogFragment
import com.gh.common.dialog.PackageCheckDialogFragment
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.history.HistoryHelper
import com.gh.common.simulator.NewSimulatorGameManager
@ -31,7 +35,6 @@ import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.utils.NewFlatLogUtils
import com.gh.gamecenter.core.runOnIoThread
@ -44,8 +47,10 @@ import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.feature.view.DownloadButton.ButtonStyle
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.GameDetailViewModel
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
import com.gh.gamecenter.teenagermode.TeenagerModeActivity.Companion.getIntent
import com.gh.vspace.VHelper
import com.lightgame.download.DownloadEntity
@ -56,13 +61,16 @@ import java.io.File
// 虽然叫 ViewHolder但其实就是一个用来临时放 View 和相关操作的包裹类
class DetailViewHolder(
view: View,
val viewModel: GameDetailViewModel?,
val gameEntity: GameEntity,
val isNewsDetail: Boolean, // 新闻详情不显示下载的游戏名, 只显示下载状态
entrance: String?,
name: String?,
title: String?,
val traceEvent: ExposureEvent?,
val isSupportDualButton: Boolean = false // 是否支持双下载按钮,不支持的时候跟普通列表意义选用优先级高的那个来显示
val isSupportDualButton: Boolean = false, // 是否支持双下载按钮,不支持的时候跟普通列表意义选用优先级高的那个来显示,
val acceleratorUiHelper: GameDetailAcceleratorUiHelper? = null, // 网速加速,只有游戏详情才有
onDownloadClickAction: ((Boolean) -> Unit)? = null
) {
var context: Context
var downloadBottom: View
@ -90,20 +98,30 @@ class DetailViewHolder(
// 多版本下载文字
var multiVersionDownloadTv: TextView?
// 加速按钮
val speedContainer: ConstraintLayout?
private val ivFreeVipTag: ImageView?
private val gMoreZone: Group?
// 注意 View 的命名
init {
downloadBottom = view.findViewById(R.id.detail_ll_bottom)
downloadPb = view.findViewById(R.id.detail_progressbar)
downloadTips = view.findViewById(R.id.downloadTipsLottie)
downloadPb = downloadBottom.findViewById(R.id.detail_progressbar)
downloadTips = downloadBottom.findViewById(R.id.downloadTipsLottie)
overlayTv = view.findViewById(R.id.overlayTv)
overlayContainer = view.findViewById(R.id.overlayContainer)
extraOverlayTv = view.findViewById(R.id.extraOverlayTv)
multiVersionDownloadTv = view.findViewById(R.id.multiVersionDownloadTv)
multiVersionDownloadTv = downloadBottom.findViewById(R.id.multiVersionDownloadTv)
localDownloadContainer = view.findViewById(R.id.localDownloadContainer)
localDownloadSizeTv = view.findViewById(R.id.localDownloadSizeTv)
localDownloadTitleTv = view.findViewById(R.id.localDownloadTitleTv)
localDownloadButton = view.findViewById(R.id.localDownloadButton)
speedContainer = view.findViewById(R.id.cl_speed_container)
ivFreeVipTag = view.findViewById(R.id.iv_free_vip_tag)
gMoreZone = view.findViewById(R.id.g_more_zone)
context = view.context
var gameDownloadMode = gameEntity.getGameDownloadButtonMode()
@ -115,7 +133,8 @@ class DetailViewHolder(
mTitle = title ?: "",
mAsVGame = false,
mShowDualDownloadButton = gameDownloadMode == GameEntity.GAME_DOWNLOAD_BUTTON_MODE_DUAL,
mTraceEvent = traceEvent
mTraceEvent = traceEvent,
onDownloadClickAction = onDownloadClickAction
)
val vGameDownloadListener = OnDetailDownloadClickListener(
@ -125,7 +144,8 @@ class DetailViewHolder(
mTitle = title ?: "",
mAsVGame = true,
mShowDualDownloadButton = gameDownloadMode == GameEntity.GAME_DOWNLOAD_BUTTON_MODE_DUAL,
mTraceEvent = traceEvent
mTraceEvent = traceEvent,
onDownloadClickAction = onDownloadClickAction
)
// 不支持双下载按钮的情况时,优选一个下载方式显示
@ -158,7 +178,9 @@ class DetailViewHolder(
localDownloadButton?.putObject(gameEntity)
localDownloadButton?.setTag(
com.gh.gamecenter.feature.R.string.download, context.getString(
com.gh.gamecenter.feature.R.string.download_local))
com.gh.gamecenter.feature.R.string.download_local
)
)
}
}
downloadPb.putWidgetBusinessName("游戏详情页")
@ -176,6 +198,33 @@ class DetailViewHolder(
gamePermissionDialogFragment?.dismissAllowingStateLoss()
}
fun checkIfShowSpeedUi(rawBtnText: String) {
acceleratorUiHelper?.let {
when {
rawBtnText == "启动" && gameEntity.canSpeed -> {
downloadPb.goneIf(true)
localDownloadButton?.goneIf(true)
it.checkIfShowSpeedUi(true)
}
rawBtnText == "更新" && gameEntity.canSpeed -> {
it.checkIfShowSpeedUi(true)
}
else -> {
it.checkIfShowSpeedUi(false)
}
}
}
}
fun setSpeedViewsVisible(isVisible: Boolean) {
ivFreeVipTag?.goneIf(!isVisible)
speedContainer?.goneIf(!isVisible)
}
internal class OnDetailDownloadClickListener(
private val mViewHolder: DetailViewHolder,
private val mEntrance: String?,
@ -183,7 +232,8 @@ class DetailViewHolder(
private val mTitle: String,
private val mAsVGame: Boolean,
private val mShowDualDownloadButton: Boolean,
private val mTraceEvent: ExposureEvent?
private val mTraceEvent: ExposureEvent?,
private val onDownloadClickAction: ((Boolean) -> Unit)? = null
) : View.OnClickListener {
private val mGameEntity: GameEntity = mViewHolder.gameEntity
@ -194,6 +244,10 @@ class DetailViewHolder(
if (mGameEntity.isLandPageAddressDialog() && !mGameEntity.isLandPageAddressDialogShowOnly()) {
// 第三方落地页为开启状态并且展示状态不为“仅显示弹窗”,需要在点击确认后显示弹窗
DialogUtils.showLandPageAddressDialog(mViewHolder.context, mGameEntity) {
val packageName = mGameEntity.getApk().firstOrNull()?.packageName
if (packageName?.isNotEmpty() == true) {
PackageChangeHelper.addInstallPendingPackage(packageName)
}
DirectUtils.directToExternalBrowser(mViewHolder.context, mGameEntity.landPageAddressDialog!!.link!!)
}
}
@ -271,14 +325,22 @@ class DetailViewHolder(
ButtonStyle.NONE_WITH_HINT, ButtonStyle.NONE -> {
val offStatus = mGameEntity.downloadOffStatus
if (offStatus != null && "off" != offStatus) {
if ("dialog" == offStatus) {
showOffServiceDialog(mGameEntity.downloadOffDialog) {
when (offStatus) {
"dialog" -> {
showOffServiceDialog(mGameEntity.downloadOffDialog) {
showLandPageAddressDialogIfNeeded()
}
}
"toast" -> {
mViewHolder.viewModel?.performTabSelected(GameDetailTabEntity.TYPE_COMMENT)
ToastUtils.toast("该游戏因故暂不提供下载,具体详情可在相关评论中查看,敬请谅解~")
showLandPageAddressDialogIfNeeded()
}
"third_party" -> {
showLandPageAddressDialogIfNeeded()
}
} else if ("toast" == offStatus) {
EventBus.getDefault().post(EBReuse(GameDetailFragment.SKIP_RATING))
ToastUtils.toast("该游戏因故暂不提供下载,具体详情可在相关评论中查看,敬请谅解~")
showLandPageAddressDialogIfNeeded()
}
} else {
ToastUtils.toast("该游戏已关闭下载")
@ -324,7 +386,19 @@ class DetailViewHolder(
if (mAsVGame) {
VHelper.installOrLaunch(mViewHolder.context, mGameEntity, null)
} else {
PackageLauncher.launchApp(mViewHolder.context, mGameEntity, mGameEntity.getUniquePackageName())
// 如果游戏配置了加速,则启动时需要进行包名检测
if (mGameEntity.canSpeed) {
PackageCheckDialogFragment.show(mViewHolder.context as AppCompatActivity, mGameEntity) {
PackageLauncher.launchApp(
mViewHolder.context, mGameEntity, mGameEntity.getUniquePackageName()
)
}
} else {
PackageLauncher.launchApp(
mViewHolder.context, mGameEntity, mGameEntity.getUniquePackageName()
)
}
}
} else {
GamePermissionDialogFragment.show(
@ -344,7 +418,8 @@ class DetailViewHolder(
gameEntity = mGameEntity,
traceEvent = mTraceEvent,
entrance = StringUtils.buildString(mEntrance, "+(", mName, "[", mTitle, "])"),
location = "$mName:$mTitle"
location = "$mName:$mTitle",
onDownloadClickAction = onDownloadClickAction
)
}
}
@ -455,17 +530,9 @@ class DetailViewHolder(
}
ButtonStyle.RESERVED -> {
if ("download" == mGameEntity.reserveStatus) {
ReservationHelper.showDeleteReservationDialog(mViewHolder.context) {
ReservationHelper.deleteReservation(mGameEntity) {
DetailDownloadUtils.updateViewHolder(mViewHolder)
}
}
} else {
ReservationHelper.showCancelReservationDialog(mViewHolder.context, mGameEntity) {
ReservationHelper.cancelReservation(mGameEntity) {
DetailDownloadUtils.updateViewHolder(mViewHolder)
}
ReservationHelper.showCancelReservationDialog(mViewHolder.context, mGameEntity) {
ReservationHelper.cancelReservation(mGameEntity) {
DetailDownloadUtils.updateViewHolder(mViewHolder)
}
}
}
@ -592,8 +659,9 @@ class DetailViewHolder(
val apkEntity = mGameEntity.getApk().firstOrNull()
val msg = FileUtils.isCanDownload(mViewHolder.context, apkEntity?.size ?: "")
if (TextUtils.isEmpty(msg)) {
val btnContainsUpdateText = mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update_v) == buttonText
|| buttonText.contains(mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update))
val btnContainsUpdateText =
mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update_v) == buttonText
|| buttonText.contains(mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update))
if (asVGame && btnContainsUpdateText) {
VHelper.updateOrReDownload(mGameEntity)
@ -669,6 +737,7 @@ class DetailViewHolder(
builder.addHandler(OverseaDownloadHandler())
builder.addHandler(CheckDownloadHandler())
builder.setProcessEndCallback(mGameEntity.id) { asVGame: Boolean, isSubscribe: Any? ->
performDownloadClickAction()
download(asVGame, isSubscribe as Boolean)
}
} else {
@ -686,7 +755,8 @@ class DetailViewHolder(
mTitle,
"])"
),
"$mName:$mTitle"
"$mName:$mTitle",
onDownloadClickAction
)
}
}
@ -697,5 +767,20 @@ class DetailViewHolder(
mAsVGame
)
}
private fun performDownloadClickAction() {
val buttonText = if (mShowDualDownloadButton && !mAsVGame) {
mViewHolder.localDownloadTitleTv?.text?.ifEmpty {
mViewHolder.downloadPb.text.ifEmpty {
mViewHolder.overlayTv?.text ?: ""
}
}
} else {
mViewHolder.downloadPb.text.ifEmpty { mViewHolder.overlayTv?.text ?: "" }
}
val isUpdate =
buttonText?.contains(mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update)) == true
onDownloadClickAction?.invoke(isUpdate)
}
}
}

View File

@ -1,11 +1,16 @@
package com.gh.gamecenter.authorization
import android.app.Activity
import android.app.Application.ActivityLifecycleCallbacks
import android.app.Dialog
import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.os.UserHandle
import com.gh.common.util.CheckLoginUtils
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
@ -16,8 +21,10 @@ import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.databinding.ActivityAuthorizationBinding
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.login.user.UserRepository
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
/**
@ -68,6 +75,13 @@ class AuthorizationActivity : ToolBarActivity() {
//授权token
private var mToken = ""
/**
* 游戏UID (适配双开/分身游戏)
*/
private var gameUid = -1
private var loadingDialog: Dialog? = null
override fun getLayoutId(): Int {
return R.layout.activity_authorization
}
@ -80,11 +94,16 @@ class AuthorizationActivity : ToolBarActivity() {
mBinding = ActivityAuthorizationBinding.bind(mContentView)
checkParam()
initView()
mBinding.authorizeBtn.postDelayed({
mBaseHandler.post {
if (loadingDialog == null) {
loadingDialog = DialogUtils.showWaitDialog(this, "请稍后...")
}
}
UserRepository.getInstance().loginUserInfo.observe(this) {
checkLogin {
initUserInfo()
}
}, 500)
}
NewFlatLogUtils.logLoginFromGHZSShow(
gameId = gameId,
gameName = gameName
@ -97,14 +116,21 @@ class AuthorizationActivity : ToolBarActivity() {
}
private fun initData() {
if (mToken.isNotEmpty() || isFinishing) return
val loadingDialog = DialogUtils.showWaitDialog(this, "请稍后...")
if (mToken.isNotEmpty() || isFinishing) {
loadingDialog?.dismiss()
return
}
if (loadingDialog == null) {
loadingDialog = DialogUtils.showWaitDialog(this, "请稍后...")
} else if (loadingDialog?.isShowing == false) {
loadingDialog?.show()
}
mViewModel.getAccessToken(listOf(mContent), {
mToken = it
loadingDialog.dismiss()
loadingDialog?.dismiss()
}, {
toast("获取token失败")
loadingDialog.dismiss()
loadingDialog?.dismiss()
})
}
@ -116,7 +142,7 @@ class AuthorizationActivity : ToolBarActivity() {
override fun onRestart() {
super.onRestart()
if (!CheckLoginUtils.isLogin()) {
finish()
finishAndRemoveTask()
} else {
initUserInfo()
initData()
@ -127,12 +153,12 @@ class AuthorizationActivity : ToolBarActivity() {
private fun checkParam() {
val uri = intent.data
if (uri == null) {
finish()
finishAndRemoveTask()
return
}
val host = uri.host
if (host != "authorize") {
finish()
finishAndRemoveTask()
return
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
@ -143,8 +169,9 @@ class AuthorizationActivity : ToolBarActivity() {
mContent = uri.getQueryParameter(EntranceConsts.KEY_CONTENT) ?: ""
gameId = uri.getQueryParameter(EntranceConsts.KEY_GAME_ID) ?: ""
gameName = uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME) ?: ""
gameUid = uri.getQueryParameter(EntranceConsts.KEY_UID)?.toIntOrNull() ?: -1
if (mRemotePkgName == null) {
finish()
finishAndRemoveTask()
return
}
}
@ -152,8 +179,8 @@ class AuthorizationActivity : ToolBarActivity() {
private fun initView() {
//通过包名获取app图标和名称
val pkgName = mRemotePkgName ?: return
val icon = packageManager.getApplicationIcon(pkgName)
val name = packageManager.getApplicationLabel(packageManager.getApplicationInfo(pkgName, 0))
val icon = PackageUtils.getIconByPackageName(this, pkgName)
val name = PackageUtils.getNameByPackageName(this, pkgName)
mBinding.authorizeAppIcon.setImageDrawable(icon)
mBinding.authorizeAppName.text = name
mBinding.authorizeBtn.setOnClickListener {
@ -197,7 +224,7 @@ class AuthorizationActivity : ToolBarActivity() {
val remotePkgName = mRemotePkgName
if (remotePkgName == null) {
logAuthResult(false)
finish()
finishAndRemoveTask()
return
}
if (mToken.isEmpty()) {
@ -217,10 +244,45 @@ class AuthorizationActivity : ToolBarActivity() {
intent.putExtra(EntranceConsts.KEY_USER_ID, userId)
intent.putExtra(EntranceConsts.KEY_USER_NAME, username)
intent.putExtra(EntranceConsts.KEY_USER_AVATAR, userAvatar)
sendBroadcast(intent)
if (gameUid != -1 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
try {
sendBroadcastAsUser(intent, UserHandle.getUserHandleForUid(gameUid))
} catch (e: Exception) {
// 双开/分身游戏进行授权时,如果无 INTERACT_ACROSS_USERS 权限则使用Activity传递授权结果
authByActivity(intent)
return
}
} else {
sendBroadcast(intent)
}
logAuthResult(true)
backToLaunchApp()
finish()
finishAndRemoveTask()
}
private fun authByActivity(intent: Intent) {
intent.setClassName(mRemotePkgName!!, AUTHORIZATION_RESULT_ACTIVITY)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
HaloApp.getInstance().registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {}
override fun onActivityPaused(activity: Activity) {}
override fun onActivityStopped(activity: Activity) {
if (activity == this@AuthorizationActivity) {
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(this)
finishAndRemoveTask()
}
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {
if (activity == this@AuthorizationActivity) {
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(this)
}
}
})
startActivity(intent)
logAuthResult(true)
}
private fun logAuthResult(isSuccess: Boolean) {
@ -242,14 +304,14 @@ class AuthorizationActivity : ToolBarActivity() {
VHelper.launch(this, gamePkg, ignoreGApps = true, showLoading = showLoading)
return
}
val remotePkgName = this.mRemotePkgName
if (remotePkgName != null) {// 跳转回其他授权app
startActivity(packageManager.getLaunchIntentForPackage(remotePkgName))
}
// val remotePkgName = this.mRemotePkgName
// if (remotePkgName != null) {// 跳转回其他授权app
// startActivity(packageManager.getLaunchIntentForPackage(remotePkgName))
// }
}
override fun onBackPressed() {
super.onBackPressed()
finishAndRemoveTask()
backToLaunchApp(false)
@ -264,6 +326,7 @@ class AuthorizationActivity : ToolBarActivity() {
private const val BUTTON_TYPE_CONFIRM = "确定"
private const val BUTTON_TYPE_BACK = "返回"
private const val TYPE_PLUGIN = "plugin"
private const val AUTHORIZATION_RESULT_ACTIVITY = "com.gh.plugin.AuthorizationResultActivity"
}
}

View File

@ -242,7 +242,7 @@ class CategoryV2ListAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity)
BindingAdapters.setGameTags(labelList, gameEntity, "")
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.text = if (gameEntity.commentCount > 3) {
if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString()

View File

@ -2,17 +2,30 @@ package com.gh.gamecenter.cloudarchive
import android.app.Application
import com.gh.gamecenter.common.baselist.ListViewModel
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.entity.ArchiveEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.lightgame.utils.Utils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.*
import retrofit2.HttpException
import java.io.IOException
open class BaseCloudArchiveViewModel(application: Application, private val mConfigUrl: String): ListViewModel<ArchiveEntity, ArchiveEntity>(application) {
open class BaseCloudArchiveViewModel(
application: Application,
private val mGameId: String,
private var mConfigUrl: String
) : ListViewModel<ArchiveEntity, ArchiveEntity>(application) {
private var mArchiveConfigStr = ""
init {
getArchiveConfigString()
if (mConfigUrl.isEmpty()) {
getArchiveConfigUrl()
} else {
getArchiveConfigString()
}
}
// 通过url获取config字符串内容
@ -41,6 +54,27 @@ open class BaseCloudArchiveViewModel(application: Application, private val mConf
}
}
// 获取游戏存档配置url
private fun getArchiveConfigUrl() {
val map = mapOf(
"game_ids" to listOf(mGameId)
)
RetrofitManager.getInstance().newApi.getGamesArchiveConfigs(map.toRequestBody())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : com.gh.gamecenter.common.retrofit.Response<List<ArchiveEntity>>() {
override fun onResponse(response: List<ArchiveEntity>?) {
mConfigUrl = response?.find { it.gameId == mGameId }?.configUrl ?: return
getArchiveConfigString()
}
override fun onFailure(e: HttpException?) {
super.onFailure(e)
Utils.toast(getApplication(), "获取存档配置失败")
}
})
}
override fun provideDataObservable(page: Int): Observable<List<ArchiveEntity>>? = null
override fun mergeResultLiveData() {}

View File

@ -216,7 +216,7 @@ class CloudArchiveManagerActivity : BaseActivity_TabLayout(), ArchiveLimitSelect
private fun initDownloadBtn() {
mGameEntity?.let { gameEntity ->
DownloadItemUtils.updateDownloadButton(this, mBinding.downloadBtn, gameEntity)
DownloadItemUtils.updateDownloadButton(this, mBinding.downloadBtn, gameEntity, listener = null)
DownloadItemUtils.setOnClickListener(this, mBinding.downloadBtn, gameEntity, 0, null, mEntrance, "")
}
}

View File

@ -8,7 +8,6 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.entity.ArchiveEntity
@ -22,7 +21,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import okhttp3.*
import okhttp3.ResponseBody
import retrofit2.HttpException
class CloudArchiveManagerViewModel(
@ -30,7 +29,7 @@ class CloudArchiveManagerViewModel(
val gameId: String,
val gameName: String,
configUrl: String
) : BaseCloudArchiveViewModel(application, configUrl) {
) : BaseCloudArchiveViewModel(application, gameId, configUrl) {
companion object {
private const val SORT_TYPE_CREATE = "time.create:-1"

View File

@ -132,6 +132,13 @@ class GamesCollectionAdapter(
)
mExposureEventArray?.put(position, exposureEvent)
val path = when (mViewModel.type) {
GamesCollectionFragment.TYPE_COLLECT -> "我的收藏-游戏单"
GamesCollectionFragment.TYPE_HISTORY -> "浏览记录-游戏单"
GamesCollectionFragment.TYPE_USER -> "个人主页-游戏单"
else -> ""
}
holder.binding.run {
ImageUtils.display(poster, itemEntity.cover)
nameTv.text = itemEntity.title
@ -249,12 +256,6 @@ class GamesCollectionAdapter(
}
userIcon.setOnClickListener {
val path = when (mViewModel.type) {
GamesCollectionFragment.TYPE_COLLECT -> "我的收藏-游戏单"
GamesCollectionFragment.TYPE_HISTORY -> "浏览记录-游戏单"
GamesCollectionFragment.TYPE_USER -> "个人主页-游戏单"
else -> ""
}
DirectUtils.directToHomeActivity(mContext, itemEntity.user?.id, "", path)
}
userName.setOnClickListener { userIcon.performClick() }
@ -266,7 +267,8 @@ class GamesCollectionAdapter(
mContext,
itemEntity.id,
isScrollToCommentArea = true,
exposureSourceList = ArrayList(exposureEvent.source)
exposureSourceList = ArrayList(exposureEvent.source),
entrance = path
)
)
}
@ -329,7 +331,8 @@ class GamesCollectionAdapter(
GameCollectionDetailActivity.getIntent(
mContext,
itemEntity.id,
exposureSourceList = ArrayList(exposureEvent.source)
exposureSourceList = ArrayList(exposureEvent.source),
entrance = path
)
)
} else {

View File

@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.IExposable
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.PackageChangeHelper
import com.gh.common.util.PackageInstaller
import com.gh.common.util.PackageLauncher
import com.gh.download.DownloadManager
@ -398,6 +399,10 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
if (update.isLandPageAddressDialogShowOnly()) {
updateOrPluggable(updateBtn, update, downloadEntity, pluginDesc)
} else {
val packageName = update.packageName
if (packageName.isNotEmpty() == true) {
PackageChangeHelper.addInstallPendingPackage(packageName)
}
DirectUtils.directToExternalBrowser(it.context, update.landPageAddressDialog!!.link!!)
}
}

View File

@ -15,6 +15,7 @@ import com.gh.gamecenter.common.base.BaseSimpleDao
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.GsonUtils.toJson
@ -629,6 +630,7 @@ class UpdatableGameViewModel(
downloadEntity.addMetaExtra(Constants.APK_MD5, update.md5)
downloadEntity.addMetaExtra(Constants.GAME_NAME, update.name)
downloadEntity.addMetaExtra(Constants.GAME_CATEGORY_IN_CHINESE, update.categoryChinese)
downloadEntity.addMetaExtra(Constants.DOWNLOAD_STATUS_IN_CHINESE, update.downloadStatusChinese)
downloadEntity.putGameCategory(update.category ?: "")
if (update.isModdedGame) {
downloadEntity.addMetaExtra(Constants.EXTRA_IS_MODDED_GAME, "true")
@ -685,6 +687,9 @@ class UpdatableGameViewModel(
// 收集下载数据
DataCollectionUtils.uploadDownload(getApplication(), downloadEntity, "开始")
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
SensorsBridge.trackEventWithExposureSource(
"DownloadProcessBegin",
event.source,
@ -700,6 +705,9 @@ class UpdatableGameViewModel(
"last_page_business_id", getLastPageEntity().pageBusinessId,
"download_status", update.downloadStatusChinese,
"download_type", "本地下载",
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
)
}

View File

@ -1,10 +1,10 @@
package com.gh.gamecenter.entity
import com.gh.gamecenter.feature.entity.SimpleGame
import com.gh.gamecenter.feature.entity.Count
import com.gh.gamecenter.feature.entity.SimpleGame
import com.google.gson.annotations.SerializedName
data class GameDetailRecommendGameEntity(
data class GameDetailRecommendGameCollectionEntity(
@SerializedName("_id")
val id: String = "",
val cover: String = "",

View File

@ -0,0 +1,16 @@
package com.gh.gamecenter.entity
import com.gh.gamecenter.feature.entity.SimpleGame
import com.google.gson.annotations.SerializedName
class GameServerTestTopGame(
@SerializedName("_id")
var id: String = "",
var game: SimpleGame? = null,
@SerializedName("column_test_v2_icon")
var icon: String = "",
@SerializedName("event_description")
var description: String = "",
@SerializedName("event_date")
var date: String = ""
)

View File

@ -0,0 +1,11 @@
package com.gh.gamecenter.entity
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
data class HistoryGameDetailEntity(
@PrimaryKey
var id: String = "",
var name: String? = "",
)

View File

@ -11,6 +11,8 @@ class ReserveReminderEntity(
private var _smsConfig: SmsConfig? = null,
@SerializedName("wechat_config")
private var _wechatConfig: WechatConfigEntity? = null,
@SerializedName("calendar_config")
private var _calendarConfig: CalendarConfig? = null,
@SerializedName("mirror_type")
private val _mirrorType: String? = null,
@SerializedName("wifi_auto_download")
@ -34,8 +36,14 @@ class ReserveReminderEntity(
_wechatConfig = value
}
val onlyShowWechatReminder: Boolean
get() = _smsConfig == null
val hasCalendarConfig: Boolean
get() = _calendarConfig != null
var calendarConfig: CalendarConfig
get() = _calendarConfig ?: CalendarConfig()
set(value) {
_calendarConfig = value
}
val mirrorType: String
get() = _mirrorType ?: ""
@ -81,4 +89,39 @@ class ReserveReminderEntity(
}
}
@Parcelize
class CalendarConfig(
@SerializedName("notice")
private val _notice: Boolean? = null,
@SerializedName("title")
private val _title: String? = null,
@SerializedName("time_start")
private val _timeStart: Long? = null,
@SerializedName("time_end")
private val _timeEnd: Long? = null,
@SerializedName("advance_seconds")
private val _advanceSeconds: Long? = null,
@SerializedName("remark")
private val _remark: String? = null
) : Parcelable {
val notice: Boolean
get() = _notice ?: false
val title: String
get() = _title ?: ""
val timeStart: Long
get() = _timeStart ?: 0L
val timeEnd: Long
get() = _timeEnd ?: 0L
val advanceSeconds: Long
get() = _advanceSeconds ?: 0L
val remark: String
get() = _remark ?: ""
}
}

View File

@ -18,7 +18,13 @@ data class SearchSubjectEntity(
@SerializedName("ad_icon_active")
val adIconActive: Boolean = false,
// 本地字段标记是否为微信小游戏CPM专题
var isWGameSubjectCPM: Boolean = false
var isWGameSubjectCPM: Boolean = false,
val type: String = ""
) : Parcelable {
companion object {
const val TYPE_WECHAT_GAME_CPM_COLUMN = "wechat_game_cpm_column"
}
fun getFilterGame() = RegionSettingHelper.filterGame(games)
}

View File

@ -130,12 +130,13 @@ data class SubjectEntity(
@IgnoredOnParcel
private var filteredData: MutableList<GameEntity>? = null
val subjectType: SubjectData.SubjectType get() = when {
isQQColumn -> SubjectData.SubjectType.QQ_GAME
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
else -> SubjectData.SubjectType.NORMAL
}
val subjectType: SubjectData.SubjectType
get() = when {
isQQColumn -> SubjectData.SubjectType.QQ_GAME
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
else -> SubjectData.SubjectType.NORMAL
}
val isMiniGame: Boolean get() = isQQColumn || isWechatColumn
@ -148,4 +149,11 @@ data class SubjectEntity(
val list: Int
get() = max(min(_list ?: 0, data?.size ?: 0), 1)
companion object {
const val SUBJECT_TAG_UPDATE = "update" // 更新时间
const val SUBJECT_TAG_TYPE = "type" // 游戏标签
const val SUBJECT_TAG_TEST = "test" // 开测时间
const val SUBJECT_TAG_SELLING_POINT = "selling_points&type" // 卖点文案+游戏标签
}
}

View File

@ -0,0 +1,5 @@
package com.gh.gamecenter.eventbus
import com.gh.gamecenter.feature.entity.AcctGameInfo
class EBStartupAcceleration(val acctGameInfo: AcctGameInfo)

View File

@ -8,7 +8,6 @@ import android.text.SpannableStringBuilder
import android.view.View
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewLogUtils
import com.gh.common.view.ImageContainerView
@ -17,22 +16,18 @@ import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.entity.AdditionalParamsEntity
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.SpanBuilder
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.databinding.CommunityAnswerItemBinding
import com.gh.gamecenter.feature.entity.ForumVideoEntity
import com.gh.gamecenter.eventbus.EBUserFollow
import com.gh.gamecenter.forum.detail.ForumDetailActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.qa.answer.BaseAnswerOrArticleItemViewHolder
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.feature.entity.AnswerEntity
import com.gh.gamecenter.feature.entity.ArticleEntity
import com.gh.gamecenter.feature.entity.CommunityItemData
import com.gh.gamecenter.feature.entity.ForumVideoEntity
import com.gh.gamecenter.forum.detail.ForumDetailActivity
import com.gh.gamecenter.forum.home.ArticleItemVideoView.Companion.toArticleVideoData
import com.gh.gamecenter.forum.search.CommunitySearchEventListener
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_COMMENT
@ -44,6 +39,9 @@ import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEA
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_VIEW_IMAGE
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_VIEW_USER_DETAIL
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.htmlToString
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.qa.answer.BaseAnswerOrArticleItemViewHolder
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.qa.entity.QuestionsDetailEntity
import com.gh.gamecenter.qa.questions.invite.QuestionsInviteActivity
import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
@ -348,8 +346,8 @@ class ForumArticleAskItemViewHolder(
.setReleaseWhenLossAudio(true)
.setLooping(false)
.setShowFullAnimation(false)
.setEnlargeImageRes(R.drawable.ic_game_detail_enter_full_screen)
.setShrinkImageRes(R.drawable.ic_game_detail_exit_full_screen)
.setEnlargeImageRes(R.drawable.ic_video_enter_full_screen)
.setShrinkImageRes(R.drawable.ic_video_exit_full_screen)
.setVideoAllCallBack(object : GSYSampleCallBack() {
override fun onQuitFullscreen(url: String?, vararg objects: Any) {
orientationUtils.backToProtVideo()

View File

@ -288,7 +288,8 @@ class ForumContentSearchListFragment : LazyListFragment<AnswerEntity, ForumConte
mSearchKey,
SearchActivity.toTrackSearchType(mSearchType),
contentId ?: "",
title ?: ""
title ?: "",
sequence
)
NewFlatLogUtils.logSearchContentClick(

View File

@ -39,8 +39,8 @@ class ForumOrUserSearchDefaultFragment : SearchDefaultFragment() {
override fun initView() {
mBinding = FragmentSearchDefaultBinding.bind(mCachedView)
mBinding.hotTagHeadContainer.root.visibility = View.GONE
mBinding.hotTagFlexContainer.visibility = View.GONE
mBinding.hotAndDiscoveryTagHeadContainer.root.visibility = View.GONE
mBinding.hotAndDiscoveryTagFlexContainer.visibility = View.GONE
if (mEntrance == "论坛首页" || mEntrance == "搜索栏") {
mBinding.hotHeadContainer.headTitle.text = "热门论坛"
mViewModel.getForumSearchHotContent()

View File

@ -37,10 +37,11 @@ class UserSearchListFragment : LazyListFragment<FollowersOrFansEntity, UserSearc
SensorsBridge.trackUserSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
mListViewModel.sourceEntrance,
mSearchKey,
SearchActivity.toTrackSearchType(mSearchType),
mListViewModel.sourceEntrance,
userId
userId,
position
)
NewFlatLogUtils.logSearchUserClick(
SearchType.fromString(mSearchType).toChinese(),

View File

@ -4,14 +4,18 @@ import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProviders
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.LazyListFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_SHOW_SUBJECT_TAB
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.observeNonNull
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.databinding.FragmentColumnCollectionDetailBinding
import com.gh.gamecenter.entity.GameColumnCollection
import com.gh.gamecenter.entity.SubjectData
import com.gh.gamecenter.subject.tab.SubjectTabFragment
@ -55,11 +59,37 @@ class ColumnCollectionDetailFragment : LazyListFragment<LinkEntity, ColumnCollec
mListViewModel.getGameColumnCollection()
mListViewModel.columnCollection.observeNonNull(this) {
setNavigationTitle(it.name)
mCachedView?.setBackgroundColor(com.gh.gamecenter.common.R.color.ui_surface.toColor(requireContext()))
logPageShow(it)
}
}
private fun logPageShow(entity: GameColumnCollection) {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("ColumnCollectionDetailPageShow", json {
"column_collection_name" to entity.name
"column_collection_id" to entity.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun onChanged(list: MutableList<LinkEntity>?) {
if (list != null && list.isNotEmpty()) {
showSubjectTab(list)

View File

@ -11,18 +11,22 @@ import com.gh.common.exposure.ExposureListener
import com.gh.common.exposure.IExposable
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.LazyListFragment
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.common.view.FixGridLayoutManager
import com.gh.gamecenter.common.view.GridSpacingItemDecoration
import com.gh.gamecenter.common.view.VerticalItemDecoration
import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding
import com.gh.gamecenter.entity.CommonCollectionEntity
import com.gh.gamecenter.home.custom.model.CustomPageItem
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMMON_CONTENT_COLLECTION_LAYOUT_HORIZONTAL_SLIDE_BANNER
@ -120,6 +124,8 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
}
mListRv?.removeItemDecorationAt(0)
mListRv?.addItemDecoration(itemDecoration)
logPageShow(it)
}
mListViewModel.loadExceptionLiveData.observe(viewLifecycleOwner) {
if (it != null && it.code() == 404) {
@ -154,6 +160,32 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
})
}
private fun logPageShow(entity: CommonCollectionEntity) {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("LinkContentCollectionDetailPageShow", json {
"link_content_collection_name" to entity.name
"link_content_collection_id" to entity.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun getItemDecoration(): RecyclerView.ItemDecoration =
when (mCollectionStyle) {
"1-2" ->

View File

@ -3,26 +3,29 @@ package com.gh.gamecenter.game.horizontal
import android.content.Context
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.*
import com.gh.common.util.DataCollectionUtils
import com.gh.common.util.DownloadItemUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.StringUtils
import com.gh.gamecenter.entity.SubjectEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.subjectTypeToComponentStyle
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper
import com.gh.gamecenter.gamedetail.detail.viewholder.BaseGameDetailItemViewHolder
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.subjectTypeToComponentStyle
import com.lightgame.adapter.BaseRecyclerAdapter
import com.lightgame.download.DownloadEntity
class GameHorizontalAdapter(
context: Context,
private var mSubjectEntity: SubjectEntity,
var subjectEntity: SubjectEntity,
private var type: GameHorizontalListType = GameHorizontalListType.SubjectHorizontalType,
private val trackColumnClick: Boolean = true
private val trackColumnClick: Boolean = true,
private val gameDetailTrackData: BaseGameDetailItemViewHolder.GameDetailModuleTrackData? = null,
private val getGameStatus: (() -> String)? = null
) : BaseRecyclerAdapter<GameHorizontalItemViewHolder>(context) {
var gameName = ""
@ -37,15 +40,15 @@ class GameHorizontalAdapter(
init {
var dataIds = ""
mSubjectEntity.data?.forEach {
subjectEntity.data?.forEach {
dataIds += it.id
}
if (dataIds.isNotEmpty()) countAndKey = Pair(mSubjectEntity.data?.size ?: 0, dataIds)
if (dataIds.isNotEmpty()) countAndKey = Pair(subjectEntity.data?.size ?: 0, dataIds)
}
fun getIndex(): Int {
if (mSubjectEntity.data!!.isNotEmpty()) {
return if (mSubjectEntity.data!![0].image.isNullOrEmpty()) 0 else 1
if (subjectEntity.data!!.isNotEmpty()) {
return if (subjectEntity.data!![0].image.isNullOrEmpty()) 0 else 1
}
return 0
}
@ -53,13 +56,13 @@ class GameHorizontalAdapter(
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = GameHorizontalItemViewHolder(parent.toBinding())
override fun getItemCount(): Int {
val size = mSubjectEntity.data!!.size - getIndex()
val size = subjectEntity.data!!.size - getIndex()
return when (type) {
GameHorizontalListType.GameDetailHorizontalType -> {
size
}
GameHorizontalListType.MiniGameSubjectHorizontalType -> {
mSubjectEntity.data!!.size
subjectEntity.data!!.size
}
else -> when {
size < 4 -> size
@ -80,14 +83,15 @@ class GameHorizontalAdapter(
}
holder.binding.root.layoutParams = params
val gameEntity = mSubjectEntity.data!![position + getIndex()]
val gameEntity = subjectEntity.data!![position + getIndex()]
holder.binding.simpleGameContainer.run {
gameIcon.displayGameIcon(gameEntity)
GameHorizontalSimpleItemViewHolder.setHorizontalNameAndGravity(gameName, gameEntity.name)
downloadBtn.goneIf(!mSubjectEntity.showDownload)
gameName.maxLines = if (mSubjectEntity.showDownload) 1 else 2
downloadBtn.goneIf(!subjectEntity.showDownload)
gameName.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(mContext))
gameName.maxLines = if (subjectEntity.showDownload) 1 else 2
}
holder.bindGameHorizontalItem(gameEntity, mSubjectEntity)
holder.bindGameHorizontalItem(gameEntity, subjectEntity)
val entranceResult: String
val locationResult: String
if (type == GameHorizontalListType.GameDetailHorizontalType) {
@ -104,37 +108,35 @@ class GameHorizontalAdapter(
locationResult = StringUtils.buildString("游戏详情-", gameName, "-${path}", ":", gameEntity.name)
} else {
entranceResult =
StringUtils.buildString("(游戏-专题:", mSubjectEntity.name, "-列表[", (position + 1).toString(), "])")
locationResult = StringUtils.buildString("游戏-专题-", mSubjectEntity.name, ":", gameEntity.name)
StringUtils.buildString("(游戏-专题:", subjectEntity.name, "-列表[", (position + 1).toString(), "])")
locationResult = StringUtils.buildString("游戏-专题-", subjectEntity.name, ":", gameEntity.name)
}
holder.itemView.setOnClickListener {
if (type == GameHorizontalListType.GameDetailHorizontalType) {
DataCollectionUtils.uploadClick(mContext, path, "游戏详情", gameEntity.name)
NewLogUtils.logGameDetailPopularClick(gameName, gameId, "game", gameEntity.name ?: "")
SensorsBridge.trackGameDetailPagePopularClick(
gameId = gameId,
gameName = gameName,
pageName = GlobalActivityManager.getCurrentPageEntity().pageName,
pageId = GlobalActivityManager.getCurrentPageEntity().pageId,
pageBusinessId = GlobalActivityManager.getCurrentPageEntity().pageBusinessId,
lastPageName = GlobalActivityManager.getLastPageEntity().pageName,
lastPageId = GlobalActivityManager.getLastPageEntity().pageId,
lastPageBusinessId = GlobalActivityManager.getLastPageEntity().pageBusinessId,
downloadStatus = game?.downloadStatusChinese ?: "",
gameType = game?.categoryChinese ?: "",
clickGameType = gameEntity.categoryChinese,
clickGameName = gameEntity.name ?: "",
clickGameId = gameEntity.id
SensorsBridge.trackGameDetailModuleClick(
gameDetailTrackData?.gameId,
gameDetailTrackData?.gameName,
gameDetailTrackData?.gameType,
"组件内容",
gameDetailTrackData?.moduleType,
gameDetailTrackData?.moduleName,
gameDetailTrackData?.sequence,
linkType = "game",
linkId = gameEntity.id,
linkText = gameEntity.name ?: "",
gameStatus = getGameStatus?.invoke()
)
if (!gameEntity.isMiniGame() && trackColumnClick) {
SensorsBridge.trackColumnClick(
location = "游戏详情",
gameName = gameName,
gameId = gameId,
gameColumnName = mSubjectEntity.name ?: "",
gameColumnId = mSubjectEntity.id ?: "",
gameColumnName = subjectEntity.name ?: "",
gameColumnId = subjectEntity.id ?: "",
text = "游戏",
columnPattern = subjectTypeToComponentStyle[mSubjectEntity.type] ?: ""
columnPattern = subjectTypeToComponentStyle[subjectEntity.type] ?: ""
)
}
}
@ -151,7 +153,7 @@ class GameHorizontalAdapter(
}
}
if (mSubjectEntity.showDownload && type != GameHorizontalListType.GameDetailHorizontalType) {
if (subjectEntity.showDownload && type != GameHorizontalListType.GameDetailHorizontalType) {
DownloadItemUtils.setOnClickListener(
mContext,
holder.binding.simpleGameContainer.downloadBtn,
@ -179,7 +181,7 @@ class GameHorizontalAdapter(
if (downloadEntity == null) {
notifyDataSetChanged()
} else {
mSubjectEntity.data?.forEachIndexed { position, gameEntity ->
subjectEntity.data?.forEachIndexed { position, gameEntity ->
if (downloadEntity.gameId == gameEntity.id) {
notifyItemChanged(position - getIndex())
return
@ -189,7 +191,7 @@ class GameHorizontalAdapter(
}
fun notifyChildItem(packageName: String) {
mSubjectEntity.data?.forEachIndexed { position, gameEntity ->
subjectEntity.data?.forEachIndexed { position, gameEntity ->
gameEntity.getApk().forEach { apkEntity ->
if (apkEntity.packageName == packageName) {
notifyItemChanged(position - getIndex())
@ -206,11 +208,11 @@ class GameHorizontalAdapter(
dataIds += it.id
}
mSubjectEntity = subjectEntity
if (countAndKey?.first == subjectEntity.data?.size && countAndKey?.second != dataIds) { // 数量不变,内容发生改变
notifyItemRangeChanged(0, itemCount)
} else if (countAndKey?.first != subjectEntity.data?.size) { // 数量发生改变
this.subjectEntity = subjectEntity
if (countAndKey?.first != subjectEntity.data?.size) { // 数量发生改变
notifyDataSetChanged()
} else {
notifyItemRangeChanged(0, itemCount)
}
// 重新刷新数据标识

View File

@ -3,10 +3,10 @@ package com.gh.gamecenter.game.vertical
import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.text.TextUtils
import android.util.AttributeSet
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import android.widget.Space
@ -17,11 +17,12 @@ import androidx.core.content.ContextCompat
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieDrawable
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.feature.view.GameIconView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.view.GameTagContainerView
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.feature.view.GameIconView
import splitties.dimensions.dip
import splitties.views.backgroundColor
import splitties.views.dsl.constraintlayout.*
@ -63,6 +64,7 @@ class GameItemUi(override val ctx: Context) : Ui {
var gamePlayCountTv: TextView
var mGameDesSpace: Space
var sellingPointsBinding: LayoutGameItemSellingPointBinding
override val root: ConstraintLayout = constraintLayout {
padding = dip(16)
@ -84,6 +86,7 @@ class GameItemUi(override val ctx: Context) : Ui {
gameTagContainer = GameTagContainerView(ctx).apply { id = R.id.label_list }
mGameDesSpace = space { }.apply { id = R.id.gameDesSpace }
recommendConstraintLayout = initRecommendConstraintLayout()
sellingPointsBinding = LayoutGameItemSellingPointBinding.inflate(LayoutInflater.from(context))
add(iconIv, lParams(dip(64), dip(64)) {
topOfParent()
@ -142,6 +145,12 @@ class GameItemUi(override val ctx: Context) : Ui {
endToEndOf(mGameDesSpace)
orientation = LinearLayout.HORIZONTAL
})
add(sellingPointsBinding.root, lParams(0, wrapContent) {
topToBottomOf(mGameDesSpace)
bottomToBottomOf(iconIv)
startToEndOf(gamePlayCountTv)
endToEndOf(mGameDesSpace)
})
add(gamePlayCountTv, lParams(wrapContent, wrapContent) {
topToBottomOf(mGameDesSpace)
bottomToBottomOf(iconIv)
@ -197,7 +206,8 @@ class GameItemUi(override val ctx: Context) : Ui {
startPadding = dip(2)
endPadding = dip(2)
ellipsize = TextUtils.TruncateAt.END
background = ContextCompat.getDrawable(context, com.gh.gamecenter.feature.R.drawable.bg_advance_download_game_subtitle)
background =
ContextCompat.getDrawable(context, com.gh.gamecenter.feature.R.drawable.bg_advance_download_game_subtitle)
setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.text_secondary))
visibility = View.GONE
}
@ -305,7 +315,12 @@ class GameItemUi(override val ctx: Context) : Ui {
gravity = Gravity.CENTER
text = "展开"
setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.white))
setDrawableEnd(AppCompatResources.getDrawable(context, com.gh.gamecenter.feature.R.drawable.ic_jump_universal))
setDrawableEnd(
AppCompatResources.getDrawable(
context,
com.gh.gamecenter.feature.R.drawable.ic_jump_universal
)
)
compoundDrawablePadding = dip(2)
visibility = View.GONE
}

View File

@ -166,7 +166,7 @@ class GameVerticalAdapter(
false
)
BindingAdapters.setGame(iconIv, gameEntity)
BindingAdapters.setGameTags(gameTagContainer, gameEntity)
BindingAdapters.setGameTags(gameTagContainer, gameEntity, subjectData?.tag ?: "")
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
gameDesTv.text = gameEntity.decoratedDes
GameItemViewHolder.initGameSubtitleAndAdLabel(
@ -225,10 +225,10 @@ class GameVerticalAdapter(
subjectData?.briefStyle
)
DownloadItemUtils.setOnClickListener(
context, downloadTv, gameEntity, position,
adapter, entrance, location = location, traceEvent = gameEntity.exposureEvent
)
DownloadItemUtils.setOnClickListener(
context, downloadTv, gameEntity, position,
adapter, entrance, location = location, traceEvent = gameEntity.exposureEvent
)
root.setPadding(paddingStart, 8F.dip2px(), paddingEnd, 8F.dip2px())
}

View File

@ -49,21 +49,24 @@ class GameCollectionDetailActivity : ToolBarActivity() {
fun getIntent(
context: Context,
gameCollectionId: String,
isFromSquare: Boolean = false
isFromSquare: Boolean = false,
entrance: String = ""
): Intent {
return getIntent(context, gameCollectionId, "", isFromSquare, false)
return getIntent(context, gameCollectionId, "", isFromSquare, false, entrance = entrance)
}
@JvmStatic
fun getSpecifiedCommentIntent(
context: Context,
gameCollectionId: String,
topCommentId: String
topCommentId: String,
entrance: String
): Intent {
return getIntent(
context, gameCollectionId, topCommentId,
isFromSquare = false,
isScrollToCommentArea = true
isScrollToCommentArea = true,
entrance = entrance
)
}
@ -74,13 +77,15 @@ class GameCollectionDetailActivity : ToolBarActivity() {
topCommentId: String = "",
isFromSquare: Boolean = false,
isScrollToCommentArea: Boolean = false,
exposureSourceList: ArrayList<ExposureSource>? = null
exposureSourceList: ArrayList<ExposureSource>? = null,
entrance: String = ""
): Intent {
val bundle = Bundle()
bundle.putString(EntranceConsts.KEY_GAME_COLLECTION_ID, gameCollectionId)
bundle.putString(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
bundle.putBoolean(EntranceConsts.KEY_IS_FROM_SQUARE, isFromSquare)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, isScrollToCommentArea)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
if (exposureSourceList != null) {
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, exposureSourceList)
}

View File

@ -610,7 +610,7 @@ open class GameCollectionDetailAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity)
BindingAdapters.setGameTags(labelList, gameEntity, "")
gameRating.setDrawableStart(
if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable(mContext) else null
)

View File

@ -39,7 +39,6 @@ import com.gh.gamecenter.common.syncpage.SyncDataEntity
import com.gh.gamecenter.common.syncpage.SyncFieldConstants
import com.gh.gamecenter.common.syncpage.SyncPageRepository
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.SegmentedFilterView
import com.gh.gamecenter.core.iinterface.IScrollable
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.FragmentGameCollectionDetailBinding
@ -48,7 +47,6 @@ import com.gh.gamecenter.entity.GamesCollectionDetailEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.eventbus.EBUserFollow
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.login.user.UserViewModel
@ -187,12 +185,10 @@ class GameCollectionDetailFragment :
root.layoutParams = this
}
orderSfv.setItemList(listOf("正序", "倒序"), 0)
orderSfv.setOnCheckedCallback(object : SegmentedFilterView.OnCheckedCallback {
override fun onItemCheck(position: Int) {
getFilterVH()?.binding?.orderSfv?.performClick(position)
updateFilterView()
}
})
orderSfv.setOnCheckedCallback { position ->
getFilterVH()?.binding?.orderSfv?.performClick(position)
updateFilterView()
}
commentHintTv.text = "玩家评论"
}
}
@ -741,7 +737,7 @@ class GameCollectionDetailFragment :
if (activity != null && activity?.isFinishing != true) {
startPlayLogic(isAutoPlay = true)
}
}, GameDetailFragment.INITIAL_DELAY)
}, INITIAL_DELAY)
}
}
}
@ -851,6 +847,7 @@ class GameCollectionDetailFragment :
trackEvent.put("game_collect_title", mGameCollectionTitle)
trackEvent.put("game_collect_id", mGameCollectionId)
trackEvent.put("stay_length", mElapsedHelper?.elapsedTime)
trackEvent.put("source_entrance", mEntrance)
} catch (e: JSONException) {
e.printStackTrace()
}
@ -1209,4 +1206,8 @@ class GameCollectionDetailFragment :
appbar.setExpanded(true)
}
}
companion object {
const val INITIAL_DELAY = 500L
}
}

View File

@ -13,15 +13,15 @@ import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.observer.MuteCallback
import com.gh.gamecenter.common.observer.VolumeObserver
import com.gh.gamecenter.core.runOnIoThread
import com.gh.common.util.*
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.debounceActionWithInterval
import com.gh.gamecenter.common.utils.rxTimer
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.NetworkUtils
import com.gh.gamecenter.common.utils.debounceActionWithInterval
import com.gh.gamecenter.common.utils.rxTimer
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.entity.GamesCollectionDetailEntity
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
@ -180,7 +180,7 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
private fun mute(isManual: Boolean = false) {
viewModel?.videoIsMuted = true
volume.setImageResource(R.drawable.ic_game_detail_volume_off)
volume.setImageResource(R.drawable.ic_video_volume_off)
CustomManager.getCustomManager(getKey()).isNeedMute = true
if (isManual) {
Utils.toast(context, "当前处于静音状态")
@ -190,7 +190,7 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
private fun unMute(isManual: Boolean = false) {
viewModel?.videoIsMuted = false
volume.setImageResource(R.drawable.ic_game_detail_volume_on)
volume.setImageResource(R.drawable.ic_video_volume_on)
CustomManager.getCustomManager(getKey()).isNeedMute = false
if (isManual) {
logVideoEvent("video_game_collect_detail_mute_cancel")
@ -278,9 +278,9 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
if (mStartButton is ImageView) {
val imageView = mStartButton as ImageView
when (mCurrentState) {
GSYVideoView.CURRENT_STATE_PLAYING -> imageView.setImageResource(R.drawable.ic_game_detail_pause)
GSYVideoView.CURRENT_STATE_ERROR -> imageView.setImageResource(R.drawable.ic_game_detail_play)
else -> imageView.setImageResource(R.drawable.ic_game_detail_play)
GSYVideoView.CURRENT_STATE_PLAYING -> imageView.setImageResource(R.drawable.ic_video_pause)
GSYVideoView.CURRENT_STATE_ERROR -> imageView.setImageResource(R.drawable.ic_video_play)
else -> imageView.setImageResource(R.drawable.ic_video_play)
}
}
}
@ -314,11 +314,11 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
}
override fun getEnlargeImageRes(): Int {
return R.drawable.ic_game_detail_enter_full_screen
return R.drawable.ic_video_enter_full_screen
}
override fun getShrinkImageRes(): Int {
return R.drawable.ic_game_detail_exit_full_screen
return R.drawable.ic_video_exit_full_screen
}
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {

View File

@ -73,6 +73,7 @@ class GameCollectionHotListAdapter(
if (holder is GameCollectionPlayerCreationAdapter.GameCollectionPlayerCreationHeaderItemViewHolder) {
holder.binding.run {
root.setPadding(0, if (mIsFromDetail) 16F.dip2px() else 0, 0, 12F.dip2px())
timeSfv.visibility = View.GONE
tipsIv.visibility = View.GONE
tipsTv.text = mGameCollectionListEntity?.explain
tipsTv.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(mContext))

View File

@ -6,6 +6,7 @@ import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.ExposureListener
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.ListFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.exposure.ExposureSource
@ -58,6 +59,7 @@ class GameCollectionHotListFragment : ListFragment<GameCollectionListItemData, G
if (requireActivity() is GameCollectionListDetailActivity) {
mBasicExposureSourceList.add(ExposureSource("游戏单合集", mGameCollectionListEntity?.id ?: ""))
mBasicExposureSourceList.add(ExposureSource("合集详情", ""))
logPageShow()
} else {
mBasicExposureSourceList.add(ExposureSource("游戏单热榜", ""))
mBasicExposureSourceList.add(ExposureSource("游戏单合集", mGameCollectionListEntity?.id ?: ""))
@ -68,6 +70,32 @@ class GameCollectionHotListFragment : ListFragment<GameCollectionListItemData, G
}
}
private fun logPageShow() {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("GameListCollectionDetailPageShow", json {
"game_list_collection_name" to mGameCollectionListEntity?.name
"game_list_collection_id" to mGameCollectionListEntity?.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
if (mListRefresh != null) {
mListRefresh!!.setColorSchemeResources(com.gh.gamecenter.common.R.color.primary_theme)

View File

@ -76,7 +76,8 @@ class MyGameCollectionViewHolder(
binding.root.context.startActivity(
GameCollectionDetailActivity.getIntent(
binding.root.context,
entity.id
entity.id,
entrance = path
)
)
} else {

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