|
|
@ -95,7 +95,7 @@ internal fun SearchRoute(
|
|
|
|
onInterestsClick = onInterestsClick,
|
|
|
|
onInterestsClick = onInterestsClick,
|
|
|
|
onSearchQueryChanged = searchViewModel::onSearchQueryChanged,
|
|
|
|
onSearchQueryChanged = searchViewModel::onSearchQueryChanged,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
onNewsResourcesCheckedChanged = forYouViewModel::updateNewsResourceSaved
|
|
|
|
onNewsResourcesCheckedChanged = forYouViewModel::updateNewsResourceSaved,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -103,9 +103,9 @@ internal fun SearchRoute(
|
|
|
|
internal fun SearchScreen(
|
|
|
|
internal fun SearchScreen(
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
onBackClick: () -> Unit = {},
|
|
|
|
onBackClick: () -> Unit = {},
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit = {_, _ -> },
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit = { _, _ -> },
|
|
|
|
onInterestsClick: () -> Unit = {},
|
|
|
|
onInterestsClick: () -> Unit = {},
|
|
|
|
onNewsResourcesCheckedChanged: (String, Boolean) -> Unit = {_, _ -> },
|
|
|
|
onNewsResourcesCheckedChanged: (String, Boolean) -> Unit = { _, _ -> },
|
|
|
|
onSearchQueryChanged: (String) -> Unit = {},
|
|
|
|
onSearchQueryChanged: (String) -> Unit = {},
|
|
|
|
onTopicClick: (String) -> Unit = {},
|
|
|
|
onTopicClick: (String) -> Unit = {},
|
|
|
|
uiState: SearchResultUiState = SearchResultUiState.Loading,
|
|
|
|
uiState: SearchResultUiState = SearchResultUiState.Loading,
|
|
|
@ -192,7 +192,6 @@ fun EmptySearchResultBody(
|
|
|
|
onInterestsClick()
|
|
|
|
onInterestsClick()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -201,8 +200,8 @@ private fun SearchResultBody(
|
|
|
|
topics: List<FollowableTopic>,
|
|
|
|
topics: List<FollowableTopic>,
|
|
|
|
newsResources: List<UserNewsResource>,
|
|
|
|
newsResources: List<UserNewsResource>,
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit,
|
|
|
|
onFollowButtonClick: (String, Boolean) -> Unit,
|
|
|
|
onNewsResourcesCheckedChanged: (String, Boolean) -> Unit = {_, _ -> },
|
|
|
|
onNewsResourcesCheckedChanged: (String, Boolean) -> Unit = { _, _ -> },
|
|
|
|
onTopicClick: (String) -> Unit = {}
|
|
|
|
onTopicClick: (String) -> Unit = {},
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (topics.isNotEmpty()) {
|
|
|
|
if (topics.isNotEmpty()) {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
@ -217,7 +216,7 @@ private fun SearchResultBody(
|
|
|
|
topics = topics,
|
|
|
|
topics = topics,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
onFollowButtonClick = onFollowButtonClick,
|
|
|
|
onFollowButtonClick = onFollowButtonClick,
|
|
|
|
withBottomSpacer = false
|
|
|
|
withBottomSpacer = false,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -246,7 +245,7 @@ private fun SearchResultBody(
|
|
|
|
newsFeed(
|
|
|
|
newsFeed(
|
|
|
|
feedState = NewsFeedUiState.Success(feed = newsResources),
|
|
|
|
feedState = NewsFeedUiState.Success(feed = newsResources),
|
|
|
|
onNewsResourcesCheckedChanged = onNewsResourcesCheckedChanged,
|
|
|
|
onNewsResourcesCheckedChanged = onNewsResourcesCheckedChanged,
|
|
|
|
onTopicClick = onTopicClick
|
|
|
|
onTopicClick = onTopicClick,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -347,7 +346,7 @@ private fun EmptySearchResultColumnPreview() {
|
|
|
|
@DevicePreviews
|
|
|
|
@DevicePreviews
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|
private fun SearchScreenPreview(
|
|
|
|
private fun SearchScreenPreview(
|
|
|
|
@PreviewParameter(SearchResultUiStatePreviewParameterProvider::class)
|
|
|
|
@PreviewParameter(SearchUiStatePreviewParameterProvider::class)
|
|
|
|
searchResultUiState: SearchResultUiState,
|
|
|
|
searchResultUiState: SearchResultUiState,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
NiaTheme {
|
|
|
|
NiaTheme {
|
|
|
|