Merge branch 'feature/CWZS-66' into 'release'
feat: 32位组件-埋点补充-05/29 https://jira.shanqu.cc/browse/CWZS-66 See merge request halo/android/assistant-android!1071
This commit is contained in:
@ -5,7 +5,6 @@ import com.gh.gamecenter.common.json.JsonObjectBuilder
|
||||
import com.gh.gamecenter.common.json.json
|
||||
import com.gh.gamecenter.common.loghub.LoghubUtils
|
||||
import com.gh.gamecenter.common.utils.LogUtils
|
||||
import com.gh.gamecenter.common.utils.NewFlatLogUtils
|
||||
import com.gh.gamecenter.entity.HomeSubSlide
|
||||
import com.lightgame.utils.Utils
|
||||
import org.json.JSONArray
|
||||
@ -54,6 +53,66 @@ object NewFlatLogUtils {
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手下载弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunDownloadDialogShow(gameId: String, gameName: String, gameArchitecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_download_dialog_show"
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
"game_architecture" to gameArchitecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手下载点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunDownloadDialogDownloadClick(architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_download_dialog_download_click"
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手安装提示弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunInstallTipDialogShow(architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_install_tip_dialog_show"
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手更新弹窗展示事件
|
||||
@JvmStatic
|
||||
fun logHaloFunUpdateDialogShow(gameId: String, gameName: String, gameArchitecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_update_dialog_show"
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
"game_architecture" to gameArchitecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 畅玩助手(32位)弹窗事件
|
||||
@JvmStatic
|
||||
fun logHaloFun32DialogEvent(event: String, gameId: String, gameName: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to event
|
||||
"game_id" to gameId
|
||||
"game_name" to gameName
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
}
|
||||
|
||||
// 关联游戏跳转icon点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunGameDetailJumpClick(downloadStatus: String, gameId: String) {
|
||||
@ -80,11 +139,12 @@ object NewFlatLogUtils {
|
||||
|
||||
// 畅玩助手更新弹窗点击事件
|
||||
@JvmStatic
|
||||
fun logHaloFunUpdateDialogClick(dialogType: String, buttonType: String) {
|
||||
fun logHaloFunUpdateDialogClick(dialogType: String, buttonType: String, architecture: String) {
|
||||
val json = json {
|
||||
KEY_EVENT to "halo_fun_update_dialog_click"
|
||||
"dialog_type" to dialogType
|
||||
KEY_BUTTON_TYPE to buttonType
|
||||
"architecture" to architecture
|
||||
parseAndPutMeta().invoke(this)
|
||||
}
|
||||
log(json)
|
||||
|
||||
@ -518,7 +518,11 @@ object VHelper {
|
||||
val gameBit = gameEntity?.getApk()?.get(0)?.bit
|
||||
val updateEntity = if (gameBit == "32" && contains32Update) m32UpdateEntity else m64UpdateEntity
|
||||
val dialogType = if (updateEntity!!.isAlertEveryTime()) "强制更新" else "提示更新"
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_update_dialog_show")
|
||||
NewFlatLogUtils.logHaloFunUpdateDialogShow(
|
||||
gameEntity?.id ?: "",
|
||||
gameEntity?.name ?: "",
|
||||
if (gameBit == "32") "32位" else "64位"
|
||||
)
|
||||
SPUtils.setString(
|
||||
if (updateEntity.category == "32-bit") KEY_LAST_ALERT_32_UPDATE_URL else KEY_LAST_ALERT_64_UPDATE_URL,
|
||||
updateEntity.url + updateEntity.alert
|
||||
@ -530,7 +534,6 @@ object VHelper {
|
||||
cancelText = "立即更新",
|
||||
confirmText = "继续游戏",
|
||||
cancelClickCallback = {
|
||||
NewFlatLogUtils.logHaloFunUpdateDialogClick(dialogType, "立即更新")
|
||||
val appEntity64 =
|
||||
if (gameBit == "32" && contains32Update && m32UpdateEntity?.relation != null) {
|
||||
// 32位游戏且包含32位更新和32位关联64位更新
|
||||
@ -554,6 +557,11 @@ object VHelper {
|
||||
null
|
||||
}
|
||||
val appEntity32 = if (contains32Update) updateEntity else null
|
||||
NewFlatLogUtils.logHaloFunUpdateDialogClick(
|
||||
dialogType,
|
||||
"立即更新",
|
||||
if (appEntity64 != null && appEntity32 != null) "32位&64位" else if (appEntity64 != null) "64位" else "32位"
|
||||
)
|
||||
VSpaceDialogFragment.showDownloadDialog(
|
||||
context,
|
||||
appEntity64,
|
||||
@ -564,7 +572,7 @@ object VHelper {
|
||||
)
|
||||
},
|
||||
confirmClickCallback = {
|
||||
NewFlatLogUtils.logHaloFunUpdateDialogClick(dialogType, "继续游戏")
|
||||
NewFlatLogUtils.logHaloFunUpdateDialogClick(dialogType, "继续游戏", "")
|
||||
callback.invoke()
|
||||
},
|
||||
extraConfig = DialogHelper.Config(centerTitle = true),
|
||||
|
||||
@ -19,7 +19,6 @@ import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.feature.view.DownloadButton
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.fragment.BaseDraggableDialogFragment
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
@ -42,6 +41,7 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
private var mGameName: String = ""
|
||||
private val mDownloadUrl by lazy { mAppEntity?.url ?: "" }
|
||||
private val mBinding by lazy { DialogVspace32Binding.inflate(layoutInflater) }
|
||||
private var mIsLogInstallShow = false
|
||||
private val mDataWatcher = object : DataWatcher() {
|
||||
override fun onDataChanged(downloadEntity: DownloadEntity) {
|
||||
if (downloadEntity.url == mDownloadUrl && isAdded) {
|
||||
@ -94,11 +94,16 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
DirectUtils.directToWebView(requireContext(), Constants.SMOOTH_GAME_PRIVACY_POLICY_ADDRESS)
|
||||
}
|
||||
|
||||
if (downloadSnapshot?.status == done) {
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_32_install_tip_dialog_show")
|
||||
} else {
|
||||
NewFlatLogUtils.logHaloFun32DialogEvent("halo_fun_32_download_tip_dialog_show", mGameId, mGameName)
|
||||
}
|
||||
|
||||
mBinding.downloadBtn.setOnClickListener {
|
||||
if (downloadSnapshot?.status == done) {
|
||||
PackageInstaller.install(requireContext(), downloadSnapshot)
|
||||
SensorsBridge.trackEvent("HaloFunInstallButtonClick")
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_32_install_tip_dialog_click")
|
||||
} else {
|
||||
val downloadEntity = DownloadEntity()
|
||||
|
||||
@ -133,6 +138,7 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
}, 200)
|
||||
|
||||
DataCollectionUtils.uploadDownload(HaloApp.getInstance(), downloadEntity, "开始")
|
||||
NewFlatLogUtils.logHaloFun32DialogEvent("halo_fun_32_download_tip_dialog_click", mGameId, mGameName)
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,11 +197,14 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
downloadBtn.setText(R.string.install)
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
|
||||
|
||||
SensorsBridge.trackEvent("HaloFunDownloadDone")
|
||||
if (!mIsLogInstallShow) {
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_32_install_tip_dialog_show")
|
||||
mIsLogInstallShow = true
|
||||
}
|
||||
|
||||
downloadBtn.setOnClickListener {
|
||||
PackageInstaller.install(requireContext(), downloadEntity)
|
||||
SensorsBridge.trackEvent("HaloFunInstallButtonClick")
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_32_install_tip_dialog_click")
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,7 +213,7 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
notfound,
|
||||
uncertificated,
|
||||
unqualified -> {
|
||||
downloadBtn.text = "下载畅玩助手服务组件"
|
||||
downloadBtn.text = "下载"
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
downloadBtn.setOnClickListener {
|
||||
DownloadManager.getInstance().resume(downloadEntity, true)
|
||||
@ -245,18 +254,6 @@ class VSpace32DialogFragment : BaseDraggableDialogFragment() {
|
||||
// 防止重复弹出
|
||||
if (hasDialogDisplayedInCurrentActivity(fragmentActivity)) return
|
||||
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_download_dialog_show")
|
||||
|
||||
if (context is BaseActivity) {
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloFunDownloadDialogShow",
|
||||
"last_page_name", context::class.java.simpleName,
|
||||
"last_page_id", context.getUniqueId(),
|
||||
"last_page_business_id", context.getBusinessId().first,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
val downloadDialog = VSpace32DialogFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
putParcelable(KEY_APP_ENTITY_32, appEntity32)
|
||||
|
||||
@ -50,6 +50,7 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
|
||||
private val mDownloadUrl64 by lazy { mAppEntity64?.url ?: "" }
|
||||
private val mDownloadUrl32 by lazy { mAppEntity32?.url ?: "" }
|
||||
private val mBinding by lazy { DialogVspaceBinding.inflate(layoutInflater) }
|
||||
private var mIsLogInstallShow = false
|
||||
private val mDataWatcher = object : DataWatcher() {
|
||||
override fun onDataChanged(downloadEntity: DownloadEntity) {
|
||||
if (((mAppEntity64 != null && downloadEntity.url == mDownloadUrl64) || (mAppEntity64 == null && downloadEntity.url == mDownloadUrl32)) && isAdded) {
|
||||
@ -111,7 +112,6 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
|
||||
.getDownloadEntitySnapshotByPackageName(if (mAppEntity64 != null) VHelper.DEFAULT_VSPACE_PACKAGENAME else VHelper.VSPACE_32BIT_PACKAGENAME)
|
||||
|
||||
mBinding.downloadBtn.setOnClickListener {
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_download_dialog_download_click")
|
||||
SensorsBridge.trackEvent("HaloFunDownloadDialogDownloadClick", "game_id", mGameId, "game_name", mGameName)
|
||||
|
||||
// 确定下载类型
|
||||
@ -168,6 +168,10 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
|
||||
DownloadManager.getInstance().add(downloadEntity32)
|
||||
}
|
||||
}, 200)
|
||||
|
||||
val architecture =
|
||||
if (downloadEntity64 != null && downloadEntity32 != null) "32位&64位" else if (downloadEntity64 != null) "64位" else "32位"
|
||||
NewFlatLogUtils.logHaloFunDownloadDialogDownloadClick(architecture)
|
||||
}
|
||||
|
||||
if (arguments?.getBoolean(KEY_AUTO_DOWNLOAD) == true && downloadSnapshot == null) {
|
||||
@ -267,6 +271,11 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
|
||||
downloadBtn.setText(R.string.install)
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
|
||||
|
||||
if (!mIsLogInstallShow) {
|
||||
NewFlatLogUtils.logHaloFunInstallTipDialogShow(if (downloadEntity.url == mDownloadUrl64) "64位" else "32位")
|
||||
mIsLogInstallShow = true
|
||||
}
|
||||
|
||||
downloadBtn.setOnClickListener {
|
||||
PackageInstaller.install(requireContext(), downloadEntity)
|
||||
SensorsBridge.trackEvent("HaloFunInstallButtonClick")
|
||||
@ -321,7 +330,7 @@ class VSpaceDialogFragment : BaseDraggableDialogFragment() {
|
||||
// 防止重复弹出
|
||||
if (hasDialogDisplayedInCurrentActivity(fragmentActivity)) return
|
||||
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_download_dialog_show")
|
||||
NewFlatLogUtils.logHaloFunDownloadDialogShow(gameId, gameName, if (bit == "32") "32位" else "64位")
|
||||
|
||||
if (context is BaseActivity) {
|
||||
SensorsBridge.trackEvent(
|
||||
|
||||
@ -18,7 +18,6 @@ import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.feature.view.DownloadButton
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.fragment.BaseDialogFragment
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
@ -86,9 +85,9 @@ class VSpaceUpdate32DialogFragment : BaseDialogFragment() {
|
||||
mBinding.contentTv.text = "《$mGameName》需安装完整的畅玩服务组件,安装后即可给您带来急速的畅玩体验~"
|
||||
|
||||
mBinding.downloadBtn.setOnClickListener {
|
||||
NewFlatLogUtils.logHaloFun32DialogEvent("halo_fun_32_update_tip_dialog_click", mGameId, mGameName)
|
||||
if (downloadSnapshot?.status == done) {
|
||||
PackageInstaller.install(requireContext(), downloadSnapshot)
|
||||
SensorsBridge.trackEvent("HaloFunInstallButtonClick")
|
||||
} else {
|
||||
val downloadEntity = DownloadEntity()
|
||||
|
||||
@ -181,11 +180,8 @@ class VSpaceUpdate32DialogFragment : BaseDialogFragment() {
|
||||
downloadBtn.setText(R.string.install)
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.INSTALL_NORMAL
|
||||
|
||||
SensorsBridge.trackEvent("HaloFunDownloadDone")
|
||||
|
||||
downloadBtn.setOnClickListener {
|
||||
PackageInstaller.install(requireContext(), downloadEntity)
|
||||
SensorsBridge.trackEvent("HaloFunInstallButtonClick")
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,7 +190,7 @@ class VSpaceUpdate32DialogFragment : BaseDialogFragment() {
|
||||
notfound,
|
||||
uncertificated,
|
||||
unqualified -> {
|
||||
downloadBtn.text = "下载畅玩助手服务组件"
|
||||
downloadBtn.text = "下载"
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
downloadBtn.setOnClickListener {
|
||||
DownloadManager.getInstance().resume(downloadEntity, true)
|
||||
@ -235,17 +231,7 @@ class VSpaceUpdate32DialogFragment : BaseDialogFragment() {
|
||||
// 防止重复弹出
|
||||
if (hasDialogDisplayedInCurrentActivity(fragmentActivity)) return
|
||||
|
||||
NewFlatLogUtils.logHaloFunEvent("halo_fun_download_dialog_show")
|
||||
|
||||
if (context is BaseActivity) {
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloFunDownloadDialogShow",
|
||||
"last_page_name", context::class.java.simpleName,
|
||||
"last_page_id", context.getUniqueId(),
|
||||
"last_page_business_id", context.getBusinessId().first,
|
||||
)
|
||||
}
|
||||
|
||||
NewFlatLogUtils.logHaloFun32DialogEvent("halo_fun_32_update_tip_dialog_show", gameId, gameName)
|
||||
|
||||
val downloadDialog = VSpaceUpdate32DialogFragment().apply {
|
||||
arguments = Bundle().apply {
|
||||
|
||||
Reference in New Issue
Block a user