Compare commits

...

77 Commits

Author SHA1 Message Date
c7094a0476 chore: 版本更新至 5.15.3 2022-12-21 09:56:23 +08:00
f8cedcf737 Merge branch 'hotfix-5.15.2-652-list_not_display' into 'legacy-release'
fix: 修改选择活动标签弹窗列表不显示问题

See merge request halo/android/assistant-android!581
2022-12-20 17:10:06 +08:00
d1e04a5743 fix: 修改选择活动标签弹窗列表不显示问题 2022-12-20 16:57:31 +08:00
cae48cb2b7 Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	dependencies.gradle
2022-12-05 17:00:22 +08:00
988b931170 chore: 版本更新到 5.14.8 2022-12-05 10:57:48 +08:00
50acd6998e Merge branch 'hotfix-v5.14.7-637-crash' into 'legacy-release'
fix: 临时修复跳转内容为空时的闪退...

See merge request halo/android/assistant-android!527
2022-12-05 10:56:15 +08:00
52b6a429bc fix: 临时修复跳转内容为空时的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/237240/?project=22&query=skip&sort=freq&statsPeriod=14d 2022-12-05 10:28:42 +08:00
cd1609a3ef chore: 版本更新至 5.15.2 2022-12-02 15:18:22 +08:00
4fd9c7b36e Merge branch 'hotfix-v5.15.1-651-game_ratting_error' into 'release'
fix: 修改游戏评论闪退问题

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

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

See merge request halo/android/assistant-android!520
2022-12-02 12:21:04 +08:00
6a4726650c fix:修复搜索专题显示空白的问题 2022-12-02 11:45:10 +08:00
001d062207 chore: 版本更新至 5.15.1 2022-12-01 16:27:31 +08:00
d4b1b822f4 Merge branch 'legacy-release' into 'release'
合并 5.14.X 闪退修复

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

See merge request halo/android/assistant-android!516
2022-12-01 16:25:36 +08:00
eeacae1fd2 fix: 修复历史游戏列表因为历史副标题颜色不存在引起的闪退 2022-12-01 16:08:17 +08:00
e982ae9125 fix: 修复双列通用合集专题因为获取到错误的位置造成的闪退 2022-12-01 16:03:20 +08:00
a7ee0c754b fix: 捕抓畅玩因为存储空间不足造成的闪退 2022-12-01 16:01:27 +08:00
094a85bfa4 Merge branch 'feature-GHZS-538' into 'release'
fix: 模拟器下载流程问题修改  https://jira.shanqu.cc/browse/GHZS-538

See merge request halo/android/assistant-android!514
2022-12-01 13:52:27 +08:00
54f0fa8dd8 fix: 模拟器下载流程问题修改 https://jira.shanqu.cc/browse/GHZS-538 2022-12-01 13:49:01 +08:00
1f331a20fa Merge branch 'feature-GHZS-538' into 'release'
fix: 模拟器下载流程问题  https://jira.shanqu.cc/browse/GHZS-538

See merge request halo/android/assistant-android!512
2022-12-01 11:40:15 +08:00
ad58699d2f fix: 模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-538 2022-12-01 11:30:21 +08:00
2ee01a0819 Merge remote-tracking branch 'origin/legacy-release' into release
# Conflicts:
#	app/src/main/java/com/gh/common/history/HistoryDatabase.kt
#	app/src/main/java/com/gh/gamecenter/entity/AmwayCommentEntity.kt
#	app/src/main/java/com/gh/gamecenter/entity/HistoryGameEntity.kt
#	dependencies.gradle
2022-11-28 16:53:02 +08:00
2242de5f83 chore: 版本更新至 5.14.7-637 2022-11-28 14:26:48 +08:00
b684fff4f1 Merge branch 'hotfix-v5.14.6-636-subtitle' into 'legacy-release'
fix: 补充遗漏的副标题(游戏动态页) https://jira.shanqu.cc/browse/GHZS-344

See merge request halo/android/assistant-android!479
2022-11-28 14:22:37 +08:00
0b0f575c41 fix: 补充遗漏的副标题(游戏动态页) https://jira.shanqu.cc/browse/GHZS-344 2022-11-28 14:05:15 +08:00
fad7083a2c Merge branch 'feature-GHZS-344' into 'legacy-release'
feat: 【光环助手】副标题遗漏场景补充 https://jira.shanqu.cc/browse/GHZS-344

See merge request halo/android/assistant-android!477
2022-11-28 11:25:05 +08:00
da22540af3 feat: 【光环助手】副标题遗漏场景补充 https://jira.shanqu.cc/browse/GHZS-344 2022-11-25 16:23:06 +08:00
0bc638a2f9 Merge branch 'merge-release_to_dev' into 'dev'
Merge release to dev

See merge request halo/android/assistant-android!468
2022-11-24 10:50:10 +08:00
1ae64c35b9 Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt
#	dependencies.gradle
2022-11-24 10:38:48 +08:00
252566837a chore: 版本更新至 5.14.6 2022-11-24 10:06:24 +08:00
94d249312b Merge branch 'hotfix-v5.13.7-617-try_catch_subtitle_crash' into 'release'
fix:捕获游戏详情副标题的异常

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

See merge request halo/android/assistant-android!463
2022-11-23 16:26:09 +08:00
5cd9197d0f fix: 修复模拟器上部分副标题不显示的问题,为分类页面和开服表页面添加副标题支持 https://jira.shanqu.cc/browse/GHZS-319 2022-11-23 16:26:09 +08:00
584512c2ae Merge branch 'merge-release_to_dev' into 'dev'
合并 release 变更至 dev

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

See merge request halo/android/assistant-android!460
2022-11-23 10:19:40 +08:00
0306caadb5 fix: 修复畅玩游戏反馈无法正常跳转的问题 https://jira.shanqu.cc/browse/GHZS-309 2022-11-23 10:19:40 +08:00
30268a5cda chore: 版本更新至 5.14.4 2022-11-15 11:13:52 +08:00
5d4f489ddd Merge branch 'release-merge-legacy_release' into 'release'
合并 legacy-release 变更

See merge request halo/android/assistant-android!434
2022-11-15 11:13:03 +08:00
102d285c09 Merge remote-tracking branch 'origin/legacy-release' into release-merge-legacy_release
# Conflicts:
#	app/src/main/java/com/gh/gamecenter/SplashScreenActivity.kt
#	dependencies.gradle
2022-11-15 10:57:41 +08:00
6b0611e05f chore: 版本更新至 5.13.7 2022-11-14 15:29:23 +08:00
384469bcae Merge branch 'feature-GHZS-209' into 'legacy-release'
feat: 还原首次启动时的权限提示弹窗和权限获取 https://jira.shanqu.cc/browse/GHZS-209

See merge request halo/android/assistant-android!431
2022-11-14 15:22:06 +08:00
0aeb37a5eb feat: 还原首次启动时的权限提示弹窗和权限获取 https://jira.shanqu.cc/browse/GHZS-209 2022-11-14 14:27:10 +08:00
900ee8e641 chore:版本更新至 5.13.6 2022-11-10 15:14:16 +08:00
bad1e32fda Merge branch 'feature-GHZS-163' into 'legacy-release'
feat:【光环助手】存储权限授权弹窗埋点补充 https://jira.shanqu.cc/browse/GHZS-163

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

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

See merge request halo/android/assistant-android!425
2022-11-10 11:00:43 +08:00
1e7c56221a fix: 修复5.0以下系统矢量图的闪退问题 2022-11-10 10:52:09 +08:00
424efdafcf fix:【光环助手V5.15.0同步正式问题】登录闪退 https://jira.shanqu.cc/browse/GHZS-116 2022-11-09 17:22:59 +08:00
44b776a156 Merge branch 'fixes-from-release' into 'dev'
合并 release 分支的改动

See merge request halo/android/assistant-android!422
2022-11-09 16:26:24 +08:00
b17fa55f94 fix: 处理合并冲突 2022-11-09 16:06:23 +08:00
5d1bc4aedd Merge remote-tracking branch 'origin/release' into dev
# Conflicts:
#	app/src/main/java/com/gh/common/constant/Config.java
#	app/src/main/java/com/gh/gamecenter/entity/NewSettingsEntity.kt
#	dependencies.gradle
#	module_common/src/main/java/com/gh/gamecenter/common/utils/Extensions.kt
2022-11-09 15:07:15 +08:00
fadd165e68 Merge branch 'hotfix-v5.14.3-633-setting_datas_error' into 'release'
fix: 修改设置接口数据保存错误问题

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

See merge request halo/android/assistant-android!419
2022-11-08 15:13:36 +08:00
b09f0cde18 fix: 捕抓清理安装包时的 concurrent 异常 2022-11-08 15:04:12 +08:00
cb355b2490 Merge branch 'hotfix-v5.14.2-632-wrong_dark_mode_setting' into 'release'
fix: 修复错误的深色模式切换开关配置

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

See merge request halo/android/assistant-android!417
2022-11-08 11:55:35 +08:00
0cc8904852 fix: 修复错误的深色模式切换开关配置 2022-11-08 11:33:33 +08:00
1ffb58feea fix: 修复因为混淆问题导致 onConfigurationChanged 没有调用 super.onConfigurationChanged 而造成的闪退 2022-11-08 11:09:32 +08:00
e80c8d76cd Merge branch 'dev-fix-issues2125-gt' into 'dev'
fix:修复模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-122

See merge request halo/android/assistant-android!415
2022-11-08 09:26:58 +08:00
f47b0326f4 fix:修复模拟器下载流程问题 https://jira.shanqu.cc/browse/GHZS-122 2022-11-08 09:26:58 +08:00
a1aada02d6 Merge branch 'dev-fix-issues2125-gt' into 'dev'
光环助手V5.15.0同步正式问题】游戏卡片UI问题

See merge request halo/android/assistant-android!413
2022-11-07 16:19:54 +08:00
659469aabc 光环助手V5.15.0同步正式问题】游戏卡片UI问题 2022-11-07 16:19:54 +08:00
3ae27ebdb6 chore: 版本更新至 5.14.2 2022-11-01 17:20:30 +08:00
aab422662a Merge branch 'hotfix-v5.14.1-631-onConfigurationChanged' into 'release'
fix: 添加 onConfigurationChanged 日志辅助闪退确定问题

See merge request halo/android/assistant-android!407
2022-11-01 17:19:23 +08:00
8193b9ec9f fix: 添加 onConfigurationChanged 日志辅助闪退确定问题 2022-11-01 16:23:54 +08:00
13929f4dc5 Merge branch 'hotfix-v5.14.1-631-webview_dark_error' into 'release'
fix: 修复web页面开启夜间模式闪退问题

See merge request halo/android/assistant-android!404
2022-11-01 16:18:12 +08:00
0ea0834140 fix: 修复web页面开启夜间模式闪退问题 2022-11-01 16:09:05 +08:00
7efdb5e432 Merge branch 'hotfix-v5.14.1-631-simulator_sync_error' into 'release'
fix: 修复模拟器游戏列表可能出现的服务端为空,本地不为空的问题

See merge request halo/android/assistant-android!393
2022-10-31 18:51:40 +08:00
87 changed files with 817 additions and 257 deletions

View File

