mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 23:47:02 +05:30
Revert "app: use ConstraintLayout for laying out LobstersItem"
Won't solve the problem I was hoping to solve.
This reverts commit a14484583d
.
This commit is contained in:
parent
8462e5c763
commit
b30ab6a537
1 changed files with 5 additions and 13 deletions
|
@ -6,7 +6,7 @@ import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.ConstraintLayout
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.LazyColumnFor
|
import androidx.compose.foundation.lazy.LazyColumnFor
|
||||||
|
@ -33,21 +33,15 @@ fun LazyItemScope.LobstersItem(
|
||||||
.fillParentMaxWidth()
|
.fillParentMaxWidth()
|
||||||
.clickable(onClick = { onClick.invoke(post) }),
|
.clickable(onClick = { onClick.invoke(post) }),
|
||||||
text = {
|
text = {
|
||||||
ConstraintLayout {
|
Column {
|
||||||
val (title, tags, submitter) = createRefs()
|
|
||||||
Text(
|
Text(
|
||||||
text = post.title,
|
text = post.title,
|
||||||
color = Color(0xFF7395D9),
|
color = Color(0xFF7395D9),
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.padding(top = 4.dp).constrainAs(title) {
|
modifier = Modifier.padding(top = 4.dp)
|
||||||
top.linkTo(parent.top)
|
|
||||||
start.linkTo(parent.start)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(vertical = 8.dp).constrainAs(tags) {
|
modifier = Modifier.padding(vertical = 8.dp),
|
||||||
top.linkTo(title.bottom)
|
|
||||||
},
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
post.tags.forEach { tag ->
|
post.tags.forEach { tag ->
|
||||||
|
@ -63,9 +57,7 @@ fun LazyItemScope.LobstersItem(
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
text = "submitted by ${post.submitterUser.username}",
|
text = "submitted by ${post.submitterUser.username}",
|
||||||
modifier = Modifier.padding(bottom = 4.dp).constrainAs(submitter) {
|
modifier = Modifier.padding(bottom = 4.dp),
|
||||||
top.linkTo(tags.bottom)
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue