Display message if favorites or tag is empty
This commit is contained in:
parent
1f0db6c03e
commit
d50013e490
@ -650,6 +650,8 @@
|
||||
<string name="apps_profile_main">Personal</string>
|
||||
<string name="apps_profile_work">Work</string>
|
||||
<string name="favorites">Favorites</string>
|
||||
<string name="favorites_empty">Pinned and frequently used items will appear here</string>
|
||||
<string name="favorites_empty_tag">There are no items with this tag</string>
|
||||
<string name="create_app_shortcut">Create shortcut</string>
|
||||
<string name="frequently_used_show_in_favorites">Show in favorites</string>
|
||||
<string name="frequently_used_rows">Number of rows</string>
|
||||
|
||||
@ -85,6 +85,25 @@ fun SearchColumn(
|
||||
showLabels = showLabels,
|
||||
key = "favorites",
|
||||
reverse = reverse,
|
||||
before = if (favorites.isEmpty()) {
|
||||
{
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(
|
||||
top = if (!reverse) 28.dp else 16.dp,
|
||||
start = 16.dp,
|
||||
end = 16.dp,
|
||||
bottom = if (reverse) 28.dp else 16.dp,
|
||||
),
|
||||
text = stringResource(
|
||||
if (selectedTag == null) R.string.favorites_empty else R.string.favorites_empty_tag
|
||||
),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.outline
|
||||
)
|
||||
}
|
||||
} else null,
|
||||
after = {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
||||
@ -27,7 +27,20 @@ fun FavoritesWidget() {
|
||||
var showEditFavoritesDialog by remember { mutableStateOf(false) }
|
||||
|
||||
Column {
|
||||
SearchResultGrid(favorites)
|
||||
if (favorites.isNotEmpty()) {
|
||||
SearchResultGrid(favorites)
|
||||
} else {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(top = 28.dp, start = 16.dp, end = 16.dp, bottom = 16.dp),
|
||||
text = stringResource(
|
||||
if (selectedTag == null) R.string.favorites_empty else R.string.favorites_empty_tag
|
||||
),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.outline
|
||||
)
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user