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.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add 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.Delete
import androidx.compose.material.icons.filled.Edit import androidx.compose.material.icons.filled.Edit
import androidx.compose.material.icons.filled.Folder import androidx.compose.material.icons.filled.Folder
@ -193,21 +194,32 @@ fun NoteItem(
) )
Box { Box {
Text( Row(
text = note.title, verticalAlignment = Alignment.CenterVertically,
style = MaterialTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier modifier = Modifier
.clickable { showMenu = true }
.padding(top = 8.dp) .padding(top = 8.dp)
.clickable( ) {
indication = null, Text(
interactionSource = remember { MutableInteractionSource() } text = note.title,
) { style = MaterialTheme.typography.bodyMedium,
showMenu = true 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( DropdownMenu(
expanded = showMenu, expanded = showMenu,