diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt b/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt index 67d5fc0ce9..2bc0065369 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/team/TeamPagerAdapter.kt @@ -31,7 +31,6 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, private val isI list.add(MainApplication.context.getString(R.string.tasks)) list.add(MainApplication.context.getString(R.string.calendar)) list.add(MainApplication.context.getString(if (isEnterprise) R.string.finances else R.string.courses)) - if (isEnterprise) { list.add("Reports") } list.add(MainApplication.context.getString(if (isEnterprise) R.string.documents else R.string.resources)) list.add(MainApplication.context.getString(if (isEnterprise) R.string.applicants else R.string.join_requests)) } @@ -46,21 +45,23 @@ class TeamPagerAdapter(fm: FragmentActivity, team: RealmMyTeam?, private val isI if (position < 0 || position >= list.size) { throw IllegalArgumentException("Invalid position: $position. List size: ${list.size}") } - val fragment = when (list[position]) { + val fragment: Fragment = when (list[position]) { MainApplication.context.getString(R.string.chat) -> DiscussionListFragment() - MainApplication.context.getString(R.string.plan) -> PlanFragment() - MainApplication.context.getString(R.string.joined_members) -> JoinedMemberFragment() + MainApplication.context.getString(R.string.plan), MainApplication.context.getString(R.string.mission) -> PlanFragment() + MainApplication.context.getString(R.string.joined_members), MainApplication.context.getString(R.string.team) -> JoinedMemberFragment() MainApplication.context.getString(R.string.tasks) -> TeamTaskFragment() MainApplication.context.getString(R.string.calendar) -> EnterpriseCalendarFragment() - MainApplication.context.getString(R.string.courses) -> TeamCourseFragment() - MainApplication.context.getString(R.string.resources) -> TeamResourceFragment().apply { MainApplication.listener = this } - MainApplication.context.getString(R.string.join_requests) -> MembersFragment() - else -> throw IllegalArgumentException("Invalid fragment type for position: $position") } + MainApplication.context.getString(R.string.courses), MainApplication.context.getString(R.string.finances) -> TeamCourseFragment() + MainApplication.context.getString(R.string.resources), MainApplication.context.getString(R.string.documents) -> TeamResourceFragment().apply { MainApplication.listener = this } + MainApplication.context.getString(R.string.join_requests), MainApplication.context.getString(R.string.applicants) -> MembersFragment() + else -> throw IllegalArgumentException("Invalid fragment type for position: $position") + } val bundle = Bundle() bundle.putString("id", teamId) fragment.arguments = bundle - return fragment } + return fragment + } override fun getItemCount(): Int { return list.size