【光环助手V5.10.0】游戏单活动:游戏单征集计划vol.1(增加跳转创建游戏单加入重复游戏的判断)https://git.shanqu.cc/pm/halo-app-issues/-/issues/1779
This commit is contained in:
@ -43,6 +43,7 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
private var mPatchCommitCount = 0
|
||||
private var mActivityId = ""
|
||||
private var mActivityName = ""
|
||||
private var mGameEntity: GameEntity? = null
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.activity_game_collection_edit
|
||||
|
||||
@ -70,14 +71,17 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
val gameId = intent.getStringExtra(EntranceConsts.KEY_GAMEID) ?: ""
|
||||
if (gameId.isNotEmpty()) {
|
||||
mViewModel.getGameDigest(gameId) {
|
||||
mChooseGamesViewModel.chooseGamesLiveData.run {
|
||||
if (it != null) {
|
||||
val gamesList = ArrayList<GameEntity>()
|
||||
if (!value.isNullOrEmpty()) {
|
||||
gamesList.addAll(value!!)
|
||||
if (it != null) {
|
||||
val gamesList = ArrayList<GameEntity>()
|
||||
val simpleGames = mViewModel.gameCollectionPatch?.games?.map { game -> game.toGameEntity() }
|
||||
if (!simpleGames.isNullOrEmpty()) {
|
||||
simpleGames.map { gameEntity ->
|
||||
if (gameEntity.id == gameId) return@getGameDigest
|
||||
}
|
||||
postValue(gamesList.apply { add(it) })
|
||||
gamesList.addAll(simpleGames)
|
||||
}
|
||||
mGameEntity = it
|
||||
mChooseGamesViewModel.chooseGamesLiveData.postValue(gamesList.apply { add(it) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -248,7 +252,11 @@ class GameCollectionEditActivity : ToolBarActivity() {
|
||||
mViewModel.tags = tags ?: arrayListOf()
|
||||
initTagsUI(mViewModel.tags)
|
||||
val simpleGames = games?.map { game -> game.toGameEntity() }
|
||||
mChooseGamesViewModel.chooseGamesLiveData.postValue(ArrayList(simpleGames))
|
||||
mChooseGamesViewModel.chooseGamesLiveData.postValue(ArrayList(simpleGames).apply {
|
||||
if (mGameEntity != null) {
|
||||
add(mGameEntity)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!it.activityTags.isNullOrEmpty()) {
|
||||
if (mActivityId.isEmpty() && mActivityName.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user