Compare commits

...

395 Commits

Author SHA1 Message Date
e58cc2c405 删除 .gradle/caches/build-cache-1 缓存目录 2023-03-24 10:12:49 +08:00
32de24bb09 delete gradlew clean 2023-03-21 16:20:57 +08:00
481a0b5257 add gradlew clean 2023-03-21 15:56:41 +08:00
dd99610310 测试打包时间 2023-03-21 15:24:55 +08:00
448ded444f 新建minio cache 2023-03-21 14:46:02 +08:00
171f1b8e4e 新建minio cache 2023-03-21 14:17:37 +08:00
449cf76cb2 新建minio cache 2023-03-21 14:04:03 +08:00
f204cf3dda 测试aliyun 内网docker build 2023-03-21 10:17:22 +08:00
aa36af2193 修改镜像为aliyun 地址 2023-03-21 09:50:38 +08:00
e7d15fd874 测试打包时间 2023-03-21 09:33:09 +08:00
3b4d7767ec 复制缓存 2023-03-20 17:59:51 +08:00
2b7faed871 复制缓存 2023-03-20 17:55:44 +08:00
bfbef33054 GIT_SUBMODULE_STRATEGY: recursive 2023-03-20 17:47:48 +08:00
e996eb72a7 开启cache 2023-03-20 17:42:44 +08:00
67a7b7b5ce test 2023-03-20 17:27:38 +08:00
07ad819a50 tar gradle-cache 2023-03-20 17:04:05 +08:00
c965bed2f8 tar gradle-cache 2023-03-20 16:57:20 +08:00
5db36ab0aa tar gradle-cache 2023-03-20 16:35:13 +08:00
c14b06c3b9 tar gradle-cache 2023-03-20 16:33:19 +08:00
4297d5af70 tar gradle-cache 2023-03-20 16:31:56 +08:00
e230e5a7b6 tar gradle-cache 2023-03-20 16:23:29 +08:00
6e0fcef261 tar gradle-cache 2023-03-20 15:54:06 +08:00
c037a2ff91 tar gradle-cache 2023-03-20 15:23:28 +08:00
e7dc16d234 tar gradle-cache 2023-03-20 14:34:19 +08:00
b22edbba69 change Dockerfile path 2023-03-20 14:18:18 +08:00
a953f282ab change Dockerfile path 2023-03-20 14:08:21 +08:00
211bc0cacb change Dockerfile path 2023-03-20 13:56:25 +08:00
798f1fe2fa 注释GIT_STRATEGY: none 2023-03-20 13:50:42 +08:00
d8755eb3bd 注释GIT_STRATEGY: none 2023-03-20 13:50:39 +08:00
b42ef259d4 注释android_build 2023-03-20 13:48:34 +08:00
b6f6007c66 change Dockerfile path 2023-03-20 13:47:54 +08:00
17de6d423d change docker build arg 2023-03-20 11:50:59 +08:00
1386bb727d change artifacts path 2023-03-20 11:04:19 +08:00
2a6bc205df add docker build 2023-03-20 10:37:10 +08:00
38fd0144a5 change images 2023-03-17 15:37:31 +08:00
85ef012911 ci:change docker images 2023-03-03 16:33:12 +08:00
c480a631cd ci:change docker images 2023-03-03 16:18:04 +08:00
bfd1dda9b3 ci:change docker images 2023-03-03 16:08:44 +08:00
ac53235a09 ci: KUBERNETES_CPU_LIMIT: 12 2023-02-27 18:07:39 +08:00
87c9d85b51 change org.gradle.jvmargs 2023-02-27 17:27:47 +08:00
8fd5c669d0 ci: KUBERNETES_CPU_LIMIT: 16 2023-02-27 16:09:31 +08:00
cd1c3052f8 ci:change tags pve-local-runner 2023-02-24 10:13:53 +08:00
80e0163235 fix: plugin 添加内部 nexus 源 2023-02-23 16:27:24 +08:00
9867241e3a ci:add KUBERNETES_CPU_LIMIT 2023-02-23 15:32:06 +08:00
92f4058dfc ci:add KUBERNETES_CPU_LIMIT 2023-02-23 14:59:05 +08:00
4bd414566f ci:change tags offline-test 2023-02-23 14:23:41 +08:00
a472eabf6d ci:change tags local-runner 2023-02-23 14:23:41 +08:00
38f780e514 change org.gradle.jvmargs 2023-02-23 14:23:41 +08:00
dc7cb2abe3 change jvmargs 2023-02-23 14:23:41 +08:00
bfdba625b8 change jvmargs 2023-02-23 14:23:41 +08:00
fe10ef135b ci:change tags pve-local-runner 2023-02-23 14:23:41 +08:00
f600197d89 ci:change tags 2023-02-23 14:23:41 +08:00
8362e7d9da ci:change docker image 2023-02-23 14:23:41 +08:00
d92cae7af8 ci:change docker image 2023-02-23 14:23:41 +08:00
c48b786178 change build.gradle 2023-02-23 14:23:41 +08:00
0818e64fe3 change maven url 2023-02-23 14:23:41 +08:00
5983832aa9 add maven url 2023-02-23 14:23:41 +08:00
c833a53bcc add maven url 2023-02-23 14:23:41 +08:00
ad1b5dada3 change kotlin_version 1.7.1 2023-02-23 14:23:41 +08:00
8cd64dd4bc ci:change docker image 2023-02-23 14:23:41 +08:00
fe37a3bd31 ci:change docker image 2023-02-23 14:23:41 +08:00
f3c33decaf change docker image 2023-02-23 14:23:41 +08:00
2a79755777 优化app的build.gradle 2023-02-23 14:23:41 +08:00
a3601fd25c 优化app的build.gradle 2023-02-23 14:23:41 +08:00
40c55dc66f 优化app的build.gradle 2023-02-23 14:23:41 +08:00
e22c3c06b9 change build.gradle 2023-02-23 14:23:41 +08:00
0f7b5055b4 test cache 2023-02-23 14:23:41 +08:00
15246bbf31 change before_script 2023-02-23 14:23:41 +08:00
92b6f1570a change cache 2023-02-23 14:23:41 +08:00
8c195e01d8 change cache 2023-02-23 14:23:41 +08:00
2a7077efab test cache 2023-02-23 14:23:40 +08:00
b6c1aa2323 test cache 2023-02-23 14:23:40 +08:00
bf3ceec277 修改jvm 2023-02-23 14:23:40 +08:00
48b668cf98 修改jvm 2023-02-23 14:23:40 +08:00
b492002c42 修改jvm 2023-02-23 14:23:40 +08:00
7261b6b512 修改gradle 版本 2023-02-23 14:23:40 +08:00
0c04cc3559 ci修改配置 2023-02-23 14:23:40 +08:00
4cf5102534 ci修改配置 2023-02-23 14:23:40 +08:00
b99353475b ci修改cache 2023-02-23 14:23:40 +08:00
f8b88b1b4e ci修改cache 2023-02-23 14:23:40 +08:00
228c938311 修改jvmargs 2023-02-23 14:23:40 +08:00
48cc6c97f9 ci修改cache 缓存目录 2023-02-23 14:23:40 +08:00
87cc042389 增大jvmargs 2023-02-23 14:23:40 +08:00
ab7a27c84b ci修改cache 缓存目录 2023-02-23 14:23:40 +08:00
708314e680 ci修改cache 缓存目录 2023-02-23 14:23:40 +08:00
59f0265cca ci修改cache 缓存目录 2023-02-23 14:23:40 +08:00
1630d24471 ci添加 build 缓存目录 2023-02-23 14:23:40 +08:00
117da57157 添加.gradle/caches 缓存 2023-02-23 14:23:40 +08:00
5c66937b48 test 2023-02-23 14:23:40 +08:00
c2179a665f 修改jvmargs堆大小 2023-02-23 14:23:40 +08:00
10178a2712 修改tags为online 集群来跑android_build 2023-02-23 14:23:40 +08:00
3ab8b6fc15 ci: 更正邮件镜像 2023-02-23 14:23:40 +08:00
dd8989fd6b ci: 更新 ci 配置文件 2023-02-23 14:23:40 +08:00
9bf4439c5b ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
9fd726d28b ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
fc382c9c98 ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
743339ffb4 ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
0d4dcacae1 ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
9d601e9a39 ci: 更新 ci 编译配置 2023-02-23 14:23:40 +08:00
b8d2826aae ci: 添加 ci 编译配置 2023-02-23 14:23:40 +08:00
0e11b03256 ci: 添加 ci 编译配置 2023-02-23 14:23:40 +08:00
ad1e6ce608 ci: 添加 ci 编译配置 2023-02-23 14:23:40 +08:00
b03cba15d4 ci: 添加 ci 编译配置 2023-02-23 14:23:40 +08:00
41f616b4a5 Merge branch 'fix-arm_build_error' into 'dev-5.21.0'
处理 ARM 处理器的编译问题

See merge request halo/android/assistant-android!736
2023-02-23 12:05:15 +08:00
d966f83b2d fix: 更换 7zip 二进制文件源 2023-02-23 11:54:07 +08:00
2c064f8ac3 chore: room 版本更新到 2.4.3 2023-02-23 11:52:21 +08:00
ca547d9ee3 Revert "fix: 将 andResGuard 移动至 init.gradle 避免 arm 处理器找不到处理文件无法正常编译运行"
This reverts commit 462e407238.
2023-02-23 11:40:56 +08:00
ff5f844a9d Merge branch 'fix_arm_build_error' into 'dev-5.21.0'
处理 ARM 设备的正常编译异常问题

See merge request halo/android/assistant-android!735
2023-02-23 10:54:59 +08:00
462e407238 fix: 将 andResGuard 移动至 init.gradle 避免 arm 处理器找不到处理文件无法正常编译运行 2023-02-23 10:40:11 +08:00
e8f9c9349d Merge branch 'fix-lint_error' into 'dev-5.21.0'
fix: 升级 LiveData 依赖来处理 lint 时误报的 error https://issuetracker.google.com/issues/169249668

See merge request halo/android/assistant-android!734
2023-02-23 10:30:22 +08:00
a931f03f1a fix: 升级 LiveData 依赖来处理 lint 时的误报的 error https://issuetracker.google.com/issues/169249668 2023-02-23 10:20:29 +08:00
f16d67a30f Merge remote-tracking branch 'origin/dev' into dev-5.21.0 2023-02-22 17:20:19 +08:00
f2b6c22235 Merge remote-tracking branch 'origin/release' into dev 2023-02-22 17:16:06 +08:00
38798446f2 Merge branch 'fix-GHZS-1372' into 'dev'
fix: 新增[新游开测]功能-前端详情页部分-0221测试  https://jira.shanqu.cc/browse/GHZS-1372

See merge request halo/android/assistant-android!733
2023-02-22 17:06:56 +08:00
d8817e98c8 fix: 新增[新游开测]功能-前端详情页部分-0221测试 https://jira.shanqu.cc/browse/GHZS-1372 2023-02-22 16:59:59 +08:00
d2238de04f Merge branch 'hotfix-v5.19.1-731-vspace_uninstall' into 'release'
fix: 畅玩组件被卸载时清空已安装的畅玩游戏列表

See merge request halo/android/assistant-android!732
2023-02-22 09:19:25 +08:00
43334a91ef fix: 畅玩组件被卸载时清空已安装的畅玩游戏列表 2023-02-22 09:19:25 +08:00
e10207452a Merge branch 'hotfix-v5.19.1-731-vspace_log' into 'release'
fix: 畅玩启动时传递游戏 id 等数据,避免日志上报异常

See merge request halo/android/assistant-android!731
2023-02-21 17:34:01 +08:00
0ef88ecfb7 Merge branch 'fix-GHZS-1372' into 'dev'
fix: 新增[新游开测]功能-前端详情页部分-0221测试 https://jira.shanqu.cc/browse/GHZS-1372

See merge request halo/android/assistant-android!730
2023-02-21 17:33:52 +08:00
b9532a7b2d fix: 畅玩启动时传递游戏 id 等数据,避免日志上班异常 2023-02-21 17:27:38 +08:00
a70cf3ffd0 fix: 新增[新游开测]功能-前端详情页部分-0221测试 https://jira.shanqu.cc/browse/GHZS-1372 2023-02-21 17:16:22 +08:00
58685b7c24 Merge remote-tracking branch 'origin/dev' into dev-5.21.0 2023-02-21 15:22:20 +08:00
70f64a755e Merge remote-tracking branch 'origin/release' into dev 2023-02-21 14:50:23 +08:00
3f84ad3a96 Merge branch 'hotfix-v5.19.1-731-wrong_download_time' into 'release'
fix: 修复小文件下载过快,统计的下载累计时间为 0 的问题

See merge request halo/android/assistant-android!729
2023-02-20 17:51:38 +08:00
74ed0080c3 fix: 修复小文件下载过快,统计的下载累计时间为 0 的问题 2023-02-20 17:40:27 +08:00
5371b5be09 Merge branch 'feature-GHZS-1272' into 'dev-5.21.0'
feat: 游戏专题-双列卡片, 动图加载优化 https://jira.shanqu.cc/browse/GHZS-1272

See merge request halo/android/assistant-android!728
2023-02-20 15:15:40 +08:00
68f58588d1 feat: 游戏专题-双列卡片, 动图加载优化 https://jira.shanqu.cc/browse/GHZS-1272 2023-02-20 15:09:30 +08:00
ccbfc69775 Merge branch 'feature-GHZS-1227' into 'dev-5.21.0'
feat: 畅玩组件下载面板文案修改 https://jira.shanqu.cc/browse/GHZS-1227

See merge request halo/android/assistant-android!726
2023-02-20 14:31:46 +08:00
697c1b20bf feat: 畅玩组件下载面板文案修改 https://jira.shanqu.cc/browse/GHZS-1227 2023-02-20 14:22:58 +08:00
d1aaa4c2b1 Merge branch 'fix-GHZS-1257' into 'dev-5.21.0'
fix:【光环助手】竖屏滑动专题闪烁问题 https://jira.shanqu.cc/browse/GHZS-1257

See merge request halo/android/assistant-android!724
2023-02-20 11:06:01 +08:00
826c6a896f Merge branch 'hotfix-v5.19.1-731-mypost_crash' into 'release'
fix: 修复我的发布页面跳转时回调的闪退问题

See merge request halo/android/assistant-android!725
2023-02-20 10:36:00 +08:00
90f386e84b fix: 修复我的发布页面跳转时回调的闪退问题 2023-02-20 09:58:28 +08:00
8d58f9baa5 fix:【光环助手】竖屏滑动专题闪烁问题 https://jira.shanqu.cc/browse/GHZS-1257 2023-02-17 16:50:48 +08:00
03cf5b0add Merge branch 'fix-GHZS-1258' into 'dev-5.21.0'
fix:【光环助手】游戏单合集数据显示错乱问题 https://jira.shanqu.cc/browse/GHZS-1258

See merge request halo/android/assistant-android!723
2023-02-17 15:04:57 +08:00
ff843c4e5f fix:【光环助手】游戏单合集数据显示错乱问题 https://jira.shanqu.cc/browse/GHZS-1258 2023-02-17 15:04:57 +08:00
f3033b4439 Merge branch 'feature-GHZS-1266' into 'dev-5.21.0'
fix: 【光环助手】APP启动广告图显示异常 https://jira.shanqu.cc/browse/GHZS-1266

See merge request halo/android/assistant-android!721
2023-02-17 12:04:55 +08:00
ddc3335e01 Merge branch 'fix-GHZS-1127' into 'dev'
fix: 修改新游开测不能上拉下拉加载更多的问题

See merge request halo/android/assistant-android!722
2023-02-17 12:04:44 +08:00
81549c78b3 Merge branch 'feature-GHZS-1261' into 'dev-5.21.0'
feat: 【光环助手】APP在横屏场景下显示优化 https://jira.shanqu.cc/browse/GHZS-1261

See merge request halo/android/assistant-android!720
2023-02-17 12:00:38 +08:00
e2c32d9add fix: 修改新游开测不能上拉下拉加载更多的问题 2023-02-17 11:15:12 +08:00
ac79b6eebb fix: 【光环助手】APP启动广告图显示异常 https://jira.shanqu.cc/browse/GHZS-1266 2023-02-17 10:31:26 +08:00
0ba25aaca9 feat: 【光环助手】APP在横屏场景下显示优化 https://jira.shanqu.cc/browse/GHZS-1261 2023-02-17 10:24:59 +08:00
3526787b92 Merge branch 'fix-GHZS-1256' into 'dev'
fix:【光环助手】开服日历表-详细开服显示问题 https://jira.shanqu.cc/browse/GHZS-1256

See merge request halo/android/assistant-android!719
2023-02-16 17:54:54 +08:00
515298361f Merge branch 'fix-GHZS-1331' into 'dev'
fix: 新增[新游开测]功能-前端详情页部分—0216UI测试 https://jira.shanqu.cc/browse/GHZS-1331

See merge request halo/android/assistant-android!718
2023-02-16 17:33:25 +08:00
67b493b335 fix: 新增[新游开测]功能-前端详情页部分—0216UI测试 https://jira.shanqu.cc/browse/GHZS-1331 2023-02-16 17:30:04 +08:00
5fa10a2c09 chore: 版本更新至 5.21.0 2023-02-16 16:47:37 +08:00
51d5ce265a fix:【光环助手】开服日历表-详细开服显示问题 https://jira.shanqu.cc/browse/GHZS-1256 2023-02-16 16:30:46 +08:00
cda4bb860a Merge branch 'fix-GHZS-1273' into 'dev'
fix: 新增[新游开测]功能-前端详情页部分—0215测试 https://jira.shanqu.cc/browse/GHZS-1273

See merge request halo/android/assistant-android!717
2023-02-16 15:37:26 +08:00
6a4c56a9e2 fix: 新增[新游开测]功能-前端详情页部分—0215测试 https://jira.shanqu.cc/browse/GHZS-1273 2023-02-16 15:37:26 +08:00
cd158d380b Merge branch 'hotfix-v5.19.1-731-game_detail_crash' into 'release'
fix: 修复游戏详情更新toolbar时出现的闪退问题

See merge request halo/android/assistant-android!716
2023-02-16 14:33:07 +08:00
3d049bb406 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-02-16 14:28:17 +08:00
63ca94509f fix: 修复游戏详情更新toolbar时出现的闪退问题 2023-02-16 14:23:36 +08:00
fd01515733 Merge branch 'fix-GHZS-1270' into 'dev'
fix: 新增[新游开测]功能-前端详情页部分—0215UI测试 https://jira.shanqu.cc/browse/GHZS-1270

See merge request halo/android/assistant-android!715
2023-02-16 11:12:36 +08:00
a687c8b149 fix: 新增[新游开测]功能-前端详情页部分—0215UI测试 https://jira.shanqu.cc/browse/GHZS-1270 2023-02-16 10:34:19 +08:00
b395b6f049 chore: 版本更新至 5.19.1 2023-02-16 09:49:52 +08:00
bb6f5e4367 Merge branch 'hotfix-v5.19.0-730-download_log_crash' into 'release'
fix: 修复下载时长为 0 时的闪退问题

See merge request halo/android/assistant-android!714
2023-02-16 09:48:36 +08:00
e9bd2b3b59 fix: 修复下载时长为 0 时的闪退问题 2023-02-16 09:43:31 +08:00
77cb3f92a1 Merge branch 'fix-GHZS-1251' into 'dev'
fix: 新增[图标浮层]功能-0214测试(1) https://jira.shanqu.cc/browse/GHZS-1251

See merge request halo/android/assistant-android!713
2023-02-15 19:30:05 +08:00
5a3db9c78e fix: 新增[图标浮层]功能-0214测试(1) https://jira.shanqu.cc/browse/GHZS-1251 2023-02-15 19:10:00 +08:00
51498b005d Merge branch 'fix-GHZS-1207-2' into 'dev'
fix: 补充消息中心文本高亮 https://jira.shanqu.cc/browse/GHZS-1207

See merge request halo/android/assistant-android!712
2023-02-15 18:43:20 +08:00
ec983f7b2c fix: 补充消息中心文本高亮 https://jira.shanqu.cc/browse/GHZS-1207 2023-02-15 18:38:14 +08:00
745e14a8ce Merge branch 'fix-GHZS-1127' into 'dev'
fix: 修改新游开测列表无法加载更多的问题

See merge request halo/android/assistant-android!710
2023-02-15 18:31:27 +08:00
4939129b21 fix: 修改列表无法加载更多的问题 2023-02-15 14:50:07 +08:00
d85da2b1b5 Merge branch 'feature-GHZS-1127' into 'dev'
feat: 新增[新游开测]功能-前端详情页部分—客户端 https://jira.shanqu.cc/browse/GHZS-1127

See merge request halo/android/assistant-android!708
2023-02-15 11:10:12 +08:00
2c90a909a6 feat: 新增[新游开测]功能-前端详情页部分—客户端 https://jira.shanqu.cc/browse/GHZS-1127 2023-02-15 11:10:11 +08:00
bd86051615 Merge remote-tracking branch 'origin/release' into dev 2023-02-15 10:49:01 +08:00
739526e9fa Merge branch 'fix-GHZS-1247' into 'release'
fix: 【光环助手】多线程下载相关数据埋点补充-0214测试 https://jira.shanqu.cc/browse/GHZS-1247

See merge request halo/android/assistant-android!709
2023-02-15 10:44:20 +08:00
cbabfe72f7 fix: 【光环助手】多线程下载相关数据埋点补充-0214测试 https://jira.shanqu.cc/browse/GHZS-1247 2023-02-15 10:37:11 +08:00
42250edbbc Merge branch 'fix-GHZS-1251' into 'dev'
fix: 新增[图标浮层]功能-0214测试(3) https://jira.shanqu.cc/browse/GHZS-1251

See merge request halo/android/assistant-android!707
2023-02-14 16:10:24 +08:00
252c933649 fix: 新增[图标浮层]功能-0214测试(3) https://jira.shanqu.cc/browse/GHZS-1251 2023-02-14 16:05:20 +08:00
f21368c761 Merge branch 'hotfix-gamedetail_jump_tab_error' into 'release'
fix: 修改游戏详情点击tab跳转错误问题

See merge request halo/android/assistant-android!706
2023-02-14 09:23:42 +08:00
2a020fb269 fix: 修改游戏详情点击tab跳转错误问题 2023-02-13 18:44:54 +08:00
0998109716 Merge remote-tracking branch 'origin/dev' into dev-5.20.0 2023-02-13 17:38:59 +08:00
89b463f40b Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-02-13 17:29:50 +08:00
32a6dff6cc feat: 【光环助手】多线程下载相关数据埋点补充 https://jira.shanqu.cc/browse/GHZS-1213 2023-02-13 17:28:28 +08:00
f4018172e3 Merge branch 'feature-GHZS-1213' into 'dev'
【光环助手】多线程下载相关数据埋点补充 https://jira.shanqu.cc/browse/GHZS-1213

See merge request halo/android/assistant-android!705
2023-02-13 17:26:09 +08:00
4745cede61 【光环助手】多线程下载相关数据埋点补充 https://jira.shanqu.cc/browse/GHZS-1213 2023-02-13 17:26:09 +08:00
bf39be9705 Merge branch 'feature-GHZS-1240' into 'dev-5.20.0'
fix: 新增[图标浮层]功能-0213UI测试 https://jira.shanqu.cc/browse/GHZS-1240

See merge request halo/android/assistant-android!704
2023-02-13 15:38:34 +08:00
1b5be46d53 Merge branch 'fix-GHZS-1200' into 'dev'
fix: 修改版块内容列表-发现页下载按钮不更新的问题

See merge request halo/android/assistant-android!703
2023-02-13 15:32:26 +08:00
97b7b6bcaa fix: 修改版块内容列表-发现页下载按钮不更新的问题 2023-02-13 15:30:29 +08:00
20c4ee5c0e fix: 新增[图标浮层]功能-0213UI测试 https://jira.shanqu.cc/browse/GHZS-1240 2023-02-13 14:24:38 +08:00
d76539c46a Merge branch 'fix-vgame_backup_clear_issue' into 'dev'
fix: 修复卸载所有畅玩游戏时没有正确清理数据库文件备份的问题

See merge request halo/android/assistant-android!702
2023-02-10 19:19:46 +08:00
a8a8f6835a fix: 修复卸载所有畅玩游戏时没有正确清理数据库文件备份的问题 2023-02-10 19:14:47 +08:00
656213153d Merge branch 'fix-webview_check_crash' into 'dev'
fix: 修复部分设备上检测 webview 类型时触发的闪退问题

See merge request halo/android/assistant-android!701
2023-02-10 17:53:42 +08:00
4a70dfed06 fix: 修复部分设备上检测 webview 类型时触发的闪退问题 2023-02-10 17:27:47 +08:00
4306f25b5e Merge branch 'fix-vgame_launch_issue' into 'dev'
fix: 保证在主线程启动畅玩游戏

See merge request halo/android/assistant-android!700
2023-02-10 16:43:43 +08:00
608b0d1c3a fix: 保证在主线程启动畅玩游戏 2023-02-10 16:41:15 +08:00
db119c22b3 Merge branch 'feature-GHZS-1001' into 'dev-5.20.0'
fix: 优化普通帖子详情评论区的显示 https://jira.shanqu.cc/browse/GHZS-1001

See merge request halo/android/assistant-android!699
2023-02-10 15:34:37 +08:00
02ba8df424 fix: 优化普通帖子详情评论区的显示 https://jira.shanqu.cc/browse/GHZS-1001 2023-02-10 15:34:37 +08:00
9071675fae Merge branch 'fix-GHZS-1221' into 'dev'
fix: 【游戏工具】原神悬浮窗登录问题 https://jira.shanqu.cc/browse/GHZS-1221

See merge request halo/android/assistant-android!698
2023-02-10 10:06:36 +08:00
21dc906600 fix: 【游戏工具】原神悬浮窗登录问题 https://jira.shanqu.cc/browse/GHZS-1221 2023-02-10 10:02:52 +08:00
677f1d6fb9 Merge branch 'feature-GHZS-1100' into 'dev-5.20.0'
feat: 新增[图标浮层]功能—客户端 https://jira.shanqu.cc/browse/GHZS-1100

See merge request halo/android/assistant-android!693
2023-02-10 09:54:37 +08:00
5bf0bb5042 feat: 新增[图标浮层]功能—客户端 https://jira.shanqu.cc/browse/GHZS-1100 2023-02-10 09:54:37 +08:00
4b90b43d0f Merge branch 'fix-GHZS-1229' into 'dev'
fix: 修复畅玩管理相关问题(1, 2, 4) https://jira.shanqu.cc/browse/GHZS-1229

See merge request halo/android/assistant-android!697
2023-02-10 09:14:05 +08:00
a03016a70c fix: 修复畅玩管理相关问题(1, 2, 4) https://jira.shanqu.cc/browse/GHZS-1229 2023-02-09 18:08:20 +08:00
0957ad65a3 Merge branch 'fix-vgame_database_issue' into 'dev'
fix: 修复畅玩游戏因为安装完成插入数据库异常而导致的显示问题

See merge request halo/android/assistant-android!696
2023-02-09 15:34:23 +08:00
13b004a78d fix: 修复畅玩游戏因为安装完成插入数据库异常而导致的显示问题 2023-02-09 15:28:18 +08:00
8e2fcd08b9 Merge remote-tracking branch 'origin/dev' into dev-5.20.0 2023-02-09 10:33:20 +08:00
6d4c16e1a9 Merge branch 'fix-vspace_installed_status' into 'dev'
fix: 修复畅玩组件没有图标时的检测安装问题

See merge request halo/android/assistant-android!695
2023-02-08 15:30:12 +08:00
efcff725ee fix: 修复畅玩组件没有图标时的检测安装问题 2023-02-08 15:24:05 +08:00
6076ad971f Merge branch 'feature-GHZS-1191' into 'dev'
fix: 【光环助手】模拟器banner图展示不完整 https://jira.shanqu.cc/browse/GHZS-1191

See merge request halo/android/assistant-android!694
2023-02-08 14:59:37 +08:00
44b497a697 fix: 【光环助手】模拟器banner图展示不完整 https://jira.shanqu.cc/browse/GHZS-1191 2023-02-08 14:59:37 +08:00
f7b86ef23c Merge branch 'fix-GHZS-1207' into 'dev'
fix: 修复评价详情回复列表内容高亮可复制文本不生效的问题 https://jira.shanqu.cc/browse/GHZS-1207

See merge request halo/android/assistant-android!692
2023-02-08 14:32:39 +08:00
3972b6fa17 fix: 修复评价详情回复列表内容高亮可复制文本不生效的问题 https://jira.shanqu.cc/browse/GHZS-1207 2023-02-08 14:26:21 +08:00
ead6e13ae5 Merge branch 'feature-GHZS-1187' into 'dev'
fix: 镜像设置相关功能优化—0206测试 https://jira.shanqu.cc/browse/GHZS-1187

See merge request halo/android/assistant-android!691
2023-02-08 13:54:36 +08:00
0588d072bc fix: 镜像设置相关功能优化—0206测试 https://jira.shanqu.cc/browse/GHZS-1187 2023-02-08 12:24:58 +08:00
f39010f2cb Merge branch 'feature-GHZS-1200' into 'dev'
fix: 【光环助手】首页/版块内容列表-发现页 下载问题 https://jira.shanqu.cc/browse/GHZS-1200

