Skip to content

Instantly share code, notes, and snippets.

@merttoptas
Created February 9, 2022 09:42
Show Gist options
  • Save merttoptas/82cab077496bada0596f5a2ac7c3cdb9 to your computer and use it in GitHub Desktop.
Save merttoptas/82cab077496bada0596f5a2ac7c3cdb9 to your computer and use it in GitHub Desktop.
search area.
@Composable
fun HomeScreen() {
Surface(color = MaterialTheme.colors.background, modifier = Modifier.fillMaxSize()) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp)
) {
LazyColumn(modifier = Modifier.fillMaxSize(), content = {
item { Spacer(modifier = Modifier.height(20.dp)) }
item {
SearchEditText(
modifier = Modifier
.fillMaxWidth()
)
}
}
}
@Composable
fun SearchEditText(modifier: Modifier) {
OutlinedTextField(
value = "",
onValueChange = {},
modifier = modifier,
singleLine = true,
placeholder = { Text(text = "Search", style = MaterialTheme.typography.body1) },
textStyle = MaterialTheme.typography.body1,
visualTransformation = VisualTransformation.None,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
shape = RoundedCornerShape(10.dp),
leadingIcon = {
Icon(
imageVector = Icons.Default.Search,
contentDescription = "Search",
modifier = Modifier.size(18.dp),
)
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment