Skip to content

Commit

Permalink
Fixed search UI location issue
Browse files Browse the repository at this point in the history
[Fixed search bar may be obscured in landscape mode]
  • Loading branch information
Z-Siqi committed Oct 26, 2024
1 parent 35ccc95 commit 2f286df
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ fun TaskLayout(
) modifier.padding(
start = left, end = if (left / 3 > 15.dp) 15.dp else left / 3
) else modifier

LazyList( // LazyColumn lists
listState = listState,
lazyState = lazyState,
Expand All @@ -118,7 +119,11 @@ fun TaskLayout(
}
},
isInSearch = { // Search function
taskSearchBar(searchState = listState.searchView, taskState = taskState)
taskSearchBar(
searchState = listState.searchView,
taskState = taskState,
modifier = safePaddingForFullscreen
)
},
context = context,
taskState = taskState,
Expand Down Expand Up @@ -206,20 +211,20 @@ private fun taskSearchBar(
if (searchState) Column(modifier = modifier.fillMaxSize()) {
val textFieldState = rememberTextFieldState()
OutlinedCard(
modifier = modifier
modifier = Modifier
.fillMaxWidth()
.padding(start = 18.dp, end = 18.dp, top = 12.dp)
.height(50.dp),
shape = ShapeDefaults.ExtraLarge
) {
Row(verticalAlignment = Alignment.CenterVertically) {
Icon(
modifier = modifier.padding(start = 10.dp),
modifier = Modifier.padding(start = 10.dp),
imageVector = Icons.Filled.Search,
contentDescription = stringResource(id = R.string.search)
)
BasicTextField(
modifier = modifier
modifier = Modifier
.fillMaxSize()
.padding(start = 9.dp, end = 9.dp, top = 10.dp, bottom = 8.dp)
.horizontalScroll(rememberScrollState()),
Expand Down

0 comments on commit 2f286df

Please sign in to comment.