-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My shiny feature #4 #5
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block contains the main structure of the UI components. It looks good and follows best practices. |
||
package com.google.samples.apps.nowinandroid.ui | ||
|
||
import android.util.Log | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.WindowInsets | ||
|
@@ -147,6 +148,10 @@ internal fun NiaApp( | |
) | ||
} | ||
|
||
LaunchedEffect(Unit) { | ||
Log.e("#####","info message - App UI") | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
NiaNavigationSuiteScaffold( | ||
navigationSuiteItems = { | ||
appState.topLevelDestinations.forEach { destination -> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import com.google.samples.apps.nowinandroid.core.data.repository.SearchContentsR | |
import com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository | ||
import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic | ||
import com.google.samples.apps.nowinandroid.core.model.data.SearchResult | ||
import com.google.samples.apps.nowinandroid.core.model.data.Topic | ||
import com.google.samples.apps.nowinandroid.core.model.data.UserData | ||
import com.google.samples.apps.nowinandroid.core.model.data.UserNewsResource | ||
import com.google.samples.apps.nowinandroid.core.model.data.UserSearchResult | ||
|
@@ -45,11 +46,14 @@ class GetSearchContentsUseCase @Inject constructor( | |
private fun Flow<SearchResult>.mapToUserSearchResult(userDataStream: Flow<UserData>): Flow<UserSearchResult> = | ||
combine(userDataStream) { searchResult, userData -> | ||
UserSearchResult( | ||
topics = searchResult.topics.map { topic -> | ||
FollowableTopic( | ||
topic = topic, | ||
isFollowed = topic.id in userData.followedTopics, | ||
) | ||
topics = when (searchResult.topics.size) { | ||
0 -> emptyList() | ||
else -> searchResult.topics.map { topic -> | ||
FollowableTopic( | ||
topic = topic, | ||
isFollowed = topic.id in userData.followedTopics, | ||
) | ||
} | ||
}, | ||
newsResources = searchResult.newsResources.map { news -> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function |
||
UserNewsResource( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
lateinit
for_context
is not ideal because it doesn't enforce non-nullability at compile time. Consider using a nullable property or providing a default value.