Only show view more card if row has more items (#1493)

## Description
Only show the view more card at the end of row if there are actually
more items (or at the limit).

Also reduces the size of the arrow a bit

### Related issues
Related to #1392 

### Testing
Emulator with different max items setting

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-05-30 17:41:44 -04:00 • committed by GitHub
parent 68836bb834
commit 6c64470c28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 11 deletions

View file

@ -592,6 +592,7 @@ class HomeSettingsService
items = resume,
viewOptions = row.viewOptions,
rowType = row,
showViewMore = resume.size >= limit,
)
}
@ -611,6 +612,7 @@ class HomeSettingsService
items = nextUp,
viewOptions = row.viewOptions,
rowType = row,
showViewMore = nextUp.size >= limit,
)
}
@ -631,17 +633,14 @@ class HomeSettingsService
prefs.maxDaysNextUp,
row.viewOptions.useSeries,
)
val combined = latestNextUpService.buildCombined(resume, nextUp)
Success(
title = ResStringProvider(R.string.continue_watching),
items =
latestNextUpService
.buildCombined(
resume,
nextUp,
).take(limit),
items = combined.take(limit),
viewOptions = row.viewOptions,
rowType = row,
showViewMore = combined.size >= limit,
)
}
@ -705,6 +704,7 @@ class HomeSettingsService
genres,
viewOptions = row.viewOptions,
rowType = row,
showViewMore = genres.size >= limit,
)
}
@ -756,6 +756,7 @@ class HomeSettingsService
title,
studios,
viewOptions = row.viewOptions,
showViewMore = studios.size >= limit,
)
}
@ -784,6 +785,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
latest
@ -838,6 +840,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -891,6 +894,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -928,6 +932,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -957,6 +962,7 @@ class HomeSettingsService
title,
it,
row.viewOptions,
showViewMore = it.size >= limit,
)
}
} else {
@ -988,6 +994,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -1023,6 +1030,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -1049,6 +1057,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -1079,6 +1088,7 @@ class HomeSettingsService
it,
row.viewOptions,
rowType = row,
showViewMore = it.size >= limit,
)
}
}
@ -1111,6 +1121,7 @@ class HomeSettingsService
suggestions.items,
row.viewOptions,
rowType = row,
showViewMore = suggestions.items.size >= limit,
)
}

View file

@ -95,12 +95,15 @@ fun ViewMoreCard(
containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(1.dp),
),
) {
Box {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.fillMaxSize(),
) {
Icon(
imageVector = Icons.Default.ArrowForward,
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = "View more",
modifier = Modifier.fillMaxSize(),
modifier = Modifier.fillMaxSize(.66f),
)
}
}

View file

@ -120,10 +120,12 @@ class RecommendedViewModel
viewModelScope.launchIO {
val result =
try {
val items = execute(row, limit)
HomeRowLoadingState.Success(
title,
execute(row, limit),
items,
viewOptions,
showViewMore = items.size >= limit,
)
} catch (ex: Exception) {
Timber.e(ex, "Exception fetching %s", title)
@ -172,6 +174,10 @@ class RecommendedViewModel
private fun fetchSuggestions() {
viewModelScope.launch(Dispatchers.IO) {
val limit =
userPreferencesService
.getCurrent()
.appPreferences.homePagePreferences.maxItemsPerRow
val title = ResStringProvider(R.string.suggestions)
try {
suggestionService
@ -188,6 +194,7 @@ class RecommendedViewModel
title,
resource.items,
viewOptions,
showViewMore = resource.items.size >= limit,
)
}
@ -196,6 +203,7 @@ class RecommendedViewModel
title,
emptyList(),
viewOptions,
showViewMore = false,
)
}
}

View file

@ -214,7 +214,11 @@ class CollectionViewModel
val result =
try {
val pager = fetchItems(sort, filter, listOf(type))
HomeRowLoadingState.Success(title, pager)
HomeRowLoadingState.Success(
title,
pager,
showViewMore = false,
)
} catch (ex: Exception) {
Timber.e(
ex,

View file

@ -472,7 +472,7 @@ fun HomePageContent(
.onKeyEvent { onKey(it) },
)
},
showViewMore = showViewMore,
showViewMore = showViewMore && row.showViewMore,
viewMoreCardContent = { mod ->
HomePageViewMoreCard(
isEpisode = row.items.last()?.type == BaseItemKind.EPISODE,

View file

@ -67,6 +67,7 @@ sealed interface HomeRowLoadingState {
val items: List<BaseItem?>,
val viewOptions: HomeRowViewOptions = HomeRowViewOptions(),
val rowType: HomeRowConfig? = null,
val showViewMore: Boolean = true,
) : HomeRowLoadingState
data class Error(