Convert the interests list to a grid

Change-Id: I9c65ce6bb87958ff8f266743eedfdd8387b7c36d
feature/adaptive_scaffold
Miłosz Moczkowski 2 years ago
parent d91c1f44a3
commit f6c2cd9a10

@ -19,10 +19,11 @@ package com.google.samples.apps.nowinandroid.feature.interests
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
@ -37,11 +38,12 @@ fun TopicsTabContent(
modifier: Modifier = Modifier,
withBottomSpacer: Boolean = true,
) {
LazyColumn(
LazyVerticalGrid(
columns = GridCells.Adaptive(300.dp),
modifier = modifier
.padding(horizontal = 24.dp)
.selectableGroup()
.testTag("interests:topics"),
contentPadding = PaddingValues(vertical = 16.dp),
contentPadding = PaddingValues(horizontal = 16.dp),
) {
topics.forEach { followableTopic ->
val topicId = followableTopic.topic.id

Loading…
Cancel
Save