From bef4962f6ee1eac2dc1684bafdf8ab4f1d4c6c4a Mon Sep 17 00:00:00 2001 From: mrghosti3 Date: Sun, 7 Apr 2024 14:18:34 +0300 Subject: [PATCH] Fix `FilledTonalButton` padding and `Icon` size --- .../greenstash/ui/common/ExpandableCard.kt | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt index 89b83a3d..b02547f4 100644 --- a/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt +++ b/app/src/main/java/com/starry/greenstash/ui/common/ExpandableCard.kt @@ -36,6 +36,7 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape @@ -183,15 +184,22 @@ fun ExpandableTextCard( modifier = Modifier.padding(start = 12.dp, end = 12.dp) ) if (showCopyButton) { - FilledTonalButton(onClick = { - clipboardManager.setText(AnnotatedString(description)) - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) { - getString(context, R.string.info_copy_alert) - .toToast(context, Toast.LENGTH_SHORT) - } - }) { + FilledTonalButton( + onClick = { + clipboardManager.setText(AnnotatedString(description)) + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) { + getString(context, R.string.info_copy_alert) + .toToast(context, Toast.LENGTH_SHORT) + } + }, + modifier = Modifier.padding(start = 8.dp, top = 8.dp) + ) { Row { - Icon(Icons.Filled.ContentCopy, contentDescription = stringResource(R.string.info_copy_icon_description)) + Icon( + Icons.Filled.ContentCopy, + contentDescription = stringResource(R.string.info_copy_icon_description), + modifier = Modifier.size(ButtonDefaults.IconSize) + ) Spacer(Modifier.width(ButtonDefaults.IconSpacing)) Text(text = stringResource(id = R.string.info_copy_button)) }