解决crash
This commit is contained in:
parent
06fc43a454
commit
0d31395d7a
|
|
@ -92,8 +92,9 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
||||||
|
|
||||||
private fun initAddSubTaskViews() {
|
private fun initAddSubTaskViews() {
|
||||||
val taskStateHelper = TaskManager.instance().boxTaskStatus()
|
val taskStateHelper = TaskManager.instance().boxTaskStatus()
|
||||||
val currentBoxState = taskStateHelper.getStatusBean().tasks[taskStateHelper.getCurrentBoxIndex()]
|
var subTaskIndex = taskStateHelper.getCurrentBoxIndex()
|
||||||
|
if (subTaskIndex >= 0) {
|
||||||
|
val currentBoxState = taskStateHelper.getStatusBean().tasks[subTaskIndex]
|
||||||
currentBoxState.tasks.forEachIndexed { index, subTask ->
|
currentBoxState.tasks.forEachIndexed { index, subTask ->
|
||||||
val separateLine = View(this@BenefitActivity)
|
val separateLine = View(this@BenefitActivity)
|
||||||
separateLine.setBackgroundResource(R.color.gray_f2)
|
separateLine.setBackgroundResource(R.color.gray_f2)
|
||||||
|
|
@ -110,6 +111,8 @@ class BenefitActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun handleActionButClicked(taskType: Int) {
|
private fun handleActionButClicked(taskType: Int) {
|
||||||
when (taskType) {
|
when (taskType) {
|
||||||
BOX_SUB_TASK_TYPE_AD -> {
|
BOX_SUB_TASK_TYPE_AD -> {
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class HomeItemFragment : AppViewsEmptyViewModelFragment<ViewBinding>() {
|
||||||
AndroidUtil.openUrl(VidiConst.URL_GAME)
|
AndroidUtil.openUrl(VidiConst.URL_GAME)
|
||||||
},
|
},
|
||||||
PopMenuIconView.MenuItem(R.mipmap.home_menu_4) {
|
PopMenuIconView.MenuItem(R.mipmap.home_menu_4) {
|
||||||
Router.Benefit.startActivity(requireActivity())
|
Router.ZeroBuy.startActivity(requireActivity())
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ class BoxTaskHelper: BaseTaskHelper<TaskStateBoxRoot, BoxTaskRoot>() {
|
||||||
return index
|
return index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getCurrentBoxState(): TaskStateBox? {
|
fun getCurrentBoxState(): TaskStateBox? {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue