|
|
@ -25,25 +25,22 @@ import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.input.pointer.PointerEventPass
|
|
|
|
|
|
|
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
|
|
|
|
|
|
import androidx.compose.ui.platform.testTag
|
|
|
|
import androidx.compose.ui.platform.testTag
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
|
|
|
|
import kotlinx.coroutines.coroutineScope
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
fun TopicsTabContent(
|
|
|
|
fun TopicsTabContent(
|
|
|
|
topics: List<FollowableTopic>,
|
|
|
|
topics: List<FollowableTopic>,
|
|
|
|
onTopicClick: (String) -> Unit,
|
|
|
|
onTopicClick: (String) -> Unit,
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit,
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit,
|
|
|
|
modifier: Modifier = Modifier
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
LazyColumn(
|
|
|
|
LazyColumn(
|
|
|
|
modifier = modifier
|
|
|
|
modifier = modifier
|
|
|
|
.padding(horizontal = 16.dp)
|
|
|
|
.padding(horizontal = 16.dp)
|
|
|
|
.testTag("interests:topics"),
|
|
|
|
.testTag("interests:topics"),
|
|
|
|
contentPadding = PaddingValues(top = 8.dp)
|
|
|
|
contentPadding = PaddingValues(top = 8.dp),
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
topics.forEach { followableTopic ->
|
|
|
|
topics.forEach { followableTopic ->
|
|
|
|
val topicId = followableTopic.topic.id
|
|
|
|
val topicId = followableTopic.topic.id
|
|
|
@ -54,7 +51,7 @@ fun TopicsTabContent(
|
|
|
|
description = followableTopic.topic.shortDescription,
|
|
|
|
description = followableTopic.topic.shortDescription,
|
|
|
|
topicImageUrl = followableTopic.topic.imageUrl,
|
|
|
|
topicImageUrl = followableTopic.topic.imageUrl,
|
|
|
|
onClick = { onTopicClick(topicId) },
|
|
|
|
onClick = { onTopicClick(topicId) },
|
|
|
|
onFollowButtonClick = { onFollowButtonClick(topicId, it) }
|
|
|
|
onFollowButtonClick = { onFollowButtonClick(topicId, it) },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|