Merge branch 'feature-GHZS-750' into 'dev-5.18.0'

feat: 游戏评分相关数据埋点补充—客户端 https://jira.shanqu.cc/browse/GHZS-750

See merge request halo/android/assistant-android!596
This commit is contained in:
刘贻荣
2022-12-27 10:34:17 +08:00
18 changed files with 561 additions and 67 deletions

View File

@ -1190,4 +1190,137 @@ object NewFlatLogUtils {
}
log(json, "event", false)
}
// 游戏详情点击发表评价,游戏详情-评论tab点击“我要安利/我来评价”时上报
fun logGameDetailPublishCommentClick(
button: String,
gameName: String,
gameId: String
) {
val json = json {
"event" to "game_detail_comment_tab_game_comment_publish_click"
"button" to button
"game_name" to gameName
"game_id" to gameId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 浏览评价tab页面停留游戏详情-评价tab时上报
fun logGameDetailCommentTabView(
interval: Long,
gameName: String,
gameId: String
) {
val json = json {
"event" to "game_detail_comment_tab_view"
"interval" to interval
"game_name" to gameName
"game_id" to gameId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 游戏评价点击事件,游戏详情-评论tab点击游戏评价时上报
fun logGameDetailCommentTabCommentClick(
location: String,
tag: String,
filter: String,
button: String,
gameName: String,
gameId: String,
commentId: String
) {
val json = json {
"event" to "game_detail_comment_tab_game_comment_click"
"location" to location
"tag" to tag
"filter_tag_name" to filter
"button" to button
"game_name" to gameName
"game_id" to gameId
"comment_id" to commentId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 浏览评价详情,页面停留游戏评价详情页面时上报
fun logGameDetailCommentDetailPageView(
interval: Long,
gameName: String,
gameId: String,
commentId: String
) {
val json = json {
"event" to "game_detail_comment_tab_detail_view"
"interval" to interval
"game_name" to gameName
"game_id" to gameId
"comment_id" to commentId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 评价详情点击事件,评价详情页面点击时上报
fun logGameDetailCommentDetailCommentClick(
location: String,
tag: String,
filter: String,
button: String,
gameName: String,
gameId: String,
commentId: String
) {
val json = json {
"event" to "game_detail_comment_tab_game_comment_detail_click"
"location" to location
"tag" to tag
"filter_tag_name" to filter
"button" to button
"game_name" to gameName
"game_id" to gameId
"comment_id" to commentId
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 安利墙点击上墙,安利墙点击“上墙”时上报
fun logAmwayPasteClick() {
val json = json {
"event" to "recommend_wall_paste_click"
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 安利墙发表评价,通过安利墙进入发表评价页面时上报
fun logAmwayGameCommentPublish(entrance: String) {
val json = json {
"event" to "recommend_wall_game_comment_publish"
"entrance" to entrance
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
// 成功发表评价,成功发布游戏评价时上报
fun logGameCommentPublishSuccess(
entrance: String,
commentId: String,
type: String
) {
val json = json {
"event" to "game_comment_publish_success"
"entrance" to entrance
"comment_id" to commentId
"type" to type
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
}

View File

@ -12,6 +12,7 @@ import com.ethanhua.skeleton.Skeleton
import com.gh.common.exposure.ExposureListener
import com.gh.gamecenter.feature.exposure.ExposureSource
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.xapk.XapkInstaller
import com.gh.common.xapk.XapkUnzipStatus
import com.gh.download.DownloadManager
@ -21,6 +22,7 @@ import com.gh.gamecenter.common.baselist.LazyListFragment
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.VerticalItemDecoration
import com.gh.gamecenter.core.utils.ClickUtils
@ -32,7 +34,6 @@ import com.gh.gamecenter.databinding.FragmentAmwayBinding
import com.gh.gamecenter.entity.RatingComment
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.eventbus.EBPackage
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.fragment.HomeSearchToolWrapperFragment
import com.gh.gamecenter.gamedetail.rating.RatingFragment
import com.google.android.material.appbar.AppBarLayout
@ -205,6 +206,7 @@ class AmwayFragment : LazyListFragment<AmwayListItemData, AmwayViewModel>() {
MtaHelper.onEvent("发表评论", "进入", "上墙")
ifLogin("安利墙") {
startActivity(AmwaySearchActivity.getIntent(requireContext()))
NewFlatLogUtils.logAmwayPasteClick()
}
}
}

View File

@ -3,11 +3,15 @@ package com.gh.gamecenter.amway.search
import android.content.Context
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.utils.toBinding
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.utils.toBinding
import com.gh.gamecenter.feature.entity.GameEntity
class AmwaySearchAdapter(context: Context, val mViewModel: AmwaySearchViewModel) : ListAdapter<GameEntity>(context) {
class AmwaySearchAdapter(
context: Context,
val mViewModel: AmwaySearchViewModel,
val mEntrance: String
) : ListAdapter<GameEntity>(context) {
fun setData(listData: List<GameEntity>) {
setListData(listData)
@ -22,7 +26,7 @@ class AmwaySearchAdapter(context: Context, val mViewModel: AmwaySearchViewModel)
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
(holder as AmwaySearchViewHolder).bindView(mEntityList[position])
(holder as AmwaySearchViewHolder).bindView(mEntityList[position], mEntrance)
}
}

View File

@ -31,7 +31,7 @@ class AmwaySearchDefaultFragment : SearchDefaultFragment() {
updateView()
mBinding.hotList.run {
layoutManager = LinearLayoutManager(context)
adapter = AmwaySearchAdapter(context, mViewModel).apply { setData(it) }
adapter = AmwaySearchAdapter(context, mViewModel, "安利墙搜索-最近玩过").apply { setData(it) }
}
updateNoPlayedGameHint()

View File

@ -26,7 +26,7 @@ class AmwaySearchListFragment : ToolbarFragment() {
mViewModel = viewModelProviderFromParent()
mAdapter = AmwaySearchAdapter(requireContext(), mViewModel)
mAdapter = AmwaySearchAdapter(requireContext(), mViewModel, "安利墙搜索-搜索列表")
mBinding.recyclerView.adapter = mAdapter
mBinding.recyclerView.layoutManager = LinearLayoutManager(requireContext())

View File

@ -4,12 +4,12 @@ import android.app.Activity
import android.graphics.Typeface
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.*
import com.gh.common.util.CommentUtils
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.callback.SimpleCallback
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.showRegulationTestDialogIfNeeded
import com.gh.gamecenter.common.callback.SimpleCallback
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.databinding.AmwaySearchItemBinding
import com.gh.gamecenter.feature.entity.GameEntity
@ -22,7 +22,7 @@ import java.lang.ref.WeakReference
class AmwaySearchViewHolder(var binding: AmwaySearchItemBinding, val mViewModel: AmwaySearchViewModel) :
RecyclerView.ViewHolder(binding.root) {
fun bindView(gameEntity: GameEntity) {
fun bindView(gameEntity: GameEntity, entrance: String) {
binding.iconIv.displayGameIcon(gameEntity)
binding.nameTv.text = gameEntity.name
binding.addIv.goneIf(!gameEntity.showComment)
@ -58,6 +58,7 @@ class AmwaySearchViewHolder(var binding: AmwaySearchItemBinding, val mViewModel:
MtaHelper.onEvent("发表评论", "进入", "选中游戏_${gameEntity.name}")
val intent = RatingEditActivity.getIntent(
binding.root.context,
entrance,
gameEntity,
0.0F,
installPackageName,

View File

@ -9,10 +9,10 @@ import android.view.ViewGroup
import android.widget.ProgressBar
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.common.util.OnSyncCallBack
import com.gh.common.util.SyncDataBetweenPageHelper
import com.gh.gamecenter.R
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.constant.EntranceConsts
@ -20,6 +20,7 @@ import com.gh.gamecenter.common.constant.ItemViewType
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.viewholder.FooterViewHolder
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.PageSwitchDataHelper
import com.gh.gamecenter.databinding.RatingCommentItemBinding
import com.gh.gamecenter.databinding.RatingItemBinding
import com.gh.gamecenter.entity.Rating
@ -204,9 +205,14 @@ class RatingAdapter(
gameType,
bbsId,
)
NewFlatLogUtils.logGameDetailPublishCommentClick(
"我来评价",
name ?: "",
id
)
}
skipRatingEdit(0.0F, "游戏详情-评论-[我来评]")
skipRatingEdit(0.0F, "游戏详情-评论-[我来评]")
}
}
ratingAmwayBtn.setOnClickListener {
@ -226,6 +232,11 @@ class RatingAdapter(
gameType,
bbsId,
)
NewFlatLogUtils.logGameDetailPublishCommentClick(
"我要安利",
name ?: "",
id
)
}
skipRatingEdit(0.0F, "游戏详情-评论-[我要安利]", fromAmway = true, isSkipSuccessPage = false)
}
@ -288,12 +299,21 @@ class RatingAdapter(
holder.binding.content.setIsExpanded(Int.MAX_VALUE == maxDesLines)
holder.binding.replyContent.setTextColor(R.color.text_subtitle.toColor(mContext))
holder.binding.content.setTextColor(R.color.text_subtitle.toColor(mContext))
holder.setContent(commentData, mListViewModel.game, dataPosition, mEntrance, path) {
holder.setContent(commentData, mListViewModel, dataPosition, mEntrance, path) {
deleteMyComment(commentData.id)
}
holder.binding.root.background = ContextCompat.getDrawable(mContext, R.drawable.background_shape_white_radius_8)
holder.binding.vote.isChecked = commentData.me.isVoted
holder.binding.run {
val location = when {
commentData.me.isCommented -> "我的评价"
commentData.isServiceComment -> "小编评价"
else -> "全部评价"
}
val isCommentListItem = !commentData.me.isCommented && !commentData.isServiceComment
val tag = if (isCommentListItem) mListViewModel.sort else ""
val filter = if (isCommentListItem) mListViewModel.filter else ""
commentItem.setOnClickListener {
if (isChildLongClick) {
isChildLongClick = false
@ -313,6 +333,16 @@ class RatingAdapter(
gameType,
bbsId,
)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"评价内容",
name ?: "",
id,
commentData.id
)
}
}
content.setExpandCallback {
@ -325,6 +355,18 @@ class RatingAdapter(
commentData.content.replace(RatingEditActivity.LABEL_REPLACE_REGEX.toRegex(), "").copyTextAndToast()
return@OnLongClickListener true
})
replyContainer.setOnClickListener {
skipRatingReply(false, commentData, dataPosition)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"引用回复",
mListViewModel.game.name ?: "",
mListViewModel.game.id,
commentData.id
)
}
replyContent.setOnLongClickListener(View.OnLongClickListener {
isChildLongClick = true
commentData.replyData?.content?.replace(RatingEditActivity.LABEL_REPLACE_REGEX.toRegex(), "")
@ -340,11 +382,29 @@ class RatingAdapter(
mListViewModel.game.id,
mListViewModel.game.gameType
)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"查看更多回复",
mListViewModel.game.name ?: "",
mListViewModel.game.id,
commentData.id
)
}
comment.setOnClickListener {
skipRatingReply(false, commentData, dataPosition)
if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab_回复", mListViewModel.game.name)
if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "回复", mListViewModel.game.name)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"回复",
mListViewModel.game.name ?: "",
mListViewModel.game.id,
commentData.id
)
}
vote.setOnClickListener {
mContext.ifLogin("游戏详情-评论-点赞评论") {
@ -363,6 +423,15 @@ class RatingAdapter(
mListViewModel.game.gameType
)
})
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"点赞",
mListViewModel.game.name ?: "",
mListViewModel.game.id,
commentData.id
)
} else {
mListViewModel.unVoteComment(commentData.id, callback = {
val count = commentData.vote - 1
@ -377,6 +446,15 @@ class RatingAdapter(
)
if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "取消点赞", mListViewModel.game.name)
})
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"取消点赞",
mListViewModel.game.name ?: "",
mListViewModel.game.id,
commentData.id
)
}
}
}
@ -385,6 +463,18 @@ class RatingAdapter(
}
private fun skipRatingReply(isOpenKeyboard: Boolean, commentData: RatingComment, dataPosition: Int) {
val location = when {
commentData.me.isCommented -> "我的评价"
commentData.isServiceComment -> "小编评价"
else -> "全部评价"
}
val pageData = hashMapOf(EntranceConsts.KEY_LOCATION to location)
if (location == "全部评价") {
pageData[EntranceConsts.KEY_SORT] = mListViewModel.sort
pageData[EntranceConsts.KEY_FILTER] = mListViewModel.filter
}
PageSwitchDataHelper.pushCurrentPageData(pageData)
val intent = if (isOpenKeyboard) {
RatingReplyActivity.getOpenKeyboardIntent(mContext, mListViewModel.game, commentData, mEntrance, path)
} else {
@ -414,6 +504,7 @@ class RatingAdapter(
val intent =
RatingEditActivity.getIntent(
mContext,
entrance,
mListViewModel.game,
starCount,
installPackageName,

View File

@ -20,6 +20,7 @@ import android.widget.TextView
import androidx.core.content.ContextCompat
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
@ -48,13 +49,14 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
@SuppressLint("CheckResult")
fun setContent(
commentData: RatingComment,
game: GameEntity?,
viewModel: RatingViewModel,
dataPosition: Int,
entrance: String,
path: String,
deleteCallback: () -> Unit
) {
binding.run {
val game = viewModel.game
val context = itemView.context
val p = Pattern.compile(LABEL_REGEX)
val m = p.matcher(commentData.content)
@ -218,7 +220,7 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
}
if (game != null && game.getApk().size > 0 && game.getApk()[0].version == commentData.gameVersion) {
if (game.getApk().size > 0 && game.getApk()[0].version == commentData.gameVersion) {
version.text = "当前版本"
} else {
version.text = ("版本:" + commentData.gameVersion)
@ -251,12 +253,22 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
} else {
badge.visibility = View.GONE
}
val location = when {
commentData.me.isCommented -> "我的评价"
commentData.isServiceComment -> "小编评价"
else -> "全部评价"
}
val isCommentListItem = !commentData.me.isCommented && !commentData.isServiceComment
val tag = if (isCommentListItem) viewModel.sort else ""
val filter = if (isCommentListItem) viewModel.filter else ""
userIcon.setOnClickListener {
if (path == "评论详情") {
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_game_comment_detail_commet_profile_photo",
game?.id ?: "",
game?.gameType ?: "",
game.id,
game.gameType,
commentData.user.id ?: ""
)
}
@ -264,11 +276,21 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
// MtaHelper.onEvent("游戏详情_新", "评论Tab-点击用户头像", game?.name)
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_allcomment_profile_photo",
game?.id ?: "",
game?.gameType ?: "",
game.id,
game.gameType,
commentData.user.id ?: ""
)
}
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"用户信息",
game.name ?: "",
game.id,
commentData.id
)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击用户头像", game?.name)
DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, getKey(path))
}
@ -276,8 +298,8 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
if (path == "评论详情") {
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_game_comment_detail_commet_nickname",
game?.id ?: "",
game?.gameType ?: "",
game.id,
game.gameType,
commentData.user.id ?: ""
)
}
@ -285,11 +307,21 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
// MtaHelper.onEvent("游戏详情_新", "评论Tab-点击用户名字", game?.name)
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_allcomment_nickname",
game?.id ?: "",
game?.gameType ?: "",
game.id,
game.gameType,
commentData.user.id ?: ""
)
}
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"用户信息",
game.name ?: "",
game.id,
commentData.id
)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击用户名字", game?.name)
DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, getKey(path))
}
@ -313,6 +345,15 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
more.setOnClickListener {
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab_更多按钮", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击更多", game?.name)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"展开右上角",
game.name ?: "",
game.id,
commentData.id
)
showMorePopWindow(it, commentData.user.id == UserManager.getInstance().userId) { text ->
when (text) {
"复制" -> {
@ -320,8 +361,17 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "更多-复制", game?.name)
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_allcomment_copy",
game?.id ?: "",
game?.gameType ?: ""
game.id,
game.gameType
)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"右上角-复制",
game.name ?: "",
game.id,
commentData.id
)
commentData.content.replace(RatingEditActivity.LABEL_REPLACE_REGEX.toRegex(), "")
.copyTextAndToast()
@ -329,7 +379,16 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
"修改" -> {
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab_修改", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "更多-修改", game?.name)
val intent = RatingEditActivity.getPatchIntent(context, game!!, commentData)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"右上角-修改",
game.name ?: "",
game.id,
commentData.id
)
val intent = RatingEditActivity.getPatchIntent(context, game, commentData)
SyncDataBetweenPageHelper.startActivityForResult(
context,
intent,
@ -342,8 +401,17 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "更多-投诉", game?.name)
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_allcomment_report",
game?.id ?: "",
game?.gameType ?: ""
game.id,
game.gameType
)
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"右上角-投诉",
game.name ?: "",
game.id,
commentData.id
)
context.ifLogin(BaseActivity.mergeEntranceAndPath(entrance, path)) {
DialogUtils.showReportReasonDialog(
@ -351,7 +419,7 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
Constants.REPORT_LIST.toList() as ArrayList<String>
) { reason, desc ->
SimpleRequestHelper.reportGameComment(
game?.id ?: "",
game.id,
commentData.id,
if (reason != "其他原因") reason else desc
)
@ -359,11 +427,20 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
}
}
"删除" -> {
NewFlatLogUtils.logGameDetailCommentTabCommentClick(
location,
tag,
filter,
"右上角-删除",
game.name ?: "",
game.id,
commentData.id
)
DialogHelper.showDeleteGameCommentDialog(
context,
R.string.delete_game_comment.toResString()
) {
SimpleRequestHelper.deleteGameComment(game?.id ?: "", commentData.id) {
SimpleRequestHelper.deleteGameComment(game.id, commentData.id) {
deleteCallback.invoke()
}
}
@ -377,13 +454,14 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab-评论说明", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "评论说明", game?.name)
DialogUtils.showStopServerExplanationDialog(
context, if (game?.commentDescription?.isNotEmpty() == true) game.commentDescription else
context.getString(R.string.rating_protection), game?.name ?: ""
context,
game.commentDescription.ifEmpty { context.getString(R.string.rating_protection) },
game.name ?: ""
)
} else if (commentData.isEditContent == true) {
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab-点击时间", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击时间", game?.name)
val intent = CommentLogsActivity.getIntent(context, game!!.id, commentData.id)
val intent = CommentLogsActivity.getIntent(context, game.id, commentData.id)
context.startActivity(intent)
}
}
@ -417,7 +495,7 @@ class RatingCommentItemViewHolder(val binding: RatingCommentItemBinding) : BaseR
}
override fun onClick(widget: View) {
val intent = RatingEditActivity.getPatchIntent(context, game!!, commentData)
val intent = RatingEditActivity.getPatchIntent(context, game, commentData)
SyncDataBetweenPageHelper.startActivityForResult(
context,
intent,

View File

@ -17,6 +17,7 @@ import androidx.constraintlayout.widget.ConstraintSet
import androidx.core.content.ContextCompat
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
@ -24,6 +25,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.utils.*
@ -39,8 +41,15 @@ import java.util.regex.Pattern
class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBinding) :
BaseRecyclerViewHolder<Any>(binding.root) {
@SuppressLint("CheckResult")
fun setContent(commentData: RatingComment, game: GameEntity?, dataPosition: Int, entrance: String, path: String) {
fun setContent(
commentData: RatingComment,
viewModel: RatingReplyViewModel,
dataPosition: Int,
entrance: String,
path: String
) {
binding.run {
val game = viewModel.game
ConstraintSet().apply {
clone(contentTv.parent as ConstraintLayout)
clear(contentTv.id, ConstraintSet.START)
@ -194,6 +203,7 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
)
}
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击用户头像", game?.name)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "作者用户信息")
DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, getKey(path))
}
userNameTv.setOnClickListener {
@ -215,6 +225,7 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
)
}
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击用户名字", game?.name)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "作者用户信息")
DirectUtils.directToHomeActivity(context, commentData.user.id, entrance, getKey(path))
}
@ -237,6 +248,7 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
moreIv.setOnClickListener {
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab_更多按钮", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "点击更多", game?.name)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "展开评价右上角")
showMorePopWindow(it, commentData.user.id == UserManager.getInstance().userId) { text ->
when (text) {
"复制" -> {
@ -247,12 +259,14 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
game?.id ?: "",
game?.gameType ?: ""
)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "评价右上角-复制")
commentData.content.replace(RatingEditActivity.LABEL_REPLACE_REGEX.toRegex(), "")
.copyTextAndToast()
}
"修改" -> {
// if (path == "游戏详情:评分") MtaHelper.onEvent("游戏详情_新", "评论Tab_修改", game?.name)
// if (path == "折叠评论") MtaHelper.onEvent("折叠评论", "更多-修改", game?.name)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "评价右上角-修改")
val intent = RatingEditActivity.getPatchIntent(context, game!!, commentData)
SyncDataBetweenPageHelper.startActivityForResult(
context,
@ -269,6 +283,7 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
game?.id ?: "",
game?.gameType ?: ""
)
logGameDetailCommentDetailCommentClick(viewModel, entrance, "评价右上角-投诉")
context.ifLogin(BaseActivity.mergeEntranceAndPath(entrance, path)) {
DialogUtils.showReportReasonDialog(
context,
@ -283,6 +298,7 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
}
}
"删除" -> {
logGameDetailCommentDetailCommentClick(viewModel, entrance, "评价右上角-删除")
DialogHelper.showDeleteGameCommentDialog(
context,
R.string.delete_game_comment.toResString()
@ -409,4 +425,29 @@ class RatingDetailCommentItemViewHolder(val binding: ItemArticleDetailCommentBin
popupWindow.showAutoOrientation(v)
}
private fun logGameDetailCommentDetailCommentClick(
viewModel: RatingReplyViewModel,
entrance: String,
button: String
) {
viewModel.run {
val location = when {
lastPageData.contains(EntranceConsts.KEY_LOCATION) -> lastPageData[EntranceConsts.KEY_LOCATION]
entrance.contains("安利墙") -> "安利墙"
else -> "其他"
}
val tag = if (location == "全部评价") lastPageData[EntranceConsts.KEY_SORT] else ""
val filter = if (location == "全部评价") lastPageData[EntranceConsts.KEY_FILTER] else ""
NewFlatLogUtils.logGameDetailCommentDetailCommentClick(
location ?: "",
tag ?: "",
filter ?: "",
button,
game?.name ?: "",
game?.id ?: "",
commentId ?: ""
)
}
}
}

View File

@ -10,6 +10,7 @@ import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
@ -116,6 +117,11 @@ class RatingFragment : LazyListFragment<RatingComment, RatingViewModel>(), IScro
game?.id ?: "",
game?.gameType ?: ""
)
NewFlatLogUtils.logGameDetailCommentTabView(
stayTime,
game?.name ?: "",
game?.id ?: ""
)
}
override fun onFragmentFirstVisible() {

View File

@ -12,6 +12,7 @@ import androidx.core.widget.doOnTextChanged
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.common.util.SyncDataBetweenPageHelper
import com.gh.download.DownloadManager
@ -24,6 +25,7 @@ import com.gh.gamecenter.common.view.CustomDividerItemDecoration
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.KeyboardHeightObserver
import com.gh.gamecenter.core.utils.KeyboardHeightProvider
import com.gh.gamecenter.core.utils.PageSwitchDataHelper
import com.gh.gamecenter.databinding.ActivityRatingReplyBinding
import com.gh.gamecenter.databinding.PieceArticleInputContainerBinding
import com.gh.gamecenter.databinding.PieceCommentTypingContainerBinding
@ -132,7 +134,9 @@ class RatingReplyActivity : ListActivity<RatingReplyEntity, RatingReplyViewModel
intent.getBooleanExtra(EntranceConsts.KEY_SHOW_KEYBOARD_IF_NEEDED, false),
intent.getStringExtra(EntranceConsts.KEY_TOP_COMMENT_ID) ?: ""
)
return ViewModelProviders.of(this, factory).get(RatingReplyViewModel::class.java)
return ViewModelProviders.of(this, factory).get(RatingReplyViewModel::class.java).apply {
lastPageData = PageSwitchDataHelper.popLastPageData() ?: hashMapOf()
}
}
private fun initView() {
@ -151,6 +155,7 @@ class RatingReplyActivity : ListActivity<RatingReplyEntity, RatingReplyViewModel
mReadyReplyData = null
mInputBinding.answerCommentEt.hint = "回复 @${mListViewModel.comment?.user?.name}"
showKeyboard(true)
logGameDetailCommentDetailCommentClick("回复评价")
}
}
@ -285,12 +290,44 @@ class RatingReplyActivity : ListActivity<RatingReplyEntity, RatingReplyViewModel
}
override fun handleBackPressed(): Boolean {
logGameDetailCommentDetailCommentClick("返回")
if (SyncDataBetweenPageHelper.setResultAndFinish(this, mListViewModel.comment)) {
return true
}
return super.handleBackPressed()
}
override fun onFinish() {
val stayTime = (System.currentTimeMillis() - startPageTime) / 1000
NewFlatLogUtils.logGameDetailCommentDetailPageView(
stayTime,
mListViewModel?.game?.name ?: "",
mListViewModel?.game?.id ?: "",
mListViewModel?.commentId ?: ""
)
}
private fun logGameDetailCommentDetailCommentClick(button: String) {
mListViewModel?.run {
val location = when {
lastPageData.contains(EntranceConsts.KEY_LOCATION) -> lastPageData[EntranceConsts.KEY_LOCATION]
mEntrance.contains("安利墙") -> "安利墙"
else -> "其他"
}
val tag = if (location == "全部评价") lastPageData[EntranceConsts.KEY_SORT] else ""
val filter = if (location == "全部评价") lastPageData[EntranceConsts.KEY_FILTER] else ""
NewFlatLogUtils.logGameDetailCommentDetailCommentClick(
location ?: "",
tag ?: "",
filter ?: "",
button,
game?.name ?: "",
game?.id ?: "",
commentId ?: ""
)
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(status: EBDownloadStatus?) {
if ("delete" == status?.status) {

View File

@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.IExposable
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.R
@ -24,10 +25,10 @@ import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.baselist.LoadType
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.ItemViewType
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.common.view.SegmentedFilterView
import com.gh.gamecenter.common.viewholder.FooterViewHolder
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.NumberUtils
@ -153,6 +154,7 @@ class RatingReplyAdapter(
game.id,
game.gameType
)
logGameDetailCommentDetailCommentClick("游戏详情")
GameDetailActivity.startGameDetailActivity(
mContext,
game,
@ -164,20 +166,23 @@ class RatingReplyAdapter(
DownloadItemUtils.setOnClickListener(
mContext, this,
game, 0, this@RatingReplyAdapter,
entrance, BaseActivity.mergeEntranceAndPath(entrance, path), mExposureEvent
) {
NewLogUtils.logDownloadBtnClick(
game.id,
game.gameType,
text
)
}
entrance, BaseActivity.mergeEntranceAndPath(entrance, path), mExposureEvent,
clickCallback = {
NewLogUtils.logDownloadBtnClick(
game.id,
game.gameType,
text
)
},
refreshCallback = null,
allStateClickCallback = { logGameDetailCommentDetailCommentClick("按钮") }
)
DownloadItemUtils.updateDownloadButton(mContext, this, game, false, PluginLocation.only_game)
}
}
is RatingDetailCommentItemViewHolder -> {
val commentData = mEntityList[position].comment!!
holder.setContent(commentData, viewModel.game, position, entrance, path)
holder.setContent(commentData, viewModel, position, entrance, path)
holder.binding.run {
contentTv.setExpandMaxLines(Int.MAX_VALUE)
contentTv.setOnLongClickListener(View.OnLongClickListener {
@ -202,6 +207,7 @@ class RatingReplyAdapter(
viewModel.game?.id ?: "",
viewModel.game?.gameType ?: ""
)
logGameDetailCommentDetailCommentClick("点赞评价")
} else {
viewModel.unvoteComment {
likeCountTv.setDrawableStart(R.drawable.comment_vote_unselect)
@ -211,6 +217,7 @@ class RatingReplyAdapter(
commentData.vote = count
commentData.me.isVoted = false
}
logGameDetailCommentDetailCommentClick("取消点赞评价")
}
}
}
@ -346,12 +353,14 @@ class RatingReplyAdapter(
viewModel.game?.id ?: "",
viewModel.game?.gameType ?: "",
)
logGameDetailCommentDetailCommentClick("回复点赞")
} else {
viewModel.voteReply(replyEntity.id, false, callback = {
likeCountTv.setDrawableStart(R.drawable.comment_vote_unselect)
likeCountTv.setTextColor(R.color.text_subtitleDesc.toColor(likeCountTv.context))
likeCountTv.text = if (replyEntity.vote == 0) "" else (replyEntity.vote).toString()
})
logGameDetailCommentDetailCommentClick("回复取消点赞")
}
}
}
@ -366,9 +375,22 @@ class RatingReplyAdapter(
viewModel.game?.id ?: "",
viewModel.game?.gameType ?: "",
)
logGameDetailCommentDetailCommentClick("回复回复")
}
}
root.setOnClickListener {
if (replyEntity.user.id == UserManager.getInstance().userId) {
Utils.toast(mContext, "不能回复自己")
} else {
replyCallback.invoke(replyEntity)
NewLogUtils.logCommentTabOrCommentDetailClick(
"click_game_comment_detail_answer",
viewModel.game?.id ?: "",
viewModel.game?.gameType ?: "",
)
logGameDetailCommentDetailCommentClick("回复正文")
}
}
root.setOnClickListener { commentCountTv.performClick() }
moreIv.setOnClickListener { view ->
showMorePopWindow(view, replyEntity.user.id == UserManager.getInstance().userId) { it ->
@ -378,6 +400,7 @@ class RatingReplyAdapter(
RatingEditActivity.LABEL_REPLACE_REGEX.toRegex(),
""
).copyTextAndToast()
logGameDetailCommentDetailCommentClick("回复右上角-复制")
}
"投诉" -> {
mContext.ifLogin("游戏详情-评分-评论详情- 投诉评论") {
@ -393,6 +416,7 @@ class RatingReplyAdapter(
)
}
}
logGameDetailCommentDetailCommentClick("回复右上角-投诉")
}
"删除" -> {
DialogHelper.showDeleteGameCommentDialog(
@ -421,9 +445,11 @@ class RatingReplyAdapter(
}
}
}
logGameDetailCommentDetailCommentClick("回复右上角-删除")
}
}
}
logGameDetailCommentDetailCommentClick("回复展开右上角")
}
userIconIv.setOnClickListener {
@ -439,6 +465,7 @@ class RatingReplyAdapter(
viewModel.game?.gameType ?: "",
replyEntity.user.id ?: ""
)
logGameDetailCommentDetailCommentClick("回复者用户信息")
}
userNameTv.setOnClickListener {
DirectUtils.directToHomeActivity(
@ -453,6 +480,7 @@ class RatingReplyAdapter(
viewModel.game?.gameType ?: "",
replyEntity.user.id ?: ""
)
logGameDetailCommentDetailCommentClick("回复者用户信息")
}
}
}
@ -480,14 +508,18 @@ class RatingReplyAdapter(
orderSfv.setItemList(listOf("正序", "倒序"), 0)
}
orderSfv.setOnCheckedCallback(object : SegmentedFilterView.OnCheckedCallback {
override fun onItemCheck(position: Int) {
when (position) {
0 -> viewModel.sortList(RatingReplyViewModel.SORT_POSITIVE)
1 -> viewModel.sortList(RatingReplyViewModel.SORT_NEGATION)
orderSfv.setOnCheckedCallback { position ->
when (position) {
0 -> {
viewModel.sortList(RatingReplyViewModel.SORT_POSITIVE)
logGameDetailCommentDetailCommentClick("正序")
}
1 -> {
viewModel.sortList(RatingReplyViewModel.SORT_NEGATION)
logGameDetailCommentDetailCommentClick("倒序")
}
}
})
}
}
}
is FooterViewHolder -> {
@ -578,6 +610,27 @@ class RatingReplyAdapter(
popupWindow.showAutoOrientation(v)
}
private fun logGameDetailCommentDetailCommentClick(button: String) {
viewModel.run {
val location = when {
lastPageData.contains(EntranceConsts.KEY_LOCATION) -> lastPageData[EntranceConsts.KEY_LOCATION]
entrance.contains("安利墙") -> "安利墙"
else -> "其他"
}
val tag = if (location == "全部评价") lastPageData[EntranceConsts.KEY_SORT] else ""
val filter = if (location == "全部评价") lastPageData[EntranceConsts.KEY_FILTER] else ""
NewFlatLogUtils.logGameDetailCommentDetailCommentClick(
location ?: "",
tag ?: "",
filter ?: "",
button,
game?.name ?: "",
game?.id ?: "",
commentId ?: ""
)
}
}
override fun getEventByPosition(pos: Int): ExposureEvent? {
return mExposureEvent
}

View File

@ -48,6 +48,7 @@ class RatingReplyViewModel(
val headDataLiveData = MediatorLiveData<Boolean>()
val processDialog = MediatorLiveData<WaitingDialogFragment.WaitingDialogData>()
var lastPageData = hashMapOf<String, String>()
private var mSortValue = SORT_POSITIVE
private var isHandleTopComment = false

View File

@ -6,21 +6,21 @@ import android.text.TextUtils
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.util.*
import com.gh.common.util.ErrorHelper
import com.gh.common.util.PackageHelper
import com.gh.gamecenter.common.baselist.ListViewModel
import com.gh.gamecenter.common.baselist.LoadParams
import com.gh.gamecenter.common.baselist.LoadStatus
import com.gh.gamecenter.common.baselist.LoadType
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.UrlFilterUtils
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.common.entity.ErrorEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.entity.Rating
import com.gh.gamecenter.entity.RatingComment
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.energy.EnergyBridge
import com.gh.gamecenter.retrofit.RetrofitManager
import com.lightgame.utils.Utils
import io.reactivex.Observable
@ -37,6 +37,8 @@ class RatingViewModel(application: Application, val game: GameEntity, val type:
val ratingLiveData = MutableLiveData<Rating>()
val filterMap = HashMap<String, String?>()
var packageNameList = ArrayList<String>()
var sort = "默认"
var filter = ""
init {
if (type == RatingType.RATING) {
@ -166,6 +168,8 @@ class RatingViewModel(application: Application, val game: GameEntity, val type:
}
fun filterList(sort: String?, filter: String?) {
this.sort = sort ?: "默认"
this.filter = filter ?: ""
filterMap.clear()
when (sort) {

View File

@ -16,6 +16,7 @@ import androidx.lifecycle.ViewModelProviders
import com.gh.common.DefaultJsApi
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.R
@ -150,6 +151,18 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
mViewModel.getDeviceName()
mViewModel.getGuideTags()
mBaseHandler.sendEmptyMessageDelayed(SAVE_DRAFTS_MESSAGE_WHAT, SAVE_DRAFTS_INTERVAL_TIME)
logAmwayGameCommentPublish()
}
private fun logAmwayGameCommentPublish() {
val entrance = when (mEntrance) {
"安利墙搜索-最近玩过" -> "最近玩过"
"安利墙搜索-搜索列表" -> "搜索"
else -> ""
}
if (entrance.isNotBlank()) {
NewFlatLogUtils.logAmwayGameCommentPublish(entrance)
}
}
private fun initView() {
@ -335,6 +348,8 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
setResult(Activity.RESULT_OK)
toast("提交成功")
logGameCommentPublishSuccess(it.data ?: Pair("", ""))
if (mFromAmway) {
if (mIsSkipSuccessPage) {
startActivity(ShellActivity.getIntent(this, ShellActivity.Type.AMWAY_SUCCESS, mGame))
@ -452,6 +467,25 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
}
private fun logGameCommentPublishSuccess(result: Pair<String, String>) {
val entrance = when {
mEntrance.contains("我要安利") -> "我要安利"
mEntrance.contains("我来评价") -> "我来评价"
mEntrance.contains("安利墙") -> "安利墙"
else -> "其他"
}
val type = when (result.second) {
"first" -> "首次发布"
"second" -> "再次发布"
else -> "修改评价"
}
NewFlatLogUtils.logGameCommentPublishSuccess(
entrance,
result.first,
type
)
}
override fun onMenuItemClick(item: MenuItem?): Boolean {
if (item?.itemId == R.id.menu_game_comment) {
debounceActionWithInterval(R.id.menu_game_comment, 1000L) {
@ -609,6 +643,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
fun getIntent(
context: Context,
entrance: String,
game: GameEntity,
starCount: Float,
installPackageName: String?,
@ -621,6 +656,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
intent.putExtra(EntranceConsts.KEY_AMWAY, fromAmway)
intent.putExtra(EntranceConsts.KEY_SKIP_SUCCESS_PAGE, isSkipSuccessPage)
intent.putExtra(EntranceConsts.KEY_PACKAGENAME, installPackageName)
intent.putExtra(EntranceConsts.KEY_ENTRANCE, entrance)
return intent
}

View File

@ -29,7 +29,7 @@ class RatingEditViewModel(
var deviceName: MutableLiveData<String> = MutableLiveData()
var guideTags: MutableLiveData<List<String>> = MutableLiveData() // 引导标签
val postLiveData = MediatorLiveData<Resource<String>>()
val postLiveData = MediatorLiveData<Resource<Pair<String, String>>>()
val ratingDraftLiveData = MediatorLiveData<RatingDraftEntity?>()
val postRatingDrafts = MediatorLiveData<Pair<RatingEditActivity.SaveDraftType, RatingDraftEntity>>()
val processDialog = MediatorLiveData<WaitingDialogFragment.WaitingDialogData>()
@ -81,14 +81,19 @@ class RatingEditViewModel(
.subscribe(object : BiResponse<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
processDialog.postValue(WaitingDialogFragment.WaitingDialogData("提交中...", false))
postLiveData.postValue(Resource.success(""))
deleteRatingDraft()
if (commentId.isNotEmpty()) {
postLiveData.postValue(Resource.success(Pair("", "")))
} else {
val dataJson = JSONObject(data.string())
val gameCommentId = dataJson.optString("_id")
val type = dataJson.optString("type")
postLiveData.postValue(Resource.success(Pair(gameCommentId, type)))
if (commentId.isEmpty()) {
tryWithDefaultCatch {
EnergyBridge.postEnergyTask("post_game_comment", JSONObject(data.string()).optString("_id"))
EnergyBridge.postEnergyTask("post_game_comment", gameCommentId)
}
}
deleteRatingDraft()
}
override fun onFailure(exception: Exception) {

View File

@ -5,15 +5,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_white"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingTop="@dimen/game_detail_item_horizontal_padding"
android:paddingStart="@dimen/game_detail_item_horizontal_padding"
android:paddingEnd="@dimen/game_detail_item_horizontal_padding">
<RelativeLayout
android:id="@+id/gameIconContainer"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_marginTop="@dimen/game_detail_item_horizontal_padding"
android:layout_marginLeft="@dimen/game_detail_item_horizontal_padding"
android:layout_marginBottom="@dimen/game_detail_item_horizontal_padding"
android:layout_marginRight="12dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/contentContainer"
@ -94,6 +94,7 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="@dimen/game_detail_item_horizontal_padding"
android:background="@color/divider"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

View File

@ -255,4 +255,5 @@ public class EntranceConsts {
public static final String KEY_PLATFORM_REQUESTS_ID = "platform_requests_id";
public static final String KEY_TOP_ID = "top_id";
public static final String KEY_ARCHIVE_CONFIG_URL = "archive_config_url";
public static final String KEY_FILTER = "filter";
}