@ -8,24 +8,26 @@ import android.text.TextUtils;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.EnvHelper;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.common.util.PackageHelper; import com.gh.common.util.PackageHelper;
import com.gh.common.util.PackageUtils; import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.BuildConfig; import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.SuggestionActivity; import com.gh.gamecenter.SuggestionActivity;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.EnvHelper;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.SPUtils; import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.entity.GameGuidePopupEntity; import com.gh.gamecenter.entity.GameGuidePopupEntity;
import com.gh.gamecenter.entity.NewApiSettingsEntity;
import com.gh.gamecenter.entity.NewSettingsEntity; import com.gh.gamecenter.entity.NewSettingsEntity;
import com.gh.gamecenter.entity.NewsEntity; import com.gh.gamecenter.entity.NewsEntity;
import com.gh.gamecenter.entity.SettingsEntity; import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.entity.SimulatorEntity; import com.gh.gamecenter.entity.SimulatorEntity;
import com.gh.gamecenter.entity.VSetting; import com.gh.gamecenter.entity.VSetting;
import com.gh.gamecenter.common.retrofit.BiResponse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.vspace.VHelper; import com.gh.vspace.VHelper;
import com.halo.assistant.HaloApp; import com.halo.assistant.HaloApp;
@ -64,8 +66,9 @@ public class Config {
private static SettingsEntity mSettingsEntity; private static SettingsEntity mSettingsEntity;
private static NewSettingsEntity mNewSettingsEntity; private static NewSettingsEntity mNewSettingsEntity;
private static NewApiSettingsEntity mNewApiSettingsEntity;
private static NewSettingsEntity.NightMode mNightModeSetting; private static NewApiSettingsEntity.NightMode mNightModeSetting;
private static SimulatorEntity mNewSimulatorEntity; private static SimulatorEntity mNewSimulatorEntity;
private static VSetting mVSetting; private static VSetting mVSetting;
private static GameGuidePopupEntity mGameGuidePopupEntity; private static GameGuidePopupEntity mGameGuidePopupEntity;
@ -227,19 +230,19 @@ public class Config {
public static SimulatorEntity getNewSimulatorEntitySetting() { public static SimulatorEntity getNewSimulatorEntitySetting() {
if (mNewSimulatorEntity != null) { if (mNewSimulatorEntity != null) {
return mNewSimulatorEntity; return mNewSimulatorEntity;
} else if (mNewSettingsEntity != null && mNewSettingsEntity.getSimulator() != null) { } else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getSimulator() != null) {
return mNewSettingsEntity.getSimulator(); return mNewApiSettingsEntity.getSimulator();
} else { } else {
return null; return null;
} }
} }
@Nullable @Nullable
public static NewSettingsEntity.NightMode getNightModeSetting() { public static NewApiSettingsEntity.NightMode getNightModeSetting() {
if (mNightModeSetting != null) { if (mNightModeSetting != null) {
return mNightModeSetting; return mNightModeSetting;
} else if (mNewSettingsEntity != null && mNewSettingsEntity.getNightMode() != null) { } else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getNightMode() != null) {
return mNewSettingsEntity.getNightMode(); return mNewApiSettingsEntity.getNightMode();
} else { } else {
return null; return null;
} }
@ -364,9 +367,6 @@ public class Config {
@Override @Override
public void onSuccess(NewSettingsEntity data) { public void onSuccess(NewSettingsEntity data) {
mNewSettingsEntity = data; mNewSettingsEntity = data;
if (mNightModeSetting != null) {
mNewSettingsEntity.setNightMode(mNightModeSetting);
}
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data)); SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
} }
}); });
@ -384,27 +384,22 @@ public class Config {
}); });
} }
if (mNightModeSetting == null && mNewSimulatorEntity == null) { if (mNewApiSettingsEntity == null) {
RetrofitManager.getInstance() RetrofitManager.getInstance()
.getNewApi().getNewSettings(PackageUtils.getGhVersionName(), channel) .getNewApi().getNewSettings(PackageUtils.getGhVersionName(), channel)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(new BiResponse<NewSettingsEntity>() { .subscribe(new BiResponse<NewApiSettingsEntity>() {
@Override @Override
public void onSuccess(NewSettingsEntity data) { public void onSuccess(NewApiSettingsEntity data) {
mNewApiSettingsEntity = data;
mNightModeSetting = data.getNightMode(); mNightModeSetting = data.getNightMode();
mNewSimulatorEntity = data.getSimulator(); mNewSimulatorEntity = data.getSimulator();
if (HaloApp.getInstance().isNewForThisVersion && mNightModeSetting != null && mNightModeSetting.getInstall()) { if (HaloApp.getInstance().isNewForThisVersion && mNightModeSetting != null && mNightModeSetting.getInstall()) {
DarkModeUtils.INSTANCE.updateFollowSystemDarkModeToSp(true); DarkModeUtils.INSTANCE.updateFollowSystemDarkModeToSp(true);
DarkModeUtils.INSTANCE.updateAppDarkModeStatusToSp(true);
DarkModeUtils.INSTANCE.initDarkMode(); DarkModeUtils.INSTANCE.initDarkMode();
} }
SPUtils.setString(Constants.SP_NEW_API_SETTINGS, GsonUtils.toJson(data));
if (mNewSettingsEntity != null) {
mNewSettingsEntity.setSimulator(mNewSimulatorEntity);
mNewSettingsEntity.setNightMode(mNightModeSetting);
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
}
} }
}); });
} }

View File

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

View File

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

View File

