From bfa27750d371c42f904beefe7f98fc4415402766 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 15 Jun 2023 13:48:21 +0530 Subject: [PATCH] fix: ensure PGP key list item works with longer user IDs --- .../main/java/app/passwordstore/ui/pgp/PGPKeyList.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyList.kt b/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyList.kt index 34cc70a1..fd717a8b 100644 --- a/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyList.kt +++ b/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyList.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.requiredSize import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.AlertDialog @@ -24,6 +25,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import app.passwordstore.R @@ -88,9 +90,14 @@ private fun KeyItem( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - Text(text = label) + Text( + text = label, + modifier = Modifier.weight(1f), + overflow = TextOverflow.Ellipsis, + maxLines = 1, + ) if (onKeySelected == null) { - IconButton(onClick = { isDeleting = true }) { + IconButton(onClick = { isDeleting = true }, modifier = Modifier.requiredSize(24.dp)) { Icon( painter = painterResource(R.drawable.ic_delete_24dp), stringResource(id = R.string.delete)