See merge request halo/android/assistant-android!690
2023-02-08 11:37:13 +08:00
fdc6907e93 fix: 【光环助手】首页/版块内容列表-发现页 下载问题 https://jira.shanqu.cc/browse/GHZS-1200 2023-02-08 11:28:54 +08:00
b5722e8e06 Merge branch 'feature-GHZS-1103' into 'dev-5.20.0'
fix: 发现页相关功能优化(第二期)—客户端 https://jira.shanqu.cc/browse/GHZS-1103

See merge request halo/android/assistant-android!689
2023-02-08 11:15:15 +08:00
44e331d368 fix: 发现页相关功能优化(第二期)—客户端 https://jira.shanqu.cc/browse/GHZS-1103 2023-02-08 11:12:02 +08:00
63ef4bd9df Merge branch 'fix-vspace_without_icon_error' into 'dev'
fix: 修复畅玩组件没有桌面图标时的检测安装问题

See merge request halo/android/assistant-android!688
2023-02-08 10:38:15 +08:00
eb6f078654 fix: 修复畅玩组件没有图标时的检测安装问题 2023-02-08 10:34:11 +08:00
8d4b8bdd01 Merge branch 'fix-horizontal_subject_click_issue' into 'dev'
fix: 修复横向固定专题跳转游戏详情下载按钮为空的问题

See merge request halo/android/assistant-android!687
2023-02-07 17:50:52 +08:00
ef7b8a7d79 fix: 修复横向固定专题跳转游戏详情下载按钮为空的问题 2023-02-07 17:43:37 +08:00
125640c22d Merge branch 'fix-GHZS-1167' into 'dev'
fix: 修复解压异常导致任务无法被删除的问题 https://jira.shanqu.cc/browse/GHZS-1167

See merge request halo/android/assistant-android!686
2023-02-07 16:57:29 +08:00
f4d7fd8715 fix: 修复解压异常导致任务无法被删除的问题 https://jira.shanqu.cc/browse/GHZS-1167 2023-02-07 16:51:53 +08:00
04cf28fc66 Merge branch 'feature-GHZS-1155' into 'dev'
fix:【光环助手】游戏评分在模拟器无法发布回复问题 https://jira.shanqu.cc/browse/GHZS-1155

See merge request halo/android/assistant-android!685
2023-02-06 17:39:04 +08:00
f2874d6b03 fix:【光环助手】游戏评分在模拟器无法发布回复问题 https://jira.shanqu.cc/browse/GHZS-1155 2023-02-06 17:09:53 +08:00
d21b5492c0 Merge branch 'fix-GHZS-1167' into 'dev'
fix: 修复浏览器安装模式下XAPK无法安装问题 https://jira.shanqu.cc/browse/GHZS-1167

See merge request halo/android/assistant-android!684
2023-02-06 16:00:39 +08:00
9aa21d6649 fix: 修复浏览器安装模式下XAPK无法安装问题 https://jira.shanqu.cc/browse/GHZS-1167 2023-02-06 15:56:05 +08:00
562faceba9 Merge branch 'feature-GHZS-1066' into 'dev-5.20.0'
fix:【光环助手】资讯文章-下载按钮显示问题(0206测试1) https://jira.shanqu.cc/browse/GHZS-1066

See merge request halo/android/assistant-android!683
2023-02-06 14:45:24 +08:00
656204de13 fix:【光环助手】资讯文章-下载按钮显示问题(0206测试1) https://jira.shanqu.cc/browse/GHZS-1066 2023-02-06 14:42:54 +08:00
f6b40a02e7 Merge branch 'feature-GHZS-1157' into 'dev'
fix: 游戏镜像相关数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-1157

See merge request halo/android/assistant-android!682
2023-02-03 14:00:12 +08:00
f1d7ecda57 fix: 游戏镜像相关数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-1157 2023-02-03 13:56:33 +08:00
5c80bdaf51 Merge branch 'fix-wrong_log' into 'dev'
fix: 修复游戏详情 tab 点击上报异常 https://jira.shanqu.cc/browse/GHZS-1164

See merge request halo/android/assistant-android!681
2023-02-03 11:43:14 +08:00
4b70b03c0d fix: 修复游戏详情 tab 点击上报异常 https://jira.shanqu.cc/browse/GHZS-1164 2023-02-03 11:38:28 +08:00
7e6d227bdd Merge branch 'feature-GHZS-1161' into 'dev'
fix: 镜像设置相关功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-1161

See merge request halo/android/assistant-android!680
2023-02-03 11:32:59 +08:00
a241ea4ad3 fix: 镜像设置相关功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-1161 2023-02-03 11:28:17 +08:00
7cb88445af Merge branch 'feature-GHZS-1161' into 'dev'
fix: 镜像设置相关功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-1161

See merge request halo/android/assistant-android!679
2023-02-03 09:58:57 +08:00
c895717393 fix: 镜像设置相关功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-1161 2023-02-03 09:55:43 +08:00
23bd96bbb2 Merge branch 'feature-GHZS-1149' into 'dev'
fix: 【光环助手】自定义栏目-正文说明 显示问题 https://jira.shanqu.cc/browse/GHZS-1149

See merge request halo/android/assistant-android!678
2023-02-03 09:16:46 +08:00
3308f18133 fix: 【光环助手】自定义栏目-正文说明 显示问题 https://jira.shanqu.cc/browse/GHZS-1149 2023-02-02 18:41:02 +08:00
7d1298f306 Merge branch 'feature-GHZS-1147' into 'dev'
fix: 【光环助手】游戏详情-大家都在玩 相关问题(2) https://jira.shanqu.cc/browse/GHZS-1147

See merge request halo/android/assistant-android!677
2023-02-02 16:13:42 +08:00
61d48fe392 fix: 【光环助手】游戏详情-大家都在玩 相关问题(2) https://jira.shanqu.cc/browse/GHZS-1147 2023-02-02 16:10:06 +08:00
02f871f95f Merge branch 'feature-GHZS-1148' into 'dev'
fix:【光环助手】首页/版块内容列表-安利墙显示问题 https://jira.shanqu.cc/browse/GHZS-1148

See merge request halo/android/assistant-android!676
2023-02-02 15:50:19 +08:00
8a0c7c9992 fix:【光环助手】首页/版块内容列表-安利墙显示问题 https://jira.shanqu.cc/browse/GHZS-1148 2023-02-02 15:06:45 +08:00
afdf102f85 Merge branch 'feature-GHZS-1119' into 'dev-5.20.0'
fix: 模拟器图片显示优化—客户端 https://jira.shanqu.cc/browse/GHZS-1119

See merge request halo/android/assistant-android!675
2023-02-01 17:48:58 +08:00
3f48d460fb fix: 模拟器图片显示优化—客户端 https://jira.shanqu.cc/browse/GHZS-1119 2023-02-01 17:43:13 +08:00
43db2becf2 Merge branch 'feature-GHZS-1064' into 'dev-5.20.0'
fix:【光环助手】多版本下载面板-版本说明显示问题 https://jira.shanqu.cc/browse/GHZS-1064

See merge request halo/android/assistant-android!674
2023-02-01 16:54:38 +08:00
e3d4aa66f9 fix:【光环助手】多版本下载面板-版本说明显示问题 https://jira.shanqu.cc/browse/GHZS-1064 2023-02-01 16:46:22 +08:00
a7012fa27f Merge branch 'feature-vpn' into 'dev-5.20.0'
feat: 完成简单的 VPN 网络限制功能 https://jira.shanqu.cc/browse/GHZS-1136

See merge request halo/android/assistant-android!673
2023-02-01 15:58:47 +08:00
540982250a feat: 完成简单的 VPN 网络限制功能 https://jira.shanqu.cc/browse/GHZS-1136?jql=text%20~%20%22vpn%22 2023-02-01 15:38:35 +08:00
3a5cddf250 Merge branch 'feature-GHZS-1048' into 'dev-5.20.0'
fix:【光环助手】内容卡片-游戏开服 相关问题 https://jira.shanqu.cc/browse/GHZS-1048

See merge request halo/android/assistant-android!672
2023-02-01 15:26:25 +08:00
48c5171e92 fix:【光环助手】内容卡片-游戏开服 相关问题 https://jira.shanqu.cc/browse/GHZS-1048 2023-02-01 15:23:10 +08:00
3dcc23509f Merge branch 'feature-GHZS-1051' into 'dev-5.20.0'
fix: 【光环助手】游戏单前端显示问题 https://jira.shanqu.cc/browse/GHZS-1051

See merge request halo/android/assistant-android!671
2023-02-01 14:05:17 +08:00
04af2a54dd fix: 【光环助手】游戏单前端显示问题 https://jira.shanqu.cc/browse/GHZS-1051 2023-02-01 14:00:03 +08:00
ec9e225c1a Merge branch 'feature-GHZS-1049' into 'dev-5.20.0'
fix:【光环助手】游戏下载过程中闪烁问题 https://jira.shanqu.cc/browse/GHZS-1049

See merge request halo/android/assistant-android!670
2023-02-01 11:46:18 +08:00
01c2ff29f1 Merge branch 'feature-GHZS-1066' into 'dev-5.20.0'
fix:【光环助手】资讯文章-下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-1066

See merge request halo/android/assistant-android!669
2023-02-01 11:28:23 +08:00
9ddc4b1de0 chore: 版本更新到 5.20.0 2023-02-01 11:26:50 +08:00
de5420f01d fix:【光环助手】资讯文章-下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-1066 2023-02-01 11:14:46 +08:00
4a79a35394 fix:【光环助手】游戏下载过程中闪烁问题 https://jira.shanqu.cc/browse/GHZS-1049 2023-02-01 11:12:29 +08:00
99049af27b chore: 版本更新到 5.17.4 (旧提交好像丢失了?) 2023-01-31 15:02:44 +08:00
d3565f105a Merge branch 'feature-GHZS-1074' into 'release'
feat:【光环助手】快手SDK对接需求—客户端 https://jira.shanqu.cc/browse/GHZS-1074

See merge request halo/android/assistant-android!668
2023-01-31 14:52:43 +08:00
7e004c5bbd feat:【光环助手】快手SDK对接需求—客户端 https://jira.shanqu.cc/browse/GHZS-1074 2023-01-31 14:52:43 +08:00
99c318c571 chore: 版本更新到 5.19.0 2023-01-31 10:24:44 +08:00
e77542abef Merge branch 'feature-GHZS-1020' into 'dev'
fix: 游戏镜像&游戏屏蔽优化汇总—0113补充  https://jira.shanqu.cc/browse/GHZS-1020

See merge request halo/android/assistant-android!667
2023-01-31 09:29:28 +08:00
2a5b189d36 Merge branch 'fix-discover_card_crash' into 'dev'
fix: 修复首页发现页卡片闪退问题

See merge request halo/android/assistant-android!666
2023-01-30 10:52:36 +08:00
8a6ac74b87 fix: 修复首页发现页卡片闪退问题 2023-01-30 10:46:03 +08:00
e8b185cb0f Merge branch 'feature-GHZS-1040' into 'dev'
fix: 游戏广告管理功能(第二期)—0118测试(2) https://jira.shanqu.cc/browse/GHZS-1040

See merge request halo/android/assistant-android!665
2023-01-18 15:01:03 +08:00
e4dc0d9cda fix: 游戏广告管理功能(第二期)—0118测试(2) https://jira.shanqu.cc/browse/GHZS-1040 2023-01-18 14:54:34 +08:00
44bee7bb4b Merge branch 'hotfix-v5.17.4-694-wechat_share_callback' into 'release'
fix: 修复部分机型不回调网页微信分享结果的问题

See merge request halo/android/assistant-android!664
2023-01-18 11:28:50 +08:00
22ff99e6e3 fix: 修复部分机型不回调网页微信分享结果的问题 2023-01-18 11:08:16 +08:00
f70f574e6d fix: 游戏镜像&游戏屏蔽优化汇总—0113补充 https://jira.shanqu.cc/browse/GHZS-1020 2023-01-17 15:14:07 +08:00
b6db8fa99f Merge branch 'feature-GHZS-998' into 'dev'
fix: 游戏镜像&游戏屏蔽优化汇总-0112测试(2(2)) https://jira.shanqu.cc/browse/GHZS-998

See merge request halo/android/assistant-android!663
2023-01-16 16:38:30 +08:00
2e113314ba fix: 游戏镜像&游戏屏蔽优化汇总-0112测试(2(2)) https://jira.shanqu.cc/browse/GHZS-998 2023-01-16 16:33:55 +08:00
d84f208de4 Merge branch 'feature-GHZS-988' into 'dev'
feat: 优化 GameEntity 高频调用方法的性能

See merge request halo/android/assistant-android!662
2023-01-16 10:41:29 +08:00
09ae826e3c feat: 优化 GameEntity 高频调用方法的性能 https://jira.shanqu.cc/browse/GHZS-968 2023-01-15 14:38:19 +08:00
18a04aac52 Merge branch 'fix-home_discover_item_dislocation' into 'dev'
fix: 修复首页发现页Item提交不喜欢错位问题

See merge request halo/android/assistant-android!661
2023-01-13 16:52:19 +08:00
cec418d484 fix: 修复首页发现页Item提交不喜欢错位问题 2023-01-13 16:42:30 +08:00
4dfed562d4 Merge branch 'feature-GHZS-956' into 'dev'
feat: 完善首页列表的子项数据比对代码 https://jira.shanqu.cc/browse/GHZS-956

See merge request halo/android/assistant-android!656
2023-01-13 15:51:36 +08:00
479b243136 feat: 完善首页列表的子项数据比对代码 https://jira.shanqu.cc/browse/GHZS-956 2023-01-13 15:51:36 +08:00
392bdf9715 Merge branch 'feature-GHZS-998' into 'dev'
fix: 游戏镜像&游戏屏蔽优化汇总-0112测试 https://jira.shanqu.cc/browse/GHZS-998

See merge request halo/android/assistant-android!660
2023-01-13 11:47:04 +08:00
39a4dcbe34 fix: 游戏镜像&游戏屏蔽优化汇总-0112测试 https://jira.shanqu.cc/browse/GHZS-998 2023-01-13 11:47:04 +08:00
3104db7c10 Merge branch 'fix_missing_material_button_crash' into 'dev'
fix: 修复 compose 包切换渠道时的闪退问题

See merge request halo/android/assistant-android!659
2023-01-13 10:25:16 +08:00
0f9cff90f8 fix: 修复 compose 包切换渠道时的闪退问题 2023-01-13 10:20:21 +08:00
197e650e81 Merge remote-tracking branch 'origin/release' into dev 2023-01-13 09:53:09 +08:00
f60c907978 Merge branch 'hotfix-vspace_launch_error' into 'release'
修复畅玩游戏安装异常

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

See merge request halo/android/assistant-android!657
2023-01-12 17:13:42 +08:00
e911588569 fix: 全量捕抓畅玩云存档下载的数据库异常 2023-01-12 17:04:36 +08:00
92d006e018 Merge branch 'feature-GHZS-982' into 'dev'
fix: 处理部分页面深色模式下的显示异常 https://jira.shanqu.cc/browse/GHZS-982

See merge request halo/android/assistant-android!655
2023-01-12 14:15:07 +08:00
a04c9bb7c2 Merge branch 'fix-dark_mode' into 'dev'
处理部分界面切换深色模式出现的异常

See merge request halo/android/assistant-android!652
2023-01-12 14:14:36 +08:00
f0093f3ff5 fix: 处理部分页面深色模式下的显示异常 https://jira.shanqu.cc/browse/GHZS-982 2023-01-12 13:55:32 +08:00
8b1c046475 Merge branch 'hotfix-v5.17.3-693-fix_vgame_update' into 'release'
fix: 修复畅玩游戏更新功能

See merge request halo/android/assistant-android!654
2023-01-12 09:21:06 +08:00
984a1ba517 fix: 修复畅玩游戏更新功能 2023-01-12 09:21:05 +08:00
d5021e139d Merge branch 'fix-data_compare_issue' into 'dev'
fix: 还原部分列表 data class,避免列表比较时的异常

See merge request halo/android/assistant-android!653
2023-01-11 16:59:54 +08:00
d43613b259 fix: 还原部分列表 data class,避免列表比较时的异常 2023-01-11 16:54:14 +08:00
8c2eb3d2be fix: 修复礼包中心右上角管理菜单显示时标题不居中的问题 2023-01-11 11:49:56 +08:00
3e55f2e1a1 fix: 修复礼包中心存号箱tab没有兼容深色模式的问题 2023-01-11 11:48:45 +08:00
2424521d0f fix: 修复部分带Tab界面Tab切换深色模式不变色的问题 2023-01-11 11:48:06 +08:00
e42b060e85 Merge branch 'feature-GHZS-953' into 'dev'
fix: 游戏镜像&游戏屏蔽优化汇总—客户端 https://jira.shanqu.cc/browse/GHZS-953

See merge request halo/android/assistant-android!651
2023-01-11 11:18:28 +08:00
e29a787c73 fix: 游戏镜像&游戏屏蔽优化汇总—客户端 https://jira.shanqu.cc/browse/GHZS-953 2023-01-11 11:18:28 +08:00
362ac1415c Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-01-11 11:11:02 +08:00
a5cdc5b432 Merge branch 'feature-GHZS-973' into 'dev'
fix: 【光环助手】内容卡片-镜像游戏显示优化 https://jira.shanqu.cc/browse/GHZS-973

See merge request halo/android/assistant-android!650
2023-01-11 09:23:41 +08:00
1d3ef08bb3 fix: 【光环助手】内容卡片-镜像游戏显示优化 https://jira.shanqu.cc/browse/GHZS-973 2023-01-10 21:38:13 +08:00
a337494d22 chore: 版本更新到 5.17.3 2023-01-10 16:00:58 +08:00
6c5f9f2689 Merge branch 'hotfix-v5.17.2-692-crashes' into 'release'
修复闪退和畅玩连接异常

See merge request halo/android/assistant-android!649
2023-01-10 16:00:12 +08:00
7ad73b84f9 fix: 修复畅玩 contentProvider 写入闪退,修复畅玩服务断连后首次安装失败的问题 2023-01-10 15:53:34 +08:00
ad683b66d7 fix: 修复检查设备 webview 状态时 webview 列表为空时的闪退 2023-01-10 15:51:12 +08:00
d972023a6a Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt
#	app/src/main/java/com/gh/common/provider/AppProviderImpl.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/rating/edit/RatingEditActivity.kt
#	app/src/main/java/com/halo/assistant/HaloApp.java
#	dependencies.gradle
#	module_core/src/main/java/com/gh/gamecenter/core/provider/IAppProvider.kt
#	module_login/src/main/java/com/gh/gamecenter/login/user/UserRepository.java
2023-01-09 11:00:20 +08:00
53987d29b0 Merge branch 'feature-GHZS-940' into 'dev'
fix: 整理 DialogUtils 的历史弹窗并改为新的弹窗-0106UI测试 https://jira.shanqu.cc/browse/GHZS-940

See merge request halo/android/assistant-android!644
2023-01-09 10:10:15 +08:00
1999663cc8 fix: 整理 DialogUtils 的历史弹窗并改为新的弹窗-0106UI测试 https://jira.shanqu.cc/browse/GHZS-940 2023-01-09 10:03:02 +08:00
3b731bdbf9 Merge branch 'feature-GHZS-931' into 'dev'
fix: 【光环助手】发现页提交不喜欢错位问题 https://jira.shanqu.cc/browse/GHZS-931

See merge request halo/android/assistant-android!639
2023-01-06 14:26:13 +08:00
589e433676 fix: 【光环助手】发现页提交不喜欢错位问题 https://jira.shanqu.cc/browse/GHZS-931 2023-01-06 14:16:51 +08:00
424aed9630 Merge branch 'feature-GHZS-922' into 'dev'
fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-922

See merge request halo/android/assistant-android!637
2023-01-05 17:56:03 +08:00
b9093ee846 fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-922 2023-01-05 17:56:02 +08:00
f0866d1a4c Merge branch 'feature-GHZS-853' into 'dev'
feat: 整理 DialogUtils 的历史弹窗并改为新的弹窗 https://jira.shanqu.cc/browse/GHZS-853

See merge request halo/android/assistant-android!636
2023-01-05 11:07:31 +08:00
bb86bf313b feat: 整理 DialogUtils 的历史弹窗并改为新的弹窗 https://jira.shanqu.cc/browse/GHZS-853 2023-01-05 11:00:41 +08:00
685e938de3 Merge branch 'feature-GHZS-917' into 'dev'
build: 更新 sentry 版本 https://jira.shanqu.cc/browse/GHZS-917

See merge request halo/android/assistant-android!634
2023-01-05 10:52:44 +08:00
3c70daf23c build: 更新 sentry 版本 https://jira.shanqu.cc/browse/GHZS-917 2023-01-05 10:52:44 +08:00
1109f1bc57 Merge branch 'feature-GHZS-923' into 'dev'
fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-923

See merge request halo/android/assistant-android!632
2023-01-05 10:12:27 +08:00
bd918b5896 fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-923 2023-01-05 09:43:26 +08:00
f3e9d55707 Merge branch 'fix-remove_unused_resources' into 'dev'
fix: 移除无用资源

See merge request halo/android/assistant-android!631
2023-01-04 17:35:30 +08:00
cb7f84a461 fix: 移除无用资源 2023-01-04 17:27:32 +08:00
59c6c493ec Merge branch 'feature-GHZS-920' into 'dev'
fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-920

See merge request halo/android/assistant-android!627
2023-01-04 16:49:43 +08:00
c8329c786b Merge branch 'feature-GHZS-921' into 'dev'
fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-921

See merge request halo/android/assistant-android!629
2023-01-04 16:39:30 +08:00
bf016c6404 fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-921 2023-01-04 16:14:35 +08:00
b395f7c96a fix: 处理 sonar 新变动代码的异味 https://jira.shanqu.cc/browse/GHZS-920 2023-01-04 15:54:52 +08:00
a03a829980 Merge branch 'feature-GHZS-916' into 'dev'
fix: 移除无用的数据库相关代码 https://jira.shanqu.cc/browse/GHZS-916

See merge request halo/android/assistant-android!625
2023-01-04 14:29:20 +08:00
9101ed4d47 fix: 移除无用的数据库相关代码 https://jira.shanqu.cc/browse/GHZS-916 2023-01-04 14:25:33 +08:00
47fef0065d Merge remote-tracking branch 'origin/release' into dev 2023-01-04 13:53:24 +08:00
a77d37ea68 Merge branch 'fix-compile' into 'dev'
邮件包启用 compose 实现的设置界面

See merge request halo/android/assistant-android!623
2023-01-04 11:22:56 +08:00
d38a071e4d 邮件包启用 compose 实现的设置界面 2023-01-04 11:22:56 +08:00
7d2f16e2d6 Merge remote-tracking branch 'origin/dev' into dev 2023-01-03 17:53:43 +08:00
0e395bb68f fix: 处理合并冲突 2023-01-03 17:53:18 +08:00
6eaaea046e Merge branch 'dev-fix-compose_setting' into 'dev'
fix:compose设置模块同步设置模块的修改,修复部分机型设置项的描述文字显示不全的问题

See merge request halo/android/assistant-android!622
2023-01-03 17:45:44 +08:00
9075fae76f fix:compose设置模块同步设置模块的修改,修复部分机型设置项的描述文字显示不全的问题 2023-01-03 17:39:13 +08:00
4ecd007f07 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java
#	app/src/main/java/com/gh/gamecenter/game/rank/RankGameItemUi.kt
#	app/src/main/java/com/gh/gamecenter/gamecollection/publish/GameCollectionEditActivity.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt
#	app/src/main/java/com/gh/gamecenter/qa/video/detail/ForumVideoDetailFragment.kt
#	app/src/main/java/com/gh/gamecenter/video/detail/VideoAdapter.kt
#	app/src/main/res/layout/game_horizontal_simple_item.xml
#	app/src/main/res/layout/game_test_item.xml
#	app/src/main/res/layout/layout_video_detail_surface.xml
#	vspace-bridge
2023-01-03 17:32:11 +08:00
aceb49eaa9 Merge branch 'fix-compile' into 'dev'
fix: 处理编译问题(还原 build src AGP 版本)

See merge request halo/android/assistant-android!616
2022-12-30 11:45:16 +08:00
8af404f3c3 fix: 处理编译问题(还原后处理的 AGP 版本) 2022-12-30 11:37:45 +08:00
d3a7929810 Merge branch 'feature-GHZS-872' into 'dev'
fix:【光环助手】发现页相关测试问题-第2点 https://jira.shanqu.cc/browse/GHZS-872

See merge request halo/android/assistant-android!615
2022-12-30 10:48:51 +08:00
c46401c763 fix:【光环助手】发现页相关测试问题-第2点 https://jira.shanqu.cc/browse/GHZS-872 2022-12-30 10:44:32 +08:00
aa03595a47 Merge branch 'feature-GHZS-848' into 'dev'
fix:细化游戏单 proguard 保留的粒度 https://jira.shanqu.cc/browse/GHZS-848

See merge request halo/android/assistant-android!614
2022-12-30 10:25:29 +08:00
e04de2c9ed fix:细化游戏单 proguard 保留的粒度 https://jira.shanqu.cc/browse/GHZS-848 2022-12-30 10:12:44 +08:00
6297849db2 Merge branch 'feature-module_setting_compose_rebase' into 'dev'
将 feature-module_setting_compose 分支的代码 rebase 到 dev-5.18.0 https://jira.shanqu.cc/browse/GHZS-828

See merge request halo/android/assistant-android!607
2022-12-30 09:46:35 +08:00
2f1f061c87 将 feature-module_setting_compose 分支的代码 rebase 到 dev-5.18.0 https://jira.shanqu.cc/browse/GHZS-828 2022-12-30 09:46:35 +08:00
6acb88be74 Merge branch 'feature-GHZS-854' into 'dev'
feat: 清理 data class 冗余方法 https://jira.shanqu.cc/browse/GHZS-854

See merge request halo/android/assistant-android!613
2022-12-30 09:39:11 +08:00
bff8916a7e Merge branch 'feature-GHZS-870' into 'dev'
fix: 【光环助手】开测表-开测标签显示问题 https://jira.shanqu.cc/browse/GHZS-870

See merge request halo/android/assistant-android!612
2022-12-29 17:07:54 +08:00
a99b4ab224 feat: 清理 data class 冗余方法 https://jira.shanqu.cc/browse/GHZS-854 2022-12-29 17:06:10 +08:00
a43f6c5ce0 fix: 【光环助手】开测表-开测标签显示问题 https://jira.shanqu.cc/browse/GHZS-870 2022-12-29 17:00:23 +08:00
4bb39d220c Merge branch 'fix-exclude_packages' into 'dev'
fix:  exclude光环没有用到的 material 组件

See merge request halo/android/assistant-android!609
2022-12-29 11:31:39 +08:00
f03be94877 fix: exclude光环没有用到的 material 组件 2022-12-29 11:29:10 +08:00
22909500c3 Merge branch 'feature-GHZS-852' into 'dev'
fix: 尝试 exclude 光环没有用到的 material 组件 https://jira.shanqu.cc/browse/GHZS-852

See merge request halo/android/assistant-android!608
2022-12-29 10:18:36 +08:00
a6a0da45fc fix: 尝试 exclude 光环没有用到的 material 组件 https://jira.shanqu.cc/browse/GHZS-852 2022-12-28 17:49:03 +08:00
a4ba5f25d2 Merge branch 'feature-GHZS-847' into 'dev'
feat: 使用 TimeElapsedHelper 统计活动时间 https://jira.shanqu.cc/browse/GHZS-847

See merge request halo/android/assistant-android!606
2022-12-28 16:16:47 +08:00
198b06c9ce feat: 使用 TimeElapsedHelper 统计活动时间 https://jira.shanqu.cc/browse/GHZS-847 2022-12-28 15:58:53 +08:00
7eed44165c Merge branch 'feature-GHZS-846' into 'dev'
feat: 精简字体库 https://jira.shanqu.cc/browse/GHZS-846

See merge request halo/android/assistant-android!605
2022-12-28 14:37:38 +08:00
b918fa5b9b feat: 精简字体库 https://jira.shanqu.cc/browse/GHZS-846 2022-12-28 14:37:38 +08:00
7fd1b2e40a Merge branch 'feature-GHZS-845' into 'dev'
feat: 移除部分活动的相关代码及资源 https://jira.shanqu.cc/browse/GHZS-845

See merge request halo/android/assistant-android!603
2022-12-28 13:58:20 +08:00
bf99b61603 feat: 移除部分活动的相关代码及资源 https://jira.shanqu.cc/browse/GHZS-845 2022-12-28 13:58:20 +08:00
f39bc39821 Merge branch 'feature-GHZS-851' into 'dev'
fix: 移除 GameDetailEntity 已经没用的字段 https://jira.shanqu.cc/browse/GHZS-851

See merge request halo/android/assistant-android!602
2022-12-28 11:36:15 +08:00
3f8e220181 fix: 移除 GameDetailEntity 已经没用的字段 https://jira.shanqu.cc/browse/GHZS-851 2022-12-28 11:36:15 +08:00
5d06646786 Merge remote-tracking branch 'origin/dev-5.18.0' into dev-5.18.0 2022-12-28 10:38:20 +08:00
37f1aeef5c Merge branch 'hotfix-remove_useless_data_class' into 'dev-5.18.0'
fix: 移除部分没用的实体类

