Compare commits

...

188 Commits

Author SHA1 Message Date
98fb4b381a Merge branch 'hotfix/v5.33.1-1011/GHZS-4743' into 'release'
还原 vivo 设备获取应用列表权限的代码

See merge request halo/android/assistant-android!1541
2024-02-04 17:03:10 +08:00
1afed0d6db fix: VIVO 手机已安装列表权限获取问题 https://jira.shanqu.cc/browse/GHZS-4743 2024-02-04 15:35:11 +08:00
5c872b282c Merge branch 'hotfix/v5.33.1-1011-crashes' into 'release'
修复 5.33.1-1011 线上闪退问题

See merge request halo/android/assistant-android!1539
2024-02-04 14:22:26 +08:00
12be13d267 Merge branch 'hotfix/v5.33.1-1011/home_push_crash' into 'release'
fix: 修复首页下拉推送闪退问题...

See merge request halo/android/assistant-android!1538
2024-02-04 11:54:48 +08:00
83f50bb42c fix: 修复礼包详情页空指针闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/359262/?project=22 2024-02-04 11:50:39 +08:00
61e73ad932 feat: 修复因为延迟引起的海外弹窗弹出闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/360465/?project=22 2024-02-04 11:46:50 +08:00
e811538bbd fix: 修复首页下拉推送闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/352280/events/fa8235ae31344d539a3651d8b9189015/?project=22&statsPeriod=14d 2024-02-04 11:46:04 +08:00
818dec8428 chore: 版本更新至 5.33.2-1012 2024-02-02 17:47:35 +08:00
b79ada682f Merge branch 'hotfix/v5.33.1-1011-crashes' into 'release'
fix: 修复登录后快速关闭绑定手机号页面造成的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/363814

See merge request halo/android/assistant-android!1536
2024-02-02 17:46:45 +08:00
78330c1d12 Merge branch 'hotfix/v5.33.1-1011/runtime_exception' into 'release'
fix: 修复子线程弹出Dialog导致闪退的问题...

See merge request halo/android/assistant-android!1537
2024-02-02 17:45:40 +08:00
ff6e73cdb1 fix: 修复子线程弹出Dialog导致闪退的问题 https://sentry.shanqu.cc/organizations/lightgame/issues/364053/events/20753e6a2e6e4136b9edc2d1c0dcd95e/?project=22&statsPeriod=14d 2024-02-02 17:41:08 +08:00
4be928b015 fix: 修复登录后快速关闭绑定手机号页面造成的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/363814
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-02-02 17:12:58 +08:00
a28451a976 build: 更改 gradle 源地址 2024-01-31 17:59:25 +08:00
ec70e2c47e Merge branch 'hotfix/meta_build_error' into 'release'
fix: 修复推广打包脚本的编译问题

See merge request halo/android/assistant-android!1533
2024-01-31 17:33:30 +08:00
68d546c7ca fix: 修复推广打包脚本的编译问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-31 17:05:15 +08:00
365aa5d8da chore: 版本更新至 5.33.1-1011 2024-01-31 14:39:02 +08:00
c842a9a184 Merge branch 'hotfix/v5.33.0-1010-crashes' into 'release'
修复 5.33.0-1010 的线上问题

See merge request halo/android/assistant-android!1532
2024-01-31 14:38:33 +08:00
6093b662a1 fix: 临时修复微博登录时偶发的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/314704
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-31 14:24:13 +08:00
85d8638178 fix: 修复浏览播放论坛视频时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/363309
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-31 14:23:09 +08:00
ff434a0e51 fix: 修复海外地址弹窗弹出闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/360465/
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-31 11:24:10 +08:00
93ec29884b Merge branch 'hotfix/v5.33.0-1010-crashes' into 'release'
fix: 修复多线程初始化下载数据库可能的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/320027

See merge request halo/android/assistant-android!1531
2024-01-30 18:01:34 +08:00
f7bb617edb fix: 移除 EasyPermission 库
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-30 17:39:38 +08:00
1b5567f470 fix: 尝试修复卸载应用时可能的数组越界问题 https://sentry.shanqu.cc/organizations/lightgame/issues/242447/
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-30 17:17:55 +08:00
d1628b3377 fix: 修复重复设置 LayoutFactoryInflater factory 导致的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/350192
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-30 17:17:55 +08:00
509d6f4ac6 fix: 修复更换用户头像时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/354267
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-30 17:17:54 +08:00
5f9257a103 fix: 修复权限获取后的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/355494 https://sentry.shanqu.cc/organizations/lightgame/issues/355612 2024-01-30 17:17:54 +08:00
d50bea5f62 fix: 修复多线程初始化下载数据库可能的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/320027
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-30 15:52:44 +08:00
e138890f4d Merge branch 'hotfix/v5.33.0-1010-crashes' into 'release'
fix: 修复首页替换游戏导致的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/352562/?project=22

See merge request halo/android/assistant-android!1530
2024-01-30 15:32:49 +08:00
96734e3ead fix: 修复首页替换游戏导致的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/352562 2024-01-30 14:51:02 +08:00
7a596f49ca Merge branch 'fix/GHZS-4681' into 'dev'
fix:【光环助手】同步正式环境问题-反馈内容提交到后台显示乱码 https://jira.shanqu.cc/browse/GHZS-4681

See merge request halo/android/assistant-android!1528
2024-01-29 13:40:28 +08:00
564e5cbb8c fix:【光环助手】同步正式环境问题-反馈内容提交到后台显示乱码 https://jira.shanqu.cc/browse/GHZS-4681 2024-01-29 13:38:51 +08:00
25d7f2731a Merge branch 'fix/download_crash' into 'dev'
fix: 修复下载完成状态同步异常导致的闪退问题

See merge request halo/android/assistant-android!1527
2024-01-29 11:11:01 +08:00
36c164da26 fix: 修复下载完成状态同步异常导致的闪退问题 2024-01-29 11:09:21 +08:00
4996d62252 Merge branch 'fix/GHZS-4678' into 'dev'
fix:【光环助手】同步正式环境问题-畅玩问题内容未带前缀 https://jira.shanqu.cc/browse/GHZS-4678

See merge request halo/android/assistant-android!1525
2024-01-26 17:10:59 +08:00
20bab0fc84 fix:【光环助手】同步正式环境问题-畅玩问题内容未带前缀 https://jira.shanqu.cc/browse/GHZS-4678 2024-01-26 16:32:21 +08:00
74f6f3467b Merge branch 'chen/202401/GHZS-4673' into 'dev'
feat:搜索结果页面新增游戏首位设置:5.33.0客户端交互验收小优化—客户端 https://jira.shanqu.cc/browse/GHZS-4673

See merge request halo/android/assistant-android!1524
2024-01-26 14:11:22 +08:00
af4647dc37 feat:搜索结果页面新增游戏首位设置:5.33.0客户端交互验收小优化—客户端 https://jira.shanqu.cc/browse/GHZS-4673 2024-01-26 14:04:57 +08:00
e2306124b2 Merge branch 'feat/GHZS-4461' into 'dev'
feat: 神策统计口径切换 https://jira.shanqu.cc/browse/GHZS-4461

See merge request halo/android/assistant-android!1510
2024-01-25 13:43:24 +08:00
00cd4c1f1f feat: 神策统计口径切换 https://jira.shanqu.cc/browse/GHZS-4461 2024-01-25 13:34:54 +08:00
4ace4b8056 Merge branch 'feat/GHZS-4434' into 'dev'
feat: 版本更新弹窗神策埋点补充 https://jira.shanqu.cc/browse/GHZS-4434

See merge request halo/android/assistant-android!1519
2024-01-25 09:18:08 +08:00
bffdc42eac feat: 版本更新弹窗神策埋点补充 https://jira.shanqu.cc/browse/GHZS-4434 2024-01-24 17:11:30 +08:00
0d6aa9f11d Merge branch 'feature-GHZS-4529' into 'dev'
feat: 云存档埋点优化—客户端 https://jira.shanqu.cc/browse/GHZS-4529

See merge request halo/android/assistant-android!1518
2024-01-24 16:52:16 +08:00
357c48ab08 feat: 云存档埋点优化—客户端 https://jira.shanqu.cc/browse/GHZS-4529 2024-01-24 16:52:16 +08:00
f1d3705f80 Merge branch 'feature-GHZS-4530' into 'dev'
feat: 兼职包特殊渠道处理—客户端 https://jira.shanqu.cc/browse/GHZS-4530

See merge request halo/android/assistant-android!1517
2024-01-24 16:14:37 +08:00
699679289b feat: 兼职包特殊渠道处理—客户端 https://jira.shanqu.cc/browse/GHZS-4530 2024-01-24 16:14:37 +08:00
f8dc122c41 Merge branch 'feat/GHZS-4501' into 'dev'
feat: 实名接口调整 https://jira.shanqu.cc/browse/GHZS-4501

See merge request halo/android/assistant-android!1511
2024-01-24 15:44:53 +08:00
0a56189ae8 feat: 实名接口调整 https://jira.shanqu.cc/browse/GHZS-4501 2024-01-24 14:41:52 +08:00
e079116d80 Merge branch 'fix/GHZS-4627' into 'dev'
fix: 广告管理相关优化—0122测试-客户端 https://jira.shanqu.cc/browse/GHZS-4627

See merge request halo/android/assistant-android!1513
2024-01-24 10:28:10 +08:00
d661a91c2f Merge branch 'feat/GHZS-4639' into 'dev'
feat: 推广包升级广点通SDK https://jira.shanqu.cc/browse/GHZS-4639

See merge request halo/android/assistant-android!1512
2024-01-24 10:11:16 +08:00
3ff5b04893 feat: 推广包升级广点通SDK https://jira.shanqu.cc/browse/GHZS-4639
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-24 10:01:09 +08:00
9c8bc7742c Revert "fix: 广告管理相关优化—0122测试-客户端(ci) https://jira.shanqu.cc/browse/GHZS-4627"
This reverts commit 9778cf439b.
2024-01-24 09:56:23 +08:00
4c01859683 Merge branch 'feat/GHZS-4542' into 'dev'
feat: 游戏内容屏蔽后台 https://jira.shanqu.cc/browse/GHZS-4542

See merge request halo/android/assistant-android!1509
2024-01-23 11:09:25 +08:00
794a681f07 feat: 游戏内容屏蔽后台 https://jira.shanqu.cc/browse/GHZS-4542 2024-01-23 11:01:15 +08:00
9778cf439b fix: 广告管理相关优化—0122测试-客户端(ci) https://jira.shanqu.cc/browse/GHZS-4627 2024-01-23 10:09:41 +08:00
a66f62bcb7 fix: 广告管理相关优化—0122测试-客户端 https://jira.shanqu.cc/browse/GHZS-4627 2024-01-23 10:07:45 +08:00
0935a75ec0 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/build.gradle
#	dependencies.gradle
2024-01-19 17:34:31 +08:00
0a221c07bf Merge branch 'fix/GHZS-4600' into 'dev'
fix:【光环助手】意见反馈的默认文案出错 https://jira.shanqu.cc/browse/GHZS-4600

See merge request halo/android/assistant-android!1505
2024-01-19 11:31:43 +08:00
011ff1e24a fix:【光环助手】意见反馈的默认文案出错 https://jira.shanqu.cc/browse/GHZS-4600 2024-01-19 11:28:49 +08:00
9cd8b5d8d5 chore: 版本更新至 5.32.9-1001 2024-01-16 15:52:27 +08:00
1eb77e8bd2 Merge branch 'fix/GHZS-4567' into 'release'
fix: V5.32.8实名认证问题 https://jira.shanqu.cc/browse/GHZS-4567

See merge request halo/android/assistant-android!1502
2024-01-16 15:41:18 +08:00
650dd2e2ad fix: V5.32.8实名认证问题 https://jira.shanqu.cc/browse/GHZS-4567
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-01-16 14:43:04 +08:00
563955940d chore: 版本更新至 5.32.9-1000 2024-01-15 17:59:36 +08:00
376996540d Merge branch 'fix/GHZS-4553' into 'release'
fix: V5.32.9群测问题汇总 https://jira.shanqu.cc/browse/GHZS-4553

See merge request halo/android/assistant-android!1500
2024-01-15 17:58:51 +08:00
1292446bd0 fix: V5.32.9群测问题汇总 https://jira.shanqu.cc/browse/GHZS-4553 2024-01-15 17:58:15 +08:00
427ce5bc38 Merge branch 'feature-GHZS-3815-dev' into 'dev'
feat: 港澳APP—客户端 https://jira.shanqu.cc/browse/GHZS-3815

See merge request halo/android/assistant-android!1499
2024-01-15 17:48:25 +08:00
e7897f9b18 feat: 港澳APP—客户端 https://jira.shanqu.cc/browse/GHZS-3815 2024-01-15 17:48:25 +08:00
55ece981b5 chore: 版本更新至 5.32.9 2024-01-12 16:23:11 +08:00
7f68b165cb Merge branch 'feat/GHZS-4498' into 'release'
feat: 神马SDK接入 https://jira.shanqu.cc/browse/GHZS-4498

See merge request halo/android/assistant-android!1495
2024-01-12 16:22:01 +08:00
bf46229bcd feat: 神马SDK接入 https://jira.shanqu.cc/browse/GHZS-4498 2024-01-12 15:43:18 +08:00
ce80f133a0 feat: 更新 LGLibrary 的依赖 2024-01-12 15:41:34 +08:00
e5ea731946 Merge branch 'feat/GHZS-4541' into 'release'
feat: 更新信通院最新版本SDK https://jira.shanqu.cc/browse/GHZS-4541

See merge request halo/android/assistant-android!1494
2024-01-12 15:36:46 +08:00
24d7f60426 Merge branch 'feat/GHZS-4522' into 'release'
feat: 第三方下载地址-实名流程补充 https://jira.shanqu.cc/browse/GHZS-4522

See merge request halo/android/assistant-android!1493
2024-01-12 15:34:30 +08:00
3a0205789a feat: 第三方下载地址-实名流程补充 https://jira.shanqu.cc/browse/GHZS-4522 2024-01-12 15:18:12 +08:00
f86edd196f Merge branch 'feat/GHZS-4537' into 'release'
feat: 推广包升级快手SDK https://jira.shanqu.cc/browse/GHZS-4536

See merge request halo/android/assistant-android!1492
2024-01-12 14:48:21 +08:00
898278b3d9 feat: 推广包升级快手SDK https://jira.shanqu.cc/browse/GHZS-4536 2024-01-12 14:42:48 +08:00
fd757a346c feat: 更新信通院最新版本SDK https://jira.shanqu.cc/browse/GHZS-4541 2024-01-12 14:17:21 +08:00
ed32da8882 Merge branch 'fix/GHZS-4487' into 'dev'
fix: V5.32.8华为鸿蒙系统-模拟器下载问题 https://jira.shanqu.cc/browse/GHZS-4487

See merge request halo/android/assistant-android!1488
2024-01-08 10:06:21 +08:00
d7e88ba38a fix: V5.32.8华为鸿蒙系统-模拟器下载问题 https://jira.shanqu.cc/browse/GHZS-4487 2024-01-08 09:57:28 +08:00
af0ba215dd Merge branch 'feat/GHZS-4476' into 'dev'
feat: 补充权限使用说明 https://jira.shanqu.cc/browse/GHZS-4476

See merge request halo/android/assistant-android!1487
2024-01-05 10:15:40 +08:00
8e7a168495 feat: 补充权限使用说明 https://jira.shanqu.cc/browse/GHZS-4476 2024-01-05 09:47:42 +08:00
913bf7ad2f Merge branch 'fix/hot_launch_splash_ad' into 'dev'
fix: 修复使用第三方登录或分享回到光环时显示开屏广告的问题

See merge request halo/android/assistant-android!1486
2024-01-04 11:21:15 +08:00
4d84af6ff9 fix: 修复使用第三方登录或分享回到光环时显示开屏广告的问题 2024-01-04 11:21:15 +08:00
1acfe4227f Merge branch 'fix/GHZS-4442' into 'dev'
fix: 客户端添加多个下载任务,操作全部开始和暂停时会有任务卡住无法下载  https://jira.shanqu.cc/browse/GHZS-4442

See merge request halo/android/assistant-android!1483
2024-01-03 12:02:33 +08:00
847def3d30 Merge branch 'fix/GHZS-4467' into 'dev'
fix: 同时下载多个畅玩游戏时,游戏详情页的进度条会消失 https://jira.shanqu.cc/projects/GHZS/issues/GHZS-4467

See merge request halo/android/assistant-android!1485
2024-01-03 12:02:28 +08:00
f523e984c8 fix: 客户端添加多个下载任务,操作全部开始和暂停时会有任务卡住无法下载 https://jira.shanqu.cc/browse/GHZS-4442 2024-01-03 11:47:15 +08:00
5fe39d69de Merge branch 'fix/wrong_entity_usage' into 'dev'
fix: 修复 下载管理-游戏更新 页面上报数据时使用了错误实体的问题

See merge request halo/android/assistant-android!1484
2023-12-29 10:38:41 +08:00
0c76783397 fix: 修复 下载管理-游戏更新 页面上报数据时使用了错误实体的问题 2023-12-29 10:20:32 +08:00
e4b5a6ef5a fix: 同时下载多个畅玩游戏时,游戏详情页的进度条会消失 https://jira.shanqu.cc/projects/GHZS/issues/GHZS-4467 2023-12-28 15:22:27 +08:00
f03a9677cc fix: 处理合并冲突 2023-12-28 13:52:22 +08:00
c4b519204b Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/util/DialogUtils.java
#	app/src/main/java/com/gh/gamecenter/MainActivity.java
#	app/src/main/res/layout/dialog_privacy_policy.xml
#	dependencies.gradle
#	module_common/src/main/java/com/gh/gamecenter/common/utils/PermissionHelper.kt
2023-12-28 11:53:03 +08:00
423bcda7ff Merge branch 'feat/GHZS-4446' into 'release'
feat:【光环助手】隐私合规问题-12/22 https://jira.shanqu.cc/browse/GHZS-4444

See merge request halo/android/assistant-android!1482
2023-12-28 11:44:29 +08:00
2bb61e8e4b feat: 隐私合规问题-12/22 https://jira.shanqu.cc/browse/GHZS-4446 2023-12-28 11:43:56 +08:00
84d8de881e Merge branch 'fix/GHZS-4421' into 'dev'
fix: 神策埋点上报问题 https://jira.shanqu.cc/browse/GHZS-4421

See merge request halo/android/assistant-android!1478
2023-12-27 17:26:07 +08:00
3809d6d887 Merge branch 'fix/CWZS-145' into 'dev'
fix: 偶现下载任务无法删除 https://jira.shanqu.cc/browse/CWZS-145

See merge request halo/android/assistant-android!1480
2023-12-27 17:26:04 +08:00
96c18ec7a6 Merge branch 'fix/GHZS-4393' into 'dev'
fix: 开测表时间问题 https://jira.shanqu.cc/browse/GHZS-4393

See merge request halo/android/assistant-android!1481
2023-12-27 17:25:59 +08:00
d052ef5923 fix: 开测表时间问题 https://jira.shanqu.cc/browse/GHZS-4393 2023-12-27 11:51:06 +08:00
993631c853 fix: 偶现下载任务无法删除 https://jira.shanqu.cc/browse/CWZS-145 2023-12-22 17:12:40 +08:00
3a9958fa7d Merge branch 'fix/GHZS-4439' into 'dev'
fix: 【光环助手】版块下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-4439

See merge request halo/android/assistant-android!1479
2023-12-22 11:31:50 +08:00
bb51391b61 fix: 【光环助手】版块下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-4439 2023-12-22 11:31:50 +08:00
57f1cb7e59 Merge branch 'fix/GHZS-3923' into 'dev'
fix: 内容触发敏感词点击还原后未正常展示 https://jira.shanqu.cc/browse/GHZS-3923

See merge request halo/android/assistant-android!1476
2023-12-18 16:44:50 +08:00
b4cd90a7e9 Merge branch 'fix/sensor-privacy-issue' into 'dev'
fix: 修复神策 SDK 可能反复获取运营商信息的问题...

See merge request halo/android/assistant-android!1477
2023-12-18 16:44:45 +08:00
6ec9d2076f fix: 修复神策 SDK 可能反复获取运营商信息的问题 https://manual.sensorsdata.cn/sa/latest/zh_cn/tech_sdk_client_android_high-128974940.html#id-.%E9%AB%98%E7%BA%A7%E5%8A%9F%E8%83%BD%EF%BC%88Android%EF%BC%89v2.5-%E9%99%90%E5%88%B6SDK%E8%AF%BB%E5%8F%96%E6%95%8F%E6%84%9F%E5%B1%9E%E6%80%A7 2023-12-18 16:36:45 +08:00
22c727cd2f Merge branch 'hotfix/v5.32.7-997/crashes' into 'release'
修复sentry闪退问题

See merge request halo/android/assistant-android!1475
2023-12-18 14:20:19 +08:00
5e5aee539e fix: 修复首页下拉刷新偶发的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/352463/?project=22&query=is%3Aunresolved+assigned%3Ame&sort=date&statsPeriod=14d 2023-12-18 14:11:21 +08:00
c158225472 fix: 修复开屏广告偶发的空指针闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/349408/events/ca7a12772e484958a5a9d4113fcba161/?project=22&statsPeriod=14d 2023-12-18 14:10:30 +08:00
ac5b7837db Merge branch 'fix/hot_launch_splash_ad' into 'dev'
fix: 修复重复展示热启动和冷启动开屏广告的问题

See merge request halo/android/assistant-android!1474
2023-12-15 17:45:15 +08:00
05a113de40 fix: 修复重复展示热启动和冷启动开屏广告的问题 2023-12-15 17:29:25 +08:00
d45d02bfd2 fix: 神策埋点上报问题 https://jira.shanqu.cc/browse/GHZS-4421
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2023-12-15 17:19:25 +08:00
395433f21f Merge branch 'feature-GHZS-3788' into 'dev'
feat: 新增草稿箱入口—客户端 https://jira.shanqu.cc/browse/GHZS-3788

See merge request halo/android/assistant-android!1473
2023-12-14 18:07:18 +08:00
ccbd70666a feat: 新增草稿箱入口—客户端 https://jira.shanqu.cc/browse/GHZS-3788 2023-12-14 18:07:18 +08:00
aaa8eda004 Merge branch 'feature-GHZS-4259' into 'dev'
fix: 【光环助手】“横屏滑动视频”专题滑动导致APP卡顿 https://jira.shanqu.cc/browse/GHZS-4259

See merge request halo/android/assistant-android!1459
2023-12-14 18:06:45 +08:00
748497e5b1 fix: 【光环助手】“横屏滑动视频”专题滑动导致APP卡顿 https://jira.shanqu.cc/browse/GHZS-4259 2023-12-14 18:06:45 +08:00
1cf49b931e Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-12-14 17:03:14 +08:00
e4a9d533d4 Merge branch 'feat/GHZS-3698' into 'dev'
feat: 通用链接模块新增帮助与反馈类型 https://jira.shanqu.cc/browse/GHZS-3785

See merge request halo/android/assistant-android!1425
2023-12-14 16:53:55 +08:00
36e9bd20ac fix: V5.32.5群测问题汇总1204 https://jira.shanqu.cc/browse/GHZS-4375 2023-12-13 15:36:34 +08:00
cc4ef16e10 chore: 版本更新至 5.32.7 2023-12-13 14:20:28 +08:00
6a446a6f3a Merge branch 'fix/GHZS-4375' into 'dev'
fix: V5.32.5群测问题汇总1204 https://jira.shanqu.cc/browse/GHZS-4375

See merge request halo/android/assistant-android!1472
2023-12-13 10:44:01 +08:00
233e0ec71d fix: V5.32.5群测问题汇总1204 https://jira.shanqu.cc/browse/GHZS-4375 2023-12-13 10:27:10 +08:00
d6e1a90472 Merge branch 'feat/GHZS-4384' into 'dev'
feat: 适龄提示等级补充 https://jira.shanqu.cc/browse/GHZS-4384

See merge request halo/android/assistant-android!1471
2023-12-13 10:06:52 +08:00
0911cd146b Merge branch 'hotfix/v5.32.5-995/CWZS-138' into 'release'
fix:【畅玩助手】畅玩-最近在玩模块、双开按钮异常 https://jira.shanqu.cc/browse/CWZS-138

See merge request halo/android/assistant-android!1468
2023-12-13 09:34:04 +08:00
8e255b1803 fix:【畅玩助手】畅玩-最近在玩模块、双开按钮异常 https://jira.shanqu.cc/browse/CWZS-138 2023-12-13 09:34:04 +08:00
14939625dd Merge branch 'feat/GHZS-3791' into 'dev'
feat: 广告管理相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-3791

