mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 19:07:02 +05:30
app: switch to FlowLayout for TagRow
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
08adc87493
commit
607e93e180
3 changed files with 7 additions and 3 deletions
|
@ -53,6 +53,7 @@ dependencies {
|
|||
implementation(Dependencies.AndroidX.Lifecycle.viewmodelKtx)
|
||||
implementation(Dependencies.Kotlin.Coroutines.android)
|
||||
implementation(Dependencies.ThirdParty.accompanist)
|
||||
implementation(Dependencies.ThirdParty.composeFlowLayout)
|
||||
implementation(Dependencies.ThirdParty.Moshi.lib)
|
||||
implementation(Dependencies.ThirdParty.Retrofit.moshi)
|
||||
implementation(Dependencies.ThirdParty.SQLDelight.androidDriver)
|
||||
|
|
|
@ -30,6 +30,7 @@ import androidx.compose.ui.text.font.FontWeight
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.star_zero.compose.flowlayout.FlowLayout
|
||||
import dev.chrisbanes.accompanist.coil.CoilImage
|
||||
import dev.msfjarvis.lobsters.R
|
||||
import dev.msfjarvis.lobsters.data.api.LobstersApi
|
||||
|
@ -131,11 +132,12 @@ fun TagRow(
|
|||
tags: List<String>,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Row(
|
||||
FlowLayout(
|
||||
modifier = Modifier.then(modifier),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalSpacing = 8.dp,
|
||||
verticalSpacing = 8.dp,
|
||||
) {
|
||||
tags.take(3).forEach { tag ->
|
||||
tags.forEach { tag ->
|
||||
Text(
|
||||
text = tag,
|
||||
modifier = Modifier
|
||||
|
|
|
@ -66,6 +66,7 @@ object Dependencies {
|
|||
object ThirdParty {
|
||||
|
||||
const val accompanist = "dev.chrisbanes.accompanist:accompanist-coil:0.6.1"
|
||||
const val composeFlowLayout = "com.star-zero:compose-flowlayout:0.0.1"
|
||||
|
||||
object Moshi {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue