埋点
This commit is contained in:
@ -361,6 +361,7 @@ class GameDetailAcceleratorUiHelper(private val binding: DetailDownloadItemBindi
|
||||
const val SOURCE_ENTRANCE_MY_ASSETS = "我的资产"
|
||||
const val SOURCE_ENTRANCE_SEARCH = "搜索页"
|
||||
const val SOURCE_ENTRANCE_RECENTLY_PLAYED = "最近在玩"
|
||||
const val SOURCE_ENTRANCE_MY_HALO_INSTALLED = "我的光环-已安装"
|
||||
const val BUTTON_NAME_ENTER_GAME = "进入游戏"
|
||||
const val BUTTON_NAME_STOP_ACCELERATOR = "停止加速"
|
||||
|
||||
|
||||
@ -212,13 +212,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
|
||||
if (CheckLoginUtils.isLogin()) {
|
||||
NewFlatLogUtils.logHaloSelfClick("右上角", "消息中心")
|
||||
SensorsBridge.trackHaloSelfClick(
|
||||
profile = "右上角",
|
||||
text = "消息中心",
|
||||
linkType = "",
|
||||
linkId = "",
|
||||
linkText = ""
|
||||
)
|
||||
SensorsBridge.trackHaloSelfClick("右上角", "消息中心")
|
||||
NewLogUtils.logMessageInformBellClick(
|
||||
binding.messageHint.isVisible,
|
||||
"我的"
|
||||
@ -231,12 +225,14 @@ class MyHaloFragment: LazyFragment() {
|
||||
DirectUtils.directToMessageCenter(defaultTabIndex, "我的光环-消息")
|
||||
}
|
||||
downloadContainer.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("右上角", "下载管理")
|
||||
DirectUtils.directToDownloadManager(
|
||||
requireContext(),
|
||||
"我的光环"
|
||||
)
|
||||
}
|
||||
settingContainer.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("右上角", "设置")
|
||||
startActivity(SettingBridge.getSettingIntent(requireContext(), isUpdate, "我的光环"))
|
||||
}
|
||||
}
|
||||
@ -247,13 +243,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
.subscribe {
|
||||
if (CheckLoginUtils.isLogin()) {
|
||||
NewFlatLogUtils.logHaloSelfClick("右上角", "签到")
|
||||
SensorsBridge.trackHaloSelfClick(
|
||||
profile = "右上角",
|
||||
text = "签到",
|
||||
linkType = "",
|
||||
linkId = "",
|
||||
linkText = ""
|
||||
)
|
||||
SensorsBridge.trackHaloSelfClick("右上角", "签到")
|
||||
sign()
|
||||
} else {
|
||||
NewFlatLogUtils.logHaloSelfLogin()
|
||||
@ -305,11 +295,11 @@ class MyHaloFragment: LazyFragment() {
|
||||
if (userInfoEntity == null) {
|
||||
NewFlatLogUtils.logHaloSelfLogin()
|
||||
NewFlatLogUtils.logHaloSelfClick("用户信息", "立即登录")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "立即登录", "", "", "")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "立即登录")
|
||||
CheckLoginUtils.checkLogin(context, "我的光环-立即登录", null)
|
||||
} else {
|
||||
NewFlatLogUtils.logHaloSelfClick("用户信息", "个人主页")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "个人主页", "", "", "")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "个人主页")
|
||||
DirectUtils.directToHomeActivity(
|
||||
requireContext(),
|
||||
UserManager.getInstance().userId,
|
||||
@ -328,7 +318,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
personalUserName.setOnClickListener {
|
||||
if (userInfoEntity != null) {
|
||||
NewFlatLogUtils.logHaloSelfClick("用户信息", "个人主页")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "个人主页", "", "", "")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "个人主页")
|
||||
DirectUtils.directToHomeActivity(
|
||||
requireContext(),
|
||||
UserManager.getInstance().userId,
|
||||
@ -338,7 +328,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
} else {
|
||||
NewFlatLogUtils.logHaloSelfLogin()
|
||||
NewFlatLogUtils.logHaloSelfClick("用户信息", "立即登录")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "立即登录", "", "", "")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "立即登录")
|
||||
CheckLoginUtils.checkLogin(context, "我的光环-立即登录", null)
|
||||
}
|
||||
}
|
||||
@ -347,7 +337,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
}
|
||||
personalBadge.setOnClickListener {
|
||||
NewFlatLogUtils.logHaloSelfClick("用户信息", "我的徽章")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "我的徽章", "", "", "")
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "我的徽章")
|
||||
DirectUtils.directToBadgeWall(
|
||||
requireContext(),
|
||||
userInfoEntity?.userId,
|
||||
@ -441,6 +431,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
|
||||
complianceContainer.run {
|
||||
userProtocolTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", userProtocolTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -450,6 +441,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
)
|
||||
}
|
||||
privacyPolicyTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", privacyPolicyTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -459,6 +451,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
)
|
||||
}
|
||||
infoListTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", infoListTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -468,6 +461,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
)
|
||||
}
|
||||
sdkListTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", sdkListTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -477,6 +471,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
)
|
||||
}
|
||||
permissionAndUsageTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", permissionAndUsageTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -486,6 +481,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
)
|
||||
}
|
||||
childrenPolicyTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("功能服务", childrenPolicyTv.text.toString())
|
||||
startActivity(
|
||||
WebActivity.getWebIntent(
|
||||
requireContext(),
|
||||
@ -538,6 +534,12 @@ class MyHaloFragment: LazyFragment() {
|
||||
if (viewModel.managementStateLiveData.value == true) {
|
||||
viewModel.changeManagementState()
|
||||
}
|
||||
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloSelfGameTabSelect",
|
||||
"tab_content",
|
||||
tabNameArray.getOrDefault(position, "")
|
||||
)
|
||||
}
|
||||
tabLayout.setupWithViewPager(viewPager)
|
||||
tabIndicator.setupWithTabLayout(tabLayout)
|
||||
@ -609,6 +611,13 @@ class MyHaloFragment: LazyFragment() {
|
||||
binding.orderTv.text = order
|
||||
val sortType = InstalledSortType.entries.find { it.des == order } ?: InstalledSortType.RECENTLY_PLAYED
|
||||
(fragmentList.getOrNull(currentVpPosition) as? IInstalledSortType)?.changeSortType(sortType)
|
||||
SensorsBridge.trackEvent(
|
||||
"HaloSelfGameSortClick",
|
||||
"tab_content",
|
||||
tabNameArray.getOrDefault(currentVpPosition, ""),
|
||||
"text",
|
||||
if (button.id == R.id.recentlyPlayedRb) R.string.order_recently_played.toResString() else order
|
||||
)
|
||||
popupWindow.dismiss()
|
||||
} else {
|
||||
button.setTypeface(button.typeface, Typeface.NORMAL)
|
||||
@ -855,6 +864,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
binding.actionTv.goneIf(vipCardData?.button == "off") {
|
||||
binding.actionTv.text = vipCardData?.button
|
||||
binding.actionTv.setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("会员卡片", "加速器会员")
|
||||
DirectUtils.navigateToMyAssetsPage(requireContext(), "我的光环-会员入口卡片")
|
||||
}
|
||||
}
|
||||
@ -924,6 +934,7 @@ class MyHaloFragment: LazyFragment() {
|
||||
text = "ID:${userInfoEntity?.getShortUserId()}"
|
||||
setPadding(8F.dip2px(), 0, 8F.dip2px(), 0)
|
||||
setOnClickListener {
|
||||
SensorsBridge.trackHaloSelfClick("用户信息", "用户ID")
|
||||
text.toString().substring(3).copyTextAndToast("用户ID复制成功")
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,6 +166,13 @@ class MyHaloFunctionAdapter(context: Context): BaseRecyclerAdapter<RecyclerView.
|
||||
root.setOnClickListener {
|
||||
directPage(root.context, entity)
|
||||
redDotIv.isVisible = false
|
||||
SensorsBridge.trackHaloSelfClick(
|
||||
"功能服务",
|
||||
entity.name,
|
||||
entity.link?.type ?: "",
|
||||
entity.link?.link ?: "",
|
||||
entity.link?.text ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ import com.gh.gamecenter.feature.view.DownloadButton
|
||||
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.DISTRICT_SERVER_EMPTY
|
||||
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.DISTRICT_SERVER_HAVA
|
||||
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.SCENE_TYPE_NO_GUIDE_LAYER
|
||||
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.SOURCE_ENTRANCE_SEARCH
|
||||
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.SOURCE_ENTRANCE_MY_HALO_INSTALLED
|
||||
import com.gh.gamecenter.gamedetail.accelerator.dialog.AcceleratorZoneDialogFragment
|
||||
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
|
||||
import com.gh.gamecenter.search.SearchGameResultAdapter.Companion.startAccelerating
|
||||
@ -44,11 +44,15 @@ import com.therouter.TheRouter
|
||||
|
||||
class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHolder>(createDiffCallback()) {
|
||||
private val positionAndPackageMap = HashMap<String, Int>()
|
||||
private var isShowUpdate = false
|
||||
|
||||
override fun submitList(list: List<InstalledGameItemData>?) {
|
||||
positionAndPackageMap.clear()
|
||||
// 记录游戏位置
|
||||
list?.forEachIndexed { i, item ->
|
||||
if (i == 0) {
|
||||
isShowUpdate = item.isHead
|
||||
}
|
||||
item.gameEntity?.let { gameEntity ->
|
||||
val key = buildString {
|
||||
append(gameEntity.id)
|
||||
@ -109,6 +113,7 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
|
||||
root.setOnClickListener {
|
||||
DirectUtils.directToDownloadManagerUpdate(root.context)
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(false, profile = "可更新入口", text = "可更新入口")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,7 +153,18 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
this@InstalledAdapter,
|
||||
"(我的光环-已安装)",
|
||||
location = "我的光环-已安装" + ":" + gameEntity.name,
|
||||
traceEvent = gameEntity.exposureEvent
|
||||
traceEvent = gameEntity.exposureEvent,
|
||||
clickCallback = {
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
false,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
if (isShowUpdate) holder.bindingAdapterPosition else holder.bindingAdapterPosition + 1,
|
||||
profile = "按钮",
|
||||
text = downloadBtn.text
|
||||
)
|
||||
}
|
||||
)
|
||||
DownloadItemUtils.updateItem(root.context, gameEntity, GameViewHolder(root).apply {
|
||||
gameDownloadBtn = downloadBtn
|
||||
@ -158,7 +174,8 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
showSpeedButton(
|
||||
text,
|
||||
gameEntity,
|
||||
gameInfo
|
||||
gameInfo,
|
||||
if (isShowUpdate) holder.bindingAdapterPosition else holder.bindingAdapterPosition + 1
|
||||
)
|
||||
}
|
||||
})
|
||||
@ -198,8 +215,8 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
}
|
||||
}
|
||||
}
|
||||
bindAnnouncement(this, gameEntity)
|
||||
bindService(this, gameEntity, "我的光环-已安装")
|
||||
bindAnnouncement(TYPE_INSTALLED, this, gameEntity, if (isShowUpdate) holder.bindingAdapterPosition else holder.bindingAdapterPosition + 1)
|
||||
bindService(TYPE_INSTALLED, this, gameEntity, if (isShowUpdate) holder.bindingAdapterPosition else holder.bindingAdapterPosition + 1, "我的光环-已安装")
|
||||
}
|
||||
|
||||
root.setOnClickListener {
|
||||
@ -209,6 +226,15 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
"(我的光环:我的游戏)",
|
||||
gameEntity.exposureEvent
|
||||
)
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
false,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
if (isShowUpdate) holder.bindingAdapterPosition else holder.bindingAdapterPosition + 1,
|
||||
profile = "游戏",
|
||||
text = "游戏"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -221,7 +247,8 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
private fun showSpeedButton(
|
||||
text: String,
|
||||
gameEntity: GameEntity,
|
||||
binding: LayoutMyHaloGameInfoBinding
|
||||
binding: LayoutMyHaloGameInfoBinding,
|
||||
position: Int
|
||||
) {
|
||||
if (text == com.gh.gamecenter.feature.R.string.launch.toResString() && !gameEntity.isVGamePreferred() && gameEntity.canSpeed) {
|
||||
val context = binding.root.context
|
||||
@ -265,19 +292,28 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
AcceleratorDataHolder.instance.memberType,
|
||||
districtServer,
|
||||
SCENE_TYPE_NO_GUIDE_LAYER,
|
||||
SOURCE_ENTRANCE_SEARCH
|
||||
SOURCE_ENTRANCE_MY_HALO_INSTALLED
|
||||
)
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
false,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
position,
|
||||
profile = "按钮",
|
||||
text = binding.tvSpeed.text.toString()
|
||||
)
|
||||
if (CheckLoginUtils.isLogin()) {
|
||||
when {
|
||||
!hasMutualityZone -> {
|
||||
// 单区服,直接启动
|
||||
val zoneInfo = gameEntity.serviceArea.firstOrNull() ?: AcctGameInfo.ZoneInfo(0)
|
||||
startAccelerating(gameEntity, context, zoneInfo, false)
|
||||
startAccelerating(gameEntity, context, zoneInfo, false, SOURCE_ENTRANCE_MY_HALO_INSTALLED)
|
||||
}
|
||||
|
||||
lastAcctGame != null -> {
|
||||
// 多区服,有缓存的加速记录
|
||||
startAccelerating(gameEntity, context, lastAcctGame.zoneInfo, true)
|
||||
startAccelerating(gameEntity, context, lastAcctGame.zoneInfo, true, SOURCE_ENTRANCE_MY_HALO_INSTALLED)
|
||||
}
|
||||
|
||||
else -> {
|
||||
@ -287,7 +323,7 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
null,
|
||||
gameEntity.serviceArea.toArrayList(),
|
||||
gameEntity,
|
||||
SOURCE_ENTRANCE_SEARCH
|
||||
SOURCE_ENTRANCE_MY_HALO_INSTALLED
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -304,7 +340,7 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
lastAcctGame?.zoneInfo?.id,
|
||||
gameEntity.serviceArea.toArrayList(),
|
||||
gameEntity,
|
||||
SOURCE_ENTRANCE_SEARCH
|
||||
SOURCE_ENTRANCE_MY_HALO_INSTALLED
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -347,6 +383,9 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
const val ITEM_NORMAL = 1
|
||||
const val ITEM_FOOTER = 2
|
||||
|
||||
const val TYPE_INSTALLED = "installed"
|
||||
const val TYPE_V_GAME = "smooth"
|
||||
const val TYPE_RESERVATION = "reservation"
|
||||
|
||||
fun createDiffCallback() = object : ItemCallback<InstalledGameItemData>() {
|
||||
override fun areItemsTheSame(oldItem: InstalledGameItemData, newItem: InstalledGameItemData): Boolean {
|
||||
@ -358,7 +397,7 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
}
|
||||
}
|
||||
|
||||
fun bindAnnouncement(binding: ItemMyHaloGameBinding, gameEntity: GameEntity) {
|
||||
fun bindAnnouncement(type: String, binding: ItemMyHaloGameBinding, gameEntity: GameEntity, position: Int) {
|
||||
binding.run {
|
||||
announcementContainer.goneIf(gameEntity.announcementTag.isEmpty()) {
|
||||
announcementContainer.removeAllViews()
|
||||
@ -376,7 +415,34 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
titleTv.text = it.title
|
||||
arrowIv.imageTintList = ColorStateList.valueOf(if (isDarkModeOn) com.gh.gamecenter.common.R.color.text_secondary.toColor(root.context) else themeColor)
|
||||
root.setOnClickListener { _ ->
|
||||
it.link?.let { link -> DirectUtils.directToLinkPage(root.context, link, "", "") }
|
||||
it.link?.let { link ->
|
||||
DirectUtils.directToLinkPage(root.context, link, "", "")
|
||||
if (type == TYPE_RESERVATION) {
|
||||
SensorsBridge.trackHaloSelfGameAppointmentClick(
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
"游戏公告",
|
||||
it.title,
|
||||
link.link ?: "",
|
||||
link.text ?: "",
|
||||
link.type ?: "",
|
||||
)
|
||||
} else {
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
type == TYPE_V_GAME,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
position,
|
||||
"游戏公告",
|
||||
it.title,
|
||||
link.link ?: "",
|
||||
link.text ?: "",
|
||||
link.type ?: "",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
announcementContainer.addView(root, LinearLayout.LayoutParams.MATCH_PARENT, 28F.dip2px())
|
||||
}
|
||||
@ -385,7 +451,7 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
}
|
||||
}
|
||||
|
||||
fun bindService(binding: ItemMyHaloGameBinding, gameEntity: GameEntity, entrance: String) {
|
||||
fun bindService(type: String, binding: ItemMyHaloGameBinding, gameEntity: GameEntity, position: Int, entrance: String) {
|
||||
binding.run {
|
||||
serviceContainer.goneIf(gameEntity.serviceTag.isEmpty()) {
|
||||
serviceContainer.removeAllViews()
|
||||
@ -403,6 +469,32 @@ class InstalledAdapter: ListAdapter<InstalledGameItemData, RecyclerView.ViewHold
|
||||
root.setOnClickListener { _ ->
|
||||
if (it.link != null) {
|
||||
DirectUtils.directToLinkPage(root.context, it.link!!, entrance, "")
|
||||
|
||||
if (type == TYPE_RESERVATION) {
|
||||
SensorsBridge.trackHaloSelfGameAppointmentClick(
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
"服务标签",
|
||||
it.title,
|
||||
it.link?.link ?: "",
|
||||
it.link?.text ?: "",
|
||||
it.link?.type ?: "",
|
||||
)
|
||||
} else {
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
type == TYPE_V_GAME,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
position,
|
||||
"服务标签",
|
||||
it.title,
|
||||
it.link?.link ?: "",
|
||||
it.link?.text ?: "",
|
||||
it.link?.type ?: "",
|
||||
)
|
||||
}
|
||||
} else {
|
||||
when (it.type) {
|
||||
MyHaloGameTag.TYPE_ARCHIVE -> {
|
||||
|
||||
@ -122,7 +122,7 @@ class InstalledViewModel(application: Application): AndroidViewModel(application
|
||||
}
|
||||
|
||||
private fun processingData(gameList: List<GameEntity>) {
|
||||
val sortedGameList = ArrayList<GameEntity>()
|
||||
val sortedGameList = mutableListOf<GameEntity>()
|
||||
for (entity in gameList) {
|
||||
val newEntity = entity.copy()
|
||||
// 下载管理不显示镜像游戏,不然会有奇怪的问题
|
||||
|
||||
@ -280,20 +280,37 @@ class ReservationAdapter(private val context: Context, private val viewModel: Re
|
||||
context,
|
||||
downloadBtn,
|
||||
gameEntity,
|
||||
position,
|
||||
holder.bindingAdapterPosition,
|
||||
this@ReservationAdapter,
|
||||
"我的光环-预约",
|
||||
location = StringUtils.buildString("我的光环-预约", ":", gameEntity.name),
|
||||
traceEvent = null,
|
||||
clickCallback = {
|
||||
SensorsBridge.trackHaloSelfGameAppointmentClick(
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
"按钮",
|
||||
downloadBtn.text,
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
InstalledAdapter.bindAnnouncement(this, gameEntity)
|
||||
InstalledAdapter.bindService(this, gameEntity, "我的光环-预约")
|
||||
InstalledAdapter.bindAnnouncement(InstalledAdapter.TYPE_RESERVATION, this, gameEntity, -1)
|
||||
InstalledAdapter.bindService(InstalledAdapter.TYPE_RESERVATION, this, gameEntity, -1, "我的光环-预约")
|
||||
|
||||
root.setOnClickListener {
|
||||
if (pageState == MyReservationFragment.ReservePageState.Normal) {
|
||||
GameDetailActivity.startGameDetailActivity(context, gameEntity.id, "我的光环-预约", null)
|
||||
SensorsBridge.trackHaloSelfGameAppointmentClick(
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
"游戏",
|
||||
"游戏",
|
||||
)
|
||||
} else {
|
||||
val isEnableSelect = pageState == MyReservationFragment.ReservePageState.CancelReserve
|
||||
|| (gameEntity.wifiAutoDownloadEnable && !gameEntity.wifiAutoDownload)
|
||||
|
||||
@ -152,16 +152,35 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
} else {
|
||||
entityFromVGame
|
||||
}
|
||||
updateDownloadBtnAndDes(root.context, downloadEntity, downloadBtn, gameDesTv, gameEntity)
|
||||
updateDownloadBtnAndDes(root.context, downloadEntity, downloadBtn, gameDesTv, gameEntity) {
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
true,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
holder.bindingAdapterPosition,
|
||||
profile = "按钮",
|
||||
text = downloadBtn.text
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
InstalledAdapter.bindAnnouncement(this, gameEntity)
|
||||
InstalledAdapter.bindService(this, gameEntity, "我的光环-畅玩")
|
||||
InstalledAdapter.bindAnnouncement(InstalledAdapter.TYPE_V_GAME, this, gameEntity, holder.bindingAdapterPosition)
|
||||
InstalledAdapter.bindService(InstalledAdapter.TYPE_V_GAME, this, gameEntity, holder.bindingAdapterPosition, "我的光环-畅玩")
|
||||
}
|
||||
|
||||
root.setOnClickListener {
|
||||
if (currentOption == ManageOption.OPTION_MANAGER) {
|
||||
GameDetailActivity.startGameDetailActivity(root.context, gameEntity.id, "我的光环-畅玩")
|
||||
SensorsBridge.trackHaloSelfGameInstalledClick(
|
||||
true,
|
||||
gameEntity.id,
|
||||
gameEntity.name ?: "",
|
||||
gameEntity.categoryChinese,
|
||||
holder.bindingAdapterPosition,
|
||||
profile = "游戏",
|
||||
text = "游戏"
|
||||
)
|
||||
} else {
|
||||
if (selectItems.contains(gameEntity.id)) {
|
||||
selectItems.remove(gameEntity.id)
|
||||
@ -185,7 +204,8 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
downloadEntity: DownloadEntity?,
|
||||
downloadBtn: DownloadButton,
|
||||
downloadDes: TextView,
|
||||
gameEntity: GameEntity
|
||||
gameEntity: GameEntity,
|
||||
clickCallback: () -> Unit
|
||||
) {
|
||||
// 青少年模式显示查看
|
||||
if (SPUtils.getBoolean(Constants.SP_TEENAGER_MODE)) {
|
||||
@ -217,6 +237,7 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
backgroundType = DownloadButton.ButtonStyle.DOWNLOADING_NORMAL
|
||||
progress = (downloadEntity.percent * 10).toInt()
|
||||
setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
DownloadManager.getInstance().pause(downloadEntity.url)
|
||||
}
|
||||
}
|
||||
@ -226,7 +247,10 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
downloadDes.visibility = View.VISIBLE
|
||||
downloadDes.text = context.getString(com.gh.gamecenter.feature.R.string.waiting)
|
||||
downloadDes.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(context))
|
||||
setOnClickListener { Utils.toast(context, "最多只能同时下载三个任务,请稍等"); }
|
||||
setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
Utils.toast(context, "最多只能同时下载三个任务,请稍等")
|
||||
}
|
||||
}
|
||||
DownloadStatus.pause,
|
||||
DownloadStatus.timeout,
|
||||
@ -240,6 +264,7 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
downloadDes.text = if (status == DownloadStatus.subscribe) "等待WIFI" else "已暂停"
|
||||
downloadDes.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(context))
|
||||
setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
DownloadManager.getInstance().resume(downloadEntity, false)
|
||||
}
|
||||
}
|
||||
@ -252,6 +277,7 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
) {
|
||||
btnText = context.getString(com.gh.gamecenter.feature.R.string.update)
|
||||
setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
PackagesManager.getUpdateList()
|
||||
.firstOrNull { it.id == downloadEntity.gameId }?.let {
|
||||
VHelper.updateOrReDownload(downloadEntity, it)
|
||||
@ -260,6 +286,7 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
} else {
|
||||
btnText = context.getString(com.gh.gamecenter.feature.R.string.launch)
|
||||
setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
CurrentActivityHolder.getCurrentActivity()?.let {
|
||||
VHelper.installOrLaunch(it, downloadEntity, "畅玩管理")
|
||||
}
|
||||
@ -278,6 +305,7 @@ class InstalledVGameAdapter(private val viewModel: InstalledVGameViewModel): Lis
|
||||
downloadBtn.buttonStyle = DownloadButton.ButtonStyle.NORMAL
|
||||
downloadBtn.text = "下载"
|
||||
downloadBtn.setOnClickListener {
|
||||
clickCallback.invoke()
|
||||
ToastUtils.toast("不应该出现状态为'下载'的按钮")
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ class InstalledVGameViewModel(application: Application): AndroidViewModel(applic
|
||||
val paramsMap = mapOf(
|
||||
"game_id" to vGameIdList
|
||||
)
|
||||
newApi.postMyHaloGame(TAB_VGAME, 1, vGameIdList.size, paramsMap.toRequestBody())
|
||||
newApi.postMyHaloGame(TAB_V_GAME, 1, vGameIdList.size, paramsMap.toRequestBody())
|
||||
.map(ApkActiveUtils.filterMapperList)
|
||||
.compose(singleToMain())
|
||||
.subscribe({
|
||||
@ -234,7 +234,7 @@ class InstalledVGameViewModel(application: Application): AndroidViewModel(applic
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAB_VGAME = "smooth"
|
||||
const val TAB_V_GAME = "smooth"
|
||||
}
|
||||
|
||||
}
|
||||
@ -1119,12 +1119,12 @@ class SearchGameResultAdapter(
|
||||
!hasMutualityZone -> {
|
||||
// 单区服,直接启动
|
||||
val zoneInfo = gameEntity.serviceArea.firstOrNull() ?: AcctGameInfo.ZoneInfo(0)
|
||||
startAccelerating(gameEntity, context, zoneInfo, false)
|
||||
startAccelerating(gameEntity, context, zoneInfo, false, SOURCE_ENTRANCE_SEARCH)
|
||||
}
|
||||
|
||||
lastAcctGame != null -> {
|
||||
// 多区服,有缓存的加速记录
|
||||
startAccelerating(gameEntity, context, lastAcctGame.zoneInfo, true)
|
||||
startAccelerating(gameEntity, context, lastAcctGame.zoneInfo, true, SOURCE_ENTRANCE_SEARCH)
|
||||
}
|
||||
|
||||
else -> {
|
||||
@ -1171,11 +1171,12 @@ class SearchGameResultAdapter(
|
||||
gameEntity: GameEntity,
|
||||
context: Context,
|
||||
zoneInfo: AcctGameInfo.ZoneInfo,
|
||||
hasMultiZone: Boolean
|
||||
hasMultiZone: Boolean,
|
||||
sourceEntrance: String
|
||||
) {
|
||||
val request = AcceleratorValidator.Request(
|
||||
gameEntity,
|
||||
SOURCE_ENTRANCE_SEARCH
|
||||
sourceEntrance
|
||||
)
|
||||
AcceleratorClient.newInstance()
|
||||
.execute(context, request, object : AcceleratorValidator.ValidateListener {
|
||||
@ -1186,7 +1187,7 @@ class SearchGameResultAdapter(
|
||||
gameEntity,
|
||||
true,
|
||||
hasMultiZone,
|
||||
SOURCE_ENTRANCE_SEARCH
|
||||
sourceEntrance
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@ -356,6 +356,9 @@ object SensorsBridge {
|
||||
private const val EVENT_DURATION_EXHAUSTED_DIALOG_SHOW = "DurationExhaustedDialogShow"
|
||||
private const val EVENT_DURATION_EXHAUSTED_DIALOG_CLICK = "DurationExhaustedDialogClick"
|
||||
private const val EVENT_GAME_DETAIL_VIDEO_CLICK = "GameDetailVideoClick"
|
||||
private const val EVENT_HALO_SELF_GAME_INSTALLED_CLICK = "HaloSelfGameInstalledClick"
|
||||
private const val EVENT_HALO_SELF_GAME_FUN_CLICK = "HaloSelfGameFunClick"
|
||||
private const val EVENT_HALO_SELF_GAME_APPOINTMENT_CLICK = "HaloSelfGameAppointmentClick"
|
||||
|
||||
private const val EVENT_DSP_AD_CLICK = "DspAdClick"
|
||||
private const val EVENT_INSTALL_DSP_AD_CLICK = "InstallDspAdClick"
|
||||
@ -4216,9 +4219,9 @@ object SensorsBridge {
|
||||
fun trackHaloSelfClick(
|
||||
profile: String,
|
||||
text: String,
|
||||
linkType: String,
|
||||
linkId: String,
|
||||
linkText: String
|
||||
linkType: String = "",
|
||||
linkId: String = "",
|
||||
linkText: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_PROFILE to profile
|
||||
@ -5777,4 +5780,62 @@ object SensorsBridge {
|
||||
trackEvent(EVENT_DURATION_EXHAUSTED_DIALOG_CLICK, json)
|
||||
}
|
||||
|
||||
/**
|
||||
* 事件ID:HaloSelfGameInstalledClick、HaloSelfGameFunClick
|
||||
* 事件名称:我的光环-我的游戏-已安装/畅玩tab游戏点击事件
|
||||
*/
|
||||
fun trackHaloSelfGameInstalledClick(
|
||||
isVGame: Boolean,
|
||||
gameId: String = "",
|
||||
gameName: String = "",
|
||||
gameType: String = "",
|
||||
position: Int = -1,
|
||||
profile: String,
|
||||
text: String,
|
||||
linkId: String = "",
|
||||
linkText: String = "",
|
||||
linkType: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_GAME_TYPE to gameType
|
||||
if (position != -1) {
|
||||
KEY_POSITION to position
|
||||
}
|
||||
KEY_PROFILE to profile
|
||||
KEY_TEXT to text
|
||||
KEY_LINK_ID to linkId
|
||||
KEY_LINK_TEXT to linkText
|
||||
KEY_LINK_TYPE to linkType
|
||||
}
|
||||
trackEvent(if (isVGame) EVENT_HALO_SELF_GAME_FUN_CLICK else EVENT_HALO_SELF_GAME_INSTALLED_CLICK, json)
|
||||
}
|
||||
|
||||
/**
|
||||
* 事件ID:HaloSelfGameAppointmentClick
|
||||
* 事件名称:我的光环-我的游戏-预约tab游戏点击事件
|
||||
*/
|
||||
fun trackHaloSelfGameAppointmentClick(
|
||||
gameId: String,
|
||||
gameName: String,
|
||||
gameType: String,
|
||||
profile: String,
|
||||
text: String,
|
||||
linkId: String = "",
|
||||
linkText: String = "",
|
||||
linkType: String = ""
|
||||
) {
|
||||
val json = json {
|
||||
KEY_GAME_ID to gameId
|
||||
KEY_GAME_NAME to gameName
|
||||
KEY_GAME_TYPE to gameType
|
||||
KEY_PROFILE to profile
|
||||
KEY_TEXT to text
|
||||
KEY_LINK_ID to linkId
|
||||
KEY_LINK_TEXT to linkText
|
||||
KEY_LINK_TYPE to linkType
|
||||
}
|
||||
trackEvent(EVENT_HALO_SELF_GAME_APPOINTMENT_CLICK, json)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user