feat:【光环助手】国际服游戏合规调整方案(需求变动) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2047#note_169012
This commit is contained in:
@ -12,7 +12,7 @@ data class RegionSetting(
|
||||
@SerializedName("channel_control")
|
||||
var channelControl: ChannelControl,
|
||||
@SerializedName("game_special_download")
|
||||
var gameSpecialDownload: List<GameSpecialDownload>
|
||||
var gameSpecialDownloadInfoList: List<GameSpecialDownloadInfo>
|
||||
) {
|
||||
|
||||
@Keep
|
||||
@ -24,12 +24,14 @@ data class RegionSetting(
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GameSpecialDownload(
|
||||
data class GameSpecialDownloadInfo(
|
||||
@SerializedName("game_id")
|
||||
var gameId: String,
|
||||
var gameId: String = "",
|
||||
@SerializedName("bbs_id")
|
||||
var bbsId: String,
|
||||
var bbsId: String = "",
|
||||
@SerializedName("top_id")
|
||||
var topId: String
|
||||
var topId: String = "",
|
||||
@SerializedName("hint_text")
|
||||
var hintText: String = ""
|
||||
)
|
||||
}
|
||||
@ -19,7 +19,7 @@ object RegionSettingHelper {
|
||||
private var mChannelControl: RegionSetting.ChannelControl? = null
|
||||
private var mFilterGameIdSet: HashSet<String>? = hashSetOf()
|
||||
private var mDisplayMirrorIfoGameIdSet: HashSet<String>? = hashSetOf()
|
||||
private var mGameSpecialDownloadList: List<RegionSetting.GameSpecialDownload>? = listOf()
|
||||
private var mGameSpecialDownloadInfoList: List<RegionSetting.GameSpecialDownloadInfo>? = listOf()
|
||||
|
||||
private const val SP_SETTING = "region_setting"
|
||||
|
||||
@ -32,13 +32,10 @@ object RegionSettingHelper {
|
||||
return mFilterGameIdSet?.contains(gameId) ?: false
|
||||
}
|
||||
|
||||
fun shouldThisGameShowSpecialDownload(gameId: String) = mGameSpecialDownloadList?.any { it.gameId == gameId } ?: false
|
||||
fun shouldThisGameShowSpecialDownload(gameId: String) = mGameSpecialDownloadInfoList?.any { it.gameId == gameId } ?: false
|
||||
|
||||
@JvmStatic
|
||||
fun getGameSpecialDownloadBbsId(gameId: String) = mGameSpecialDownloadList?.find { it.gameId == gameId }?.bbsId ?: ""
|
||||
|
||||
@JvmStatic
|
||||
fun getGameSpecialDownloadTopId(gameId: String) = mGameSpecialDownloadList?.find { it.gameId == gameId }?.topId ?: ""
|
||||
fun getGameSpecialDownloadInfo(gameId: String) = mGameSpecialDownloadInfoList?.find { it.gameId == gameId }
|
||||
|
||||
@JvmStatic
|
||||
fun filterGame(list: List<GameEntity>?): ArrayList<GameEntity> {
|
||||
@ -95,7 +92,7 @@ object RegionSettingHelper {
|
||||
mFilterGameIdSet = data.filterGameIdSet
|
||||
mDisplayMirrorIfoGameIdSet = data.mirrorGameIdSet
|
||||
mChannelControl = data.channelControl
|
||||
mGameSpecialDownloadList = data.gameSpecialDownload
|
||||
mGameSpecialDownloadInfoList = data.gameSpecialDownloadInfoList
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -49,7 +49,7 @@ public class DetailDownloadUtils {
|
||||
}
|
||||
|
||||
if (viewHolder.gameEntity.isSpecialDownload()) {
|
||||
viewHolder.mDownloadPb.setText("前往论坛讨论");
|
||||
viewHolder.mDownloadPb.setText("查看下载资源");
|
||||
viewHolder.mDownloadPb.setDownloadType(DownloadProgressBar.DownloadType.SPECIAL_DOWNLOAD);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -548,16 +548,29 @@ object DownloadItemUtils {
|
||||
return
|
||||
}
|
||||
if (gameEntity.isSpecialDownload()) {
|
||||
val bbsId = RegionSettingHelper.getGameSpecialDownloadBbsId(gameEntity.id)
|
||||
val topId = RegionSettingHelper.getGameSpecialDownloadTopId(gameEntity.id)
|
||||
val info = RegionSettingHelper.getGameSpecialDownloadInfo(gameEntity.id) ?: return
|
||||
downloadBtn.setOnClickListener {
|
||||
if (bbsId.isNotBlank()) {
|
||||
if (topId.isNotBlank()) {
|
||||
val data = hashMapOf(EntranceConsts.KEY_TOP_ID to topId)
|
||||
PageSwitchDataHelper.pushCurrentPageData(data)
|
||||
}
|
||||
DirectUtils.directForumDetail(context, bbsId, entrance)
|
||||
}
|
||||
DialogHelper.showDialog(
|
||||
context,
|
||||
"提示",
|
||||
info.hintText,
|
||||
"前往论坛",
|
||||
"",
|
||||
{
|
||||
if (info.bbsId.isNotBlank()) {
|
||||
if (info.topId.isNotBlank()) {
|
||||
val data = hashMapOf(EntranceConsts.KEY_TOP_ID to info.topId)
|
||||
PageSwitchDataHelper.pushCurrentPageData(data)
|
||||
}
|
||||
DirectUtils.directForumDetail(context, info.bbsId, entrance)
|
||||
}
|
||||
},
|
||||
{},
|
||||
DialogHelper.Config(
|
||||
centerTitle = true,
|
||||
centerContent = true
|
||||
)
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.gh.common.filter.RegionSetting;
|
||||
import com.gh.common.filter.RegionSettingHelper;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
@ -357,15 +358,16 @@ public class DetailViewHolder {
|
||||
);
|
||||
break;
|
||||
case SPECIAL_DOWNLOAD:
|
||||
String bbsId = RegionSettingHelper.getGameSpecialDownloadBbsId(mGameEntity.getId());
|
||||
String topId = RegionSettingHelper.getGameSpecialDownloadTopId(mGameEntity.getId());
|
||||
if (!TextUtils.isEmpty(bbsId)) {
|
||||
if (!TextUtils.isEmpty(topId)) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put(EntranceConsts.KEY_TOP_ID, topId);
|
||||
PageSwitchDataHelper.pushCurrentPageData(map);
|
||||
RegionSetting.GameSpecialDownloadInfo info = RegionSettingHelper.getGameSpecialDownloadInfo(mGameEntity.getId());
|
||||
if (info != null) {
|
||||
if (!TextUtils.isEmpty(info.getBbsId())) {
|
||||
if (!TextUtils.isEmpty(info.getTopId())) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put(EntranceConsts.KEY_TOP_ID, info.getTopId());
|
||||
PageSwitchDataHelper.pushCurrentPageData(map);
|
||||
}
|
||||
DirectUtils.directForumDetail(mViewHolder.context, info.getBbsId(), mEntrance);
|
||||
}
|
||||
DirectUtils.directForumDetail(mViewHolder.context, bbsId, mEntrance);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user