diff --git a/app/src/main/java/com/gh/common/util/DataLogUtils.java b/app/src/main/java/com/gh/common/util/DataLogUtils.java index 36139e0d19..725136b95f 100644 --- a/app/src/main/java/com/gh/common/util/DataLogUtils.java +++ b/app/src/main/java/com/gh/common/util/DataLogUtils.java @@ -27,13 +27,13 @@ import okhttp3.ResponseBody; public class DataLogUtils { // 轮播图 - public static void uploadLunbotuLog(Context context, String type, String title, String location) { + public static void uploadLunbotuLog(Context context, String type, String text, String index, String source) { Map map = new HashMap<>(); - map.put("location", location); + map.put("index", index); map.put("type", type); - map.put("title", title); - map.put("form", "click"); - uploadLog(context, "lunbotu", map); + map.put("text", text); + map.put("source", source); + uploadLog(context, "slide", map); } // 上传日志 diff --git a/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java index 108ef3552a..f3549e641e 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/ImagePagerAdapter.java @@ -81,12 +81,12 @@ public class ImagePagerAdapter extends RecyclingPagerAdapter { // 首页轮播图数据统计 DataLogUtils.uploadLunbotuLog(mContext, slideEntity.getType(), - slideEntity.getText(), String.valueOf(getPosition(position) % size + 1)); + slideEntity.getText(), String.valueOf(getPosition(position) % size + 1), mSource); - String entrance = StringUtils.buildString("(游戏-专题:滚动图[" + String entrance = StringUtils.buildString("(", mSource, "-轮播图[" , slideEntity.getText() , "=", slideEntity.getType() - , "=", String.valueOf(size + 1) + , "=", String.valueOf(getPosition(position) % size + 1) , "])"); DataUtils.onMtaEvent(mContext, "轮播图", mSource, String.valueOf(getPosition(position) % size + 1)); diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt index b6f1b41522..d1fb105c7c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/edit/QuestionEditViewModel.kt @@ -333,10 +333,12 @@ class QuestionEditViewModel(application: Application) : AndroidViewModel(applica val body = RequestBody.create(MediaType.parse("application/json"), GsonUtils.toJson(entity)) mApiService.patchQuestions(body, questionEntity?.id) // patch } else { - val postContent = GsonUtils.toJson(entity) - if (isForce) { // 标题重复提示后强制提交 - val bodyJson = JSONObject(postContent) + val postContent = if (isForce) { // 标题重复提示后强制提交 + val bodyJson = JSONObject(GsonUtils.toJson(entity)) bodyJson.put("again", true) + bodyJson.toString() + } else { + GsonUtils.toJson(entity) } val body = RequestBody.create(MediaType.parse("application/json"), postContent) mApiService.postQuestions(body, communityId) // add diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchNormalItemViewHolder.java b/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchNormalItemViewHolder.java index 70557d40eb..4de216ea1a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchNormalItemViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/qa/search/AskSearchNormalItemViewHolder.java @@ -26,8 +26,6 @@ public class AskSearchNormalItemViewHolder extends BaseRecyclerViewHolder(context: Context, id, UserManager.getInstance().community, mEntrance, mPath)) postSearchLogAndSearchHistory() } + private fun postSearchLogAndSearchHistory() { if (mContext is AskSearchActivity) { (mContext as AskSearchActivity).postLog(false) diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt index b60b195caa..8214d5c981 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/hottest/HottestAdapter.kt @@ -1,21 +1,29 @@ package com.gh.gamecenter.qa.search.hottest import android.content.Context +import android.graphics.drawable.Drawable import androidx.recyclerview.widget.RecyclerView import android.text.Html import android.view.View import android.view.ViewGroup +import androidx.databinding.DataBindingUtil import com.gh.base.BaseRecyclerViewHolder import com.gh.common.constant.ItemViewType +import com.gh.common.util.DisplayUtils import com.gh.common.util.ImageUtils import com.gh.common.util.NumberUtils import com.gh.gamecenter.R import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.databinding.AskSearchQuestionItemBinding import com.gh.gamecenter.databinding.CommunitySearchColummItemBinding import com.gh.gamecenter.databinding.CommunitySearchSpecialColummItemBinding +import com.gh.gamecenter.qa.entity.Questions import com.gh.gamecenter.qa.entity.SearchHottestEntity import com.gh.gamecenter.qa.search.AskSearchNormalItemViewHolder +import com.gh.gamecenter.qa.search.AskSearchQuestionItemViewHolder import com.gh.gamecenter.qa.search.base.BaseAskSearchAdapter +import com.gh.gamecenter.qa.search.hottest.HottestAdapter.ResourceImageGetter.Companion.addHintIconToTitle +import com.halo.assistant.HaloApp class HottestAdapter(context: Context, entrance: String, @@ -42,13 +50,16 @@ class HottestAdapter(context: Context, "community_column" -> { COLUMN_TYPE } + "question" -> { + QUESTION_TYPE + } else -> { ANSWER_TYPE } } } - override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): androidx.recyclerview.widget.RecyclerView.ViewHolder { + override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { return when (viewType) { COLUMN_TYPE -> { val view = mLayoutInflater.inflate(R.layout.community_search_columm_item, parent, false) @@ -58,6 +69,10 @@ class HottestAdapter(context: Context, val view = mLayoutInflater.inflate(R.layout.community_search_special_columm_item, parent, false) SpecialColumnViewHolder(CommunitySearchSpecialColummItemBinding.bind(view)) } + QUESTION_TYPE -> { + val view = mLayoutInflater.inflate(R.layout.ask_search_question_item, parent, false) + return AskSearchQuestionItemViewHolder(AskSearchQuestionItemBinding.bind(view)) + } else -> { val view = mLayoutInflater.inflate(R.layout.ask_search_item, parent, false) AskSearchNormalItemViewHolder(view) @@ -65,65 +80,75 @@ class HottestAdapter(context: Context, } } - override fun onBindBodyViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) { + override fun onBindBodyViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + val entity = mEntityList[position] when (holder) { is AskSearchNormalItemViewHolder -> { if (getItemViewType(position) == ARTICLE_TYPE) { - val entity = mEntityList[position] if (entity.images.isNotEmpty()) { holder.mImage.visibility = View.VISIBLE ImageUtils.display(holder.mImage, entity.images[0]) } else { holder.mImage.visibility = View.GONE } - holder.mTopIcon.visibility = if (entity.topSearchType == "community_article") { - View.VISIBLE + + val title = if (entity.topSearchType == "community_article") { + Html.fromHtml(addHintIconToTitle(ARTICLE_TYPE, replayKeyword(entity.title)), + ResourceImageGetter(), null) } else { - View.GONE + Html.fromHtml(replayKeyword(entity.title)) } + holder.mTitle.text = title + holder.mAnswerCount.visibility = View.GONE holder.mAnswerCount.text = mContext.getString(R.string.ask_answer_count, NumberUtils.transSimpleCount(entity.count.comment)) holder.mVoteCount.text = mContext.getString(R.string.ask_vote_count, NumberUtils.transSimpleCount(entity.count.vote)) - holder.mTitle.text = Html.fromHtml(replayKeyword(entity.title)) holder.mContent.text = Html.fromHtml(replayKeyword(entity.brief)) holder.itemView.setOnClickListener { skipArticleDetail(entity.id) } } else { - val searchEntity = mEntityList[position] - val question = searchEntity.question - if (searchEntity.images.isNotEmpty()) { + val question = entity.question + + if (entity.images.isNotEmpty()) { holder.mImage.visibility = View.VISIBLE - ImageUtils.display(holder.mImage, searchEntity.images[0]) + ImageUtils.display(holder.mImage, entity.images[0]) } else { holder.mImage.visibility = View.GONE } - holder.mTopIcon.visibility = if (searchEntity.topSearchType == "answer") { - View.VISIBLE + + val title = if (entity.topSearchType == "answer") { + Html.fromHtml(addHintIconToTitle(ANSWER_TYPE, replayKeyword(question.title)), + ResourceImageGetter(), null) } else { - View.GONE + Html.fromHtml(replayKeyword(question.title)) } + holder.mTitle.text = title + holder.mAnswerCount.visibility = View.GONE holder.mAnswerCount.text = mContext.getString(R.string.ask_answer_count, - NumberUtils.transSimpleCount(searchEntity.count.answer)) + NumberUtils.transSimpleCount(entity.count.answer)) holder.mVoteCount.text = mContext.getString(R.string.ask_vote_count, - NumberUtils.transSimpleCount(searchEntity.count.vote)) - holder.mTitle.text = Html.fromHtml(replayKeyword(question.title)) - holder.mContent.text = Html.fromHtml(replayKeyword(searchEntity.brief)) + NumberUtils.transSimpleCount(entity.count.vote)) + holder.mContent.text = Html.fromHtml(replayKeyword(entity.brief)) holder.mTitle.setOnClickListener { skipQuestionDetail(question) } - holder.itemView.setOnClickListener { skipAnswerDetail(searchEntity.id) } + holder.itemView.setOnClickListener { skipAnswerDetail(entity.id) } } } is ColumnViewHolder -> { - val entity = mEntityList[position] holder.binding.data = entity holder.itemView.setOnClickListener { skipColumn(entity.id) } } is SpecialColumnViewHolder -> { - val entity = mEntityList[position] holder.binding.data = entity holder.itemView.setOnClickListener { skipSpecialColumn(entity.id) } } + is AskSearchQuestionItemViewHolder -> { + holder.binding.questionHintIcon.visibility = View.VISIBLE + holder.binding.questionsTitle.text = Html.fromHtml(replayKeyword(entity.title)) + holder.binding.questionsAnswerCount.text = (NumberUtils.transSimpleCount(entity.count.answer) + " 回答") + holder.itemView.setOnClickListener { skipQuestionDetail(Questions(id = entity.id)) } + } } } @@ -132,9 +157,36 @@ class HottestAdapter(context: Context, const val SPECIAL_COLUMN_TYPE = 201 const val COLUMN_TYPE = 202 const val ARTICLE_TYPE = 203 + const val QUESTION_TYPE = 204 } class ColumnViewHolder(val binding: CommunitySearchColummItemBinding) : BaseRecyclerViewHolder(binding.root) class SpecialColumnViewHolder(val binding: CommunitySearchSpecialColummItemBinding) : BaseRecyclerViewHolder(binding.root) + + class ResourceImageGetter : Html.ImageGetter { + override fun getDrawable(source: String): Drawable { + val drawable = if (source.contains("answer")) { + HaloApp.getInstance().application.resources.getDrawable(R.drawable.search_answer_icon) + } else { + HaloApp.getInstance().application.resources.getDrawable(R.drawable.search_article_icon) + } + drawable.setBounds(0, 0, drawable.intrinsicWidth, drawable.intrinsicHeight) + return drawable + } + + companion object { + fun addHintIconToTitle(type: Int, title: String?): String { + return when { + ANSWER_TYPE == type -> { + "\u00A0\u00A0\u00A0$title" + } + ARTICLE_TYPE == type -> { + "\u00A0\u00A0\u00A0$title" + } + else -> throw IllegalStateException("$type not found") + } + } + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt index babff0526e..48423cf16c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/newest/NewestAdapter.kt @@ -30,12 +30,12 @@ class NewestAdapter(context: Context, } } - override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): androidx.recyclerview.widget.RecyclerView.ViewHolder { + override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val view = mLayoutInflater.inflate(R.layout.ask_search_item, parent, false) return AskSearchNormalItemViewHolder(view) } - override fun onBindBodyViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) { + override fun onBindBodyViewHolder(holder: RecyclerView.ViewHolder, position: Int) { if (getItemViewType(position) == HottestAdapter.ANSWER_TYPE) { holder as AskSearchNormalItemViewHolder val searchEntity = mEntityList[position] diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt index c17454ab55..bbfbd25297 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/question/QuestionAdapter.kt @@ -8,6 +8,7 @@ import android.view.ViewGroup import com.gh.common.util.NumberUtils import com.gh.gamecenter.R import com.gh.gamecenter.baselist.NormalListViewModel +import com.gh.gamecenter.databinding.AskSearchQuestionItemBinding import com.gh.gamecenter.qa.entity.Questions import com.gh.gamecenter.qa.search.AskSearchQuestionItemViewHolder import com.gh.gamecenter.qa.search.base.BaseAskSearchAdapter @@ -22,12 +23,12 @@ class QuestionAdapter(context: Context, return oldItem?.id == newItem?.id } - override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): androidx.recyclerview.widget.RecyclerView.ViewHolder { + override fun onCreateBodyViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { val view = mLayoutInflater.inflate(R.layout.ask_search_question_item, parent, false) - return AskSearchQuestionItemViewHolder(DataBindingUtil.bind(view)!!) + return AskSearchQuestionItemViewHolder(AskSearchQuestionItemBinding.bind(view)) } - override fun onBindBodyViewHolder(holder: androidx.recyclerview.widget.RecyclerView.ViewHolder, position: Int) { + override fun onBindBodyViewHolder(holder: RecyclerView.ViewHolder, position: Int) { if (holder is AskSearchQuestionItemViewHolder) { val entity = mEntityList[position] holder.binding.questionsTitle.text = Html.fromHtml(replayKeyword(entity.title)) diff --git a/app/src/main/res/drawable-xhdpi/ic_right_arrow.png b/app/src/main/res/drawable-xxhdpi/ic_right_arrow.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_right_arrow.png rename to app/src/main/res/drawable-xxhdpi/ic_right_arrow.png diff --git a/app/src/main/res/drawable-xhdpi/ic_right_arrow_darker.png b/app/src/main/res/drawable-xxhdpi/ic_right_arrow_darker.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_right_arrow_darker.png rename to app/src/main/res/drawable-xxhdpi/ic_right_arrow_darker.png diff --git a/app/src/main/res/drawable-xxhdpi/search_answer_icon.png b/app/src/main/res/drawable-xxhdpi/search_answer_icon.png new file mode 100644 index 0000000000..94b4941349 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/search_answer_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/search_article_icon.png b/app/src/main/res/drawable-xxhdpi/search_article_icon.png new file mode 100644 index 0000000000..903328557c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/search_article_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/search_column_icon.png b/app/src/main/res/drawable-xxhdpi/search_column_icon.png new file mode 100644 index 0000000000..2ca5d74231 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/search_column_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/search_question_icon.png b/app/src/main/res/drawable-xxhdpi/search_question_icon.png new file mode 100644 index 0000000000..f5f9d5b0a4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/search_question_icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi/search_special_column_icon.png b/app/src/main/res/drawable-xxhdpi/search_special_column_icon.png new file mode 100644 index 0000000000..46ecfa1019 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/search_special_column_icon.png differ diff --git a/app/src/main/res/layout/ask_search_item.xml b/app/src/main/res/layout/ask_search_item.xml index caaaa4dbfc..042d04a366 100644 --- a/app/src/main/res/layout/ask_search_item.xml +++ b/app/src/main/res/layout/ask_search_item.xml @@ -1,87 +1,78 @@ - + - - + android:id="@+id/ask_search_item_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:ellipsize="end" + android:maxLines="2" + android:textColor="@color/black" + android:textSize="16sp" + android:textStyle="bold" + android:includeFontPadding="false" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/ask_search_item_content_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="9dp" + app:layout_constraintTop_toBottomOf="@id/ask_search_item_title"> + android:id="@+id/ask_search_item_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginRight="5dp" + android:layout_toLeftOf="@+id/ask_search_item_image" + android:ellipsize="end" + android:lineSpacingMultiplier="1.2" + android:maxLines="3" + android:textColor="@color/title" + android:textSize="14sp" /> - + android:id="@+id/ask_search_item_image" + android:layout_width="90dp" + android:layout_height="60dp" + android:layout_alignParentRight="true" + android:visibility="visible" /> + + android:id="@+id/ask_search_item_votecount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="7dp" + android:textColor="@color/hint" + android:textSize="12sp" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/ask_search_item_content_container" + tools:text="235赞同" /> + android:id="@+id/ask_search_item_answercount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="12dp" + android:layout_marginTop="7dp" + android:textColor="@color/hint" + android:textSize="12sp" + app:layout_constraintLeft_toRightOf="@id/ask_search_item_votecount" + app:layout_constraintTop_toBottomOf="@id/ask_search_item_content_container" + tools:text="235回答" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/ask_search_question_item.xml b/app/src/main/res/layout/ask_search_question_item.xml index 65c4d19821..5fa232c8db 100644 --- a/app/src/main/res/layout/ask_search_question_item.xml +++ b/app/src/main/res/layout/ask_search_question_item.xml @@ -1,38 +1,51 @@ - + + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/white" + android:paddingLeft="20dp" + android:paddingTop="17dp" + android:paddingRight="20dp" + android:paddingBottom="18dp"> + + + android:id="@+id/questions_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:includeFontPadding="false" + android:maxLines="2" + android:textColor="@color/black" + android:textSize="14sp" + android:textStyle="bold" + app:layout_constraintBottom_toTopOf="@id/questions_answer_count" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/question_hint_icon" /> + android:id="@+id/questions_answer_count" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="24dp" + android:includeFontPadding="false" + android:textColor="@color/button_gray" + android:textSize="11dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toBottomOf="@id/questions_title" /> - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/community_search_columm_item.xml b/app/src/main/res/layout/community_search_columm_item.xml index 6fa283fe4b..2f85d4c5bc 100644 --- a/app/src/main/res/layout/community_search_columm_item.xml +++ b/app/src/main/res/layout/community_search_columm_item.xml @@ -1,92 +1,89 @@ - + - + + name="data" + type="com.gh.gamecenter.qa.entity.SearchHottestEntity" /> - + - + + android:id="@+id/column_name" + android:layout_width="wrap_content" + android:layout_height="45dp" + android:drawableLeft="@drawable/search_column_icon" + android:drawablePadding="6dp" + android:gravity="center_vertical" + android:text="专题" + android:textColor="@color/text_3a3a3a" + android:textSize="14sp" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - - + android:id="@+id/column_skip" + android:layout_width="wrap_content" + android:layout_height="45dp" + android:drawableRight="@drawable/ic_right_arrow_darker" + android:gravity="center_vertical" + android:text="查看 " + android:textColor="@color/text_b3b3b3" + android:textSize="12sp" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/column_image" + style="@style/frescoStyle" + imageUrl="@{data.icon}" + android:layout_width="90dp" + android:layout_height="60dp" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/column_name" /> + android:id="@+id/column_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginRight="12dp" + android:singleLine="true" + android:text="@{data.title}" + android:textColor="@color/tag_orange" + android:textSize="15sp" + app:layout_constraintBottom_toTopOf="@+id/column_desc" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@id/column_image" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="@id/column_image" + tools:text="我是大哥大哈哈哈哈哈哈哈哈哈哈哈哈和哈哈哈哈和" /> - - \ No newline at end of file + android:id="@+id/column_desc" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="6dp" + android:ellipsize="end" + android:maxLines="2" + android:paddingBottom="3dp" + android:text="@{data.description}" + android:textColor="@color/text_3a3a3a" + android:textSize="12sp" + app:layout_constraintBottom_toBottomOf="@id/column_image" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="@id/column_title" + app:layout_constraintTop_toBottomOf="@id/column_title" + tools:text="我是大哥大哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/community_search_special_columm_item.xml b/app/src/main/res/layout/community_search_special_columm_item.xml index 5e881c079e..0fb4bc102b 100644 --- a/app/src/main/res/layout/community_search_special_columm_item.xml +++ b/app/src/main/res/layout/community_search_special_columm_item.xml @@ -1,90 +1,89 @@ - + - + + name="data" + type="com.gh.gamecenter.qa.entity.SearchHottestEntity" /> - + - + + android:id="@+id/special_column_name" + android:layout_width="wrap_content" + android:layout_height="45dp" + android:drawableLeft="@drawable/search_special_column_icon" + android:drawablePadding="6dp" + android:gravity="center_vertical" + android:text="专栏" + android:textColor="@color/text_3a3a3a" + android:textSize="14sp" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + android:id="@+id/special_column_skip" + android:layout_width="wrap_content" + android:layout_height="45dp" + android:drawableRight="@drawable/ic_right_arrow_darker" + android:gravity="center_vertical" + android:text="查看 " + android:textColor="@color/text_b3b3b3" + android:textSize="12sp" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + android:id="@+id/special_column_image" + style="@style/frescoStyle" + imageUrl="@{data.icon}" + android:layout_width="60dp" + android:layout_height="60dp" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/special_column_name" /> + android:id="@+id/special_column_title" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginLeft="12dp" + android:singleLine="true" + android:text="@{data.name}" + android:textColor="@color/tag_orange" + android:textSize="15sp" + app:layout_constraintBottom_toTopOf="@+id/special_column_desc" + app:layout_constraintLeft_toRightOf="@id/special_column_image" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="@id/special_column_image" + tools:text="我是大哥大哈哈哈哈哈哈哈哈哈哈哈哈和哈哈哈哈和" /> - - + android:id="@+id/special_column_desc" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="6dp" + android:ellipsize="end" + android:maxLines="2" + android:paddingBottom="3dp" + android:text="@{data.description}" + android:textColor="@color/text_3a3a3a" + android:textSize="12sp" + app:layout_constraintBottom_toBottomOf="@id/special_column_image" + app:layout_constraintLeft_toLeftOf="@id/special_column_title" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toBottomOf="@id/special_column_title" + tools:text="我是大哥大哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈" /> + +