Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchEmptyState.kt +6 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package foundation.e.apps.ui.compose.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize Loading @@ -33,6 +33,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp Loading @@ -42,21 +43,17 @@ import foundation.e.apps.ui.compose.theme.AppTheme @Composable fun SearchEmptyState(modifier: Modifier = Modifier) { Box( modifier = modifier .fillMaxSize(), modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center, ) { Column( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(12.dp), ) { androidx.compose.foundation.Image( Image( painter = painterResource(id = R.drawable.ic_error_circular), contentDescription = null, contentScale = ContentScale.Fit, modifier = Modifier .padding(bottom = 4.dp) .size(96.dp), modifier = Modifier.size(64.dp), ) Text( text = stringResource(id = R.string.no_apps_found), Loading @@ -64,7 +61,7 @@ fun SearchEmptyState(modifier: Modifier = Modifier) { fontSize = 18.sp ), color = colorResource(id = R.color.light_grey), textAlign = androidx.compose.ui.text.style.TextAlign.Center, textAlign = TextAlign.Center, ) } } Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchInitialState.kt +4 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Search Loading @@ -15,6 +14,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import foundation.e.apps.R Loading @@ -33,15 +33,14 @@ fun SearchInitialState(modifier: Modifier = Modifier) { Icon( imageVector = Icons.Outlined.Search, contentDescription = null, tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.45f), modifier = Modifier .padding(bottom = 4.dp) .size(72.dp), tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f), modifier = Modifier.size(64.dp), ) Text( text = stringResource(id = R.string.search_hint), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.72f), textAlign = TextAlign.Center, ) } } Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultListItem.kt +10 −20 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package foundation.e.apps.ui.compose.components import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.clickable Loading Loading @@ -267,49 +268,38 @@ private fun PrimaryActionArea( // render the primary action button } val accentColor = MaterialTheme.colorScheme.tertiary val buttonContent: @Composable () -> Unit = { if (uiState.isInProgress) { val indicatorColor = if (uiState.isFilledStyle) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.onPrimary CircularProgressIndicator( modifier = Modifier.size(16.dp), strokeWidth = 2.dp, color = indicatorColor, color = accentColor, ) } else { val textColor = if (uiState.isFilledStyle) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.onSurface Text( text = uiState.label, maxLines = 1, overflow = TextOverflow.Clip, color = textColor, color = accentColor, ) } } Column(horizontalAlignment = Alignment.End) { val containerColor = if (uiState.isFilledStyle) { MaterialTheme.colorScheme.primary } else { MaterialTheme.colorScheme.secondaryContainer } val contentColor = if (uiState.isFilledStyle) { MaterialTheme.colorScheme.onPrimary } else { MaterialTheme.colorScheme.onSecondaryContainer } Button( onClick = onPrimaryClick, enabled = uiState.enabled, modifier = Modifier.height(40.dp), shape = RoundedCornerShape(4.dp), colors = ButtonDefaults.buttonColors( containerColor = containerColor, contentColor = contentColor, disabledContainerColor = containerColor.copy(alpha = 0.38f), disabledContentColor = contentColor.copy(alpha = 0.38f), containerColor = Color.Transparent, contentColor = accentColor, disabledContainerColor = Color.Transparent, disabledContentColor = accentColor.copy(alpha = 0.38f), ), border = BorderStroke(1.dp, if (uiState.enabled) accentColor else accentColor.copy(alpha = 0.38f)), contentPadding = ButtonDefaults.ContentPadding, ) { buttonContent() Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultsContent.kt +3 −3 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ private fun SearchTabs( if (selectedIndex in tabPositions.indices) { TabRowDefaults.Indicator( modifier = Modifier.tabIndicatorOffset(tabPositions[selectedIndex]), color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.tertiary, ) } }, Loading @@ -209,8 +209,8 @@ private fun SearchTabs( Tab( selected = index == selectedIndex, onClick = { onTabSelected(tab, index) }, selectedContentColor = MaterialTheme.colorScheme.primary, unselectedContentColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.64f), selectedContentColor = MaterialTheme.colorScheme.tertiary, unselectedContentColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f), ) { Text( text = label, Loading app/src/main/java/foundation/e/apps/ui/compose/components/SearchSuggestionsDropdown.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme Loading @@ -44,6 +45,7 @@ fun SearchSuggestionsDropdown( Card( modifier = modifier.fillMaxWidth(), shape = RoundedCornerShape(0.dp), colors = CardDefaults.cardColors( containerColor = MaterialTheme.colorScheme.surface, ), Loading Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchEmptyState.kt +6 −9 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ package foundation.e.apps.ui.compose.components import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize Loading @@ -33,6 +33,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp Loading @@ -42,21 +43,17 @@ import foundation.e.apps.ui.compose.theme.AppTheme @Composable fun SearchEmptyState(modifier: Modifier = Modifier) { Box( modifier = modifier .fillMaxSize(), modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center, ) { Column( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.spacedBy(12.dp), ) { androidx.compose.foundation.Image( Image( painter = painterResource(id = R.drawable.ic_error_circular), contentDescription = null, contentScale = ContentScale.Fit, modifier = Modifier .padding(bottom = 4.dp) .size(96.dp), modifier = Modifier.size(64.dp), ) Text( text = stringResource(id = R.string.no_apps_found), Loading @@ -64,7 +61,7 @@ fun SearchEmptyState(modifier: Modifier = Modifier) { fontSize = 18.sp ), color = colorResource(id = R.color.light_grey), textAlign = androidx.compose.ui.text.style.TextAlign.Center, textAlign = TextAlign.Center, ) } } Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchInitialState.kt +4 −5 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Search Loading @@ -15,6 +14,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import foundation.e.apps.R Loading @@ -33,15 +33,14 @@ fun SearchInitialState(modifier: Modifier = Modifier) { Icon( imageVector = Icons.Outlined.Search, contentDescription = null, tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.45f), modifier = Modifier .padding(bottom = 4.dp) .size(72.dp), tint = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f), modifier = Modifier.size(64.dp), ) Text( text = stringResource(id = R.string.search_hint), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.72f), textAlign = TextAlign.Center, ) } } Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultListItem.kt +10 −20 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package foundation.e.apps.ui.compose.components import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.clickable Loading Loading @@ -267,49 +268,38 @@ private fun PrimaryActionArea( // render the primary action button } val accentColor = MaterialTheme.colorScheme.tertiary val buttonContent: @Composable () -> Unit = { if (uiState.isInProgress) { val indicatorColor = if (uiState.isFilledStyle) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.onPrimary CircularProgressIndicator( modifier = Modifier.size(16.dp), strokeWidth = 2.dp, color = indicatorColor, color = accentColor, ) } else { val textColor = if (uiState.isFilledStyle) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.onSurface Text( text = uiState.label, maxLines = 1, overflow = TextOverflow.Clip, color = textColor, color = accentColor, ) } } Column(horizontalAlignment = Alignment.End) { val containerColor = if (uiState.isFilledStyle) { MaterialTheme.colorScheme.primary } else { MaterialTheme.colorScheme.secondaryContainer } val contentColor = if (uiState.isFilledStyle) { MaterialTheme.colorScheme.onPrimary } else { MaterialTheme.colorScheme.onSecondaryContainer } Button( onClick = onPrimaryClick, enabled = uiState.enabled, modifier = Modifier.height(40.dp), shape = RoundedCornerShape(4.dp), colors = ButtonDefaults.buttonColors( containerColor = containerColor, contentColor = contentColor, disabledContainerColor = containerColor.copy(alpha = 0.38f), disabledContentColor = contentColor.copy(alpha = 0.38f), containerColor = Color.Transparent, contentColor = accentColor, disabledContainerColor = Color.Transparent, disabledContentColor = accentColor.copy(alpha = 0.38f), ), border = BorderStroke(1.dp, if (uiState.enabled) accentColor else accentColor.copy(alpha = 0.38f)), contentPadding = ButtonDefaults.ContentPadding, ) { buttonContent() Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchResultsContent.kt +3 −3 Original line number Diff line number Diff line Loading @@ -196,7 +196,7 @@ private fun SearchTabs( if (selectedIndex in tabPositions.indices) { TabRowDefaults.Indicator( modifier = Modifier.tabIndicatorOffset(tabPositions[selectedIndex]), color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.tertiary, ) } }, Loading @@ -209,8 +209,8 @@ private fun SearchTabs( Tab( selected = index == selectedIndex, onClick = { onTabSelected(tab, index) }, selectedContentColor = MaterialTheme.colorScheme.primary, unselectedContentColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.64f), selectedContentColor = MaterialTheme.colorScheme.tertiary, unselectedContentColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.5f), ) { Text( text = label, Loading
app/src/main/java/foundation/e/apps/ui/compose/components/SearchSuggestionsDropdown.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme Loading @@ -44,6 +45,7 @@ fun SearchSuggestionsDropdown( Card( modifier = modifier.fillMaxWidth(), shape = RoundedCornerShape(0.dp), colors = CardDefaults.cardColors( containerColor = MaterialTheme.colorScheme.surface, ), Loading