Skip to content

Commit

Permalink
Adjust spacers
Browse files Browse the repository at this point in the history
  • Loading branch information
yasanglass committed Mar 10, 2024
1 parent 6e68ac8 commit 4050858
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package glass.yasan.concrete.component

import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
Expand All @@ -24,7 +22,7 @@ public fun Spacer(
}

@Composable
public fun RowScope.Spacer(
public fun SpacerHorizontal(
width: Dp,
modifier: Modifier = Modifier,
) {
Expand All @@ -36,7 +34,7 @@ public fun RowScope.Spacer(
}

@Composable
public fun ColumnScope.Spacer(
public fun SpacerVertical(
height: Dp,
modifier: Modifier = Modifier,
) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package glass.yasan.concrete.component

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp

@Composable
public fun SpacerVertical(
height: Dp,
) {
Spacer(
width = 0.dp,
height = height,
)
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
package glass.yasan.concrete.component.extension

import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import glass.yasan.concrete.component.Spacer
import glass.yasan.concrete.component.SpacerHorizontal
import glass.yasan.concrete.component.SpacerVertical

@Composable
public fun RowScope.Spacer(
width: Dp,
modifier: Modifier = Modifier,
) {
Spacer(
width = width,
height = 0.dp,
modifier = modifier,
)
}

@Composable
public fun ColumnScope.Spacer(
height: Dp,
modifier: Modifier = Modifier,
) {
Spacer(
width = 0.dp,
height = height,
modifier = modifier,
)
}

public fun LazyListScope.spacer(
width: Dp,
height: Dp,
Expand Down Expand Up @@ -36,4 +65,4 @@ public fun LazyListScope.spacerVertical(
height = height,
)
}
}
}

0 comments on commit 4050858

Please sign in to comment.