【光环助手V5.5.0】前端优化汇总第一周(1213测试 1-3)https://git.shanqu.cc/pm/halo-app-issues/-/issues/1617#note_127947

This commit is contained in:
lyr
2021-12-13 20:35:44 +08:00
parent e6246314fd
commit 0b40894cda
2 changed files with 68 additions and 69 deletions

View File

@ -5,6 +5,7 @@ import android.util.SparseArray
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.collection.ArrayMap
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.constant.Constants
@ -241,39 +242,6 @@ class SearchGameIndexAdapter(context: Context,
tagContainer.addView(libaoView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.server) {
val serverView = getContentTagView(
R.drawable.ic_label_server,
"",
"开服",
tagWidth,
if (tagContainer.childCount == 3) 0 else 8F.dip2px()
) {
dao.add(key)
GameDetailActivity.startGameDetailActivityToServer(
mContext, gameEntity,
StringUtils.buildString(
entrance, "+(搜索-列表[", key, "=", "$type=",
(holder.adapterPosition + 1).toString(), "])"
), exposureEvent
)
gameEntity.run {
NewLogUtils.logSearchTagClick(
SearchType.fromString(this@SearchGameIndexAdapter.type).toChinese(),
key,
id,
name ?: "",
"",
"开服表",
"",
""
)
}
}
tagContainer.addView(serverView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.isBbsExists) {
val serverView = getContentTagView(
R.drawable.ic_label_bbs,
@ -306,6 +274,39 @@ class SearchGameIndexAdapter(context: Context,
}
tagContainer.addView(serverView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.server) {
val serverView = getContentTagView(
R.drawable.ic_label_server,
"",
"开服表",
tagWidth,
if (tagContainer.childCount == 3) 0 else 8F.dip2px()
) {
dao.add(key)
GameDetailActivity.startGameDetailActivityToServer(
mContext, gameEntity,
StringUtils.buildString(
entrance, "+(搜索-列表[", key, "=", "$type=",
(holder.adapterPosition + 1).toString(), "])"
), exposureEvent
)
gameEntity.run {
NewLogUtils.logSearchTagClick(
SearchType.fromString(this@SearchGameIndexAdapter.type).toChinese(),
key,
id,
name ?: "",
"",
"开服表",
"",
""
)
}
}
tagContainer.addView(serverView)
}
}
}
@ -447,7 +448,7 @@ class SearchGameIndexAdapter(context: Context,
clickListener: () -> Unit
): View {
return LayoutSearchGameContentTagBinding.inflate(mLayoutInflater).apply {
root.layoutParams = ViewGroup.MarginLayoutParams(
root.layoutParams = LinearLayout.LayoutParams(
width,
28F.dip2px()
).apply { rightMargin = marginRight }

View File

@ -2,11 +2,9 @@ package com.gh.gamecenter.search
import android.content.Context
import android.util.SparseArray
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.collection.ArrayMap
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.constant.Constants
@ -309,38 +307,6 @@ class SearchGameResultAdapter(context: Context,
tagContainer.addView(libaoView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.server) {
val serverView = getContentTagView(
R.drawable.ic_label_server,
"",
"开服",
tagWidth,
if (tagContainer.childCount == 3) 0 else 8F.dip2px()
) {
GameDetailActivity.startGameDetailActivityToServer(
mContext, gameEntity,
StringUtils.buildString(
entrance, "+(搜索-列表[", key, "=", "$type=",
(holder.adapterPosition + 1).toString(), "])"
), exposureEvent
)
gameEntity.run {
NewLogUtils.logSearchTagClick(
SearchType.fromString(this@SearchGameResultAdapter.type).toChinese(),
key,
id,
name ?: "",
"",
"开服表",
"",
""
)
}
}
tagContainer.addView(serverView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.isBbsExists) {
val serverView = getContentTagView(
R.drawable.ic_label_bbs,
@ -372,6 +338,38 @@ class SearchGameResultAdapter(context: Context,
}
tagContainer.addView(serverView)
}
if (tagContainer.childCount < 4 && gameEntity.contentTag!!.server) {
val serverView = getContentTagView(
R.drawable.ic_label_server,
"",
"开服表",
tagWidth,
if (tagContainer.childCount == 3) 0 else 8F.dip2px()
) {
GameDetailActivity.startGameDetailActivityToServer(
mContext, gameEntity,
StringUtils.buildString(
entrance, "+(搜索-列表[", key, "=", "$type=",
(holder.adapterPosition + 1).toString(), "])"
), exposureEvent
)
gameEntity.run {
NewLogUtils.logSearchTagClick(
SearchType.fromString(this@SearchGameResultAdapter.type).toChinese(),
key,
id,
name ?: "",
"",
"开服表",
"",
""
)
}
}
tagContainer.addView(serverView)
}
} else {
bottomDivider.visibility = View.GONE
}
@ -459,7 +457,7 @@ class SearchGameResultAdapter(context: Context,
clickListener: () -> Unit
): View {
return LayoutSearchGameContentTagBinding.inflate(mLayoutInflater).apply {
root.layoutParams = ViewGroup.MarginLayoutParams(
root.layoutParams = LinearLayout.LayoutParams(
width,
28F.dip2px()
).apply { rightMargin = marginRight }