Fix build warnings

pull/504/head
Don Turner 2 years ago
parent b00ed067a7
commit cf053ade5a

@ -27,8 +27,10 @@ class AndroidHiltConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("org.jetbrains.kotlin.kapt")
apply("dagger.hilt.android.plugin")
// KAPT must go last to avoid build warnings.
// See: https://stackoverflow.com/questions/70550883/warning-the-following-options-were-not-recognized-by-any-processor-dagger-f
apply("org.jetbrains.kotlin.kapt")
}
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")

@ -56,10 +56,10 @@ class GetSaveableNewsResourcesUseCase @Inject constructor(
}
private fun Flow<List<NewsResource>>.mapToSaveableNewsResources(
savedNewsResourceIds: Flow<Set<String>>
savedNewsResourceIdsStream: Flow<Set<String>>
): Flow<List<SaveableNewsResource>> =
filterNot { it.isEmpty() }
.combine(savedNewsResourceIds) { newsResources, savedNewsResourceIds ->
.combine(savedNewsResourceIdsStream) { newsResources, savedNewsResourceIds ->
newsResources.map { newsResource ->
SaveableNewsResource(
newsResource = newsResource,

@ -213,6 +213,7 @@ fun NewsResourceMetaData(
@Composable
fun NewsResourceLink(
@Suppress("UNUSED_PARAMETER")
newsResource: NewsResource
) {
TODO()

@ -45,7 +45,6 @@ class TopicViewModel @Inject constructor(
stringDecoder: StringDecoder,
private val userDataRepository: UserDataRepository,
topicsRepository: TopicsRepository,
// newsRepository: NewsRepository,
getSaveableNewsResources: GetSaveableNewsResourcesUseCase
) : ViewModel() {
@ -97,13 +96,13 @@ private fun topicUiState(
.map { it.followedTopics }
// Observe topic information
val topic: Flow<Topic> = topicsRepository.getTopic(
val topicStream: Flow<Topic> = topicsRepository.getTopic(
id = topicId
)
return combine(
followedTopicIds,
topic,
topicStream,
::Pair
)
.asResult()
@ -135,7 +134,7 @@ private fun newsUiState(
userDataRepository: UserDataRepository,
): Flow<NewsUiState> {
// Observe news
val news: Flow<List<SaveableNewsResource>> = getSaveableNewsResources(
val newsStream: Flow<List<SaveableNewsResource>> = getSaveableNewsResources(
filterTopicIds = setOf(element = topicId),
)
@ -144,7 +143,7 @@ private fun newsUiState(
.map { it.bookmarkedNewsResources }
return combine(
news,
newsStream,
bookmark,
::Pair
)
@ -152,7 +151,7 @@ private fun newsUiState(
.map { newsToBookmarksResult ->
when (newsToBookmarksResult) {
is Result.Success -> {
val (news, bookmarks) = newsToBookmarksResult.data
val news = newsToBookmarksResult.data.first
NewsUiState.Success(news)
}
is Result.Loading -> {

Loading…
Cancel
Save