@ -146,21 +146,31 @@ class SimulatorDownloadManager private constructor() {
PermissionHelper.checkGetInstalledAppsListBeforeAction(context, object : EmptyCallback { PermissionHelper.checkGetInstalledAppsListBeforeAction(context, object : EmptyCallback {
override fun onCallback() { override fun onCallback() {
//判断是否隐藏 val isInstalledNewSimulator =
if (simulator?.active == false) { SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
//当没有安装新版本模拟器时候 判断是否隐藏
if (simulator?.active == false && !isInstalledNewSimulator) {
showNoneEmulatorDialog(context) showNoneEmulatorDialog(context)
return return
} }
val isInstalled = PackageUtils.isInstalledFromAllPackage(context, simulator?.apk?.packageName) var isInstalled = PackageUtils.isInstalledFromAllPackage(
context,
simulator?.apk?.packageName
)
//模拟器管理界面还是用之前的逻辑
if (isInstalledNewSimulator && location != SimulatorLocation.SIMULATOR_MANAGE) {
isInstalled = isInstalledNewSimulator
}
// val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(simulator?.apk?.packageName) // val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(simulator?.apk?.packageName)
val shouldShowUpdate = PackageUtils.isInstalledApkMatchedMd5(simulator?.apk?.packageName, simulator?.apk?.md5) val shouldShowUpdate =
PackageUtils.isInstalledApkMatchedMd5(simulator?.apk?.packageName, simulator?.apk?.md5)
val showAlertTag = SPUtils.getString(SimulatorGameManager.SIMULATOR_UPDATE_SHOW_ALERT_TAG, "") //当天是否弹过 val showAlertTag = SPUtils.getString(SimulatorGameManager.SIMULATOR_UPDATE_SHOW_ALERT_TAG, "") //当天是否弹过
val todayIsShow = showAlertTag == TimeUtils.getToday() val todayIsShow = showAlertTag == TimeUtils.getToday()
downloadType = if (shouldShowUpdate && isInstalled) "update" else "download" downloadType = if (shouldShowUpdate && isInstalled) "update" else "download"
if (downloadType == "update" && todayIsShow && location != SimulatorLocation.SIMULATOR_MANAGE){ if (downloadType == "update" && todayIsShow && location != SimulatorLocation.SIMULATOR_MANAGE) {
return return
} }
if (downloadType == "download" && isInstalled){ if (downloadType == "download" && isInstalled) {
return return
} }
val title = if (shouldShowUpdate && isInstalled) "更新模拟器" else "安装模拟器" val title = if (shouldShowUpdate && isInstalled) "更新模拟器" else "安装模拟器"

View File

@ -771,6 +771,36 @@ object DirectUtils {
jumpActivity(context, bundle) jumpActivity(context, bundle)
} }
@JvmStatic
fun directToFeedbackCompat(
context: Context,
content: String? = null,
hintType: String? = null,
isQaFeedback: Boolean = false,
qaContentId: String? = "",
entrance: String? = null
) {
val bundle = Bundle()
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
if (isQaFeedback) {
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
} else {
bundle.putString(KEY_CONTENT, content)
if (TextUtils.isEmpty(hintType)) {
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion)
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
} else {
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType)
}
}
jumpActivityCompat(context, bundle)
}
@JvmStatic @JvmStatic
fun directToDownloadManager(context: Context, entrance: String? = null) { fun directToDownloadManager(context: Context, entrance: String? = null) {
val bundle = Bundle() val bundle = Bundle()

View File

@ -787,6 +787,7 @@ object DownloadItemUtils {
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance) DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
} else if (str == context.getString(R.string.attempt)) { } else if (str == context.getString(R.string.attempt)) {
ChainBuilder().apply { ChainBuilder().apply {
addHandler(UpdateNewSimulatorHandler())
addHandler(GamePermissionHandler()) addHandler(GamePermissionHandler())
addHandler(BrowserInstallHandler()) addHandler(BrowserInstallHandler())
addHandler(PackageCheckHandler()) addHandler(PackageCheckHandler())
@ -844,8 +845,11 @@ object DownloadItemUtils {
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context) val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context) val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
var simulator = gameEntity.simulator var simulator = gameEntity.simulator
if (!isInstalledOldSimulator) { val newSimulator = Config.getNewSimulatorEntitySetting()
simulator = Config.getNewSimulatorEntitySetting() if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
if (newSimulator.active) {
simulator = newSimulator
}
} }
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) { if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
SimulatorDownloadManager.getInstance().showDownloadDialog( SimulatorDownloadManager.getInstance().showDownloadDialog(

View File

@ -241,16 +241,20 @@ object DownloadObserver {
val gameName = downloadEntity.getMetaExtra(Constants.GAME_NAME) val gameName = downloadEntity.getMetaExtra(Constants.GAME_NAME)
if (simulatorJson.isEmpty()) return if (simulatorJson.isEmpty()) return
var simulator = GsonUtils.fromJson(simulatorJson, SimulatorEntity::class.java) var simulator = GsonUtils.fromJson(simulatorJson, SimulatorEntity::class.java)
val isInstalled = PackageUtils.isInstalledFromAllPackage(HaloApp.getInstance().application, simulator.apk?.packageName) val isInstalled = PackageUtils.isInstalledFromAllPackage(
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application) HaloApp.getInstance().application,
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(HaloApp.getInstance().application) simulator.apk?.packageName
)
val isInstalledNewSimulator =
SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
val isInstalledOldSimulator =
SimulatorGameManager.isOldSimulatorInstalled(HaloApp.getInstance().application)
// if (!isInstalled && !isInstalledNewSimulator) { // if (!isInstalled && !isInstalledNewSimulator) {
val currentActivity = AppManager.getInstance().currentActivity() val currentActivity = AppManager.getInstance().currentActivity()
?: return ?: return
if (!isInstalledOldSimulator || isInstalledNewSimulator) { //如果没有安装任一旧的模拟器 或者下载了新模拟器 则使用新版本模拟器 val newSimulator = Config.getNewSimulatorEntitySetting()
Config.getNewSimulatorEntitySetting().let { if ((!isInstalledOldSimulator && newSimulator != null && newSimulator.active) || isInstalledNewSimulator) { //如果没有安装任一旧的模拟器 或者下载了新模拟器 则使用新版本模拟器
simulator = it!! simulator = newSimulator ?: simulator
}
} }
SimulatorDownloadManager.getInstance().showDownloadDialog( SimulatorDownloadManager.getInstance().showDownloadDialog(
currentActivity, simulator, currentActivity, simulator,

View File

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

View File

@ -36,6 +36,7 @@ import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.core.utils.PageSwitchDataHelper; import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
import com.gh.gamecenter.core.utils.SPUtils; import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.BuildConfig; import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.core.utils.SentryHelper;
import com.gh.gamecenter.download.DownloadedGameIdAndPackageNameDao; import com.gh.gamecenter.download.DownloadedGameIdAndPackageNameDao;
import com.gh.gamecenter.entity.ApkEntity; import com.gh.gamecenter.entity.ApkEntity;
import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.GameEntity;
@ -389,12 +390,16 @@ public class DownloadManager implements DownloadStatusListener {
* 清理不存在本地 APK 文件的任务 * 清理不存在本地 APK 文件的任务
*/ */
public void clearTasksThatFileBeenDeleted() { public void clearTasksThatFileBeenDeleted() {
for (DownloadEntity entity : getAllDownloadEntity()) { try {
if (entity.getStatus() == DownloadStatus.done) { for (DownloadEntity entity : getAllDownloadEntity()) {
if (FileUtils.isEmptyFile(entity.getPath())) { if (entity.getStatus() == DownloadStatus.done) {
cancel(entity.getUrl()); if (FileUtils.isEmptyFile(entity.getPath())) {
cancel(entity.getUrl());
}
} }
} }
} catch (Exception e) {
SentryHelper.INSTANCE.onEvent("CLEAR_DELETED_TASK_ERROR", "exception_digest", e.getLocalizedMessage());
} }
} }

View File

@ -180,6 +180,7 @@ public class MainActivity extends BaseActivity {
showAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null; showAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null;
HaloApp.getInstance().initFresco(); HaloApp.getInstance().initFresco();
HaloApp.getInstance().isAlreadyUpAndRunning = true;
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setStatusBarColor(Color.TRANSPARENT); setStatusBarColor(Color.TRANSPARENT);

View File

@ -137,7 +137,7 @@ public class SkipActivity extends BaseActivity {
if (!TextUtils.isEmpty(qaId)) { if (!TextUtils.isEmpty(qaId)) {
DirectUtils.directToQa(this, qaTitle, qaId); DirectUtils.directToQa(this, qaTitle, qaId);
} else if ("vgame".equals(suggestionType)) { } else if ("vgame".equals(suggestionType)) {
DirectUtils.directToFeedback(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER); DirectUtils.directToFeedbackCompat(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
} else { } else {
DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER); DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
} }

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter package com.gh.gamecenter
import android.Manifest
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
@ -25,6 +26,7 @@ import com.gh.common.util.GameSubstituteRepositoryHelper.updateGameSubstituteRep
import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
import com.gh.download.DownloadManager import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.activity.BaseActivity 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.Constants
import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger import com.gh.gamecenter.common.tracker.TrackerLogger
@ -60,6 +62,8 @@ class SplashScreenActivity : BaseActivity() {
private var mShouldPrefetchData = true private var mShouldPrefetchData = true
private val mPermissions = arrayOf( private val mPermissions = arrayOf(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
PermissionHelper.PERMISSION_GET_INSTALLED_LIST PermissionHelper.PERMISSION_GET_INSTALLED_LIST
) )
@ -150,42 +154,41 @@ class SplashScreenActivity : BaseActivity() {
private fun showPrivacyDialog(guideLayout: ViewPager) { private fun showPrivacyDialog(guideLayout: ViewPager) {
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean -> NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
if (isSuccess) { if (isSuccess) {
guideLayout.visibility = View.VISIBLE // guideLayout.visibility = View.VISIBLE
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false) // SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
//
// // 恢复畅玩数据
// VHelper.recoverVDataIfPossible()
//
// requestPermission()
//
// // 检查是否有旧版本光环,有就删掉
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
// if (mStartMainActivityDirectly) {
// launchMainActivity()
// }
// 恢复畅玩数据 mShouldPrefetchData = false
VHelper.recoverVDataIfPossible() prefetchData()
requestPermission() val callback = object : SimpleCallback<Boolean> {
override fun onCallback(arg: Boolean) {
// 检查是否有旧版本光环,有就删掉 // Dialog dismiss 后的回调
AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() } guideLayout.visibility = View.VISIBLE
if (mStartMainActivityDirectly) { SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
launchMainActivity() if (arg) {
} else { requestPermission()
mShouldPrefetchData = false } else {
prefetchData() mStartMainActivityDirectly = false
}
}
} }
// val callback = object : SimpleCallback<Boolean> { mViewModel?.showPrivacyPolicy({
// override fun onCallback(arg: Boolean) { DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
// // Dialog dismiss 后的回调 }, {
// guideLayout.visibility = View.VISIBLE DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false) })
// if (arg) {
// requestPermission()
// } else {
// mStartMainActivityDirectly = false
// }
// }
// }
//
// mViewModel?.showPrivacyPolicy({
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
// }, {
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
// })
} else { } else {
DialogUtils.showPrivacyPolicyDisallowDialog( DialogUtils.showPrivacyPolicyDisallowDialog(
this, this,
@ -385,10 +388,10 @@ class SplashScreenActivity : BaseActivity() {
private fun checkAndRequestPermission() { private fun checkAndRequestPermission() {
if (EasyPermissions.hasPermissions(this, *mPermissions)) { if (EasyPermissions.hasPermissions(this, *mPermissions)) {
// 恢复畅玩数据 // 恢复畅玩数据
// VHelper.recoverVDataIfPossible() VHelper.recoverVDataIfPossible()
// 检查是否有旧版本光环,有就删掉 // 检查是否有旧版本光环,有就删掉
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() } AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
if (mStartMainActivityDirectly) { if (mStartMainActivityDirectly) {
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) { if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
showGitLogDialogIfNeeded() showGitLogDialogIfNeeded()
@ -477,7 +480,7 @@ class SplashScreenActivity : BaseActivity() {
intent.action = Intent.ACTION_MAIN intent.action = Intent.ACTION_MAIN
intent.addCategory(Intent.CATEGORY_LAUNCHER) intent.addCategory(Intent.CATEGORY_LAUNCHER)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtras(bundle!!) intent.putExtras(bundle ?: Bundle())
return intent return intent
} }
} }

View File

@ -42,6 +42,7 @@ import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity;
import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
import com.gh.gamecenter.suggest.SuggestType; import com.gh.gamecenter.suggest.SuggestType;
import com.lightgame.adapter.BaseRecyclerAdapter; import com.lightgame.adapter.BaseRecyclerAdapter;
@ -196,6 +197,8 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.background_white); ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.background_white);
if (mLibaoEntity.getGame() != null) { if (mLibaoEntity.getGame() != null) {
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript()); holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript());
GameEntity gameEntity = mLibaoEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
} else { } else {
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getIcon(), null); holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getIcon(), null);
} }

View File

@ -315,9 +315,10 @@ public class DetailViewHolder {
boolean isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(mViewHolder.context); boolean isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(mViewHolder.context);
boolean isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(mViewHolder.context); boolean isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(mViewHolder.context);
SimulatorEntity simulator = mGameEntity.getSimulator(); SimulatorEntity simulator = mGameEntity.getSimulator();
if (!isInstalledOldSimulator){ SimulatorEntity newSimulator = Config.getNewSimulatorEntitySetting();
if (Config.getNewSimulatorEntitySetting() != null){ if (!isInstalledOldSimulator && newSimulator != null) {
simulator = Config.getNewSimulatorEntitySetting(); if (newSimulator.getActive()) {
simulator = newSimulator;
} }
} }

View File

@ -28,6 +28,7 @@ import com.gh.gamecenter.core.utils.NumberUtils
import com.gh.gamecenter.databinding.AmwayCommentItemBinding import com.gh.gamecenter.databinding.AmwayCommentItemBinding
import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.game.GameAndPosition import com.gh.gamecenter.game.GameAndPosition
import com.gh.gamecenter.game.GameItemViewHolder
import com.gh.gamecenter.game.vertical.GameVerticalAdapter import com.gh.gamecenter.game.vertical.GameVerticalAdapter
import com.gh.gamecenter.gamedetail.rating.RatingFragment import com.gh.gamecenter.gamedetail.rating.RatingFragment
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
@ -206,6 +207,7 @@ class AmwayAdapter(
) { ) {
val context = binding.root.context val context = binding.root.context
val amway = itemData.amwayCommentItem!! val amway = itemData.amwayCommentItem!!
val gameEntity = amway.game.toGameEntity()
binding.gameContainer.background = R.drawable.selector_f8f8f8.toDrawable(context) binding.gameContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
binding.commentContainer.background = R.drawable.selector_f8f8f8.toDrawable(context) binding.commentContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
@ -237,7 +239,8 @@ class AmwayAdapter(
) )
} }
itemData.exposureEvent = ExposureEvent.createEvent(amway.game.toGameEntity(), basicExposureSource) itemData.exposureEvent = ExposureEvent.createEvent(gameEntity, basicExposureSource)
GameItemViewHolder.initGameSubtitle(gameEntity, binding.gameSubtitleTv)
binding.gameContainer.setOnClickListener { binding.gameContainer.setOnClickListener {
GameDetailActivity.startGameDetailActivity( GameDetailActivity.startGameDetailActivity(

View File

@ -27,6 +27,7 @@ import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.CategoryGameItemBinding import com.gh.gamecenter.databinding.CategoryGameItemBinding
import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.game.GameItemViewHolder
import com.lightgame.download.DownloadEntity import com.lightgame.download.DownloadEntity
class CategoryV2ListAdapter( class CategoryV2ListAdapter(
@ -245,6 +246,8 @@ class CategoryV2ListAdapter(
) )
) )
gameDes.text = gameEntity.decoratedDes gameDes.text = gameEntity.decoratedDes
GameItemViewHolder.initGameSubtitle(gameEntity, gameSubtitleTv, gameDesSpace, root)
} }
} }

View File

@ -14,6 +14,7 @@ import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler;
import com.gh.common.util.CollectionUtils; import com.gh.common.util.CollectionUtils;
import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.R; import com.gh.gamecenter.R;
import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.viewholder.FooterViewHolder;
@ -232,6 +233,11 @@ public class AnswerAdapter extends ListAdapter<AnswerEntity> implements ISyncAda
} }
}); });
mPopupBinding.checkAllCb.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
);
mPopupBinding.checkAllCb.setOnClickListener(v -> { mPopupBinding.checkAllCb.setOnClickListener(v -> {
if (mPopupBinding.checkAllCb.isChecked()) { if (mPopupBinding.checkAllCb.isChecked()) {
selectItems.clear(); selectItems.clear();

View File

@ -16,6 +16,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener;
import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.constant.ItemViewType;
import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.common.utils.DialogHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.common.util.NewsUtils; import com.gh.common.util.NewsUtils;
@ -361,6 +362,11 @@ public class ArticleAdapter extends ListAdapter<NewsEntity> {
} }
}); });
mPopupBinding.checkAllCb.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
);
mPopupBinding.checkAllCb.setOnClickListener(v -> { mPopupBinding.checkAllCb.setOnClickListener(v -> {
if (mPopupBinding.checkAllCb.isChecked()) { if (mPopupBinding.checkAllCb.isChecked()) {
selectItems.clear(); selectItems.clear();

View File

@ -18,6 +18,7 @@ import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.databinding.CommunityAnswerItemBinding import com.gh.gamecenter.databinding.CommunityAnswerItemBinding
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
import com.gh.gamecenter.common.entity.CommunityEntity import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.history.ManageOption import com.gh.gamecenter.history.ManageOption
import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
@ -172,6 +173,11 @@ class CommunityArticleAdapter(
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)) }, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
} }
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
)
mPopupBinding?.checkAllCb?.setOnClickListener { mPopupBinding?.checkAllCb?.setOnClickListener {
if (mPopupBinding?.checkAllCb?.isChecked == true) { if (mPopupBinding?.checkAllCb?.isChecked == true) {
selectItems.clear() selectItems.clear()

View File

@ -24,6 +24,7 @@ import com.gh.gamecenter.adapter.viewholder.GameCollectionItemViewHolder
import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_USER import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_USER
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.ItemGameCollectionFlexTagBinding import com.gh.gamecenter.databinding.ItemGameCollectionFlexTagBinding
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
@ -424,6 +425,11 @@ class GamesCollectionAdapter(
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)) }, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
} }
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
)
mPopupBinding?.checkAllCb?.setOnClickListener { mPopupBinding?.checkAllCb?.setOnClickListener {
if (mPopupBinding?.checkAllCb?.isChecked == true) { if (mPopupBinding?.checkAllCb?.isChecked == true) {
selectItems.clear() selectItems.clear()

View File

@ -3,6 +3,7 @@ package com.gh.gamecenter.collection
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.drawable.StateListDrawable
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -17,6 +18,7 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.viewholder.FooterViewHolder
import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
import com.gh.gamecenter.databinding.VideoNewItemBinding import com.gh.gamecenter.databinding.VideoNewItemBinding
import com.gh.gamecenter.entity.MyVideoEntity import com.gh.gamecenter.entity.MyVideoEntity
@ -166,6 +168,11 @@ class VideoAdapter(
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)) }, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
} }
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
)
mPopupBinding?.checkAllCb?.setOnClickListener { mPopupBinding?.checkAllCb?.setOnClickListener {
if (mPopupBinding?.checkAllCb?.isChecked == true) { if (mPopupBinding?.checkAllCb?.isChecked == true) {
selectItems.clear() selectItems.clear()

View File

@ -32,6 +32,10 @@ data class AmwayCommentEntity(
@SerializedName("new_star") @SerializedName("new_star")
var star: Float, var star: Float,
var subtitle: String? = "",
@SerializedName("subtitle_style")
var subtitleStyle: TagStyleEntity? = null,
// 曝光用的位置 // 曝光用的位置
var sequence: Int = 0, var sequence: Int = 0,
var outerSequence: Int = 0 var outerSequence: Int = 0
@ -50,6 +54,9 @@ data class AmwayCommentEntity(
gameEntity.iconSubscript = iconSubscript gameEntity.iconSubscript = iconSubscript
gameEntity.platform = "" gameEntity.platform = ""
gameEntity.subtitle = subtitle ?: ""
gameEntity.subtitleStyle = subtitleStyle
gameEntity.sequence = sequence gameEntity.sequence = sequence
gameEntity.outerSequence = outerSequence gameEntity.outerSequence = outerSequence
return gameEntity return gameEntity

View File

@ -876,7 +876,11 @@ data class SimpleGame(
@SerializedName("recommend_text") @SerializedName("recommend_text")
var recommendText: String = "", var recommendText: String = "",
@SerializedName("download_status") @SerializedName("download_status")
var downloadStatus: String = "" var downloadStatus: String = "",
var subtitle: String? = "",
@SerializedName("subtitle_style")
var subtitleStyle: TagStyleEntity? = null,
) : Parcelable { ) : Parcelable {
@IgnoredOnParcel @IgnoredOnParcel
@ -902,6 +906,8 @@ data class SimpleGame(
gameEntity.recommendStar = recommendStar gameEntity.recommendStar = recommendStar
gameEntity.recommendText = recommendText gameEntity.recommendText = recommendText
gameEntity.downloadStatus = downloadStatus gameEntity.downloadStatus = downloadStatus
gameEntity.subtitle = subtitle ?: ""
gameEntity.subtitleStyle = subtitleStyle
return gameEntity return gameEntity
} }

View File

@ -16,6 +16,9 @@ data class HistoryGameEntity(
var tag: ArrayList<String>? = null, var tag: ArrayList<String>? = null,
var isLibaoExist: Boolean = false, var isLibaoExist: Boolean = false,
var subtitle: String = "",
var subtitleStyle: TagStyleEntity? = null,
@SerializedName("tag_style") @SerializedName("tag_style")
var tagStyle: ArrayList<TagStyleEntity> = ArrayList(), var tagStyle: ArrayList<TagStyleEntity> = ArrayList(),
@ -31,6 +34,8 @@ data class HistoryGameEntity(
gameEntity.des = des gameEntity.des = des
gameEntity.rawIcon = icon gameEntity.rawIcon = icon
gameEntity.iconSubscript = iconSubscript gameEntity.iconSubscript = iconSubscript
gameEntity.subtitle = subtitle
gameEntity.subtitleStyle = subtitleStyle
gameEntity.name = name gameEntity.name = name
gameEntity.tagStyle = tagStyle gameEntity.tagStyle = tagStyle
gameEntity.isLibaoExists = isLibaoExist gameEntity.isLibaoExists = isLibaoExist

View File

@ -0,0 +1,21 @@
package com.gh.gamecenter.entity
import com.google.gson.annotations.SerializedName
data class NewApiSettingsEntity(
@SerializedName("night_mode")
var nightMode: NightMode? = null,
var simulator: SimulatorEntity? = null,
) {
/**
*
* "icon": false, // 是否显示切换true显示
* "setting": false, // 设置页面是否显示true显示
* "install": false, // 安装时的默认值true开启
*/
data class NightMode(
val icon: Boolean,
val setting: Boolean,
val install: Boolean
)
}

View File

@ -5,9 +5,6 @@ import com.google.gson.annotations.SerializedName
data class NewSettingsEntity( data class NewSettingsEntity(
@SerializedName("install_model") @SerializedName("install_model")
var installModel: InstallModel? = null, var installModel: InstallModel? = null,
@SerializedName("night_mode")
var nightMode: NightMode? = null,
var simulator: SimulatorEntity? = null
) { ) {
data class InstallModel( data class InstallModel(
var status: String = "", var status: String = "",
@ -15,16 +12,4 @@ data class NewSettingsEntity(
@SerializedName("white_list") @SerializedName("white_list")
var whiteList: ArrayList<String>? = arrayListOf() var whiteList: ArrayList<String>? = arrayListOf()
) )
/**
*
* "icon": false, // 是否显示切换true显示
* "setting": false, // 设置页面是否显示true显示
* "install": false, // 安装时的默认值true开启
*/
data class NightMode(
val icon: Boolean,
val setting: Boolean,
val install: Boolean
)
} }

View File

@ -28,13 +28,13 @@ data class PrivacyPolicyEntity(
intro = "用于下载游戏,以及实现内容缓存提升浏览体验" intro = "用于下载游戏,以及实现内容缓存提升浏览体验"
) )
) )
permissions.add( // permissions.add(
PermissionsEntity( // PermissionsEntity(
icon = "res:///" + R.drawable.permission_phone_state, // icon = "res:///" + R.drawable.permission_phone_state,
name = "设备信息", // name = "设备信息",
intro = "为保障您的账号安全及使用软件与服务可安全运行" // intro = "为保障您的账号安全及使用软件与服务可安全运行"
) // )
) // )
// permissions.add(PermissionsEntity( // permissions.add(PermissionsEntity(
// icon = "res:///" + R.drawable.permission_sdk, // icon = "res:///" + R.drawable.permission_sdk,
// name = "第三方SDK使用信息提醒", // name = "第三方SDK使用信息提醒",

View File

@ -2,6 +2,7 @@ package com.gh.gamecenter.game
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.Space import android.widget.Space
import android.widget.TextView import android.widget.TextView
@ -11,6 +12,7 @@ import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.R import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.maxWidthExcludeZero
import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.common.view.DrawableView
@ -32,6 +34,7 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
) { ) {
binding.run { binding.run {
root.background = R.drawable.reuse_listview_item_style.toDrawable(root.context) root.background = R.drawable.reuse_listview_item_style.toDrawable(root.context)
selectIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(root.context))
gameKaifuType.setBackgroundColor(R.color.theme.toColor(root.context)) gameKaifuType.setBackgroundColor(R.color.theme.toColor(root.context))
gameName.setTextColor(R.color.text_title.toColor(root.context)) gameName.setTextColor(R.color.text_title.toColor(root.context))
gameDes.setTextColor(R.color.text_subtitleDesc.toColor(root.context)) gameDes.setTextColor(R.color.text_subtitleDesc.toColor(root.context))
@ -86,19 +89,17 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
} }
@JvmStatic @JvmStatic
fun initGameSubtitle( fun initGameSubtitle(entity: GameEntity,
entity: GameEntity, gameSubtitleTv: TextView,
gameSubtitleTv: TextView, gameDesSpace: Space? = null,
gameDesSpace: Space, rootContainer: ConstraintLayout? = null,
rootContainer: ConstraintLayout, forceShowSubtitle: Boolean = false) {
forceShowSubtitle: Boolean = false
) {
gameSubtitleTv.visibility = View.GONE gameSubtitleTv.visibility = View.GONE
if ((entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) || (forceShowSubtitle && entity.subtitle.isNotEmpty())) { if ((entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) || (forceShowSubtitle && entity.subtitle.isNotEmpty())) {
gameSubtitleTv.run { gameSubtitleTv.run {
visibility = View.VISIBLE visibility = View.VISIBLE
text = entity.subtitle text = entity.subtitle
if (entity.subtitleStyle != null) { if (entity.subtitleStyle != null && !TextUtils.isEmpty(entity.subtitleStyle?.color)) {
setTextColor(Color.parseColor("#${entity.subtitleStyle?.color}")) setTextColor(Color.parseColor("#${entity.subtitleStyle?.color}"))
background = GradientDrawable().apply { background = GradientDrawable().apply {
cornerRadius = 2F.dip2px().toFloat() cornerRadius = 2F.dip2px().toFloat()
@ -112,8 +113,9 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
} }
} }
} }
gameDesSpace.post { gameDesSpace?.post {
gameSubtitleTv.maxWidth = gameDesSpace.width // 模拟器上可能出现未提前 bindView 导致 gameDesSpace.width 为 0 的情况
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (entity.advanceDownload) { if (entity.advanceDownload) {
@ -124,15 +126,12 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context) background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
} }
} }
ConstraintSet().apply { rootContainer?.let {
clone(rootContainer) ConstraintSet().apply {
connect( clone(rootContainer)
R.id.game_name, connect(R.id.game_name, ConstraintSet.END, if (entity.serverLabel != null && !entity.advanceDownload && !forceShowSubtitle) R.id.recent_played_tag else R.id.gameSubtitleTv, ConstraintSet.START)
ConstraintSet.END, }.applyTo(rootContainer)
if (entity.serverLabel != null && !entity.advanceDownload && !forceShowSubtitle) R.id.recent_played_tag else R.id.gameSubtitleTv, }
ConstraintSet.START
)
}.applyTo(rootContainer)
} }
} }

View File

@ -37,6 +37,8 @@ class CommonCollectionViewHolder(val binding: CommonCollectionListBinding) : Bas
if (newState == RecyclerView.SCROLL_STATE_IDLE) { if (newState == RecyclerView.SCROLL_STATE_IDLE) {
var position = mLayoutManager.findLastCompletelyVisibleItemPosition() var position = mLayoutManager.findLastCompletelyVisibleItemPosition()
if (position == -1) position = mLayoutManager.findLastVisibleItemPosition() - 1 if (position == -1) position = mLayoutManager.findLastVisibleItemPosition() - 1
if (position < 0) return
val linkEntity = mCollection?.commonCollectionList?.get(position) val linkEntity = mCollection?.commonCollectionList?.get(position)
NewLogUtils.logSlideCommonCollection( NewLogUtils.logSlideCommonCollection(
mCollection?.id ?: "", mCollection?.id ?: "",

View File

@ -13,6 +13,7 @@ import com.gh.common.util.DownloadItemUtils
import com.gh.gamecenter.R import com.gh.gamecenter.R
import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder
import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.maxWidthExcludeZero
import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.AsyncUi import com.gh.gamecenter.common.view.AsyncUi
@ -111,7 +112,7 @@ class GameVerticalAdapter(
} }
} }
mGameDesSpace.post { mGameDesSpace.post {
gameSubtitleTv.maxWidth = mGameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(mGameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -639,7 +639,7 @@ open class GameCollectionDetailAdapter(
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -7,10 +7,10 @@ import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.gh.gamecenter.R import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.fragment.ToolbarFragment import com.gh.gamecenter.common.base.fragment.ToolbarFragment
import com.gh.gamecenter.common.databinding.FragmentListBaseBinding
import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration
import com.gh.gamecenter.common.databinding.FragmentListBaseBinding
import com.gh.gamecenter.entity.ActivityLabelEntity import com.gh.gamecenter.entity.ActivityLabelEntity
import com.gh.gamecenter.video.label.VideoLabelActivity import com.gh.gamecenter.video.label.VideoLabelActivity
import com.gh.gamecenter.video.label.VideoLabelAdapter import com.gh.gamecenter.video.label.VideoLabelAdapter
@ -50,6 +50,7 @@ class GameCollectionActivityLabelFragment : ToolbarFragment() {
if (it != null) { if (it != null) {
mBinding.reuseNoConnection.root.visibility = View.GONE mBinding.reuseNoConnection.root.visibility = View.GONE
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
mBinding.listRv.visibility = View.VISIBLE
mBinding.reuseNoneData.root.visibility = View.GONE mBinding.reuseNoneData.root.visibility = View.GONE
mAdapter?.setListData(it) mAdapter?.setListData(it)
} else { } else {

View File

@ -592,32 +592,36 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
} }
private fun subtractGameNameIfNeeded(textView: TextView, name: CharSequence, tagLayout: FrameLayout) { private fun subtractGameNameIfNeeded(textView: TextView, name: CharSequence, tagLayout: FrameLayout) {
if (!isAdded) return try {
textView.run { if (!isAdded) return
if (lineCount > 2 || (layout != null && layout.getEllipsisCount(1) > 0)) { textView.run {
val displayName = name.substring(0, name.length - 2) + "" if (lineCount > 2 || (layout != null && layout.getEllipsisCount(1) > 0)) {
text = displayName val displayName = name.substring(0, name.length - 2) + ""
if (tagLayout.getChildAt(0) != null) { text = displayName
val tagView = tagLayout.getChildAt(0) if (tagLayout.getChildAt(0) != null) {
tagView.layoutParams = (tagView.layoutParams as FrameLayout.LayoutParams).apply { val tagView = tagLayout.getChildAt(0)
setMargins(if (lineCount == 1) 0 else 4F.dip2px(), 0, 0, 0) tagView.layoutParams = (tagView.layoutParams as FrameLayout.LayoutParams).apply {
setMargins(if (lineCount == 1) 0 else 4F.dip2px(), 0, 0, 0)
}
} }
} val tagBitmap = tagLayout.convertViewToBitmap()
val tagBitmap = tagLayout.convertViewToBitmap() text = SpannableStringBuilder("$displayName ").apply {
text = SpannableStringBuilder("$displayName ").apply { tagBitmap?.let {
tagBitmap?.let { setSpan(
setSpan( CenterImageSpan(
CenterImageSpan( context,
context, it
it ), displayName.length, displayName.length + 1, Spanned.SPAN_EXCLUSIVE_INCLUSIVE
), displayName.length, displayName.length + 1, Spanned.SPAN_EXCLUSIVE_INCLUSIVE )
) }
}
post {
subtractGameNameIfNeeded(this, displayName, tagLayout)
} }
}
post {
subtractGameNameIfNeeded(this, displayName, tagLayout)
} }
} }
} catch (e: Exception) {
SentryHelper.onEvent("GAME_DETAIL_SUBTRACT_GAME_NAME_ERROR", "exception_digest", e.localizedMessage)
} }
} }

View File

@ -13,31 +13,31 @@ import android.view.View
import android.webkit.* import android.webkit.*
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders import androidx.lifecycle.ViewModelProviders
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.DefaultJsApi import com.gh.common.DefaultJsApi
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.util.* import com.gh.common.util.*
import com.gh.common.util.DialogUtils import com.gh.common.util.DialogUtils
import com.gh.common.util.NewLogUtils import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.common.view.dsbridge.DWebView
import com.gh.gamecenter.common.view.dsbridge.OnReturnValue
import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R import com.gh.gamecenter.R
import com.gh.gamecenter.ShellActivity import com.gh.gamecenter.ShellActivity
import com.gh.gamecenter.WebActivity import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.adapter.viewholder.UnAvaliableWebviewViewHolder import com.gh.gamecenter.adapter.viewholder.UnAvaliableWebviewViewHolder
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment
import com.gh.gamecenter.common.callback.CancelListener import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.entity.NotificationUgc import com.gh.gamecenter.common.entity.NotificationUgc
import com.gh.gamecenter.common.mvvm.Status
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.dsbridge.DWebView
import com.gh.gamecenter.common.view.dsbridge.OnReturnValue
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.ActivityRatingEditBinding import com.gh.gamecenter.databinding.ActivityRatingEditBinding
import com.gh.gamecenter.databinding.FragmentWebWarningBinding
import com.gh.gamecenter.entity.* import com.gh.gamecenter.entity.*
import com.gh.gamecenter.login.user.UserManager import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.common.mvvm.Status
import com.gh.gamecenter.databinding.FragmentWebWarningBinding
import com.gh.gamecenter.suggest.SuggestType import com.gh.gamecenter.suggest.SuggestType
import com.halo.assistant.HaloApp import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils import com.lightgame.utils.Utils
@ -374,12 +374,10 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
}, TrackableEntity(event = "游戏评论跳转", key = "意见反馈弹窗") }, TrackableEntity(event = "游戏评论跳转", key = "意见反馈弹窗")
) )
} }
400401 -> {
CheckLoginUtils.checkLogin(this, mEntrance) {}
}
else -> { else -> {
val errorCode = JSONObject(errorString ?: "").getInt("code")
if (errorCode == 400401) {
CheckLoginUtils.checkLogin(this, mEntrance) {}
return@Observer
}
ErrorHelper.handleError(this@RatingEditActivity, errorString, false, { ErrorHelper.handleError(this@RatingEditActivity, errorString, false, {
postGameComment(again = false) postGameComment(again = false)
}, "游戏评论及回复") }, "游戏评论及回复")

View File

@ -16,6 +16,7 @@ import com.gh.gamecenter.common.viewholder.FooterViewHolder
import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder
import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.GameItemBinding import com.gh.gamecenter.databinding.GameItemBinding
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
@ -149,6 +150,11 @@ class HistoryGameListAdapter(context: Context, private val mViewModel: HistoryGa
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)) }, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
} }
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
)
mPopupBinding?.checkAllCb?.setOnClickListener { mPopupBinding?.checkAllCb?.setOnClickListener {
if (mPopupBinding?.checkAllCb?.isChecked == true) { if (mPopupBinding?.checkAllCb?.isChecked == true) {
selectItems.clear() selectItems.clear()

View File

@ -12,13 +12,16 @@ import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.AsyncCell import com.gh.gamecenter.common.view.AsyncCell
import com.gh.gamecenter.databinding.HomeAmwayItemBinding import com.gh.gamecenter.databinding.HomeAmwayItemBinding
import com.gh.gamecenter.entity.AmwayCommentEntity import com.gh.gamecenter.entity.AmwayCommentEntity
import com.gh.gamecenter.game.GameItemViewHolder
import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity
import java.util.regex.Pattern import java.util.regex.Pattern
class HomeAmwayItemViewHolder(val binding: HomeAmwayItemBinding) : BaseRecyclerViewHolder<Any>(binding.root) { class HomeAmwayItemViewHolder(val binding: HomeAmwayItemBinding) : BaseRecyclerViewHolder<Any>(binding.root) {
fun bindAmway(amway: AmwayCommentEntity) { fun bindAmway(amway: AmwayCommentEntity) {
binding.gameIcon.displayGameIcon(amway.game.toGameEntity()) val gameEntity = amway.game.toGameEntity()
binding.gameIcon.displayGameIcon(gameEntity)
binding.gameName.text = amway.game.name binding.gameName.text = amway.game.name
binding.amwayScoreNumber.text = amway.game.star.toString() binding.amwayScoreNumber.text = amway.game.star.toString()
BindingAdapters.setGameTags(binding.gameTags, amway.game.tag, 2) BindingAdapters.setGameTags(binding.gameTags, amway.game.tag, 2)
@ -51,6 +54,7 @@ class HomeAmwayItemViewHolder(val binding: HomeAmwayItemBinding) : BaseRecyclerV
ratingName.setTextColor(R.color.text_subtitleDesc.toColor(root.context)) ratingName.setTextColor(R.color.text_subtitleDesc.toColor(root.context))
all.setTextColor(R.color.text_title.toColor(root.context)) all.setTextColor(R.color.text_title.toColor(root.context))
} }
GameItemViewHolder.initGameSubtitle(gameEntity, binding.gameSubtitleTv)
} }
} }

View File

@ -27,10 +27,12 @@ import com.gh.gamecenter.adapter.viewholder.NewsDigestViewHolder;
import com.gh.gamecenter.databinding.NewsDigestItemBinding; import com.gh.gamecenter.databinding.NewsDigestItemBinding;
import com.gh.gamecenter.entity.CommentnumEntity; import com.gh.gamecenter.entity.CommentnumEntity;
import com.gh.gamecenter.entity.ConcernEntity; import com.gh.gamecenter.entity.ConcernEntity;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.LibaoStatusEntity; import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity;
import com.gh.gamecenter.entity.ViewsEntity; import com.gh.gamecenter.entity.ViewsEntity;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.manager.CommentManager; import com.gh.gamecenter.manager.CommentManager;
import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.manager.VisitManager; import com.gh.gamecenter.manager.VisitManager;
@ -365,6 +367,9 @@ class ConcernAdapter extends BaseRecyclerAdapter<ViewHolder> {
viewHolder.binding.newsDigestThumb.displayGameIcon(concernEntity.getGameIcon(), null); viewHolder.binding.newsDigestThumb.displayGameIcon(concernEntity.getGameIcon(), null);
} }
viewHolder.binding.newsDigestTitle.setText(concernEntity.getGameName()); viewHolder.binding.newsDigestTitle.setText(concernEntity.getGameName());
GameEntity gameEntity = concernEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, viewHolder.binding.gameSubtitleTv, null, null, false);
NewsUtils.setNewsPublishOn(viewHolder.binding.newsDigestTime, concernEntity.getTime()); NewsUtils.setNewsPublishOn(viewHolder.binding.newsDigestTime, concernEntity.getTime());
if ("libao".equals(concernEntity.getType())) { if ("libao".equals(concernEntity.getType())) {

View File

@ -22,8 +22,10 @@ import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.constant.ItemViewType;
import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.databinding.LibaoItemBinding; import com.gh.gamecenter.databinding.LibaoItemBinding;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.entity.LibaoEntity;
import com.gh.gamecenter.entity.LibaoStatusEntity; import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
@ -238,6 +240,9 @@ class Libao2FragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
} }
// LibaoUtils.setLiBaoBtnStatusRound(holder.libaoBtnStatus, libaoEntity, true, mContext); // LibaoUtils.setLiBaoBtnStatusRound(holder.libaoBtnStatus, libaoEntity, true, mContext);
} }
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
} }
private void initFooterViewHolder(FooterViewHolder holder) { private void initFooterViewHolder(FooterViewHolder holder) {

View File

@ -25,10 +25,12 @@ import com.gh.gamecenter.R;
import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.viewholder.FooterViewHolder;
import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder;
import com.gh.gamecenter.databinding.LibaoItemBinding; import com.gh.gamecenter.databinding.LibaoItemBinding;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.entity.LibaoEntity;
import com.gh.gamecenter.entity.LibaoStatusEntity; import com.gh.gamecenter.entity.LibaoStatusEntity;
import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.login.user.UserManager; import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
@ -261,6 +263,9 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder>
holder.binding.libaoBtnStatus.setText("复制"); holder.binding.libaoBtnStatus.setText("复制");
holder.binding.libaoBtnStatus.setBackgroundResource(R.drawable.button_normal_round_style); holder.binding.libaoBtnStatus.setBackgroundResource(R.drawable.button_normal_round_style);
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
} else if (viewHolder instanceof FooterViewHolder) { } else if (viewHolder instanceof FooterViewHolder) {
initFooterViewHolder((FooterViewHolder) viewHolder); initFooterViewHolder((FooterViewHolder) viewHolder);
} }

View File

@ -20,10 +20,12 @@ import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.core.utils.DisplayUtils;
import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.core.utils.UrlFilterUtils;
import com.gh.gamecenter.databinding.LibaoItemBinding; import com.gh.gamecenter.databinding.LibaoItemBinding;
import com.gh.gamecenter.entity.GameEntity;
import com.gh.gamecenter.entity.LibaoEntity; import com.gh.gamecenter.entity.LibaoEntity;
import com.gh.gamecenter.entity.MeEntity; import com.gh.gamecenter.entity.MeEntity;
import com.gh.gamecenter.entity.UserDataLibaoEntity; import com.gh.gamecenter.entity.UserDataLibaoEntity;
import com.gh.gamecenter.common.retrofit.Response; import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.game.GameItemViewHolder;
import com.gh.gamecenter.retrofit.RetrofitManager; import com.gh.gamecenter.retrofit.RetrofitManager;
import com.lightgame.adapter.BaseRecyclerAdapter; import com.lightgame.adapter.BaseRecyclerAdapter;
@ -168,6 +170,8 @@ public class LibaoHistoryAdapter extends BaseRecyclerAdapter<ViewHolder> {
LibaoUtils.setLiBaoBtnStatusRound(viewHolder.binding.libaoBtnStatus, LibaoUtils.setLiBaoBtnStatusRound(viewHolder.binding.libaoBtnStatus,
libaoEntity, true, mContext); libaoEntity, true, mContext);
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
GameItemViewHolder.initGameSubtitle(gameEntity, viewHolder.binding.gameSubtitleTv, null, null, false);
} else { } else {
FooterViewHolder viewHolder = (FooterViewHolder) holder; FooterViewHolder viewHolder = (FooterViewHolder) holder;
viewHolder.initFooterViewHolder(isLoading, isNetworkError, isOver, v -> { viewHolder.initFooterViewHolder(isLoading, isNetworkError, isOver, v -> {

View File

@ -18,6 +18,7 @@ import com.gh.gamecenter.databinding.LibaoItemBinding
import com.gh.gamecenter.entity.LibaoEntity import com.gh.gamecenter.entity.LibaoEntity
import com.gh.gamecenter.entity.LibaoStatusEntity import com.gh.gamecenter.entity.LibaoStatusEntity
import com.gh.gamecenter.common.retrofit.Response import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.game.GameItemViewHolder
import com.gh.gamecenter.retrofit.RetrofitManager import com.gh.gamecenter.retrofit.RetrofitManager
import com.lightgame.adapter.BaseRecyclerAdapter import com.lightgame.adapter.BaseRecyclerAdapter
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
@ -224,6 +225,10 @@ class LibaoNewAdapter(
} }
} }
} }
libaoEntity.game?.toGameEntity()?.let {
GameItemViewHolder.initGameSubtitle(it, holder.binding.gameSubtitleTv)
}
} }
fun getLibaoListSize(): Int { fun getLibaoListSize(): Int {

View File

@ -126,7 +126,7 @@ class MyFollowedGameAdapter(context: Context, var mViewModel: MyFollowedGameView
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -127,7 +127,7 @@ class MyReservationAdapter(context: Context, var mViewModel: MyReservationViewMo
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -165,7 +165,7 @@ open class PlayedGameAdapter(
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -756,7 +756,7 @@ public interface ApiService {
* 新的设置接口 * 新的设置接口
*/ */
@GET("settings") @GET("settings")
Single<NewSettingsEntity> getNewSettings(@Query("version") String version, @Query("channel") String channel); Single<NewApiSettingsEntity> getNewSettings(@Query("version") String version, @Query("channel") String channel);
/** /**
* 获取新的配置信息,因为旧的已经太大了避免冲突 * 获取新的配置信息,因为旧的已经太大了避免冲突

View File

@ -0,0 +1,20 @@
package com.gh.gamecenter.room.converter
import androidx.room.TypeConverter
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.entity.TagStyleEntity
class TagStyleConverter {
@TypeConverter
fun toString(entity: TagStyleEntity?): String {
return entity?.toJson() ?: ""
}
@TypeConverter
fun toObject(value: String?): TagStyleEntity {
return value?.toObject() ?: TagStyleEntity()
}
}

View File

@ -166,7 +166,7 @@ class SearchGameIndexAdapter(
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -10,6 +10,7 @@ import com.gh.common.exposure.ExposureSource
import com.gh.common.util.DirectUtils import com.gh.common.util.DirectUtils
import com.gh.gamecenter.R import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.databinding.SearchGameIndexItemBinding import com.gh.gamecenter.databinding.SearchGameIndexItemBinding
import com.gh.gamecenter.databinding.SearchSubjectItemBinding import com.gh.gamecenter.databinding.SearchSubjectItemBinding
@ -75,7 +76,7 @@ class SearchSubjectItemViewHolder(var binding: SearchSubjectItemBinding) : Recyc
headContainer.headActionTv.setCompoundDrawablesWithIntrinsicBounds( headContainer.headActionTv.setCompoundDrawablesWithIntrinsicBounds(
null, null,
null, null,
VectorDrawableCompat.create(context.resources, R.drawable.ic_home_head_arrow, null), R.drawable.ic_home_head_arrow.toDrawable(context),
null null
) )
headContainer.headActionTv.setOnClickListener { headContainer.headActionTv.setOnClickListener {

View File

@ -228,7 +228,7 @@ class SearchGameResultAdapter(
} }
} }
gameDesSpace.post { gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
} }
} }
if (gameEntity.advanceDownload) { if (gameEntity.advanceDownload) {

View File

@ -25,6 +25,7 @@ import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.game.GameItemViewHolder
import com.lightgame.adapter.BaseRecyclerAdapter import com.lightgame.adapter.BaseRecyclerAdapter
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
@ -299,6 +300,8 @@ class GameServersContentAdapter(
viewHolder.binding.home2TestType.background = getServerDrawableBySource(R.color.tag_orange) viewHolder.binding.home2TestType.background = getServerDrawableBySource(R.color.tag_orange)
} }
GameItemViewHolder.initGameSubtitle(gameEntity, viewHolder.binding.gameSubtitleTv, forceShowSubtitle = true)
if (gameEntity.fixedTop!!) { if (gameEntity.fixedTop!!) {
val tag = "今日开服" val tag = "今日开服"
viewHolder.binding.home2TestType.visibility = View.VISIBLE viewHolder.binding.home2TestType.visibility = View.VISIBLE

View File

@ -36,6 +36,7 @@ import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.callback.BiCallback import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.utils.* import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.databinding.SimulatorGameItemBinding import com.gh.gamecenter.databinding.SimulatorGameItemBinding
import com.gh.gamecenter.databinding.SimulatorHeaderViewBinding import com.gh.gamecenter.databinding.SimulatorHeaderViewBinding
@ -199,6 +200,7 @@ class SimulatorGameListAdapter(
recommendStar.rating = gameEntity.recommendStar.toFloat() recommendStar.rating = gameEntity.recommendStar.toFloat()
} }
gameItemIncluded.recentPlayedTag.goneIf(!gameEntity.isRecentlyPlayed) gameItemIncluded.recentPlayedTag.goneIf(!gameEntity.isRecentlyPlayed)
gameItemIncluded.selectIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(mContext))
gameItemIncluded.selectIv.goneIf(!mShowSelectFlag) gameItemIncluded.selectIv.goneIf(!mShowSelectFlag)
gameItemIncluded.selectIv.isChecked = mSelectList[position - 1] gameItemIncluded.selectIv.isChecked = mSelectList[position - 1]
gameItemIncluded.selectIv.setOnClickListener { gameItemIncluded.selectIv.setOnClickListener {

View File

@ -6,14 +6,14 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.fragment.ToolbarFragment
import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.databinding.FragmentListBaseBinding
import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.viewModelProvider import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration import com.gh.gamecenter.common.view.divider.HorizontalDividerItemDecoration
import com.gh.gamecenter.R
import com.gh.gamecenter.entity.ActivityLabelEntity import com.gh.gamecenter.entity.ActivityLabelEntity
import com.gh.gamecenter.common.base.fragment.ToolbarFragment
import com.gh.gamecenter.common.databinding.FragmentListBaseBinding
import com.gh.gamecenter.qa.dialog.ChooseActivityDialogFragment import com.gh.gamecenter.qa.dialog.ChooseActivityDialogFragment
class VideoLabelFragment : ToolbarFragment() { class VideoLabelFragment : ToolbarFragment() {
@ -53,6 +53,7 @@ class VideoLabelFragment : ToolbarFragment() {
if (it != null) { if (it != null) {
mBinding.reuseNoConnection.root.visibility = View.GONE mBinding.reuseNoConnection.root.visibility = View.GONE
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
mBinding.listRv.visibility = View.VISIBLE
mBinding.reuseNoneData.root.visibility = View.GONE mBinding.reuseNoneData.root.visibility = View.GONE
mAdapter?.setListData(it) mAdapter?.setListData(it)
} else { } else {

View File

@ -25,6 +25,7 @@ import com.gh.gamecenter.common.baselist.LoadType
import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.constant.ItemViewType
import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.AppExecutor import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.runOnIoThread import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.CurrentActivityHolder import com.gh.gamecenter.core.utils.CurrentActivityHolder
@ -136,7 +137,7 @@ class VDownloadManagerAdapter(
holder.binding.descTv.goneIf(!mViewModel.isTypeDownloaded() || gameEntity.des?.isEmpty() == true) holder.binding.descTv.goneIf(!mViewModel.isTypeDownloaded() || gameEntity.des?.isEmpty() == true)
holder.binding.descTv.text = gameEntity.des holder.binding.descTv.text = gameEntity.des
holder.binding.selectIv.setImageDrawable(R.drawable.selector_ic_simulator.toDrawable(mContext)) holder.binding.selectIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(mContext))
holder.binding.selectIv.goneIf(mCurrentOption == ManageOption.OPTION_MANAGER) holder.binding.selectIv.goneIf(mCurrentOption == ManageOption.OPTION_MANAGER)
holder.binding.selectIv.isChecked = selectItems.contains(gameEntity.id) holder.binding.selectIv.isChecked = selectItems.contains(gameEntity.id)
@ -242,6 +243,11 @@ class VDownloadManagerAdapter(
extraConfig = DialogHelper.Config(centerTitle = true) extraConfig = DialogHelper.Config(centerTitle = true)
) )
} }
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
DrawableView.getCheckSelectorDrawable(
mContext
), null, null, null
)
mPopupBinding?.checkAllCb?.setOnClickListener { mPopupBinding?.checkAllCb?.setOnClickListener {
if (mPopupBinding?.checkAllCb?.isChecked == true) { if (mPopupBinding?.checkAllCb?.isChecked == true) {
selectItems.clear() selectItems.clear()
@ -261,7 +267,7 @@ class VDownloadManagerAdapter(
checkAllCb.setTextColor(R.color.text_title.toColor(mContext)) checkAllCb.setTextColor(R.color.text_title.toColor(mContext))
selectNumTv.setTextColor(R.color.theme_font.toColor(mContext)) selectNumTv.setTextColor(R.color.theme_font.toColor(mContext))
checkAllCb.setCompoundDrawablesWithIntrinsicBounds( checkAllCb.setCompoundDrawablesWithIntrinsicBounds(
R.drawable.selector_ic_simulator.toDrawable(mContext), DrawableView.getCheckSelectorDrawable(mContext),
null, null,
null, null,
null null

View File

@ -5,6 +5,7 @@ import android.annotation.SuppressLint
import android.content.ContentValues import android.content.ContentValues
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.database.sqlite.SQLiteFullException
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.text.TextUtils import android.text.TextUtils
@ -610,9 +611,13 @@ object VHelper {
*/ */
private fun updateVGamePlayedTime(packageName: String, lastPlayedTime: Long, totalPlayedTime: Long) { private fun updateVGamePlayedTime(packageName: String, lastPlayedTime: Long, totalPlayedTime: Long) {
getVGameSnapshot(null, packageName)?.let { getVGameSnapshot(null, packageName)?.let {
it.downloadEntity.addMetaExtra(KEY_LAST_PLAYED_TIME, totalPlayedTime.toString()) it.downloadEntity.addMetaExtra(KEY_LAST_PLAYED_TIME, lastPlayedTime.toString())
it.downloadEntity.addMetaExtra(KEY_TOTAL_PLAYED_TIME, totalPlayedTime.toString()) it.downloadEntity.addMetaExtra(KEY_TOTAL_PLAYED_TIME, totalPlayedTime.toString())
mVGameDao.insert(it) try {
mVGameDao.insert(it)
} catch (e: SQLiteFullException) {
ToastUtils.toast("设备存储空间不足,请清理后重试")
}
} }
// 更新首页排序 // 更新首页排序

View File

@ -98,6 +98,8 @@ public class HaloApp extends MultiDexApplication {
public boolean isBrandNewInstall = false; // 当前用户是否是安装光环后第一次打开 public boolean isBrandNewInstall = false; // 当前用户是否是安装光环后第一次打开
public boolean isNewForThisVersion = false; // 当前用户是否是安装当前版本后第一次打开 (包括全新和更新) public boolean isNewForThisVersion = false; // 当前用户是否是安装当前版本后第一次打开 (包括全新和更新)
public boolean isRunningForeground = false; // 标记当前 APP 是否处于前台运行中 public boolean isRunningForeground = false; // 标记当前 APP 是否处于前台运行中
public boolean isAlreadyUpAndRunning = false; // 应用是否处于运行中状态 (进入到 MainActivity 就当运行中)
private List<String> webViewAbiList; private List<String> webViewAbiList;
private ChannelProvider mChannelProvider = new ChannelProviderImp(); private ChannelProvider mChannelProvider = new ChannelProviderImp();
private final ServiceLoader<IApplication> mApplicationList = ServiceLoader.load(IApplication.class, this.getClass().getClassLoader()); private final ServiceLoader<IApplication> mApplicationList = ServiceLoader.load(IApplication.class, this.getClass().getClassLoader());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_video_setting_select" android:state_checked="true" />
<item android:drawable="@drawable/ic_selector_default" />
</selector>

View File

@ -46,10 +46,33 @@
android:textColor="@color/title" android:textColor="@color/title"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toRightOf="@id/gameIconView" app:layout_constraintLeft_toRightOf="@id/gameIconView"
app:layout_constraintRight_toLeftOf="@id/gameSubtitleTv"
app:layout_constraintTop_toTopOf="@id/gameIconView" app:layout_constraintTop_toTopOf="@id/gameIconView"
tools:text="我的世界(像素村落)如果有很长的文字的话就截断处理" /> tools:text="我的世界(像素村落)如果有很长的文字的话就截断处理" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/gameNameTv"
app:layout_constraintLeft_toRightOf="@+id/gameNameTv"
app:layout_constraintRight_toRightOf="@+id/parent"
app:layout_constraintTop_toTopOf="@+id/gameNameTv"
app:layout_goneMarginLeft="0dp"
tools:text="副标题" />
<ImageView <ImageView
android:id="@+id/starIv" android:id="@+id/starIv"
android:layout_width="12dp" android:layout_width="12dp"

View File

@ -36,8 +36,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/game_order" app:layout_constraintLeft_toRightOf="@+id/game_order"
app:layout_constraintRight_toLeftOf="@+id/gameIconView" app:layout_constraintRight_toLeftOf="@+id/gameIconView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
app:srcCompat="@drawable/selector_ic_simulator" />
<com.gh.common.view.GameIconView <com.gh.common.view.GameIconView
android:id="@+id/gameIconView" android:id="@+id/gameIconView"
@ -60,14 +59,45 @@
android:textStyle="bold" android:textStyle="bold"
app:layout_constrainedWidth="true" app:layout_constrainedWidth="true"
app:layout_constraintBottom_toTopOf="@+id/gameDescContainer" app:layout_constraintBottom_toTopOf="@+id/gameDescContainer"
app:layout_constraintEnd_toStartOf="@+id/recent_played_tag"
app:layout_constraintHorizontal_bias="0" app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="@+id/gameDescContainer" app:layout_constraintStart_toStartOf="@+id/gameDescContainer"
app:layout_constraintRight_toLeftOf="@+id/recent_played_tag"
app:layout_constraintTop_toTopOf="@+id/gameIconView" app:layout_constraintTop_toTopOf="@+id/gameIconView"
app:layout_constraintVertical_chainStyle="packed" app:layout_constraintVertical_chainStyle="packed"
tools:text="地海争霸:巫妖王再怒" /> tools:text="地海争霸:巫妖王再怒" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/game_name"
app:layout_constraintEnd_toEndOf="@+id/gameDesSpace"
app:layout_constraintStart_toEndOf="@+id/game_name"
app:layout_constraintTop_toTopOf="@+id/game_name"
app:layout_goneMarginStart="0dp"
tools:text="副标题"
tools:visibility="visible" />
<Space
android:id="@+id/gameDesSpace"
android:layout_width="0dp"
android:layout_height="28dp"
android:background="@color/black"
app:layout_constraintBottom_toTopOf="@+id/label_list"
app:layout_constraintEnd_toStartOf="@+id/download_btn"
app:layout_constraintStart_toEndOf="@+id/gameIconView"
app:layout_constraintTop_toBottomOf="@+id/game_name" />
<TextView <TextView
android:id="@+id/recent_played_tag" android:id="@+id/recent_played_tag"
android:layout_width="44dp" android:layout_width="44dp"
@ -80,9 +110,10 @@
android:textSize="9sp" android:textSize="9sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/game_name" app:layout_constraintBottom_toBottomOf="@+id/game_name"
app:layout_constraintLeft_toRightOf="@+id/game_name" app:layout_constraintEnd_toStartOf="@+id/game_kaifu_type"
app:layout_constraintRight_toLeftOf="@+id/game_kaifu_type" app:layout_constraintStart_toEndOf="@+id/game_name"
app:layout_constraintTop_toTopOf="@+id/game_name" /> app:layout_constraintTop_toTopOf="@+id/game_name"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/game_kaifu_type" android:id="@+id/game_kaifu_type"
@ -99,9 +130,11 @@
android:textSize="9sp" android:textSize="9sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/game_name" app:layout_constraintBottom_toBottomOf="@+id/game_name"
app:layout_constraintLeft_toRightOf="@+id/recent_played_tag" app:layout_constraintEnd_toEndOf="@+id/gameDescContainer"
app:layout_constraintRight_toRightOf="@+id/gameDescContainer" app:layout_constraintStart_toEndOf="@+id/recent_played_tag"
app:layout_constraintTop_toTopOf="@+id/game_name" /> app:layout_constraintTop_toTopOf="@+id/game_name"
tools:text="九游版"
tools:visibility="visible" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gameDescContainer" android:id="@+id/gameDescContainer"

View File

@ -39,8 +39,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/game_order" app:layout_constraintLeft_toRightOf="@+id/game_order"
app:layout_constraintRight_toLeftOf="@+id/gameIconView" app:layout_constraintRight_toLeftOf="@+id/gameIconView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
app:srcCompat="@drawable/selector_ic_simulator" />
<com.gh.common.view.GameIconView <com.gh.common.view.GameIconView
android:id="@+id/gameIconView" android:id="@+id/gameIconView"

View File

@ -80,7 +80,7 @@
android:layout_width="14dp" android:layout_width="14dp"
android:layout_height="14dp" android:layout_height="14dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:src="@drawable/toolbar_search_icon" app:srcCompat="@drawable/toolbar_search_icon"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintBottom_toBottomOf="parent" />

View File

@ -53,7 +53,7 @@
android:layout_height="16dp" android:layout_height="16dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:src="@drawable/toolbar_search_icon" app:srcCompat="@drawable/toolbar_search_icon"
app:layout_constraintBottom_toBottomOf="@+id/search_input" app:layout_constraintBottom_toBottomOf="@+id/search_input"
app:layout_constraintStart_toStartOf="@+id/search_input" app:layout_constraintStart_toStartOf="@+id/search_input"
app:layout_constraintTop_toTopOf="@+id/search_input" /> app:layout_constraintTop_toTopOf="@+id/search_input" />

View File

@ -69,7 +69,7 @@
android:layout_height="16dp" android:layout_height="16dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:src="@drawable/toolbar_search_icon" /> app:srcCompat="@drawable/toolbar_search_icon" />
<TextView <TextView
android:id="@+id/actionbar_search_input" android:id="@+id/actionbar_search_input"

View File

@ -36,8 +36,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/game_order" app:layout_constraintLeft_toRightOf="@+id/game_order"
app:layout_constraintRight_toLeftOf="@+id/gameIconView" app:layout_constraintRight_toLeftOf="@+id/gameIconView"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
app:srcCompat="@drawable/selector_ic_simulator" />
<com.gh.common.view.GameIconView <com.gh.common.view.GameIconView
android:id="@+id/gameIconView" android:id="@+id/gameIconView"
@ -101,6 +100,7 @@
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/game_name" app:layout_constraintBottom_toBottomOf="@+id/game_name"
app:layout_constraintLeft_toRightOf="@+id/game_name" app:layout_constraintLeft_toRightOf="@+id/game_name"
app:layout_constraintRight_toLeftOf="@+id/game_kaifu_type"
app:layout_constraintTop_toTopOf="@+id/game_name" /> app:layout_constraintTop_toTopOf="@+id/game_name" />
<TextView <TextView

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -30,7 +31,7 @@
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -45,7 +46,32 @@
android:singleLine="true" android:singleLine="true"
android:textColor="@color/text_title" android:textColor="@color/text_title"
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" /> android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="who let dog out" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_toRightOf="@id/home2_game_nameAndsize"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/home2_game_nameAndsize"
app:layout_constraintStart_toEndOf="@id/home2_game_nameAndsize"
app:layout_constraintTop_toTopOf="@id/home2_game_nameAndsize"
app:layout_goneMarginStart="0dp"
tools:text="副标题"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/home2_game_server_type" android:id="@+id/home2_game_server_type"
@ -57,10 +83,15 @@
android:paddingLeft="3dp" android:paddingLeft="3dp"
android:paddingRight="3dp" android:paddingRight="3dp"
android:paddingBottom="0.5dp" android:paddingBottom="0.5dp"
android:text="九游版"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="9sp" android:textSize="9sp"
android:visibility="gone" /> android:visibility="gone"
</RelativeLayout> app:layout_constraintBottom_toBottomOf="@id/home2_game_nameAndsize"
app:layout_constraintStart_toEndOf="@id/gameSubtitleTv"
app:layout_constraintTop_toTopOf="@id/home2_game_nameAndsize"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -167,8 +198,8 @@
android:id="@+id/home2_download_btn" android:id="@+id/home2_download_btn"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="28.5dp" android:layout_height="28.5dp"
fresco:download_button_show_progress="false" app:download_button_show_progress="false"
fresco:download_button_text_size="12sp" /> app:download_button_text_size="12sp" />
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout

View File

@ -31,21 +31,43 @@
<TextView <TextView
android:id="@+id/game_name" android:id="@+id/game_name"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginRight="12dp" android:layout_marginRight="8dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/text_title" android:textColor="@color/text_title"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constrainedWidth="true"
app:layout_constraintLeft_toRightOf="@id/game_icon" app:layout_constraintLeft_toRightOf="@id/game_icon"
app:layout_constraintRight_toRightOf="@id/amway_background" app:layout_constraintRight_toLeftOf="@id/gameSubtitleTv"
app:layout_constraintTop_toTopOf="@id/amway_background" app:layout_constraintTop_toTopOf="@id/amway_background"
tools:text="泡面三国" /> tools:text="泡面三国" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginRight="16dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_goneMarginStart="0dp"
app:layout_constraintBottom_toBottomOf="@+id/game_name"
app:layout_constraintLeft_toRightOf="@+id/game_name"
app:layout_constraintTop_toTopOf="@+id/game_name"
app:layout_constraintRight_toRightOf="@id/amway_background"
tools:text="副标题" />
<ImageView <ImageView
android:id="@+id/amway_score_icon" android:id="@+id/amway_score_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -21,7 +21,6 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/selector_ic_simulator"
tools:visibility="visible" /> tools:visibility="visible" />
<com.gh.common.view.GameIconView <com.gh.common.view.GameIconView

View File

@ -47,7 +47,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:src="@drawable/toolbar_search_icon" app:srcCompat="@drawable/toolbar_search_icon"
app:layout_constraintBottom_toBottomOf="@id/search_background" app:layout_constraintBottom_toBottomOf="@id/search_background"
app:layout_constraintLeft_toLeftOf="@id/search_background" app:layout_constraintLeft_toLeftOf="@id/search_background"
app:layout_constraintTop_toTopOf="@id/search_background" /> app:layout_constraintTop_toTopOf="@id/search_background" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -33,16 +34,49 @@
android:textColor="@color/text_title" android:textColor="@color/text_title"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/libao_game_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp" <TextView
android:includeFontPadding="false" android:id="@+id/libao_game_name"
android:singleLine="true" android:layout_width="wrap_content"
android:textColor="@color/text_subtitleDesc" android:layout_height="wrap_content"
android:textSize="12sp" /> android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/text_subtitleDesc"
android:textSize="12sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gameSubtitleTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="who let the dog out" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/libao_game_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/libao_game_name"
app:layout_constraintTop_toTopOf="@+id/libao_game_name"
tools:text="副标题" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/libao_des" android:id="@+id/libao_des"

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/background_white" android:background="@color/background_white"
@ -35,13 +37,49 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/libaodetail_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:singleLine="true"
android:textColor="@color/title" <TextView
android:textSize="16sp" /> android:id="@+id/libaodetail_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/title"
android:textSize="16sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gameSubtitleTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="who let the dog out" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/libaodetail_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/libaodetail_name"
app:layout_constraintTop_toTopOf="@id/libaodetail_name"
tools:text="副标题" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/libaodetail_game_name" android:id="@+id/libaodetail_game_name"

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style" android:background="@drawable/reuse_listview_item_style"
@ -21,19 +23,57 @@
android:layout_marginRight="11dp" /> android:layout_marginRight="11dp" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toRightOf="@id/news_digest_thumb" android:layout_toRightOf="@id/news_digest_thumb"
android:orientation="vertical"> android:orientation="vertical">
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/news_digest_title" android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="7dp" android:layout_marginBottom="7dp">
android:textColor="@color/text_black"
android:textSize="16sp" /> <TextView
android:id="@+id/news_digest_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/text_black"
android:textSize="16sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gameSubtitleTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="who let the dog out" />
<TextView
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_subtitle"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/news_digest_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/news_digest_title"
app:layout_constraintTop_toTopOf="@+id/news_digest_title"
tools:visibility="visible"
tools:text="副标题" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView <TextView
android:id="@+id/news_digest_time" android:id="@+id/news_digest_time"

View File

@ -17,8 +17,7 @@
android:button="@null" android:button="@null"
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:text="全选" android:text="全选"
android:textColor="@color/text_title" android:textColor="@color/text_title" />
app:drawableLeftCompat="@drawable/selector_ic_simulator" />
<TextView <TextView
android:id="@+id/selectNumTv" android:id="@+id/selectNumTv"

View File

@ -7,8 +7,8 @@ ext {
targetSdkVersion = 28 targetSdkVersion = 28
// application info (每个大版本之间的 versionCode 增加 20) // application info (每个大版本之间的 versionCode 增加 20)
versionCode = 650 versionCode = 653
versionName = "5.15.0" versionName = "5.15.3"
applicationId = "com.gh.gamecenter" applicationId = "com.gh.gamecenter"
// AndroidX // AndroidX

View File

@ -16,6 +16,8 @@ android {
} }
} }
vectorDrawables.useSupportLibrary = true
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode versionCode rootProject.ext.versionCode

View File

@ -80,6 +80,9 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.sentry.Breadcrumb;
import io.sentry.Sentry;
import io.sentry.SentryLevel;
import kotlin.Pair; import kotlin.Pair;
import pub.devrel.easypermissions.EasyPermissions; import pub.devrel.easypermissions.EasyPermissions;
@ -564,12 +567,19 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Easy
// 这里根据调用栈是否存在 DarkModeUtils 来确定是否为系统回调 // 这里根据调用栈是否存在 DarkModeUtils 来确定是否为系统回调
StackTraceElement[] trace = Thread.currentThread().getStackTrace(); StackTraceElement[] trace = Thread.currentThread().getStackTrace();
for (StackTraceElement element : trace) { for (StackTraceElement element : trace) {
if (element.getClassName().contains(DarkModeUtils.class.getSimpleName())) { if (element.getClassName().equals(DarkModeUtils.class.getName())) {
isCalledBySystem = false; isCalledBySystem = false;
break; break;
} }
} }
Breadcrumb breadcrumb = new Breadcrumb();
breadcrumb.setCategory("onConfigurationChanged");
breadcrumb.setMessage("IsCalledBySystem " + isCalledBySystem + ","
+ this.getClass().getSimpleName() + " lifecycle is " + getLifecycle().getCurrentState());
breadcrumb.setLevel(SentryLevel.INFO);
Sentry.addBreadcrumb(breadcrumb);
if (BuildConfig.IS_DARK_MODE_ON && mIsDarkModeOn != DarkModeUtils.INSTANCE.isDarkModeOn(this)) { if (BuildConfig.IS_DARK_MODE_ON && mIsDarkModeOn != DarkModeUtils.INSTANCE.isDarkModeOn(this)) {
// 当且仅当页面处于可见状态时响应新的 UiMode并将它传递下去 // 当且仅当页面处于可见状态时响应新的 UiMode并将它传递下去
// (在不可见的 activity 调用 onConfigurationChanged 方法有一定概率触发 ANR // (在不可见的 activity 调用 onConfigurationChanged 方法有一定概率触发 ANR

View File

@ -207,6 +207,9 @@ public class Constants {
// 补充配置项 // 补充配置项
public static final String SP_NEW_SETTINGS = "new_settings"; public static final String SP_NEW_SETTINGS = "new_settings";
// 新接口配置项
public static final String SP_NEW_API_SETTINGS = "new_api_settings";
// 畅玩组件的配置 // 畅玩组件的配置
public static final String SP_V_SETTINGS = "v_settings"; public static final String SP_V_SETTINGS = "v_settings";

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.common.utils package com.gh.gamecenter.common.utils
import android.animation.Animator import android.animation.Animator
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
@ -854,6 +855,15 @@ fun TextView.setTextWithInterceptingInternalUrl(text: CharSequence) {
setText(ssb) setText(ssb)
} }
/**
* 为 TextView 设置最大宽度,忽略入参为 0 的场景
*/
fun TextView.maxWidthExcludeZero(width: Int) {
if (width != 0) {
maxWidth = width
}
}
fun CharSequence.interceptUrlSpanAndRoundImageSpan(clickedCallback: ((url: String) -> Unit)? = null): SpannableStringBuilder { fun CharSequence.interceptUrlSpanAndRoundImageSpan(clickedCallback: ((url: String) -> Unit)? = null): SpannableStringBuilder {
return SpannableStringBuilder.valueOf(this).apply { return SpannableStringBuilder.valueOf(this).apply {
getSpans(0, length, URLSpan::class.java).forEach { getSpans(0, length, URLSpan::class.java).forEach {
@ -1271,8 +1281,15 @@ fun String.emojiCount(): Int {
/** /**
* WebView启用强制深色模式 * WebView启用强制深色模式
*/ */
@SuppressLint("RequiresFeature")
fun WebView.enableForceDark(isDarkModeOn: Boolean) { fun WebView.enableForceDark(isDarkModeOn: Boolean) {
if (BuildConfig.IS_DARK_MODE_ON && WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) { val isFeatureSupported = try {
WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)
} catch (throwable: Throwable) {
throwable.printStackTrace()
false
}
if (BuildConfig.IS_DARK_MODE_ON && isFeatureSupported) {
WebSettingsCompat.setForceDark( WebSettingsCompat.setForceDark(
settings, settings,
if (isDarkModeOn) WebSettingsCompat.FORCE_DARK_ON else WebSettingsCompat.FORCE_DARK_OFF if (isDarkModeOn) WebSettingsCompat.FORCE_DARK_ON else WebSettingsCompat.FORCE_DARK_OFF

View File

@ -0,0 +1,49 @@
package com.gh.gamecenter.common.utils
import com.gh.gamecenter.common.json.JsonObjectBuilder
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.loghub.LoghubUtils
import com.lightgame.utils.Utils
import org.json.JSONObject
object NewFlagLogUtils {
private fun log(jsonObject: JSONObject, logStore: String, uploadImmediately: Boolean) {
Utils.log("NewFlatLogUtils", jsonObject.toString(4))
LoghubUtils.log(jsonObject, logStore, uploadImmediately, true)
}
private fun parseAndPutMeta(): JsonObjectBuilder.() -> Unit = {
val meta = LogUtils.getMetaObject()
val metaKeys = meta.keys()
while (metaKeys.hasNext()) {
val key: String = metaKeys.next().toString()
val value = meta.getString(key)
key to value
}
}
/**
* 记录外部存储权限提示弹窗出现
*/
fun logExternalStoragePermissionDialogAppearance() {
val json = json {
"event" to "storage_permission_pop_show"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
/**
* 记录外部存储权限弹窗行为
*/
fun logExternalStoragePermissionDialogAction(action: String) {
val json = json {
"event" to "storage_permission_pop_click"
"button" to action
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
}

View File

@ -249,14 +249,25 @@ object PermissionHelper {
} }
private fun showDialogBeforeRequestingStorageDialog(context: FragmentActivity, emptyCallback: EmptyCallback) { private fun showDialogBeforeRequestingStorageDialog(context: FragmentActivity, emptyCallback: EmptyCallback) {
// 是否点击外部区域触发弹窗消失
var isCanceledByClickingOutside = true
NewFlagLogUtils.logExternalStoragePermissionDialogAppearance()
DialogHelper.showDialog( DialogHelper.showDialog(
context, context,
title = "权限申请", title = "权限申请",
content = "光环助手将向您申请开启设备的存储权限,以保证能正常使用相关功能。拒绝授权将无法正常使用部分功能。", content = "光环助手将向您申请开启设备的存储权限,以保证能正常使用相关功能。拒绝授权将无法正常使用部分功能。",
cancelText = "放弃", cancelText = "放弃",
confirmText = "去授权", confirmText = "去授权",
cancelClickCallback = null, cancelClickCallback = {
confirmClickCallback = { checkStoragePermissionBeforeAction(context, emptyCallback) }, isCanceledByClickingOutside = false
NewFlagLogUtils.logExternalStoragePermissionDialogAction("放弃")
},
confirmClickCallback = {
isCanceledByClickingOutside = false
checkStoragePermissionBeforeAction(context, emptyCallback)
NewFlagLogUtils.logExternalStoragePermissionDialogAction("去授权")
},
extraConfig = DialogHelper.Config(hint = "查看权限应用场景"), extraConfig = DialogHelper.Config(hint = "查看权限应用场景"),
uiModificationCallback = { uiModificationCallback = {
it.hintTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font)) it.hintTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font))
@ -264,10 +275,15 @@ object PermissionHelper {
val provider = val provider =
ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider
provider?.directToWebView(context, Constants.PERMISSION_SCENARIO_ADDRESS, "(权限弹窗)") provider?.directToWebView(context, Constants.PERMISSION_SCENARIO_ADDRESS, "(权限弹窗)")
NewFlagLogUtils.logExternalStoragePermissionDialogAction("查看权限应用场景")
} }
it.contentTv.setTextColor(ContextCompat.getColor(context, R.color.text_title)) it.contentTv.setTextColor(ContextCompat.getColor(context, R.color.text_title))
} }
) )?.setOnDismissListener {
if (isCanceledByClickingOutside) {
NewFlagLogUtils.logExternalStoragePermissionDialogAction("点击弹窗以外空白区域")
}
}
} }
private fun showDialogBeforeRequestingGetInstalledListDialog( private fun showDialogBeforeRequestingGetInstalledListDialog(

View File

@ -13,8 +13,10 @@ import android.graphics.drawable.shapes.RectShape
import android.widget.TextView import android.widget.TextView
import androidx.annotation.ColorRes import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.gh.gamecenter.common.HaloApp import com.gh.gamecenter.common.HaloApp
import com.gh.gamecenter.common.R
import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.dip2px
@ -186,4 +188,14 @@ object DrawableView {
val hexString = Integer.toHexString(Math.round((255 * percent / 100).toFloat())) val hexString = Integer.toHexString(Math.round((255 * percent / 100).toFloat()))
return (if (hexString.length < 2) "0" else "") + hexString return (if (hexString.length < 2) "0" else "") + hexString
} }
@JvmStatic
fun getCheckSelectorDrawable(context: Context) =
StateListDrawable().apply {
addState(
intArrayOf(android.R.attr.state_checked),
AppCompatResources.getDrawable(context, R.drawable.ic_selector_selected)
)
addState(intArrayOf(), AppCompatResources.getDrawable(context, R.drawable.ic_selector_default))
}
} }

View File

@ -9,6 +9,8 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig { defaultConfig {
vectorDrawables.useSupportLibrary = true
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode versionCode rootProject.ext.versionCode

View File

@ -1,6 +1,7 @@
package com.gh.gamecenter.login.view; package com.gh.gamecenter.login.view;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.StateListDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Message; import android.os.Message;
import android.text.Editable; import android.text.Editable;
@ -17,6 +18,7 @@ import android.widget.EditText;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
@ -31,6 +33,7 @@ import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.eventbus.EBReuse; import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.ApiResponse; import com.gh.gamecenter.common.retrofit.ApiResponse;
import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.view.DrawableView;
import com.gh.gamecenter.core.provider.ILogUtilsProvider; import com.gh.gamecenter.core.provider.ILogUtilsProvider;
import com.gh.gamecenter.core.provider.IWebProvider; import com.gh.gamecenter.core.provider.IWebProvider;
import com.gh.gamecenter.core.utils.ClickUtils; import com.gh.gamecenter.core.utils.ClickUtils;
@ -171,6 +174,12 @@ public class LoginFragment
mBinding.loginPrivacyPolicy.setText(getPrivacyContent()); mBinding.loginPrivacyPolicy.setText(getPrivacyContent());
mBinding.loginPrivacyPolicy.setHighlightColor(getResources().getColor(R.color.transparent)); mBinding.loginPrivacyPolicy.setHighlightColor(getResources().getColor(R.color.transparent));
mBinding.loginPrivacyPolicy.setMovementMethod(new LinkMovementMethod()); mBinding.loginPrivacyPolicy.setMovementMethod(new LinkMovementMethod());
setCheckIvSrc();
}
private void setCheckIvSrc() {
mBinding.checkIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(requireContext()));
} }
private SpannableStringBuilder getPrivacyContent() { private SpannableStringBuilder getPrivacyContent() {
@ -468,6 +477,7 @@ public class LoginFragment
mBinding.normalToolbarContainer.normalToolbar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); mBinding.normalToolbarContainer.normalToolbar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white));
mBinding.normalToolbarContainer.backBtn.setImageDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.ic_bar_back)); mBinding.normalToolbarContainer.backBtn.setImageDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.ic_bar_back));
} }
setCheckIvSrc();
} }
private class LoginTextWatcher implements TextWatcher { private class LoginTextWatcher implements TextWatcher {

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_selector_selected" android:state_checked="true" />
<item android:drawable="@drawable/ic_selector_default" />
</selector>

View File

@ -184,8 +184,7 @@
android:id="@+id/checkIv" android:id="@+id/checkIv"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" android:layout_height="24dp"
android:padding="4dp" android:padding="4dp" />
android:src="@drawable/selector_login_checkbox" />
<TextView <TextView
android:id="@+id/login_privacy_policy" android:id="@+id/login_privacy_policy"
@ -260,7 +259,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/statusBarView" android:layout_below="@+id/statusBarView"
android:padding="12dp" android:padding="12dp"
android:src="@drawable/ic_login_close" /> app:srcCompat="@drawable/ic_login_close" />
<include <include
android:visibility="gone" android:visibility="gone"

View File

@ -2,7 +2,8 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -21,7 +22,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/statusBarView" android:layout_below="@+id/statusBarView"
android:padding="12dp" android:padding="12dp"
android:src="@drawable/ic_login_close" /> app:srcCompat="@drawable/ic_login_close" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"