See merge request halo/android/assistant-android!1430
2023-12-13 09:31:58 +08:00
19afb7221d feat: 广告管理相关优化—客户端 https://jira.shanqu.cc/browse/GHZS-3791 2023-12-13 09:31:58 +08:00
ae0f4c948b chore: 版本更新至 5.32.5 2023-12-12 15:04:32 +08:00
d650739632 Merge branch 'feature-GHZS-sentry-20231211' into 'release'
fix: Sentry异常修复

See merge request halo/android/assistant-android!1470
2023-12-11 18:00:01 +08:00
6f6a734cb5 fix: Sentry异常修复 2023-12-11 18:00:01 +08:00
e510146775 Merge branch 'hotfix/v5.32.5-995/search_crash' into 'release'
fix: 修复点击搜索栏闪退的问题...

See merge request halo/android/assistant-android!1469
2023-12-11 10:09:01 +08:00
8b863955a3 fix: 修复点击搜索栏闪退的问题 https://sentry.shanqu.cc/organizations/lightgame/issues/350701/events/e5db556244ac4ecb93d37e7997103bf3/?environment=kuaishou&project=22 2023-12-11 10:03:02 +08:00
37155b96dd Merge branch 'hotfix/v5.32.5-995/crashes' into 'release'
修复sentry闪退问题

See merge request halo/android/assistant-android!1467
2023-12-08 14:07:02 +08:00
e55d4d3332 fix: 捕获替换Fragment关联的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/348952/events/d6c0400d0edb4ee8b302faab4707960d/?project=22&statsPeriod=14d 2023-12-08 13:50:00 +08:00
3e38830480 Merge branch 'feat/GHZS-4377' into 'dev'
feat: 游戏详情当前版本展示规则变更 https://jira.shanqu.cc/browse/GHZS-4377

See merge request halo/android/assistant-android!1466
2023-12-06 16:04:10 +08:00
dabf532ae7 feat: 游戏详情当前版本展示规则变更 https://jira.shanqu.cc/browse/GHZS-4377
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2023-12-06 15:59:10 +08:00
7aa2b20224 feat: 适龄提示等级补充 https://jira.shanqu.cc/browse/GHZS-4384
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2023-12-06 11:53:25 +08:00
10572e7b0b fix: 修复线上闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/349079/events/06d299cb0e6549a49f80cd248a91e614/?project=22 2023-12-05 14:53:00 +08:00
3912729fff Merge branch 'fix/GHZS-4364' into 'dev'
fix: 游戏下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-4364

See merge request halo/android/assistant-android!1465
2023-12-05 10:27:39 +08:00
78ff8dcb0a fix: 游戏下载按钮显示问题 https://jira.shanqu.cc/browse/GHZS-4364
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2023-12-01 16:54:40 +08:00
80e7ad9401 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-12-01 10:08:09 +08:00
a9ba7d056b Merge branch 'feat/GHZS-3983' into 'dev'
feat: 游戏下载判断逻辑优化 https://jira.shanqu.cc/browse/GHZS-3982

See merge request halo/android/assistant-android!1444
2023-11-23 16:36:23 +08:00
da4e83d29d feat: 游戏下载判断逻辑优化 https://jira.shanqu.cc/browse/GHZS-3983 2023-11-23 16:17:40 +08:00
cc9c390bbb fix: 内容触发敏感词点击还原后未正常展示 https://jira.shanqu.cc/browse/GHZS-3923
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2023-11-23 14:56:52 +08:00
d96ae0cdbb Merge branch 'chen/202311/GHZS-3800' into 'dev'
feat:搜索结果页面新增游戏首位设置—客户端 https://jira.shanqu.cc/browse/GHZS-3800

See merge request halo/android/assistant-android!1457
2023-11-23 13:37:10 +08:00
c8a1bd5278 feat:搜索结果页面新增游戏首位设置—客户端 https://jira.shanqu.cc/browse/GHZS-3800 2023-11-23 13:37:10 +08:00
aa0d36a3ba Merge branch 'feat/GHZS-3783' into 'dev'
feat: 畅玩游戏问题反馈优化—客户端 https://jira.shanqu.cc/browse/GHZS-3783

See merge request halo/android/assistant-android!1423
2023-11-23 11:47:33 +08:00
ffe1c0606a feat: 畅玩游戏问题反馈优化—客户端 https://jira.shanqu.cc/browse/GHZS-3783 2023-11-23 11:47:33 +08:00
7f73b728a5 feat: 通用链接模块新增帮助与反馈类型 https://jira.shanqu.cc/browse/GHZS-3785 2023-11-22 17:54:41 +08:00
5cfb7f5036 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	dependencies.gradle
2023-11-22 17:54:06 +08:00
399e513174 Merge branch 'feat/GHZS-3760' into 'dev'
feat: 帮助与反馈第二期迭代 https://jira.shanqu.cc/browse/GHZS-3760

See merge request halo/android/assistant-android!1424
2023-11-22 17:16:10 +08:00
1eeb34c93a Merge branch 'feature/GHZS-4272-patch' into 'dev'
fix: 内容搜索新增搜索配置(客户端)-1117测试-客户端...

See merge request halo/android/assistant-android!1450
2023-11-20 15:24:05 +08:00
d18f3909ea fix: 内容搜索新增搜索配置(客户端)-1117测试-客户端... 2023-11-20 15:24:05 +08:00
c23118e535 Merge remote-tracking branch 'origin/dev' into dev-5.33.0
# Conflicts:
#	dependencies.gradle
2023-11-20 14:41:30 +08:00
4d4498cdee Merge branch 'release' into 'dev'
chore: 版本更新至 5.32.1

See merge request halo/android/assistant-android!1448
2023-11-20 14:36:25 +08:00
a348b80eaf Merge branch 'dev' into 'dev-5.33.0'
merge dev into dev-5.33.0

See merge request halo/android/assistant-android!1447
2023-11-20 14:34:22 +08:00
64bdbbf409 Merge branch 'feature-GHZS-4272' into 'dev-5.33.0'
fix: 内容搜索新增搜索配置(客户端)-1117测试-客户端 https://jira.shanqu.cc/browse/GHZS-4272

See merge request halo/android/assistant-android!1446
2023-11-20 10:51:36 +08:00
984bb60e6a fix: 内容搜索新增搜索配置(客户端)-1117测试-客户端 https://jira.shanqu.cc/browse/GHZS-4272 2023-11-20 10:51:36 +08:00
1461af16b9 feat: 帮助与反馈第二期迭代 https://jira.shanqu.cc/browse/GHZS-3760 2023-11-15 14:14:28 +08:00
14fca95ed6 Merge branch 'feature-GHZS-3949' into 'dev-5.33.0'
fix: 内容搜索新增搜索配置(客-户-端)—1110测试-后端 https://jira.shanqu.cc/browse/GHZS-3949

See merge request halo/android/assistant-android!1442
2023-11-15 11:21:50 +08:00
c3926c85d8 fix: 内容搜索新增搜索配置(客-户-端)—1110测试-后端 https://jira.shanqu.cc/browse/GHZS-3949 2023-11-15 11:21:50 +08:00
9b73272019 Merge branch 'dev' into 'dev-5.33.0'
合并 dev 到 dev-5.33.0

See merge request halo/android/assistant-android!1443
2023-11-15 11:16:14 +08:00
5757df01e7 Merge branch 'dev-5.33.0-merged-dev' into 'dev-5.33.0'
Dev 5.33.0 merged dev

See merge request halo/android/assistant-android!1436
2023-11-10 14:12:42 +08:00
3f60f85992 Merge branch 'dev' into dev-5.33.0-merged-dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/forum/search/CommunitySearchEventListener.kt
#	app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt
#	app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt
2023-11-10 14:05:20 +08:00
52980189ed Merge branch 'chen/202310/GHZS-3730' into 'dev-5.33.0' 2023-11-09 14:01:17 +08:00
852f7734ef feat:论坛搜索排序逻辑优化—客户端 https://jira.shanqu.cc/browse/GHZS-3730 2023-11-09 14:01:17 +08:00
a25503113b Merge branch 'docs/GHZS-3866' into 'dev-5.33.0'
docs: 为首页所有现有的 ViewHolder 备注后台对应的样式名称 https://jira.shanqu.cc/browse/GHZS-3866

See merge request halo/android/assistant-android!1426
2023-11-08 18:03:38 +08:00
0d6b62b361 docs: 为首页所有现有的 ViewHolder 备注后台对应的样式名称 https://jira.shanqu.cc/browse/GHZS-3866 2023-11-08 14:34:29 +08:00
e3b8ea74c1 fix: 处理与 5.32.0 的代码冲突 2023-11-08 11:44:15 +08:00
bf10d5aa42 Merge remote-tracking branch 'origin/dev' into dev-5.33.0
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/category/CategoryDirectoryFragment.kt
#	app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListFragment.kt
#	app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListFragment.kt
#	app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListFragment.kt
#	app/src/main/res/layout/fragment_list_article_detail_comment.xml
2023-11-08 11:30:16 +08:00
3efcd71046 Merge branch 'fix/GHZS-3853' into 'dev-5.33.0'
fix: 畅玩游戏反馈优化—客户端 https://jira.shanqu.cc/browse/GHZS-3853

See merge request halo/android/assistant-android!1417
2023-11-03 16:24:53 +08:00
ce99eef958 fix: 畅玩游戏反馈优化—客户端 https://jira.shanqu.cc/browse/GHZS-3853 2023-11-03 16:17:49 +08:00
4f1ccac6fc Merge branch 'fix/GHZS-3754' into 'dev-5.33.0'
fix:【光环助手】跳转链接问题 https://jira.shanqu.cc/browse/GHZS-3754

See merge request halo/android/assistant-android!1409
2023-11-01 17:54:58 +08:00
41c8d4950f Merge branch 'merge_dev_to_dev-5.33.0' into 'dev-5.33.0'
合并 dev 变更

See merge request halo/android/assistant-android!1408
2023-11-01 17:54:46 +08:00
d633d9b37b fix:【光环助手】跳转链接问题 https://jira.shanqu.cc/browse/GHZS-3754 2023-11-01 16:36:42 +08:00
23ec072ac5 fix: 处理合并冲突 2023-11-01 15:54:12 +08:00
3f3fd1ad5f Merge branch 'dev' into merge_dev_to_dev-5.33.0
# Conflicts:
#	app/src/main/java/com/gh/common/databind/BindingAdapters.java
#	app/src/main/java/com/gh/gamecenter/cloudarchive/CloudArchiveManagerActivity.kt
#	app/src/main/java/com/gh/gamecenter/cloudarchive/CloudArchiveManagerViewModel.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersDetailReportViewHolder.kt
#	app/src/main/java/com/gh/gamecenter/gamedetail/fuli/kaifu/ServersDetailViewHolder.kt
#	app/src/main/java/com/gh/vspace/VHelper.kt
#	app/src/main/res/layout/dialog_servers_calendear_detail.xml
#	app/src/main/res/layout/dialog_servers_calendear_detail_item.xml
#	app/src/main/res/layout/dialog_servers_calendear_detail_report.xml
#	module_common/src/main/res/drawable/download_button_normal_style.xml
2023-11-01 14:47:48 +08:00
3022118445 Merge branch 'feature-GHZS-3769' into 'dev-5.33.0'
feat:更新光环编译SDK版本至 34 https://jira.shanqu.cc/browse/GHZS-3769

See merge request halo/android/assistant-android!1407
2023-10-30 18:04:17 +08:00
edf56c92d5 feat:更新光环编译SDK版本至 34 https://jira.shanqu.cc/browse/GHZS-3769 2023-10-30 18:04:17 +08:00
ad6bf59297 Merge branch 'chen/202310/GHZS-3757' into 'dev-5.33.0'
feat:统一设计规范与客户端内代码的命名 https://jira.shanqu.cc/browse/GHZS-3757

See merge request halo/android/assistant-android!1404
2023-10-25 18:01:45 +08:00
42e009b91d feat:统一设计规范与客户端内代码的命名 https://jira.shanqu.cc/browse/GHZS-3757 2023-10-25 17:37:23 +08:00
fe2d0e6a34 Merge branch 'fix/CWZS-127' into 'dev-5.33.0'
fix: 云存档使用存档流程优化—客户端(修复云存档管理页面获取存档配置失败的问题) https://jira.shanqu.cc/browse/CWZS-127

See merge request halo/android/assistant-android!1396
2023-10-23 10:04:14 +08:00
1cbfbeb118 Merge branch 'fix/CWZS-129' into 'dev-5.33.0'
fix: 游戏详情中从云存档启动游戏,缺少谷歌框架流程导致无法进入游戏—客户端 https://jira.shanqu.cc/browse/CWZS-129

See merge request halo/android/assistant-android!1395
2023-10-23 10:04:01 +08:00
d845ceb31a fix: 云存档使用存档流程优化—客户端(修复云存档管理页面获取存档配置失败的问题) https://jira.shanqu.cc/browse/CWZS-127 2023-10-23 09:48:38 +08:00
c080049322 fix: 游戏详情中从云存档启动游戏,缺少谷歌框架流程导致无法进入游戏—客户端 https://jira.shanqu.cc/browse/CWZS-129 2023-10-20 17:31:56 +08:00
820e29db23 Merge remote-tracking branch 'origin/dev' into dev-5.33.0 2023-10-20 14:28:21 +08:00
be4d464bc0 Merge branch 'dev' into 'dev-5.33.0'
Dev

See merge request halo/android/assistant-android!1392
2023-10-19 15:50:39 +08:00
e3c56fa800 Merge branch 'feat/CWZS-127' into 'dev-5.33.0'
feat: 云存档使用存档流程优化—客户端 https://jira.shanqu.cc/browse/CWZS-127

See merge request halo/android/assistant-android!1391
2023-10-19 15:30:35 +08:00
7e982e30a3 feat: 云存档使用存档流程优化—客户端 https://jira.shanqu.cc/browse/CWZS-127 2023-10-19 14:19:20 +08:00
0eae5262af Merge branch 'feat/GHZS-3622' into 'dev-5.33.0'
feat: 反馈管理新增包名屏蔽—客户端 https://jira.shanqu.cc/browse/GHZS-3622

See merge request halo/android/assistant-android!1389
2023-10-19 09:55:51 +08:00
6656cbc635 feat: 反馈管理新增包名屏蔽—客户端 https://jira.shanqu.cc/browse/GHZS-3622 2023-10-19 09:55:51 +08:00
0a6b93a8f8 chore: 版本更新至 5.33.0 2023-10-10 14:47:26 +08:00
1666 changed files with 12472 additions and 7239 deletions

View File

@ -71,7 +71,7 @@ android_build:
exit_codes: 137
only:
- dev
- dev-5.32.0
- dev-5.33.0
# 代码检查
sonarqube_analysis:
@ -102,7 +102,7 @@ sonarqube_analysis:
exit_codes: 137
only:
- dev
- dev-5.32.0
- dev-5.33.0
## 发送简易检测结果报告
send_sonar_report:
@ -120,7 +120,7 @@ send_sonar_report:
exit_codes: 137
only:
- dev
- dev-5.32.0
- dev-5.33.0
oss-upload&send-email:
tags:
@ -152,4 +152,4 @@ oss-upload&send-email:
- /usr/local/bin/python /ci-android-mail-jira-comment.py
only:
- dev
- dev-5.32.0
- dev-5.33.0

View File

@ -95,8 +95,10 @@ android {
buildConfigField "int", "ACTIVATE_REPORTING_RATIO", "${ACTIVATE_REPORTING_RATIO}"
// All third-party appid/appkey
buildConfigField "boolean", "IS_GAT_APP", "false"
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
buildConfigField "String", "NEW_API_HOST", "\"${NEW_API_HOST}\""
buildConfigField "String", "LOG_HUB_PROJECT", "\"${LOG_HUB_PROJECT}\""
buildConfigField "String", "VAPI_HOST", "\"${VAPI_HOST}\""
buildConfigField "String", "WECHAT_APPID", "\"${WECHAT_APPID}\""
buildConfigField "String", "WECHAT_SECRET", "\"${WECHAT_SECRET}\""
@ -157,7 +159,7 @@ android {
}
}
flavorDimensions("env")
flavorDimensions("env", "region")
sourceSets {
publish {
@ -175,6 +177,15 @@ android {
gdt {
java.srcDirs = ['src/main/java', 'src/gdt/java']
}
gat {
java.srcDirs = ['src/main/java', 'src/gat/java']
}
cn {
java.srcDirs = ['src/main/java', 'src/cn/java']
}
sm {
java.srcDirs = ['src/main/java', 'src/sm/java']
}
}
productFlavors {
@ -242,6 +253,37 @@ android {
buildConfigField "String", "DEV_CSJ_APPID", "\"${CSJ_APPID}\""
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
}
sm {
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}\""
buildConfigField "String", "DEV_CSJ_APPID", "\"${CSJ_APPID}\""
buildConfigField "String", "CSJ_APPID", "\"${CSJ_APPID}\""
}
// 港澳台
gat {
dimension "region"
applicationId rootProject.ext.applicationIdGat
// 支持繁体
resConfigs "zh", "zh-rTW"
buildConfigField "boolean", "IS_GAT_APP", "true"
buildConfigField "String", "LOG_HUB_PROJECT", "\"${LOG_HUB_PROJECT_GAT}\""
buildConfigField "String", "API_HOST", "\"${API_HOST_GAT}\""
buildConfigField "String", "NEW_API_HOST", "\"${NEW_API_HOST_GAT}\""
}
cn {
dimension "region"
}
}
}
@ -258,6 +300,7 @@ dependencies {
teaImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/tea/libs')
kuaishouImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/kuaishou/libs')
gdtImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/gdt/libs')
smImplementation fileTree(include: ['*.jar', '*.aar'], dir: 'src/sm/libs')
testImplementation 'junit:junit:4.12'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakcanary}"

View File

@ -88,6 +88,9 @@
-keep class com.qq.gdt.action.** {*;}
-keep public class com.tencent.turingfd.sdk.**
### 神马 SDK
-dontwarn com.gism.**
-keepclasseswithmembers class * {
native <methods>;
}

View File

