Notify when no pokemon is found
This commit is contained in:
parent
e86ff0cc17
commit
db0f41f207
1 changed files with 7 additions and 2 deletions
|
|
@ -58,6 +58,7 @@ class HomeScreen: Screen {
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
var searchQuery by remember { mutableStateOf("") }
|
var searchQuery by remember { mutableStateOf("") }
|
||||||
val yellow = Color(0xFFFFD700)
|
val yellow = Color(0xFFFFD700)
|
||||||
|
var placeholder by remember { mutableStateOf("") }
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
|
|
@ -66,7 +67,7 @@ class HomeScreen: Screen {
|
||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = searchQuery,
|
value = searchQuery,
|
||||||
onValueChange = { newName -> searchQuery = newName },
|
onValueChange = { newName -> searchQuery = newName; placeholder = "" },
|
||||||
modifier = Modifier.fillMaxWidth(0.8f)
|
modifier = Modifier.fillMaxWidth(0.8f)
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.padding(top = 16.dp)
|
.padding(top = 16.dp)
|
||||||
|
|
@ -95,6 +96,9 @@ class HomeScreen: Screen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
searchQuery = ""
|
||||||
|
placeholder = "No results, make sure to use more than 2 letters."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
|
|
@ -108,7 +112,8 @@ class HomeScreen: Screen {
|
||||||
cursorColor = orange,
|
cursorColor = orange,
|
||||||
focusedLabelColor = orange,
|
focusedLabelColor = orange,
|
||||||
unfocusedLabelColor = orange,
|
unfocusedLabelColor = orange,
|
||||||
)
|
),
|
||||||
|
placeholder = { Text(placeholder) }
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
//Grid
|
//Grid
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue