Add ButtonDefaults that replaces the Material 2 one to allow changes of PaddingValues
This commit is contained in:
parent
eb1ffa0c7a
commit
216350ae63
4 changed files with 16 additions and 3 deletions
|
@ -15,7 +15,7 @@ fun Button(
|
|||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
|
||||
contentPadding: PaddingValues = buttonContentPadding(),
|
||||
) {
|
||||
MaterialButton(
|
||||
onClick = onClick,
|
||||
|
|
|
@ -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,
|
||||
)
|
|
@ -18,7 +18,7 @@ fun ButtonOutlined(
|
|||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
|
||||
contentPadding: PaddingValues = buttonContentPadding(),
|
||||
) {
|
||||
MaterialOutlinedButton(
|
||||
onClick = onClick,
|
||||
|
|
|
@ -15,7 +15,7 @@ fun ButtonText(
|
|||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
|
||||
contentPadding: PaddingValues = buttonContentPadding(),
|
||||
) {
|
||||
MaterialTextButton(
|
||||
onClick = onClick,
|
||||
|
|
Loading…
Reference in a new issue