Skip to content

Commit

Permalink
Fix FilledTonalButton padding and Icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
mrghosti3 committed Apr 7, 2024
1 parent d121651 commit bef4962
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit bef4962

Please sign in to comment.