From 5c10eb7c9cc265372c3f87788add93d9e0d027d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=99=A8?= Date: Tue, 12 Mar 2024 09:52:40 +0800 Subject: [PATCH] fix:GHZS-4857,GHZS-4720,GHZS-4856,GHZS-4890,GHZS-4892,GHZS-4891 https://jira.shanqu.cc/browse/GHZS-3956 --- .../com/gh/common/util/DownloadItemUtils.kt | 8 ++- .../home/custom/CustomPageFragment.kt | 46 ++++++++-------- .../home/custom/CustomPageViewModel.kt | 36 ++++++------- .../CustomFoldSlideLargeImageItemAdapter.kt | 2 +- .../adapter/CustomGameVerticalAdapter.kt | 41 ++++---------- .../custom/adapter/CustomIconMatrixAdapter.kt | 11 +--- .../home/custom/adapter/CustomViewExt.kt | 53 +++++++++++++++++++ .../home/custom/model/CustomPageRepository.kt | 1 + .../CustomGameHorizontalItemViewHolder.kt | 9 ++-- .../viewholder/CustomGameItemViewHolder.kt | 26 ++------- .../CustomHomeGameItemViewHolder.kt | 4 +- .../gamecenter/libao/LibaoDetailFragment.java | 2 +- app/src/main/res/layout/fragment_custom.xml | 6 +++ .../layout/game_horizontal_item_custom.xml | 6 +-- app/src/main/res/layout/game_item_custom.xml | 8 ++- .../recycler_child_icon_matrix_custom.xml | 7 +-- app/src/main/res/values/styles.xml | 10 ++++ 17 files changed, 141 insertions(+), 135 deletions(-) create mode 100644 app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomViewExt.kt diff --git a/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt b/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt index 9a4bad2931..c9a3a8aa83 100644 --- a/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt +++ b/app/src/main/java/com/gh/common/util/DownloadItemUtils.kt @@ -777,8 +777,8 @@ object DownloadItemUtils { return } if (gameEntity.isReservable) { - if (!ReservationRepository.thisGameHasBeenReserved(gameEntity.id)) { - downloadBtn.setOnClickListener { + downloadBtn.setOnClickListener { + if (!ReservationRepository.thisGameHasBeenReserved(gameEntity.id)) { SensorsBridge.trackEvent( "AppointmentGame", "game_name", @@ -803,9 +803,7 @@ object DownloadItemUtils { refreshCallback?.onCallback() } } - } - } else { - downloadBtn.setOnClickListener { + } else { allStateClickCallback?.onCallback() clickCallback?.onCallback() if ("download" == gameEntity.reserveStatus) { diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageFragment.kt b/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageFragment.kt index a33286d8a3..08ed040e9c 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageFragment.kt @@ -89,9 +89,6 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable { private var bottomTabName = "" private var tabIndex = -1 - // 是否是下拉刷新 - private var isPullToRefreshing = false - private lateinit var pageLocation: PageLocation private var pullDownPushHandler: PullDownPushHandler? = null @@ -188,32 +185,36 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable { adapter.submitList(it) } - loadStatus.observe(viewLifecycleOwner) { + loadStatus.observe(viewLifecycleOwner) { (status, isPullToRefresh) -> binding.gameRefresh.isRefreshing = false - binding.gameRefresh.goneIf(it == LoadStatus.INIT_FAILED) - binding.gameList.goneIf(!isPullToRefreshing && it == LoadStatus.INIT_LOADING) - binding.reuseNoConnection.root.goneIf(it != LoadStatus.INIT_FAILED) - // 下拉刷新时,不需要显示loading - if (isPullToRefreshing || it != LoadStatus.INIT_LOADING) { - binding.reuseLoading.root.goneIf(true) - binding.root.setBackgroundColor(Color.TRANSPARENT) + if (!isPullToRefresh) { + binding.gameList.goneIf(status == LoadStatus.INIT_LOADING || status == LoadStatus.INIT_FAILED || status == LoadStatus.INIT_EMPTY) + binding.reuseNoConnection.root.goneIf(status != LoadStatus.INIT_FAILED) + if (status == LoadStatus.INIT_LOADING) { + binding.reuseLoading.root.goneIf(false) + binding.root.setBackgroundColor(R.color.ui_surface.toColor(requireContext())) + } else { + binding.reuseLoading.root.goneIf(true) + binding.root.setBackgroundColor(Color.TRANSPARENT) + } + binding.reuseNoData.root.goneIf(status != LoadStatus.INIT_EMPTY) } else { - binding.reuseLoading.root.goneIf(false) - binding.root.setBackgroundColor(R.color.ui_surface.toColor(requireContext())) + if (status == LoadStatus.INIT_LOADED) { + binding.gameList.visibleIf(true) + binding.reuseNoConnection.root.goneIf(true) + binding.reuseNoData.root.goneIf(true) + } } - - adapter.setLoadStatus(it) - if (it == LoadStatus.INIT_LOADED) { + adapter.setLoadStatus(status) + if (status == LoadStatus.INIT_LOADED) { AppExecutor.uiExecutor.executeWithDelay({ scroll() scrollCalculatorHelper.onScrollStateChanged(RecyclerView.SCROLL_STATE_IDLE) }, 100) - (parentFragment as? ISmartRefresh)?.finishRefresh() } - - if (it == LoadStatus.INIT_LOADING) { - isPullToRefreshing = false + if (status != LoadStatus.INIT_LOADING) { + (parentFragment as? ISmartRefresh)?.finishRefresh() } } @@ -490,7 +491,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable { binding.gameList.addOnScrollListener(exposureListener) binding.reuseNoConnection.connectionReloadTv.setOnClickListener { - viewModel.loadFirst() + viewModel.loadFirst(false) } binding.gameRefresh.setOnRefreshListener { @@ -683,9 +684,8 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable { } override fun onRefresh() { - isPullToRefreshing = true viewModel.onRefresh() - viewModel.loadFirst(true) + viewModel.loadFirst(true, true) } override fun setSwipeRefreshEnabled(isSwipeRefreshEnabled: Boolean) { diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageViewModel.kt b/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageViewModel.kt index 2941103a42..38967b61bb 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/CustomPageViewModel.kt @@ -70,10 +70,8 @@ class CustomPageViewModel( private val _dataList = MutableLiveData>() val dataList: LiveData> = _dataList - private val _loadStatus = MutableLiveData() - val loadStatus: LiveData = _loadStatus - - private var isLoading = false + private val _loadStatus = MutableLiveData>() + val loadStatus: LiveData> = _loadStatus var refreshCount = 0 @@ -118,7 +116,7 @@ class CustomPageViewModel( fun loadData() { - loadFirst() + loadFirst(false) loadSuspendedWindow() } @@ -148,8 +146,8 @@ class CustomPageViewModel( }).addDisposable() } - fun loadFirst(forceLoad: Boolean = false) { - _loadStatus.value = LoadStatus.INIT_LOADING + fun loadFirst(isPullToRefresh: Boolean, forceLoad: Boolean = false) { + _loadStatus.value = LoadStatus.INIT_LOADING to isPullToRefresh repository.loadFirstCustomPageData(pageConfigure.pageId, forceLoad) .map { (custom, list) -> Triple(custom, list, getPositionAndPackageMap(list)) @@ -179,9 +177,9 @@ class CustomPageViewModel( pageSwitchData.postValue(custom.pageSwitch) _dataList.value = list _loadStatus.value = if (list.isEmpty()) { - LoadStatus.INIT_EMPTY + LoadStatus.INIT_EMPTY to isPullToRefresh } else { - LoadStatus.INIT_LOADED + LoadStatus.INIT_LOADED to isPullToRefresh } if (custom.pageSwitch.suspendedWindow) { @@ -191,7 +189,8 @@ class CustomPageViewModel( override fun onFailure(exception: Exception) { super.onFailure(exception) - _loadStatus.value = LoadStatus.INIT_FAILED + _loadStatus.value = LoadStatus.INIT_FAILED to isPullToRefresh + } }).addDisposable() @@ -204,11 +203,11 @@ class CustomPageViewModel( } override fun onLoadMore() { - if (isLoading && loadStatus.value == LoadStatus.LIST_OVER) { + val status = loadStatus.value?.first ?: LoadStatus.INIT + if (status == LoadStatus.LIST_LOADING || status == LoadStatus.INIT_LOADING || status == LoadStatus.LIST_OVER) { return } - isLoading = true - _loadStatus.value = LoadStatus.LIST_LOADING + _loadStatus.value = LoadStatus.LIST_LOADING to false repository.loadNextCustomPageData(pageConfigure.pageId) .map { it to getPositionAndPackageMap(it) @@ -220,25 +219,24 @@ class CustomPageViewModel( override fun onSuccess(data: Pair, HashMap>) { val (list, gameWithPositionMap) = data gamePositionAndPackageHelper.putAll(gameWithPositionMap) - isLoading = false - addData(list) _loadStatus.value = if (list.isEmpty()) { - LoadStatus.LIST_OVER + LoadStatus.LIST_OVER to false } else { - LoadStatus.LIST_LOADED + LoadStatus.LIST_LOADED to false } + addData(list) } override fun onFailure(exception: Exception) { super.onFailure(exception) - isLoading = false + _loadStatus.value = LoadStatus.LIST_FAILED to false } }).addDisposable() } override fun onRetry() { - onLoadMore() + loadFirst(false) } override fun onRotateRefresh(customSubjectCollectionItem: CustomSubjectCollectionItem) { diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomFoldSlideLargeImageItemAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomFoldSlideLargeImageItemAdapter.kt index 1025b499d7..c4bd251f10 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomFoldSlideLargeImageItemAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomFoldSlideLargeImageItemAdapter.kt @@ -136,7 +136,7 @@ class CustomFoldSlideLargeImageItemAdapter( ) binding.tvBubble.text = game.bubbleText - binding.gStar.goneIf(!data.data.showStar) { + binding.gStar.goneIf(!(data.data.showStar && game.commentCount > 3)) { binding.tvStar.text = if (game.star == 10.0F) "10" else game.star.toString() } BindingAdapters.setGameTags(binding.llLabel, game) diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomGameVerticalAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomGameVerticalAdapter.kt index 619d7fe660..07332c46a7 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomGameVerticalAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomGameVerticalAdapter.kt @@ -2,8 +2,10 @@ package com.gh.gamecenter.home.custom.adapter import android.content.Context import android.graphics.drawable.Drawable +import android.os.Build import android.view.ViewGroup import android.view.ViewGroup.MarginLayoutParams +import androidx.core.content.ContextCompat import androidx.core.view.marginBottom import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.ViewHolder @@ -146,18 +148,16 @@ class CustomGameVerticalAdapter( BindingAdapters.setGameTags(gameTagContainer, gameEntity) GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity) - val brief = if (briefStyle.contains("recommend") && gameEntity.columnRecommend != null) { - gameEntity.columnRecommend?.text ?: "" + val styleResId = R.style.CustomPageGameRating + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + gameRatingTv.setTextAppearance(styleResId) } else { - val size = gameEntity.getApk().firstOrNull()?.size ?: "" - if (size.isBlank()) { - gameEntity.brief - } else { - "${size} ${gameEntity.brief}" - } + gameRatingTv.setTextAppearance(context, styleResId) } - - gameDesTv.text = brief + gameRatingTv.setPadding(0, 4f.dip2px(), 8f.dip2px(), 0) + gameRatingTv.setDrawableStart(R.drawable.game_horizontal_rating) + CustomViewExt.setGameRatting(gameRatingTv, briefStyle, gameEntity) + CustomViewExt.setDescription(gameDesTv, briefStyle, gameEntity) GameItemViewHolder.initGameSubtitleAndAdLabel( gameEntity, gameSubtitleTv, @@ -167,26 +167,6 @@ class CustomGameVerticalAdapter( adLabelTv ) - var gameRatingPaddingEnd = 0 - var gameRatingDrawableStart: Drawable? = null - var gameRatingTextColor = R.color.primary_theme.toColor(context) - var gameRatingText = "" - - gameRatingTv.textSize = if (gameEntity.commentCount > 3) 12F else 10F - - if (gameEntity.commentCount > 3) { - gameRatingPaddingEnd = 8F.dip2px() - gameRatingDrawableStart = R.drawable.game_horizontal_rating.toDrawable() - gameRatingTextColor = R.color.text_theme.toColor(context) - gameRatingText = - if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString() - } - - gameRatingTv.setDrawableStart(gameRatingDrawableStart) - gameRatingTv.setPadding(0, 4f.dip2px(), gameRatingPaddingEnd, 0) - gameRatingTv.setTextColor(gameRatingTextColor) - gameRatingTv.text = gameRatingText - // 没错,产品就把这个通用样式叫推荐榜单专题 downloadTv.putWidgetBusinessName("推荐榜单专题") @@ -203,7 +183,6 @@ class CustomGameVerticalAdapter( tempViewHolder.recommendTv = recommendTv tempViewHolder.recommendContainer = recommendConstraintLayout tempViewHolder.gameServerType = serverTypeTv - tempViewHolder.gameRating = gameRatingTv DownloadItemUtils.updateItem( context, diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomIconMatrixAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomIconMatrixAdapter.kt index f66da38877..443aa91efe 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomIconMatrixAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomIconMatrixAdapter.kt @@ -1,6 +1,7 @@ package com.gh.gamecenter.home.custom.adapter import android.content.Context +import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView.ViewHolder import com.gh.common.util.DownloadItemUtils @@ -72,15 +73,7 @@ class CustomIconMatrixAdapter( gameName.maxLines = if (subject.showDownload) 1 else 2 } - - holder.binding.gameRating.textSize = 12F - holder.binding.gameRating.goneIf(!subject.showStar) { - holder.binding.gameRating.setDrawableStart(if (item.commentCount > 3) R.drawable.game_horizontal_rating.toDrawable() else null) - holder.binding.gameRating.text = - if (item.commentCount > 3) (if (item.star == 10.0f) "10" else item.star.toString()) else "" - } - - + CustomViewExt.setGameRattingWithSubject(holder.binding.gameRating, subject.showStar, item) val entranceResult = StringUtils.buildString("(游戏-专题:", subject.name, "-列表[", (position + 1).toString(), "])") val locationResult = StringUtils.buildString("游戏-专题-", subject.name, ":", item.name) diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomViewExt.kt b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomViewExt.kt new file mode 100644 index 0000000000..0f62f9b3f4 --- /dev/null +++ b/app/src/main/java/com/gh/gamecenter/home/custom/adapter/CustomViewExt.kt @@ -0,0 +1,53 @@ +package com.gh.gamecenter.home.custom.adapter + +import android.widget.TextView +import com.gh.gamecenter.common.utils.goneIf +import com.gh.gamecenter.common.utils.visibleIf +import com.gh.gamecenter.feature.entity.GameEntity + +object CustomViewExt { + + fun setGameRatting(tvRatting: TextView, briefStyle: String, game: GameEntity) { + tvRatting.goneIf(!(game.commentCount > 3 && briefStyle == "star&brief")) { + tvRatting.text = if (game.star == 10.0f) { + "10" + } else { + "${game.star}" + } + } + } + + fun setGameRattingWithSubject(tvRatting: TextView, showStar: Boolean, game: GameEntity) { + if (showStar) { + tvRatting.visibleIf(game.commentCount > 3) { + tvRatting.text = if (game.star == 10.0f) { + "10" + } else { + "${game.star}" + } + } + } else { + tvRatting.goneIf(true) + } + } + + fun setDescription(tvDesc: TextView, briefStyle: String, game: GameEntity) { + fun getBriefWithSize(): String { + val size = game.getApk().firstOrNull()?.size ?: "" + return if (size.isNotBlank()) { + "$size ${game.brief ?: ""}" + } else { + game.brief ?: "" + } + } + + val brief = when (briefStyle) { + "size&brief" -> getBriefWithSize() + "star&brief" -> game.brief + "recommend" -> game.columnRecommend?.text ?: getBriefWithSize() + + else -> getBriefWithSize() + } + tvDesc.text = brief + } +} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/model/CustomPageRepository.kt b/app/src/main/java/com/gh/gamecenter/home/custom/model/CustomPageRepository.kt index acd4b1e18e..98298cf17d 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/model/CustomPageRepository.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/model/CustomPageRepository.kt @@ -332,6 +332,7 @@ class CustomPageRepository private constructor( COMPONENTS_COLLECTION_STYLE_REFRESH_ICONS_4_2 -> { val needGameCount = linkColumnCollection.styleSetting.rowsNum * 4 + println("kayn -->name:${linkColumnCollection.name} --size:${it.games.size}") it.games.size >= needGameCount } diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameHorizontalItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameHorizontalItemViewHolder.kt index 106d07b9e2..6063feaf99 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameHorizontalItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameHorizontalItemViewHolder.kt @@ -9,6 +9,7 @@ import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.GameHorizontalItemCustomBinding import com.gh.gamecenter.entity.SubjectEntity import com.gh.gamecenter.feature.entity.GameEntity +import com.gh.gamecenter.home.custom.adapter.CustomViewExt class CustomGameHorizontalItemViewHolder(val binding: GameHorizontalItemCustomBinding) : BaseRecyclerViewHolder(binding.root) { @@ -19,12 +20,8 @@ class CustomGameHorizontalItemViewHolder(val binding: GameHorizontalItemCustomBi isShowFirstLine: Boolean, isShowSecondLine: Boolean ) { - binding.gameRating.textSize = 12f - binding.gameRating.goneIf("star" != subjectEntity.typeStyle, visibleCallback = { - binding.gameRating.setDrawableStart(if (gameEntity.commentCount > 3) R.drawable.game_horizontal_rating.toDrawable() else null) - binding.gameRating.text = - if (gameEntity.commentCount > 3) (if (gameEntity.star == 10.0f) "10" else gameEntity.star.toString()) else "" - }) + CustomViewExt.setGameRattingWithSubject(binding.gameRating, subjectEntity.typeStyle == "star", gameEntity) + binding.firstRemark.text = gameEntity.assignRemark.firstLine binding.firstRemark.setTextColor( if (gameEntity.assignRemark.markedRed) Color.parseColor("#F10000") else R.color.text_primary.toColor( diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameItemViewHolder.kt index 4a10423c65..4f8e89f080 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomGameItemViewHolder.kt @@ -22,6 +22,7 @@ import com.gh.gamecenter.feature.entity.GameEntity import com.gh.gamecenter.feature.entity.PluginLocation import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider import com.gh.gamecenter.home.custom.CustomPageViewModel +import com.gh.gamecenter.home.custom.adapter.CustomViewExt import com.gh.gamecenter.home.custom.createExposureEvent import com.gh.gamecenter.home.custom.eventlistener.SubjectEventHelper import com.gh.gamecenter.home.custom.model.CustomPageItem @@ -79,27 +80,9 @@ class CustomGameItemViewHolder( .navigation() as? IBindingAdaptersProvider provider?.setGameName(gameName, entity, isShowPlatform) provider?.setGameTags(labelList, entity) - gameRating.textSize = if (entity.commentCount > 3) 12F else 10F - gameRating.setDrawableStart(if (entity.commentCount > 3) R.drawable.game_horizontal_rating.toDrawable() else null) - gameRating.setPadding(0, 0, if (entity.commentCount > 3) 8F.dip2px() else 0, 0) - gameRating.text = if (entity.commentCount > 3) { - if (entity.star == 10.0F) "10" else entity.star.toString() - } else "" - gameRating.setTextColor( - if (entity.commentCount > 3) R.color.text_theme.toColor(root.context) else R.color.primary_theme.toColor( - root.context - ) - ) - gameRating.visibleIf(subject.briefStyle.contains("star&brief")) { - gameRating.text = "${entity.star}" - } - val brief = when (subject.briefStyle) { - "size&brief" -> entity.getApk().firstOrNull()?.size + " " + entity.brief - "star&brief" -> entity.brief - else -> "专题推荐文案" - } - gameDes.text = brief + CustomViewExt.setGameRatting(gameRating, subject.briefStyle, entity) + CustomViewExt.setDescription(gameDes, subject.briefStyle, entity) recommendStar.rating = entity.recommendStar.toFloat() initCustomGameSubtitleAndAdLabel( entity, @@ -288,11 +271,10 @@ class CustomGameItemViewHolder( } } - class CustomGameViewHolder(private val binding: GameItemCustomBinding) : GameViewHolder(binding.root) { + class CustomGameViewHolder(binding: GameItemCustomBinding) : GameViewHolder(binding.root) { init { gameDownloadBtn = binding.downloadBtn gameDes = binding.gameDes - gameRating = binding.gameRating recommendContainer = binding.recommendContainer recommendIv = binding.recommendIv recommendTv = binding.recommendTv diff --git a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomHomeGameItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomHomeGameItemViewHolder.kt index eb8740115b..c9972b671a 100644 --- a/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomHomeGameItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/home/custom/viewholder/CustomHomeGameItemViewHolder.kt @@ -211,7 +211,7 @@ class CustomHomeGameItemViewHolder( ) binding.downloadBtn.putWidgetBusinessName("首页游戏大图样式") binding.downloadBtn.goneIf(game.homeSetting.downloadBtnSwitch != "on") - binding.gameRating.goneIf(!(game.star >= 7 && game.homeSetting.downloadBtnSwitch == "on")) - binding.gameRating2.goneIf(!(game.star >= 7 && game.homeSetting.downloadBtnSwitch != "on")) + binding.gameRating.goneIf(!(game.commentCount > 3 && game.star >= 7 && game.homeSetting.downloadBtnSwitch == "on")) + binding.gameRating2.goneIf(!(game.commentCount > 3 && game.star >= 7 && game.homeSetting.downloadBtnSwitch != "on")) } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoDetailFragment.java b/app/src/main/java/com/gh/gamecenter/libao/LibaoDetailFragment.java index 6a70982858..43e6cb6451 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoDetailFragment.java +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoDetailFragment.java @@ -376,7 +376,7 @@ public class LibaoDetailFragment extends ToolbarFragment implements LibaoDetailA if (mLibaoEntity.getGame() == null) return; String gameId = mLibaoEntity.getGame().getId(); if (RegionSettingHelper.shouldThisGameBeFiltered(gameId)) { - toast("网络异常,请稍后再试"); + loadNotFound(); return; } RetrofitManager.getInstance().getApi().getGameNewsDigest(gameId) diff --git a/app/src/main/res/layout/fragment_custom.xml b/app/src/main/res/layout/fragment_custom.xml index 48931b8614..b266a1ad10 100644 --- a/app/src/main/res/layout/fragment_custom.xml +++ b/app/src/main/res/layout/fragment_custom.xml @@ -43,6 +43,12 @@ android:layout_height="wrap_content" android:layout_centerInParent="true" /> + + 12sp center + + \ No newline at end of file