UPD: Add Dropdown Icon next to text

This commit is contained in:
sebastian 2025-05-10 15:20:22 +02:00
parent 0c1bc5265e
commit 2525ef9eac

View File

@ -27,6 +27,7 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.ArrowDropDown
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Folder
@ -193,21 +194,32 @@ fun NoteItem(
)
Box {
Text(
text = note.title,
style = MaterialTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.clickable { showMenu = true }
.padding(top = 8.dp)
.clickable(
indication = null,
interactionSource = remember { MutableInteractionSource() }
) {
showMenu = true
}
)
) {
Text(
text = note.title,
style = MaterialTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier
.clickable(
indication = null,
interactionSource = remember { MutableInteractionSource() }
) {
showMenu = true
}
)
Icon(
imageVector = Icons.Default.ArrowDropDown,
contentDescription = "Mehr Optionen",
tint = MaterialTheme.colorScheme.onSurface
)
}
DropdownMenu(
expanded = showMenu,