|
|
@ -31,8 +31,6 @@ import androidx.compose.foundation.layout.windowInsetsTopHeight
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
|
|
import androidx.compose.foundation.lazy.LazyListScope
|
|
|
|
import androidx.compose.foundation.lazy.LazyListScope
|
|
|
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
|
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
|
|
import androidx.compose.material.icons.Icons.Filled
|
|
|
|
|
|
|
|
import androidx.compose.material.icons.filled.ArrowBack
|
|
|
|
|
|
|
|
import androidx.compose.material3.Icon
|
|
|
|
import androidx.compose.material3.Icon
|
|
|
|
import androidx.compose.material3.IconButton
|
|
|
|
import androidx.compose.material3.IconButton
|
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
|
@ -51,6 +49,7 @@ import coil.compose.AsyncImage
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaBackground
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaFilterChip
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaLoadingWheel
|
|
|
|
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource
|
|
|
|
import com.google.samples.apps.nowinandroid.core.domain.model.SaveableNewsResource
|
|
|
@ -109,6 +108,7 @@ internal fun TopicScreen(
|
|
|
|
contentDesc = stringResource(id = string.topic_loading),
|
|
|
|
contentDesc = stringResource(id = string.topic_loading),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TopicUiState.Error -> TODO()
|
|
|
|
TopicUiState.Error -> TODO()
|
|
|
|
is TopicUiState.Success -> {
|
|
|
|
is TopicUiState.Success -> {
|
|
|
|
item {
|
|
|
|
item {
|
|
|
@ -186,9 +186,11 @@ private fun LazyListScope.TopicCards(
|
|
|
|
itemModifier = Modifier.padding(24.dp)
|
|
|
|
itemModifier = Modifier.padding(24.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
is NewsUiState.Loading -> item {
|
|
|
|
is NewsUiState.Loading -> item {
|
|
|
|
NiaLoadingWheel(contentDesc = "Loading news") // TODO
|
|
|
|
NiaLoadingWheel(contentDesc = "Loading news") // TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else -> item {
|
|
|
|
else -> item {
|
|
|
|
Text("Error") // TODO
|
|
|
|
Text("Error") // TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -224,7 +226,7 @@ private fun TopicToolbar(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
IconButton(onClick = { onBackClick() }) {
|
|
|
|
IconButton(onClick = { onBackClick() }) {
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = Filled.ArrowBack,
|
|
|
|
imageVector = NiaIcons.ArrowBack,
|
|
|
|
contentDescription = stringResource(
|
|
|
|
contentDescription = stringResource(
|
|
|
|
id = com.google.samples.apps.nowinandroid.core.ui.R.string.back
|
|
|
|
id = com.google.samples.apps.nowinandroid.core.ui.R.string.back
|
|
|
|
)
|
|
|
|
)
|
|
|
|