screenshots: filter out dupes & used stable id
This commit is contained in:
@@ -40,6 +40,7 @@ fun ScreenshotScreen(
|
|||||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfoV2()
|
||||||
) {
|
) {
|
||||||
val app by viewModel.app.collectAsStateWithLifecycle()
|
val app by viewModel.app.collectAsStateWithLifecycle()
|
||||||
|
val screenshots = app?.screenshots ?: emptyList()
|
||||||
|
|
||||||
val topAppBarTitle = when {
|
val topAppBarTitle = when {
|
||||||
windowAdaptiveInfo.isWindowCompact -> app!!.displayName
|
windowAdaptiveInfo.isWindowCompact -> app!!.displayName
|
||||||
@@ -48,7 +49,7 @@ fun ScreenshotScreen(
|
|||||||
|
|
||||||
ScreenContent(
|
ScreenContent(
|
||||||
topAppBarTitle = topAppBarTitle,
|
topAppBarTitle = topAppBarTitle,
|
||||||
screenshots = app!!.screenshots,
|
screenshots = screenshots.distinctBy { it.url },
|
||||||
index = index
|
index = index
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -79,7 +80,8 @@ private fun ScreenContent(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(paddingValues)
|
.padding(paddingValues)
|
||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
state = pagerState
|
state = pagerState,
|
||||||
|
key = { screenshots[it].url }
|
||||||
) { page ->
|
) { page ->
|
||||||
val artwork = screenshots[page]
|
val artwork = screenshots[page]
|
||||||
ScreenshotListItem(
|
ScreenshotListItem(
|
||||||
|
|||||||
Reference in New Issue
Block a user