@ -5,6 +5,7 @@ import com.lightgame.utils.Utils
import com.qq.gdt.action.ActionParam
import com.qq.gdt.action.ActionType
import com.qq.gdt.action.GDTAction
import com.qq.gdt.action.PrivateController
import org.json.JSONObject
object GdtHelper {
@ -16,6 +17,12 @@ object GdtHelper {
@JvmStatic
fun init(application: Application, channel: String) {
GDTAction.setPrivateController(object : PrivateController() {
override fun isCanUsePhoneState(): Boolean {
return false
}
})
if (channel == "KS_GDT_GHZS_MC01") {
GDTAction.init(application, KS_USER_ACTION_SET_ID, KS_APP_SECRET_ID, channel)
} else {

View File

@ -67,7 +67,7 @@ class InstallExternalGameFragment : ToolbarFragment(), OnItemClickListener {
it.layoutManager = LinearLayoutManager(requireContext())
val itemDecoration = HorizontalDividerItemDecoration.Builder(requireContext())
.size(2F.dip2px())
.color(R.color.divider.toColor(requireContext()))
.color(R.color.ui_divider.toColor(requireContext()))
.build()
if (it.itemDecorationCount != 0) {
it.removeItemDecorationAt(0)

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="title_install_external_game">從SD卡安裝</string>
<string name="text_install">安裝</string>
<string name="text_uninstall">卸載</string>
<string name="text_start">啟動</string>
</resources>

Binary file not shown.

View File

@ -99,6 +99,9 @@
android:name="android.permission.GET_TASKS"
tools:node="remove" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
tools:node="remove"/>
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
@ -771,6 +774,10 @@
android:name="com.gh.gamecenter.UserAuthActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.SplashAdActivity"
android:screenOrientation="portrait" />
<!-- <activity-->
<!-- android:name="${applicationId}.douyinapi.DouYinEntryActivity"-->
@ -826,6 +833,8 @@
<!-- tools:node="remove" />-->
<!-- </provider>-->
<service android:name = "com.gh.gamecenter.install.InstallService" />
<receiver
android:name="com.gh.gamecenter.receiver.DownloadReceiver"
android:exported="false">

View File

@ -17,6 +17,7 @@ import com.gh.common.exposure.ExposureManager
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils.logOpenScreenAdSkip
import com.gh.common.util.PackageUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.R
@ -66,6 +67,7 @@ object AdDelegateHelper {
private const val AD_SDK_CSJ = "穿山甲"
private const val AD_SDK_BEIZI = "倍孜"
const val AD_TYPE_SDK = "third_party_ads" // 第三方 SDK 广告
const val AD_TYPE_OWNER = "owner_ads" // 自有广告
private const val KEY_CACHE_CONFIG = "cache_config" // 放在 SP 里的广告缓存(避免接口加载问题)
@ -73,6 +75,7 @@ object AdDelegateHelper {
HaloApp.getInstance().getSharedPreferences("AdConfig", Context.MODE_PRIVATE)
}
var isShowingSplashAd = false // 是否正在显示开屏广告
var gameSearchKeyword = ""
fun initAdSdk(context: Context) {
@ -174,9 +177,99 @@ object AdDelegateHelper {
/**
* 是否需要显示开屏广告
* @param isHotLaunch 是否为热启动
*/
fun shouldShowStartUpAd(): Boolean {
fun shouldShowStartUpAd(isHotLaunch: Boolean): Boolean {
return mSplashAd != null
&& !isShowingSplashAd
&& (!isHotLaunch || shouldShowStartUpAdWhenHotLaunch())
&& !isMatchAdFreeRule(mSplashAd)
&& isMatchStartUpAdDisplayRule()
}
/**
* 热启动是否需要显示开屏广告
*/
private fun shouldShowStartUpAdWhenHotLaunch() = mSplashAd?.displayRule?.hotStartSplashAd?.type == AD_TYPE_SDK
/**
* 是否需要显示下载管理广告
*/
fun shouldShowDownloadManagerAd(): Boolean {
return mDownloadManagerAd != null && !isMatchAdFreeRule(mDownloadManagerAd) && isMatchDownloadManagerAdDisplayRule()
}
/**
* 是否需要显示游戏搜索广告
*/
fun shouldShowGameSearchAd(adConfig: AdConfig): Boolean {
return !isMatchAdFreeRule(adConfig) && isMatchGameSearchAdDisplayRule(adConfig)
}
/**
* 是否在免广告时长内
*/
private fun isMatchAdFreeRule(adConfig: AdConfig?): Boolean {
adConfig?.displayRule?.run {
if (adFreeDuration > 0) {
val ghInstalledDurationInHours = (System.currentTimeMillis() - PackageUtils.getInstalledTime(
HaloApp.getInstance(),
BuildConfig.APPLICATION_ID
)).toFloat() / 1000 / 3600
return ghInstalledDurationInHours < adFreeDuration
} else {
return false
}
}
return false
}
/**
* 是否大于开屏广告展示间隔时长
*/
private fun isMatchStartUpAdDisplayRule(): Boolean {
mSplashAd?.displayRule?.run {
if (adDisplayInterval > 0) {
val lastShowTime = SPUtils.getLong(Constants.SP_LAST_SPLASH_AD_SHOW_TIME, 0L)
val durationInMinutes = (System.currentTimeMillis() - lastShowTime).toFloat() / 1000 / 60
return durationInMinutes > adDisplayInterval
} else {
return true
}
}
return true
}
/**
* 是否大于广告管理展示间隔时长
*/
private fun isMatchDownloadManagerAdDisplayRule(): Boolean {
mDownloadManagerAd?.displayRule?.run {
if (adDisplayInterval > 0) {
val lastShowTime = SPUtils.getLong(Constants.SP_LAST_DOWNLOAD_MANAGER_AD_SHOW_TIME, 0L)
val durationInMinutes = (System.currentTimeMillis() - lastShowTime).toFloat() / 1000 / 60
return durationInMinutes > adDisplayInterval
} else {
return true
}
}
return true
}
/**
* 是否大于游戏搜索展示间隔时长
*/
private fun isMatchGameSearchAdDisplayRule(adConfig: AdConfig?): Boolean {
adConfig?.displayRule?.run {
if (adDisplayInterval > 0) {
val lastShowTime = SPUtils.getLong(Constants.SP_LAST_GAME_SEARCH_AD_SHOW_TIME + adConfig.position, 0L)
val durationInMinutes = (System.currentTimeMillis() - lastShowTime).toFloat() / 1000 / 60
return durationInMinutes > adDisplayInterval
} else {
return true
}
}
return true
}
/**
@ -200,54 +293,124 @@ object AdDelegateHelper {
sdkStartAdContainer: ViewGroup,
adsViewGroup: FrameLayout,
handler: BaseActivity.BaseHandler,
hideCallback: () -> Unit
isHotLaunch: Boolean,
hideAction: () -> Unit
) {
val hideCallback = {
isShowingSplashAd = false
hideAction.invoke()
}
if (mSplashAd != null) {
if (mSplashAd!!.displayRule.adSource == AD_TYPE_SDK) {
// 第三方开屏广告回调,失败时根据接口配置选项决定是否显示自有开屏广告
val sdkSplashCallback: (isSuccess: Boolean) -> Unit = { isSuccess ->
if (isSuccess) {
hideCallback.invoke()
} else {
if (mSplashAd?.displayRule?.onFailedAction == "show") {
sdkStartAdContainer.visibility = View.GONE
requestStandardSplashAd(
mSplashAd!!.ownerAd?.startAd,
startAdContainer,
handler,
hideCallback
)
} else {
hideCallback.invoke()
}
}
}
// 第三方广告的数据为空,按加载失败处理
if (mSplashAd?.thirdPartyAd == null) {
sdkSplashCallback.invoke(false)
return
}
if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_BEIZI) {
sdkStartAdContainer.visibility = View.VISIBLE
requestBeiziSplashAd(sdkStartAdContainer, adsViewGroup, adViewWidthInPx, adViewHeightInPx, sdkSplashCallback)
} else if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_CSJ) {
sdkStartAdContainer.visibility = View.VISIBLE
requestCsjSplashAd(
when (if (isHotLaunch) mSplashAd!!.displayRule.hotStartSplashAd?.type else mSplashAd!!.displayRule.adSource) {
AD_TYPE_SDK -> {
isShowingSplashAd = true
requestThirdPartySplashAd(
activity,
mSplashAd?.thirdPartyAd?.slotId ?: "unknown",
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,
adViewHeightInDp,
startAdContainer,
sdkStartAdContainer,
sdkSplashCallback
adsViewGroup,
handler,
isHotLaunch,
hideCallback
)
}
AD_TYPE_OWNER -> {
isShowingSplashAd = true
requestStandardSplashAd(
activity,
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,
adViewHeightInDp,
startAdContainer,
sdkStartAdContainer,
adsViewGroup,
handler,
isHotLaunch,
hideCallback
)
}
} else {
requestStandardSplashAd(mSplashAd!!.ownerAd?.startAd, startAdContainer, handler, hideCallback)
}
} else {
hideCallback.invoke()
}
}
/**
* 获取第三方开屏广告
*/
private fun requestThirdPartySplashAd(
activity: Activity,
adViewWidthInPx: Int,
adViewHeightInPx: Int,
adViewWidthInDp: Float,
adViewHeightInDp: Float,
startAdContainer: ViewGroup,
sdkStartAdContainer: ViewGroup,
adsViewGroup: FrameLayout,
handler: BaseActivity.BaseHandler,
isHotLaunch: Boolean,
hideCallback: () -> Unit
) {
val timeout = if (isHotLaunch) {
((mSplashAd!!.displayRule.hotStartSplashAd?.timeout ?: 3.5F) * 1000).toInt()
} else {
(mSplashAd!!.displayRule.timeout * 1000).toInt()
}
// 第三方开屏广告回调,失败时根据接口配置选项决定是否显示自有开屏广告
val sdkSplashCallback: (isSuccess: Boolean) -> Unit = { isSuccess ->
if (isSuccess) {
hideCallback.invoke()
SPUtils.setLong(Constants.SP_LAST_SPLASH_AD_SHOW_TIME, System.currentTimeMillis())
} else {
if (mSplashAd?.displayRule?.adSource == AD_TYPE_SDK && mSplashAd?.displayRule?.onFailedAction == "show" && !isHotLaunch) {
sdkStartAdContainer.visibility = View.GONE
requestStandardSplashAd(
activity,
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,
adViewHeightInDp,
startAdContainer,
sdkStartAdContainer,
adsViewGroup,
handler,
isHotLaunch,
hideCallback
)
} else {
hideCallback.invoke()
}
}
}
// 第三方广告的数据为空,按加载失败处理
if (mSplashAd?.thirdPartyAd == null) {
sdkSplashCallback.invoke(false)
return
}
if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_BEIZI) {
sdkStartAdContainer.visibility = View.VISIBLE
requestBeiziSplashAd(sdkStartAdContainer, adsViewGroup, adViewWidthInPx, adViewHeightInPx, timeout.toLong(), sdkSplashCallback)
} else if (mSplashAd?.thirdPartyAd?.sourceName == AD_SDK_CSJ) {
sdkStartAdContainer.visibility = View.VISIBLE
requestCsjSplashAd(
activity,
mSplashAd?.thirdPartyAd?.slotId ?: "unknown",
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,
adViewHeightInDp,
sdkStartAdContainer,
timeout,
sdkSplashCallback
)
}
}
@ -262,6 +425,7 @@ object AdDelegateHelper {
adViewWidthInDp: Float,
adViewHeightInDp: Float,
startAdContainer: ViewGroup,
timeout: Int,
callback: (isSuccess: Boolean) -> Unit,
) {
if (mCsjAdImpl == null) {
@ -275,6 +439,7 @@ object AdDelegateHelper {
adViewWidthInDp,
adViewHeightInDp,
startAdContainer,
timeout,
callback,
)
}
@ -288,12 +453,13 @@ object AdDelegateHelper {
adsFl: FrameLayout,
adViewWidthInPx: Int,
adViewHeightInPx: Int,
timeout: Long,
callback: (isSuccess: Boolean) -> Unit,
) {
if (mBeiziAdImpl == null) {
callback.invoke(false)
} else {
mBeiziAdImpl?.requestSplashAd(startAdContainer, adsFl, adViewWidthInPx, adViewHeightInPx, callback)
mBeiziAdImpl?.requestSplashAd(startAdContainer, adsFl, adViewWidthInPx, adViewHeightInPx, timeout, callback)
}
}
@ -301,13 +467,41 @@ object AdDelegateHelper {
* 显示自有的开屏广告
*/
private fun requestStandardSplashAd(
splashAd: StartupAdEntity?,
activity: Activity,
adViewWidthInPx: Int,
adViewHeightInPx: Int,
adViewWidthInDp: Float,
adViewHeightInDp: Float,
startAdContainer: ViewGroup,
sdkStartAdContainer: ViewGroup,
adsViewGroup: FrameLayout,
handler: BaseActivity.BaseHandler,
isHotLaunch: Boolean,
hideCallback: () -> Unit
) {
val splashAd = mSplashAd?.ownerAd?.startAd
val onEmptyCallback = {
if (mSplashAd?.displayRule?.adSource == AD_TYPE_OWNER && mSplashAd?.displayRule?.onFailedAction == "show" && mSplashAd?.thirdPartyAd != null) {
// 自有广告为空时,显示第三方广告
requestThirdPartySplashAd(
activity,
adViewWidthInPx,
adViewHeightInPx,
adViewWidthInDp,
adViewHeightInDp,
startAdContainer,
sdkStartAdContainer,
adsViewGroup,
handler,
isHotLaunch,
hideCallback
)
} else {
hideCallback.invoke()
}
}
if (splashAd == null) {
hideCallback.invoke()
onEmptyCallback.invoke()
return
}
@ -320,7 +514,7 @@ object AdDelegateHelper {
) {
showStandardSplashAd(splashAd, startAdContainer, handler, hideCallback)
} else {
hideCallback.invoke()
onEmptyCallback.invoke()
}
"everyday" -> {
@ -331,7 +525,7 @@ object AdDelegateHelper {
) {
showStandardSplashAd(splashAd, startAdContainer, handler, hideCallback)
} else {
hideCallback.invoke()
onEmptyCallback.invoke()
}
}
@ -394,6 +588,7 @@ object AdDelegateHelper {
} else {
LogUtils.logStartAd("start_ads", ad)
}
SPUtils.setLong(Constants.SP_LAST_SPLASH_AD_SHOW_TIME, System.currentTimeMillis())
handler.sendEmptyMessageDelayed(MainActivity.COUNTDOWN_AD, 1000)
}

View File

@ -233,7 +233,7 @@ 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.setEditorBackgroundColor(R.color.ui_surface.toColor(this))
mRichEditor.setEditorFontColor(if (mIsDarkModeOn) Color.parseColor("#C2C2C2") else Color.parseColor("#4A4A4A"))
// 防止个别手机在Js里无法获取粘贴内容
mRichEditor.addJavascriptInterface(OnPasteListener(), "onPasteListener")
@ -797,9 +797,9 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
mRichEditor.enableForceDark(DarkModeUtils.isDarkModeOn(this))
mRichEditor.setEditorBackgroundColor(R.color.background_white.toColor(this))
mRichEditor.setEditorBackgroundColor(R.color.ui_surface.toColor(this))
mRichEditor.setEditorFontColor(if (mIsDarkModeOn) Color.parseColor("#C2C2C2") else Color.parseColor("#4A4A4A"))
}

View File

@ -4,11 +4,13 @@ import android.app.Activity
import android.app.Application
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.gh.ad.AdDelegateHelper
import com.gh.common.util.FloatingBackViewManager
import com.gh.common.xapk.XapkInstaller
import com.gh.download.DownloadManager
import com.gh.gamecenter.SingletonWebActivity
import com.gh.gamecenter.SkipActivity
import com.gh.gamecenter.SplashAdActivity
import com.gh.gamecenter.SplashScreenActivity
import com.gh.gamecenter.authorization.AuthorizationActivity
import com.gh.gamecenter.common.base.GlobalActivityManager
@ -18,6 +20,8 @@ import com.halo.assistant.HaloApp
// TODO移动到对应的模块
class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
private var isFromBackgroundToForeground = false // 是否后台回到前台
private var activityCount = 0
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
// do nothing
@ -25,6 +29,19 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
override fun onActivityStarted(activity: Activity) {
GlobalActivityManager.currentActivity = activity
activityCount ++
if (activityCount == 1 && isFromBackgroundToForeground) {
if (AdDelegateHelper.shouldShowStartUpAd(true)
&& !HaloApp.getInstance().isSkippingThirdParty
&& activity !is SplashScreenActivity
&& activity !is SkipActivity
&& activity !is AuthorizationActivity
&& activity !is SplashAdActivity
) {
activity.startActivity(SplashAdActivity.getIntent(activity))
}
isFromBackgroundToForeground = false
}
}
override fun onActivityResumed(activity: Activity) {
@ -74,7 +91,8 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
}
override fun onActivityStopped(activity: Activity) {
// do nothing
activityCount --
isFromBackgroundToForeground = activityCount <= 0
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {

View File

@ -11,7 +11,8 @@ class CheckStoragePermissionHandler : DownloadChainHandler() {
context,
gameEntity.id,
gameEntity.name ?: "",
gameEntity.categoryChinese
gameEntity.categoryChinese,
gameEntity.getApk().firstOrNull()?.format,
) {
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity, asVGame)

View File

@ -1,16 +1,25 @@
package com.gh.common.chain
import android.app.Activity
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.TempCertificationUtils
import com.gh.gamecenter.feature.entity.GameEntity
class LandPageAddressHandler : DownloadChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity, asVGame: Boolean) {
if (gameEntity.isLandPageAddressDialog()) {
DialogUtils.showLandPageAddressDialog(context, gameEntity) {// 跳转第三方落地页
DirectUtils.directToExternalBrowser(context, gameEntity.landPageAddressDialog!!.link!!)
TempCertificationUtils.checkCertificationBeforeAction(gameEntity) {
if (context is Activity && context.isFinishing) {
// 当前 context 已经无效,不需要再传递执行下去了
return@checkCertificationBeforeAction
}
DialogUtils.showLandPageAddressDialog(context, gameEntity) {// 跳转第三方落地页
DirectUtils.directToExternalBrowser(context, gameEntity.landPageAddressDialog!!.link!!)
}
}
} else {
if (hasNext()) {

View File

@ -1,18 +1,27 @@
package com.gh.common.chain
import android.app.Activity
import android.content.Context
import com.gh.common.util.DialogUtils
import com.gh.common.util.TempCertificationUtils
import com.gh.gamecenter.feature.entity.GameEntity
class OverseaDownloadHandler : DownloadChainHandler() {
override fun handleRequest(context: Context, gameEntity: GameEntity, asVGame: Boolean) {
if (gameEntity.isOverseaAddressDialog()) {
DialogUtils.showOverseaDownloadDialog(context, gameEntity) {// 跳转海外下载地址弹窗
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity, asVGame)
} else {
processEndCallback?.invoke(asVGame, null)
TempCertificationUtils.checkCertificationBeforeAction(gameEntity) {
if (context is Activity && context.isFinishing) {
// 当前 context 已经无效,不需要再传递执行下去了
return@checkCertificationBeforeAction
}
DialogUtils.showOverseaDownloadDialog(context, gameEntity) {// 跳转海外下载地址弹窗
if (hasNext()) {
getNext()?.handleRequest(context, gameEntity, asVGame)
} else {
processEndCallback?.invoke(asVGame, null)
}
}
}
} else {

View File

@ -29,6 +29,7 @@ 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.feature.utils.ContentBlockedHelper;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.vspace.VHelper;
import com.halo.assistant.HaloApp;
@ -460,6 +461,11 @@ public class Config {
DarkModeUtils.INSTANCE.initDarkMode();
}
SPUtils.setString(Constants.SP_NEW_API_SETTINGS, GsonUtils.toJson(data));
// 刷新屏蔽字段
if (mNewApiSettingsEntity.getGameShieldContents() != null) {
ContentBlockedHelper.INSTANCE.init(mNewApiSettingsEntity.getGameShieldContents());
}
}
});
}

View File

@ -120,13 +120,13 @@ object AddKaiFuBindingAdapter {
@BindingAdapter("kaiFuTextColor", "kaiFuTextPosition")
fun kaiFuTextColor(view: EditText, dataMark: Int, position: Int) {
if (dataMark == 1 && view.id == R.id.kaifu_add_time || dataMark == 2 && view.id == R.id.kaifu_add_first_name || dataMark == 3 && view.id == R.id.kaifu_add_server_name || dataMark == 4) {
view.setTextColor(ContextCompat.getColor(view.context, R.color.theme_red))
view.setHintTextColor(ContextCompat.getColor(view.context, R.color.theme_red))
view.setTextColor(ContextCompat.getColor(view.context, R.color.secondary_red))
view.setHintTextColor(ContextCompat.getColor(view.context, R.color.secondary_red))
} else if (position == 0) {
view.setTextColor(ContextCompat.getColor(view.context, R.color.hint))
view.setHintTextColor(ContextCompat.getColor(view.context, R.color.hint))
} else {
view.setTextColor(ContextCompat.getColor(view.context, R.color.text_title))
view.setTextColor(ContextCompat.getColor(view.context, R.color.text_primary))
view.setHintTextColor(ContextCompat.getColor(view.context, R.color.hint))
}
}

View File

@ -49,7 +49,7 @@ class ApplyModeratorDialogFragment : BaseDialogFragment() {
requireContext(),
startText.length,
startText.length + mGroupNumber.length,
R.color.theme_font,
R.color.text_theme,
true
) {
DirectUtils.directToQqGroup(

View File

@ -60,7 +60,7 @@ class GameOffServiceDialogFragment : BaseDialogFragment() {
if (index == notEmptySite.size - 1) bottomMargin = 8F.dip2px()
}
siteTv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14F)
siteTv.setTextColor(R.color.theme_font.toColor(requireContext()))
siteTv.setTextColor(R.color.text_theme.toColor(requireContext()))
siteTv.text = site.text
siteTv.paintFlags = siteTv.paintFlags or Paint.UNDERLINE_TEXT_FLAG
siteTv.setOnClickListener {

View File

@ -76,7 +76,7 @@ class NewPrivacyPolicyDialogFragment : BaseDialogFragment() {
contentText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.color = ContextCompat.getColor(requireContext(), R.color.text_theme)
ds.isUnderlineText = false
}

View File

@ -125,7 +125,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
requireContext(),
0,
(link.title ?: "").length,
R.color.theme_font,
R.color.text_theme,
true
) {
LogUtils.uploadPackageCheck(
@ -391,10 +391,10 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
val isAllInstalled = checkDetectionsInstalled(mAllInstalledPackages, entity.packages)
if (isAllInstalled) {
holder.binding.statusTv.text = "已安装"
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font))
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.text_theme))
} else {
holder.binding.statusTv.text = "未安装"
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.theme_red))
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, R.color.secondary_red))
}
holder.binding.statusTv.visibility = View.VISIBLE
} else {

View File

@ -59,7 +59,7 @@ class PrivacyPolicyDialogFragment : BaseDialogFragment() {
skipText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.color = ContextCompat.getColor(requireContext(), R.color.text_theme)
ds.isUnderlineText = false
}
@ -101,7 +101,7 @@ class PrivacyPolicyDialogFragment : BaseDialogFragment() {
skipText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.color = ContextCompat.getColor(requireContext(), R.color.text_theme)
ds.isUnderlineText = false
}
@ -115,7 +115,7 @@ class PrivacyPolicyDialogFragment : BaseDialogFragment() {
skipText.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = ContextCompat.getColor(requireContext(), R.color.theme_font)
ds.color = ContextCompat.getColor(requireContext(), R.color.text_theme)
ds.isUnderlineText = false
}

View File

@ -82,4 +82,8 @@ class AppProviderImpl : IAppProvider {
override fun getIsBrandNewInstall(): Boolean {
return HaloApp.getInstance().isBrandNewInstall
}
override fun setSkippingThirdParty(isSkippingThirdParty: Boolean) {
HaloApp.getInstance().isSkippingThirdParty = isSkippingThirdParty
}
}

View File

@ -19,6 +19,7 @@ class BuildConfigImpl : IBuildConfigProvider {
override fun getExposureVersion(): String = BuildConfig.EXPOSURE_VERSION
override fun isDebug(): Boolean = BuildConfig.DEBUG
override fun isGATApp(): Boolean = BuildConfig.IS_GAT_APP
override fun getApiHost(): String = BuildConfig.API_HOST
@ -31,4 +32,5 @@ class BuildConfigImpl : IBuildConfigProvider {
override fun getVApiHost(): String = BuildConfig.VAPI_HOST
override fun getVDevApiHost(): String = BuildConfig.DEV_VAPI_HOST
override fun getLogProducerProject(): String = BuildConfig.LOG_HUB_PROJECT
}

View File

@ -9,8 +9,8 @@ import com.gh.gamecenter.core.provider.IGameSubstituteRepositoryProvider
@Route(path = RouteConsts.provider.gameSubstituteRepository, name = "GameSubstituteRepositoryHelper暴露服务")
class GameSubstituteRepositoryProviderImpl : IGameSubstituteRepositoryProvider {
override fun updateSubstitutableGames() {
GameSubstituteRepositoryHelper.updateSubstitutableGames()
override fun updateHistoricInstalledGameSet() {
GameSubstituteRepositoryHelper.updateHistoricInstalledGameSet()
}
override fun init(context: Context?) {

View File

@ -3,7 +3,8 @@ 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.gamecenter.feature.entity.InstallGameEntity
import com.gh.gamecenter.feature.provider.IVHelperProvider
import com.gh.vspace.VHelper
@Route(path = RouteConsts.provider.vhelper, name = "VHelper暴露服务")
@ -12,6 +13,14 @@ class VHelperProviderImpl: IVHelperProvider {
return VHelper.isVGameOn()
}
override fun getAllInstalledVGameEntity(): ArrayList<InstallGameEntity> {
return VHelper.getAllInstalledVGameEntity()
}
override fun launch(context: Context, packageName: String, ignoreGApps: Boolean, showLoading: Boolean) {
VHelper.launch(context, packageName, ignoreGApps, showLoading)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -91,7 +91,7 @@ object NewSimulatorGameManager {
},
uiModificationCallback = { binding ->
binding.contentTv.gravity = Gravity.START
binding.contentTv.setTextColor(R.color.text_subtitle.toColor(context))
binding.contentTv.setTextColor(R.color.text_secondary.toColor(context))
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)

View File

@ -395,7 +395,7 @@ class SimulatorDownloadManager private constructor() {
ToastUtils.showToast("该模拟器暂未提供下载")
},
uiModificationCallback = { binding ->
binding.confirmTv.setTextColor(R.color.text_body.toColor(context))
binding.confirmTv.setTextColor(R.color.text_instance.toColor(context))
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
@ -420,7 +420,7 @@ class SimulatorDownloadManager private constructor() {
DownloadStatus.diskioerror,
DownloadStatus.diskisfull -> {
DownloadManager.getInstance().addObserver(dataWatcher)
uiExecutor.executeWithDelay(Runnable { DownloadManager.getInstance().resume(entity, true) }, 200)
uiExecutor.executeWithDelay(Runnable { DownloadManager.getInstance().resume(entity, false) }, 200)
SensorsBridge.trackSimulatorDownloadDialogShow(
gameId = gameId,
gameName = gameName,

View File

@ -9,6 +9,7 @@ import androidx.fragment.app.Fragment
import com.gh.download.simple.AutoUnregisteredSimpleDownloadListener
import com.gh.download.simple.DownloadListener
import com.gh.gamecenter.R
import com.gh.gamecenter.cloudarchive.BaseCloudArchiveViewModel
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.runOnUiThread
@ -36,6 +37,7 @@ object ArchiveDownloadButtonHelper {
entrance: String,
fragment: Fragment,
packageName: String,
viewModel: BaseCloudArchiveViewModel,
archiveEntity: ArchiveEntity,
downloadBtn: TextView,
gameEntity: GameEntity?,
@ -60,19 +62,23 @@ object ArchiveDownloadButtonHelper {
}
}
// 检查本地是否已下载存档
VArchiveHelper.isArchiveDownloaded(archiveEntity.md5) -> showApplyArchiveTipDialog(
context,
entrance,
packageName,
archiveEntity,
gameEntity
)
VArchiveHelper.isArchiveDownloaded(archiveEntity.md5) -> viewModel.getArchiveConfigString {
showApplyArchiveTipDialog(
context,
entrance,
packageName,
it,
archiveEntity,
gameEntity
)
}
// 检查完毕下载存档
else -> downloadArchive(
context,
entrance,
fragment,
packageName,
viewModel,
archiveEntity,
downloadBtn,
gameEntity,
@ -125,6 +131,7 @@ object ArchiveDownloadButtonHelper {
context: Context,
entrance: String,
packageName: String,
config: String,
archiveEntity: ArchiveEntity,
gameEntity: GameEntity?
) {
@ -135,7 +142,7 @@ object ArchiveDownloadButtonHelper {
.subscribeOn(Schedulers.io())
.subscribe()
VArchiveHelper.applyGameArchive(context, packageName, this) { packageName, isSuccess ->
VArchiveHelper.applyGameArchive(context, packageName, config, this) { packageName, isSuccess ->
runOnUiThread {
if (isSuccess) {
VHelper.launch(context, packageName)
@ -161,6 +168,7 @@ object ArchiveDownloadButtonHelper {
entrance: String,
fragment: Fragment,
packageName: String,
viewModel: BaseCloudArchiveViewModel,
archiveEntity: ArchiveEntity,
downloadBtn: TextView,
gameEntity: GameEntity?,
@ -197,7 +205,9 @@ object ArchiveDownloadButtonHelper {
DownloadStatus.COMPLETED -> {
dismissArchiveLoadingDialog(archiveLoadingDialog)
downloadBtn.text = R.string.archive_apply.toResString()
showApplyArchiveTipDialog(context, entrance, packageName, archiveEntity, gameEntity)
viewModel.getArchiveConfigString {
showApplyArchiveTipDialog(context, entrance, packageName, it, archiveEntity, gameEntity)
}
downloadCompletedListener?.invoke()
}
else -> {
@ -251,43 +261,46 @@ object ArchiveDownloadButtonHelper {
context: Context,
entrance: String,
packageName: String,
config: String,
archiveEntity: ArchiveEntity,
gameEntity: GameEntity?
) {
DialogHelper.showDialog(
context,
R.string.archive_dialog_title.toResString(),
R.string.archive_apply_dialog_content.toResString(),
R.string.archive_apply.toResString(),
R.string.cancel.toResString(),
{
applyArchive(context, entrance, packageName, archiveEntity, gameEntity)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "使用")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogClick",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: "",
"button_name", "使用"
)
},
{
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "取消")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogClick",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: "",
"button_name", "取消"
)
},
extraConfig = DialogHelper.Config(centerTitle = true)
)
runOnUiThread {
DialogHelper.showDialog(
context,
R.string.archive_dialog_title.toResString(),
R.string.archive_apply_dialog_content.toResString(),
R.string.archive_apply.toResString(),
R.string.cancel.toResString(),
{
applyArchive(context, entrance, packageName, config, archiveEntity, gameEntity)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "使用")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogClick",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: "",
"button_name", "使用"
)
},
{
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_click", "取消")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogClick",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: "",
"button_name", "取消"
)
},
extraConfig = DialogHelper.Config(centerTitle = true)
)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_show")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogShow",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: ""
)
NewFlatLogUtils.logCloudArchiveApplyDialogRelated("cloud_save_overwrite_dialog_show")
SensorsBridge.trackEvent(
"CloudSaveOverwriteDialogShow",
"game_id", gameEntity?.id ?: "",
"game_name", gameEntity?.name ?: ""
)
}
}
private fun dismissArchiveLoadingDialog(archiveLoadingDialog: Dialog) {

View File

@ -64,7 +64,7 @@ object BbsReportHelper {
this,
1f,
false,
R.color.background
R.color.ui_background
)
)
binding.reasonRv.adapter = reportReasonAdapter
@ -94,7 +94,7 @@ object BbsReportHelper {
binding.otherReasonEt.doOnTextChanged { text, start, before, count ->
val tvCount: Int = text.toString().length
if (tvCount >= 500) {
binding.tvCount.setTextColor(R.color.theme_red.toColor(binding.tvCount.context))
binding.tvCount.setTextColor(R.color.secondary_red.toColor(binding.tvCount.context))
}
binding.tvCount.text = "$tvCount/500"
}

View File

@ -198,7 +198,7 @@ public class CommentUtils {
LinearLayout container = new LinearLayout(context);
container.setOrientation(LinearLayout.VERTICAL);
container.setPadding(0, DisplayUtils.dip2px(context, 12), 0, DisplayUtils.dip2px(context, 12));
container.setBackgroundColor(ContextCompat.getColor(context, R.color.background_white));
container.setBackgroundColor(ContextCompat.getColor(context, R.color.ui_surface));
for (final String s : arrReportType) {
TextView reportTypeTv = new TextView(context);
@ -248,12 +248,12 @@ public class CommentUtils {
public static void postVote(final Context context, final CommentEntity commentEntity,
final TextView commentLikeCountTv, final ImageView commentLikeIv,
final OnVoteListener listener) {
if (commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(context, R.color.theme_font)) {
if (commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(context, R.color.text_theme)) {
ToastUtils.INSTANCE.showToast("已经点过赞啦!");
return;
}
commentEntity.setVote(commentEntity.getVote() + 1);
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.text_theme));
commentLikeIv.setImageResource(R.drawable.comment_vote_select);
commentLikeCountTv.setText(NumberUtils.transSimpleCount(commentEntity.getVote()));
commentLikeCountTv.setVisibility(View.VISIBLE);
@ -318,12 +318,12 @@ public class CommentUtils {
entrance = "视频流-评论-点赞";
}
CheckLoginUtils.checkLogin(context, entrance, () -> {
if (commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(context, R.color.theme_font)) {
if (commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(context, R.color.text_theme)) {
ToastUtils.INSTANCE.showToast("已经点过赞啦!");
return;
}
commentEntity.setVote(commentEntity.getVote() + 1);
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.text_theme));
commentLikeIv.setImageResource(R.drawable.comment_vote_select);
commentLikeCountTv.setText(NumberUtils.transSimpleCount(commentEntity.getVote()));
commentLikeCountTv.setVisibility(View.VISIBLE);
@ -444,7 +444,7 @@ public class CommentUtils {
public void onFailure(@Nullable HttpException e) {
super.onFailure(e);
commentEntity.setVote(commentEntity.getVote() + 1);
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font));
commentLikeCountTv.setTextColor(ContextCompat.getColor(context, R.color.text_theme));
commentLikeIv.setImageResource(R.drawable.comment_vote_select);
commentLikeCountTv.setText(NumberUtils.transSimpleCount(commentEntity.getVote()));
commentLikeCountTv.setVisibility(View.VISIBLE);
@ -502,7 +502,7 @@ public class CommentUtils {
holder.commentLikeCountTv.setVisibility(View.GONE);
} else { // 检查是否已点赞
if (userDataEntity != null && (userDataEntity.isCommentVoted())) {
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.theme_font));
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_theme));
holder.commentLikeIv.setImageResource(R.drawable.comment_vote_select);
}
holder.commentLikeCountTv.setVisibility(View.VISIBLE);

View File

@ -125,8 +125,6 @@ public class DataUtils {
HaloApp.getInstance().setGid(gid);
SensorsBridge.setGid(gid);
// 更新广告配置
ExtensionsKt.doOnMainProcessOnly(HaloApp.getInstance(), () -> {
AdDelegateHelper.INSTANCE.requestAdConfig(false, "", null);
@ -134,7 +132,7 @@ public class DataUtils {
// 避免重复调用
if (!TextUtils.isEmpty(gid)) {
GameSubstituteRepositoryHelper.updateSubstitutableGames();
GameSubstituteRepositoryHelper.updateHistoricInstalledGameSet();
}
getDeviceCertification(gid);
@ -180,9 +178,11 @@ public class DataUtils {
if (idCardEntity != null) {
boolean isCertificated = !TextUtils.isEmpty(data.getIdCard().getId());
boolean isAdult = data.getIdCard().getMinor() == null || !data.getIdCard().getMinor();
boolean isCertificating = data.getIdCard().getStatus() == 1;
values.put(GhContentProvider.KEY_IS_CERTIFICATED, isCertificated); // 是否认证
values.put(GhContentProvider.KEY_IS_ADULT, isAdult); // 是否成年
values.put(GhContentProvider.KEY_IS_CERTIFICATING, isCertificating); // 是否认证中
if (!isCertificated) {
RealNameHelper.updateCertificationStatus(0);
@ -196,6 +196,7 @@ public class DataUtils {
} else {
values.put(GhContentProvider.KEY_IS_CERTIFICATED, false);
values.put(GhContentProvider.KEY_IS_ADULT, false);
values.put(GhContentProvider.KEY_IS_CERTIFICATING, false);
RealNameHelper.updateCertificationStatus(0);
}

View File

@ -458,8 +458,7 @@ public class DetailDownloadUtils {
break;
case waiting:
downloadButton.setText(R.string.waiting);
downloadButton.setButtonStyle(DownloadButton.ButtonStyle.DOWNLOADING_NORMAL);
downloadButton.setVisibility(View.GONE);
downloadButton.setButtonStyle(DownloadButton.ButtonStyle.WAITING);
break;
case overflow:
case timeout:

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;
@ -12,16 +11,9 @@ import android.net.Uri;
import android.os.CountDownTimer;
import android.provider.Settings;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.URLSpan;
import android.text.style.UnderlineSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -34,12 +26,9 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.view.SimpleDraweeView;
import com.gh.common.constant.Config;
import com.gh.common.filter.RegionSetting;
@ -47,11 +36,9 @@ import com.gh.common.xapk.XapkDialogHelper;
import com.gh.gamecenter.R;
import com.gh.gamecenter.ShellActivity;
import com.gh.gamecenter.adapter.ReportReasonAdapter;
import com.gh.gamecenter.adapter.viewholder.PrivacyPolicyItemViewHolder;
import com.gh.gamecenter.common.base.TrackableDialog;
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;
@ -60,9 +47,7 @@ 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.utils.SensorsBridge;
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.MaxHeightLinearLayout;
import com.gh.gamecenter.common.view.MaxHeightNestedScrollView;
import com.gh.gamecenter.common.view.VerticalItemDecoration;
@ -80,10 +65,7 @@ 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.BadgeEntity;
import com.gh.gamecenter.entity.PermissionsEntity;
import com.gh.gamecenter.entity.PrivacyPolicyEntity;
import com.gh.gamecenter.entity.TrackableEntity;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.Badge;
@ -91,7 +73,6 @@ 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;
@ -328,180 +309,7 @@ public class DialogUtils {
return dialog;
}
public static void showPrivacyPolicyDialog(Context context,
@NonNull PrivacyPolicyEntity entity,
SimpleCallback<Boolean> callback) {
final Context activityContext = checkDialogContext(context);
// 区分此 dialog 是点击 dialog 外部取消的还是点击返回取消的
AtomicBoolean isCanceledByClickOutsideOfDialog = new AtomicBoolean(true);
final Dialog dialog = new Dialog(activityContext, R.style.GhAlertDialog);
View contentView = LayoutInflater.from(activityContext).inflate(R.layout.dialog_privacy_policy, null);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(contentView);
Window window = dialog.getWindow();
if (window != null) {
window.setBackgroundDrawableResource(android.R.color.transparent);
WindowManager.LayoutParams params = window.getAttributes();
params.horizontalMargin = 0;
params.width = context.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(40);
// int height = context.getResources().getDisplayMetrics().heightPixels - DisplayUtils.dip2px(120);
// int maxHeight = DisplayUtils.dip2px(446);
// if (height > maxHeight) {
// params.height = maxHeight;
// } else {
// params.height = height;
// }
window.setAttributes(params);
}
TextView title = contentView.findViewById(R.id.title);
TextView bottomContent = contentView.findViewById(R.id.bottom_content);
TextView topContent = contentView.findViewById(R.id.top_content);
TextView allowButton = contentView.findViewById(R.id.allow_button);
TextView disallowButton = contentView.findViewById(R.id.disallow_button);
TextView linkContent = contentView.findViewById(R.id.link_content);
RecyclerView permissions = contentView.findViewById(R.id.permissions_content);
permissions.setLayoutManager(new FixLinearLayoutManager(context));
permissions.setAdapter(new BaseRecyclerAdapter(context) {
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = mLayoutInflater.inflate(R.layout.privacy_item, parent, false);
return new PrivacyPolicyItemViewHolder(PrivacyItemBinding.bind(view));
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (holder instanceof PrivacyPolicyItemViewHolder) {
PrivacyPolicyItemViewHolder viewHolder = (PrivacyPolicyItemViewHolder) holder;
PrivacyItemBinding binding = viewHolder.getBinding();
final PermissionsEntity permissionsEntity = entity.getPermissions().get(position);
ImageUtils.display(binding.icon, permissionsEntity.getIcon());
binding.name.setText(permissionsEntity.getName());
binding.intro.setText(permissionsEntity.getIntro());
GenericDraweeHierarchy hierarchy = binding.icon.getHierarchy();
if (hierarchy != null) {
if (position == 0) {
hierarchy.setPlaceholderImage(R.drawable.permission_storage);
} else if (position == 1) {
hierarchy.setPlaceholderImage(R.drawable.permission_phone_state);
}
}
}
}
@Override
public int getItemCount() {
return entity.getPermissions().size();
}
});
SpannableStringBuilder skipText = new SpannableStringBuilder("查看完整版的隐私政策和用户协议");
skipText.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ContextCompat.getColor(activityContext, R.color.theme_font));
ds.setUnderlineText(false);
}
@Override
public void onClick(@NonNull View widget) {
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击隐私政策");
DirectUtils.directToExternalBrowser(context, context.getString(R.string.privacy_policy_url));
}
}, skipText.length() - 9, skipText.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
skipText.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ContextCompat.getColor(activityContext, R.color.theme_font));
ds.setUnderlineText(false);
}
@Override
public void onClick(@NonNull View widget) {
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击用户协议");
DirectUtils.directToExternalBrowser(context, context.getString(R.string.disclaimer_url));
}
}, skipText.length() - 4, skipText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
/*skipText.setSpan(new ClickableSpan() {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ContextCompat.getColor(activityContext, R.color.theme_font));
ds.setUnderlineText(false);
}
@Override
public void onClick(@NonNull View widget) {
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击第三方SDK接入说明");
activityContext.startActivity(WebActivity.getThirdPartySdkStatementIntent(activityContext));
}
}, skipText.length() - 10, skipText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);*/
title.setText(entity.getTitle());
linkContent.setText(skipText);
linkContent.setMovementMethod(LinkMovementMethod.getInstance());
topContent.setText(entity.getTopContent());
bottomContent.setText(ExtensionsKt.fromHtml(entity.getBottomContent()));
bottomContent.setMovementMethod(CustomLinkMovementMethod.getInstance());
// Remove underline
Spannable sa = (Spannable) bottomContent.getText();
for (URLSpan u : sa.getSpans(0, sa.length(), URLSpan.class)) {
sa.setSpan(new UnderlineSpan() {
public void updateDrawState(TextPaint tp) {
tp.setUnderlineText(false);
}
}, sa.getSpanStart(u), sa.getSpanEnd(u), 0);
}
allowButton.setOnClickListener(view -> {
dialog.dismiss();
callback.onCallback(true);
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击同意");
});
disallowButton.setOnClickListener(v -> {
dialog.dismiss();
callback.onCallback(false);
// showPrivacyPolicyDisallowDialog(activityContext, entity, callback);
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "不同意并退出App");
});
dialog.setOnCancelListener(cd -> {
if (isCanceledByClickOutsideOfDialog.get()) {
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击空白");
}
});
dialog.setOnKeyListener((dialog1, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
isCanceledByClickOutsideOfDialog.set(false);
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "点击返回");
}
return false;
});
// 用户未同意隐私策略不应该触发 MTA 事件
// MtaHelper.onEvent("隐私政策弹窗", "隐私政策弹窗", "出现弹窗");
try {
dialog.setCancelable(false);
dialog.show();
} catch (Exception ignored) {
}
}
public static void showPrivacyPolicyDisallowDialog(Context context,
@NonNull PrivacyPolicyEntity entity,
EmptyCallback callback) {
final Context activityContext = checkDialogContext(context);
@ -547,8 +355,8 @@ public class DialogUtils {
TextView negativeTv = contentView.findViewById(R.id.negative);
TextView positiveTv = contentView.findViewById(R.id.positive);
TextView content = contentView.findViewById(R.id.content);
positiveTv.setBackground(DrawableView.getOvalDrawable(R.color.background, 999));
negativeTv.setBackground(DrawableView.getOvalDrawable(R.color.theme, 999));
positiveTv.setBackground(DrawableView.getOvalDrawable(R.color.ui_background, 999));
negativeTv.setBackground(DrawableView.getOvalDrawable(R.color.primary_theme, 999));
content.setText(Html.fromHtml(context.getString(R.string.video_upload_draft_dialog_content)));
negativeTv.setOnClickListener(view -> {
@ -1251,10 +1059,10 @@ public class DialogUtils {
DialogPackageParseErrorBinding binding = DialogPackageParseErrorBinding.inflate(LayoutInflater.from(context), null, false);
Context finalContext = context;
SpannableStringBuilder builder = new SpanBuilder("您也可以点击提交反馈跟我们联系").click(context, 6, 10, R.color.theme_font, true, new Function0<Unit>() {
SpannableStringBuilder builder = new SpanBuilder("您也可以点击提交反馈跟我们联系").click(context, 6, 10, R.color.text_theme, true, new Function0<Unit>() {
@Override
public Unit invoke() {
SimpleGameEntity entity = new SimpleGameEntity(gameId, gameName, "");
SimpleGameEntity entity = new SimpleGameEntity(gameId, gameName, "", "");
HelpAndFeedbackBridge.startSuggestionActivity(finalContext, SuggestType.GAME, "notfound", "模拟器安装包解析错误", entity);
dialog.dismiss();
return null;
@ -1310,7 +1118,7 @@ public class DialogUtils {
return null;
});
binding.reasonRv.setLayoutManager(new LinearLayoutManager(context));
binding.reasonRv.addItemDecoration(new VerticalItemDecoration(context, 1F, false, R.color.background));
binding.reasonRv.addItemDecoration(new VerticalItemDecoration(context, 1F, false, R.color.ui_background));
binding.reasonRv.setAdapter(reportReasonAdapter);
binding.negativeBtn.setOnClickListener(v -> {
@ -1332,7 +1140,7 @@ public class DialogUtils {
ExtensionsKt.setTextChangedListener(binding.otherReasonEt, (s, start, before, count) -> {
int tvCount = s.length();
if (tvCount >= 500) {
binding.tvCount.setTextColor(ContextCompat.getColor(finalContext, R.color.theme_red));
binding.tvCount.setTextColor(ContextCompat.getColor(finalContext, R.color.secondary_red));
}
binding.tvCount.setText(tvCount + "/500");
return null;

View File

@ -321,6 +321,8 @@ object DirectUtils {
"qa", "qa_content", "Q&A" -> directToQa(context, linkEntity.text ?: "", linkEntity.link ?: "")
"qa_list" -> directToHelpAndFeedback(context)
"qa_collection", "Q&A合集" -> directToQaCollection(
context, linkEntity.text
?: "", linkEntity.link
@ -920,9 +922,9 @@ object DirectUtils {
browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(browserIntent)
} catch (e: ActivityNotFoundException) {
} catch (e: Exception) {
e.printStackTrace()
Utils.toast(context, "跳转地址无效")
url.copyTextAndToast(context.getString(R.string.direct_to_external_browser_failed_toast))
}
}
@ -1939,7 +1941,8 @@ object DirectUtils {
fromRatingKey: Boolean = false,
diagnosis: String = "",
forceLogin: Boolean = true,
requestCode: Int? = null
requestCode: Int? = null,
isSmoothGame: Boolean = false
) {
val intent = HelpAndFeedbackBridge.getIntent(
context,
@ -1952,7 +1955,8 @@ object DirectUtils {
qaContentId,
fromRatingKey,
diagnosis,
forceLogin
forceLogin,
isSmoothGame
)
if (requestCode != null) {
(context as Activity).startActivityForResult(intent, requestCode)

View File

@ -890,6 +890,7 @@ object DownloadItemUtils {
gameEntity.id,
gameEntity.name ?: "",
gameEntity.categoryChinese,
gameEntity.getApk().firstOrNull()?.format,
clickRunnable
)
}
@ -1122,7 +1123,7 @@ object DownloadItemUtils {
}
when (str) {
context.getString(R.string.resume) -> {
DownloadManager.getInstance().resume(downloadEntity, true)
DownloadManager.getInstance().resume(downloadEntity, false)
}
context.getString(R.string.waiting) -> {

View File

@ -8,6 +8,7 @@ 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.ShellActivity
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.base.activity.BaseActivity
@ -171,6 +172,33 @@ object DownloadObserver {
ToastUtils.toast("该游戏未接入防沉迷系统,暂不支持下载")
}
// 删除任务
downloadEntity.status = DownloadStatus.cancel
downloadManager.cancel(downloadEntity.url)
} else if (DownloadStatus.isCertificating == downloadEntity.status) {
// 未接入防沉迷系统
val currentActivity = AppManager.getInstance().currentActivity()
if (currentActivity != null) {
DialogHelper.showDialog(
context = currentActivity,
title = "实名提示",
content = "您当前的身份信息正在认证中,根据相关政策要求,该游戏需通过认证后才能进行下载",
cancelText = "知道了",
confirmText = "查看实名认证",
cancelClickCallback = null,
confirmClickCallback = {
currentActivity.startActivity(
ShellActivity.getIntent(
currentActivity,
ShellActivity.Type.REAL_NAME_INFO,
))
}
)
} else {
ToastUtils.toast("您当前的身份信息正在认证中,根据相关政策要求,该游戏需通过认证后才能进行下载")
}
// 删除任务
downloadEntity.status = DownloadStatus.cancel
downloadManager.cancel(downloadEntity.url)

View File

@ -18,7 +18,6 @@ import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.ErrorEntity
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.login.user.LoginTag
import com.halo.assistant.fragment.user.UserInfoEditFragment
import com.halo.assistant.fragment.user.VerifyPhoneFragment
import com.lightgame.utils.AppManager
@ -236,7 +235,7 @@ object ErrorHelper {
)
}
binding.hintTv.text = errorEntity.data?.text
binding.hintTv.setTextColor(R.color.theme_font.toColor(context))
binding.hintTv.setTextColor(R.color.text_theme.toColor(context))
binding.hintTv.setOnClickListener {
errorEntity.data?.toLinkEntity()?.let { entity ->
DirectUtils.directToLinkPage(context, entity, "实名提醒弹窗", "")
@ -297,7 +296,7 @@ object ErrorHelper {
)
}
binding.hintTv.text = errorEntity.data?.text
binding.hintTv.setTextColor(R.color.theme_font.toColor(context))
binding.hintTv.setTextColor(R.color.text_theme.toColor(context))
binding.hintTv.setOnClickListener {
errorEntity.data?.toLinkEntity()?.let { entity ->
DirectUtils.directToLinkPage(context, entity, "手机号验证", "")

View File

@ -1,12 +1,12 @@
package com.gh.common.util
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.gh.gamecenter.core.utils.SPUtils
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.feature.entity.GameEntity
import com.gh.gamecenter.entity.SubjectEntity
import com.gh.gamecenter.login.user.UserManager
@ -18,17 +18,19 @@ import com.lightgame.utils.Utils
import io.reactivex.schedulers.Schedulers
/**
* 首页补充游戏库辅助
* 补充游戏库管理
*/
object GameSubstituteRepositoryHelper {
private const val SP_GAME_SUB = "sp_game_sub"
private const val KEY_GAME_REPOSITORY = "game_substitute_repository"
private var mSubstitutableGameIdSet = hashSetOf<String>()
private var mApi = RetrofitManager.getInstance().api
private var mHistoricInstalledGameIdSet = hashSetOf<String>() // 历史已安装过的游戏 ID 列表
private var mApplicationContext = HaloApp.getInstance().application
private val mGameSubSp by lazy { mApplicationContext.getSharedPreferences(SP_GAME_SUB, Context.MODE_PRIVATE) }
var gameCollectionList: List<SubjectEntity> = arrayListOf()
private var mGameCollectionList: List<SubjectEntity> = arrayListOf() // 游戏补充库
init {
loadSavedRepository()
@ -50,9 +52,13 @@ object GameSubstituteRepositoryHelper {
})
}
/**
* 联网获取历史已安装过的游戏 ID 列表
* 包括根据用户 ID 获取的已玩游戏 ID 列表,以及根据 gid 获取的已下载游戏 ID 列表
*/
@JvmStatic
@SuppressLint("CheckResult")
fun updateSubstitutableGames() {
fun updateHistoricInstalledGameSet() {
mApplicationContext.doOnMainProcessOnly {
val single = if (UserManager.getInstance().isLoggedIn) {
mApi.getIdListOfPlayedGames(UserManager.getInstance().userId, Utils.getTime(mApplicationContext))
@ -61,28 +67,22 @@ object GameSubstituteRepositoryHelper {
}
single.subscribeOn(Schedulers.io()).subscribe(object : BiResponse<List<String>>() {
override fun onSuccess(data: List<String>) {
mSubstitutableGameIdSet = data.toHashSet()
mHistoricInstalledGameIdSet = data.toHashSet()
}
})
}
}
/**
* 刷新内存中的游戏库(即从 SP 中再读一次)
*/
@JvmStatic
fun refreshRepositoryFromLocal() = loadSavedRepository()
private fun loadSavedRepository() {
gameCollectionList = SPUtils.getString(KEY_GAME_REPOSITORY).toObject() ?: arrayListOf()
mGameCollectionList = SPUtils.getString(mGameSubSp, KEY_GAME_REPOSITORY).toObject() ?: arrayListOf()
}
private fun updateGameRepository(subjects: List<SubjectEntity>?) {
if (subjects == null) return
SPUtils.setString(KEY_GAME_REPOSITORY, subjects.toJson())
SPUtils.setString(mGameSubSp, KEY_GAME_REPOSITORY, subjects.toJson())
gameCollectionList = subjects
mGameCollectionList = subjects
}
/**
@ -90,19 +90,12 @@ object GameSubstituteRepositoryHelper {
* @param collectionId 补充游戏库相应专题 ID
* @param gameIdList 该专题里已经包含的游戏 ID 列表
*/
private fun getOneUniqueGame(collectionId: String?, gameIdList: HashSet<String>): GameEntity? {
private fun getValidGame(collectionId: String?, gameIdList: HashSet<String>): GameEntity? {
collectionId?.let {
val collection = gameCollectionList.find { it.id == collectionId }
val collection = mGameCollectionList.find { it.id == collectionId }
collection?.let {
val game = collection.data?.find { game -> isThisGameUnique(game, gameIdList) }
val game = collection.data?.find { game -> isThisGameValid(game, gameIdList) }
game?.let {
collection.data?.remove(game)
// collection.data?.size?.let { remainingSize ->
// // 记录被替换游戏的数量10个以上的时候触发
// if (remainingSize % 10 == 0) {
// SentryHelper.onEvent("game_substitute", "substituted_size", "${50 - remainingSize}")
// }
// }
// 产品说要记录补充专题的曝光数,所以这个游戏附带了所在专题的名字
game.subjectName = collection.name
game.subjectId = collection.id
@ -115,14 +108,17 @@ object GameSubstituteRepositoryHelper {
/**
* 替换游戏,包括 已安装,历史下载,历史已安装等类型
* @param gameList 需要被替换数据的游戏列表
* @param displayingGameIdSet 页面正在显示的游戏 ID 列表,避免重复替换
* @param relatedCollectionId 关联的替换合集 ID
*/
fun replaceGames(
gameList: MutableList<GameEntity>,
alreadyDisplayedGameIdSet: HashSet<String>,
displayingGameIdSet: HashSet<String>,
relatedCollectionId: String,
shouldLogReplaceEvent: Boolean
) {
val positionOfTheGameToReplaceList = arrayListOf<Int>()
// 需要被替换的游戏 position 列表
val positionOfGameToBeReplacedList = arrayListOf<Int>()
// 标记需要替换的已安装游戏
for ((index, game) in gameList.withIndex()) {
@ -132,28 +128,29 @@ object GameSubstituteRepositoryHelper {
continue
}
var isThisPositionLabeled = false
// 这个 position 的游戏是否需要被替换
var thisPositionNeedToBeReplaced = false
// 从 游戏ID 判断当前游戏是否需要被替换
if (mSubstitutableGameIdSet.contains(game.id)) {
positionOfTheGameToReplaceList.add(index)
isThisPositionLabeled = true
if (mHistoricInstalledGameIdSet.contains(game.id)) {
positionOfGameToBeReplacedList.add(index)
thisPositionNeedToBeReplaced = true
}
// 检查是否已安装该游戏里同包名的 APK
if (!isThisPositionLabeled) {
if (!thisPositionNeedToBeReplaced) {
for (apk in game.getApk()) {
if (PackageHelper.validLocalPackageNameSet.contains(apk.packageName)) {
// 将该位置的游戏标记为需要替换
positionOfTheGameToReplaceList.add(index)
isThisPositionLabeled = true
positionOfGameToBeReplacedList.add(index)
thisPositionNeedToBeReplaced = true
break
}
}
}
// 若此游戏所包含的 apk 没有已安装,那么再检查是否已安装有预设相关包名
if (!isThisPositionLabeled) {
if (!thisPositionNeedToBeReplaced) {
var relatedPackageList = arrayListOf<String>()
for (entity in PackageHelper.relatedPackageList) {
if (entity.gameId == game.id) {
@ -164,39 +161,45 @@ object GameSubstituteRepositoryHelper {
for (packageName in relatedPackageList) {
if (PackageHelper.validLocalPackageNameSet.contains(packageName)) {
positionOfTheGameToReplaceList.add(index)
positionOfGameToBeReplacedList.add(index)
break
}
}
}
}
if (positionOfTheGameToReplaceList.isNotEmpty()) {
if (shouldLogReplaceEvent) {
MtaHelper.onEvent("首页_加载", "启动光环", "替换游戏")
}
for (position in positionOfTheGameToReplaceList) {
val replacingGame = getOneUniqueGame(relatedCollectionId, alreadyDisplayedGameIdSet)
replacingGame?.let {
gameList[position] = replacingGame
if (positionOfGameToBeReplacedList.isNotEmpty()) {
for (position in positionOfGameToBeReplacedList) {
val validGame = getValidGame(relatedCollectionId, displayingGameIdSet)
validGame?.let {
gameList[position] = it
displayingGameIdSet.add(it.id)
}
}
}
}
private fun isThisGameUnique(game: GameEntity, gameIdList: HashSet<String>): Boolean {
// 判断该游戏是否出现在已安装列表
if (mSubstitutableGameIdSet.contains(game.id)) return false
/**
* 判断该游戏是否有效
* @param game 需要判断的游戏
* @param gameIdList 专题里已经包含的游戏 ID 列表
*/
private fun isThisGameValid(
game: GameEntity,
gameIdList: HashSet<String>
): Boolean {
// 该游戏是否在历史已安装列表中
if (mHistoricInstalledGameIdSet.contains(game.id)) return false
// 该补充游戏是否已经存在关联关系
// 该游戏是否与专题里已包含的游戏存在关联关系
for (relatedId in game.relatedGameIds!!) {
if (gameIdList.contains(relatedId)) {
return false
}
}
// 检查本地是否已安装该游戏,已过滤部分框架服务的包名
for (apk in game.getApk()) {
// 检查本地是否已安装该游戏,已过滤那部分框架服务的包名
if (PackageHelper.validLocalPackageNameSet.contains(apk.packageName)) {
return false
}

View File

@ -183,12 +183,12 @@ public class LibaoUtils {
case "coming":
libaoBtn.setText(R.string.libao_coming);
libaoBtn.setBackgroundResource(R.drawable.button_round_gray_light);
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_subtitleDesc));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_tertiary));
break;
case "used_up":
libaoBtn.setText(R.string.libao_used_up);
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_border);
libaoBtn.setTextColor(context.getResources().getColor(R.color.theme_font));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_theme));
break;
case "finish":
libaoBtn.setText(R.string.libao_finish);
@ -198,12 +198,12 @@ public class LibaoUtils {
case "linged":
libaoBtn.setText(R.string.libao_linged);
libaoBtn.setBackgroundResource(R.drawable.button_round_gray_light);
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_subtitleDesc));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_tertiary));
break;
case "taoed":
libaoBtn.setText(R.string.libao_taoed);
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_border);
libaoBtn.setTextColor(context.getResources().getColor(R.color.theme_font));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_theme));
break;
case "copy":
libaoBtn.setText(R.string.libao_copy);
@ -213,13 +213,13 @@ public class LibaoUtils {
case "repeatLinged":
libaoBtn.setText(R.string.libao_repeat_ling);
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_border);
libaoBtn.setTextColor(context.getResources().getColor(R.color.theme_font));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_theme));
break;
case "repeatTao":
case "repeatTaoed":
libaoBtn.setText(R.string.libao_repeat_tao);
libaoBtn.setBackgroundResource(R.drawable.button_normal_round_border);
libaoBtn.setTextColor(context.getResources().getColor(R.color.theme_font));
libaoBtn.setTextColor(context.getResources().getColor(R.color.text_theme));
break;
case "unshelve":
libaoBtn.setBackgroundResource(R.drawable.button_border_round_gray);

View File

@ -259,6 +259,7 @@ public class LogUtils {
private static void uploadToReservation(JSONObject object) {
Context context = HaloApp.getInstance().getApplication();
try {
object.put(KEY_EVENT, "appointment");
object.put("version", PackageUtils.getGhVersionName());
object.put("channel", HaloApp.getInstance().getChannel());
object.put("dia", MetaUtil.getBase64EncodedAndroidId());

View File

@ -668,7 +668,8 @@ object NewFlatLogUtils {
searchKey: String,
bbsId: String,
sequence: Int,
name: String
name: String,
button: String
) {
json {
KEY_EVENT to "search_bbs_click"
@ -677,6 +678,7 @@ object NewFlatLogUtils {
"bbs_id" to bbsId
"sequence" to sequence
"name" to name
"button" to button
parseAndPutMeta()()
}.let(::log)
}
@ -1271,10 +1273,19 @@ object NewFlatLogUtils {
}
// 存档分享弹窗点击事件
fun logCloudArchiveShareDialogClick(buttonType: String, gameId: String, gameName: String, cloudSaveId: String) {
fun logCloudArchiveShareDialogClick(
buttonType: String,
gameId: String,
gameName: String,
cloudSaveId: String,
cloudSaveName: String,
content: String
) {
val json = json {
"cloud_save_id" to cloudSaveId
KEY_EVENT to "cloud_save_share_dialog_click"
"cloud_save_id" to cloudSaveId
"cloud_save_name" to cloudSaveName
"content" to content
KEY_BUTTON_TYPE to buttonType
KEY_GAME_ID to gameId
KEY_GAME_NAME to gameName
@ -1324,12 +1335,14 @@ object NewFlatLogUtils {
}
// 上传存档弹窗点击事件
fun logCloudArchiveUploadDialogClick(buttonType: String, gameId: String, gameName: String) {
fun logCloudArchiveUploadDialogClick(gameId: String, gameName: String, cloudSaveId: String, cloudSaveName: String, isSuccess: Boolean) {
val json = json {
KEY_EVENT to "cloud_save_upload_dialog_click"
KEY_BUTTON_TYPE to buttonType
KEY_GAME_ID to gameId
KEY_GAME_NAME to gameName
"cloud_save_id" to cloudSaveId
"cloud_save_name" to cloudSaveName
"is_success" to isSuccess
parseAndPutMeta().invoke(this)
}
log(json)
@ -1770,7 +1783,12 @@ object NewFlatLogUtils {
}
//新游开测详情页点击游戏类型
fun logGameTestDetailGameCategoryClick(tabName: String, gameCategory: String, gameTestStartType: String, isOn: Boolean) {
fun logGameTestDetailGameCategoryClick(
tabName: String,
gameCategory: String,
gameTestStartType: String,
isOn: Boolean
) {
val json = json {
"event" to "game_test_detail_game_category_click"
"tab_name" to tabName
@ -2657,4 +2675,49 @@ object NewFlatLogUtils {
}
log(json)
}
// 搜索结果页面点击横幅位卡片
@JvmStatic
fun logGameSearchFirstGameBannerClick(
gameId: String,
gameName: String,
sequence: Int,
linkType: String?,
linkId: String?,
linkText: String?
) {
json {
KEY_EVENT to "game_search_first_game_banner_click"
"game_id" to gameId
"game_name" to gameName
"sequence" to sequence
"link_type" to linkType
"link_id" to linkId
"link_text" to linkText
parseAndPutMeta()(this)
}.let(::log)
}
// 搜索结果页面点击卡片栏卡片
fun logGameSearchFirstGameCardClick(
gameId: String,
gameName: String,
title: String,
sequence: Int,
linkType: String?,
linkId: String?,
linkText: String?
) {
json {
KEY_EVENT to "game_search_first_game_card_click"
"game_id" to gameId
"game_name" to gameName
"title" to title
"sequence" to sequence
"link_type" to linkType
"link_id" to linkId
"link_text" to linkText
parseAndPutMeta()(this)
}.let(::log)
}
}

View File

@ -19,6 +19,7 @@ import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.CurrentActivityHolder
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.install.InstallService
import com.gh.gamecenter.vpn.VpnHelper
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
@ -159,6 +160,13 @@ object PackageInstaller {
*/
private fun install(context: Context, pkgPath: String) {
HaloApp.put(Constants.LAST_INSTALL_GAME, pkgPath)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU && Build.MANUFACTURER.lowercase().contains("xiaomi")) {
val foregroundServiceIntent = Intent(context, InstallService::class.java)
foregroundServiceIntent.putExtra(InstallService.KEY_SERVICE_ACTION, InstallService.START_FOREGROUND)
context.startForegroundService(foregroundServiceIntent)
}
val installIntent = getInstallIntent(context, pkgPath)
context.startActivity(installIntent)
}

View File

@ -22,8 +22,8 @@ object RealNameHelper {
/**
* 弹未成年人不能下载游戏弹窗
*/
fun showRealNameUnqualifiedDialog(downloadEntity: DownloadEntity) {
val contentText = if (downloadEntity.status == DownloadStatus.done) {
fun showRealNameUnqualifiedDialog(downloadEntity: DownloadEntity?) {
val contentText = if (downloadEntity?.status == DownloadStatus.done) {
"为保护未成年身心健康成长\n" + "根据相关政策要求,该游戏不对未成年人开放"
} else {
"为保护未成年身心健康成长\n" + "根据相关政策要求,该游戏不对未成年人开放下载"
@ -45,7 +45,7 @@ object RealNameHelper {
}
)
}
if (downloadEntity.status != DownloadStatus.done) {
if (downloadEntity != null && downloadEntity.status != DownloadStatus.done) {
DownloadManager.getInstance()
.addInvisiblePendingTask(downloadEntity)
}
@ -54,22 +54,24 @@ object RealNameHelper {
/**
* 弹需要实名弹窗
*/
fun showRealNameUncertificatedDialog(downloadEntity: DownloadEntity) {
fun showRealNameUncertificatedDialog(downloadEntity: DownloadEntity?) {
// 是否强制实名
val isForced = downloadEntity.getMetaExtra("force_real_name") != "false"
val isForced = downloadEntity?.getMetaExtra("force_real_name") != "false"
NewLogUtils.logCertificationTrigger(downloadEntity.gameId, downloadEntity.name)
SensorsBridge.trackEvent(
"VerificationDialogShow",
"game_id",
downloadEntity.gameId,
"game_name",
downloadEntity.name ?: "",
"game_type",
downloadEntity.meta[Constants.GAME_CATEGORY_IN_CHINESE] ?: ""
)
downloadEntity?.let {
NewLogUtils.logCertificationTrigger(downloadEntity.gameId, downloadEntity.name)
SensorsBridge.trackEvent(
"VerificationDialogShow",
"game_id",
downloadEntity.gameId,
"game_name",
downloadEntity.name ?: "",
"game_type",
downloadEntity.meta[Constants.GAME_CATEGORY_IN_CHINESE] ?: ""
)
}
val contentText = if (downloadEntity.status == DownloadStatus.done) {
val contentText = if (downloadEntity?.status == DownloadStatus.done) {
"为保护未成年身心健康成长\n" + "根据相关政策要求,该游戏不对未成年人开放\n" + "如需完成安装,请前往实名认证"
} else {
"为保护未成年身心健康成长\n" + "根据相关政策要求,该游戏不对未成年人开放下载\n" + "如需下载,请前往实名认证"
@ -98,7 +100,7 @@ object RealNameHelper {
putExtra(EntranceConsts.KEY_IS_FORCED_TO_CERTIFICATE_BUT_WITH_BACKDOOR, !isForced)
}
)
if (downloadEntity.status == DownloadStatus.done) {
if (downloadEntity?.status == DownloadStatus.done) {
pendingInstallPkgPath = downloadEntity.path
}
NewLogUtils.logCertificationHintDialogOptionsClicked("前往实名认证")
@ -123,7 +125,7 @@ object RealNameHelper {
}
}
if (downloadEntity.status != DownloadStatus.done) {
if (downloadEntity != null && downloadEntity.status != DownloadStatus.done) {
DownloadManager.getInstance()
.addInvisiblePendingTask(downloadEntity)
}

View File

@ -163,7 +163,7 @@ object ReservationHelper {
}, cancelClickCallback = {
cancelListener?.onCancel()
}, uiModificationCallback = {
it.confirmTv.setTextColor(R.color.theme_red.toColor(context))
it.confirmTv.setTextColor(R.color.secondary_red.toColor(context))
}, extraConfig = DialogHelper.Config(centerContent = true, centerTitle = true)
)
}

View File

@ -0,0 +1,92 @@
package com.gh.common.util
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.runOnUiThread
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.ndownload.NHttpClient
import com.lightgame.utils.AppManager
import org.json.JSONObject
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.net.HttpURLConnection
/**
* 一个临时用来检测实名的工具类,相关需求是这个 https://jira.shanqu.cc/browse/GHZS-4522
*/
object TempCertificationUtils {
fun checkCertificationBeforeAction(gameEntity: GameEntity, action: () -> Unit) {
// 更新下载相关的meta信息用于 connection 的 header
DownloadManager.updateDownloadMetaMap()
runOnIoThread {
try {
val url = gameEntity.getApk().firstOrNull()?.url ?: return@runOnIoThread
val client = NHttpClient()
val connection = client.connect(url, 3000, 3000, -1, -1, -1, null)
val code = connection.responseCode
if (code == HttpURLConnection.HTTP_FORBIDDEN) {
val resultObject = JSONObject(getErrorResponse(connection.errorStream))
val customResponseCode = resultObject.getString("code")
if ("403001" == customResponseCode) {
// 未实名
runOnUiThread {
RealNameHelper.showRealNameUncertificatedDialog(null)
}
} else if ("403002" == customResponseCode) {
// 未成年
runOnUiThread {
RealNameHelper.showRealNameUnqualifiedDialog(null)
}
} else if ("403003" == customResponseCode) {
// 该游戏未接入防沉迷系统禁止下载
val currentActivity = AppManager.getInstance().currentActivity()
if (currentActivity != null) {
runOnUiThread {
DialogHelper.showDialog(
context = currentActivity,
title = "温馨提示",
content = "该游戏未接入防沉迷系统,暂不支持下载",
confirmText = "知道了",
cancelText = ""
)
}
} else {
ToastUtils.toast("该游戏未接入防沉迷系统,暂不支持下载")
}
} else if ("403004" == customResponseCode) {
// 后台禁止该设备下载
ToastUtils.showToast("网络异常")
} else {
ToastUtils.showToast("网络异常 $customResponseCode")
}
} else {
runOnUiThread {
action.invoke()
}
}
} catch (e: Exception) {
ToastUtils.showToast("网络异常,请稍后再试 ${e.message}")
}
}
}
private fun getErrorResponse(inputStream: InputStream): String {
val bf = BufferedReader(InputStreamReader(inputStream))
val stringBuffer = StringBuilder()
var strCurrentLine: String?
while (bf.readLine().also { strCurrentLine = it } != null) {
stringBuffer.append(strCurrentLine)
}
bf.close()
return stringBuffer.toString()
}
}

View File

@ -0,0 +1,246 @@
package com.gh.common.video
import android.content.Context
import android.media.AudioManager
import android.net.TrafficStats
import android.net.Uri
import android.os.Message
import android.view.Surface
import com.google.android.exoplayer2.SeekParameters
import com.google.android.exoplayer2.video.DummySurface
import com.shuyu.gsyvideoplayer.cache.ICacheManager
import com.shuyu.gsyvideoplayer.model.GSYModel
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
import com.shuyu.gsyvideoplayer.player.BasePlayerManager
import tv.danmaku.ijk.media.player.IMediaPlayer
/**
* 基于Exo2PlayerManager修改主要做了如下改动
* 1.使用CustomIjkExo2MediaPlayer代替IjkExo2MediaPlayer
* 2.复用mediaPlayer的实例提高内存利用效率
*/
class CustomExo2PlayerManager : BasePlayerManager() {
private var context: Context? = null
private var mediaPlayer: CustomIjkExo2MediaPlayer? = null
private var surface: Surface? = null
private var dummySurface: DummySurface? = null
private var lastTotalRxBytes: Long = 0
private var lastTimeStamp: Long = 0
override fun getMediaPlayer(): IMediaPlayer? {
return mediaPlayer
}
override fun initVideoPlayer(
context: Context,
msg: Message,
optionModelList: List<VideoOptionModel?>?,
cacheManager: ICacheManager?
) {
this.context = context.applicationContext
val mediaPlayer = this.mediaPlayer ?: CustomIjkExo2MediaPlayer().apply {
mediaPlayer = this
}
if (mediaPlayer.appContext != context.applicationContext) {
mediaPlayer.release()
mediaPlayer.updateAppContext(context)
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
}
if (dummySurface == null) {
dummySurface = DummySurface.newInstanceV17(context, false)
}
//使用自己的cache模式
val gsyModel = msg.obj as GSYModel
try {
mediaPlayer.isLooping = gsyModel.isLooping
mediaPlayer.isPreview = gsyModel.mapHeadData != null && gsyModel.mapHeadData.isNotEmpty()
if (gsyModel.isCache && cacheManager != null) {
//通过管理器处理
cacheManager.doCacheLogic(context, mediaPlayer, gsyModel.url, gsyModel.mapHeadData, gsyModel.cachePath)
} else {
//通过自己的内部缓存机制
mediaPlayer.isCache = gsyModel.isCache
mediaPlayer.cacheDir = gsyModel.cachePath
mediaPlayer.overrideExtension = gsyModel.overrideExtension
mediaPlayer.setDataSource(context, Uri.parse(gsyModel.url), gsyModel.mapHeadData)
}
if (gsyModel.speed != 1f && gsyModel.speed > 0) {
mediaPlayer.setSpeed(gsyModel.speed, 1f)
}
} catch (e: Exception) {
e.printStackTrace()
}
initSuccess(gsyModel)
}
override fun showDisplay(msg: Message) {
if (msg.obj == null) {
mediaPlayer?.setSurface(dummySurface)
} else {
val holder = msg.obj as Surface
surface = holder
mediaPlayer?.setSurface(holder)
}
}
override fun setSpeed(speed: Float, soundTouch: Boolean) {
try {
mediaPlayer?.setSpeed(speed, 1f)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun setNeedMute(needMute: Boolean) {
if (needMute) {
mediaPlayer?.setVolume(0f, 0f)
} else {
mediaPlayer?.setVolume(1f, 1f)
}
}
override fun setVolume(left: Float, right: Float) {
mediaPlayer?.setVolume(left, right)
}
override fun releaseSurface() {
if (surface != null) {
//surface.release();
surface = null
}
}
override fun release() {
mediaPlayer?.setSurface(null)
mediaPlayer?.release()
mediaPlayer = null
dummySurface?.release()
dummySurface = null
lastTotalRxBytes = 0
lastTimeStamp = 0
}
override fun getBufferedPercentage(): Int {
return mediaPlayer?.bufferedPercentage ?: 0
}
override fun getNetSpeed(): Long {
return if (mediaPlayer != null) {
getNetSpeed(context)
} else 0
}
override fun setSpeedPlaying(speed: Float, soundTouch: Boolean) {}
override fun start() {
if (mediaPlayer != null) {
mediaPlayer!!.start()
}
}
override fun stop() {
if (mediaPlayer != null) {
mediaPlayer!!.stop()
}
}
override fun pause() {
if (mediaPlayer != null) {
mediaPlayer!!.pause()
}
}
override fun getVideoWidth(): Int {
return if (mediaPlayer != null) {
mediaPlayer!!.videoWidth
} else 0
}
override fun getVideoHeight(): Int {
return if (mediaPlayer != null) {
mediaPlayer!!.videoHeight
} else 0
}
override fun isPlaying(): Boolean {
return if (mediaPlayer != null) {
mediaPlayer!!.isPlaying
} else false
}
override fun seekTo(time: Long) {
if (mediaPlayer != null) {
mediaPlayer!!.seekTo(time)
}
}
override fun getCurrentPosition(): Long {
return if (mediaPlayer != null) {
mediaPlayer!!.currentPosition
} else 0
}
override fun getDuration(): Long {
return if (mediaPlayer != null) {
mediaPlayer!!.duration
} else 0
}
override fun getVideoSarNum(): Int {
return if (mediaPlayer != null) {
mediaPlayer!!.videoSarNum
} else 1
}
override fun getVideoSarDen(): Int {
return if (mediaPlayer != null) {
mediaPlayer!!.videoSarDen
} else 1
}
override fun isSurfaceSupportLockCanvas(): Boolean {
return false
}
/**
* 设置seek的临近帧。
*/
fun setSeekParameter(seekParameters: SeekParameters?) {
if (mediaPlayer != null) {
mediaPlayer!!.setSeekParameter(seekParameters)
}
}
private fun getNetSpeed(context: Context?): Long {
if (context == null) {
return 0
}
val nowTotalRxBytes =
if (TrafficStats.getUidRxBytes(context.applicationInfo.uid) == TrafficStats.UNSUPPORTED.toLong()) 0 else TrafficStats.getTotalRxBytes() / 1024 //转为KB
val nowTimeStamp = System.currentTimeMillis()
val calculationTime = nowTimeStamp - lastTimeStamp
if (calculationTime == 0L) {
return calculationTime
}
//毫秒转换
val speed = (nowTotalRxBytes - lastTotalRxBytes) * 1000 / calculationTime
lastTimeStamp = nowTimeStamp
lastTotalRxBytes = nowTotalRxBytes
return speed
}
}

View File

@ -0,0 +1,51 @@
package com.gh.common.video
import android.content.Context
import android.net.Uri
import com.shuyu.gsyvideoplayer.cache.ICacheManager
import com.shuyu.gsyvideoplayer.cache.ICacheManager.ICacheAvailableListener
import tv.danmaku.ijk.media.exo2.ExoSourceManager
import tv.danmaku.ijk.media.player.IMediaPlayer
import java.io.File
/**
* 基于ExoPlayerCacheManager修改规避使用CustomExo2PlayerManager时的异常抛出
*/
class CustomExoPlayerCacheManager : ICacheManager {
protected var mExoSourceManager: ExoSourceManager? = null
override fun doCacheLogic(
context: Context,
mediaPlayer: IMediaPlayer,
url: String,
header: Map<String, String>,
cachePath: File?
) {
if (mediaPlayer !is CustomIjkExo2MediaPlayer) {
throw UnsupportedOperationException("CustomExoPlayCacheManager only support CustomIjkExo2MediaPlayer")
}
mExoSourceManager = mediaPlayer.exoHelper
//通过自己的内部缓存机制
mediaPlayer.isCache = true
mediaPlayer.cacheDir = cachePath
mediaPlayer.setDataSource(context, Uri.parse(url), header)
}
override fun clearCache(context: Context, cachePath: File, url: String) {
ExoSourceManager.clearCache(context, cachePath, url)
}
override fun release() {
mExoSourceManager = null
}
override fun hadCached(): Boolean {
return mExoSourceManager != null && mExoSourceManager?.hadCached() == true
}
override fun cachePreview(context: Context, cacheDir: File?, url: String): Boolean {
return ExoSourceManager.cachePreView(context, cacheDir, url)
}
override fun setCacheAvailableListener(cacheAvailableListener: ICacheAvailableListener) {}
}

View File

@ -0,0 +1,558 @@
package com.gh.common.video
import android.content.Context
import android.net.Uri
import android.os.Looper
import android.view.Surface
import android.view.SurfaceHolder
import androidx.annotation.Size
import com.google.android.exoplayer2.*
import com.google.android.exoplayer2.DefaultRenderersFactory.ExtensionRendererMode
import com.google.android.exoplayer2.analytics.AnalyticsListener
import com.google.android.exoplayer2.analytics.AnalyticsListener.EventTime
import com.google.android.exoplayer2.decoder.DecoderCounters
import com.google.android.exoplayer2.metadata.Metadata
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory
import com.google.android.exoplayer2.source.MediaSource
import com.google.android.exoplayer2.source.TrackGroupArray
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
import com.google.android.exoplayer2.trackselection.MappingTrackSelector
import com.google.android.exoplayer2.trackselection.TrackSelectionArray
import tv.danmaku.ijk.media.exo2.ExoSourceManager
import tv.danmaku.ijk.media.exo2.demo.EventLogger
import tv.danmaku.ijk.media.player.AbstractMediaPlayer
import tv.danmaku.ijk.media.player.MediaInfo
import tv.danmaku.ijk.media.player.misc.IjkTrackInfo
import java.io.File
import java.io.FileDescriptor
/**
* 基于IjkExo2MediaPlayer修改实现列表视频播放的适配主要做了如下改动
* 1. 复用SimpleExoPlayer的实例避免在列表中使用时造成的卡顿
* 2. 新增updateAppContext方法提供切换上下文环境的入口
* 3. 移除prepareAsync的Handler调用机制避免频繁调用造成的队列拥堵问题
*/
class CustomIjkExo2MediaPlayer : AbstractMediaPlayer(), Player.EventListener, AnalyticsListener {
private var _appContext: Context? = null
private var internalPlayer: SimpleExoPlayer? = null
private var eventLogger: EventLogger? = null
private var rendererFactory: DefaultRenderersFactory? = null
private var mediaSource: MediaSource? = null
private var trackSelector: MappingTrackSelector? = null
private var loadControl: LoadControl? = null
private var dataSource: String? = null
private var surface: Surface? = null
private var headers: MutableMap<String, String> = HashMap()
private var speedPlaybackParameters: PlaybackParameters? = null
private var videoWidth = 0
private var videoHeight = 0
private var lastReportedPlaybackState = 0
private var isLastReportedPlayWhenReady = false
private var isPreparing = true
private var isBuffering = false
private var isLooping = false
/**
* 是否带上header
*/
var isPreview = false
/**
* 是否开启缓存
*/
var isCache: Boolean = false
/**
* dataSource等的帮组类
*/
private var _exoHelper: ExoSourceManager? = null
/**
* 缓存目录,可以为空
*/
var cacheDir: File? = null
/**
* 类型覆盖
*/
var overrideExtension: String? = null
private var audioSessionId = C.AUDIO_SESSION_ID_UNSET
val appContext: Context? get() = _appContext
val exoHelper: ExoSourceManager? get() = _exoHelper
fun updateAppContext(context: Context) {
val appContext = context.applicationContext.apply {
_appContext = this
}
resetFlags()
_exoHelper = ExoSourceManager.newInstance(context, headers)
val trackSelector = DefaultTrackSelector(appContext).also {
trackSelector = it
}
val eventLogger = EventLogger(trackSelector).also {
eventLogger = it
}
val preferExtensionDecoders = true
val useExtensionRenderers = true //是否开启扩展
@ExtensionRendererMode val extensionRendererMode =
if (useExtensionRenderers) (if (preferExtensionDecoders) DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER else DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON) else DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF
val rendererFactory = DefaultRenderersFactory(appContext!!).also {
it.setExtensionRendererMode(extensionRendererMode)
rendererFactory = it
}
val loadControl = DefaultLoadControl().also {
loadControl = it
}
internalPlayer = SimpleExoPlayer.Builder(appContext, rendererFactory)
.setLooper(Looper.myLooper()!!)
.setTrackSelector(trackSelector)
.setLoadControl(loadControl)
.build()
.also {
it.addListener(this)
it.addAnalyticsListener(this)
it.addListener(eventLogger)
}
}
private fun getVideoRendererIndex(): Int {
if (internalPlayer != null) {
for (i in 0 until internalPlayer!!.rendererCount) {
if (internalPlayer!!.getRendererType(i) == C.TRACK_TYPE_VIDEO) {
return i
}
}
}
return 0
}
override fun setDisplay(sh: SurfaceHolder?) {
if (sh == null) setSurface(null) else setSurface(sh.surface)
}
override fun setSurface(surface: Surface?) {
internalPlayer?.setVideoSurface(surface)
?: let {
this.surface = surface
}
}
override fun setDataSource(context: Context?, uri: Uri, headers: Map<String, String>?) {
if (headers != null) {
this.headers.clear()
this.headers.putAll(headers)
}
setDataSource(context, uri)
}
override fun setDataSource(path: String?) {
setDataSource(appContext, Uri.parse(path))
}
override fun setDataSource(context: Context?, uri: Uri) {
dataSource = uri.toString()
// mediaSource = exoHelper?.getMediaSource(dataSource, isPreview, isCache, isLooping, cacheDir, overrideExtension)
mediaSource = DefaultMediaSourceFactory(context!!).createMediaSource(MediaItem.fromUri(uri))
}
override fun setDataSource(fd: FileDescriptor?) {
throw UnsupportedOperationException("no support")
}
override fun getDataSource(): String? {
return dataSource
}
@Throws(IllegalStateException::class)
override fun prepareAsync() {
internalPlayer?.let {
it.setPlaybackParameters(speedPlaybackParameters)
if (surface != null) {
it.setVideoSurface(surface)
surface = null
}
mediaSource?.apply {
it.setMediaSource(this)
}
it.prepare()
it.playWhenReady = false
}
}
@Throws(IllegalStateException::class)
override fun start() {
internalPlayer?.play()
}
@Throws(IllegalStateException::class)
override fun stop() {
resetFlags()
internalPlayer?.clearMediaItems()
internalPlayer?.stop()
}
private fun resetFlags() {
isPreparing = true
isBuffering = false
lastReportedPlaybackState = Player.STATE_IDLE
isLastReportedPlayWhenReady = false
}
@Throws(IllegalStateException::class)
override fun pause() {
internalPlayer?.pause()
}
@Deprecated("Deprecated in Java")
override fun setWakeMode(context: Context?, mode: Int) {
// FIXME: implement
}
override fun setScreenOnWhilePlaying(screenOn: Boolean) {
// TODO: do nothing
}
override fun getTrackInfo(): Array<IjkTrackInfo?>? {
// TODO: implement
return null
}
override fun getVideoWidth(): Int {
return videoWidth
}
override fun getVideoHeight(): Int {
return videoHeight
}
override fun isPlaying(): Boolean {
val state = internalPlayer?.playbackState ?: return false
return when (state) {
Player.STATE_BUFFERING, Player.STATE_READY -> internalPlayer!!.playWhenReady
Player.STATE_IDLE, Player.STATE_ENDED -> false
else -> false
}
}
@Throws(IllegalStateException::class)
override fun seekTo(msec: Long) {
internalPlayer?.seekTo(msec)
}
override fun getCurrentPosition(): Long {
return internalPlayer?.currentPosition ?: 0
}
override fun getDuration(): Long {
return internalPlayer?.duration ?: 0
}
override fun getVideoSarNum(): Int {
return 1
}
override fun getVideoSarDen(): Int {
return 1
}
override fun reset() {
internalPlayer?.release()
internalPlayer = null
exoHelper?.release()
surface = null
dataSource = null
videoWidth = 0
videoHeight = 0
}
override fun setLooping(looping: Boolean) {
isLooping = looping
}
override fun isLooping(): Boolean {
return isLooping
}
override fun setVolume(leftVolume: Float, rightVolume: Float) {
internalPlayer?.volume = (leftVolume + rightVolume) / 2
}
override fun getAudioSessionId(): Int {
return audioSessionId
}
override fun getMediaInfo(): MediaInfo? {
return null
}
@Deprecated("Deprecated in Java")
override fun setLogEnabled(enable: Boolean) {
// do nothing
}
@Deprecated("Deprecated in Java", ReplaceWith("true"))
override fun isPlayable(): Boolean {
return true
}
override fun setAudioStreamType(streamtype: Int) {
// do nothing
}
@Deprecated("Deprecated in Java")
override fun setKeepInBackground(keepInBackground: Boolean) {
// do nothing
}
override fun release() {
if (internalPlayer != null) {
reset()
eventLogger = null
}
}
/**
* 设置seek 的临近帧。
*/
fun setSeekParameter(seekParameters: SeekParameters?) {
internalPlayer?.setSeekParameters(seekParameters)
}
fun getMediaSource(): MediaSource? {
return mediaSource
}
fun setMediaSource(mediaSource: MediaSource?) {
this.mediaSource = mediaSource
}
/**
* 倍速播放
*
* @param speed 倍速播放默认为1
* @param pitch 音量缩放默认为1修改会导致声音变调
*/
fun setSpeed(@Size(min = 0) speed: Float, @Size(min = 0) pitch: Float) {
val playbackParameters = PlaybackParameters(speed, pitch)
speedPlaybackParameters = playbackParameters
internalPlayer?.setPlaybackParameters(playbackParameters)
}
fun getSpeed(): Float {
return internalPlayer?.playbackParameters?.speed ?: 0F
}
val bufferedPercentage: Int get() = internalPlayer?.bufferedPercentage ?: 0
fun getTrackSelector(): MappingTrackSelector? {
return trackSelector
}
fun setTrackSelector(trackSelector: MappingTrackSelector?) {
this.trackSelector = trackSelector
}
fun getLoadControl(): LoadControl? {
return loadControl
}
fun setLoadControl(loadControl: LoadControl?) {
this.loadControl = loadControl
}
fun getRendererFactory(): DefaultRenderersFactory? {
return rendererFactory
}
fun setRendererFactory(rendererFactory: DefaultRenderersFactory?) {
this.rendererFactory = rendererFactory
}
@Deprecated("Deprecated in Java")
override fun onTimelineChanged(timeline: Timeline, manifest: Any?, reason: Int) {
}
@Deprecated("Deprecated in Java")
override fun onPlayerStateChanged(playWhenReady: Boolean, playbackState: Int) {
//重新播放状态顺序为STATE_IDLE -》STATE_BUFFERING -》STATE_READY
//缓冲时顺序为STATE_BUFFERING -》STATE_READY
// Log.e("CustomIjkExo2Player",
// "onPlayerStateChanged: playWhenReady = $playWhenReady, playbackState = $playbackState"
// )
if (isLastReportedPlayWhenReady != playWhenReady || lastReportedPlaybackState != playbackState) {
var buffer = 0
if (internalPlayer != null) {
buffer = internalPlayer!!.bufferedPercentage
}
if (isBuffering) {
when (playbackState) {
Player.STATE_ENDED, Player.STATE_READY -> {
notifyOnInfo(MEDIA_INFO_BUFFERING_END, buffer)
isBuffering = false
}
else -> {}
}
}
if (isPreparing) {
when (playbackState) {
Player.STATE_READY -> {
notifyOnPrepared()
isPreparing = false
}
else -> {}
}
}
when (playbackState) {
Player.STATE_BUFFERING -> {
notifyOnInfo(MEDIA_INFO_BUFFERING_START, buffer)
isBuffering = true
}
Player.STATE_READY -> {}
Player.STATE_ENDED -> notifyOnCompletion()
else -> {}
}
}
isLastReportedPlayWhenReady = playWhenReady
lastReportedPlaybackState = playbackState
}
override fun onRepeatModeChanged(repeatMode: Int) {}
override fun onShuffleModeEnabledChanged(shuffleModeEnabled: Boolean) {}
override fun onPlayerError(error: ExoPlaybackException) {
notifyOnError(MEDIA_ERROR_UNKNOWN, MEDIA_ERROR_UNKNOWN)
}
override fun onPositionDiscontinuity(reason: Int) {}
override fun onPlaybackParametersChanged(playbackParameters: PlaybackParameters) {}
@Deprecated("Deprecated in Java")
override fun onPlayerStateChanged(eventTime: EventTime, playWhenReady: Boolean, playbackState: Int) {
}
override fun onTimelineChanged(eventTime: EventTime, reason: Int) {}
override fun onPositionDiscontinuity(eventTime: EventTime, reason: Int) {
notifyOnInfo(ON_POSITION_DISCOUNTINUITY, reason)
}
override fun onSeekStarted(eventTime: EventTime) {}
@Deprecated("Deprecated in Java")
override fun onSeekProcessed(eventTime: EventTime) {
}
@Deprecated("Deprecated in Java", ReplaceWith("notifyOnSeekComplete()"))
override fun onSeekProcessed() {
notifyOnSeekComplete()
}
override fun onPlaybackParametersChanged(eventTime: EventTime, playbackParameters: PlaybackParameters) {}
override fun onRepeatModeChanged(eventTime: EventTime, repeatMode: Int) {}
override fun onShuffleModeChanged(eventTime: EventTime, shuffleModeEnabled: Boolean) {}
@Deprecated("Deprecated in Java")
override fun onLoadingChanged(eventTime: EventTime, isLoading: Boolean) {
}
@Deprecated("Deprecated in Java")
override fun onLoadingChanged(isLoading: Boolean) {
}
override fun onPlayerError(eventTime: EventTime, error: ExoPlaybackException) {}
override fun onTracksChanged(
eventTime: EventTime,
trackGroups: TrackGroupArray,
trackSelections: TrackSelectionArray
) {
}
override fun onTracksChanged(trackGroups: TrackGroupArray, trackSelections: TrackSelectionArray) {}
override fun onBandwidthEstimate(
eventTime: EventTime,
totalLoadTimeMs: Int,
totalBytesLoaded: Long,
bitrateEstimate: Long
) {
}
override fun onMetadata(eventTime: EventTime, metadata: Metadata) {}
@Deprecated("Deprecated in Java")
override fun onDecoderEnabled(eventTime: EventTime, trackType: Int, decoderCounters: DecoderCounters) {
}
@Deprecated("Deprecated in Java")
override fun onDecoderInitialized(
eventTime: EventTime,
trackType: Int,
decoderName: String,
initializationDurationMs: Long
) {
}
@Deprecated("Deprecated in Java")
override fun onDecoderInputFormatChanged(eventTime: EventTime, trackType: Int, format: Format) {
}
@Deprecated("Deprecated in Java")
override fun onDecoderDisabled(eventTime: EventTime, trackType: Int, decoderCounters: DecoderCounters) {
audioSessionId = C.AUDIO_SESSION_ID_UNSET
}
override fun onAudioUnderrun(
eventTime: EventTime,
bufferSize: Int,
bufferSizeMs: Long,
elapsedSinceLastFeedMs: Long
) {
}
override fun onDroppedVideoFrames(eventTime: EventTime, droppedFrames: Int, elapsedMs: Long) {}
override fun onVideoSizeChanged(
eventTime: EventTime,
width: Int,
height: Int,
unappliedRotationDegrees: Int,
pixelWidthHeightRatio: Float
) {
videoWidth = (width * pixelWidthHeightRatio).toInt()
videoHeight = height
notifyOnVideoSizeChanged((width * pixelWidthHeightRatio).toInt(), height, 1, 1)
if (unappliedRotationDegrees > 0) notifyOnInfo(MEDIA_INFO_VIDEO_ROTATION_CHANGED, unappliedRotationDegrees)
}
override fun onRenderedFirstFrame(eventTime: EventTime, surface: Surface?) {}
override fun onDrmKeysLoaded(eventTime: EventTime) {}
override fun onDrmSessionManagerError(eventTime: EventTime, error: Exception) {}
override fun onDrmKeysRestored(eventTime: EventTime) {}
override fun onDrmKeysRemoved(eventTime: EventTime) {}
companion object {
const val ON_POSITION_DISCOUNTINUITY = 2702
}
}

View File

@ -95,7 +95,7 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectTypePopupWindow(containerView: View, typeTv: TextView, typeText: String) {
typeTv.setTextColor(R.color.theme_font.toColor(context))
typeTv.setTextColor(R.color.text_theme.toColor(context))
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(typeTv.context)
@ -152,7 +152,7 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectCatalogPopupWindow(containerView: View, catalogTv: TextView, catalogText: String) {
catalogTv.setTextColor(R.color.theme_font.toColor(context))
catalogTv.setTextColor(R.color.text_theme.toColor(context))
catalogTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(catalogTv.context)
@ -211,7 +211,7 @@ class CatalogFilterView @JvmOverloads constructor(
}
private fun showSelectSizePopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
sizeTv.setTextColor(R.color.theme_font.toColor(context))
sizeTv.setTextColor(R.color.text_theme.toColor(context))
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)

View File

@ -90,7 +90,7 @@ class CategoryFilterView @JvmOverloads constructor(
}
private fun showSelectTypePopupWindow(containerView: View, typeTv: TextView, typeText: String) {
typeTv.setTextColor(R.color.theme_font.toColor(context))
typeTv.setTextColor(R.color.text_theme.toColor(context))
typeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(typeTv.context)
@ -148,7 +148,7 @@ class CategoryFilterView @JvmOverloads constructor(
}
private fun showSelectSizePopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
sizeTv.setTextColor(R.color.theme_font.toColor(context))
sizeTv.setTextColor(R.color.text_theme.toColor(context))
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)

View File

@ -112,7 +112,7 @@ class ConfigFilterView @JvmOverloads constructor(
}
private fun showSelectionPopupWindow(containerView: View, sizeTv: TextView, sizeText: String) {
sizeTv.setTextColor(R.color.theme_font.toColor(sizeTv.context))
sizeTv.setTextColor(R.color.text_theme.toColor(sizeTv.context))
sizeTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(sizeTv.context)

View File

@ -97,7 +97,7 @@ public class DownloadProgressBar extends ProgressBar {
super.onDraw(canvas);
if (TextUtils.isEmpty(mText)) return;
mPaint.setColor(mDefaultColor == 0 ? ContextCompat.getColor(getContext(), R.color.theme_font) : mDefaultColor); // 初始化颜色
mPaint.setColor(mDefaultColor == 0 ? ContextCompat.getColor(getContext(), R.color.text_theme) : mDefaultColor); // 初始化颜色
mPaint.setTextSize(mTextSize);
mFakeTextPaint.setTextSize(mTextSize);
mFakeTextPaint.setStyle(Paint.Style.FILL_AND_STROKE);
@ -187,7 +187,7 @@ public class DownloadProgressBar extends ProgressBar {
break;
case NONE:
setProgressDrawable(getResources().getDrawable(R.drawable.button_round_gray_light));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_subtitleDesc);
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_tertiary);
setProgress(0);
break;
case LAUNCH_OR_OPEN:
@ -206,12 +206,12 @@ public class DownloadProgressBar extends ProgressBar {
mDefaultColor = Color.WHITE;
} else {
setProgressDrawable(getResources().getDrawable(R.drawable.detail_downloading_normal_style));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.theme_font);
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_theme);
}
break;
case DOWNLOADING_PLUGIN:
setProgressDrawable(getResources().getDrawable(R.drawable.detail_downloading_normal_style));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.theme_font);
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_theme);
break;
case RESERVABLE:
setProgressDrawable(getResources().getDrawable(R.drawable.button_reserve));
@ -223,7 +223,7 @@ public class DownloadProgressBar extends ProgressBar {
break;
case RESERVED:
setProgressDrawable(getResources().getDrawable(R.drawable.button_round_gray_light));
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_subtitleDesc);
mDefaultColor = ContextCompat.getColor(getContext(), R.color.text_tertiary);
break;
case XAPK_FAILURE:
case XAPK_SUCCESS:

View File

@ -86,7 +86,7 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
mSelectedSubFilter = filter
mBinding?.subFilterTv?.text = filter
if (filter != mSubFilterList.firstOrNull() && mHighlightSubFilterIfItsNotDefault) {
mBinding?.subFilterTv?.setTextColor(R.color.theme_font.toColor(context))
mBinding?.subFilterTv?.setTextColor(R.color.text_theme.toColor(context))
} else {
mBinding?.subFilterTv?.setTextColor(R.color.text_757575.toColor(context))
}
@ -108,7 +108,7 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
subFilterText: String,
selectedCallback: ((String) -> Unit)
) {
subFilterTv.setTextColor(R.color.theme_font.toColor(context))
subFilterTv.setTextColor(R.color.text_theme.toColor(context))
subFilterTv.setDrawableEnd(R.drawable.ic_filter_arrow_up)
val inflater = LayoutInflater.from(subFilterTv.context)
@ -215,7 +215,7 @@ class FilterView @JvmOverloads constructor(context: Context, attrs: AttributeSet
holder.binding.titleTv.background = R.drawable.bg_tag_text.toDrawable(context)
holder.binding.titleTv.setTextColor(R.color.white.toColor(context))
} else {
holder.binding.titleTv.setBackgroundColor(R.color.background_white.toColor(context))
holder.binding.titleTv.setBackgroundColor(R.color.ui_surface.toColor(context))
holder.binding.titleTv.setTextColor(R.color.text_777777.toColor(context))
}

View File

@ -91,7 +91,7 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
val params = LayoutParams(mLastItemWidth, mItemHeight)
layoutParams = params
setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_game_detail_label_more))
if (DarkModeUtils.isDarkModeOn(context)) setColorFilter(R.color.text_title.toColor(context))
if (DarkModeUtils.isDarkModeOn(context)) setColorFilter(R.color.text_primary.toColor(context))
background = createNormalBackgroundDrawable()
scaleType = ImageView.ScaleType.CENTER
}
@ -114,7 +114,7 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
setPadding(mPadding, 0, mPadding, 0)
layoutParams = params
setTextColor(if (tag.isTop) "#${tag.color}".hexStringToIntColor() else R.color.text_title.toColor(context))
setTextColor(if (tag.isTop) "#${tag.color}".hexStringToIntColor() else R.color.text_primary.toColor(context))
background = if (tag.isTop) createTopBackgroundDrawable(tag) else createNormalBackgroundDrawable()
setOnClickListener {
onClickListener?.onItemClickListener(tag, position)

View File

@ -80,7 +80,7 @@ class GameTagFlexLinearLayout @JvmOverloads constructor(context: Context, attrs:
includeFontPadding = false
textSize = mTextSize
gravity = Gravity.CENTER
setTextColor(R.color.text_subtitleDesc.toColor(context))
setTextColor(R.color.text_tertiary.toColor(context))
val params = LayoutParams(LayoutParams.WRAP_CONTENT, mItemHeight)
params.setMargins(0, 0, mMargin, 0)

View File

@ -44,7 +44,12 @@ object DownloadDataHelper {
return if (status == DownloadStatus.add) {
"开始下载"
} else if (status == DownloadStatus.pause) {
"暂停下载"
val pauseExtraString = downloadEntity.getMetaExtra(Constants.DOWNLOAD_PAUSE_EXTRA)
if (pauseExtraString.isEmpty()) {
"暂停下载"
} else {
"暂停下载-$pauseExtraString"
}
} else if (status == DownloadStatus.resume) {
if (downloadEntity.meta[DOWNLOAD_RESUME_WAY] == DOWNLOAD_RESUME_AUTO) {
"自动恢复下载"
@ -95,6 +100,8 @@ object DownloadDataHelper {
"网络异常"
} else if (status == DownloadStatus.redirected) {
"重定向至最终地址"
} else if (status == DownloadStatus.resourceUnavailable) {
"资源不可用"
} else {
"未知状态"
}

View File

@ -870,6 +870,8 @@ public class DownloadManager implements DownloadStatusListener {
NDownloadBridge.INSTANCE.cancel(url);
mDownloadDao.delete(url);
// 避免非原子操作导致 snapshot 和 record 不一致,这里尝试清理 snapshot 的数据
mDownloadDao.update(entry, true);
if (isDeleteFile) {
FileUtils.deleteFile(entry.getPath());

View File

@ -125,11 +125,11 @@ class DownloadDialogAdapter(
rightLink.text = if (links?.size ?: 0 > 1) links?.get(1)?.title else ""
leftLink.background = GradientDrawable().apply {
cornerRadius = 8F.dip2px().toFloat()
setStroke(0.5F.dip2px(), R.color.divider.toColor(mContext))
setStroke(0.5F.dip2px(), R.color.ui_divider.toColor(mContext))
}
rightLink.background = GradientDrawable().apply {
cornerRadius = 8F.dip2px().toFloat()
setStroke(0.5F.dip2px(), R.color.divider.toColor(mContext))
setStroke(0.5F.dip2px(), R.color.ui_divider.toColor(mContext))
}
}
}

View File

@ -70,7 +70,7 @@ class DownloadDialogInstalledItemViewHolder(val binding: DownloadDialogInstalled
binding.collection.setTextColor(R.color.text_05CBA3.toColor(binding.collection.context))
gameEntity.pluginDesc + "此版本"
} else {
binding.collection.setTextColor(R.color.text_body.toColor(binding.collection.context))
binding.collection.setTextColor(R.color.text_instance.toColor(binding.collection.context))
"查看合集"
}
} else "查看详情"

View File

@ -1,6 +1,5 @@
package com.gh.download.simple
import com.halo.assistant.HaloApp
import com.lg.download.*
import com.lg.ndownload.DownloadConfig
import com.lg.ndownload.DownloadDbManager
@ -11,20 +10,9 @@ import java.util.concurrent.Executors
object SimpleDownloadManager {
private const val MAX_DOWNLOADING_TASK = 2
private val mDownloadQueue by lazy { DownloadQueue.getInstance() }
private val mExecutor by lazy { Executors.newCachedThreadPool() }
fun init() {
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadDbManager.init(HaloApp.getInstance())
}
// 设置最大同时下载任务数 (可选)
DownloadQueue.getInstance().setMaxDownloadingTask(MAX_DOWNLOADING_TASK)
}
/**
* 继续任务
*/

View File

@ -12,7 +12,7 @@ class BbsCertificationActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setNavigationTitle("社区交流身份认证")
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun isAutoResetViewBackgroundEnabled() = true

View File

@ -30,7 +30,7 @@ class BlockActivity : DownloadToolbarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setToolbarMenu(R.menu.menu_download)
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun provideNormalIntent(): Intent {
@ -54,6 +54,6 @@ class BlockActivity : DownloadToolbarActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
}

View File

@ -21,7 +21,7 @@ public class CollectionActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override
@ -32,7 +32,7 @@ public class CollectionActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@NonNull

View File

@ -19,7 +19,7 @@ public class ConcernActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override
@ -30,7 +30,7 @@ public class ConcernActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@NonNull

View File

@ -75,7 +75,7 @@ public class CropImageActivity extends ToolBarActivity {
setToolbarMenu(R.menu.menu_positive);
MenuItem menuItem = getMenuItem(R.id.layout_menu_positive);
TextView menuButton = menuItem.getActionView().findViewById(R.id.menu_answer_post);
menuButton.setTextColor(getResources().getColor(R.color.theme_font));
menuButton.setTextColor(getResources().getColor(R.color.text_theme));
float ratio = getIntent().getFloatExtra(EntranceConsts.KEY_IMAGE_CROP_RATIO, 1F);
mCropImageCustom.setCropRatio(ratio);

View File

@ -12,7 +12,6 @@ import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.download.DownloadFragment;
import com.gh.vspace.VHelper;
@ -33,7 +32,7 @@ public class DownloadManagerActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
if (VHelper.isVGameOn()) {
setToolbarMenu(R.menu.menu_download_manager);
}
@ -78,7 +77,7 @@ public class DownloadManagerActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override

View File

@ -20,7 +20,7 @@ public class InfoActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
public static Intent getIntent(Context context) {
@ -30,7 +30,7 @@ public class InfoActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override

View File

@ -23,7 +23,7 @@ public class LibaoActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@NonNull
@ -36,7 +36,7 @@ public class LibaoActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override

View File

@ -205,7 +205,7 @@ public class LibaoDetailActivity extends ToolBarActivity implements LibaoDetailA
if (mLibaoEntity != null) {
mLibaoEntity.setClickReceiveBtnIn(isClickReceiveBtnIn);
}
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
mIsScroll = true;
mSkeleton = Skeleton.bind(mListSkeleton).shimmer(false).load(R.layout.activity_libaodetail_skeleton).show();
@ -562,16 +562,18 @@ public class LibaoDetailActivity extends ToolBarActivity implements LibaoDetailA
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.setRootBackgroundColor(mContentView, R.color.background);
mDetailBottom.setBackgroundColor(ContextCompat.getColor(this, R.color.background));
ExtensionsKt.setRootBackgroundColor(mContentView, R.color.ui_background);
mDetailBottom.setBackgroundColor(ContextCompat.getColor(this, R.color.ui_background));
mLibaoDetailRv.getRecycledViewPool().clear();
mAdapter.notifyItemRangeChanged(0, mAdapter.getItemCount());
DetailDownloadUtils.updateViewHolder(getDetailViewHolder());
if (mGameEntity != null) {
DetailDownloadUtils.updateViewHolder(getDetailViewHolder());
}
if (mLibaoDetailRv.getItemDecorationCount() > 0) {
mLibaoDetailRv.removeItemDecorationAt(0);
mLibaoDetailRv.addItemDecoration(getItemDecoration());
}
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override

View File

@ -82,11 +82,13 @@ import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.NewFlatLogUtils;
import com.gh.gamecenter.common.utils.PermissionHelper;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.common.utils.ShareUtils;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.utils.ClassUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.EmptyCallback;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.SPUtils;
@ -155,8 +157,8 @@ public class MainActivity extends BaseActivity {
public static final String SWITCH_TO_VIDEO = "switch_to_video";
public static final String SHOW_AD = "show_ad";
public static final int COUNTDOWN_AD = 100;
private static final int COUNTDOWN_MAX_COUNT = 3;
private int countdownCount = 0;
public static final int COUNTDOWN_MAX_COUNT = 3;
private int mCountdownCount = 0;
private static final String CURRENT_PAGE = "current_page";
@ -176,8 +178,8 @@ public class MainActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
mShouldShowAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null;
mShouldShowAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null
&& !HaloApp.getInstance().isAlreadyUpAndRunning;
HaloApp.getInstance().isAlreadyUpAndRunning = true;
mMainWrapperViewModel = new ViewModelProvider(this, new MainWrapperViewModel.Factory(HaloApp.getInstance()))
@ -226,6 +228,7 @@ public class MainActivity extends BaseActivity {
DataUtils.getGid();
}
mPackageViewModel = ViewModelProviders.of(this, new PackageViewModel.Factory()).get(PackageViewModel.class);
final boolean containsErrorMsg = com.gh.gamecenter.common.constant.Config.isContainsErrorMsg();
@ -507,10 +510,10 @@ public class MainActivity extends BaseActivity {
}
/**
* 显示开屏广告
* 显示冷启动开屏广告
*/
private void showSplashAd() {
if (AdDelegateHelper.INSTANCE.shouldShowStartUpAd()) {
if (AdDelegateHelper.INSTANCE.shouldShowStartUpAd(false)) {
ViewGroup startAdContainer = findViewById(R.id.startAdContainer);
ViewGroup sdkStartAdContainer = findViewById(R.id.sdkStartAdContainer);
FrameLayout adsFl = findViewById(R.id.adsFl);
@ -522,21 +525,26 @@ public class MainActivity extends BaseActivity {
float screenWidthInDp = DisplayUtils.px2dip(this, screenWidthInPx);
float screenHeightInDp = DisplayUtils.px2dip(this, screenHeightInPx);
AdDelegateHelper.requestSplashAd(
this,
screenWidthInPx,
screenHeightInPx,
screenWidthInDp,
screenHeightInDp,
startAdContainer,
sdkStartAdContainer,
adsFl,
(BaseHandler) mBaseHandler,
() -> {
hideSplashAd();
return null;
}
);
if (startAdContainer != null && sdkStartAdContainer != null && adsFl != null) {
AdDelegateHelper.requestSplashAd(
this,
screenWidthInPx,
screenHeightInPx,
screenWidthInDp,
screenHeightInDp,
startAdContainer,
sdkStartAdContainer,
adsFl,
(BaseHandler) mBaseHandler,
false,
() -> {
hideSplashAd();
return null;
}
);
} else {
hideSplashAd();
}
} else {
hideSplashAd();
}
@ -546,12 +554,13 @@ public class MainActivity extends BaseActivity {
protected void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == COUNTDOWN_AD) {
countdownCount++;
TextView jumpBtn = findViewById(R.id.jumpBtn);
jumpBtn.setText(String.format(Locale.CHINA, "跳过 %d", COUNTDOWN_MAX_COUNT - countdownCount));
if (COUNTDOWN_MAX_COUNT < countdownCount) {
mCountdownCount++;
if (COUNTDOWN_MAX_COUNT < mCountdownCount) {
AdDelegateHelper.INSTANCE.setShowingSplashAd(false);
hideSplashAd();
} else {
TextView jumpBtn = findViewById(R.id.jumpBtn);
jumpBtn.setText(String.format(Locale.CHINA, "跳过 %d", COUNTDOWN_MAX_COUNT - mCountdownCount));
mBaseHandler.sendEmptyMessageDelayed(COUNTDOWN_AD, 1000);
}
}
@ -883,6 +892,7 @@ public class MainActivity extends BaseActivity {
@Override
protected void onSaveInstanceState(@NotNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.clear();
outState.putInt(CURRENT_PAGE, mMainWrapperFragment.getCurrentItem());
if (mMainWrapperFragment != null) {
outState.putInt(BaseFragment_ViewPager.ARGS_INDEX, mMainWrapperFragment.getCurrentItem());

View File

@ -278,7 +278,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
mDetailRv = findViewById(R.id.news_detail_rv_show);
mDetailBottomLl = findViewById(R.id.news_detail_ll_bottom);
@ -807,16 +807,16 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
mNewsShare.setIcon(R.drawable.icon_share_black);
mNewsCollection.setIcon(R.drawable.community_content_detail_collect_unselect);
mDetailRv.removeItemDecoration(mItemDecoration);
mItemDecoration = new VerticalItemDecoration(this, 8, false);
mDetailRv.addItemDecoration(mItemDecoration);
if (mContentView != null) {
mContentView.setBackgroundColor(ContextCompat.getColor(this, R.color.background));
findViewById(R.id.bottomContainer).setBackgroundColor(ContextCompat.getColor(this, R.color.background_white));
((TextView) findViewById(R.id.commentTv)).setTextColor(ContextCompat.getColor(this, R.color.text_subtitle));
mContentView.setBackgroundColor(ContextCompat.getColor(this, R.color.ui_background));
findViewById(R.id.bottomContainer).setBackgroundColor(ContextCompat.getColor(this, R.color.ui_surface));
((TextView) findViewById(R.id.commentTv)).setTextColor(ContextCompat.getColor(this, R.color.text_secondary));
}
if (adapter != null) {
adapter.notifyItemRangeChanged(0, adapter.getItemCount());

View File

@ -61,7 +61,7 @@ open class SearchActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
searchEt = findViewById(R.id.searchEt)
searchBtn = findViewById(R.id.searchBtn)
@ -304,7 +304,7 @@ open class SearchActivity : BaseActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun isAutoResetViewBackgroundEnabled() = true

View File

@ -52,7 +52,7 @@ public class ShareGhActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
mGhQrcode = findViewById(R.id.gh_address_qrcode);
mGhAddress = findViewById(R.id.gh_address_tv);
mContentLl = findViewById(R.id.content_ll);
@ -75,6 +75,6 @@ public class ShareGhActivity extends ToolBarActivity {
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
}

View File

@ -153,9 +153,8 @@ public class SkipActivity extends BaseActivity {
case HOST_SUGGESTION:
if (!TextUtils.isEmpty(qaId)) {
DirectUtils.directToQa(this, qaTitle, qaId);
} else if ("vgame".equals(suggestionType)) {
DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, false, true, EntranceConsts.ENTRANCE_BROWSER);
} else {
// 插件反馈跳转到意见反馈分类页
DirectUtils.directToFeedback(this, content, isQaFeedback, qaContentId, true, false, EntranceConsts.ENTRANCE_BROWSER);
}
break;
@ -226,7 +225,7 @@ public class SkipActivity extends BaseActivity {
String tagActivityName = uri.getQueryParameter("tagActivityName");
VideoLinkEntity linkEntity = new VideoLinkEntity(title, categoryId, link, tagActivityId, tagActivityName);
SimpleGameEntity simpleGameEntity = new SimpleGameEntity(gameId != null ? gameId : "", gameName != null ? gameName : "", "");
SimpleGameEntity simpleGameEntity = new SimpleGameEntity(gameId != null ? gameId : "", gameName != null ? gameName : "", "", "");
Bundle nextToBundle = VideoManagerActivity.getVideoManagerBundle(linkEntity, simpleGameEntity, EntranceConsts.ENTRANCE_BROWSER, "");
CheckLoginUtils.checkLogin(this, nextToBundle, true, EntranceConsts.ENTRANCE_BROWSER, () ->
DirectUtils.directToVideoManager(SkipActivity.this, linkEntity, simpleGameEntity, EntranceConsts.ENTRANCE_BROWSER, "浏览器"));

View File

@ -0,0 +1,98 @@
package com.gh.gamecenter
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Message
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.TextView
import com.gh.ad.AdDelegateHelper
import com.gh.ad.AdDelegateHelper.requestSplashAd
import com.gh.ad.AdDelegateHelper.shouldShowStartUpAd
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.core.utils.DisplayUtils
import java.util.*
/**
* 开屏广告(热启动)
*/
class SplashAdActivity : BaseActivity() {
private var mCountdownCount = 0
override fun getLayoutId(): Int = R.layout.activity_splash_ad
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
overridePendingTransition(0, 0)
DisplayUtils.transparentStatusBar(this)
showSplashAd()
}
/**
* 显示开屏广告
*/
private fun showSplashAd() {
if (shouldShowStartUpAd(true)) {
val startAdContainer = findViewById<ViewGroup>(R.id.startAdContainer)
val sdkStartAdContainer = findViewById<ViewGroup>(R.id.sdkStartAdContainer)
val adsFl = findViewById<FrameLayout>(R.id.adsFl)
val screenWidthInPx = DisplayUtils.getScreenWidth(this)
val screenHeightInPx = (DisplayUtils.getScreenHeight(this)
+ DisplayUtils.getStatusBarHeight(this.resources)
- 112F.dip2px())
val screenWidthInDp = DisplayUtils.px2dip(this, screenWidthInPx.toFloat()).toFloat()
val screenHeightInDp = DisplayUtils.px2dip(this, screenHeightInPx.toFloat()).toFloat()
requestSplashAd(
this,
screenWidthInPx,
screenHeightInPx,
screenWidthInDp,
screenHeightInDp,
startAdContainer!!,
sdkStartAdContainer!!,
adsFl!!,
(mBaseHandler as BaseHandler),
true
) {
finishActivity()
null
}
} else {
finishActivity()
}
}
private fun finishActivity() {
finish()
overridePendingTransition(0, 0)
}
override fun handleBackPressed(): Boolean {
return true
}
override fun handleMessage(msg: Message) {
super.handleMessage(msg)
if (msg.what == MainActivity.COUNTDOWN_AD) {
mCountdownCount++
if (MainActivity.COUNTDOWN_MAX_COUNT < mCountdownCount) {
AdDelegateHelper.isShowingSplashAd = false
finishActivity()
} else {
val jumpBtn = findViewById<TextView>(R.id.jumpBtn)
jumpBtn.text =
String.format(Locale.CHINA, "跳过 %d", MainActivity.COUNTDOWN_MAX_COUNT - mCountdownCount)
mBaseHandler.sendEmptyMessageDelayed(MainActivity.COUNTDOWN_AD, 1000)
}
}
}
companion object {
@JvmStatic
fun getIntent(context: Context): Intent {
return Intent(context, SplashAdActivity::class.java)
}
}
}

View File

@ -1,57 +1,40 @@
package com.gh.gamecenter
import android.Manifest
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
import android.text.method.ScrollingMovementMethod
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.core.app.ActivityCompat
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.g00fy2.versioncompare.Version
import com.gh.ad.AdDelegateHelper
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
import com.gh.common.util.*
import com.gh.common.util.GameSubstituteRepositoryHelper.updateGameSubstituteRepository
import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.SimpleCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.exposure.meta.MetaUtil
import com.gh.gamecenter.common.tracker.TrackerLogger
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.provider.IAppProvider
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.PrivacyPolicyEntity
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.feature.utils.PlatformUtils
import com.gh.gamecenter.pkg.PkgHelper
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.lightgame.download.FileUtils
import org.json.JSONObject
import pub.devrel.easypermissions.AfterPermissionGranted
import pub.devrel.easypermissions.EasyPermissions
import java.io.BufferedReader
import java.io.File
import java.io.IOException
import java.io.InputStreamReader
import splitties.systemservices.notificationManager
import java.text.SimpleDateFormat
import java.util.*
import kotlin.collections.ArrayList
/**
* 引导页面
@ -61,22 +44,9 @@ class SplashScreenActivity : BaseActivity() {
private var mSharedPreferences: SharedPreferences? = null
private var mIsNewForThisVersion = false
private var mStartMainActivityDirectly = false // 是否不需要用户点击立即体验就直接跳转首页
private var mViewModel: SplashScreenViewModel? = null
private var mShouldPrefetchData = true
private val mPermissions by lazy {
if (isStoragePermissionsRequired) {
arrayOf(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
PermissionHelper.PERMISSION_GET_INSTALLED_LIST
)
} else {
arrayOf(PermissionHelper.PERMISSION_GET_INSTALLED_LIST)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
mViewModel = viewModelProvider()
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
@ -104,18 +74,11 @@ class SplashScreenActivity : BaseActivity() {
// 判断是不是这个版本的新用户
if (mIsNewForThisVersion) {
mContentView.setPadding(0, 0, 0, 0)
val guideLayout = findViewById<ViewPager>(R.id.splash_intro_vp_guide)
guideLayout.adapter = GuidePagerAdapter()
// 判断是不是光环的新用户
if (HaloApp.getInstance().isBrandNewInstall) {
// 引导页需用户点击 “立即体验” 按钮才进入首页所以这里不能置为true
// https://git.ghzs.com/pm/halo-app-issues/-/issues/1422第3点
// mStartMainActivityDirectly = true;
SPUtils.setLong(Constants.SP_INITIAL_USAGE_TIME, System.currentTimeMillis())
if (!PackageFlavorHelper.IS_TEST_FLAVOR) {
showPrivacyDialog(guideLayout)
showPrivacyDialog()
} else {
// Test dex2oat
executeDex2OatInAdvance()
@ -127,11 +90,11 @@ class SplashScreenActivity : BaseActivity() {
"测试环境",
{
SPUtils.setBoolean(Constants.SP_IS_DEV_ENV, false)
showPrivacyDialog(guideLayout)
showPrivacyDialog()
},
{
SPUtils.setBoolean(Constants.SP_IS_DEV_ENV, true)
showPrivacyDialog(guideLayout)
showPrivacyDialog()
},
false,
"",
@ -140,15 +103,10 @@ class SplashScreenActivity : BaseActivity() {
}
} else {
cancelPreviousUpdateTask()
guideLayout.visibility = View.VISIBLE
//requestPermission()
}
} else {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
} else {
launchMainActivity()
}
} else {
launchMainActivity()
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
SPUtils.setString(Constants.SP_XAPK_UNZIP_ACTIVITY, "")
@ -180,41 +138,63 @@ class SplashScreenActivity : BaseActivity() {
SPUtils.setBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, false)
}
private fun showPrivacyDialog(guideLayout: ViewPager) {
private fun showPrivacyDialog() {
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
if (isSuccess) {
mShouldPrefetchData = false
prefetchData()
val callback = object : SimpleCallback<Boolean> {
override fun onCallback(arg: Boolean) {
// Dialog dismiss 后的回调
guideLayout.visibility = View.VISIBLE
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
if (arg) {
requestPermission()
} else {
mStartMainActivityDirectly = false
}
}
}
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
mViewModel?.showPrivacyPolicy({
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
}, {
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
})
// 荣耀高版本系统设备在获取已安装列表权限时,会把存储权限等的东西也一并弹出来,导致超量获取权限
// 神奇的是,只需要在获取权限前弹出一条通知,再获取权限就会恢复正常.....
val isMalfunctioningHonorDevice = Build.MANUFACTURER.lowercase() == "honor"
&& Build.VERSION.SDK_INT > Build.VERSION_CODES.R
if (isMalfunctioningHonorDevice) {
showHonorNotification()
mBaseHandler.postDelayed({
requestGetInstallListPermissionAndLaunchMainActivity()
}, 100L)
} else {
requestGetInstallListPermissionAndLaunchMainActivity()
}
} else {
DialogUtils.showPrivacyPolicyDisallowDialog(
this,
PrivacyPolicyEntity.createDefaultData()
) {
showPrivacyDialog(guideLayout)
DialogUtils.showPrivacyPolicyDisallowDialog(this) {
showPrivacyDialog()
}
}
}
}
@RequiresApi(Build.VERSION_CODES.O)
private fun showHonorNotification() {
val channel =
NotificationChannel(HONOR_CULPRIT_CHANNEL, HONOR_CULPRIT_CHANNEL, NotificationManager.IMPORTANCE_MIN)
notificationManager.createNotificationChannel(channel)
val builder = NotificationCompat.Builder(HaloApp.getInstance().application, HONOR_CULPRIT_CHANNEL)
.setSmallIcon(R.mipmap.logo)
.setContentTitle("光环助手荣耀设备启动服务")
val notification = builder.build()
notificationManager.notify(HONOR_CULPRIT_CHANNEL, HONOR_CULPRIT_ID, notification)
notificationManager.cancel(HONOR_CULPRIT_ID)
}
// 尝试获取安装应用列表权限并启动首页(不在乎结果)
private fun requestGetInstallListPermissionAndLaunchMainActivity() {
if (PackageUtils.isSupportGetInstalledAppsPermission(this)
&& PermissionHelper.isGetInstalledListPermissionDisabled(this)
) {
PermissionHelper.requestGetInstalledAppsListPermission(this, true) {
launchMainActivity()
}
} else {
launchMainActivity()
}
}
// 删除更新后的光环助手包
private fun cancelPreviousUpdateTask() {
val all = DownloadManager.getInstance().allDownloadEntity
@ -237,26 +217,12 @@ class SplashScreenActivity : BaseActivity() {
}
}
private fun requestPermission() {
if (!EasyPermissions.hasPermissions(this, *mPermissions)) {
checkAndRequestPermission()
}
}
override fun getLayoutId(): Int {
return if (mIsNewForThisVersion) {
R.layout.activity_splash_intro
} else 0
}
override fun getLayoutId() = 0
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK && event.repeatCount == 0) {
if (mIsNewForThisVersion && EasyPermissions.hasPermissions(this, *mPermissions)) {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
} else {
launchMainActivity()
}
if (mIsNewForThisVersion) {
launchMainActivity()
} else {
return true
}
@ -291,77 +257,7 @@ class SplashScreenActivity : BaseActivity() {
HaloApp.getInstance().flavorProvider.init(HaloApp.getInstance(), this, PkgHelper.getActivateRatio())
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
}
private fun getGitLogString(): String {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
val stringBuilder = StringBuilder()
var bufferedReader: BufferedReader? = null
var inputStreamReader: InputStreamReader? = null
try {
inputStreamReader = InputStreamReader(assets.open("gitlog.txt"))
bufferedReader = BufferedReader(inputStreamReader)
var line: String?
stringBuilder.append("本光环安装包最近20次代码变更如下")
stringBuilder.append(System.getProperty("line.separator"))
while (bufferedReader.readLine().also { line = it } != null) {
line?.let {
val urlRegex = Regex("http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?")
if (urlRegex.containsMatchIn(it)) {
line = urlRegex.replace(it, "")
}
}
stringBuilder.append(line)
stringBuilder.append(System.getProperty("line.separator"))
}
} catch (e: IOException) {
e.printStackTrace()
} finally {
inputStreamReader?.close()
bufferedReader?.close()
}
return stringBuilder.toString()
} else {
return ""
}
}
private fun showGitLogDialogIfNeeded() {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
val gitLog = getGitLogString()
if (gitLog.isNotEmpty()) {
val md5 = MD5Utils.getContentMD5(gitLog)
if (SPUtils.getString(Constants.GIT_LOG_MD5, "") != md5) {
SPUtils.setString(Constants.GIT_LOG_MD5, md5)
DialogHelper.showDialog(
this,
"${PackageUtils.getGhVersionName()} ${com.gh.gamecenter.common.BuildConfig.BUILD_TIME}",
gitLog,
"确定",
"",
{
launchMainActivity()
},
extraConfig = DialogHelper.Config(
centerTitle = true,
centerContent = false
),
uiModificationCallback = { binding ->
binding.contentTv.run {
maxHeight = 500F.dip2px()
textSize = 10F
isVerticalScrollBarEnabled = true
movementMethod = ScrollingMovementMethod.getInstance()
}
},
)
} else {
launchMainActivity()
}
} else {
launchMainActivity()
}
}
SensorsBridge.setOAID(HaloApp.getInstance().oaid)
}
private fun prefetchData() {
@ -393,112 +289,11 @@ class SplashScreenActivity : BaseActivity() {
}
}
@AfterPermissionGranted(REQUEST_PERMISSION_TAG)
private fun checkAndRequestPermission() {
if (EasyPermissions.hasPermissions(this, *mPermissions)) {
onPermissionsGranted(REQUEST_PERMISSION_TAG, ArrayList(mPermissions.toList()))
if (mStartMainActivityDirectly) {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
} else {
launchMainActivity()
}
}
} else {
ActivityCompat.requestPermissions(this, mPermissions, REQUEST_PERMISSION_TAG)
}
}
override fun onPermissionsDenied(requestCode: Int, perms: List<String>) {
if (mStartMainActivityDirectly) {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
} else {
launchMainActivity()
}
}
}
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>?) {
super.onPermissionsGranted(requestCode, perms)
if (perms?.contains(Manifest.permission.READ_EXTERNAL_STORAGE) == true) {
// 恢复畅玩数据
VHelper.recoverVDataIfPossible()
// 检查是否有旧版本光环,有就删掉
runOnIoThread { deleteOutdatedUpdatePackage() }
}
}
// 检查下载文件夹下是否有旧版本的光环助手的包,有则删除
private fun deleteOutdatedUpdatePackage() {
try {
val folder = File(FileUtils.getDownloadDir(this) + File.separator)
if (folder.isDirectory) {
for (file in folder.listFiles()) {
if (!file.isDirectory && file.name.startsWith("光环助手V")) {
val name = file.name
val index = name.indexOf("_")
if (index != -1) {
val versionString = name.substring(name.indexOf("V") + 1, index)
val currentVersion = Version(PackageUtils.getGhVersionName())
if (currentVersion.isHigherThan(versionString) || currentVersion.isEqual(versionString)) {
file.delete()
}
}
}
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
private inner class GuidePagerAdapter : PagerAdapter() {
private val mPics = intArrayOf(R.drawable.splash_01)
override fun getCount(): Int {
return mPics.size
}
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val view = View.inflate(container.context, R.layout.splash_guide_item, null)
val ivImage = view.findViewById<ImageView>(R.id.splsh_guide_iv_image)
ivImage.setImageResource(mPics[position])
if (position == mPics.size - 1) {
val tvSkip = view.findViewById<TextView>(R.id.splsh_guide_tv_skip)
// 如果屏幕特短,或者是平板的横屏显示,把图片改成按高度显示
if (DisplayUtils.isUltraShortScreen(this@SplashScreenActivity)) {
ivImage.scaleType = ImageView.ScaleType.CENTER_INSIDE
}
tvSkip.setOnClickListener {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded()
} else {
launchMainActivity()
}
}
}
container.addView(view)
return view
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
container.removeView(`object` as View)
}
override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object`
}
}
companion object {
private const val REQUEST_PERMISSION_TAG = 30001
// 启动时的存储权限获取是否开启
val isStoragePermissionsRequired by lazy {
HaloApp.getInstance().channel != "GH_206" && HaloApp.getInstance().channel != "GH_110"
}
const val HONOR_CULPRIT_ID = 12324
const val HONOR_CULPRIT_CHANNEL = "荣耀通道"
@JvmStatic
fun getSplashScreenIntent(context: Context?, bundle: Bundle?): Intent {

View File

@ -15,7 +15,6 @@ import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.feature.entity.AuthDialogEntity
import com.gh.gamecenter.entity.DeviceDialogEntity
import com.gh.gamecenter.entity.PrivacyPolicyEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.HaloApp
import io.reactivex.android.schedulers.AndroidSchedulers
@ -91,25 +90,6 @@ class SplashScreenViewModel(application: Application) : AndroidViewModel(applica
})
}
/**
* 获取隐私政策指引概要
*/
@SuppressLint("CheckResult")
fun showPrivacyPolicy(successCallBack: (PrivacyPolicyEntity) -> Unit, onFailureCallBack: () -> Unit) {
mApi.privacyPolicy
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : BiResponse<PrivacyPolicyEntity>() {
override fun onSuccess(data: PrivacyPolicyEntity) {
successCallBack.invoke(data)
}
override fun onFailure(exception: Exception) {
onFailureCallBack.invoke()
}
})
}
/**
* 判断新老用户
*/

View File

@ -12,14 +12,14 @@ class UserAuthActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setNavigationTitle("已获得认证")
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun isAutoResetViewBackgroundEnabled(): Boolean = false
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
companion object {

View File

@ -11,7 +11,7 @@ class UserInfoActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
companion object {
@ -28,6 +28,6 @@ class UserInfoActivity : ToolBarActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
}

View File

@ -11,7 +11,7 @@ class VerifyPhoneActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun isAutoResetViewBackgroundEnabled() = true

View File

@ -29,13 +29,13 @@ public class VoteActivity extends ToolBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
ExtensionsKt.updateStatusBarColor(this, R.color.ui_surface, R.color.ui_surface);
}
@Override

View File

@ -39,7 +39,7 @@ open class WebActivity : ToolBarActivity() {
} else {
super.onCreate(savedInstanceState)
}
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun provideNormalIntent(): Intent {
@ -72,7 +72,7 @@ open class WebActivity : ToolBarActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
companion object {

View File

@ -20,15 +20,17 @@ import android.util.Base64;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.gh.common.constant.Config;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.common.util.IntegralLogHelper;
import com.gh.gamecenter.common.callback.BiCallback;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.eventbus.EBShare;
import com.gh.gamecenter.common.utils.BitmapUtils;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.common.utils.ShareUtils;
import com.gh.gamecenter.core.provider.IAppProvider;
import com.lightgame.utils.Utils;
import com.sina.weibo.sdk.api.ImageObject;
import com.sina.weibo.sdk.api.TextObject;
@ -50,6 +52,7 @@ import java.io.ByteArrayOutputStream;
*/
@Route(path = RouteConsts.activity.weiBoShareActivity)
public class WeiBoShareActivity extends Activity implements WbShareCallback {
private IAppProvider mAppProvider = (IAppProvider) ARouter.getInstance().build(RouteConsts.provider.app).navigation();
private static final String WEIBO_SCOPE = (
"email,direct_messages_read,direct_messages_write,"
@ -95,6 +98,9 @@ public class WeiBoShareActivity extends Activity implements WbShareCallback {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (mAppProvider != null) {
mAppProvider.setSkippingThirdParty(true);
}
Bundle extras = getIntent().getExtras();
if (extras == null) return;
@ -326,4 +332,12 @@ public class WeiBoShareActivity extends Activity implements WbShareCallback {
}
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mAppProvider != null) {
mAppProvider.setSkippingThirdParty(false);
}
}
}

View File

@ -228,10 +228,10 @@ public class CleanApkAdapter extends BaseRecyclerAdapter<KcSelectGameViewHolder>
if (!mIsChooseApk) {
if (gameEntity.getInstallStatus() == INSTALLED) {
holder.binding.selectGameSize.setText(R.string.installed);
holder.binding.selectGameSize.setTextColor(ContextCompat.getColor(mContext, R.color.theme_font));
holder.binding.selectGameSize.setTextColor(ContextCompat.getColor(mContext, R.color.text_theme));
} else {
holder.binding.selectGameSize.setText(R.string.installed_not);
holder.binding.selectGameSize.setTextColor(ContextCompat.getColor(mContext, R.color.theme_red));
holder.binding.selectGameSize.setTextColor(ContextCompat.getColor(mContext, R.color.secondary_red));
}
holder.binding.selectGameDes.setText(mContext.getString(R.string.clean_apk_version, gameEntity.getGameVersion(), sizeName));
holder.binding.selectGameDes.setTextColor(ContextCompat.getColor(mContext, R.color.content));

View File

@ -37,7 +37,7 @@ public class LiBaoCodeAdapter extends BaseRecyclerAdapter<LiBaoCodeViewHolder> {
@Override
public void onBindViewHolder(LiBaoCodeViewHolder holder, int position) {
final UserDataLibaoEntity userDataLibaoEntity = mUserDataLibaoList.get(position);
holder.binding.libaoCodeTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle));
holder.binding.libaoCodeTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_secondary));
if ("ling".equals(userDataLibaoEntity.getType()) || "linged".equals(userDataLibaoEntity.getType())) {
StringBuilder content = new StringBuilder();
if (mUserDataLibaoList.size() > 1) {

View File

@ -159,15 +159,15 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
SpannableStringBuilder builder = new SpanBuilder("此礼包有问题?点击反馈")
.click(mContext, 7, 11, R.color.theme_font, false, () -> {
.click(mContext, 7, 11, R.color.text_theme, false, () -> {
HelpAndFeedbackBridge.startSuggestionActivity(mContext,
SuggestType.GAME, "libao",
StringUtils.buildString(mLibaoEntity.getName(), "有问题:"), new SimpleGameEntity(mLibaoEntity.getGame().getId(), mLibaoEntity.getGame().getName(), mLibaoEntity.getGame().getIcon()));
StringUtils.buildString(mLibaoEntity.getName(), "有问题:"), new SimpleGameEntity(mLibaoEntity.getGame().getId(), mLibaoEntity.getGame().getName(), mLibaoEntity.getGame().getIcon(), ""));
return null;
})
.build();
viewHolder.getHint().setText(builder);
viewHolder.getHint().setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle));
viewHolder.getHint().setTextColor(ContextCompat.getColor(mContext, R.color.text_secondary));
viewHolder.getHint().setMovementMethod(new LinkMovementMethod());
}
}
@ -199,7 +199,7 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
}
});
ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.background_white);
ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.ui_surface);
if (mLibaoEntity.getGame() != null) {
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript(), mLibaoEntity.getGame().getIconFloat());
GameEntity gameEntity = mLibaoEntity.getGame().toGameEntity();
@ -370,7 +370,7 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
@Override
public void updateDrawState(@NonNull TextPaint ds) {
super.updateDrawState(ds);
ds.setColor(ExtensionsKt.toColor(R.color.theme_font, mContext));
ds.setColor(ExtensionsKt.toColor(R.color.text_theme, mContext));
ds.setUnderlineText(false);
}

View File

@ -1,17 +1,22 @@
package com.gh.gamecenter.adapter
import android.content.Context
import android.content.Intent
import android.util.SparseIntArray
import android.view.ViewGroup
import androidx.core.util.forEach
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.gh.gamecenter.common.BuildConfig
/***
* 支持替换Fragment的FragmentPagerAdapter
*/
class MainFragmentPagerAdapter(
private val mContext: Context,
private val mFragmentManager: FragmentManager,
private val mFragmentsList: ArrayList<Fragment>
private val mFragmentsList: ArrayList<Fragment>,
) : FragmentPagerAdapter(mFragmentManager) {
private val mFragmentPositionSparseArray = SparseIntArray() // 记录Fragment的位置
private val mFragmentPositionUpdateSparseArray = SparseIntArray() // 记录更新后Fragment的位置
@ -76,4 +81,24 @@ class MainFragmentPagerAdapter(
override fun getItem(position: Int): Fragment = mFragmentsList[position]
override fun getItemId(position: Int): Long = mFragmentsList[position].hashCode().toLong()
override fun finishUpdate(container: ViewGroup) {
// 替换Fragment闪退关联问题REPLACE_FRAGMENT_CRASH
try {
super.finishUpdate(container)
} catch (e: Throwable) {
if (BuildConfig.DEBUG) {
throw e
} else {
e.printStackTrace()
// 重启APP
val pm = mContext.packageManager
val intent = pm?.getLaunchIntentForPackage(mContext.packageName)
val mainIntent = Intent.makeRestartActivityTask(intent!!.component)
mContext.startActivity(mainIntent)
Runtime.getRuntime().exit(0)
}
}
}
}

View File

@ -217,7 +217,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
} else if (holder instanceof FooterViewHolder) {
initFooterViewHolder((FooterViewHolder) holder);
} else if (holder instanceof CommentHeadViewHolder) {
((CommentHeadViewHolder) holder).binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white));
((CommentHeadViewHolder) holder).binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.ui_surface));
((CommentHeadViewHolder) holder).binding.commentHeadTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a));
if (mHotCommentList.size() != 0 && position == 1) {
((CommentHeadViewHolder) holder).binding.commentHeadTitle.setText(R.string.comment_hot);
@ -266,8 +266,8 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
viewHolder.binding.getRoot().setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style));
viewHolder.binding.newsDigestTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_black));
viewHolder.binding.newsDigestContent.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a));
viewHolder.binding.newsDigestCommentnum.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
viewHolder.binding.newsDigestReadNum.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
viewHolder.binding.newsDigestCommentnum.setTextColor(ContextCompat.getColor(mContext, R.color.text_tertiary));
viewHolder.binding.newsDigestReadNum.setTextColor(ContextCompat.getColor(mContext, R.color.text_tertiary));
if (mConcernEntity.getViews() != 0) {
viewHolder.binding.newsDigestReadNum.setText(NumberUtils.transSimpleCount(mConcernEntity.getViews()));
@ -355,12 +355,12 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
private void initCommentViewHolder(final CommentViewHolder holder, int position) {
holder.itemView.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style));
holder.commentContentTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_title));
holder.commentTimeTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
holder.commentReply.setTextColor(ContextCompat.getColor(mContext, R.color.text_title));
holder.commentUserNameTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle));
holder.badgeNameTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc));
holder.quoteAuthorTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle));
holder.commentContentTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_primary));
holder.commentTimeTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_tertiary));
holder.commentReply.setTextColor(ContextCompat.getColor(mContext, R.color.text_primary));
holder.commentUserNameTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_secondary));
holder.badgeNameTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_tertiary));
holder.quoteAuthorTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_secondary));
holder.commentLikeIv.setImageResource(R.drawable.comment_vote_unselect);
holder.quoteContainer.setBackground(ContextCompat.getDrawable(mContext, R.drawable.community_comment_reply_background));

View File

@ -210,10 +210,11 @@ class DetailViewHolder(
return
} else if (XapkUnzipStatus.FAILURE.name == xapkStatus) {
PermissionHelper.checkStoragePermissionBeforeAction(
mViewHolder.context,
mGameEntity.id,
(if (mGameEntity.name != null) mGameEntity.name else "")!!,
mGameEntity.categoryChinese
context = mViewHolder.context,
gameId = mGameEntity.id,
gameName = (if (mGameEntity.name != null) mGameEntity.name else "")!!,
gameType = mGameEntity.categoryChinese,
gameFormat = mGameEntity.getApk().firstOrNull()?.format
) {
if (mDownloadEntity != null) {
val path = mDownloadEntity!!.path
@ -303,7 +304,8 @@ class DetailViewHolder(
context = mViewHolder.context,
gameId = mGameEntity.id,
gameName = mGameEntity.name ?: "",
gameType = mGameEntity.categoryChinese
gameType = mGameEntity.categoryChinese,
gameFormat = mGameEntity.getApk().firstOrNull()?.format
) {
DownloadDialog.showDownloadDialog(
context = mViewHolder.context,
@ -364,7 +366,8 @@ class DetailViewHolder(
context = mViewHolder.context,
gameId = mGameEntity.id,
gameName = (if (mGameEntity.name != null) mGameEntity.name else "")!!,
gameType = mGameEntity.categoryChinese
gameType = mGameEntity.categoryChinese,
gameFormat = mGameEntity.getApk().firstOrNull()?.format
) {
if (mDownloadEntity == null) {
mDownloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshot(mGameEntity)
@ -505,7 +508,7 @@ class DetailViewHolder(
}
if (mDownloadEntity != null) {
if (downloadButton.text.contains("继续加载")) {
DownloadManager.getInstance().resume(mDownloadEntity, true)
DownloadManager.getInstance().resume(mDownloadEntity, false)
} else {
DownloadManager.getInstance().pause(mDownloadEntity!!.url)
downloadButton.text = "继续加载 " + mDownloadEntity!!.percent + "%"

View File

@ -10,6 +10,9 @@ import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.databinding.GameHeadItemBinding
import com.gh.gamecenter.entity.SubjectEntity
/**
* 专题头部
*/
class GameHeadViewHolder(var binding: GameHeadItemBinding) :
BaseRecyclerViewHolder<Any>(binding.root) {
@ -66,7 +69,7 @@ class GameHeadViewHolder(var binding: GameHeadItemBinding) :
if (binding.headMore.visibility == View.VISIBLE && (binding.headMore.text == "更多" || binding.headMore.text == "全部" || binding.headMore.text == "游戏单广场")) {
binding.arrowIv.visibility = View.VISIBLE
}
binding.headTitle.setTextColor(R.color.text_title.toColor(binding.root.context))
binding.headTitle.setTextColor(R.color.text_primary.toColor(binding.root.context))
binding.adLabelTv.goneIf(!subject.adIconActive)
}
}

View File

@ -1,15 +1,18 @@
package com.gh.gamecenter.adapter.viewholder
import com.facebook.drawee.generic.RoundingParams
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.R
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.databinding.GameImageItemBinding
import com.gh.gamecenter.feature.entity.GameEntity
/**
* 游戏专题-大图-显示/只显示
*/
class GameImageViewHolder(var binding: GameImageItemBinding) : BaseRecyclerViewHolder<Any>(binding.root) {
// 注意:专题详情的大图不能用此方法

View File

@ -65,7 +65,7 @@ public class GameViewHolder extends RecyclerView.ViewHolder {
gameServerType.setText(serverLabel.getValue());
if (gameEntity.isUseDefaultServerStyle()) {
gameServerType.setBackground(ExtensionsKt.toDrawable(R.drawable.server_label_default_bg));
gameServerType.setTextColor(ExtensionsKt.toColor(R.color.text_server_label));
gameServerType.setTextColor(ExtensionsKt.toColor(R.color.text_secondary));
} else {
gameServerType.setBackground(DrawableView.getServerDrawable(serverLabel.getColor()));
gameServerType.setTextColor(ExtensionsKt.toColor(R.color.white));

View File

@ -215,8 +215,8 @@ class AmwayAdapter(
binding.gameContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
binding.commentContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
binding.gameNameTv.setTextColor(R.color.title.toColor(context))
binding.ratingTv.setTextColor(R.color.theme_font.toColor(context))
binding.tagTv.setTextColor(R.color.text_subtitleDesc.toColor(context))
binding.ratingTv.setTextColor(R.color.text_theme.toColor(context))
binding.tagTv.setTextColor(R.color.text_tertiary.toColor(context))
binding.amwayContentTv.setTextColor(R.color.text_3a3a3a.toColor(context))
binding.userNameTv.setTextColor(R.color.title.toColor(context))
binding.likeCountTv.setTextColor(R.color.text_B3B3B3.toColor(context))
@ -233,7 +233,7 @@ class AmwayAdapter(
val m = Pattern.compile(RatingEditActivity.LABEL_REGEX).matcher(amway.comment.content)
if (m.find()) {
val contents =
TextHelper.getCommentLabelSpannableStringBuilder(amway.comment.content, R.color.theme_font)
TextHelper.getCommentLabelSpannableStringBuilder(amway.comment.content, R.color.text_theme)
binding.amwayContentTv.setTextWithHighlightedTextWrappedInsideWrapper(contents, copyClickedText = true)
} else {
binding.amwayContentTv.setTextWithHighlightedTextWrappedInsideWrapper(
@ -311,7 +311,7 @@ class AmwayAdapter(
if (amway.comment.me.isVoted) {
binding.likeIv.isChecked = true
binding.likeCountTv.setTextColor(R.color.theme_font.toColor(binding.likeCountTv.context))
binding.likeCountTv.setTextColor(R.color.text_theme.toColor(binding.likeCountTv.context))
binding.likeClickableView.setOnClickListener {
debounceActionWithInterval(binding.likeClickableView.id, 1000L) {
binding.likeIv.context.ifLogin("安利墙-取消点赞") {
@ -357,7 +357,7 @@ class AmwayAdapter(
likeIv: CheckableImageView,
likeAnimView: LottieAnimationView
) {
likeTv.setTextColor(R.color.theme_font.toColor(likeTv.context))
likeTv.setTextColor(R.color.text_theme.toColor(likeTv.context))
likeIv.isChecked = true
likeIv.visibility = View.INVISIBLE
likeAnimView.visibility = View.VISIBLE

View File

@ -354,13 +354,13 @@ class AmwayFragment : LazyListFragment<AmwayListItemData, AmwayViewModel>() {
mAlternativeBinding?.firstBackground?.goneIf(mIsDarkModeOn)
mAlternativeBinding?.secondBackground?.goneIf(mIsDarkModeOn)
mAlternativeBinding?.topBackgroundView?.goneIf(mIsDarkModeOn)
mAlternativeBinding?.listRefresh?.setBackgroundColor(R.color.background.toColor(requireContext()))
mAlternativeBinding?.listRefresh?.setBackgroundColor(R.color.ui_background.toColor(requireContext()))
onScrollChanged()
} else {
mDefaultBinding?.nightMaskView?.goneIf(!mIsDarkModeOn)
mDefaultBinding?.appbar?.setBackgroundColor(R.color.background_white.toColor(requireContext()))
mDefaultBinding?.collapsingToolbar?.setContentScrimColor(R.color.background_white.toColor(requireContext()))
mDefaultBinding?.listRefresh?.setBackgroundColor(R.color.background.toColor(requireContext()))
mDefaultBinding?.appbar?.setBackgroundColor(R.color.ui_surface.toColor(requireContext()))
mDefaultBinding?.collapsingToolbar?.setContentScrimColor(R.color.ui_surface.toColor(requireContext()))
mDefaultBinding?.listRefresh?.setBackgroundColor(R.color.ui_background.toColor(requireContext()))
}
if (mIsFromMainWrapper) {
DisplayUtils.setLightStatusBar(requireActivity(), !mIsDarkModeOn && mIsCollapsed)

View File

@ -64,7 +64,7 @@ class AmwaySearchDefaultFragment : SearchDefaultFragment() {
headTitle.text = getString(R.string.search_history)
headTitle.textSize = 16F
headActionTv.text = "清空"
headActionTv.setTextColor(R.color.text_subtitleDesc.toColor(requireContext()))
headActionTv.setTextColor(R.color.text_tertiary.toColor(requireContext()))
headActionTv.setDrawableStart(
AppCompatResources.getDrawable(
requireContext(),

View File

@ -29,10 +29,10 @@ class AmwaySearchViewHolder(var binding: AmwaySearchItemBinding, val mViewModel:
binding.hintTv.goneIf(gameEntity.showComment)
if (gameEntity.showComment) {
binding.nameTv.setTextColor(ContextCompat.getColor(binding.root.context, R.color.text_title))
binding.nameTv.setTextColor(ContextCompat.getColor(binding.root.context, R.color.text_primary))
binding.nameTv.setTypeface(binding.nameTv.typeface, Typeface.BOLD)
} else {
binding.nameTv.setTextColor(ContextCompat.getColor(binding.root.context, R.color.text_subtitleDesc))
binding.nameTv.setTextColor(ContextCompat.getColor(binding.root.context, R.color.text_tertiary))
binding.nameTv.setTypeface(binding.nameTv.typeface, Typeface.NORMAL)
}

View File

@ -73,7 +73,7 @@ class AuthorizationActivity : ToolBarActivity() {
super.onCreate(savedInstanceState)
DisplayUtils.transparentStatusBar(this)
setNavigationTitle("光环助手授权登陆")
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
mBinding = ActivityAuthorizationBinding.bind(mContentView)
checkParam()
initView()
@ -102,7 +102,7 @@ class AuthorizationActivity : ToolBarActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun onRestart() {

View File

@ -13,7 +13,7 @@ class CatalogActivity : DownloadToolbarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setToolbarMenu(R.menu.menu_download)
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun showDownloadMenu(): Boolean {
@ -26,7 +26,7 @@ class CatalogActivity : DownloadToolbarActivity() {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(R.color.background_white, R.color.background_white)
updateStatusBarColor(R.color.ui_surface, R.color.ui_surface)
}
override fun isAutoResetViewBackgroundEnabled() = true

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