Compare commits

...

16 Commits

Author SHA1 Message Date
e4d2036cc2 chore: 版本更新至 5.19.4 2023-03-01 19:12:38 +08:00
0600daadde Merge branch 'feature-add_download_header' into 'release'
feat: 添加新的 download header 供后端接口使用

See merge request halo/android/assistant-android!752
2023-03-01 17:55:07 +08:00
c4b1be9925 feat: 添加新的 download header 供后端接口使用 2023-03-01 13:43:37 +08:00
b2a6393afd Merge branch 'hotfix-v5.19.3-733-vspace_update_issue' into 'release'
fix: 修复畅玩组件更新后因为服务连接延迟导致的游戏游戏状态显示异常

See merge request halo/android/assistant-android!750
2023-03-01 13:38:46 +08:00
b5c15940a1 Merge branch 'hotfix-v5.19.3-733-archive_tab_error' into 'release'
fix: 修复游戏详情隐藏专区 tab 且显示云存档 tab 时,云存档红点错位的问题

See merge request halo/android/assistant-android!751
2023-03-01 13:38:01 +08:00
3f6f55b265 fix: 修复畅玩组件更新后因为服务连接延迟导致的游戏游戏状态显示异常 2023-03-01 11:19:27 +08:00
ba666da059 fix: 修复游戏详情隐藏专区 tab 且显示云存档 tab 时,云存档红点错位的问题 2023-03-01 11:16:33 +08:00
fa29e00864 Merge branch 'hotfix-v5.19.3-733-gamedetail_tab' into 'release'
fix: 修复游戏详情页超过 3 个 tab 时,页面变空白的问题

See merge request halo/android/assistant-android!748
2023-02-28 16:27:36 +08:00
1b412bf081 fix: 修复游戏详情页超过 3 个 tab 时,页面变空白的问题 2023-02-28 16:13:52 +08:00
b1abadc145 chore: 版本更新至 5.19.3 2023-02-27 16:21:22 +08:00
05da2c3da4 Merge branch 'hotfix-v5.19.2-732-crashes' into 'release'
fix: 修复闪退

See merge request halo/android/assistant-android!742
2023-02-27 15:35:18 +08:00
e83ece5520 fix: 捕抓游戏详情页上报视频相关日志时的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/272842/?project=22&query=release%3Acom.gh.gamecenter%405.19.2%2B732+error.unhandled%3Atrue&sort=freq 2023-02-27 15:26:59 +08:00
08a86c778d fix: 修复游戏详情延迟选中时的闪退 https://sentry.shanqu.cc/organizations/lightgame/issues/272842/?project=22&query=release%3Acom.gh.gamecenter%405.19.2%2B732+error.unhandled%3Atrue&sort=freq 2023-02-27 14:57:03 +08:00
b216d33d6b chore: 版本更新至 5.19.2 2023-02-24 16:00:21 +08:00
4fe062ea40 Merge branch 'feature-GHZS-1386' into 'release'
feat: 启动畅玩游戏时添加光环版本和渠道 https://jira.shanqu.cc/browse/GHZS-1386

See merge request halo/android/assistant-android!739
2023-02-24 11:14:43 +08:00
7d678085d5 feat: 启动畅玩游戏时添加光环版本和渠道 https://jira.shanqu.cc/browse/GHZS-1386 2023-02-24 11:09:57 +08:00
7 changed files with 41 additions and 13 deletions

View File