See merge request halo/android/assistant-android!600
2022-12-28 10:33:42 +08:00
2210ed31fb Merge remote-tracking branch 'origin/dev' into dev-5.18.0
# Conflicts:
#	app/src/main/java/com/gh/common/DefaultUrlHandler.kt
#	vspace-bridge
2022-12-28 10:31:57 +08:00
33a32c707e Merge branch 'feature-GHZS-850' into 'dev-5.18.0'
fix: 细化视频详情 proguard 保留的粒度 https://jira.shanqu.cc/browse/GHZS-850

See merge request halo/android/assistant-android!601
2022-12-28 10:25:39 +08:00
c3bbbe3d17 fix: 细化视频详情 proguard 保留的粒度 https://jira.shanqu.cc/browse/GHZS-850 2022-12-28 10:19:32 +08:00
90540b1475 Merge branch 'feature-GHZS-837' into 'dev-5.18.0'
feat: 整理静态类代码 https://jira.shanqu.cc/browse/GHZS-837

See merge request halo/android/assistant-android!599
2022-12-28 09:24:03 +08:00
2812cdde01 fix: 移除部分没用的实体类 2022-12-27 16:17:51 +08:00
f63d5eb30a feat: 整理静态类代码 https://jira.shanqu.cc/browse/GHZS-837
1. 移除远古时代的光环3.0数据同步代码
2. 清理部分无用的弹窗构建代码
3. 将默认头像修改完全放置到网络数据中 (原来是本地 drawable,但提交固定 url 的形式)
4. 移除部分没有引用的代码
5. 合并重复的日志类
6. 移除已经没有入口的玩过的游戏 activity
7. 整理部分含有无用入参的方法
8. 重命名部分不合规范的命名
2022-12-27 15:20:23 +08:00
a798250357 Merge branch 'feature-GHZS-824' into 'dev-5.18.0'
fix:处理部分页面深色模式显示异常 https://jira.shanqu.cc/browse/GHZS-824

See merge request halo/android/assistant-android!597
2022-12-27 14:13:20 +08:00
2e34102d9a fix:处理部分页面深色模式显示异常 https://jira.shanqu.cc/browse/GHZS-824 2022-12-27 14:13:20 +08:00
743332179b Merge branch 'feature-GHZS-826' into 'dev-5.18.0'
feat: 统一整理日志相关工具类反复出现的字符串 https://jira.shanqu.cc/browse/GHZS-826

See merge request halo/android/assistant-android!598
2022-12-27 11:24:40 +08:00
044270f79b feat: 统一整理日志相关工具类反复出现的字符串 https://jira.shanqu.cc/browse/GHZS-826 2022-12-27 10:52:38 +08:00
5624efe693 Merge branch 'feature-GHZS-750' into 'dev-5.18.0'
feat: 游戏评分相关数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-750

See merge request halo/android/assistant-android!596
2022-12-27 10:34:17 +08:00
6f94c2158a feat: 游戏评分相关数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-750 2022-12-27 10:34:17 +08:00
664b0f7a72 Merge branch 'feature-GHZS-825' into 'dev-5.18.0'
feat: 全量检查并修改 kotlin 部分静态类初始化变量问题 https://jira.shanqu.cc/browse/GHZS-825

See merge request halo/android/assistant-android!595
2022-12-26 14:33:24 +08:00
2a84590f70 feat: 全量检查并修改 kotlin 部分静态类初始化变量问题 https://jira.shanqu.cc/browse/GHZS-825 2022-12-26 14:30:49 +08:00
446acb8176 Merge branch 'feature-GHZS-825' into 'dev-5.18.0'
feat: 全量检查并修改 kotlin 部分静态类初始化变量问题 https://jira.shanqu.cc/browse/GHZS-825

See merge request halo/android/assistant-android!594
2022-12-26 14:19:40 +08:00
dc7db3d09f feat: 全量检查并修改 kotlin 部分静态类初始化变量问题 https://jira.shanqu.cc/browse/GHZS-825 2022-12-26 13:52:12 +08:00
e9263b0a22 Merge branch 'feature-GHZS-823' into 'dev-5.18.0'
fix: 社区 1x1 长图缩略图显示优化 https://jira.shanqu.cc/browse/GHZS-823

See merge request halo/android/assistant-android!592
2022-12-26 11:31:57 +08:00
fcc6b10e35 fix: 社区 1x1 长图缩略图显示优化 https://jira.shanqu.cc/browse/GHZS-823 2022-12-26 10:50:41 +08:00
9433e071b9 Merge branch 'fix-modify-dependencies' into 'dev-5.18.0'
处理编译的一些问题

See merge request halo/android/assistant-android!588
2022-12-23 09:22:56 +08:00
c4f1894504 fix: 处理 databinding 编译问题 2022-12-22 18:04:27 +08:00
c7cda3f64f build: 将aar单独放到一个模块里,避免多个地方重复拷贝 2022-12-22 16:17:44 +08:00
3a6dba580b Merge branch 'feature-GHZS-797' into 'dev-5.18.0'
feat: 组件化帮助与反馈功能 https://jira.shanqu.cc/browse/GHZS-797

See merge request halo/android/assistant-android!586
2022-12-22 13:50:18 +08:00
1a653b551e feat: 组件化帮助与反馈功能 https://jira.shanqu.cc/browse/GHZS-797 2022-12-22 13:50:18 +08:00
eef2ae3dbe Merge branch 'feature-GHZS-796' into 'dev-5.18.0'
feat:优化设置模块 https://jira.shanqu.cc/browse/GHZS-796

See merge request halo/android/assistant-android!585
2022-12-21 15:05:14 +08:00
011f8cc2b7 feat:优化设置模块 https://jira.shanqu.cc/browse/GHZS-796 2022-12-21 15:05:14 +08:00
3eb002ece1 chore: 版本更新至 5.18.0 2022-12-21 14:36:17 +08:00
ead95968ec Merge remote-tracking branch 'origin/dev' into dev-5.18.0 2022-12-21 10:28:57 +08:00
c5019a90f7 Merge branch 'feature-GHZS-779' into 'dev-5.18.0'
feat: 畅玩助手问题反馈相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-779

See merge request halo/android/assistant-android!582
2022-12-20 17:59:54 +08:00
e7bc17c29f feat: 畅玩助手问题反馈相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-779 2022-12-20 17:53:38 +08:00
6cf154268a Merge branch 'feature-fix_rejected_task_error' into 'dev-5.18.0'
简单处理线程池不足以运行更多任务的问题 https://jira.shanqu.cc/browse/GHZS-801

See merge request halo/android/assistant-android!580
2022-12-20 16:40:13 +08:00
395bfc744e 简单处理线程池不足以运行更多任务的问题 https://jira.shanqu.cc/browse/GHZS-801 2022-12-20 16:40:13 +08:00
9892e891e2 Merge branch 'dev' into 'dev-5.18.0'
fix: 更新畅玩 module 依赖

See merge request halo/android/assistant-android!579
2022-12-19 11:21:58 +08:00
9d9d620d98 Merge branch 'feature-GHZS-578' into 'dev-5.18.0'
fix:【光环助手】夜间模式测试问题汇总(3-4) https://jira.shanqu.cc/browse/GHZS-578

See merge request halo/android/assistant-android!577
2022-12-16 16:58:36 +08:00
6f28b640dd Merge branch 'feature-GHZS-766' into 'dev-5.18.0'
feat: 埋点事件补充—客户端 https://jira.shanqu.cc/browse/GHZS-766

See merge request halo/android/assistant-android!575
2022-12-16 16:45:24 +08:00
eaae32a06a Merge branch 'feature-GHZS-798' into 'dev-5.18.0'
fix: 移除热门卡牌专题的相关代码 https://jira.shanqu.cc/browse/GHZS-798

See merge request halo/android/assistant-android!576
2022-12-16 16:37:22 +08:00
c2f32aafff fix:【光环助手】夜间模式测试问题汇总(3-4) https://jira.shanqu.cc/browse/GHZS-578 2022-12-16 15:37:40 +08:00
f9d2c875b8 fix: 移除热门卡牌专题的相关代码 https://jira.shanqu.cc/browse/GHZS-798 2022-12-16 15:19:52 +08:00
72634a877e feat: 埋点事件补充—客户端 https://jira.shanqu.cc/browse/GHZS-766 2022-12-16 14:38:50 +08:00
7c76753815 Merge branch 'feature-GHZS-717' into 'dev-5.18.0'
fix:【光环助手】开服表的多版本下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-717

See merge request halo/android/assistant-android!573
2022-12-16 13:44:40 +08:00
a36d905e27 Merge branch 'feature-GHZS-800' into 'dev-5.18.0'
fix: 解决多线程调用 DownloadManager.initMap() 造成的问题 https://jira.shanqu.cc/browse/GHZS-800

See merge request halo/android/assistant-android!574
2022-12-16 12:02:35 +08:00
ab7e417b42 fix: 解决多线程调用 DownloadManager.initMap() 造成的问题 https://jira.shanqu.cc/browse/GHZS-800 2022-12-16 11:36:04 +08:00
198eb0d961 fix:【光环助手】开服表的多版本下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-717 2022-12-15 17:55:41 +08:00
1301 changed files with 18365 additions and 10297 deletions

View File

@ -1,43 +1,43 @@
stages:
- analysis
- sendmail
- android-build
- docker-build
## 代码检查
sonarqube_analysis:
android_build:
tags:
- offline-test
stage: analysis
image: sonarsource/sonar-scanner-cli:latest
dependencies: [] #禁止传递来的artifact
stage: android-build
image: hub.shanqu.cc/devops/ci-android:jdk11
variables:
KUBERNETES_CPU_LIMIT: "16"
GIT_SUBMODULE_STRATEGY: recursive
Apk_Path: "app/build/outputs/apk/**/release/*.apk"
script:
## 获取项目的一级组和二级组和项目名作为projectKey例如projectKey=platform-backend-eci-monitor
- group=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
- sonar-scanner
-Dsonar.host.url=http://sonarqube-server.sonarqube:9000/
-Dsonar.login=be43de7264ce4c4766eb0c020373c3e74e6df257
-Dsonar.jacoco.reportPaths=target/jacoco.exec
-Dsonar.projectKey=$group
-Dsonar.projectName=$CI_PROJECT_PATH
-Dsonar.sourceEncoding=UTF-8
-Dsonar.exclusions=**/vendor/**,**/errcode/**
-Dsonar.gitlab.project_id=$CI_PROJECT_ID
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
-Dsonar.gitlab.ci_merge_request_iid=$CI_MERGE_REQUEST_IID
-Dsonar.gitlab.merge_request_discussion=true
-Dsonar.java.binaries=. # 如果不使用Maven或Gradle进行分析则必须手动提供测试二进制文件
- export GRADLE_USER_HOME=./.gradle
- chmod +x ./gradlew
- ./scripts/jenkins_build.sh -c
- rm -rf ./.gradle/caches/build-cache-1
cache:
paths:
- .gradle
only:
- dev
## 发送简易检测结果报告
send_sonar_report:
- feature-ci
# 构建推送docker镜像
docker-build:
tags:
- offline-test
stage: sendmail
stage: docker-build
variables:
GIT_SUBMODULE_STRATEGY: recursive
image: hub.shanqu.cc/library/docker:latest
dependencies: [] #禁止传递来的artifact
script:
- group=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
- docker run -e PROJECTKEY=$group -e EMAIL=$GITLAB_USER_EMAIL --name send-email --rm hub.shanqu.cc/platform/send-sonar-report:latest
- imageName=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
- docker build -t registry.cn-shenzhen.aliyuncs.com/ghzs/$imageName:latest .
- docker push registry.cn-shenzhen.aliyuncs.com/ghzs/$imageName:latest
cache:
paths:
- .gradle
policy: pull
only:
- dev
- feature-ci

8
.gitmodules vendored
View File

@ -1,13 +1,13 @@
[submodule "libraries/LGLibrary"]
path = libraries/LGLibrary
url = git@git.shanqu.cc:android/common-library.git
url = ../../../android/common-library.git
branch = master
[submodule "vspace-bridge"]
path = vspace-bridge
url = git@git.shanqu.cc:cwzs/android/vspace-bridge.git
url = ../../../cwzs/android/vspace-bridge.git
[submodule "module_common/src/debug/assets/assistant-android-mock"]
path = module_common/src/debug/assets/assistant-android-mock
url = git@git.shanqu.cc:halo/android/assistant-android-mock.git
url = ../../../halo/android/assistant-android-mock.git
[submodule "ndownload"]
path = ndownload
url = git@git.shanqu.cc:android/ndownload.git
url = ../../../android/ndownload.git

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM openjdk:11-jdk
WORKDIR /project
ARG CI_PROJECT_PATH=default_value
SHELL ["/bin/bash", "-c"]
#配置SDK环境变量
ENV ANDROID_SDK_ROOT /usr/lib/sdk
ENV ANDROID_HOME /usr/lib/sdk
ENV PATH $ANDROID_SDK_ROOT:$PATH
ENV PATH=$PATH:${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin/
ENV GRADLE_USER_HOME /project/.gradle
RUN source ~/.bashrc
RUN sed -i "s@http://\(deb\|security\).debian.org@https://mirrors.aliyun.com@g" /etc/apt/sources.list \
&& apt-get --quiet update --yes \
&& apt-get --quiet install --yes wget lib32stdc++6 lib32z1 libncurses5 \
&& rm -rf /var/lib/apt/lists/*
COPY . /project

View File

@ -127,7 +127,7 @@ android {
variantFilter { variant ->
def names = variant.flavors*.name
def isDebugType = variant.buildType.name == "debug"
if ((names.contains("tea")) && isDebugType) {
if ((names.contains("tea") || name.contains("kuaishou")) && isDebugType) {
setIgnore(true)
}
}
@ -144,6 +144,9 @@ android {
tea {
java.srcDirs = ['src/main/java', 'src/tea/java']
}
kuaishou {
java.srcDirs = ['src/main/java', 'src/kuaishou/java']
}
}
productFlavors {
@ -181,6 +184,16 @@ android {
manifestPlaceholders.put("APPLOG_SCHEME", "rangersapplog.byAx6uYt".toLowerCase())
}
kuaishou {
dimension "env"
buildConfigField "String", "DEV_API_HOST", "\"${API_HOST}\""
buildConfigField "String", "NEW_DEV_API_HOST", "\"${NEW_API_HOST}\""
buildConfigField "String", "DEV_VAPI_HOST", "\"${VAPI_HOST}\""
buildConfigField "String", "QUICK_LOGIN_APPID", "\"${QUICK_LOGIN_APPID}\""
buildConfigField "String", "QUICK_LOGIN_APPKEY", "\"${QUICK_LOGIN_APPKEY}\""
}
}
}
@ -195,6 +208,7 @@ dependencies {
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
teaImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/tea/libs')
kuaishouImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/kuaishou/libs')
testImplementation 'junit:junit:4.12'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakcanary}"
@ -272,6 +286,15 @@ dependencies {
implementation(project(':module_setting')) {
exclude group: 'androidx.swiperefreshlayout'
}
// implementation(project(':module_setting_compose')) {
// exclude group: 'androidx.swiperefreshlayout'
// }
implementation(project(':module_core_feature')){
exclude group: 'androidx.swiperefreshlayout'
}
implementation(project(':module_feedback')) {
exclude group: 'androidx.swiperefreshlayout'
}
// 默认不接入光能模块,提高编译速度
// debugImplementation(project(':module_energy')) {
// exclude group: 'androidx.swiperefreshlayout'
@ -425,7 +448,7 @@ andResGuard {
"*.gif",
]
sevenzip {
artifact = 'com.tencent.mm:SevenZip:1.2.20'
artifact = 'io.github.leon406:SevenZip:1.2.22.5'
}
}
@ -511,4 +534,4 @@ project.afterEvaluate {
}
}
}
}
}

View File

@ -17,15 +17,30 @@
-dontwarn com.j256.**
### app models
-keep class com.gh.common.view.* {*;}
-keep class com.gh.gamecenter.db.info.* {*;}
-keep class com.gh.gamecenter.entity.* {*;}
-keep class com.gh.gamecenter.qa.entity.* {*;}
-keep class com.gh.gamecenter.entity.** {<fields>;}
-keep class com.gh.gamecenter.qa.entity.** {<fields>;}
-keep class com.gh.gamecenter.BR
-keep class com.gh.gamecenter.retrofit.* {*;}
-keep class com.gh.gamecenter.eventbus.* {*;}
-keep class com.gh.gamecenter.video.detail.* {*;}
-keep class com.gh.gamecenter.home.gamecollection.* {*;}
-keep class com.gh.gamecenter.home.gamecollection.GameCollectionStackLayout {*;}
-keep class com.gh.gamecenter.home.gamecollection.GameCollectionStackAnimation {*;}
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
# TODO What's this ?
-ignorewarnings
@ -39,7 +54,7 @@
-dontwarn com.shuyu.gsyvideoplayer.utils.**
-keep class tv.danmaku.ijk.* { *; }
-dontwarn tv.danmaku.ijk.**
-keep public class * extends android.view.View{
-keep public class * extends android.view.View {
*** get*();
void set*(***);
public <init>(android.content.Context);
@ -54,15 +69,4 @@
-keep class com.lzf.easyfloat.* {*;}
### dokit
-keep class com.didichuxing.** {*;}
# Flutter模块
-keep class com.gh.common.util.DirectUtils {
public static void directToQa(...);
public static void directToQaCollection(...);
public static void directToGift(...);
public static void directToConcernInfo(...);
public static void directToFeedback(...);
public static void directToSuggestion(...);
}
-keep class com.didichuxing.** {*;}

View File

@ -0,0 +1,30 @@
package com.gh.gamecenter
import android.content.Context
import com.kwai.monitor.log.TurboAgent
import com.kwai.monitor.log.TurboConfig
object KuaishouHelper {
private const val APP_ID = "80655"
private const val APP_NAME = "guanghuanzhushou_1"
@JvmStatic
fun init(context: Context, channel: String) {
TurboAgent.init(
TurboConfig.TurboConfigBuilder.create(context)
.setAppId(APP_ID)
.setAppName(APP_NAME)
.setAppChannel(channel)
.build()
)
}
@JvmStatic
fun onEvent(type: String) {
when (type) {
"EVENT_ACTIVE" -> TurboAgent.onAppActive()
"active_register" -> TurboAgent.onRegister()
"EVENT_NEXTDAY_STAY" -> TurboAgent.onNextDayStay()
}
}
}

View File

@ -0,0 +1,48 @@
package com.gh.gamecenter.provider
import android.app.Activity
import android.app.Application
import android.text.TextUtils
import com.gh.gamecenter.KuaishouHelper
import com.gh.gamecenter.core.provider.IFlavorProvider
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.TimeUtils
import com.halo.assistant.HaloApp
import com.leon.channel.helper.ChannelReaderUtil
class FlavorProviderImp : IFlavorProvider {
override fun init(application: Application, activity: Activity) {
KuaishouHelper.init(application, getChannelStr(application))
if (HaloApp.getInstance().isBrandNewInstall) {
logEvent("EVENT_ACTIVE")
SPUtils.setLong("TIME_OF_BRAND_NEW_INSTALL", System.currentTimeMillis() / 1000)
} else {
val shouldSendRetentionLogEvent =
SPUtils.getBoolean("SHOULD_SEND_RETENTION_EVENT", true)
val installTimeNotToday =
!TimeUtils.isToday(SPUtils.getLong("TIME_OF_BRAND_NEW_INSTALL", System.currentTimeMillis() / 1000))
if (shouldSendRetentionLogEvent && installTimeNotToday) {
logEvent("EVENT_NEXTDAY_STAY")
SPUtils.setBoolean("SHOULD_SEND_RETENTION_EVENT", false)
}
}
}
override fun getChannelStr(application: Application): String {
var channel = ChannelReaderUtil.getChannel(application)
if (channel == null || TextUtils.isEmpty(channel.trim())) {
channel = KUAISHOU_CHANNEL
}
return channel
}
override fun logEvent(content: String) {
KuaishouHelper.onEvent(content)
}
companion object {
private const val KUAISHOU_CHANNEL = "KS-GHZS-01"
}
}

Binary file not shown.

View File

@ -6,6 +6,11 @@
<queries>
<package android:name="com.gh.gamecenter" />
</queries>
<queries>
<package android:name="com.lg.vspace" />
</queries>
<!-- 允许应用程序访问网络连接 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 允许应用程序写入外部存储如SD卡上写文件 -->
@ -51,7 +56,27 @@
com.google.android.exoplayer2,
tv.danmaku.ijk.media.exo2,
pl.droidsonroids.gif,
com.lzf.easyfloat" />
com.lzf.easyfloat,
com.airbnb.lottie.compose,
androidx.compose.ui.platform,
androidx.compose.material.icons,
androidx.activity.compose,
androidx.compose.ui.tooling,
androidx.compose.ui.tooling.data,
androidx.compose.material.ripple,
androidx.compose.foundation,
androidx.compose.animation,
androidx.compose.foundation.layout,
androidx.compose.ui.text,
androidx.compose.ui.graphics,
androidx.compose.ui.unit,
androidx.compose.ui.util,
androidx.compose.ui.geometry,
androidx.compose.runtime.saveable,
androidx.compose.animation.core,
androidx.constraintlayout.compose,
androidx.compose.ui.test.manifest,
androidx.compose.ui.tooling.preview"/>
<!-- 去掉 SDK 一些流氓权限 -->
<uses-permission
@ -229,9 +254,6 @@
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.SuggestionActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.VoteActivity"
android:screenOrientation="portrait"
@ -415,10 +437,6 @@
android:name="com.gh.gamecenter.qa.editor.LocalMediaActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.mygame.PlayedGameActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.servers.GameServersActivity"
android:screenOrientation="portrait" />
@ -435,15 +453,6 @@
android:name="com.halo.assistant.fragment.user.UserPortraitCropImageActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.HelpAndFeedbackActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" />
<activity
android:name="com.gh.gamecenter.help.HelpDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.qa.comment.CommentActivity"
android:theme="@style/Theme.Transparent"
@ -467,10 +476,6 @@
android:name="com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.QaActivity"
android:screenOrientation="portrait" />
<activity
android:name=".qa.answer.draft.AnswerDraftActivity"
android:screenOrientation="portrait" />
@ -721,6 +726,10 @@
android:name=".discovery.interestedgame.InterestedGameActivity"
android:screenOrientation="portrait" />
<activity
android:name=".servers.gametest2.GameServerTestV2Activity"
android:screenOrientation="portrait" />
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->

Binary file not shown.

View File

@ -6,6 +6,7 @@ import android.app.Activity
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.TextUtils
import android.view.View
@ -25,9 +26,10 @@ 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.qa.entity.AnswerEntity
import com.gh.gamecenter.qa.entity.ArticleEntity
import com.gh.gamecenter.feature.entity.AnswerEntity
import com.gh.gamecenter.feature.entity.ArticleEntity
import com.gh.gamecenter.qa.entity.EditorInsertEntity
import com.gh.gamecenter.video.poster.PosterEditActivity
import com.gh.gamecenter.video.upload.UploadManager
@ -214,6 +216,8 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
mKeyboardHeightProvider = KeyboardHeightProvider(this)
mRichEditor.post { mKeyboardHeightProvider?.start() }
mRichEditor.enableForceDark(DarkModeUtils.isDarkModeOn(this))
mRichEditor.setEditorBackgroundColor(R.color.background_white.toColor(this))
mRichEditor.setEditorFontColor(if (mIsDarkModeOn) Color.parseColor("#C2C2C2") else Color.parseColor("#4A4A4A"))
// 防止个别手机在Js里无法获取粘贴内容
mRichEditor.addJavascriptInterface(OnPasteListener(), "onPasteListener")
mRichEditor.addJavascriptInterface(OnCursorChangeListener(), "OnCursorChangeListener")
@ -750,6 +754,8 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
mRichEditor.enableForceDark(DarkModeUtils.isDarkModeOn(this))
mRichEditor.setEditorBackgroundColor(R.color.background_white.toColor(this))
mRichEditor.setEditorFontColor(if (mIsDarkModeOn) Color.parseColor("#C2C2C2") else Color.parseColor("#4A4A4A"))
}
companion object {

View File

@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.ErrorEntity
import com.gh.gamecenter.common.entity.ErrorEntity
import com.gh.gamecenter.entity.LocalVideoEntity
import com.gh.gamecenter.entity.QuoteCountEntity
import com.gh.gamecenter.qa.BbsType

View File

@ -6,8 +6,8 @@ import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.util.FloatingBackViewManager
import com.gh.download.DownloadManager
import com.gh.gamecenter.SingletonWebActivity
import com.gh.gamecenter.SplashScreenActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
@ -30,7 +30,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_TASK
) {
FloatingBackViewManager.disableBackView()
} else if (activity is WebActivity
} else if (activity is SingletonWebActivity
&& FloatingBackViewManager.getType() == FloatingBackViewManager.TYPE_ACTIVITY
) {
FloatingBackViewManager.disableBackView()

View File

@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.launcher.ARouter
import com.gh.common.util.*
import com.gh.common.util.LogUtils
import com.gh.download.DownloadManager
@ -20,8 +21,10 @@ import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.NotificationUgc
import com.gh.gamecenter.common.loghub.LoghubUtils
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.view.dsbridge.CompletionHandler
@ -30,11 +33,9 @@ import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.MtaEvent
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.help.QaFeedbackDialogFragment
import com.gh.gamecenter.login.entity.Badge
import com.gh.gamecenter.feature.entity.Badge
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.login.user.LoginTag
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.login.user.UserRepository
@ -42,8 +43,7 @@ import com.gh.gamecenter.login.utils.LoginHelper
import com.gh.gamecenter.login.utils.QuickLoginHelper
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.setting.view.AboutActivity
import com.gh.gamecenter.setting.view.security.BindPhoneActivity
import com.gh.gamecenter.setting.SettingBridge
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.download.DataWatcher
@ -81,9 +81,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
@JavascriptInterface
fun logMtaEvent(event: Any) {
val mtaEvent = event.toString().toObject() ?: MtaEvent()
MtaHelper.onEvent(mtaEvent.name, mtaEvent.key, mtaEvent.value)
// do nothing, mta is deprecated
}
@JavascriptInterface
@ -186,13 +184,15 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
val packageName = msg.toString()
val context = HaloApp.getInstance().application
// 若畅玩列表中安装了,优先启动畅玩游戏
if (VHelper.isInstalled(packageName)) {
if (!VHelper.showDialogIfVSpaceIsNeeded(context)) {
VHelper.launch(context, packageName)
runOnUiThread {
// 若畅玩列表中安装了,优先启动畅玩游戏
if (VHelper.isInstalled(packageName)) {
if (!VHelper.showDialogIfVSpaceIsNeeded(context)) {
VHelper.launch(context, packageName)
}
} else {
PackageUtils.launchApplicationByPackageName(context, packageName)
}
} else {
PackageUtils.launchApplicationByPackageName(context, packageName)
}
}
@ -296,7 +296,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
@JavascriptInterface
fun bindPhone(msg: Any) {
val intent = BindPhoneActivity.getNormalIntent(context, false)
val intent = SettingBridge.getBindPhoneNormalIntent(context, false)
context.startActivity(intent)
}
@ -340,7 +340,9 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
@JavascriptInterface
fun showQaFeedbackDialog(msg: Any) {
QaFeedbackDialogFragment.show(context as AppCompatActivity, msg.toString())
val mHelpAndFeedbackHelp =
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback).navigation() as? IHelpAndFeedbackProvider
mHelpAndFeedbackHelp?.showQaFeedbackDialogFragment(context as AppCompatActivity, msg.toString())
}
@JavascriptInterface
@ -387,11 +389,6 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
FloatingBackViewManager.enableBackView(FloatingBackViewManager.TYPE_ACTIVITY, msg.toString())
}
@JavascriptInterface
fun startBBSStayTimeCount(msg: Any) {
BbsStayTimeHelper.enableStayTimeCount(msg.toString().toInt())
}
@JavascriptInterface
fun saveBase64ImageToGallery(msg: Any) {
val base64StringData = msg.toString()
@ -431,18 +428,9 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
runOnUiThread { DirectUtils.directToFullScreenWebPage(context, url.toString(), true, entrance) }
}
@JavascriptInterface
fun startGameCollectionSquareBrowseTask(event: Any) {
val browseTimeEvent = event.toString().toObject() ?: BrowseTaskEvent()
GameCollectionSquareBrowseTaskHelper.enableBrowseTimeCount(
browseTimeEvent.timeout.toInt(),
browseTimeEvent.isFinished == "true"
)
}
@JavascriptInterface
fun checkUpdateGhzs(msg: Any) {
context.startActivity(AboutActivity.getIntent(context, true))
context.startActivity(SettingBridge.getAboutIntent(context, true))
}
@JavascriptInterface
@ -524,12 +512,10 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
override fun onDataChanged(downloadEntity: DownloadEntity?) {
val url = VHelper.getOriginalUrl(downloadEntity?.url)
if (downloadEntity != null) {
if (mDownloadUrlSet?.contains(url) == true) {
mDownloadHandler?.setProgressData(
SimpleDownloadEntity.fromDownloadEntity(downloadEntity).toJson()
)
}
if (downloadEntity != null && mDownloadUrlSet?.contains(url) == true) {
mDownloadHandler?.setProgressData(
SimpleDownloadEntity.fromDownloadEntity(downloadEntity).toJson()
)
}
}
}
@ -616,20 +602,16 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {
super.onFragmentResumed(fm, f)
if (f === fragment) {
if (mDownloadWatcher != null) {
DownloadManager.getInstance().addObserver(mDownloadWatcher)
}
if (f === fragment && mDownloadWatcher != null) {
DownloadManager.getInstance().addObserver(mDownloadWatcher)
}
}
override fun onFragmentPaused(fm: FragmentManager, f: Fragment) {
super.onFragmentPaused(fm, f)
if (f === fragment) {
if (mDownloadWatcher != null) {
DownloadManager.getInstance().removeObserver(mDownloadWatcher)
}
if (f === fragment && mDownloadWatcher != null) {
DownloadManager.getInstance().removeObserver(mDownloadWatcher)
}
}
}, false
@ -637,16 +619,16 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
}
@Keep
internal data class ImageEvent(var imageList: ArrayList<String> = arrayListOf(), var position: Int = 0)
internal class ImageEvent(var imageList: ArrayList<String> = arrayListOf(), var position: Int = 0)
@Keep
internal data class ImageShareEvent(var image: String = "", var type: String = "")
internal class ImageShareEvent(var image: String = "", var type: String = "")
@Keep
internal data class TextShareEvent(var text: String = "", var type: String = "")
internal class TextShareEvent(var text: String = "", var type: String = "")
@Keep
internal data class InviteFriendsEvent(
internal class InviteFriendsEvent(
var type: String = "",
var way: String = "",
var url: String = "",
@ -654,13 +636,10 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
)
@Keep
internal data class LogEvent(var jsonString: String = "", var logStore: String = "")
internal class LogEvent(var jsonString: String = "", var logStore: String = "")
@Keep
internal data class BrowseTaskEvent(var timeout: String = "", var isFinished: String = "")
@Keep
data class GameActivityEvent(
class GameActivityEvent(
var gameId: String = "",
var activityTitle: String = "",
var activityId: String = "",
@ -668,7 +647,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "", private var
)
@Keep
data class SimpleDownloadEntity(
class SimpleDownloadEntity(
var url: String = "",
var progress: Float = 0F,
var status: String = "" // DOWNLOADING, PAUSED, DOWNLOADED, ERROR, UNKNOWN

View File

@ -21,6 +21,7 @@ import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.entity.SimpleGameEntity
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.EnvHelper
@ -28,6 +29,8 @@ import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBSkip
import com.gh.gamecenter.fragment.MainWrapperFragment
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.utils.PlatformUtils
import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity
import com.gh.gamecenter.qa.BbsType
import com.gh.gamecenter.qa.video.publish.VideoPublishActivity
@ -263,21 +266,6 @@ object DefaultUrlHandler {
EntranceConsts.HOST_COLUMN -> {
DirectUtils.directToSubject(context, id, uri.getQueryParameter(EntranceConsts.KEY_NAME), entrance)
}
EntranceConsts.HOST_COMMUNITY_QUESTION_LABEL_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val tag = uri.getQueryParameter("tag") ?: ""
DirectUtils.directAskColumnLabelDetail(context, tag, community, entrance, "")
}
EntranceConsts.HOST_COMMUNITY_COLUMN_DETAIL -> {
val community = CommunityEntity()
community.id = uri.getQueryParameter("community_id") ?: ""
community.name = uri.getQueryParameter("community_name") ?: ""
val columnId = uri.getQueryParameter("column_id") ?: ""
DirectUtils.directAskColumnDetail(context, columnId, community, entrance, "")
}
EntranceConsts.HOST_BLOCK -> {
val name = uri.getQueryParameter("name")
?: ""

View File

@ -21,7 +21,7 @@ object FixedRateJobHelper {
private const val TIME_PERIOD: Long = 600 * 1000L
private const val LOGHUB_PERIOD: Long = 120 * 1000L
private const val EXPOSURE_PERIOD: Long = 300 * 1000L
private const val REGION_SETTING_PERIOD: Long = 300 * 1000L
private const val REGION_SETTING_PERIOD: Long = 30 * 1000L
private const val VIDEO_RECORD_PERIOD: Long = 60 * 1000L
private const val DOWNLOAD_HEARTBEAT_PERIOD: Long = 60 * 1000L

View File

@ -3,7 +3,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.download.server.BrowserInstallHelper
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class BrowserInstallHandler : ChainHandler() {

View File

@ -2,7 +2,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.common.dialog.CertificationDialog
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class CertificationHandler : ChainHandler() {

View File

@ -1,7 +1,7 @@
package com.gh.common.chain
import android.content.Context
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
abstract class ChainHandler {
private var next: ChainHandler? = null

View File

@ -3,7 +3,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.common.utils.safelyGetInRelease
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class CheckDownloadHandler : ChainHandler() {

View File

@ -3,7 +3,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.gamecenter.common.utils.PermissionHelper
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class CheckStoragePermissionHandler : ChainHandler() {

View File

@ -4,7 +4,7 @@ import android.content.Context
import com.gh.common.util.DownloadDialogHelper
import com.gh.gamecenter.common.utils.safelyGetInRelease
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class DownloadDialogHelperHandler : ChainHandler() {

View File

@ -2,7 +2,7 @@ package com.gh.common.chain
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
class GamePermissionHandler : ChainHandler() {

View File

@ -2,7 +2,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class OverseaDownloadHandler : ChainHandler() {

View File

@ -3,7 +3,7 @@ package com.gh.common.chain
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.dialog.PackageCheckDialogFragment
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class PackageCheckHandler : ChainHandler() {

View File

@ -3,7 +3,7 @@ package com.gh.common.chain
import android.content.Context
import com.gh.common.simulator.NewSimulatorGameManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class UpdateNewSimulatorHandler: ChainHandler() {

View File

@ -1,7 +1,7 @@
package com.gh.common.chain
import android.content.Context
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.vspace.VHelper
class ValidateVSpaceHandler : ChainHandler() {

View File

@ -4,7 +4,7 @@ import android.content.Context
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
class VersionNumberHandler : ChainHandler() {

View File

@ -12,7 +12,7 @@ import com.gh.common.util.AdHelper;
import com.gh.common.util.PackageHelper;
import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.SuggestionActivity;
import com.gh.gamecenter.common.constant.CommonConsts;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.BiResponse;
@ -24,10 +24,10 @@ import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.GameGuidePopupEntity;
import com.gh.gamecenter.entity.NewApiSettingsEntity;
import com.gh.gamecenter.entity.NewSettingsEntity;
import com.gh.gamecenter.entity.NewsEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.SimulatorEntity;
import com.gh.gamecenter.entity.VSetting;
import com.gh.gamecenter.feature.entity.NewsEntity;
import com.gh.gamecenter.feature.entity.SettingsEntity;
import com.gh.gamecenter.feature.entity.SimulatorEntity;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.vspace.VHelper;
import com.halo.assistant.HaloApp;
@ -354,7 +354,7 @@ public class Config {
// 意见反馈
SharedPreferences.Editor edit = getPreferences().edit();
edit.putString(SuggestionActivity.SUGGESTION_HINT_TYPE,
edit.putString(CommonConsts.SUGGESTION_HINT_TYPE,
GsonUtils.toJson(response.getSuggestion()));
edit.apply();

View File

@ -21,7 +21,7 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.KaifuAddItemBinding
import com.gh.gamecenter.databinding.LayoutAddKaifuPopupBinding
import com.gh.gamecenter.databinding.LayoutPopupContainerBinding
import com.gh.gamecenter.entity.ServerCalendarEntity
import com.gh.gamecenter.feature.entity.ServerCalendarEntity
import com.gh.gamecenter.servers.add.AddKaiFuPopupAdapter
import java.text.SimpleDateFormat
import java.util.*

View File

@ -31,7 +31,7 @@ import com.gh.common.chain.PackageCheckHandler;
import com.gh.common.chain.ValidateVSpaceHandler;
import com.gh.common.chain.VersionNumberHandler;
import com.gh.common.constant.Config;
import com.gh.common.exposure.ExposureEvent;
import com.gh.gamecenter.feature.exposure.ExposureEvent;
import com.gh.common.filter.RegionSetting;
import com.gh.common.filter.RegionSettingHelper;
import com.gh.common.history.HistoryHelper;
@ -46,11 +46,11 @@ import com.gh.common.util.LogUtils;
import com.gh.common.util.NewsUtils;
import com.gh.common.util.PackageInstaller;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.gamecenter.feature.utils.PlatformUtils;
import com.gh.common.util.ReservationHelper;
import com.gh.common.view.DownloadButton;
import com.gh.common.view.GameIconView;
import com.gh.common.view.NoEllipsizeSpaceTextView;
import com.gh.gamecenter.feature.view.DownloadButton;
import com.gh.gamecenter.feature.view.GameIconView;
import com.gh.gamecenter.common.view.NoEllipsizeSpaceTextView;
import com.gh.download.DownloadManager;
import com.gh.download.dialog.DownloadDialog;
import com.gh.gamecenter.DownloadManagerActivity;
@ -66,17 +66,17 @@ import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.NumberUtils;
import com.gh.gamecenter.databinding.KaifuDetailItemRowBinding;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.entity.ServerCalendarEntity;
import com.gh.gamecenter.entity.TagStyleEntity;
import com.gh.gamecenter.entity.TestEntity;
import com.gh.gamecenter.feature.entity.PluginLocation;
import com.gh.gamecenter.feature.entity.ServerCalendarEntity;
import com.gh.gamecenter.feature.entity.TagStyleEntity;
import com.gh.gamecenter.feature.entity.TestEntity;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.gamecenter.qa.entity.CommunityVideoEntity;
import com.gh.gamecenter.feature.entity.CommunityVideoEntity;
import com.gh.vspace.VDownloadManagerActivity;
import com.gh.vspace.VHelper;
import com.lightgame.download.DownloadEntity;
@ -262,7 +262,7 @@ public class BindingAdapters {
public static void setGameIcon(View view, GameEntity gameEntity) {
if (gameEntity != null && view instanceof GameIconView) {
((GameIconView) view).displayGameIcon(gameEntity.getIcon(), gameEntity.getIconSubscript());
((GameIconView) view).displayGameIcon(gameEntity.getIcon(), gameEntity.getIconSubscript(), gameEntity.getIconFloat());
}
}
@ -787,12 +787,21 @@ public class BindingAdapters {
public static void setGameName(NoEllipsizeSpaceTextView view, GameEntity game, boolean isShowPlatform, @Nullable Boolean isShowSuffix) {
if (isShowSuffix == null) isShowSuffix = true; // 默认显示
String gameName;
if (isShowPlatform && game.getApk().size() > 0) {
view.setText(String.format("%s - %s", !isShowSuffix ? game.getNameWithoutSuffix() : game.getName(),
gameName = String.format("%s - %s", !isShowSuffix ? game.getNameWithoutSuffix() : game.getName(),
PlatformUtils.getInstance(view.getContext()).getPlatformName(
game.getApk().get(0).getPlatform())));
game.getApk().get(0).getPlatform()));
if (!gameName.equals((String) view.getTag(R.string.tag_game_name_id))) {
view.setText(gameName);
view.setTag(R.string.tag_game_name_id, gameName);
}
} else {
view.setText(!isShowSuffix ? game.getNameWithoutSuffix() : game.getName());
gameName = !isShowSuffix ? game.getNameWithoutSuffix() : game.getName();
if (gameName != null && !gameName.equals((String) view.getTag(R.string.tag_game_name_id))) {
view.setText(gameName);
view.setTag(R.string.tag_game_name_id, gameName);
}
}
}

View File

@ -24,9 +24,9 @@ import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.entity.AuthDialogEntity
import com.gh.gamecenter.entity.AuthDialogLevel
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.AuthDialogEntity
import com.gh.gamecenter.feature.entity.AuthDialogLevel
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.login.user.UserManager
import com.google.gson.reflect.TypeToken
import com.halo.assistant.fragment.user.UserInfoEditFragment

View File

@ -18,18 +18,17 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.common.constant.Constants
import com.gh.download.DownloadManager
import com.gh.gamecenter.R
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.countDownTimer
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.databinding.DialogDeviceRemindBinding
import com.gh.gamecenter.entity.DeviceDialogEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment
import com.gh.gamecenter.feature.entity.GameEntity
import com.google.gson.reflect.TypeToken
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
@ -53,7 +52,7 @@ class DeviceRemindDialog(context: Context, val entity: DeviceDialogEntity, val g
private val dataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
if (downloadEntity.status == DownloadStatus.done && downloadEntity.name == gameEntity.name) {
val autoInstall = SPUtils.getBoolean(GameDownloadSettingFragment.AUTO_INSTALL_SP_KEY, true)
val autoInstall = SPUtils.getBoolean(Constants.SP_AUTO_INSTALL, true)
if (autoInstall) {
dismiss()
}

View File

@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.DialogGameOffServiceBinding
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
// 游戏关闭下载弹窗
class GameOffServiceDialogFragment : BaseDialogFragment() {

View File

@ -31,9 +31,9 @@ import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.SpanBuilder
import com.gh.gamecenter.databinding.FragmentPackageCheckBinding
import com.gh.gamecenter.databinding.PackageCheckItemBinding
import com.gh.gamecenter.entity.DetectionObjectEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.PackageDialogEntity
import com.gh.gamecenter.feature.entity.DetectionObjectEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.PackageDialogEntity
import com.gh.gamecenter.eventbus.EBPackage
import com.halo.assistant.HaloApp
import com.lightgame.adapter.BaseRecyclerAdapter

View File

@ -15,7 +15,7 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.common.view.FixLinearLayoutManager
import com.gh.gamecenter.databinding.DialogReserveBinding
import com.gh.gamecenter.databinding.DialogReserveItemBinding
import com.gh.gamecenter.entity.SimpleGameEntity
import com.gh.gamecenter.common.entity.SimpleGameEntity
import com.gh.gamecenter.mygame.MyGameActivity
import com.lightgame.adapter.BaseRecyclerAdapter

View File

@ -4,6 +4,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.feature.exposure.ExposureEvent
import io.reactivex.functions.Consumer
/**

View File

@ -5,6 +5,7 @@ import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.common.loghub.LoghubHelper
import com.gh.gamecenter.common.utils.FixedSizeLinkedHashSet
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.lightgame.utils.Utils
/**

View File

@ -1,5 +1,7 @@
package com.gh.common.exposure
import com.gh.gamecenter.feature.exposure.ExposureEvent
object ExposureTraceUtils {
fun appendTrace(event: ExposureEvent?): List<ExposureEvent> {

View File

@ -5,8 +5,10 @@ import com.g00fy2.versioncompare.Version
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.common.utils.FixedSizeLinkedHashSet
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.ApkEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.exposure.ExposureType
import com.gh.gamecenter.manager.PackagesManager
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
@ -22,7 +24,7 @@ object ExposureUtils {
traceEvent: ExposureEvent?,
downloadType: DownloadType
): ExposureEvent {
val gameEntity = entity.clone()
val gameEntity = entity.copy()
gameEntity.id = if (entity.id.contains(DownloadEntity.GAME_ID_DIVIDER)) {
entity.id.split(DownloadEntity.GAME_ID_DIVIDER).toTypedArray()[0]
} else {
@ -49,11 +51,12 @@ object ExposureUtils {
entity: GameEntity,
platform: String?,
trace: String?,
speed: Long,
host: String? = "unknown",
path: String? = "unknown",
downloadType: DownloadType
) {
val gameEntity = entity.clone()
val gameEntity = entity.copy()
gameEntity.platform = platform
gameEntity.downloadCompleteType = downloadType.toString()
val traceEvent = trace?.toObject<ExposureEvent>()
@ -75,6 +78,8 @@ object ExposureUtils {
)
exposureEvent.payload.host = host
exposureEvent.payload.path = path
exposureEvent.payload.speed = speed
ExposureManager.log(exposureEvent)
ExposureManager.commitSavedExposureEvents(forcedUpload = true)
}

View File

@ -1,5 +1,7 @@
package com.gh.common.exposure
import com.gh.gamecenter.feature.exposure.ExposureEvent
/**
* 统计曝光的列表的 adapter 需要实现这个接口
*/

