Skip to content

Commit

Permalink
Add offset between the BU selector and its menu
Browse files Browse the repository at this point in the history
Add a check next to the selected BU
  • Loading branch information
MGaetan89 committed Nov 21, 2023
1 parent 31b6829 commit 4b7f7e9
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.ExpandMore
import androidx.compose.material.icons.filled.Search
Expand Down Expand Up @@ -53,6 +54,7 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
Expand Down Expand Up @@ -224,14 +226,25 @@ private fun SearchInput(

DropdownMenu(
expanded = showBuSelector,
onDismissRequest = { showBuSelector = false }
onDismissRequest = { showBuSelector = false },
offset = DpOffset(x = 0.dp, y = 8.dp)
) {
bus.forEach { bu ->
DropdownMenuItem(
text = { Text(text = bu.name.uppercase()) },
onClick = {
onBuChange(bu)
showBuSelector = false
},
trailingIcon = if (selectedBu == bu) {
{
Icon(
imageVector = Icons.Default.Check,
contentDescription = null
)
}
} else {
null
}
)
}
Expand Down

0 comments on commit 4b7f7e9

Please sign in to comment.