@ -1265,7 +1265,8 @@ public class DownloadManager implements DownloadStatusListener {
*/
public static void updateDownloadMetaMap() {
String isOverwrite;
if (LunchType.UPDATE.name().equals(SPUtils.getString(Constants.SP_INSTALL_TYPE))) {
String installType = SPUtils.getString(Constants.SP_INSTALL_TYPE);
if (LunchType.UPDATE.name().equals(installType)) {
isOverwrite = "true";
} else {
isOverwrite = "false";
@ -1280,6 +1281,7 @@ public class DownloadManager implements DownloadStatusListener {
map.put(HttpDnsManager.IMEI, MetaUtil.getBase64EncodedIMEI());
map.put(HttpDnsManager.TOKEN, UserManager.getInstance().getToken());
map.put(HttpDnsManager.IS_OVERWRITE, isOverwrite);
map.put(HttpDnsManager.INSTALL_TYPE, installType);
HttpDnsManager.metaMap = map;
}

View File

@ -408,7 +408,7 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
savedInstanceState?.let { mDestinationTab = it.getInt(LAST_SELECTED_POSITION) }
mBinding.reuseNoneData.reuseNoneDataTv.text = "页面不见了"
mBodyBinding.gamedetailVp.setScrollable(true)
mBodyBinding.gamedetailVp.offscreenPageLimit = 3
mBodyBinding.gamedetailVp.offscreenPageLimit = 5
mMaxWidth = resources.displayMetrics.widthPixels - DisplayUtils.dip2px(40f)
@ -939,7 +939,7 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
for (i in 0 until mBodyBinding.tabLayout.tabCount) {
val tab = mBodyBinding.tabLayout.getTabAt(i) ?: continue
val tabTitle = if (tab.text != null) tab.text.toString() else ""
if (data.showArchive && i == INDEX_ARCHIVE) {
if (data.showArchive && i == getTabPositionFromTabName(getString(R.string.game_detail_cloud_archive))) {
tab.customView = getArchiveTabView(tabTitle)
tab.view.run {
clipChildren = false
@ -1799,6 +1799,9 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
}
private fun logTabClick(position: Int) {
// 特殊处理延时选中 tab 时可能 fragment 已被移除的情况
if (!isAdded) return
val entrance = if (mEntrance.contains("论坛详情")) "论坛" else "游戏"
mGameEntity?.run {
when (getTabContentForReal(position)) {
@ -1836,7 +1839,7 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
/**
* 获取真实的 tab 内容类型
* @param position tab 的位置
* @return 真实的
* @return 真实的 tab 类型
*/
private fun getTabContentForReal(position: Int): String {
return when (mTabTitleList[position]) {
@ -1855,6 +1858,15 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
}
}
/**
* 获取 tab 的位置
* @param tabName tab 名字
* @return tab 的真实位置
*/
private fun getTabPositionFromTabName(tabName: String): Int {
return mTabTitleList.indexOf(tabName)
}
private fun handleTabTouchEvent(title: String) {
if (title == mTabClickEvent.second && System.currentTimeMillis() - mTabClickEvent.first < 300) {
val fragment = mFragmentsList[mBodyBinding.gamedetailVp.currentItem]
@ -2088,7 +2100,8 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
private fun updateArchiveTabUI() {
mBodyBinding.tabLayout.run {
getTabAt(INDEX_ARCHIVE)?.customView?.findViewById<ImageView>(R.id.newIv)?.visibility = View.VISIBLE
val archivePosition = getTabPositionFromTabName(getString(R.string.game_detail_cloud_archive))
getTabAt(archivePosition)?.customView?.findViewById<ImageView>(R.id.newIv)?.visibility = View.VISIBLE
}
}

View File

@ -106,15 +106,17 @@ object VHelper {
if (!isVSpace || !isVIsUsed()) return@PackageChangeListener
if (it.type == "安装") {
if (it.type == EBPackage.TYPE_INSTALLED) {
// 即时调用大概率调不起来,我也不知道为什么,只能延迟大法了
AppExecutor.uiExecutor.executeWithDelay({
connectService()
}, 500)
} else if (it.type == "卸载") {
} else if (it.type == EBPackage.TYPE_UNINSTALLED) {
// 执行卸载逻辑
mIsServiceConnected = false
mInstalledInfoList.clear()
} else if (it.type == EBPackage.TYPE_REPLACED) {
connectService()
}
}
}
@ -164,6 +166,7 @@ object VHelper {
* 连接服务
*/
fun connectService(shouldCheckUpdate: Boolean = false, callbackClosure: (() -> Unit)? = null) {
Utils.log(LOG_TAG, "尝试连接 V 服务")
toastIfServiceConnectTimeout()
mPendingAction = callbackClosure
@ -599,7 +602,9 @@ object VHelper {
packageName,
downloadEntity?.gameId ?: "unknown",
MetaUtil.getBase64EncodedAndroidId(),
HaloApp.getInstance().gid)
HaloApp.getInstance().gid,
com.gh.gamecenter.BuildConfig.VERSION_NAME,
HaloApp.getInstance().channel)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)

View File

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

View File

@ -7,6 +7,7 @@ import com.gh.gamecenter.core.AppExecutor.ioExecutor
import com.gh.gamecenter.core.AppExecutor.lightWeightIoExecutor
import com.gh.gamecenter.core.AppExecutor.logExecutor
import com.gh.gamecenter.core.AppExecutor.uiExecutor
import com.gh.gamecenter.core.utils.SentryHelper
import io.reactivex.schedulers.Schedulers
import java.util.concurrent.*
@ -81,7 +82,14 @@ fun runOnIoThread(
) {
when {
isLightWeightTask -> lightWeightIoExecutor.execute(f)
isHeavyWightTask -> heavyWeightIoExecutor.execute(f)
isHeavyWightTask -> {
try {
heavyWeightIoExecutor.execute(f)
} catch (e: RejectedExecutionException) {
SentryHelper.onEvent("HEAVY_TASK_REJECTED", "digest", e.localizedMessage)
e.printStackTrace()
}
}
else -> ioExecutor.execute(f)
}
}