View File

@ -1,15 +0,0 @@
package com.gh.common.exposure.time
import com.gh.common.FixedRateJobHelper
object TimeUtil {
fun currentTimeMillis(): Long {
return FixedRateJobHelper.timeDeltaBetweenServerAndClient + System.currentTimeMillis()
}
fun currentTime(): Int {
return ((FixedRateJobHelper.timeDeltaBetweenServerAndClient + System.currentTimeMillis()) / 1000).toInt()
}
}

View File

@ -1,10 +1,11 @@
package com.gh.common.filter
import androidx.annotation.Keep
import com.gh.gamecenter.feature.entity.IpInfo
import com.google.gson.annotations.SerializedName
@Keep
data class RegionSetting(
class RegionSetting(
@SerializedName("game_mirror")
var mirrorGameIdSet: HashSet<String>,
@SerializedName("game_block")
@ -14,11 +15,13 @@ data class RegionSetting(
@SerializedName("game_h5_download")
var gameH5DownloadList: List<GameH5Download>,
@SerializedName("game_special_download")
var gameSpecialDownloadInfoList: List<GameSpecialDownloadInfo>
var gameSpecialDownloadInfoList: List<GameSpecialDownloadInfo>,
@SerializedName("ip_info")
var ipInfo: IpInfo? = null
) {
@Keep
data class ChannelControl(
class ChannelControl(
@SerializedName("game_category")
var gameCategory: String,
@SerializedName("effect")
@ -26,7 +29,7 @@ data class RegionSetting(
)
@Keep
data class GameH5Download(
class GameH5Download(
@SerializedName("game_id")
var gameId: String,// 游戏id
@SerializedName("h5_link")
@ -37,7 +40,7 @@ data class RegionSetting(
var buttonText: String,// 按钮文案
)
data class GameSpecialDownloadInfo(
class GameSpecialDownloadInfo(
@SerializedName("game_id")
var gameId: String = "",
@SerializedName("bbs_id")

View File

@ -1,14 +1,16 @@
package com.gh.common.filter
import android.annotation.SuppressLint
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.debounceActionWithInterval
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.IpInfo
import com.gh.gamecenter.feature.entity.SimpleGame
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.functions.Function
@ -21,8 +23,10 @@ object RegionSettingHelper {
private var mDisplayMirrorIfoGameIdSet: HashSet<String>? = hashSetOf()
private var mGameH5DownloadList: List<RegionSetting.GameH5Download>? = listOf()
private var mGameSpecialDownloadInfoList: List<RegionSetting.GameSpecialDownloadInfo>? = listOf()
private var mIpInfo: IpInfo? = null
private const val SP_SETTING = "region_setting"
const val SP_SETTING_FAILURE = "region_setting_failure"
fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return mDisplayMirrorIfoGameIdSet?.contains(gameId) ?: false
@ -39,6 +43,8 @@ object RegionSettingHelper {
@JvmStatic
fun getGameSpecialDownloadInfo(gameId: String) = mGameSpecialDownloadInfoList?.find { it.gameId == gameId }
fun getIpInfo(): IpInfo? = mIpInfo
@JvmStatic
fun filterGame(list: List<GameEntity>?): ArrayList<GameEntity> {
if (list == null) return arrayListOf()
@ -52,6 +58,19 @@ object RegionSettingHelper {
return listCopy
}
@JvmStatic
fun filterSimpleGame(list: List<SimpleGame>?): ArrayList<SimpleGame> {
if (list == null) return arrayListOf()
if (mFilterGameIdSet?.isEmpty() == true) {
if (list is ArrayList) return list
}
val listCopy: ArrayList<SimpleGame> = if (list is ArrayList) list else ArrayList(list)
listCopy.removeAll { mFilterGameIdSet?.contains(it.id) ?: false }
return listCopy
}
@JvmField
var filterGame = Function { list: List<GameEntity> ->
filterGame(list)
@ -88,9 +107,10 @@ object RegionSettingHelper {
}
override fun onFailure(exception: Exception) {
SPUtils.getString(SP_SETTING)?.toObject<RegionSetting>()?.let {
SPUtils.getString(SP_SETTING).toObject<RegionSetting>()?.let {
updateSettingsInMemory(it)
}
SPUtils.setBoolean(SP_SETTING_FAILURE, true)
}
})
}
@ -102,6 +122,7 @@ object RegionSettingHelper {
mChannelControl = data.channelControl
mGameH5DownloadList = data.gameH5DownloadList
mGameSpecialDownloadInfoList = data.gameSpecialDownloadInfoList
mIpInfo = data.ipInfo
}
/**

View File

@ -9,16 +9,17 @@ import androidx.sqlite.db.SupportSQLiteDatabase
import com.gh.gamecenter.entity.GamesCollectionEntity
import com.gh.gamecenter.entity.HistoryGameEntity
import com.gh.gamecenter.entity.MyVideoEntity
import com.gh.gamecenter.entity.NewsEntity
import com.gh.gamecenter.qa.entity.AnswerEntity
import com.gh.gamecenter.qa.entity.ArticleEntity
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.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 = 12,
version = 13,
exportSchema = false
)
@TypeConverters(
@ -39,7 +40,8 @@ import com.halo.assistant.HaloApp
MeConverter::class,
SimpleGameListConverter::class,
TagInfoListConverter::class,
ActivityLabelListConverter::class
ActivityLabelListConverter::class,
IconFloatConverter::class
)
abstract class HistoryDatabase : RoomDatabase() {
@ -135,6 +137,12 @@ abstract class HistoryDatabase : RoomDatabase() {
}
}
val MIGRATION_12_13: Migration = object : Migration(12, 13) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("Alter TABLE HistoryGameEntity add iconFloat TEXT")
}
}
val instance by lazy {
Room.databaseBuilder(
HaloApp.getInstance().application,
@ -151,6 +159,7 @@ abstract class HistoryDatabase : RoomDatabase() {
.addMigrations(MIGRATION_9_10)
.addMigrations(MIGRATION_10_11)
.addMigrations(MIGRATION_11_12)
.addMigrations(MIGRATION_12_13)
.build()
}
}

View File

@ -6,10 +6,12 @@ import com.gh.gamecenter.common.utils.removeVideoContent
import com.gh.gamecenter.common.utils.tryCatchInRelease
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.entity.*
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.entity.NewsEntity
import com.gh.gamecenter.qa.entity.AnswerDetailEntity
import com.gh.gamecenter.qa.entity.AnswerEntity
import com.gh.gamecenter.qa.entity.ArticleDetailEntity
import com.gh.gamecenter.qa.entity.ArticleEntity
object HistoryHelper {
@ -54,6 +56,7 @@ object HistoryHelper {
historyGame.des = ""
historyGame.icon = updateEntity.rawIcon ?: updateEntity.icon
historyGame.iconSubscript = updateEntity.iconSubscript
historyGame.iconFloat = updateEntity.iconFloat
historyGame.name = updateEntity.name
historyGame.tagStyle = updateEntity.tagStyle
return historyGame
@ -68,6 +71,7 @@ object HistoryHelper {
historyGame.des = gameEntity.des
historyGame.icon = gameEntity.rawIcon ?: gameEntity.icon
historyGame.iconSubscript = gameEntity.iconSubscript
historyGame.iconFloat = gameEntity.iconFloat
historyGame.name = gameEntity.name
historyGame.tagStyle = gameEntity.tagStyle
historyGame.tag = gameEntity.getTag()

View File

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

View File

@ -58,6 +58,14 @@ class AppProviderImpl : IAppProvider {
return HaloApp.isUserAcceptPrivacyPolicy(context)
}
override fun put(key: String, any: Any) {
HaloApp.put(key, any)
}
override fun get(key: String, isRemove: Boolean): Any? {
return HaloApp.get(key, isRemove)
}
override fun getFlavorProvider(): IFlavorProvider {
return HaloApp.getInstance().flavorProvider
}

View File

@ -0,0 +1,30 @@
package com.gh.common.provider
import android.content.Context
import android.widget.LinearLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.view.NoEllipsizeSpaceTextView
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
@Route(path = RouteConsts.provider.bindingAdapters, name = "BindingAdapters暴露服务")
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGameName(
view: NoEllipsizeSpaceTextView,
game: GameEntity,
isShowPlatform: Boolean,
isShowSuffix: Boolean
) {
BindingAdapters.setGameName(view, game, isShowPlatform, isShowSuffix)
}
override fun setGameTags(layout: LinearLayout, gameEntity: GameEntity) {
BindingAdapters.setGameTags(layout, gameEntity)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -60,6 +60,14 @@ class ConfigProviderImpl : IConfigProvider {
return Config.getSettings()?.support?.qq ?: ""
}
override fun getQQun(): String {
return Config.getSettings()?.support?.qQun ?: ""
}
override fun getQQunKey(): String {
return Config.getSettings()?.support?.qQunKey ?: ""
}
override fun getQuickLoginAppId(): String {
return Config.QUICK_LOGIN_APPID
}
@ -76,6 +84,10 @@ class ConfigProviderImpl : IConfigProvider {
return Config.getNightModeSetting()?.setting ?: false
}
override fun isShowPlugin(gameId: String): Boolean {
return Config.isShowPlugin(gameId)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -25,23 +25,6 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
override fun showWaitDialog(context: Context, string: String): Dialog = DialogUtils.showWaitDialog(context, string)
override fun showForceDialog(
context: Context,
title: String,
message: CharSequence,
positive: String,
negative: String,
confirm: () -> Unit,
cancel: () -> Unit
) {
DialogUtils.showForceDialog(context, title, message, positive, negative,
{ confirm.invoke() }, object :CancelListener{
override fun onCancel() {
cancel.invoke()
}
})
}
override fun showUsageStatsDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
DialogUtils.showUsageStatsDialog(context,
{ confirm.invoke() }, object :CancelListener{

View File

@ -57,6 +57,18 @@ class DirectProviderImpl : IDirectProvider {
DirectUtils.directToSuggestion(context, diagnosis = diagnosis)
}
override fun directToQa(context: Context, text: String?, id: String) {
DirectUtils.directToQa(context, text, id)
}
override fun directToHelpAndFeedback(context: Context, position: Int) {
DirectUtils.directToHelpAndFeedback(context, position)
}
override fun directToQqGroup(context: Context, groupNumber: String?): Boolean {
return DirectUtils.directToQqGroup(context, groupNumber)
}
override fun init(context: Context?) {
// Do nothing
}

View File

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

View File

@ -0,0 +1,46 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IGameDetailProvider
@Route(path = RouteConsts.provider.gameDetail, name = "GameDetailActivity暴露服务")
class GameDetailProviderImpl : IGameDetailProvider {
override fun startGameDetailActivity(
context: Context,
gameId: String,
entrance: String?,
traceEvent: ExposureEvent?
) {
GameDetailActivity.startGameDetailActivity(context, gameId, entrance, traceEvent)
}
override fun startGameDetailActivity(
context: Context,
gameEntity: GameEntity?,
entrance: String,
defaultTab: Int,
isSkipGameComment: Boolean,
scrollToLibao: Boolean,
scrollToServer: Boolean,
traceEvent: ExposureEvent?
) {
GameDetailActivity.startGameDetailActivity(
context,
gameEntity,
entrance,
defaultTab,
isSkipGameComment,
scrollToLibao,
scrollToServer,
traceEvent
)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -3,13 +3,13 @@ package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.util.ApkActiveUtils
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.countOccurrences
import com.gh.gamecenter.core.provider.IHandleGameResponseProvider
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
@Route(path = RouteConsts.provider.handleGameResponse, name = "处理游戏类型返回")
class HandleGameResponseProviderImpl : IHandleGameResponseProvider {

View File

@ -5,6 +5,8 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.common.constant.RouteConsts
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.provider.ILinkDirectUtilsProvider
@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务主要是暴露directToLinkPage方法")
@ -19,6 +21,35 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
DirectUtils.directToLinkPage(context, linkEntity, entrance, path)
}
override fun directToSuggestion(context: Context, type: SuggestType, requestCode: Int?) {
DirectUtils.directToSuggestion(context, type, requestCode)
}
override fun directToSuggestion(
context: Context,
type: SuggestType,
suggestHintType: String?,
content: String?,
isQaFeedback: Boolean,
qaContentId: String
) {
DirectUtils.directToSuggestion(context, type, suggestHintType, content, isQaFeedback, qaContentId)
}
override fun directToSuggestion(
context: Context,
type: SuggestType,
suggestHintType: String?,
content: String?,
game: SimpleGameEntity,
platform: String
) {
DirectUtils.directToSuggestion(context, type, suggestHintType, content, game, platform)
}
override fun directToSuggestion(context: Context, type: SuggestType, hiddenHint: String) {
DirectUtils.directToSuggestion(context, type, hiddenHint)
}
override fun init(context: Context?) {
// Do nothing

View File

@ -1,10 +1,8 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMainProvider

View File

@ -0,0 +1,18 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPackagesManagerProvider
import com.gh.gamecenter.manager.PackagesManager
@Route(path = RouteConsts.provider.packagesManager, name = "PackagesManager暴露服务")
class PackagesManagerProviderImpl: IPackagesManagerProvider {
override fun isCanPluggable(gameId: String?, packageName: String?): Boolean {
return PackagesManager.isCanPluggable(gameId, packageName)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,32 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.IpInfo
import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
@Route(path = RouteConsts.provider.regionSettingHelper, name = "RegionSettingHelper暴露服务")
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
}
override fun shouldThisGameShowSpecialDownload(gameId: String): Boolean {
return RegionSettingHelper.shouldThisGameShowSpecialDownload(gameId)
}
override fun filterGame(list: List<GameEntity>): ArrayList<GameEntity> {
return RegionSettingHelper.filterGame(list)
}
override fun getIpInfo(): IpInfo? {
return RegionSettingHelper.getIpInfo()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -2,7 +2,7 @@ package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.exposure.time.TimeUtil
import com.gh.gamecenter.feature.exposure.time.TimeUtil
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ITimeUtilProvider

View File

@ -5,7 +5,6 @@ import android.os.Build
import androidx.annotation.RequiresApi
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.UsageStatsHelper
import com.gh.common.util.WechatBindHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider

View File

@ -0,0 +1,26 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IVHelperProvider
import com.gh.vspace.VHelper
@Route(path = RouteConsts.provider.vhelper, name = "VHelper暴露服务")
class VHelperProviderImpl: IVHelperProvider {
override fun getPlatformV(): String {
return VHelper.PLATFORM_V
}
override fun getVUrl(originUrl: String?): String {
return VHelper.getVUrl(originUrl)
}
override fun isVGameOn(): Boolean {
return VHelper.isVGameOn()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -25,6 +25,16 @@ class WebProviderImpl : IWebProvider {
return WebActivity.getSecurityCertificationIntent(context)
}
override fun getQAIntent(
context: Context?,
url: String?,
title: String?,
isWebPageHandleBackPressed: Boolean,
qaType: Int
): Intent {
return WebActivity.getQAIntent(context, url, title, isWebPageHandleBackPressed, qaType)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -1,57 +0,0 @@
package com.gh.common.repository
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.util.ApkActiveUtils
import com.gh.gamecenter.core.utils.RandomUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.Observable
// 热门卡牌的仓库
object RemenkapaiRepository {
var remenkapaiList = arrayListOf<GameEntity>()
@JvmStatic
fun getRemenkapai(size: Int): Observable<List<GameEntity>> {
return if (remenkapaiList.isEmpty()) {
RetrofitManager.getInstance().api.remenkapai
.map(RegionSettingHelper.filterGame)
.map { gameList -> filterEntityWithoutApk(gameList) }
.map { pickRandomSizeEntity(size) }
.map(ApkActiveUtils.filterMapperList)
} else {
Observable.create { emitter -> emitter.onNext(pickRandomSizeEntity(size)) }
}
}
/**
* 选择随机数量的热门卡牌
*/
private fun pickRandomSizeEntity(size: Int): List<GameEntity> {
if (size > remenkapaiList.size) return remenkapaiList
val randomGameList = arrayListOf<GameEntity>()
val randomArray = RandomUtils.getRandomArray(size, remenkapaiList.size)
for (i in randomArray) {
randomGameList.add(remenkapaiList[i])
}
return randomGameList
}
/**
* 过滤没有 Apk 的实体
*/
private fun filterEntityWithoutApk(gameList: List<GameEntity>): List<GameEntity> {
val realGameList = arrayListOf<GameEntity>()
for (gameEntity in gameList) {
val apk = gameEntity.getApk()
if (apk.size != 0) {
realGameList.add(gameEntity)
}
}
remenkapaiList = realGameList
return remenkapaiList
}
}

View File

@ -7,12 +7,9 @@ import android.content.Intent
import android.graphics.Bitmap
import android.view.Gravity
import androidx.core.content.FileProvider
import com.g00fy2.versioncompare.Version
import com.gh.common.constant.Config
import com.gh.common.util.DownloadItemUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.*
@ -20,7 +17,7 @@ import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.AppManager

View File

@ -8,7 +8,6 @@ import android.widget.ProgressBar
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import com.g00fy2.versioncompare.Version
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.PackageInstaller
@ -20,8 +19,8 @@ import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor.uiExecutor
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.SimulatorEntity
import com.gh.gamecenter.feature.entity.ApkEntity
import com.gh.gamecenter.feature.entity.SimulatorEntity
import com.gh.gamecenter.entity.TrackableEntity
import com.halo.assistant.HaloApp
import com.lightgame.download.*

View File

@ -8,7 +8,7 @@ import android.graphics.Bitmap
import android.net.Uri
import android.text.TextUtils
import com.gh.common.constant.Config
import com.gh.common.util.ApkActiveUtils
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.PackageUtils
import com.gh.download.DownloadManager
@ -22,8 +22,8 @@ import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.core.utils.UrlFilterUtils
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.SimulatorGameRecordEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.SimulatorGameRecordEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.room.AppDatabase

View File

@ -4,25 +4,17 @@ import android.net.Uri
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.EnvHelper
import com.gh.gamecenter.common.utils.tryWithDefaultCatch
import com.gh.gamecenter.core.GHThreadFactory
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
/**
* 活动相关数据统计辅助类
*/
object ActivityCountHelper {
private val ACTIVITY_URL_COMMON_PREF =
if (EnvHelper.isDevEnv) Constants.ACTIVITY_DETAIL_ADDRESS_DEV else Constants.ACTIVITY_DETAIL_ADDRESS
private var mStayTimeCount = 0
private var mIsStayTimeCountEnabled = false
private var mStayTimeArray = arrayOf(5, 10, 20, 40, 80, 160)
private const val MAX_STAY_TIME = 320
private val mThreadService: ExecutorService by lazy {
Executors.newSingleThreadExecutor(GHThreadFactory("STAY_TIME_THREAD"))
private val ACTIVITY_URL_COMMON_PREF by lazy {
if (EnvHelper.isDevEnv) Constants.ACTIVITY_DETAIL_ADDRESS_DEV else Constants.ACTIVITY_DETAIL_ADDRESS
}
private var mStayTimeArray = arrayOf(5, 10, 20, 40, 80, 160)
@JvmStatic
fun postActivityPageEnter(url: String?, entrance: String) {
@ -45,34 +37,20 @@ object ActivityCountHelper {
}
}
fun startCountStayTime(url: String) {
fun handleStayTime(url: String, stayTime: Int) {
if (url.contains(ACTIVITY_URL_COMMON_PREF)) {
val uri = Uri.parse(url)
val activityId = uri.getQueryParameter("id") ?: return
mIsStayTimeCountEnabled = true
mThreadService.execute {
while (mIsStayTimeCountEnabled) {
tryWithDefaultCatch {
mStayTimeCount++
when {
mStayTimeCount % MAX_STAY_TIME == 0 -> NewFlatLogUtils.logActivityPageView(
MAX_STAY_TIME,
activityId
)
mStayTimeArray.contains(mStayTimeCount) -> NewFlatLogUtils.logActivityPageView(
mStayTimeCount,
activityId
)
}
}
Thread.sleep(1000)
}
when {
stayTime % MAX_STAY_TIME == 0 -> NewFlatLogUtils.logActivityPageView(
MAX_STAY_TIME,
activityId
)
mStayTimeArray.contains(stayTime) -> NewFlatLogUtils.logActivityPageView(
stayTime,
activityId
)
}
}
}
fun endCountStayTime() {
mIsStayTimeCountEnabled = false
mStayTimeCount = 0
}
}

View File

@ -6,8 +6,8 @@ import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.observableToMain
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.NewApiSettingsEntity
import com.gh.gamecenter.entity.SettingsEntity
import com.gh.gamecenter.entity.StartupAdEntity
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp

View File

@ -14,6 +14,7 @@ import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.roundTo
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.databinding.DialogArchiveLoadingBinding
@ -133,10 +134,12 @@ object ArchiveDownloadButtonHelper {
.subscribe()
VArchiveHelper.applyGameArchive(context, packageName, this) { packageName, isSuccess ->
if (isSuccess) {
VHelper.launch(context, packageName)
} else {
ToastUtils.toast(R.string.archive_apply_fail.toResString())
runOnUiThread {
if (isSuccess) {
VHelper.launch(context, packageName)
} else {
ToastUtils.toast(R.string.archive_apply_fail.toResString())
}
}
}
}

View File

@ -9,19 +9,19 @@ import android.view.View
import android.view.Window
import androidx.core.widget.doOnTextChanged
import androidx.recyclerview.widget.LinearLayoutManager
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.view.VerticalItemDecoration
import com.gh.gamecenter.R
import com.gh.gamecenter.SuggestionActivity
import com.gh.gamecenter.adapter.ReportReasonAdapter
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.common.constant.CommonConsts
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.common.view.VerticalItemDecoration
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.databinding.DialogReportReasonBinding
import com.gh.gamecenter.entity.SettingsEntity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.android.schedulers.AndroidSchedulers
@ -35,7 +35,7 @@ object BbsReportHelper {
fun showReportDialog(contentId: String) {
val sp = PreferenceManager.getDefaultSharedPreferences(HaloApp.getInstance())
val suggestion: SettingsEntity.Suggestion? =
sp.getString(SuggestionActivity.SUGGESTION_HINT_TYPE, null)?.toObject()
sp.getString(CommonConsts.SUGGESTION_HINT_TYPE, null)?.toObject()
val reportList = suggestion?.report ?: return
CurrentActivityHolder.getCurrentActivity()?.apply {

View File

@ -1,131 +0,0 @@
package com.gh.common.util
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Application
import android.os.Bundle
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.GHThreadFactory
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.common.utils.isPublishEnv
import com.gh.gamecenter.common.utils.tryWithDefaultCatch
import com.gh.gamecenter.forum.detail.ForumDetailActivity
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
import com.gh.gamecenter.qa.comment.CommentActivity
import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
object BbsStayTimeHelper {
private var mStayTimeCount = 0
private var mIsStayTimeCountEnabled = false // 论坛停留时间统计是否开启
private var mStayTimeTimeout = 30
private var mIsStayTimeCountValid = false // 论坛停留时间统计是否有效
const val IS_BBS_CONTENT_VISIBLE = "is_bbs_content_visible"
private val mThreadService: ExecutorService by lazy {
Executors.newSingleThreadExecutor(GHThreadFactory("STAY_TIME_THREAD"))
}
private val mActivityLifecycleCallbacks by lazy {
object : Application.ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {
if (isTopActivityBbsRelated(activity) && mIsStayTimeCountEnabled) {
resumeTimeCount()
}
}
override fun onActivityPaused(activity: Activity) {
if (isTopActivityBbsRelated(activity) && mIsStayTimeCountEnabled) {
pauseTimeCount()
}
}
}
}
fun enableStayTimeCount(timeout: Int) {
mIsStayTimeCountEnabled = true
mStayTimeTimeout = timeout
resumeTimeCount()
HaloApp.getInstance().registerActivityLifecycleCallbacks(mActivityLifecycleCallbacks)
}
fun disableStayTimeCount() {
mIsStayTimeCountEnabled = false
mStayTimeCount = 0
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(mActivityLifecycleCallbacks)
}
fun resumeTimeCount() {
if (!mIsStayTimeCountEnabled) return
mIsStayTimeCountValid = true
mThreadService.execute {
while (mIsStayTimeCountEnabled && mIsStayTimeCountValid) {
val topActivity = CurrentActivityHolder.getCurrentActivity() ?: continue
if (isTopActivityBbsRelated(topActivity)) {
tryWithDefaultCatch {
mStayTimeCount++
if (mStayTimeCount >= mStayTimeTimeout) {
postExploreFinish()
}
}
}
Thread.sleep(1000)
}
}
}
fun pauseTimeCount() {
if (!mIsStayTimeCountEnabled) return
mIsStayTimeCountValid = false
}
private fun isTopActivityBbsRelated(activity: Activity): Boolean {
return (activity is MainActivity && activity.intent.extras?.getBoolean(IS_BBS_CONTENT_VISIBLE) == true)
|| activity is ForumDetailActivity
|| activity is ArticleDetailActivity
|| activity is ForumVideoDetailActivity
|| activity is CommentActivity
|| activity is NewQuestionDetailActivity
}
@SuppressLint("CheckResult")
private fun postExploreFinish() {
RetrofitManager.getInstance()
.api
.postExplorerFinish()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
if (!isPublishEnv()) {
ToastUtils.toast("完成了论坛停留任务(仅测试环境有这个 toast 不要慌)")
}
disableStayTimeCount()
}
})
}
}

View File

@ -1,11 +1,9 @@
package com.gh.common.util
import android.content.Context
import com.gh.gamecenter.eventbus.EBCollectionChanged
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
@ -19,18 +17,16 @@ import retrofit2.HttpException
object CollectionUtils {
enum class CollectionType {
toolkit, article, answer, communityArticle
TOOLKIT, ARTICLE, ANSWER, COMMUNITY_ARTICLE
}
fun postCollection(context: Context, content: String, type: CollectionType, listener: OnCollectionListener) {
fun postCollection(content: String, type: CollectionType, listener: OnCollectionListener) {
val api = RetrofitManager.getInstance().api
val postCollection = when (type) {
CollectionType.article -> RetrofitManager.getInstance().getApi()
.postCollectionArticle(UserManager.getInstance().userId, content)
CollectionType.toolkit -> RetrofitManager.getInstance().getApi()
.postCollectionTools(UserManager.getInstance().userId, content)
CollectionType.answer -> RetrofitManager.getInstance().getApi()
.postCollectionAnswer(UserManager.getInstance().userId, content)
CollectionType.ARTICLE -> api.postCollectionArticle(UserManager.getInstance().userId, content)
CollectionType.TOOLKIT -> api.postCollectionTools(UserManager.getInstance().userId, content)
CollectionType.ANSWER -> api.postCollectionAnswer(UserManager.getInstance().userId, content)
else -> return
}
postCollection
@ -47,7 +43,7 @@ object CollectionUtils {
super.onFailure(e)
if (e != null) {
try {
val string = e.response()?.errorBody()?.string()
val string = e.response()?.errorBody()?.string() ?: ""
val errorBody = JSONObject(string)
if (errorBody.getInt("code") == 403009) {
listener.onSuccess()
@ -62,16 +58,13 @@ object CollectionUtils {
})
}
fun deleteCollection(context: Context, id: String, type: CollectionType, listener: OnCollectionListener) {
fun deleteCollection(id: String, type: CollectionType, listener: OnCollectionListener) {
val api = RetrofitManager.getInstance().api
val postCollection: Observable<ResponseBody>
when (type) {
CollectionType.article -> postCollection =
RetrofitManager.getInstance().getApi().deletaCollectionArticle(UserManager.getInstance().userId, id)
CollectionType.toolkit -> postCollection =
RetrofitManager.getInstance().getApi().deleteCollectionTools(UserManager.getInstance().userId, id)
CollectionType.answer -> postCollection =
RetrofitManager.getInstance().getApi().deleteCollectionAnswer(UserManager.getInstance().userId, id)
val postCollection = when (type) {
CollectionType.ARTICLE -> api.deletaCollectionArticle(UserManager.getInstance().userId, id)
CollectionType.TOOLKIT -> api.deleteCollectionTools(UserManager.getInstance().userId, id)
CollectionType.ANSWER -> api.deleteCollectionAnswer(UserManager.getInstance().userId, id)
else -> return
}
postCollection

View File

@ -10,22 +10,15 @@ import com.gh.gamecenter.CommentDetailActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.ifLogin
import com.gh.gamecenter.common.utils.showAutoOrientation
import com.gh.gamecenter.common.view.BugFixedPopupWindow
import com.gh.gamecenter.entity.CommentEntity
import com.gh.gamecenter.entity.MeEntity
import com.gh.gamecenter.entity.Permissions
import com.gh.gamecenter.feature.entity.Permissions
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.qa.comment.OnCommentOptionClickListener
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import org.json.JSONObject
import retrofit2.HttpException
@ -316,200 +309,6 @@ object CommentHelper {
popupWindow.showAutoOrientation(view)
}
private fun showControlDialog(
context: Context,
answerId: String? = null,
articleId: String? = null,
communityId: String? = null,
comment: CommentEntity,
me: MeEntity
) {
val dialogOptions = arrayListOf<String>()
val highlight = "置顶评论"
val hide = "隐藏评论"
var canHighlightCommentDirectly = false
var canHideCommentDirectly = false
if (me.isModerator || me.moderatorPermissions.topAnswerComment > Permissions.GUEST
|| me.moderatorPermissions.topCommunityArticleComment > Permissions.GUEST
) {
dialogOptions.add(highlight)
if (me.moderatorPermissions.topAnswerComment > Permissions.REPORTER
|| me.moderatorPermissions.topCommunityArticleComment > Permissions.REPORTER
) {
canHighlightCommentDirectly = true
}
}
if (me.isModerator || me.moderatorPermissions.hideAnswerComment > Permissions.GUEST
|| me.moderatorPermissions.hideCommunityArticleComment > Permissions.GUEST
) {
dialogOptions.add(hide)
if (me.moderatorPermissions.hideAnswerComment > Permissions.REPORTER
|| me.moderatorPermissions.hideCommunityArticleComment > Permissions.REPORTER
) {
canHideCommentDirectly = true
}
}
val highlightDialogHintContent = if (canHighlightCommentDirectly) {
"你的操作将立即生效,确定提交吗?(你的管理权限为:高级)"
} else {
"你的操作将提交给小编审核,确定提交吗?"
}
val hideDialogHintContent = if (canHideCommentDirectly) {
"你的操作将立即生效,确定提交吗?(你的管理权限为:高级)"
} else {
"你的操作将提交给小编审核,确定提交吗?"
}
val disabledOptions = arrayListOf<String>()
if (comment.priority != 0) {
disabledOptions.add(highlight)
}
comment.me?.let {
if (it.isCommentOwner) {
disabledOptions.add(highlight)
}
}
DialogUtils.showListDialog(context, dialogOptions, disabledOptions) {
when (it) {
highlight -> {
if (comment.priority != 0) {
Utils.toast(context, "评论已经置顶")
return@showListDialog
}
comment.me?.let { me ->
if (me.isCommentOwner) {
Utils.toast(context, "不能置顶自己的评论")
return@showListDialog
}
}
val highlightObserver = object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
if (canHighlightCommentDirectly) {
Utils.toast(context, "置顶成功,请刷新列表")
} else {
Utils.toast(context, "提交成功")
}
}
override fun onFailure(e: HttpException?) {
super.onFailure(e)
e?.let { httpException ->
if (httpException.code() == 403) {
val string = e.response().errorBody()?.string()
val errorJson = JSONObject(string)
val errorCode = errorJson.getInt("code")
if (errorCode == 403059) {
Utils.toast(
HaloApp.getInstance().application,
"权限错误,请刷新后重试"
)
return
} else {
Utils.toast(HaloApp.getInstance().application, e.message())
}
}
}
}
}
if (answerId != null) {
DialogHelper.showDialog(
context, highlight, highlightDialogHintContent,
"确定", "取消", {
RetrofitManager.getInstance().api
.highlightAnswerComment(answerId, comment.id)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(highlightObserver)
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
} else {
DialogHelper.showDialog(
context, highlight, highlightDialogHintContent,
"确定", "取消", {
RetrofitManager.getInstance().api
.highlightCommunityArticleComment(comment.id)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(highlightObserver)
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
}
}
hide -> {
val hideObserver = object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
if (canHideCommentDirectly) {
Utils.toast(context, "隐藏成功,请刷新列表")
} else {
Utils.toast(context, "提交成功")
}
}
override fun onFailure(e: HttpException?) {
super.onFailure(e)
e?.let { httpException ->
if (httpException.code() == 403) {
val string = e.response().errorBody()?.string()
val errorJson = JSONObject(string)
val errorCode = errorJson.getInt("code")
if (errorCode == 403059) {
Utils.toast(
HaloApp.getInstance().application,
"权限错误,请刷新后重试"
)
return
} else {
Utils.toast(HaloApp.getInstance().application, e.message())
}
}
}
}
}
if (answerId != null) {
DialogHelper.showDialog(
context, hide, hideDialogHintContent,
"确定", "取消", {
RetrofitManager.getInstance().api
.hideAnswerComment(answerId, comment.id)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(hideObserver)
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
} else {
DialogHelper.showDialog(
context, hide, hideDialogHintContent,
"确定", "取消", {
RetrofitManager.getInstance().api
.hideCommunityArticleComment(comment.id)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(hideObserver)
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
}
}
}
}
}
private fun showReportTypeDialog(
context: Context,
reportCallback: (reportType: String) -> Unit

View File

@ -3,7 +3,6 @@ package com.gh.common.util;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
@ -26,7 +25,7 @@ import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.NumberUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.entity.CommentEntity;
import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.feature.entity.MeEntity;
import com.gh.gamecenter.login.entity.UserInfoEntity;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.retrofit.RetrofitManager;

View File

@ -1,6 +1,5 @@
package com.gh.common.util
import android.content.Context
import android.text.TextUtils
import com.gh.gamecenter.eventbus.EBConcernChanged
import com.gh.gamecenter.login.user.UserManager
@ -8,11 +7,8 @@ import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.RequestBody
import okhttp3.ResponseBody
import org.greenrobot.eventbus.EventBus
import org.json.JSONArray
import retrofit2.HttpException
/**
@ -25,9 +21,8 @@ object ConcernUtils {
* autoConcern:是否自动关注'关联关注'
*/
fun postConcernGameId(
context: Context,
gameId: String,
listener: onConcernListener?,
listener: OnConcernListener?,
autoConcern: Boolean = false
) {
val mode = if (autoConcern) "auto" else "manual"
@ -53,7 +48,7 @@ object ConcernUtils {
})
}
fun deleteConcernData(context: Context, gameId: String, listener: onConcernListener?) {
fun deleteConcernData(gameId: String, listener: OnConcernListener?) {
RetrofitManager.getInstance().api
.deleteConcern(UserManager.getInstance().userId, gameId)
.subscribeOn(Schedulers.io())
@ -72,73 +67,7 @@ object ConcernUtils {
})
}
fun updateConcernData(context: Context, data: JSONArray) {
val body = RequestBody.create(
MediaType.parse("application/json"),
data.toString()
)
RetrofitManager.getInstance().api
.putConcern(UserManager.getInstance().userId, body)
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
EventBus.getDefault().post(EBConcernChanged())
}
})
}
fun deleteConcernQuestions(context: Context, questionsId: String, listener: onConcernListener?) {
RetrofitManager.getInstance().api
.deleteConcernQuestions(UserManager.getInstance().userId, questionsId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
listener?.onSuccess()
}
override fun onFailure(e: HttpException?) {
super.onFailure(e)
listener?.onError()
var errorString: String? = null
try {
errorString = e?.response()?.errorBody()?.string()
} catch (e1: Exception) {
e1.printStackTrace()
}
ErrorHelper.handleError(context, errorString, false)
}
})
}
fun postConcernQuestions(context: Context, questionsId: String, listener: onConcernListener?) {
RetrofitManager.getInstance().api
.postConcernQuestions(UserManager.getInstance().userId, questionsId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
listener?.onSuccess()
}
override fun onFailure(e: HttpException?) {
super.onFailure(e)
listener?.onError()
var errorString: String? = null
try {
errorString = e?.response()?.errorBody()?.string()
} catch (e1: Exception) {
e1.printStackTrace()
}
ErrorHelper.handleError(context, errorString, false)
}
})
}
interface onConcernListener {
interface OnConcernListener {
fun onSuccess()
fun onError()
}

View File

@ -6,8 +6,9 @@ import android.os.Build;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.utils.NetworkUtils;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.entity.NewsDetailEntity;
import com.gh.gamecenter.feature.utils.PlatformUtils;
import com.gh.gamecenter.manager.DataCollectionManager;
import com.gh.gamecenter.manager.PackagesManager;
import com.lightgame.download.DownloadEntity;
@ -71,16 +72,6 @@ public class DataCollectionUtils {
DataCollectionManager.onEvent(context, "click-item", map);
}
// 上传游戏数据
public static void uploadGame(Context context, GameEntity gameEntity, int seconds, String from) {
Map<String, Object> map = new HashMap<>();
map.put("game", gameEntity.getName());
map.put("game_id", gameEntity.getId());
map.put("time", seconds);
map.put("from", from);
DataCollectionManager.onEvent(context, "game", map);
}
// 上传新闻数据
public static void uploadNews(Context context, NewsDetailEntity newsDetailEntity,
GameEntity gameEntity, int seconds, String from) {
@ -116,15 +107,6 @@ public class DataCollectionUtils {
DataCollectionManager.onEvent(context, "hijack", map);
}
// 上传用户数据
public static void uploadUser(Context context) {
Map<String, Object> map = new HashMap<>();
map.put("type", Build.MODEL);
map.put("system", Build.VERSION.SDK_INT + "=" + Build.VERSION.RELEASE);
map.put("install", PackagesManager.INSTANCE.getInstalledList());
DataCollectionManager.upsert(context, "user", map);
}
// 上传搜索数据
public static void uploadSearch(Context context, String... args) {
if (args.length != 5) {

View File

@ -8,7 +8,7 @@ import com.gh.common.filter.RegionSetting;
import com.gh.common.filter.RegionSettingHelper;
import com.gh.common.repository.ReservationRepository;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.view.DownloadButton;
import com.gh.gamecenter.feature.view.DownloadButton;
import com.gh.common.xapk.XapkInstaller;
import com.gh.common.xapk.XapkUnzipStatus;
import com.gh.download.DownloadManager;
@ -18,7 +18,7 @@ import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.feature.entity.PluginLocation;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.vspace.VHelper;
import com.lightgame.download.DownloadEntity;
@ -274,11 +274,7 @@ public class DetailDownloadUtils {
break;
case waiting:
viewHolder.mDownloadPb.setText(R.string.waiting);
if (downloadEntity.isPluggable() && PackagesManager.INSTANCE.isInstalled(downloadEntity.getPackageName())) {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
} else {
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
}
viewHolder.mDownloadPb.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
break;
case done:
if (SimulatorGameManager.isSimulatorGame(viewHolder.gameEntity)) {

View File

@ -4,7 +4,6 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
@ -21,7 +20,6 @@ import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.URLSpan;
import android.text.style.UnderlineSpan;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@ -30,15 +28,11 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
@ -49,7 +43,6 @@ import com.gh.common.constant.Config;
import com.gh.common.filter.RegionSetting;
import com.gh.gamecenter.R;
import com.gh.gamecenter.ShellActivity;
import com.gh.gamecenter.SuggestionActivity;
import com.gh.gamecenter.adapter.ReportReasonAdapter;
import com.gh.gamecenter.adapter.viewholder.PrivacyPolicyItemViewHolder;
import com.gh.gamecenter.common.base.TrackableDialog;
@ -57,13 +50,16 @@ import com.gh.gamecenter.common.callback.CancelListener;
import com.gh.gamecenter.common.callback.ConfirmListener;
import com.gh.gamecenter.common.callback.SimpleCallback;
import com.gh.gamecenter.common.databinding.DialogAlertDefaultBinding;
import com.gh.gamecenter.common.entity.SimpleGameEntity;
import com.gh.gamecenter.common.entity.SuggestType;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.NetworkUtils;
import com.gh.gamecenter.common.view.CustomLinkMovementMethod;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.common.view.FixLinearLayoutManager;
import com.gh.gamecenter.common.view.LimitHeightLinearLayout;
import com.gh.gamecenter.common.view.MaxHeightLinearLayout;
import com.gh.gamecenter.common.view.MaxHeightNestedScrollView;
import com.gh.gamecenter.common.view.VerticalItemDecoration;
import com.gh.gamecenter.core.AppExecutor;
@ -72,40 +68,32 @@ import com.gh.gamecenter.core.utils.EmptyCallback;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.core.utils.SpanBuilder;
import com.gh.gamecenter.core.utils.StringUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.databinding.DialogBindPhoneBinding;
import com.gh.gamecenter.databinding.DialogOverseaConfirmationBinding;
import com.gh.gamecenter.databinding.DialogPackageParseErrorBinding;
import com.gh.gamecenter.databinding.DialogReceiveLibaoSuccessBinding;
import com.gh.gamecenter.databinding.DialogRelievePhoneBinding;
import com.gh.gamecenter.databinding.DialogReportReasonBinding;
import com.gh.gamecenter.databinding.DialogWechatReserveSuccessBinding;
import com.gh.gamecenter.databinding.ImprintContentItemBinding;
import com.gh.gamecenter.databinding.PrivacyItemBinding;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.BadgeEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.PermissionsEntity;
import com.gh.gamecenter.entity.PrivacyPolicyEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.SimpleGameEntity;
import com.gh.gamecenter.entity.TrackableEntity;
import com.gh.gamecenter.login.entity.Badge;
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment;
import com.gh.gamecenter.setting.view.security.BindPhoneActivity;
import com.gh.gamecenter.suggest.SuggestType;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.Badge;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.feature.entity.SettingsEntity;
import com.gh.gamecenter.help.HelpAndFeedbackBridge;
import com.gh.gamecenter.setting.SettingBridge;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.AppManager;
import com.lightgame.utils.Util_System_Keyboard;
import com.lightgame.utils.Utils;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Unit;
@ -131,91 +119,15 @@ public class DialogUtils {
return dialog;
}
public static void showInstallHintDialog(Context context, final ConfirmListener cmListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context);
View view = View.inflate(context, R.layout.dialog_install_hint, null);
// 标题
TextView alertdialog_title = view.findViewById(R.id.installhint_title);
alertdialog_title.setText("重要提示");
Spanned content = Html.fromHtml("如果您使用的是" + "<font color=\"#ff0000\">华为</font>" + "" +
"<font color=\"#ff0000\">OPPO</font>" + "手机,安装游戏时请选择“" +
"<font color=\"#ff0000\">继续安装</font>" +
"”(记住不要选择“官方推荐”或“软件商店安装”)");
// 内容
TextView alertdialog_content = view.findViewById(R.id.installhint_content);
alertdialog_content.setText(content);
// 确定按钮
TextView installhint_confirm = view.findViewById(R.id.installhint_confirm);
installhint_confirm.setText("知道了");
final ImageView installhint_unselect = view.findViewById(R.id.installhint_unselect);
final ImageView installhint_select = view.findViewById(R.id.installhint_select);
LinearLayout installhint_unselect_ll = view.findViewById(R.id.installhint_unselect_ll);
installhint_unselect_ll.setOnClickListener(v -> {
if (installhint_unselect.getVisibility() == View.GONE) {
installhint_unselect.setVisibility(View.VISIBLE);
installhint_select.setVisibility(View.GONE);
} else {
installhint_unselect.setVisibility(View.GONE);
installhint_select.setVisibility(View.VISIBLE);
}
});
installhint_confirm.setOnClickListener(v -> {
dialog.dismiss();
if (installhint_select.getVisibility() == View.VISIBLE) {
if (cmListener != null) {
cmListener.onConfirm();
}
}
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(view);
dialog.show();
}
public static void showHintDialog(Context context, String title, CharSequence msg, String confirm) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context);
View view = View.inflate(context, R.layout.common_hintdialog, null);
TextView hintdialog_title = view.findViewById(R.id.tv_dialog_hint_title);
hintdialog_title.setText(title);
// 内容
TextView hintdialog_content = view.findViewById(R.id.tv_dialog_hint_content);
hintdialog_content.setText(msg);
TextView hintdialog_confirm = view.findViewById(R.id.tv_dialog_hint_confirm);
hintdialog_confirm.setText(confirm);
hintdialog_confirm.setOnClickListener(v -> dialog.cancel());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(view);
dialog.show();
}
public static void checkDownload(Context context, String size, CheckDownloadCallBack callBack) {
if (!NetworkUtils.isNetworkConnected(context)) {
showNoConnectionDownloadDialog(context, null,
showNoConnectionDownloadDialog(context, () -> {
},
() -> callBack.onResponse(true));
} else if (NetworkUtils.isWifiConnected(context)
|| filter4GorSize(context, size)) {
callBack.onResponse(false);
} else if (!SPUtils.getBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), true)) {
} else if (!SPUtils.getBoolean(getTrafficDownloadHintKey(), true)) {
AppExecutor.getUiExecutor().executeWithDelay(() -> Utils.toast(context, "当前使用移动网络下载,请注意流量消耗"), 500);
callBack.onResponse(false);
} else {
@ -226,6 +138,10 @@ public class DialogUtils {
}
}
private static String getTrafficDownloadHintKey() {
return PackageUtils.getGhVersionName() + "traffic_download_hint";
}
private static boolean filter4GorSize(Context context, String size) {
try {
if (TextUtils.isEmpty(size)) {
@ -243,23 +159,8 @@ public class DialogUtils {
}
return false;
}
public static void checkResumeDownload(Context context, CheckDownloadCallBack callBack) {
if (!NetworkUtils.isNetworkConnected(context)) {
showNoConnectionDownloadDialog(context, null, () -> callBack.onResponse(true));
} else if (NetworkUtils.isWifiConnected(context)) {
callBack.onResponse(false);
} else {
showResumeDownloadDialog(context, () -> {
callBack.onResponse(false);
}, () -> {
callBack.onResponse(true);
});
}
}
public static void showNoConnectionDownloadDialog(Context context, ConfirmListener listener, CancelListener cancelListener) {
com.gh.gamecenter.common.utils.DialogUtils.showWarningDialog(context, "下载提示", "网络异常,请检查手机网络状态", "连上WiFi后自动下载", "关闭", listener, cancelListener);
DialogHelper.showDialog(context, "下载提示", "网络异常,请检查手机网络状态", "知道了", "WiFi自动下载", listener::onConfirm, cancelListener::onCancel, false, "", "");
}
public static void showDownloadDialog(Context context, ConfirmListener listener, CancelListener cancelListener) {
@ -287,7 +188,7 @@ public class DialogUtils {
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
});
allowAlways.setOnClickListener(v -> {
SPUtils.setBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), false);
SPUtils.setBoolean(getTrafficDownloadHintKey(), false);
AppExecutor.getUiExecutor().executeWithDelay(() -> {
// 显示了弹窗以后,即便下面这个 toast 放在 listener.onConfirm 后调用也是显示 listener.onConfirm 里的 toast
// 喷了,延时包治疑难杂症
@ -300,363 +201,10 @@ public class DialogUtils {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
public static void showResumeDownloadDialog(Context context, ConfirmListener listener, CancelListener cancelListener) {
com.gh.gamecenter.common.utils.DialogUtils.showWarningDialog(context, "下载提示", "当前正在使用移动网络,继续下载会消耗手机流量", "连上WiFi后自动下载", "继续下载", listener, cancelListener);
}
public static void showDownloadDialog(Context context, ConfirmListener listener) {
com.gh.gamecenter.common.utils.DialogUtils.showWarningDialog(context, "下载提示", "您当前使用的网络为2G/3G/4G开始下载将会消耗移动流量确定下载", listener);
}
public static void showCancelDialog(Context context, final ConfirmListener listener, CancelListener cancelListener) {
Spanned content = Html.fromHtml(context.getString(R.string.cancel_concern_dialog));
showCancelListenerDialog(context, "取消关注", content, "确定取消", "暂不取消", listener, cancelListener);
}
/**
* ios 风格弹窗
*
* @param context
* @param title 标题
* @param message 内容
* @param negative 取消按钮文本
* @param positive 确认按钮文本
* @param clListener 取消按钮监听
* @param cmListener 确认按钮监听
*/
public static Dialog showNewAlertDialog(Context context, String title, CharSequence message
, String negative, String positive, TrackableEntity trackableEntity, int gravity, boolean shouldShowCloseBtn, final CancelListener clListener, final ConfirmListener cmListener) {
context = checkDialogContext(context);
final Dialog dialog;
if (trackableEntity != null) {
dialog = new TrackableDialog(context,
R.style.GhAlertDialog,
trackableEntity.getEvent(),
trackableEntity.getKey(),
trackableEntity.getValue(),
trackableEntity.getCancelValue(),
trackableEntity.getKeyBackValue(),
trackableEntity.getLogShowEvent());
} else {
dialog = new Dialog(context, R.style.GhAlertDialog);
}
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_new_alert, null);
TextView titleTv = contentView.findViewById(R.id.title);
TextView contentTv = contentView.findViewById(R.id.content);
TextView cancelBtn = contentView.findViewById(R.id.cancel);
TextView confirmBtn = contentView.findViewById(R.id.confirm);
View middleLine = contentView.findViewById(R.id.middle_line);
View closeIv = contentView.findViewById(R.id.closeIv);
titleTv.setGravity(gravity);
contentTv.setGravity(gravity);
titleTv.setText(title);
contentTv.setText(message);
cancelBtn.setText(negative);
confirmBtn.setText(positive);
if (negative.isEmpty()) {
cancelBtn.setVisibility(View.GONE);
middleLine.setVisibility(View.GONE);
confirmBtn.setTextColor(ContextCompat.getColor(context, R.color.text_title));
}
if (positive.isEmpty()) {
confirmBtn.setVisibility(View.GONE);
middleLine.setVisibility(View.GONE);
}
closeIv.setVisibility(shouldShowCloseBtn ? View.VISIBLE : View.GONE);
closeIv.setOnClickListener(v -> dialog.dismiss());
cancelBtn.setOnClickListener(v -> {
if (clListener != null) clListener.onCancel();
dialog.dismiss();
});
confirmBtn.setOnClickListener(v -> {
if (cmListener != null) cmListener.onConfirm();
dialog.dismiss();
});
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
return dialog;
}
public static Dialog showNewAlertDialog(Context context, String title, CharSequence message
, String negative, String positive, final CancelListener clListener, final ConfirmListener cmListener) {
return showNewAlertDialog(context, title, message, negative, positive, null, Gravity.LEFT, false, clListener, cmListener);
}
public static Dialog showNewAlertDialog(Context context, String title, CharSequence message
, String negative, String positive, int gravity, boolean shouldShowCloseBtn, final CancelListener clListener, final ConfirmListener cmListener) {
return showNewAlertDialog(context, title, message, negative, positive, null, gravity, shouldShowCloseBtn, clListener, cmListener);
}
public static Dialog showDialogWithHtmlContent(Context context, String title, String content
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
contentTv.setText(Html.fromHtml(content));
titleTv.setText(title);
negativeTv.setText(negative);
positiveTv.setText(positive);
negativeTv.setOnClickListener(view -> {
if (clListener != null) {
clListener.onCancel();
}
dialog.dismiss();
});
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
return dialog;
}
/**
* 取消按钮灰色
*
* @param context
* @param title
* @param message
* @param positive
* @param negative
* @param cmListener
*/
public static void showCancelAlertDialog(Context context, String title, CharSequence message
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
contentTv.setText(message);
titleTv.setText(title);
negativeTv.setText(negative);
negativeTv.setTextColor(ContextCompat.getColor(context, R.color.hint));
positiveTv.setText(positive);
negativeTv.setOnClickListener(view -> {
if (clListener != null) {
clListener.onCancel();
}
dialog.dismiss();
});
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
/**
* 点击外部退出和取消监听绑定
*/
public static void showCancelListenerDialog(Context context, String title, CharSequence message
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
contentTv.setText(message);
titleTv.setText(title);
negativeTv.setText(negative);
//negativeTv.setTextColor(ContextCompat.getColor(context, R.color.hint));
positiveTv.setText(positive);
negativeTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (clListener != null) {
clListener.onCancel();
}
dialog.dismiss();
}
});
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.setOnCancelListener(dialogInterface -> {
if (clListener != null)
clListener.onCancel();
});
dialog.show();
}
/**
* 权限弹窗
* 只能在弹窗内取消
*/
public static void showPermissionDialog(Context context, String title, CharSequence message
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
contentTv.setText(message);
titleTv.setText(title);
negativeTv.setText(negative);
negativeTv.setTextColor(ContextCompat.getColor(context, R.color.hint));
positiveTv.setText(positive);
negativeTv.setOnClickListener(view -> {
if (clListener != null) {
clListener.onCancel();
}
dialog.dismiss();
});
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.setCancelable(false);
dialog.show();
}
/**
* 只能在弹窗内取消
*/
public static void showForceDialog(Context context, String title, CharSequence message
, String positive, String negative, final ConfirmListener cmListener, final CancelListener clListener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView negativeTv = contentView.findViewById(R.id.dialog_negative);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
contentTv.setText(message);
titleTv.setText(title);
negativeTv.setText(negative);
positiveTv.setText(positive);
negativeTv.setOnClickListener(view -> {
if (clListener != null) {
clListener.onCancel();
}
dialog.dismiss();
});
positiveTv.setOnClickListener(view -> {
if (cmListener != null) {
cmListener.onConfirm();
}
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.setCancelable(false);
dialog.show();
}
/**
* 特殊:验证手机号码
*/
public static void checkPhoneNumDialog(Context context, CharSequence message, final ConfirmListener cmListener) {
String s = message.toString();
String sub1 = s.substring(0, 3);
String sub2 = s.substring(3, 7);
String sub3 = s.substring(7, 11);
String phoneNum = StringUtils.buildString(sub1, " - ", sub2, " - ", sub3);
AlertDialog alertDialog = new AlertDialog.Builder(context, R.style.GhAlertDialog)
.setTitle("请确定手机号:")
.setMessage(phoneNum)
.setPositiveButton("确认", (dialog, which) -> {
if (cmListener != null) {
cmListener.onConfirm();
}
})
.setNegativeButton("取消", null)
.create();
alertDialog.show();
TextView mesage = (TextView) alertDialog.findViewById(android.R.id.message);
Button positiveBtn = alertDialog.getButton(android.app.AlertDialog.BUTTON_POSITIVE);
Button negativeBtn = alertDialog.getButton(android.app.AlertDialog.BUTTON_NEGATIVE);
positiveBtn.setTextSize(13);
positiveBtn.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
negativeBtn.setTextSize(13);
negativeBtn.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
if (mesage != null) {
mesage.setGravity(Gravity.CENTER);
mesage.setTextSize(24);
mesage.setTextColor(ContextCompat.getColor(context, R.color.title));
TextPaint tp = mesage.getPaint();
tp.setFakeBoldText(true);
}
}
public static void showSignDialog(Context context, String title, CharSequence message, CharSequence message2
, String positive, final ConfirmListener cmListener) {
context = checkDialogContext(context);
@ -672,7 +220,7 @@ public class DialogUtils {
contentTv.setText(Html.fromHtml(message.toString()));
content2Tv.setText(Html.fromHtml(message2.toString()));
titleTv.setText(title);
titleTv.setText(Html.fromHtml(title));
positiveTv.setText(positive);
negativeTv.setOnClickListener(view -> dialog.dismiss());
@ -686,92 +234,10 @@ public class DialogUtils {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
public static void showLowSystemVersionDialog(Context context) {
final Context activityContext = checkDialogContext(context);
final Dialog dialog = new Dialog(activityContext, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(activityContext).inflate(R.layout.dialog_alert, null);
TextView contentTv = contentView.findViewById(R.id.dialog_content);
TextView titleTv = contentView.findViewById(R.id.dialog_title);
TextView positiveTv = contentView.findViewById(R.id.dialog_positive);
titleTv.setText("提示");
contentTv.setText("抱歉,您当前系统版本过低,暂不支持视频功能");
positiveTv.setText("我知道了");
positiveTv.setOnClickListener(view -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
}
public static void showListDialog(Context context,
List<String> selectionList,
DialogInterface.OnClickListener onClickListener) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
String[] selectionArray = new String[selectionList.size()];
selectionArray = selectionList.toArray(selectionArray);
builder.setItems(selectionArray, onClickListener);
AlertDialog dialog = builder.create();
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.show();
}
/**
* @param options 供以显示的选项
* @param disabledOptions 显示为灰色的选项(是 options 的子集)
*/
public static void showListDialog(Context context,
List<String> options,
List<String> disabledOptions,
OptionCallback callback) {
context = checkDialogContext(context);
Dialog dialog = new Dialog(context);
LinearLayout container = new LinearLayout(context);
container.setOrientation(LinearLayout.VERTICAL);
container.setBackgroundColor(ContextCompat.getColor(context, R.color.background_white));
container.setPadding(0, DisplayUtils.dip2px(context, 12f), 0, DisplayUtils.dip2px(context, 12f));
for (String option : options) {
TextView reportTv = new TextView(context);
reportTv.setText(option);
reportTv.setTextSize(17f);
if (disabledOptions != null && disabledOptions.contains(option)) {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.btn_gray));
} else {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.title));
reportTv.setBackgroundResource(R.drawable.textview_white_style);
}
int widthPixels = context.getResources().getDisplayMetrics().widthPixels;
reportTv.setLayoutParams(new LinearLayout.LayoutParams(widthPixels * 9 / 10,
LinearLayout.LayoutParams.WRAP_CONTENT));
reportTv.setPadding(DisplayUtils.dip2px(context, 20f), DisplayUtils.dip2px(context, 12f),
0, DisplayUtils.dip2px(context, 12f));
container.addView(reportTv);
reportTv.setOnClickListener(v -> {
dialog.cancel();
callback.onClicked(reportTv.getText().toString());
});
}
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(container);
dialog.show();
}
/**
* 特殊:目前只在提交问题错误返回时弹出
*/
@ -1343,8 +809,8 @@ public class DialogUtils {
((TextView) inflate.findViewById(R.id.imprint_title)).setText(titleName);
View head = LayoutInflater.from(context).inflate(R.layout.imprint_content_item, null);
content.addView(head, LinearLayout.LayoutParams.MATCH_PARENT, DisplayUtils.dip2px(30));
LimitHeightLinearLayout imprintContainer = inflate.findViewById(R.id.imprint_container);
imprintContainer.setLimitHeight((int) (context.getResources().getDisplayMetrics().heightPixels * 0.8));
MaxHeightLinearLayout imprintContainer = inflate.findViewById(R.id.imprint_container);
imprintContainer.setMaxHeight((int) (context.getResources().getDisplayMetrics().heightPixels * 0.8));
ArrayList<ApkEntity> list = gameEntity.getApk();
SettingsEntity settings = Config.getSettings();
@ -1436,30 +902,9 @@ public class DialogUtils {
}
public static void showPluggableNeverRemindDialog(Context context, String nameAndPlatform, @NonNull ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_pluggable_never_remind, null);
View cancelBtn = contentView.findViewById(R.id.cancel);
View confirmBtn = contentView.findViewById(R.id.confirm);
TextView contentTv = contentView.findViewById(R.id.content);
contentTv.setText(("助手首页将不再提示《" + nameAndPlatform + "》的所有插件化消息,确定吗?"));
cancelBtn.setOnClickListener(v -> {
dialog.dismiss();
});
confirmBtn.setOnClickListener(v -> {
listener.onConfirm();
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
dialog.show();
String content = "助手首页将不再提示《" + nameAndPlatform + "》的所有插件化消息,确定吗?";
DialogHelper.showDialog(context, "温馨提醒", content, "确定", "取消", listener::onConfirm, () -> {
}, false, "", "");
}
public static void showRegulationTestDialog(Context context, @NonNull ConfirmListener confirmListener, @NonNull CancelListener cancelListener) {
@ -1534,7 +979,7 @@ public class DialogUtils {
confirmBtn.setOnClickListener(v -> {
dialog.dismiss();
String hint = "" + downloadEntity.getName() + "》游戏安装包解压失败,问题反馈:";
SuggestionActivity.startSuggestionActivity(activityContext, SuggestType.normal, null, hint);
HelpAndFeedbackBridge.startSuggestionActivity(activityContext, SuggestType.normal, null, hint);
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -1569,100 +1014,6 @@ public class DialogUtils {
dialog.show();
}
public static void showVideoComplaintDialog(Context context,
List<String> options,
List<String> disabledOptions,
OptionCallback callback) {
context = checkDialogContext(context);
Dialog dialog = new Dialog(context);
View view = LayoutInflater.from(context).inflate(R.layout.dialog_video_complaint, null, false);
LinearLayout complaintContainer = view.findViewById(R.id.complaintContainer);
ConstraintLayout otherComplaintContainer = view.findViewById(R.id.otherComplaintContainer);
EditText complaintCommentEt = view.findViewById(R.id.complaintCommentEt);
TextView backTv = view.findViewById(R.id.backTv);
TextView commitTv = view.findViewById(R.id.commitTv);
Context finalContext = context;
//添加透明阴影,实现类似 clipPadding=false 效果
complaintCommentEt.setShadowLayer(complaintCommentEt.getExtendedPaddingBottom(), 0F, 0F, Color.TRANSPARENT);
ExtensionsKt.setTextChangedListener(complaintCommentEt, (s, start, before, count) -> {
commitTv.setTextColor(ContextCompat.getColor(finalContext, s.toString().trim().isEmpty() ? R.color.text_subtitleDesc : R.color.theme_font));
return null;
});
for (String option : options) {
TextView reportTv = new TextView(context);
reportTv.setText(option);
reportTv.setTextSize(16F);
if (disabledOptions != null && disabledOptions.contains(option)) {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.btn_gray));
} else {
reportTv.setTextColor(ContextCompat.getColor(context, R.color.title));
reportTv.setBackgroundResource(R.drawable.textview_white_style);
}
reportTv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
reportTv.setPadding(DisplayUtils.dip2px(context, 20F), DisplayUtils.dip2px(context, 17F),
DisplayUtils.dip2px(context, 20F), DisplayUtils.dip2px(context, 17F));
if (option.equals("其它")) {
ExtensionsKt.setDrawableEnd(reportTv, R.drawable.ic_complaint_arrow_right, DisplayUtils.dip2px(6F), DisplayUtils.dip2px(6F));
}
complaintContainer.addView(reportTv);
reportTv.setOnClickListener(v -> {
if (option.equals("其它")) {
complaintContainer.setVisibility(View.GONE);
otherComplaintContainer.setVisibility(View.VISIBLE);
complaintCommentEt.requestFocus();
Util_System_Keyboard.showSoftKeyboard(finalContext, complaintCommentEt);
} else {
dialog.cancel();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("reason", reportTv.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
callback.onClicked(jsonObject.toString());
}
});
}
backTv.setOnClickListener(v -> {
Util_System_Keyboard.hideSoftKeyboard(finalContext, complaintCommentEt);
complaintContainer.setVisibility(View.VISIBLE);
otherComplaintContainer.setVisibility(View.GONE);
});
commitTv.setOnClickListener(v -> {
if (complaintCommentEt.getText().toString().isEmpty()) {
ToastUtils.INSTANCE.showToast("请先输入说明~");
return;
}
dialog.cancel();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("reason", "其它");
jsonObject.put("description", complaintCommentEt.getText().toString());
} catch (JSONException e) {
e.printStackTrace();
}
callback.onClicked(jsonObject.toString());
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(view);
dialog.show();
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(40f);
window.setAttributes(params);
}
}
public static void showViewBadgeDialog(Context context, Badge badge, ConfirmListener listener) {
context = checkDialogContext(context);
@ -1842,7 +1193,7 @@ public class DialogUtils {
@Override
public Unit invoke() {
SimpleGameEntity entity = new SimpleGameEntity(gameId, gameName, "");
SuggestionActivity.startSuggestionActivity(finalContext, SuggestType.gameQuestion, "notfound", "模拟器安装包解析错误", entity, "-");
HelpAndFeedbackBridge.startSuggestionActivity(finalContext, SuggestType.gameQuestion, "notfound", "模拟器安装包解析错误", entity, "-");
dialog.dismiss();
return null;
}
@ -1951,36 +1302,6 @@ public class DialogUtils {
return dialog;
}
public static void showReceiveLibaoSuccessDialog(Context context, String title, String des, String libaoCode, ConfirmListener listener) {
context = checkDialogContext(context);
final Dialog dialog = new Dialog(context, R.style.DialogWindowTransparent);
DialogReceiveLibaoSuccessBinding binding = DialogReceiveLibaoSuccessBinding.inflate(LayoutInflater.from(context));
binding.title.setText(title);
binding.libaoCodeTv.setText(libaoCode);
binding.desTv.setText(des);
binding.confirm.setOnClickListener(v -> {
dialog.dismiss();
listener.onConfirm();
});
binding.cancel.setOnClickListener(v -> {
dialog.dismiss();
});
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(binding.getRoot());
dialog.show();
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
WindowManager.LayoutParams params = window.getAttributes();
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(60f);
window.setAttributes(params);
}
}
public static void showReserveSuccess2WechatBindDialog(Context context, ConfirmListener confirmListener, CancelListener cancelListener) {
context = checkDialogContext(context);
@ -2045,7 +1366,7 @@ public class DialogUtils {
binding.bindPhoneBtn.setOnClickListener(v -> {
dialog.dismiss();
Intent intent = BindPhoneActivity.getNormalIntent(finalContext, false);
Intent intent = SettingBridge.INSTANCE.getBindPhoneNormalIntent(finalContext, false);
finalContext.startActivity(intent);
});

View File

@ -10,11 +10,8 @@ import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureEvent.Companion.createEvent
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.common.exposure.ExposureType
import com.gh.common.util.EntranceUtils.jumpActivity
import com.gh.gamecenter.*
import com.gh.gamecenter.amway.AmwayActivity
@ -25,20 +22,25 @@ import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.common.constant.CommonConsts
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.entity.Display
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.*
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.discovery.DiscoveryActivity
import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.eventbus.EBSkip
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.MeEntity
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.forum.detail.ForumDetailActivity
import com.gh.gamecenter.forum.home.CommunityHomeFragment
import com.gh.gamecenter.fragment.MainWrapperFragment
@ -51,8 +53,8 @@ import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
import com.gh.gamecenter.help.HelpAndFeedbackBridge
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.mygame.PlayedGameActivity
import com.gh.gamecenter.personalhome.UserHomeActivity
import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
@ -65,10 +67,9 @@ import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.servers.GameServerTestActivity
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.setting.view.security.BindPhoneActivity
import com.gh.gamecenter.setting.view.SettingActivity
import com.gh.gamecenter.servers.gametest2.GameServerTestV2Activity
import com.gh.gamecenter.setting.SettingBridge
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.suggest.SuggestType
import com.gh.gamecenter.tag.TagsActivity
import com.gh.gamecenter.toolbox.ToolBoxBlockActivity
import com.gh.gamecenter.video.data.VideoDataActivity
@ -252,11 +253,6 @@ object DirectUtils {
path
)
"community_special_column" -> directAskColumnDetail(
context, linkEntity.link
?: "", linkEntity.community!!, entrance, path
)
"web", "inurl", "web链接" -> {
when {
linkEntity.link!!.contains("v.douyin") && PackageHelper.localPackageNameSet.contains("com.ss.android.ugc.aweme") -> {
@ -287,11 +283,6 @@ object DirectUtils {
)
)
"all_community_article" -> directSimpleArticleList(
context, linkEntity.link
?: "", entrance, path
)
"category", "分类" -> directCategoryDirectory(context, linkEntity.link!!, linkEntity.text!!)
"catalog" -> directCatalog(context, linkEntity.link!!, linkEntity.text!!, entrance, path)
@ -359,7 +350,7 @@ object DirectUtils {
"mobile_bind" -> {
CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(BindPhoneActivity.getNormalIntent(context, false))
context.startActivity(SettingBridge.getBindPhoneNormalIntent(context, false))
}
}
@ -389,7 +380,7 @@ object DirectUtils {
"etiquette_exam" -> directToRegulationTestPage(context)
"setting" -> context.startActivity(SettingActivity.getIntent(context, false, entrance))
"setting" -> context.startActivity(SettingBridge.getSettingIntent(context, false, entrance))
"index_page" -> directToHomeTab(context)
@ -440,6 +431,8 @@ object DirectUtils {
"explore_column" -> context.startActivity(DiscoveryActivity.getIntent(context, entrance))
"column_test_v2" -> context.startActivity(GameServerTestV2Activity.getIntent(context, entrance))
"" -> {
// do nothing
}
@ -459,8 +452,9 @@ object DirectUtils {
@JvmStatic
fun directToQa(context: Context, text: String? = "", id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, QaActivity::class.java.simpleName)
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_ID, id)
jumpActivity(context, bundle)
@ -472,8 +466,9 @@ object DirectUtils {
@JvmStatic
fun directToQaCollection(context: Context, text: String, id: String) {
if (id.isEmpty()) return
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, QaActivity::class.java.simpleName)
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putString(KEY_NAVIGATION_TITLE, text)
bundle.putString(KEY_QA_COLLECTION_ID, id)
jumpActivity(context, bundle)
@ -598,14 +593,14 @@ object DirectUtils {
* 跳转至个人主页
* @param position 定位到某个tab 0游戏 1发布
* @param type 类型 (发布)
* @param game_type 类型 (游戏)
* @param gameType 类型 (游戏)
*/
@JvmStatic
fun directToHomeActivity(
context: Context,
userId: String? = "",
type: String? = "",
game_type: String? = "",
gameType: String? = "",
position: Int? = 0,
entrance: String? = null,
path: String? = null
@ -618,7 +613,7 @@ object DirectUtils {
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
bundle.putString(KEY_PATH, path)
bundle.putString(KEY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
bundle.putString(KEY_GAME, game_type)
bundle.putString(KEY_GAME, gameType)
bundle.putInt(KEY_POSITION, position ?: 0)
jumpActivity(context, bundle)
}
@ -713,11 +708,6 @@ object DirectUtils {
jumpActivity(context, bundle)
}
// 跳转至用户玩过的游戏
fun directToPlayedGame(context: Context, userId: String, entrance: String = "", path: String = "") {
context.startActivity(PlayedGameActivity.getIntent(context, userId, entrance, path))
}
// 专栏
@JvmStatic
fun directToSubject(
@ -757,7 +747,8 @@ object DirectUtils {
) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
val destination = RouteConsts.activity.suggestionActivity.toDestinationClass()
bundle.putString(KEY_TO, destination?.name ?: "")
if (isQaFeedback) {
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
@ -787,7 +778,8 @@ object DirectUtils {
) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
val destination = RouteConsts.activity.suggestionActivity.toDestinationClass()
bundle.putString(KEY_TO, destination?.name ?: "")
if (isQaFeedback) {
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
@ -900,15 +892,6 @@ object DirectUtils {
jumpActivity(context, bundle)
}
// 个人-系统消息
@JvmStatic
fun directToOfficialNotification(context: Context, entrance: String? = null) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, MessageKeFuActivity::class.java.simpleName)
jumpActivity(context, bundle)
}
@JvmStatic
fun directToExternalBrowser(context: Context, url: String) {
try {
@ -1096,7 +1079,7 @@ object DirectUtils {
bundle.putString(KEY_PATH, path)
jumpActivity(context, bundle)
} else {
DialogUtils.showLowSystemVersionDialog(context)
DialogHelper.showVideoUnsupportedDialog(context)
}
}
@ -1138,7 +1121,7 @@ object DirectUtils {
bundle.putString(KEY_SECTION_NAME, sectionName)
jumpActivity(context, bundle)
} else {
DialogUtils.showLowSystemVersionDialog(context)
DialogHelper.showVideoUnsupportedDialog(context)
}
}
@ -1285,30 +1268,6 @@ object DirectUtils {
}
}
/**
* 跳转梦工厂小游戏
*/
/*@JvmStatic
fun directLetoGameCenter(context: Context) {
if (UserManager.getInstance().isLoggedIn) {
UserManager.getInstance().userInfoEntity?.run {
MgcAccountManager.syncAccount(context, if (idCard != null) idCard!!.name else name, mobile, name, icon, true,
object : SyncUserInfoListener {
override fun onSuccess(data: LoginResultBean?) {}
override fun onFail(code: String?, message: String?) {}
})
}
} else {
MgcAccountManager.exitAccount(context, object : SyncUserInfoListener {
override fun onSuccess(data: LoginResultBean?) {}
override fun onFail(code: String?, message: String?) {}
})
}
Leto.getInstance().startGameCenter(context)
}*/
/**
* 跳转分类
*/
@ -1375,47 +1334,6 @@ object DirectUtils {
jumpActivity(context, bundle)
}
/**
* 跳转到问题标签详情
*/
@JvmStatic
fun directAskColumnLabelDetail(
context: Context,
tag: String,
community: CommunityEntity,
entrance: String? = null,
path: String? = ""
) {
// val bundle = Bundle()
// bundle.putString(KEY_TO, AskColumnDetailActivity::class.java.name)
// bundle.putString(KEY_ASK_TAG, tag)
// bundle.putParcelable(KEY_COMMUNITY_DATA, community)
// bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
// bundle.putString(KEY_PATH, path)
// jumpActivity(context, bundle)
}
/**
* 跳转到专栏详情
*/
@JvmStatic
fun directAskColumnDetail(
context: Context,
columnId: String,
community: CommunityEntity,
entrance: String? = null,
path: String? = ""
) {
// if (columnId.isEmpty()) return
// val bundle = Bundle()
// bundle.putString(KEY_TO, AskColumnDetailActivity::class.java.name)
// bundle.putString(KEY_COLUMN_ID, columnId)
// bundle.putParcelable(KEY_COMMUNITY_DATA, community)
// bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
// bundle.putString(KEY_PATH, path)
// jumpActivity(context, bundle)
}
/**
* 跳转到板块
*/
@ -1451,20 +1369,6 @@ object DirectUtils {
jumpActivity(context, bundle)
}
/**
* 社区文章
*/
@JvmStatic
fun directSimpleArticleList(context: Context, sortType: String, entrance: String? = null, path: String? = "") {
// if (sortType.isEmpty()) return
// val bundle = Bundle()
// bundle.putString(KEY_TO, SimpleArticleListActivity::class.java.name)
// bundle.putString(KEY_TYPE, sortType)
// bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
// bundle.putString(KEY_PATH, path)
// jumpActivity(context, bundle)
}
@JvmStatic
fun directGameZone(context: Context, gameId: String, url: String, entrance: String? = null) {
RetrofitManager.getInstance()
@ -1521,7 +1425,7 @@ object DirectUtils {
context.startActivity(intent)
// 这里换个线程操作是为了做一点延时
AppExecutor.ioExecutor.execute {
runOnIoThread {
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_HOME))
}
} else {
@ -1542,7 +1446,7 @@ object DirectUtils {
context.startActivity(intent)
// 这里换个线程操作是为了做一点延时
AppExecutor.ioExecutor.execute {
runOnIoThread {
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_BBS))
EventBus.getDefault().post(EBSkip(CommunityHomeFragment.EB_TAB, position))
}
@ -1565,7 +1469,7 @@ object DirectUtils {
context.startActivity(intent)
// 这里换个线程操作是为了做一点延时
AppExecutor.ioExecutor.execute {
runOnIoThread {
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_VIDEO))
}
} else {
@ -1584,7 +1488,7 @@ object DirectUtils {
context.startActivity(intent)
// 这里换个线程操作是为了做一点延时
AppExecutor.ioExecutor.execute {
runOnIoThread {
EventBus.getDefault().post(EBSkip(MainActivity.EB_SKIP_MAIN, MainWrapperFragment.INDEX_PERSONAL))
}
} else {
@ -1594,12 +1498,13 @@ object DirectUtils {
/**
* 跳转至使用帮助与反馈,请不要随意修改方法名
* @param position 使用帮助:[HelpAndFeedbackActivity.HELP_ITEM],意见反馈:[HelpAndFeedbackActivity.SUGGESTION_ITEM]
* @param position 使用帮助:[CommonConsts.TAB_MAIN],意见反馈:[CommonConsts.TAB_SUB]
*/
@JvmStatic
fun directToHelpAndFeedback(context: Context, position: Int = HelpAndFeedbackActivity.HELP_ITEM) {
fun directToHelpAndFeedback(context: Context, position: Int = CommonConsts.TAB_MAIN) {
val destination = RouteConsts.activity.helpAndFeedbackActivity.toDestinationClass()
val bundle = Bundle()
bundle.putString(KEY_TO, HelpAndFeedbackActivity::class.java.name)
bundle.putString(KEY_TO, destination?.name ?: "")
bundle.putInt(BaseActivity_TabLayout.PAGE_INDEX, position)
jumpActivity(context, bundle)
}
@ -1955,7 +1860,7 @@ object DirectUtils {
diagnosis: String = "",
requestCode: Int? = null
) {
val intent = SuggestionActivity.getIntent(
val intent = HelpAndFeedbackBridge.getIntent(
context,
type,
hiddenHint,

View File

@ -4,8 +4,8 @@ import android.content.Context
import android.os.Build
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.core.utils.EmptyCallback
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.ApkEntity
import com.gh.gamecenter.feature.entity.GameEntity
object DownloadDialogHelper {

View File

@ -3,8 +3,9 @@ package com.gh.common.util
import com.gh.common.filter.RegionSettingHelper
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.schedulers.Schedulers

View File

@ -10,14 +10,14 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.common.chain.*
import com.gh.common.constant.Config
import com.gh.common.dialog.DeviceRemindDialog
import com.gh.common.exposure.ExposureEvent
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.common.filter.RegionSettingHelper
import com.gh.common.history.HistoryHelper
import com.gh.common.repository.ReservationRepository
import com.gh.common.simulator.NewSimulatorGameManager
import com.gh.common.simulator.SimulatorDownloadManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.common.view.DownloadButton
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.common.xapk.XapkInstaller
import com.gh.common.xapk.XapkInstaller.cancelUnzipTask
import com.gh.common.xapk.XapkUnzipStatus
@ -33,8 +33,8 @@ import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.PluginLocation
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.PluginLocation
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
import com.gh.gamecenter.manager.PackagesManager
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
@ -316,7 +316,9 @@ object DownloadItemUtils {
DownloadStatus.cancel -> {
GameUtils.setDownloadBtnStatus(context, gameEntity, downloadBtn, pluginLocation)
}
else -> {}
else -> {
// do nothing
}
}
}
} else {
@ -847,10 +849,8 @@ object DownloadItemUtils {
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator
val newSimulator = Config.getNewSimulatorEntitySetting()
if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (newSimulator.active) {
simulator = newSimulator
}
if (!isInstalledOldSimulator && newSimulator != null && newSimulator.active) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
simulator = newSimulator
}
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(

View File

@ -35,7 +35,7 @@ object DownloadNotificationHelper {
const val ACTION_DOWNLOAD = "com.gh.gamecenter.DOWNLOAD"
const val ACTION_VDOWNLOAD = "com.gh.gamecenter.VDOWNLOAD"
private val mNotifyMap: MutableMap<String, Long> = mutableMapOf()
private val mNotifyMap: MutableMap<String, Long> by lazy { mutableMapOf() }
private fun getNotificationManager(): NotificationManager {
return HaloApp.getInstance().application.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@ -196,13 +196,6 @@ object DownloadNotificationHelper {
}
}
@JvmStatic
fun initDownloadNotification(downloadTasks: MutableList<DownloadEntity>) {
for (downloadTask in downloadTasks) {
addOrUpdateDownloadNotification(downloadTask)
}
}
private fun getNotificationIcon(): Int {
return R.mipmap.logo
}

View File

@ -1,6 +1,5 @@
package com.gh.common.util
import android.preference.PreferenceManager
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureUtils
import com.gh.common.simulator.SimulatorDownloadManager
@ -9,28 +8,25 @@ import com.gh.common.xapk.XapkInstaller
import com.gh.download.DownloadDataHelper
import com.gh.download.DownloadManager
import com.gh.gamecenter.R
import com.gh.gamecenter.SuggestionActivity
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.SimpleGameEntity
import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.common.eventbus.EBShowDialog
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.SimpleGameEntity
import com.gh.gamecenter.entity.SimulatorEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.SimulatorEntity
import com.gh.gamecenter.feature.utils.PlatformUtils
import com.gh.gamecenter.help.HelpAndFeedbackBridge
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.view.GameDownloadSettingFragment
import com.gh.gamecenter.suggest.SuggestType
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus
import com.lightgame.download.FileUtils
import com.lightgame.download.*
import com.lightgame.utils.AppManager
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
@ -80,7 +76,7 @@ object DownloadObserver {
val currentActivity = AppManager.getInstance().currentActivity() ?: return
DialogHelper.showDialog(currentActivity, "下载失败", "下载链接已失效,建议提交反馈", "立即反馈", "取消", {
SuggestionActivity.startSuggestionActivity(
HelpAndFeedbackBridge.startSuggestionActivity(
currentActivity,
SuggestType.gameQuestion, "notfound",
StringUtils.buildString(downloadEntity.name, ",问题反馈:下载链接失效"),
@ -273,7 +269,7 @@ object DownloadObserver {
} else {
val downloadType = downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE)
// 是否是自动安装
val isAutoInstall = SPUtils.getBoolean(GameDownloadSettingFragment.AUTO_INSTALL_SP_KEY, true)
val isAutoInstall = SPUtils.getBoolean(Constants.SP_AUTO_INSTALL, true)
if (downloadType == Constants.SIMULATOR_DOWNLOAD || isAutoInstall) {
if (FileUtils.isEmptyFile(downloadEntity.path)) {
Utils.toast(mApplication, R.string.install_failure_hint)
@ -374,6 +370,22 @@ object DownloadObserver {
if (downloadEntity.isPluggable) {
type = ExposureUtils.DownloadType.PLUGIN_DOWNLOAD
}
var downloadSpeed = 0L
val elapsedTimeString = downloadEntity.meta[DownloadConfig.KEY_DOWNLOAD_ELAPSED_TIME]
if (elapsedTimeString != null) {
var elapsedTime = elapsedTimeString.toLong()
if (elapsedTime == 0L) {
elapsedTime = 1L
SentryHelper.onEvent(
"DOWNLOAD_ELAPSED_TIME",
"elapsedTime is zero",
downloadEntity.gameId + ":" + downloadEntity.size
)
}
downloadSpeed = downloadEntity.size / elapsedTime
}
val isPlatformRecommend =
java.lang.Boolean.parseBoolean(downloadEntity.getMetaExtra(Constants.IS_PLATFORM_RECOMMEND))
ExposureUtils.logADownloadCompleteExposureEvent(
@ -385,6 +397,7 @@ object DownloadObserver {
),
downloadEntity.platform,
downloadEntity.exposureTrace,
downloadSpeed,
downloadEntity.meta[DownloadEntity.DOWNLOAD_HOST_KEY] ?: "unknown",
downloadEntity.meta[DownloadEntity.DOWNLOAD_PATH_KEY] ?: "unknown",
type

View File

@ -19,7 +19,7 @@ import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.entity.ErrorEntity
import com.gh.gamecenter.common.entity.ErrorEntity
import com.halo.assistant.fragment.user.UserInfoEditFragment
import com.halo.assistant.fragment.user.VerifyPhoneFragment
import com.lightgame.utils.AppManager

View File

@ -7,10 +7,7 @@ import androidx.appcompat.app.AppCompatActivity
import com.gh.common.DefaultJsApi
import com.gh.common.constant.Config
import com.gh.common.dialog.CertificationDialog
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureManager
import com.gh.common.exposure.ExposureSource
import com.gh.common.exposure.ExposureType
import com.gh.common.history.HistoryHelper
import com.gh.common.repository.ReservationRepository
import com.gh.common.simulator.NewSimulatorGameManager
@ -35,9 +32,13 @@ import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.entity.ApkEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.PluginLocation
import com.gh.gamecenter.feature.entity.ApkEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.PluginLocation
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.exposure.ExposureSource
import com.gh.gamecenter.feature.exposure.ExposureType
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.retrofit.RetrofitManager
@ -102,7 +103,7 @@ object GameActivityDownloadHelper {
// 开始玩
gameEntity.getApk().size == 0 && gameEntity.h5Link != null -> play(context, gameEntity)
// 下载
else -> handleDownload(context, event, gameEntity, entrance, location, this)
else -> handleDownloadStatus(context, event, gameEntity, entrance, location, this)
}
}
}
@ -166,8 +167,8 @@ object GameActivityDownloadHelper {
context.startActivity(i)
}
// 下载
private fun handleDownload(
// 处理下载的各种状态
private fun handleDownloadStatus(
context: Context,
event: DefaultJsApi.GameActivityEvent,
gameEntity: GameEntity,
@ -184,106 +185,183 @@ object GameActivityDownloadHelper {
) {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
} else {
if (str == context.getString(R.string.download) || str == context.getString(R.string.attempt)) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
}
}
when {
str == context.getString(R.string.download) || str == context.getString(R.string.attempt) -> {
handleDownloadStatus(context, gameEntity, apk, entrance, location, traceEvent)
}
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
} else if (str == context.getString(R.string.smooth)) {
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
}
}
}
str == context.getString(R.string.smooth) -> {
handleSmoothStatus(context, gameEntity, apk, entrance, location, traceEvent)
}
} else if (str.contains("")) {
if (gameEntity.pluggableCollection != null) {
DownloadDialog.showDownloadDialog(context, gameEntity, traceEvent, entrance, location)
} else {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
plugin(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
}
}
str.contains("") -> {
handlePluginStatus(context, gameEntity, apk, entrance, location, traceEvent)
}
} else if (str == context.getString(R.string.install)) {
val simulatorDownloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.url)
if (gameEntity.simulator != null) {
val isInstalled =
PackageUtils.isInstalledFromAllPackage(context, gameEntity.simulator!!.apk!!.packageName)
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator
val newSimulator = Config.getNewSimulatorEntitySetting()
if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (newSimulator.active) {
simulator = newSimulator
}
}
if (simulatorDownloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
context, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name!!, null
)
return
}
str == context.getString(R.string.install) -> {
handleInstallStatus(context, gameEntity, apk, downloadEntity)
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
} else {
downloadEntity?.run {
install(context, gameEntity, apk, this)
}
str == context.getString(R.string.launch) -> {
handleLaunchStatus(context, gameEntity, apk, entrance, location, traceEvent)
}
} else if (str == context.getString(R.string.launch)) {
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(context, null)
return
}
val simulatorDownloadEntity =
SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk()[0].url)
if (simulatorDownloadEntity != null) {
val file = File(simulatorDownloadEntity.path)
if (!file.exists()) {
download(context, gameEntity, apk, false, entrance, location, traceEvent)
return
}
NewFlatLogUtils.logSimulatorGameCardClick("启动")
SimulatorGameManager.launchSimulatorGame(simulatorDownloadEntity, gameEntity)
}
return
str == context.getString(R.string.update) -> {
handleUpdateStatus(context, gameEntity, apk, entrance, location, traceEvent)
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
return
else -> {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
}
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "启动", gameEntity.name)
}
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk()[0].packageName)
} else if (str == context.getString(R.string.update)) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
update(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
}
} else {
ToastUtils.toast("${gameEntity.name}已加入下载队列")
}
}
}
// 处理下载状态
private fun handleDownloadStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
entrance: String,
location: String,
traceEvent: ExposureEvent
) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
}
}
}
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
}
// 处理畅玩状态
private fun handleSmoothStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
entrance: String,
location: String,
traceEvent: ExposureEvent
) {
VHelper.validateVSpaceBeforeAction(context, gameEntity) {
GamePermissionDialogFragment.show((context as AppCompatActivity), gameEntity, gameEntity.info) {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
download(context, gameEntity, apk, isSubscribe, entrance, location, traceEvent)
}
}
}
}
}
// 处理插件化状态
private fun handlePluginStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
entrance: String,
location: String,
traceEvent: ExposureEvent
) {
if (gameEntity.pluggableCollection != null) {
DownloadDialog.showDownloadDialog(context, gameEntity, traceEvent, entrance, location)
} else {
CertificationDialog.showCertificationDialog(context, gameEntity) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
plugin(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
}
}
}
}
// 处理安装状态
private fun handleInstallStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
downloadEntity: DownloadEntity?
) {
val simulatorDownloadEntity = SimulatorGameManager.findDownloadEntityByUrl(apk.url)
if (gameEntity.simulator != null) {
val isInstalled =
PackageUtils.isInstalledFromAllPackage(context, gameEntity.simulator!!.apk!!.packageName)
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator
val newSimulator = Config.getNewSimulatorEntitySetting()
// 在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (!isInstalledOldSimulator && newSimulator != null && newSimulator.active) {
simulator = newSimulator
}
if (simulatorDownloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog(
context, simulator,
SimulatorDownloadManager.SimulatorLocation.LAUNCH, gameEntity.id, gameEntity.name!!, null
)
return
}
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
} else {
downloadEntity?.run {
install(context, gameEntity, apk, this)
}
}
}
// 处理启动状态
private fun handleLaunchStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
entrance: String,
location: String,
traceEvent: ExposureEvent
) {
EnergyBridge.postEnergyTask("play_game", gameEntity.id, gameEntity.getApk()[0].packageName)
//启动模拟器游戏
if (SimulatorGameManager.isSimulatorGame(gameEntity)) {
if (NewSimulatorGameManager.shouldShowUpdateNewSimulatorAlert(context)) {
NewSimulatorGameManager.showUpdateNewsSimulator(context, null)
return
}
val simulatorDownloadEntity =
SimulatorGameManager.findDownloadEntityByUrl(gameEntity.getApk()[0].url)
if (simulatorDownloadEntity != null) {
val file = File(simulatorDownloadEntity.path)
if (!file.exists()) {
download(context, gameEntity, apk, false, entrance, location, traceEvent)
return
}
NewFlatLogUtils.logSimulatorGameCardClick("启动")
SimulatorGameManager.launchSimulatorGame(simulatorDownloadEntity, gameEntity)
}
return
}
if (gameEntity.isVGame()) {
VHelper.installOrLaunch((context as AppCompatActivity), gameEntity.getUniquePackageName() ?: "")
return
}
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "启动", gameEntity.name)
}
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk()[0].packageName)
}
// 处理更新状态
private fun handleUpdateStatus(
context: Context,
gameEntity: GameEntity,
apk: ApkEntity,
entrance: String,
location: String,
traceEvent: ExposureEvent
) {
DialogUtils.checkDownload(context, apk.size) { isSubscribe: Boolean ->
update(context, gameEntity, apk, entrance, location, isSubscribe, traceEvent)
}
}
private fun getApk(
gameEntity: GameEntity,
event: DefaultJsApi.GameActivityEvent,

View File

@ -1,254 +0,0 @@
package com.gh.common.util
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Application
import android.os.Build
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.utils.tryWithDefaultCatch
import com.gh.gamecenter.core.GHThreadFactory
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareActivity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import com.lzf.easyfloat.EasyFloat
import com.lzf.easyfloat.enums.ShowPattern
import com.lzf.easyfloat.enums.SidePattern
import okhttp3.ResponseBody
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
/**
* 浏览游戏单广场任务辅助类
*/
@SuppressLint("StaticFieldLeak")
object GameCollectionSquareBrowseTaskHelper {
const val KEY_IS_FORM_BROWSE_TASK = "is_from_browse_task"
private const val FLOATING_SQUARE_BROWSE_TASK_VIEW = "floating_square_browse_task_view"
private var mBrowseTimeCount = 0
private var mIsBrowseTimeCountEnabled = false // 游戏单广场浏览时间统计是否开启
private var mBrowseTimeTimeout = 15
private var mIsBrowseTimeCountValid = false // 游戏单广场浏览时间统计是否有效
private var mBrowsePro: ProgressBar? = null
private var mIsFinished = false
private var mNeedShowFloatView = false
private var mIsFirstEnterSquare = true
private val mThreadService: ExecutorService by lazy {
Executors.newSingleThreadExecutor(GHThreadFactory("BROWSE_SQUARE_THREAD"))
}
private val mActivityLifecycleCallbacks by lazy {
object : Application.ActivityLifecycleCallbacks {
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {
if (isTopActivityGameCollectionRelated(activity) && mIsBrowseTimeCountEnabled) {
resumeTimeCount()
} else if (isGameCollectionSquare(activity) && mNeedShowFloatView) {
showOrUpdateFloatView(activity, mBrowseTimeTimeout)
}
}
override fun onActivityPaused(activity: Activity) {
if (isTopActivityGameCollectionRelated(activity) && mIsBrowseTimeCountEnabled) {
pauseTimeCount()
}
if (isGameCollectionSquare(activity)) {
dismissFloatView()
}
}
override fun onActivityDestroyed(activity: Activity) {
if (isGameCollectionSquare(activity) && mIsBrowseTimeCountEnabled) {
disableBrowseTimeCount()
unregisterActivityLifecycleCallbacks()
}
}
}
}
fun enableBrowseTimeCount(timeout: Int, isFinished: Boolean) {
mIsBrowseTimeCountEnabled = true
mBrowseTimeTimeout = timeout
mIsFinished = isFinished
mNeedShowFloatView = true
mIsFirstEnterSquare = true
resumeTimeCount()
HaloApp.getInstance().registerActivityLifecycleCallbacks(mActivityLifecycleCallbacks)
}
fun disableBrowseTimeCount() {
mBrowseTimeCount = 0
mIsBrowseTimeCountEnabled = false
mBrowsePro = null
mIsFinished = false
mIsFirstEnterSquare = true
}
fun unregisterActivityLifecycleCallbacks() {
mNeedShowFloatView = false
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(mActivityLifecycleCallbacks)
}
private fun resumeTimeCount() {
if (!mIsBrowseTimeCountEnabled) return
mIsBrowseTimeCountValid = true
mThreadService.execute {
while (mIsBrowseTimeCountEnabled && mIsBrowseTimeCountValid) {
val topActivity = CurrentActivityHolder.getCurrentActivity() ?: continue
checkFirstEnterSquare(topActivity)
runBrowseTask(topActivity)
Thread.sleep(1000)
}
}
}
private fun checkFirstEnterSquare(topActivity: Activity) {
if (isGameCollectionSquare(topActivity, false) && mIsFirstEnterSquare) {
mIsFirstEnterSquare = false
topActivity.intent.putExtra(KEY_IS_FORM_BROWSE_TASK, true)
}
}
private fun runBrowseTask(topActivity: Activity) {
if (isTopActivityGameCollectionRelated(topActivity)) {
tryWithDefaultCatch {
showOrUpdateFloatView(topActivity, if (mIsFinished) mBrowseTimeTimeout else mBrowseTimeCount)
if (mIsFinished) {
disableBrowseTimeCount()
} else {
countBrowseTimeout(topActivity)
}
}
}
}
private fun countBrowseTimeout(topActivity: Activity) {
mBrowseTimeCount++
if (mBrowseTimeCount >= mBrowseTimeTimeout) {
showOrUpdateFloatView(topActivity, mBrowseTimeTimeout)
postBrowseFinish()
}
}
private fun pauseTimeCount() {
if (!mIsBrowseTimeCountEnabled) return
mIsBrowseTimeCountValid = false
}
// 从任务跳转的游戏单广场/此游戏单广场进入的游戏单详情都计时
private fun isTopActivityGameCollectionRelated(activity: Activity): Boolean {
return isGameCollectionSquare(activity)
|| (activity is GameCollectionDetailActivity
&& activity.intent.getBundleExtra(ToolBarActivity.NORMAL_FRAGMENT_BUNDLE)
?.getBoolean(KEY_IS_FORM_BROWSE_TASK) == true)
}
private fun isGameCollectionSquare(activity: Activity, checkIsFromTask: Boolean = true): Boolean {
return activity is GameCollectionSquareActivity
&& (!checkIsFromTask || activity.intent.getBooleanExtra(KEY_IS_FORM_BROWSE_TASK, false))
}
private fun showOrUpdateFloatView(activity: Activity, time: Int) {
// 不支持 Android 4.1 的设备
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) return
// 游戏单广场才显示FloatView
if (!isGameCollectionSquare(activity)) return
runOnUiThread {
val isFinished = time == mBrowseTimeTimeout
val floatView = EasyFloat.getFloatView(FLOATING_SQUARE_BROWSE_TASK_VIEW)
if (floatView != null) {
updateFloatView(floatView, isFinished, time)
} else {
showFloatView(activity, isFinished)
}
}
}
private fun showFloatView(activity: Activity, isFinished: Boolean) {
EasyFloat.with(activity)
.setLayout(R.layout.layout_square_browse_task_float)
.setTag(FLOATING_SQUARE_BROWSE_TASK_VIEW)
.setAnimator(null)
.setGravity(Gravity.END.or(Gravity.CENTER_VERTICAL), 0, 0)
.setSidePattern(SidePattern.RIGHT)
.setShowPattern(ShowPattern.CURRENT_ACTIVITY)
.setDragEnable(false)
.registerCallback {
createResult { _, _, view ->
initFloatView(view, isFinished)
}
}
.show()
}
private fun initFloatView(view: View?, isFinished: Boolean) {
if (isFinished) {
view?.findViewById<ProgressBar>(R.id.browsePro)?.run {
max = mBrowseTimeTimeout
progress = mBrowseTimeTimeout
}
view?.findViewById<ImageView>(R.id.browsePic)
?.setImageResource(R.drawable.pic_browse_square_finish)
} else {
view?.findViewById<ProgressBar>(R.id.browsePro)?.run {
mBrowsePro = this
max = mBrowseTimeTimeout
progress = 0
}
view?.findViewById<ImageView>(R.id.browsePic)
?.setImageResource(R.drawable.pic_browse_square)
}
}
private fun updateFloatView(floatView: View, isFinished: Boolean, time: Int) {
if (mBrowsePro == null) {
mBrowsePro = floatView.findViewById(R.id.browsePro)
}
mBrowsePro?.progress = time
if (isFinished) {
floatView.findViewById<ImageView>(R.id.browsePic)
.setImageResource(R.drawable.pic_browse_square_finish)
}
}
private fun dismissFloatView() {
EasyFloat.dismiss(FLOATING_SQUARE_BROWSE_TASK_VIEW)
}
@SuppressLint("CheckResult")
private fun postBrowseFinish() {
RetrofitManager.getInstance()
.newApi
.postGameCollectionTask("browse_game_list_square", "0")
.compose(singleToMain())
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
disableBrowseTimeCount()
}
})
}
}

View File

@ -7,7 +7,7 @@ import com.gh.gamecenter.common.utils.doOnMainProcessOnly
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.entity.SubjectEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.common.retrofit.BiResponse

View File

@ -8,17 +8,17 @@ import androidx.annotation.WorkerThread;
import com.gh.common.constant.Config;
import com.gh.common.simulator.SimulatorGameManager;
import com.gh.common.view.DownloadButton;
import com.gh.gamecenter.feature.view.DownloadButton;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.R;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.ApkLink;
import com.gh.gamecenter.entity.GameCollectionEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.ApkLink;
import com.gh.gamecenter.feature.entity.GameCollectionEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.entity.GameUpdateEntity;
import com.gh.gamecenter.entity.PluginLocation;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.feature.entity.PluginLocation;
import com.gh.gamecenter.feature.entity.SettingsEntity;
import com.gh.gamecenter.manager.PackagesManager;
import com.gh.vspace.VHelper;
import com.lightgame.download.DownloadEntity;
@ -204,6 +204,7 @@ public class GameUtils {
gameUpdateEntity.setIcon(gameEntity.getIcon());
gameUpdateEntity.setRawIcon(gameEntity.getRawIcon());
gameUpdateEntity.setIconSubscript(gameEntity.getIconSubscript());
gameUpdateEntity.setIconFloat(gameEntity.getIconFloat());
gameUpdateEntity.setName(gameEntity.getName());
gameUpdateEntity.setPackageName(apkEntity.getPackageName());
gameUpdateEntity.setSize(apkEntity.getSize());

View File

@ -17,7 +17,7 @@ import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.R;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.entity.TagStyleEntity;
import com.gh.gamecenter.feature.entity.TagStyleEntity;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -73,28 +73,6 @@ public class GameViewUtils {
}
}
public static void setLabelList(Context context, LinearLayout labelLayout, String tagType, List<TagStyleEntity> tagStyle) {
labelLayout.removeAllViews();
if (tagStyle == null || tagStyle.isEmpty()) {
labelLayout.addView(getGameTagView(context, "官方版", 0, tagType, null));
} else {
for (int i = 0; i < tagStyle.size() - 1; i++) {
View view;
if (i == tagStyle.size() - 1) {
view = getGameTagView(context, tagStyle.get(i).getName(), 0, tagType, tagStyle.size() > i ? tagStyle.get(i) : null);
} else {
view = getGameTagView(context, tagStyle.get(i).getName(), DisplayUtils.dip2px(context, 8), tagType, tagStyle.size() > i ? tagStyle.get(i) : null);
}
if (view != null) {
labelLayout.addView(view);
}
if (labelLayout.getChildCount() == 3) {
break;
}
}
}
}
// 新的游戏标签样式 version>=4.0.0
private static TextView getNewGameTagView(Context context, TagStyleEntity tagEntity, int rightMargin) {
// 参数不全,用旧样式实现

View File

@ -2,8 +2,8 @@ package com.gh.common.util
import com.gh.gamecenter.common.utils.toastInInternalRelease
import com.gh.gamecenter.common.utils.tryCatchInRelease
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.HomePluggableFilterEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.room.AppDatabase
/**
@ -11,7 +11,7 @@ import com.gh.gamecenter.room.AppDatabase
*/
object HomePluggableHelper {
private val mHomePluggableFilterDao = AppDatabase.getInstance().homePluggableFilterDao()
private val mHomePluggableFilterDao by lazy { AppDatabase.getInstance().homePluggableFilterDao() }
@JvmStatic
fun setHomePluggableFilterData(gameEntity: GameEntity, isNever: Boolean) {

View File

@ -20,14 +20,15 @@ import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.NotificationHelper;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.core.utils.UrlFilterUtils;
import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.entity.LibaoEntity;
import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.feature.entity.MeEntity;
import com.gh.gamecenter.common.entity.NotificationUgc;
import com.gh.gamecenter.entity.UserDataLibaoEntity;
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;
@ -392,73 +393,6 @@ public class LibaoUtils {
});
}
public static void libaoBtnClick(final Context context, final TextView libaoBtn, final LibaoEntity libaoEntity,
final boolean isInstallRequired, final LibaoDetailAdapter adapter,
final String entrance, final String loginEntrance, final OnLibaoStatusChangeListener listener) {
String status = libaoEntity.getStatus();
// 领取限制
CheckLoginUtils.checkLogin(context, loginEntrance, () -> {// "礼包详情-[" + btnStatus + "]"
if ("ling".equals(status) || "tao".equals(status)) {
if (isInstallRequired && !isAppInstalled(context, libaoEntity.getPackageName()) && adapter != null) {
String platform;
if (TextUtils.isEmpty(libaoEntity.getPlatform())) {
platform = "";
} else {
platform = PlatformUtils.getInstance(context).getPlatformName(libaoEntity.getPlatform());
}
boolean isExistPlatform = false;
ArrayList<ApkEntity> apk = adapter.getGameEntity().getApk();
for (ApkEntity apkEntity : apk) {
if (TextUtils.isEmpty(libaoEntity.getPlatform())) break;
if (libaoEntity.getPlatform().equals(apkEntity.getPlatform())) {
isExistPlatform = true;
break;
}
}
String dialogContent = context.getString(R.string.ling_rules_dialog, libaoEntity.getGame().getName(), platform);
boolean finalIsExistPlatform = isExistPlatform;
DialogHelper.showWarningDialog(context, "条件不符",
Html.fromHtml(dialogContent), isExistPlatform ? "关闭" : "",
isExistPlatform ? "立即安装" : "关闭",
() -> {
if (finalIsExistPlatform) {
adapter.openDownload(libaoEntity.getPlatform());
}
return null;
}, null);
return;
}
}
switch (Objects.requireNonNull(status)) {
case "coming":
Utils.toast(context, "还没到开始领取时间");
break;
case "check":
if (!TextUtils.isEmpty(libaoEntity.getDes())) {
DialogHelper.showDialog(context, "使用说明", Html.fromHtml(libaoEntity.getDes()), "关闭", "", () -> {
}, () -> {
}, false, "", "");
}
break;
case "repeatLing":
ToastUtils.showToast("礼包每天0点刷新明日0点后可再领一个");
break;
case "repeatLinged":
case "ling":
libaoLing(context, libaoBtn, libaoEntity, adapter, isInstallRequired, null, entrance, listener);
break;
case "repeatTao":
case "repeatTaoed":
case "tao":
libaoTao(context, libaoBtn, libaoEntity, isInstallRequired, adapter, status, entrance, listener);
break;
}
});
}
private static void libaoTao(Context context, TextView libaoBtn, LibaoEntity libaoEntity, boolean isInstallRequired, LibaoDetailAdapter adapter,
String status, String entrance, final OnLibaoStatusChangeListener listener) {
if ("repeatTao".equals(status)) {
@ -548,8 +482,9 @@ public class LibaoUtils {
break;
case "try tao":
case "used up":
DialogUtils.showHintDialog(context, "礼包已领光"
, "手速不够快,礼包已经被抢光了,十分抱歉", "知道了");
DialogHelper.showDialog(context, "礼包已领光", "手速不够快,礼包已经被抢光了,十分抱歉", "知道了", "", () -> {
}, () -> {
}, false, "", "");
break;
case "maintaining":
Utils.toast(context, "网络状态异常,请稍后再试");
@ -675,8 +610,9 @@ public class LibaoUtils {
break;
case "try tao":
case "used up":
DialogUtils.showHintDialog(context, "礼包已领光"
, "手速不够快,礼包已经被抢光了,十分抱歉", "知道了");
DialogHelper.showDialog(context, "礼包已领光", "手速不够快,礼包已经被抢光了,十分抱歉", "知道了", "", () -> {
}, () -> {
}, false, "", "");
libaoEntity.setStatus("used_up");
if (libaoBtn != null) {
initLibaoBtn(context, libaoBtn, libaoEntity, isInstallRequired, adapter, false, entrance, listener);

View File

@ -7,8 +7,6 @@ import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.gh.common.exposure.ExposureEvent;
import com.gh.common.exposure.ExposureSource;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.CommunityEntity;
@ -19,13 +17,15 @@ import com.gh.gamecenter.common.loghub.LoghubUtils;
import com.gh.gamecenter.common.loghub.SimpleLogContainerEntity;
import com.gh.gamecenter.common.utils.DeviceUtils;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.entity.DetectionObjectEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.PackageDialogEntity;
import com.gh.gamecenter.entity.SpecialColumn;
import com.gh.gamecenter.entity.StartupAdEntity;
import com.gh.gamecenter.feature.entity.DetectionObjectEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
import com.gh.gamecenter.feature.entity.PackageDialogEntity;
import com.gh.gamecenter.feature.entity.Questions;
import com.gh.gamecenter.feature.exposure.ExposureEvent;
import com.gh.gamecenter.feature.exposure.ExposureSource;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.qa.entity.Questions;
import com.halo.assistant.HaloApp;
import com.lightgame.utils.Utils;
@ -41,17 +41,26 @@ import java.util.List;
*/
public class LogUtils {
private static final String KEY_EVENT = "event";
private static final String KEY_META = "meta";
private static final String KEY_TIMESTAMP = "timestamp";
private static final String KEY_ENTRANCE = "entrance";
private static final String KEY_PAY_LOAD = "payload";
private static final String KEY_GAME_NAME = "game_name";
private static final String KEY_GAME_ID = "game_id";
private static final String LOG_STORE_EVENT = "event";
public static void logVideoStreamingUpload(String action, String entrance, String entranceDetail, String videoId) {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", "UPLOAD_VIDEO_STEAMING");
object.put(KEY_EVENT, "UPLOAD_VIDEO_STEAMING");
object.put("action", action);
payloadObject.put("entrance", entrance);
payloadObject.put(KEY_ENTRANCE, entrance);
payloadObject.put("entrance_detail", entranceDetail);
payloadObject.put("video_id", videoId);
object.put("payload", payloadObject);
object.put(KEY_PAY_LOAD, payloadObject);
} catch (JSONException e) {
e.printStackTrace();
}
@ -161,7 +170,7 @@ public class LogUtils {
public static void login(String loginStep, String loginType, String entrance) {
JSONObject object = new JSONObject();
try {
object.put("entrance", entrance);
object.put(KEY_ENTRANCE, entrance);
object.put("subject", "login");
object.put("step", loginStep);
object.put("login_type", loginType);
@ -199,8 +208,8 @@ public class LogUtils {
try {
object.put("source", GsonUtils.toJson(exposureSourceList));
object.put("game_name", gameEntity.getName());
object.put("game_id", gameEntity.getId());
object.put(KEY_GAME_NAME, gameEntity.getName());
object.put(KEY_GAME_ID, gameEntity.getId());
object.put("game_platform", gameEntity.getPlatform());
if (event != null) {
object.put("sequence", event.getPayload().getSequence());
@ -285,8 +294,8 @@ public class LogUtils {
metaObject.put("os", meta.getOs());
metaObject.put("userId", meta.getUserId());
object.put("meta", metaObject);
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, metaObject);
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
@ -302,14 +311,14 @@ public class LogUtils {
JSONObject payloadObject = new JSONObject();
try {
object.put("event", "ENTERING_VIDEO_STEAMING");
payloadObject.put("entrance", entrance);
object.put(KEY_EVENT, "ENTERING_VIDEO_STEAMING");
payloadObject.put(KEY_ENTRANCE, entrance);
if (!TextUtils.isEmpty(entranceDetail)) {
payloadObject.put("entrance_detail", entranceDetail);
}
payloadObject.put("video_id", videoId);
payloadObject.put("streaming_id", streamingId);
object.put("payload", payloadObject);
object.put(KEY_PAY_LOAD, payloadObject);
} catch (JSONException e) {
e.printStackTrace();
}
@ -321,13 +330,13 @@ public class LogUtils {
JSONObject payloadObject = new JSONObject();
try {
object.put("event", "VIDEO_PLAYING");
object.put(KEY_EVENT, "VIDEO_PLAYING");
object.put("action", action);
if (!TextUtils.isEmpty(msg)) {
object.put("msg", msg);
}
payloadObject.put("entrance", entrance);
payloadObject.put(KEY_ENTRANCE, entrance);
if (!TextUtils.isEmpty(entranceDetail)) {
payloadObject.put("entrance_detail", entranceDetail);
}
@ -342,7 +351,7 @@ public class LogUtils {
payloadObject.put("progress", progress);
payloadObject.put("video_play_status", videoPlayStatus);
object.put("payload", payloadObject);
object.put(KEY_PAY_LOAD, payloadObject);
} catch (JSONException e) {
e.printStackTrace();
}
@ -353,22 +362,22 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", "TOP_VIDEO_PLAYING");
object.put(KEY_EVENT, "TOP_VIDEO_PLAYING");
object.put("action", action);
payloadObject.put("video_mode", videoModel);//视频播放方式 ["自动播放"/"点击播放"/"全屏播放"]
payloadObject.put("video_id", videoId);
payloadObject.put("video_title", videoTitle);
payloadObject.put("game_id", gameId);
payloadObject.put("game_name", gameName);
payloadObject.put(KEY_GAME_ID, gameId);
payloadObject.put(KEY_GAME_NAME, gameName);
payloadObject.put("video_size", videoSize);
payloadObject.put("video_total_time", videoTotalTime);
payloadObject.put("progress", progress);
payloadObject.put("video_play_ts", videoPlayTs);
payloadObject.put("video_play_status", videoPlayStatus);
object.put("payload", payloadObject);
object.put("meta", getMetaObject());
object.put(KEY_PAY_LOAD, payloadObject);
object.put(KEY_META, getMetaObject());
} catch (JSONException e) {
e.printStackTrace();
}
@ -382,21 +391,21 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", "HOME_VIDEO_PLAYING");
object.put(KEY_EVENT, "HOME_VIDEO_PLAYING");
object.put("action", action);
payloadObject.put("video_id", videoId);
payloadObject.put("video_title", videoTitle);
payloadObject.put("game_id", gameId);
payloadObject.put("game_name", gameName);
payloadObject.put(KEY_GAME_ID, gameId);
payloadObject.put(KEY_GAME_NAME, gameName);
payloadObject.put("video_size", videoSize);
payloadObject.put("video_total_time", videoTotalTime);
payloadObject.put("progress", progress);
payloadObject.put("video_play_ts", videoPlayTs);
payloadObject.put("video_shade", String.valueOf(videoShade));//["true"/"false"]是否存在引导遮罩
object.put("payload", payloadObject);
object.put("meta", getMetaObject());
object.put(KEY_PAY_LOAD, payloadObject);
object.put(KEY_META, getMetaObject());
} catch (JSONException e) {
e.printStackTrace();
}
@ -418,7 +427,7 @@ public class LogUtils {
entity.setPayload(payload);
entity.setTimestamp(System.currentTimeMillis() / 1000);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), "event", false);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), LOG_STORE_EVENT, false);
}
public static void uploadLikeFromWelcomeDialog() {
@ -435,7 +444,7 @@ public class LogUtils {
entity.setPayload(payload);
entity.setTimestamp(System.currentTimeMillis() / 1000);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), "event", false);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), LOG_STORE_EVENT, false);
}
public static void uploadCommentFromWelcomeDialog() {
@ -452,7 +461,7 @@ public class LogUtils {
entity.setPayload(payload);
entity.setTimestamp(System.currentTimeMillis() / 1000);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), "event", false);
LoghubUtils.log(GsonUtils.toJsonIgnoreNull(entity), LOG_STORE_EVENT, false);
}
/**
@ -486,8 +495,8 @@ public class LogUtils {
private static void uploadCommunity(JSONObject object) {
try {
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
@ -504,8 +513,8 @@ public class LogUtils {
payload.put("location", location);//关注板块/文章外所属论坛/游戏详情/文章内所属论坛
payload.put("bbs_id", bbsId);
object.put("event", "access_to_bbs");
object.put("payload", payload);
object.put(KEY_EVENT, "access_to_bbs");
object.put(KEY_PAY_LOAD, payload);
} catch (JSONException e) {
e.printStackTrace();
}
@ -516,7 +525,7 @@ public class LogUtils {
public static void uploadAccessBbsTab() {
JSONObject object = new JSONObject();
try {
object.put("event", "main_tab[bbs]");
object.put(KEY_EVENT, "main_tab[bbs]");
} catch (JSONException e) {
e.printStackTrace();
}
@ -528,20 +537,20 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payload = new JSONObject();
try {
object.put("event", event);// 取值有[开始, 完成] [simulator_download, simulator_download_complete]
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_EVENT, event);// 取值有[开始, 完成] [simulator_download, simulator_download_complete]
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
payload.put("filename", fileName);// 下载模拟器文件名,每次新创建的下载任务文件名都不同,可以用来关联同一次的下载开始与完成
payload.put("simulator_id", simulatorId);
payload.put("simulator_name", simulatorName);
payload.put("location", location);//启动《具体的游戏名称》/模拟器游戏/模拟器游戏-模拟器管理
payload.put("game_id", gameId);//如果是 启动《游戏名称》 这种方式, 记录这个游戏具体的游戏ID
payload.put(KEY_GAME_ID, gameId);//如果是 启动《游戏名称》 这种方式, 记录这个游戏具体的游戏ID
payload.put("download_type", downloadType);// update/download 下载类型(更新/下载)
if (!TextUtils.isEmpty(startTime) && event.equals("simulator_download_complete")) {
payload.put("simulator_download_timestamp", startTime);// 对应的下载开始时间
}
object.put("payload", payload);
object.put(KEY_PAY_LOAD, payload);
} catch (JSONException e) {
e.printStackTrace();
}
@ -549,7 +558,7 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void uploadSearchGame(String event, String location, String key, String searchType) {
@ -567,18 +576,18 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payload = new JSONObject();
try {
object.put("event", event);
object.put(KEY_EVENT, event);
object.put("location", location);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
payload.put("key", key); //搜索关键词
payload.put("search_type", searchType); //搜索类型, 有四种取值 默认搜索/历史搜索/自动搜索/主动搜索
payload.put("game_id", gameId); //event为search_click才取值
payload.put("game_name", gameName); //event为search_click才取值
payload.put(KEY_GAME_ID, gameId); //event为search_click才取值
payload.put(KEY_GAME_NAME, gameName); //event为search_click才取值
payload.put("is_mirror_data", isMirrorData);
payload.put("is_ad_data", isAdData);
object.put("payload", payload);
object.put(KEY_PAY_LOAD, payload);
} catch (JSONException e) {
e.printStackTrace();
}
@ -586,7 +595,7 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logGameDetailStrategyButtonEvent(String gameId,
@ -594,11 +603,11 @@ public class LogUtils {
String text) {
JSONObject object = new JSONObject();
try {
object.put("event", "game_detail_click_strategy_button");
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put("meta", getMetaObject());
object.put("game_id", gameId);
object.put("game_name", gameName);
object.put(KEY_EVENT, "game_detail_click_strategy_button");
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_GAME_ID, gameId);
object.put(KEY_GAME_NAME, gameName);
object.put("text", text);
} catch (JSONException e) {
e.printStackTrace();
@ -606,7 +615,7 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logServerTestAccessEvent(String entrance,
@ -617,7 +626,7 @@ public class LogUtils {
try {
payload.put("server_test_name", serverTestName);
payload.put("server_test_note", serverTestNote);
payload.put("entrance", entrance);
payload.put(KEY_ENTRANCE, entrance);
payload.put("entrance_detail", entranceDetail);
} catch (JSONException e) {
e.printStackTrace();
@ -689,10 +698,10 @@ public class LogUtils {
private static void logServerTestEvent(String event, JSONObject payload) {
JSONObject object = new JSONObject();
try {
object.put("event", event);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put("payload", payload);
object.put(KEY_EVENT, event);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put(KEY_PAY_LOAD, payload);
} catch (JSONException e) {
e.printStackTrace();
}
@ -700,7 +709,7 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logNewCatalogAppearanceEvent(String entrance, String key) {
@ -726,9 +735,9 @@ public class LogUtils {
public static void logSpecialCatalogBannerClickEvent(String key, int seq) {
JSONObject object = new JSONObject();
try {
object.put("event", "category_lunbo_click");
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_EVENT, "category_lunbo_click");
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put("key", key);
object.put("sequence", seq);
@ -739,24 +748,24 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
private static void logCatalogEvent(String event, String entrance, String key, int seq1, int seq2, int seqContent, int seqContentList) {
JSONObject object = new JSONObject();
JSONObject payload = new JSONObject();
try {
object.put("event", event);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_EVENT, event);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
payload.put("entrance", entrance); //入口分类, 分为 首页或版块,
payload.put(KEY_ENTRANCE, entrance); //入口分类, 分为 首页或版块,
payload.put("key", key); //搜索类型, 有四种取值 默认搜索/历史搜索/自动搜索/主动搜索
payload.put("seq_1st", seq1); //从0开始,默认-1表示没有
payload.put("seq_2nd", seq2); //从0开始,默认-1表示没有
payload.put("seq_content", seqContent); //精选页上 图片、专题-全部按钮、专题合集-全部按钮 的排序;从0开始,默认-1表示没有
payload.put("seq_content_list", seqContentList);
object.put("payload", payload);
object.put(KEY_PAY_LOAD, payload);
} catch (JSONException e) {
e.printStackTrace();
}
@ -764,34 +773,34 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void uploadPackageSkip(String event, String action, String gameId, String gameName) {
JSONObject object = new JSONObject();
try {
object.put("event", event);//external_jump/external_show
object.put(KEY_EVENT, event);//external_jump/external_show
object.put("action", action);
if (!TextUtils.isEmpty(gameId) && !TextUtils.isEmpty(gameName)) {
object.put("game_id", gameId);
object.put("game_name", gameName);
object.put(KEY_GAME_ID, gameId);
object.put(KEY_GAME_NAME, gameName);
}
object.put("meta", getMetaObject());
object.put(KEY_META, getMetaObject());
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logStartAd(String event, StartupAdEntity adEntity) {
JSONObject object = new JSONObject();
try {
object.put("event", event);
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put("meta", getMetaObject());
object.put(KEY_EVENT, event);
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
if (adEntity != null) {
object.put("abs_id", adEntity.getId());
object.put("abs_text", adEntity.getDesc());
@ -807,16 +816,16 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logRecommendClick(String entrance, String recommendName, String linkType, String linkTitle, String linkId, int sequence) {
JSONObject object = new JSONObject();
try {
object.put("event", "recommend_click");
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put("meta", getMetaObject());
object.put("entrance", entrance);
object.put(KEY_EVENT, "recommend_click");
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_ENTRANCE, entrance);
object.put("recommend_name", recommendName);
object.put("link_id", linkId);
object.put("link_type", linkType);
@ -828,7 +837,7 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void uploadPackageCheck(String event, String action, GameEntity gameEntity, String linkTitle, String linkDesc, String downloadGameId, String downloadGameName) {
@ -839,11 +848,11 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", event);
object.put(KEY_EVENT, event);
object.put("action", action);
payloadObject.put("game_id", gameEntity.getId());
payloadObject.put("game_name", gameEntity.getName());
payloadObject.put(KEY_GAME_ID, gameEntity.getId());
payloadObject.put(KEY_GAME_NAME, gameEntity.getName());
payloadObject.put("link_title", linkTitle);
payloadObject.put("link_desc", linkDesc);
payloadObject.put("download_game_id", downloadGameId);
@ -857,16 +866,16 @@ public class LogUtils {
}
payloadObject.put("detection_objects", detectionArray);
object.put("meta", getMetaObject());
object.put("payload", payloadObject);
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_PAY_LOAD, payloadObject);
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logCategoryV2AppearanceEvent(String entrance, String classification) {
@ -919,11 +928,11 @@ public class LogUtils {
int seq2) {
JSONObject object = new JSONObject();
try {
object.put("event", event);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_EVENT, event);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
object.put("entrance", entrance);
object.put(KEY_ENTRANCE, entrance);
object.put("classification", classification);
object.put("side_classification", sideClassification);
object.put("classification_1st", classification1);
@ -941,45 +950,45 @@ public class LogUtils {
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logGameDetailFixedTopArticleClick(String gameId, String gameName, String url) {
JSONObject object = new JSONObject();
try {
object.put("event", "game_detail_click_top_strategy");
object.put("game_id", gameId);
object.put("game_name", gameName);
object.put(KEY_EVENT, "game_detail_click_top_strategy");
object.put(KEY_GAME_ID, gameId);
object.put(KEY_GAME_NAME, gameName);
object.put("top_strategy_url", url);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void logHomeTopTabClick(String tabName, String linkType, String linkTitle, String linkId, int sequence) {
JSONObject object = new JSONObject();
try {
object.put("event", "top_tab_click");
object.put(KEY_EVENT, "top_tab_click");
object.put("tab_name", tabName);
object.put("link_type", linkType);
object.put("link_id", linkId);
object.put("link_text", linkTitle);
object.put("sequence", sequence);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void uploadRecommendPopup(String event, String popupId, String gameId, String gameName,
@ -987,10 +996,10 @@ public class LogUtils {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", event);//recommend_pop_show推荐弹窗出现、recommend_pop_close推荐弹窗手动关闭、recommend_pop_link_click点击推荐弹窗链接、recommend_pop_download推荐弹窗下载开始、recommend_pop_download_complete推荐弹窗下载完成
object.put(KEY_EVENT, event);//recommend_pop_show推荐弹窗出现、recommend_pop_close推荐弹窗手动关闭、recommend_pop_link_click点击推荐弹窗链接、recommend_pop_download推荐弹窗下载开始、recommend_pop_download_complete推荐弹窗下载完成
payloadObject.put("recommend_pop_id", popupId);
payloadObject.put("game_id", gameId);
payloadObject.put("game_name", gameName);
payloadObject.put(KEY_GAME_ID, gameId);
payloadObject.put(KEY_GAME_NAME, gameName);
if (!TextUtils.isEmpty(linkType)) {
payloadObject.put("link_type", linkType);
}
@ -1003,37 +1012,37 @@ public class LogUtils {
if (!TextUtils.isEmpty(downloadGameName)) {
payloadObject.put("download_game_name", downloadGameName);
}
object.put("payload", payloadObject);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
object.put(KEY_PAY_LOAD, payloadObject);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
public static void uploadReceiveGift(String event, String giftId, String giftName, String location, String gameId, String gameName) {
JSONObject object = new JSONObject();
JSONObject payloadObject = new JSONObject();
try {
object.put("event", event);//game_gift_get_successful领取礼包、game_gift_dig_successful淘号
object.put(KEY_EVENT, event);//game_gift_get_successful领取礼包、game_gift_dig_successful淘号
payloadObject.put("gift_id", giftId);
payloadObject.put("gift_name", giftName);
payloadObject.put("location", location);
payloadObject.put("game_id", gameId);
payloadObject.put("game_name", gameName);
object.put("payload", payloadObject);
object.put("meta", getMetaObject());
object.put("timestamp", System.currentTimeMillis() / 1000);
payloadObject.put(KEY_GAME_ID, gameId);
payloadObject.put(KEY_GAME_NAME, gameName);
object.put(KEY_PAY_LOAD, payloadObject);
object.put(KEY_META, getMetaObject());
object.put(KEY_TIMESTAMP, System.currentTimeMillis() / 1000);
} catch (JSONException e) {
e.printStackTrace();
}
if (BuildConfig.DEBUG) {
Utils.log("LogUtils->" + object.toString());
}
LoghubUtils.log(object, "event", false);
LoghubUtils.log(object, LOG_STORE_EVENT, false);
}
}

View File

@ -313,47 +313,44 @@ public class MessageShareUtils {
}
public void shareTextFromWeb(Activity activity, String text, String type) {
switch (type) {
case "qq":
Utils.toast(mContext, "分享跳转中...");
if (ShareUtils.isQQClientAvailable(activity)) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, text);
intent.setType("text/plain");
intent.setPackage("com.tencent.mobileqq");
intent.setClassName("com.tencent.mobileqq", "com.tencent.mobileqq.activity.JumpActivity");
try {
activity.startActivity(intent);
} catch (Exception e) {
Utils.toast(mContext, "分享失败");
}
} else {
Utils.toast(mContext, "请安装QQ客户端");
if ("qq".equals(type)) {
Utils.toast(mContext, "分享跳转中...");
if (ShareUtils.isQQClientAvailable(activity)) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, text);
intent.setType("text/plain");
intent.setPackage("com.tencent.mobileqq");
intent.setClassName("com.tencent.mobileqq", "com.tencent.mobileqq.activity.JumpActivity");
try {
activity.startActivity(intent);
} catch (Exception e) {
Utils.toast(mContext, "分享失败");
}
break;
case "wechat":
Utils.toast(mContext, "分享跳转中...");
} else {
Utils.toast(mContext, "请安装QQ客户端");
}
} else if ("wechat".equals(type)) {
Utils.toast(mContext, "分享跳转中...");
if (!mIWXAPI.isWXAppInstalled() && !PermissionHelper.isGetInstalledListPermissionDisabled(mContext)) {
Utils.toast(mContext, mContext.getString(R.string.share_no_wechat_hint));
return;
}
if (!mIWXAPI.isWXAppInstalled() && !PermissionHelper.isGetInstalledListPermissionDisabled(mContext)) {
Utils.toast(mContext, mContext.getString(R.string.share_no_wechat_hint));
return;
}
WXTextObject textObj = new WXTextObject();
textObj.text = text;
WXTextObject textObj = new WXTextObject();
textObj.text = text;
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = textObj;
msg.description = text;
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = textObj;
msg.description = text;
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("text");
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = buildTransaction("text");
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
mIWXAPI.sendReq(req);
break;
mIWXAPI.sendReq(req);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import com.gh.gamecenter.R;
import com.gh.gamecenter.entity.NewsEntity;
import com.gh.gamecenter.feature.entity.NewsEntity;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager;
@ -94,19 +94,12 @@ public class NewsUtils {
textView.setTextColor(Color.WHITE);
switch (type != null ? type : "") {
case "活动":
textView.setBackgroundResource(R.drawable.textview_orange_style);
break;
case "公告":
textView.setBackgroundResource(R.drawable.textview_red_style);
break;
case "评测":
textView.setBackgroundResource(R.drawable.textview_red_style);
break;
case "杂谈":
textView.setBackgroundResource(R.drawable.textview_orange_style);
break;
case "专题":
textView.setBackgroundResource(R.drawable.textview_blue_style);
case "公告":
case "评测":
textView.setBackgroundResource(R.drawable.textview_red_style);
break;
default:
textView.setBackgroundResource(R.drawable.textview_blue_style);

View File

@ -3,7 +3,7 @@ package com.gh.common.util
import android.content.Context
import android.content.pm.ApplicationInfo
import com.gh.common.constant.Config
import com.gh.gamecenter.entity.SettingsEntity
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.halo.assistant.HaloApp
object PackageHelper {

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