Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -206,11 +206,12 @@ object DirectUtils {
|
||||
|
||||
"libao" -> directToGiftDetail(context, linkEntity.link ?: "", entrance)
|
||||
|
||||
"feedback" -> directToFeedback(context, "", entrance)
|
||||
"feedback" -> directToFeedback(context, linkEntity.name, linkEntity.text, entrance)
|
||||
|
||||
"qa" -> directToQa(context, linkEntity.text ?: "", linkEntity.link ?: "")
|
||||
|
||||
"qa_collection" -> directToQaCollection(context, linkEntity.text ?: "", linkEntity.link ?: "")
|
||||
"qa_collection" -> directToQaCollection(context, linkEntity.text ?: "", linkEntity.link
|
||||
?: "")
|
||||
|
||||
"anliwall" -> directToAmway(context, fixedTopAmwayCommentId = null, entrance = entrance, path = path)
|
||||
|
||||
@ -342,12 +343,21 @@ object DirectUtils {
|
||||
// 反馈
|
||||
@JvmStatic
|
||||
fun directToFeedback(context: Context, content: String? = null, entrance: String? = null) {
|
||||
directToFeedback(context, content, null, entrance)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToFeedback(context: Context, content: String? = null, hintType: String? = null, entrance: String? = null) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
|
||||
bundle.putString(KEY_CONTENT, content)
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
|
||||
bundle.putSerializable(EntranceUtils.KEY_SUGGESTTYPE, SuggestType.gameQuestion)
|
||||
if (TextUtils.isEmpty(hintType)) {
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
|
||||
} else {
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType)
|
||||
}
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
|
||||
@ -331,6 +331,12 @@ class GameDetailViewModel(application: Application,
|
||||
override fun onResponse(response: List<BigEvent>?) {
|
||||
super.onResponse(response)
|
||||
response?.let {
|
||||
for (event in it) {
|
||||
if (event.link?.type == "feedback") {
|
||||
event.link?.name = game?.name
|
||||
event.link?.text = game?.getGameCategory().toString()
|
||||
}
|
||||
}
|
||||
bigEventLiveData.postValue(it)
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,10 @@ import com.gh.gamecenter.entity.*
|
||||
import com.gh.gamecenter.eventbus.EBReuse
|
||||
import com.gh.gamecenter.game.horizontal.GameHorizontalAdapter
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.gamedetail.entity.*
|
||||
import com.gh.gamecenter.gamedetail.entity.CustomColumn
|
||||
import com.gh.gamecenter.gamedetail.entity.DetailEntity
|
||||
import com.gh.gamecenter.gamedetail.entity.NewGameDetailEntity
|
||||
import com.gh.gamecenter.gamedetail.entity.UpdateContent
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
|
||||
import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity
|
||||
import com.gh.gamecenter.home.amway.LeftPagerSnapHelper
|
||||
@ -157,7 +160,7 @@ class DescAdapter(context: Context,
|
||||
|
||||
is GameLatestServiceViewHolder -> bindLatestServiceViewHolder(holder, descItemList[position].server)
|
||||
|
||||
is GameDetailInfoViewHolder -> bindGameDetailInfoViewHolder(holder, descItemList[position].info)
|
||||
is GameDetailInfoViewHolder -> bindGameDetailInfoViewHolder(holder, descItemList[position])
|
||||
|
||||
is GameLibaoGalleryViewHolder -> bindLibaoViewHolder(holder, descItemList[position].libao)
|
||||
|
||||
@ -501,7 +504,9 @@ class DescAdapter(context: Context,
|
||||
}
|
||||
|
||||
//绑定游戏信息
|
||||
private fun bindGameDetailInfoViewHolder(viewHolder: GameDetailInfoViewHolder, info: GameInfo?) {
|
||||
private fun bindGameDetailInfoViewHolder(viewHolder: GameDetailInfoViewHolder, itemData: DetailEntity) {
|
||||
val info = itemData.info
|
||||
|
||||
if (!info!!.topTags.isNullOrEmpty()) {
|
||||
viewHolder.binding.labelsLl.visibility = View.VISIBLE
|
||||
viewHolder.binding.labelsLl.removeAllViews()
|
||||
@ -511,6 +516,8 @@ class DescAdapter(context: Context,
|
||||
}
|
||||
}
|
||||
viewHolder.binding.gameInfoRv.isNestedScrollingEnabled = false
|
||||
viewHolder.binding.shouldBoundToNextItem = itemData.shouldBoundTogetherWithNextItem
|
||||
updateBoundableContainerBackground(viewHolder.binding.container, false, itemData.shouldBoundTogetherWithNextItem)
|
||||
if (viewHolder.binding.gameInfoRv.adapter == null) {
|
||||
viewHolder.binding.gameInfoRv.apply {
|
||||
val infoAdapter = GameDetailInfoItemAdapter(mContext, info, mViewModel, gameName
|
||||
@ -606,6 +613,8 @@ class DescAdapter(context: Context,
|
||||
if (customColumn.nameLink?.type == "top_game_comment"
|
||||
|| customColumn.nameLink?.type == "server"
|
||||
|| customColumn.nameLink?.type == "feedback") {
|
||||
customColumn.nameLink?.name = gameName
|
||||
customColumn.nameLink?.text = mViewModel.game?.category.toString()
|
||||
DirectUtils.directToLinkPage(mContext, customColumn.nameLink!!, StringUtils.buildString(mEntrance, "游戏详情[", gameName, "]:自定义栏目"), "")
|
||||
} else if (!customColumn.nameLink?.link.isNullOrEmpty()) {
|
||||
DirectUtils.directToLinkPage(mContext, customColumn.nameLink!!, StringUtils.buildString(mEntrance, "游戏详情[", gameName, "]:自定义栏目"), "")
|
||||
|
||||
@ -199,14 +199,14 @@ class DescViewModel(application: Application,
|
||||
// 装饰列表数据
|
||||
fun decorateList(detailEntityList: ArrayList<DetailEntity>): ArrayList<DetailEntity> {
|
||||
|
||||
// A 把低权重的自定义栏目转化为新的低权重自定义栏目 item
|
||||
for (rawItem in detailEntityList) {
|
||||
if (rawItem.type == DetailEntity.Type.CUSTOM_COLUMN.value) {
|
||||
if (rawItem.customColumn?.order ?: -1 <= 0) {
|
||||
rawItem.type = DetailEntity.Type.INFERIOR_CUSTOM_COLUMN.value
|
||||
}
|
||||
}
|
||||
}
|
||||
// // A 把低权重的自定义栏目转化为新的低权重自定义栏目 item // DEPRECATED
|
||||
// for (rawItem in detailEntityList) {
|
||||
// if (rawItem.type == DetailEntity.Type.CUSTOM_COLUMN.value) {
|
||||
// if (rawItem.customColumn?.order ?: -1 <= 0) {
|
||||
// rawItem.type = DetailEntity.Type.INFERIOR_CUSTOM_COLUMN.value
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// B 将游戏介绍转为简单的自定义栏目
|
||||
for (rawItem in detailEntityList) {
|
||||
@ -222,11 +222,15 @@ class DescViewModel(application: Application,
|
||||
}
|
||||
}
|
||||
|
||||
// C 标记"公告"、"自定义栏目"的UI样式是否合并在一起
|
||||
// C 标记"公告"、"自定义栏目"、"详细信息" 的UI样式是否合并在一起
|
||||
for ((index, rawItem) in detailEntityList.withIndex()) {
|
||||
if (rawItem.type == DetailEntity.Type.NOTICE.value || rawItem.type == DetailEntity.Type.CUSTOM_COLUMN.value) {
|
||||
if (rawItem.type == DetailEntity.Type.NOTICE.value
|
||||
|| rawItem.type == DetailEntity.Type.CUSTOM_COLUMN.value
|
||||
|| rawItem.type == DetailEntity.Type.GAME_INFO.value) {
|
||||
if (index + 1 != detailEntityList.size
|
||||
&& (detailEntityList[index + 1].type == DetailEntity.Type.CUSTOM_COLUMN.value || detailEntityList[index + 1].type == DetailEntity.Type.NOTICE.value)) {
|
||||
&& (detailEntityList[index + 1].type == DetailEntity.Type.CUSTOM_COLUMN.value
|
||||
|| detailEntityList[index + 1].type == DetailEntity.Type.NOTICE.value
|
||||
|| rawItem.type == DetailEntity.Type.GAME_INFO.value)) {
|
||||
rawItem.shouldBoundTogetherWithNextItem = true
|
||||
detailEntityList[index + 1].shouldBoundTogetherWithPreviousItem = true
|
||||
}
|
||||
|
||||
@ -12,7 +12,9 @@ import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.MtaHelper
|
||||
import com.gh.common.util.TimeUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.ItemGameDetailBigEventBinding
|
||||
import com.gh.gamecenter.gamedetail.entity.BigEvent
|
||||
|
||||
Reference in New Issue
Block a user