Replace `Enum.values()` with `Enum.entries`

'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9
pull/1120/head
Simon Marquis 6 months ago
parent a5c030f740
commit be9dc533e3
No known key found for this signature in database
GPG Key ID: AC8D63F7571DC6D6

@ -115,7 +115,7 @@ class NiaAppState(
* Map of top level destinations to be used in the TopBar, BottomBar and NavRail. The key is the
* route.
*/
val topLevelDestinations: List<TopLevelDestination> = TopLevelDestination.values().asList()
val topLevelDestinations: List<TopLevelDestination> = TopLevelDestination.entries
/**
* The top level destinations that have unread news resources.

@ -45,7 +45,7 @@ class ScrollTopicListPowerMetricsBenchmark {
@get:Rule
val benchmarkRule = MacrobenchmarkRule()
private val categories = PowerCategory.values()
private val categories = PowerCategory.entries
.associateWith { PowerCategoryDisplayLevel.TOTAL }
@Test

@ -53,7 +53,7 @@ fun <A : ComponentActivity> AndroidComposeTestRule<ActivityScenarioRule<A>, A>.c
screenshotName: String,
body: @Composable () -> Unit,
) {
DefaultTestDevices.values().forEach {
DefaultTestDevices.entries.forEach {
this.captureForDevice(it.description, it.spec, screenshotName, body = body)
}
}

Loading…
Cancel
Save