Skip to content

Commit

Permalink
DisplaySection horizontalAlignment
Browse files Browse the repository at this point in the history
  • Loading branch information
baec23 committed Jan 25, 2023
1 parent 124c69e commit f8738aa
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowForward
Expand Down Expand Up @@ -43,6 +42,7 @@ fun DisplaySection(
headerSubtextStyle: TextStyle = MaterialTheme.typography.titleSmall,
headerIconColor: Color = MaterialTheme.colorScheme.primary,
dividerColor: Color = MaterialTheme.colorScheme.primary,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
contentSpacing: Dp = 12.dp,
contentPadding: PaddingValues = PaddingValues(horizontal = 8.dp, vertical = 16.dp),
content: @Composable ColumnScope.() -> Unit
Expand Down Expand Up @@ -76,9 +76,9 @@ fun DisplaySection(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(contentPadding)
.align(Alignment.CenterHorizontally),
verticalArrangement = Arrangement.spacedBy(contentSpacing)
.padding(contentPadding),
verticalArrangement = Arrangement.spacedBy(contentSpacing),
horizontalAlignment = horizontalAlignment
) {
content()
}
Expand All @@ -97,6 +97,7 @@ fun ExpandableDisplaySection(
headerSubtextStyle: TextStyle = MaterialTheme.typography.titleSmall,
headerIconColor: Color = MaterialTheme.colorScheme.primary,
dividerColor: Color = MaterialTheme.colorScheme.primary,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
contentSpacing: Dp = 12.dp,
contentPadding: PaddingValues = PaddingValues(horizontal = 8.dp, vertical = 16.dp),
content: @Composable ColumnScope.() -> Unit
Expand Down Expand Up @@ -155,9 +156,9 @@ fun ExpandableDisplaySection(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(contentPadding)
.align(Alignment.CenterHorizontally),
verticalArrangement = Arrangement.spacedBy(contentSpacing)
.padding(contentPadding),
verticalArrangement = Arrangement.spacedBy(contentSpacing),
horizontalAlignment = horizontalAlignment
) {
content()
}
Expand Down

0 comments on commit f8738aa

Please sign in to comment.