Add ButtonDefaults that replaces the Material 2 one to allow changes of PaddingValues

This commit is contained in:
Wolf Montwé 2023-03-31 18:13:55 +02:00
parent eb1ffa0c7a
commit 216350ae63
No known key found for this signature in database
GPG key ID: 6D45B21512ACBF72
4 changed files with 16 additions and 3 deletions

View file

@ -15,7 +15,7 @@ fun Button(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
contentPadding: PaddingValues = buttonContentPadding(),
) {
MaterialButton(
onClick = onClick,

View file

@ -0,0 +1,13 @@
package app.k9mail.core.ui.compose.designsystem.atom.button
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.runtime.Composable
import app.k9mail.core.ui.compose.theme.MainTheme
@Composable
fun buttonContentPadding(): PaddingValues = PaddingValues(
start = MainTheme.spacings.quadruple,
top = MainTheme.spacings.default,
end = MainTheme.spacings.quadruple,
bottom = MainTheme.spacings.default,
)

View file

@ -18,7 +18,7 @@ fun ButtonOutlined(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
contentPadding: PaddingValues = buttonContentPadding(),
) {
MaterialOutlinedButton(
onClick = onClick,

View file

@ -15,7 +15,7 @@ fun ButtonText(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
contentPadding: PaddingValues = buttonContentPadding(),
) {
MaterialTextButton(
onClick = onClick,