Skip to content

Commit

Permalink
Replace Spacers with the horizontalArrangement parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Jun 23, 2024
1 parent 9af8756 commit e9a4ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
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.shape.CircleShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -76,7 +74,8 @@ fun Comment(comment: CommentsInfoItem) {
modifier = Modifier
.fillMaxWidth()
.clickable { isExpanded = !isExpanded }
.padding(all = 8.dp)
.padding(all = 8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
if (ImageStrategy.shouldLoadImages()) {
AsyncImage(
Expand All @@ -95,8 +94,6 @@ fun Comment(comment: CommentsInfoItem) {
)
}

Spacer(modifier = Modifier.width(8.dp))

Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
Row(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
if (comment.isPinned) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
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.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -42,6 +40,7 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
Column(modifier = Modifier.padding(all = 8.dp)) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Row(
Expand All @@ -53,6 +52,7 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
comment
)
},
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically
) {
if (ImageStrategy.shouldLoadImages()) {
Expand All @@ -67,8 +67,6 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
)
}

Spacer(modifier = Modifier.width(8.dp))

Column {
Text(text = comment.uploaderName)

Expand All @@ -82,8 +80,6 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
}
}

Spacer(modifier = Modifier.weight(1f))

Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically
Expand Down

0 comments on commit e9a4ae8

Please sign in to comment.