From 736912bd6c67dfd03f13797e87dd7a96565e4f5b Mon Sep 17 00:00:00 2001 From: David Perez Date: Tue, 15 Oct 2024 14:41:19 -0500 Subject: [PATCH] Remove launch icon and update BitwardenActionCard (#4097) --- .../components/card/BitwardenActionCard.kt | 55 ++++++++++--------- .../feature/item/VaultItemLoginContent.kt | 2 +- app/src/main/res/drawable/ic_launch.xml | 12 ---- 3 files changed, 29 insertions(+), 40 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_launch.xml diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/card/BitwardenActionCard.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/card/BitwardenActionCard.kt index 2f768ee01..abeaf0c36 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/card/BitwardenActionCard.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/card/BitwardenActionCard.kt @@ -4,12 +4,10 @@ import android.content.res.Configuration import androidx.compose.animation.fadeOut import androidx.compose.animation.shrinkVertically import androidx.compose.foundation.BorderStroke -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.material3.Card @@ -28,6 +26,7 @@ import com.x8bit.bitwarden.ui.platform.components.button.BitwardenStandardIconBu import com.x8bit.bitwarden.ui.platform.components.card.color.bitwardenCardColors import com.x8bit.bitwarden.ui.platform.components.util.rememberVectorPainter import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme +import kotlin.let /** * A design component action card, which contains a title, action button, and a dismiss button @@ -57,12 +56,9 @@ fun BitwardenActionCard( elevation = CardDefaults.elevatedCardElevation(), border = BorderStroke(width = 1.dp, color = BitwardenTheme.colorScheme.stroke.border), ) { - Column( - modifier = Modifier.padding(16.dp), - ) { - Row( - modifier = Modifier.fillMaxWidth(), - ) { + Row(modifier = Modifier.fillMaxWidth()) { + Spacer(Modifier.width(16.dp)) + Row(modifier = Modifier.padding(top = 16.dp)) { leadingContent?.let { it() Spacer(Modifier.width(12.dp)) @@ -71,28 +67,33 @@ fun BitwardenActionCard( text = cardTitle, style = BitwardenTheme.typography.titleMedium, ) - Spacer(Modifier.weight(1f)) - BitwardenStandardIconButton( - painter = rememberVectorPainter(id = R.drawable.ic_close), - contentDescription = stringResource(id = R.string.close), - onClick = onDismissClick, - modifier = Modifier.offset(x = 10.dp, y = (-10).dp), - ) } - cardSubtitle?.let { - Spacer(Modifier.height(4.dp)) - Text( - text = it, - style = BitwardenTheme.typography.bodyMedium, - ) - } - Spacer(Modifier.height(16.dp)) - BitwardenFilledButton( - label = actionText, - onClick = onActionClick, - modifier = Modifier.fillMaxWidth(), + Spacer(Modifier.weight(1f)) + BitwardenStandardIconButton( + painter = rememberVectorPainter(id = R.drawable.ic_close), + contentDescription = stringResource(id = R.string.close), + onClick = onDismissClick, ) } + cardSubtitle?.let { + Spacer(Modifier.height(4.dp)) + Text( + text = it, + style = BitwardenTheme.typography.bodyMedium, + modifier = Modifier + .padding(horizontal = 16.dp) + .fillMaxWidth(), + ) + } + Spacer(Modifier.height(16.dp)) + BitwardenFilledButton( + label = actionText, + onClick = onActionClick, + modifier = Modifier + .padding(horizontal = 16.dp) + .fillMaxWidth(), + ) + Spacer(Modifier.height(16.dp)) } } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt index 73045d8bb..5f7631dd7 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt @@ -418,7 +418,7 @@ private fun UriField( actions = { if (uriData.isLaunchable) { BitwardenFilledIconButton( - vectorIconRes = R.drawable.ic_launch, + vectorIconRes = R.drawable.ic_external_link, contentDescription = stringResource(id = R.string.launch), onClick = { onLaunchUriClick(uriData.uri) }, modifier = Modifier.testTag(tag = "LoginLaunchUriButton"), diff --git a/app/src/main/res/drawable/ic_launch.xml b/app/src/main/res/drawable/ic_launch.xml deleted file mode 100644 index bdc8f694e..000000000 --- a/app/src/main/res/drawable/ic_launch.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - -