Skip to content

Commit

Permalink
Use Enum.entries instead of Enum.values
Browse files Browse the repository at this point in the history
  • Loading branch information
mars885 committed Aug 4, 2024
1 parent 6ff37e6 commit c80d5d5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal class ClothingSizePickerFragment : BaseFragment<
}

private fun generateClothingSizePickerItems(): List<Item> {
return ClothingSize.values().map {
return ClothingSize.entries.map {
PickerItem(
id = it.ordinal,
title = it.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal class DashboardFragment : BaseFragment<
private fun initAdapter(): DashboardRecyclerViewAdapter {
return DashboardRecyclerViewAdapter(
context = requireContext(),
items = DashboardDestination.values().toList(),
items = DashboardDestination.entries.toList(),
onItemClickListener = ::navigateToDestination,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal class DatePickerFragment : BaseFragment<
}

private fun generateMonthPickerItems(longMonthNames: Boolean): List<Item> {
return Month.values().map {
return Month.entries.map {
PickerItem(
id = it.ordinal,
title = if (longMonthNames) it.longName else it.shortName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal class MovieFilteringPickerFragment : BaseFragment<
}

private fun generateGenrePickerItems(): List<Item> {
return Genre.values().map {
return Genre.entries.map {
PickerItem(
id = it.ordinal,
title = it.title,
Expand Down Expand Up @@ -128,7 +128,7 @@ internal class MovieFilteringPickerFragment : BaseFragment<
}

private fun generateServicePickerItems(): List<Item> {
return StreamingService.values().map {
return StreamingService.entries.map {
PickerItem(
id = it.ordinal,
title = it.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal class RatingPickerFragment : BaseFragment<
}

private fun generateRatingPickerItems(): List<Item> {
return Rating.values().map {
return Rating.entries.map {
PickerItem(
id = it.ordinal,
title = it.number.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal class TeamPickerFragment : BaseFragment<
}

private fun generateTeamPickerItems(): List<Item> {
return Team.values().map {
return Team.entries.map {
PickerItem(
id = it.ordinal,
title = it.longName,
Expand Down

0 comments on commit c80d5d5

Please sign in to comment.