Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchPlaceholder.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ fun SearchPlaceholder(modifier: Modifier = Modifier) { ) { ) { Image( Image( painter = painterResource(id = R.drawable.ic_error_circular), painter = painterResource(id = R.drawable.ic_error_circular), contentDescription = stringResource(id = R.string.menu_search), contentDescription = stringResource(id = R.string.no_apps_found), contentScale = ContentScale.Fit, contentScale = ContentScale.Fit, modifier = Modifier modifier = Modifier .padding(bottom = 4.dp) .padding(bottom = 4.dp) Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultsContent.kt +17 −3 Original line number Original line Diff line number Diff line Loading @@ -79,11 +79,26 @@ fun SearchResultsContent( onPrivacyClick: (Application) -> Unit = {}, onPrivacyClick: (Application) -> Unit = {}, installButtonStateProvider: (Application) -> InstallButtonState, installButtonStateProvider: (Application) -> InstallButtonState, ) { ) { when { if (tabs.isEmpty() || selectedTab !in tabs) { tabs.isEmpty() || selectedTab !in tabs -> { return return } } val fossEmpty = fossItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val pwaEmpty = pwaItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val playEmpty = playStoreItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val allSourcesEmpty = fossEmpty && pwaEmpty && playEmpty when { allSourcesEmpty -> { SearchPlaceholder(modifier = modifier.fillMaxSize()) } // Don't show tabs when a single source is checked in the Settings screen // Don't show tabs when a single source is checked in the Settings screen tabs.size == 1 -> { tabs.size == 1 -> { SearchTabPage( SearchTabPage( Loading @@ -101,7 +116,6 @@ fun SearchResultsContent( installButtonStateProvider = installButtonStateProvider, installButtonStateProvider = installButtonStateProvider, modifier = modifier.fillMaxSize(), modifier = modifier.fillMaxSize(), ) ) return } } else -> { else -> { Loading Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchPlaceholder.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ fun SearchPlaceholder(modifier: Modifier = Modifier) { ) { ) { Image( Image( painter = painterResource(id = R.drawable.ic_error_circular), painter = painterResource(id = R.drawable.ic_error_circular), contentDescription = stringResource(id = R.string.menu_search), contentDescription = stringResource(id = R.string.no_apps_found), contentScale = ContentScale.Fit, contentScale = ContentScale.Fit, modifier = Modifier modifier = Modifier .padding(bottom = 4.dp) .padding(bottom = 4.dp) Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultsContent.kt +17 −3 Original line number Original line Diff line number Diff line Loading @@ -79,11 +79,26 @@ fun SearchResultsContent( onPrivacyClick: (Application) -> Unit = {}, onPrivacyClick: (Application) -> Unit = {}, installButtonStateProvider: (Application) -> InstallButtonState, installButtonStateProvider: (Application) -> InstallButtonState, ) { ) { when { if (tabs.isEmpty() || selectedTab !in tabs) { tabs.isEmpty() || selectedTab !in tabs -> { return return } } val fossEmpty = fossItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val pwaEmpty = pwaItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val playEmpty = playStoreItems?.let { it.loadState.refresh is LoadState.NotLoading && it.itemCount == 0 } ?: true val allSourcesEmpty = fossEmpty && pwaEmpty && playEmpty when { allSourcesEmpty -> { SearchPlaceholder(modifier = modifier.fillMaxSize()) } // Don't show tabs when a single source is checked in the Settings screen // Don't show tabs when a single source is checked in the Settings screen tabs.size == 1 -> { tabs.size == 1 -> { SearchTabPage( SearchTabPage( Loading @@ -101,7 +116,6 @@ fun SearchResultsContent( installButtonStateProvider = installButtonStateProvider, installButtonStateProvider = installButtonStateProvider, modifier = modifier.fillMaxSize(), modifier = modifier.fillMaxSize(), ) ) return } } else -> { else -> { Loading