A cheap attempt at a native Bluesky client for Android

ShowSkeets: Add divider to separate root post replies

Add a `HorizontalDivider` below skeets in a thread view that are direct replies to the root post.

+18 -1
+16
app/src/main/java/industries/geesawra/monarch/ShowSkeets.kt
··· 2 2 3 3 import androidx.compose.foundation.layout.Arrangement 4 4 import androidx.compose.foundation.layout.fillMaxSize 5 + import androidx.compose.foundation.layout.fillMaxWidth 5 6 import androidx.compose.foundation.layout.height 6 7 import androidx.compose.foundation.layout.padding 7 8 import androidx.compose.foundation.lazy.LazyColumn ··· 10 11 import androidx.compose.foundation.lazy.rememberLazyListState 11 12 import androidx.compose.foundation.shape.RoundedCornerShape 12 13 import androidx.compose.material3.Card 14 + import androidx.compose.material3.HorizontalDivider 13 15 import androidx.compose.material3.VerticalDivider 14 16 import androidx.compose.runtime.Composable 15 17 import androidx.compose.runtime.LaunchedEffect ··· 124 126 } 125 127 } 126 128 ) 129 + } 130 + 131 + if (isShowingThread) { 132 + if (idx + 1 >= data.lastIndex) { 133 + return@itemsIndexed 134 + } 135 + if (data[idx + 1].isReplyToRoot) { 136 + HorizontalDivider( 137 + thickness = 2.dp, 138 + modifier = Modifier 139 + .fillMaxWidth() 140 + .padding(top = 16.dp) 141 + ) 142 + } 127 143 } 128 144 } 129 145 }
+2 -1
app/src/main/java/industries/geesawra/monarch/datalayer/Models.kt
··· 81 81 82 82 data class SkeetData( 83 83 val nestingLevel: Int = 0, 84 + val isReplyToRoot: Boolean = false, 84 85 val likes: Long? = null, 85 86 val reposts: Long? = null, 86 87 val replies: Long? = null, ··· 637 638 ) { 638 639 fun flatten(): List<SkeetData> { 639 640 val list = mutableListOf<SkeetData>() 640 - list.add(post.copy(nestingLevel = level)) 641 + list.add(post.copy(nestingLevel = level, isReplyToRoot = level == 1)) 641 642 replies.forEach { reply -> 642 643 list.addAll(reply.flatten()) 643 644 }