mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 16:27:06 +05:30
common: remove broken CommentTreeColors
This commit is contained in:
parent
1620ea75fd
commit
b3fda724ad
2 changed files with 0 additions and 55 deletions
|
@ -1,14 +1,10 @@
|
||||||
package dev.msfjarvis.claw.common.comments
|
package dev.msfjarvis.claw.common.comments
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
|
||||||
import androidx.compose.foundation.layout.wrapContentHeight
|
import androidx.compose.foundation.layout.wrapContentHeight
|
||||||
import androidx.compose.material.Divider
|
import androidx.compose.material.Divider
|
||||||
import androidx.compose.material.Surface
|
import androidx.compose.material.Surface
|
||||||
|
@ -47,11 +43,8 @@ fun CommentEntry(
|
||||||
comment: Comment,
|
comment: Comment,
|
||||||
htmlToMarkdown: (html: String) -> String,
|
htmlToMarkdown: (html: String) -> String,
|
||||||
) {
|
) {
|
||||||
val indentLevel = comment.indentLevel.toInt() - 1
|
|
||||||
|
|
||||||
Divider(color = Color.Gray.copy(0.4f))
|
Divider(color = Color.Gray.copy(0.4f))
|
||||||
Row(modifier = Modifier.wrapContentHeight()) {
|
Row(modifier = Modifier.wrapContentHeight()) {
|
||||||
CommentTreeColors(indentLevel = indentLevel)
|
|
||||||
Column(modifier = Modifier.padding(start = 12.dp, end = 8.dp, top = 4.dp, bottom = 4.dp)) {
|
Column(modifier = Modifier.padding(start = 12.dp, end = 8.dp, top = 4.dp, bottom = 4.dp)) {
|
||||||
SubmitterName(
|
SubmitterName(
|
||||||
text = comment.user.username,
|
text = comment.user.username,
|
||||||
|
@ -64,21 +57,3 @@ fun CommentEntry(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun CommentTreeColors(
|
|
||||||
indentLevel: Int,
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
) {
|
|
||||||
Box(modifier = modifier) {
|
|
||||||
for (level in 1..indentLevel) {
|
|
||||||
Box(
|
|
||||||
modifier =
|
|
||||||
Modifier.padding(start = (12 + ((level - 1) * 10)).dp)
|
|
||||||
.fillMaxHeight()
|
|
||||||
.width(1.dp)
|
|
||||||
.background(CommentTreeColor[level])
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
package dev.msfjarvis.claw.common.comments
|
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
|
|
||||||
object CommentTreeColor {
|
|
||||||
private val colors =
|
|
||||||
arrayOf(
|
|
||||||
Color(0xFFFFC40D),
|
|
||||||
Color(0xFF2D89EF),
|
|
||||||
Color(0xFFB91D47),
|
|
||||||
Color(0xFF00ABA9),
|
|
||||||
Color(0xFFE3A21A),
|
|
||||||
Color(0xFF99B433),
|
|
||||||
Color(0xFF7E3878),
|
|
||||||
Color(0xFFFFB300),
|
|
||||||
Color(0xFFFFFFFF),
|
|
||||||
Color(0xFF00A300),
|
|
||||||
Color(0xFF2B5797),
|
|
||||||
Color(0xFF9F00A7),
|
|
||||||
Color(0xFF603CBA),
|
|
||||||
Color(0xFFEE1111),
|
|
||||||
Color(0xFFEFF4FF),
|
|
||||||
Color(0xFFDA532C),
|
|
||||||
Color(0xFFFF0097),
|
|
||||||
Color(0xFF1E7145),
|
|
||||||
)
|
|
||||||
val size = colors.size
|
|
||||||
|
|
||||||
operator fun get(idx: Int): Color = colors[idx % size]
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue