Update Search Bar Ui

This commit is contained in:
FirephoenixX02 2024-04-17 10:40:43 +02:00
parent 6f55430a1d
commit f90696d3d3

View file

@ -57,7 +57,13 @@ class HomeScreen: Screen {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
val coroutineScope = rememberCoroutineScope() val coroutineScope = rememberCoroutineScope()
var searchQuery by remember { mutableStateOf("") } var searchQuery by remember { mutableStateOf("") }
Box(modifier = Modifier.background(color = orange).fillMaxSize()) { val yellow = Color(0xFFFFD700)
Column(
modifier = Modifier
.fillMaxSize()
.background(color = orange),
horizontalAlignment = Alignment.CenterHorizontally
) {
OutlinedTextField( OutlinedTextField(
value = searchQuery, value = searchQuery,
onValueChange = { newName -> searchQuery = newName }, onValueChange = { newName -> searchQuery = newName },
@ -84,8 +90,7 @@ class HomeScreen: Screen {
println(names) println(names)
println(newMap) println(newMap)
if (newMap.isNotEmpty()) { if (newMap.isNotEmpty()) {
pokemap.clear() pokemap = newMap
pokemap.addAll(newMap)
} }
} }
} }
@ -96,11 +101,15 @@ class HomeScreen: Screen {
} }
}, },
colors = TextFieldDefaults.outlinedTextFieldColors( colors = TextFieldDefaults.outlinedTextFieldColors(
focusedBorderColor = Color(0xFFffa500), // Orange color focusedBorderColor = yellow,
unfocusedBorderColor = Color(0xFFffa500), // Orange color unfocusedBorderColor = yellow,
textColor = Color.Black textColor = Color.Black,
cursorColor = orange,
focusedLabelColor = orange,
unfocusedLabelColor = orange,
) )
) )
Spacer(modifier = Modifier.height(16.dp))
//Grid //Grid
LazyVerticalGrid( LazyVerticalGrid(
columns = GridCells.Adaptive(minSize = 256.dp), columns = GridCells.Adaptive(minSize = 256.dp),