mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 07:21:58 +00:00
ref: adjust the search screen empty state ui
This commit is contained in:
parent
1a0738551f
commit
cf1bd1613b
1 changed files with 45 additions and 37 deletions
|
|
@ -285,7 +285,15 @@ fun SearchScreen(
|
||||||
onPosterLongClick = onPosterLongClick,
|
onPosterLongClick = onPosterLongClick,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
val normalizedQuery = query.trim()
|
||||||
|
val isWaitingForSearch = normalizedQuery.isNotBlank() && lastRequestedQuery != normalizedQuery
|
||||||
when {
|
when {
|
||||||
|
isWaitingForSearch -> {
|
||||||
|
items(2) {
|
||||||
|
HomeSkeletonRow(modifier = Modifier.padding(horizontal = homeSectionPadding))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uiState.isLoading && uiState.sections.isEmpty() -> {
|
uiState.isLoading && uiState.sections.isEmpty() -> {
|
||||||
items(2) {
|
items(2) {
|
||||||
HomeSkeletonRow(modifier = Modifier.padding(horizontal = homeSectionPadding))
|
HomeSkeletonRow(modifier = Modifier.padding(horizontal = homeSectionPadding))
|
||||||
|
|
@ -299,7 +307,6 @@ fun SearchScreen(
|
||||||
errorMessage = uiState.errorMessage,
|
errorMessage = uiState.errorMessage,
|
||||||
networkCondition = networkStatusUiState.condition,
|
networkCondition = networkStatusUiState.condition,
|
||||||
onRetry = {
|
onRetry = {
|
||||||
val normalizedQuery = query.trim()
|
|
||||||
if (normalizedQuery.isNotBlank()) {
|
if (normalizedQuery.isNotBlank()) {
|
||||||
NetworkStatusRepository.requestRefresh(force = true)
|
NetworkStatusRepository.requestRefresh(force = true)
|
||||||
SearchRepository.search(
|
SearchRepository.search(
|
||||||
|
|
@ -308,6 +315,7 @@ fun SearchScreen(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
modifier = Modifier.padding(horizontal = homeSectionPadding),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue