From 0b40894cdae46b9453167ce5151cf0dda3e9cf72 Mon Sep 17 00:00:00 2001 From: lyr <15622190878@163.com> Date: Mon, 13 Dec 2021 20:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=85=89=E7=8E=AF=E5=8A=A9=E6=89=8BV5?= =?UTF-8?q?.5.0=E3=80=91=E5=89=8D=E7=AB=AF=E4=BC=98=E5=8C=96=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E7=AC=AC=E4=B8=80=E5=91=A8=EF=BC=881213=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=201-3=EF=BC=89https://git.shanqu.cc/pm/halo-app-issue?= =?UTF-8?q?s/-/issues/1617#note=5F127947?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/SearchGameIndexAdapter.kt | 69 ++++++++++--------- .../search/SearchGameResultAdapter.kt | 68 +++++++++--------- 2 files changed, 68 insertions(+), 69 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt index 703e9bc9c6..9c8755e5ef 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameIndexAdapter.kt @@ -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 } diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt index f6bbb6d0d6..cdc0aecaee 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt @@ -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 }