Skip to content

Commit

Permalink
Update TeamPagerAdapter.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 committed Jan 5, 2025
1 parent bbfe5a5 commit ad88fe5
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,24 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, isInMyTeam: Boo
private val isTeam: Boolean = TextUtils.equals(team?.type, "team")

init {
list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan))
list.add(context.getString(if (isEnterprise) R.string.team else R.string.members))
if (isInMyTeam || team?.isPublic == true) {
list.add(context.getString(R.string.chat))
list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan))
list.add(context.getString(if (isEnterprise) R.string.team else R.string.members))
list.add(context.getString(R.string.tasks))
list.add(context.getString(R.string.calendar))
if (!isEnterprise) {
list.add(context.getString(R.string.survey))
}
list.add(context.getString(if (isEnterprise) R.string.finances else R.string.courses))
if (isEnterprise) list.add(context.getString(R.string.reports))
if (isEnterprise) {
list.add(context.getString(R.string.reports))
}
list.add(context.getString(if (isEnterprise) R.string.documents else R.string.resources))
list.add(context.getString(if (isEnterprise) R.string.applicants else R.string.join_requests))
list.removeAt(0)
list.removeAt(0)
list.add(1, context.getString(if (isEnterprise) R.string.mission else R.string.plan))
list.add(2, context.getString(if (isEnterprise) R.string.team else R.string.members))
} else {
list.add(context.getString(if (isEnterprise) R.string.mission else R.string.plan))
list.add(context.getString(if (isEnterprise) R.string.team else R.string.members))
}
}

Expand Down Expand Up @@ -74,9 +75,9 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, isInMyTeam: Boo
else -> throw IllegalArgumentException("Invalid fragment type for position: $position")
}
if (fragment.arguments == null) {
val bundle = Bundle()
bundle.putString("id", teamId)
fragment.arguments = bundle
fragment.arguments = Bundle().apply {
putString("id", teamId)
}
}
return fragment
}
Expand Down

0 comments on commit ad88fe5

Please sign in to comment.