Skip to content

Commit

Permalink
fix enterprises
Browse files Browse the repository at this point in the history
  • Loading branch information
rlam20 committed Jul 10, 2024
1 parent 9e63880 commit d9ca170
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand All @@ -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
Expand Down

0 comments on commit d9ca170

Please sign in to comment.