Merge branch 'fix/GHZS-2945' into 'dev'

fix:【光环助手】内容导航栏图标闪烁 https://jira.shanqu.cc/browse/GHZS-2945

See merge request halo/android/assistant-android!1200
This commit is contained in:
叶子维
2023-07-17 09:45:10 +08:00
3 changed files with 12 additions and 4 deletions

View File

@ -534,8 +534,7 @@ class SearchGameIndexAdapter(
if (key.contains(download.packageName) && key.contains(download.gameId)) {
val position = positionAndPackageMap[key]
if (position != null && mEntityList != null && position < mEntityList.size && mEntityList[position].game != null) {
mEntityList[position].game!!.getEntryMap()[download.platform] = download
notifyItemChanged(position)
DownloadItemUtils.processDate(mEntityList[position].game!!, download, this, position)
}
}
}

View File

@ -46,6 +46,7 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
private val mBinding by lazy { DialogVspace32Binding.inflate(layoutInflater) }
private var mIsLogInstallShow = false
private var mIsLogAutoInstallClick = false
private var mIsClickDownloadThisTime = false // 是否本次弹出Dialog点击的下载按钮
private val mDataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
if (downloadEntity.url == mDownloadUrl && isAdded) {
@ -146,6 +147,8 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
downloadType
).toJson()
mIsClickDownloadThisTime = true
AppExecutor.uiExecutor.executeWithDelay({
DownloadManager.getInstance().cancel(mDownloadUrl)
DownloadManager.getInstance().add(downloadEntity)
@ -221,7 +224,7 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
val isVSpace32DownloadOnly =
downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE) == Constants.VSPACE_32_DOWNLOAD_ONLY
val isAutoInstall = SPUtils.getBoolean(Constants.SP_AUTO_INSTALL, true)
if (!isVSpace32DownloadOnly && isAutoInstall && !mIsLogAutoInstallClick) {
if (!isVSpace32DownloadOnly && isAutoInstall && !mIsLogAutoInstallClick && mIsClickDownloadThisTime) {
NewFlatLogUtils.logHaloFunEvent("halo_fun_32_install_tip_dialog_click")
SensorsBridge.trackEvent("HaloFunExpandInstallButtonClick")
mIsLogAutoInstallClick = true

View File

@ -59,6 +59,7 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
private val mBinding by lazy { DialogVspaceBinding.inflate(layoutInflater) }
private var mIsLogInstallShow = false
private var mIsLogAutoInstallClick = false
private var mIsClickDownloadThisTime = false // 是否本次弹出Dialog点击的下载按钮
private val mDataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
if (((mAppEntity64 != null && downloadEntity.url == mDownloadUrl64) || (mAppEntity64 == null && downloadEntity.url == mDownloadUrl32)) && isAdded) {
@ -159,6 +160,7 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
DataCollectionUtils.uploadDownload(HaloApp.getInstance(), downloadEntity32, "开始")
}
mIsClickDownloadThisTime = true
AppExecutor.uiExecutor.executeWithDelay({
if (downloadEntity64 != null) {
DownloadManager.getInstance().cancel(mDownloadUrl64)
@ -318,7 +320,11 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
mIsLogInstallShow = true
}
if (SPUtils.getBoolean(Constants.SP_AUTO_INSTALL, true) && !mIsLogAutoInstallClick) {
if (SPUtils.getBoolean(
Constants.SP_AUTO_INSTALL,
true
) && !mIsLogAutoInstallClick && mIsClickDownloadThisTime
) {
SensorsBridge.trackEvent("HaloFunInstallButtonClick", "space_schema_type", vSpaceType)
mIsLogAutoInstallClick = true
}