diff --git a/app/README.md b/app/README.md index cbcdc35be8..b0cf666dbe 100644 --- a/app/README.md +++ b/app/README.md @@ -11,42 +11,19 @@ config: nodePlacementStrategy: SIMPLE --- graph TB - subgraph :feature - direction TB - subgraph :feature:settings - direction TB - :feature:settings:impl[impl]:::android-library - end - subgraph :feature:foryou - direction TB - :feature:foryou:api[api]:::android-library - :feature:foryou:impl[impl]:::android-library - end - subgraph :feature:bookmarks - direction TB - :feature:bookmarks:api[api]:::android-library - :feature:bookmarks:impl[impl]:::android-library - end - subgraph :feature:search - direction TB - :feature:search:api[api]:::android-library - :feature:search:impl[impl]:::android-library - end - subgraph :feature:interests - direction TB - :feature:interests:api[api]:::android-library - :feature:interests:impl[impl]:::android-library - end - subgraph :feature:topic - direction TB - :feature:topic:api[api]:::android-library - :feature:topic:impl[impl]:::android-library - end - end subgraph :sync direction TB :sync:work[work]:::android-library end + subgraph :feature + direction TB + :feature:bookmarks[bookmarks]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:search[search]:::android-feature + :feature:settings[settings]:::android-feature + :feature:topic[topic]:::android-feature + end subgraph :core direction TB :core:analytics[analytics]:::android-library @@ -63,6 +40,7 @@ graph TB :core:notifications[notifications]:::android-library :core:ui[ui]:::android-library end + :navigation[navigation]:::android-library :benchmarks[benchmarks]:::android-test :app[app]:::android-application @@ -72,18 +50,10 @@ graph TB :app -.-> :core:data :app -.-> :core:designsystem :app -.-> :core:model + :app -.-> :core:navigation :app -.-> :core:ui - :app -.-> :feature:bookmarks:api - :app -.-> :feature:bookmarks:impl - :app -.-> :feature:foryou:api - :app -.-> :feature:foryou:impl - :app -.-> :feature:interests:api - :app -.-> :feature:interests:impl - :app -.-> :feature:search:api - :app -.-> :feature:search:impl - :app -.-> :feature:settings:impl - :app -.-> :feature:topic:api - :app -.-> :feature:topic:impl + :app -.-> :feature:settings + :app -.-> :navigation :app -.-> :sync:work :benchmarks -.->|testedApks| :app :core:data -.-> :core:analytics @@ -105,43 +75,35 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:bookmarks:api --> :core:navigation - :feature:bookmarks:impl -.-> :core:data - :feature:bookmarks:impl -.-> :core:designsystem - :feature:bookmarks:impl -.-> :core:ui - :feature:bookmarks:impl -.-> :feature:bookmarks:api - :feature:bookmarks:impl -.-> :feature:topic:api - :feature:foryou:api --> :core:navigation - :feature:foryou:impl -.-> :core:designsystem - :feature:foryou:impl -.-> :core:domain - :feature:foryou:impl -.-> :core:notifications - :feature:foryou:impl -.-> :core:ui - :feature:foryou:impl -.-> :feature:foryou:api - :feature:foryou:impl -.-> :feature:topic:api - :feature:interests:api --> :core:navigation - :feature:interests:impl -.-> :core:designsystem - :feature:interests:impl -.-> :core:domain - :feature:interests:impl -.-> :core:ui - :feature:interests:impl -.-> :feature:interests:api - :feature:interests:impl -.-> :feature:topic:api - :feature:search:api -.-> :core:domain - :feature:search:api --> :core:navigation - :feature:search:impl -.-> :core:designsystem - :feature:search:impl -.-> :core:domain - :feature:search:impl -.-> :core:ui - :feature:search:impl -.-> :feature:interests:api - :feature:search:impl -.-> :feature:search:api - :feature:search:impl -.-> :feature:topic:api - :feature:settings:impl -.-> :core:data - :feature:settings:impl -.-> :core:designsystem - :feature:settings:impl -.-> :core:ui - :feature:topic:api -.-> :core:designsystem - :feature:topic:api --> :core:navigation - :feature:topic:api -.-> :core:ui - :feature:topic:impl -.-> :core:data - :feature:topic:impl -.-> :core:designsystem - :feature:topic:impl -.-> :core:ui - :feature:topic:impl -.-> :feature:topic:api + :feature:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:bookmarks -.-> :feature:topic + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :core:ui + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui + :navigation -.-> :core:designsystem + :navigation -.-> :core:model + :navigation -.-> :core:navigation + :navigation -.-> :feature:bookmarks + :navigation -.-> :feature:foryou + :navigation -.-> :feature:interests + :navigation -.-> :feature:search + :navigation -.-> :feature:settings + :navigation -.-> :feature:topic :sync:work -.-> :core:analytics :sync:work -.-> :core:data :sync:work -.-> :core:notifications diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2f02539435..0f1f9c0430 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -35,7 +35,8 @@ android { versionName = "0.1.2" // X.Y.Z; X = Major, Y = minor, Z = Patch level // Custom test runner to set up Hilt dependency graph - testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + testInstrumentationRunner = + "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" } buildTypes { @@ -46,8 +47,10 @@ android { isMinifyEnabled = providers.gradleProperty("minifyWithR8") .map(String::toBooleanStrict).getOrElse(true) applicationIdSuffix = NiaBuildType.RELEASE.applicationIdSuffix - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro") + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) // To publish on the Play store a private signing key is required, but to allow anyone // who clones the code to sign and run the release variant, use the debug signing key. @@ -68,17 +71,8 @@ android { } dependencies { - implementation(projects.feature.interests.api) - implementation(projects.feature.interests.impl) - implementation(projects.feature.foryou.api) - implementation(projects.feature.foryou.impl) - implementation(projects.feature.bookmarks.api) - implementation(projects.feature.bookmarks.impl) - implementation(projects.feature.topic.api) - implementation(projects.feature.topic.impl) - implementation(projects.feature.search.api) - implementation(projects.feature.search.impl) - implementation(projects.feature.settings.impl) + implementation(projects.navigation) + implementation(projects.feature.settings) implementation(projects.core.common) implementation(projects.core.ui) @@ -86,6 +80,7 @@ dependencies { implementation(projects.core.data) implementation(projects.core.model) implementation(projects.core.analytics) + implementation(projects.core.navigation) implementation(projects.sync.work) implementation(libs.androidx.activity.compose) @@ -115,6 +110,11 @@ dependencies { kspTest(libs.hilt.compiler) + testImplementation(projects.feature.interests) + testImplementation(projects.feature.foryou) + testImplementation(projects.feature.bookmarks) + testImplementation(projects.feature.topic) + testImplementation(projects.feature.search) testImplementation(projects.core.dataTest) testImplementation(projects.core.datastoreTest) testImplementation(libs.hilt.android.testing) @@ -130,6 +130,12 @@ dependencies { androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.dataTest) androidTestImplementation(projects.core.datastoreTest) + androidTestImplementation(projects.feature.interests) + androidTestImplementation(projects.feature.foryou) + androidTestImplementation(projects.feature.bookmarks) + androidTestImplementation(projects.feature.topic) + androidTestImplementation(projects.feature.search) + androidTestImplementation(libs.androidx.test.espresso.core) androidTestImplementation(libs.androidx.compose.ui.test) androidTestImplementation(libs.hilt.android.testing) diff --git a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt index c0eba5fd31..b931c4d702 100644 --- a/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt +++ b/app/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/ui/NavigationTest.kt @@ -40,7 +40,7 @@ import com.google.samples.apps.nowinandroid.core.data.repository.NewsRepository import com.google.samples.apps.nowinandroid.core.data.repository.TopicsRepository import com.google.samples.apps.nowinandroid.core.model.data.Topic import com.google.samples.apps.nowinandroid.core.rules.GrantPostNotificationsPermissionRule -import com.google.samples.apps.nowinandroid.feature.interests.impl.LIST_PANE_TEST_TAG +import com.google.samples.apps.nowinandroid.feature.interests.LIST_PANE_TEST_TAG import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest import kotlinx.coroutines.flow.first @@ -50,10 +50,10 @@ import org.junit.Ignore import org.junit.Rule import org.junit.Test import javax.inject.Inject -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.R as BookmarksR -import com.google.samples.apps.nowinandroid.feature.foryou.api.R as FeatureForyouR -import com.google.samples.apps.nowinandroid.feature.search.api.R as FeatureSearchR -import com.google.samples.apps.nowinandroid.feature.settings.impl.R as SettingsR +import com.google.samples.apps.nowinandroid.feature.bookmarks.R as BookmarksR +import com.google.samples.apps.nowinandroid.feature.foryou.R as FeatureForyouR +import com.google.samples.apps.nowinandroid.feature.search.R as FeatureSearchR +import com.google.samples.apps.nowinandroid.feature.settings.R as SettingsR /** * Tests all the navigation flows that are handled by the navigation library. diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt index bfaa27fa62..1ef7850ed4 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaApp.kt @@ -74,17 +74,17 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.GradientColo import com.google.samples.apps.nowinandroid.core.designsystem.theme.LocalGradientColors import com.google.samples.apps.nowinandroid.core.navigation.Navigator import com.google.samples.apps.nowinandroid.core.navigation.toEntries -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.navigation.LocalSnackbarHostState -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.navigation.bookmarksEntry -import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouNavKey -import com.google.samples.apps.nowinandroid.feature.foryou.impl.navigation.forYouEntry -import com.google.samples.apps.nowinandroid.feature.interests.impl.navigation.interestsEntry -import com.google.samples.apps.nowinandroid.feature.search.api.navigation.SearchNavKey -import com.google.samples.apps.nowinandroid.feature.search.impl.navigation.searchEntry -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsDialog -import com.google.samples.apps.nowinandroid.feature.topic.impl.navigation.topicEntry +import com.google.samples.apps.nowinandroid.feature.settings.SettingsDialog import com.google.samples.apps.nowinandroid.navigation.TOP_LEVEL_NAV_ITEMS -import com.google.samples.apps.nowinandroid.feature.settings.impl.R as settingsR +import com.google.samples.apps.nowinandroid.navigation.bookmarks.LocalSnackbarHostState +import com.google.samples.apps.nowinandroid.navigation.bookmarks.bookmarksEntry +import com.google.samples.apps.nowinandroid.navigation.foryou.forYouEntry +import com.google.samples.apps.nowinandroid.navigation.interests.interestsEntry +import com.google.samples.apps.nowinandroid.navigation.navigateToSearch +import com.google.samples.apps.nowinandroid.navigation.search.searchEntry +import com.google.samples.apps.nowinandroid.navigation.shouldShowGradientBackground +import com.google.samples.apps.nowinandroid.navigation.topic.topicEntry +import com.google.samples.apps.nowinandroid.feature.settings.R as settingsR @Composable fun NiaApp( @@ -92,7 +92,7 @@ fun NiaApp( modifier: Modifier = Modifier, windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo(), ) { - val shouldShowGradientBackground = appState.navigationState.currentTopLevelKey == ForYouNavKey + val shouldShowGradientBackground = appState.navigationState.shouldShowGradientBackground() var showSettingsDialog by rememberSaveable { mutableStateOf(false) } NiaBackground(modifier = modifier) { @@ -223,8 +223,9 @@ internal fun NiaApp( if (appState.navigationState.currentKey in appState.navigationState.topLevelKeys) { shouldShowTopAppBar = true - val destination = TOP_LEVEL_NAV_ITEMS[appState.navigationState.currentTopLevelKey] - ?: error("Top level nav item not found for ${appState.navigationState.currentTopLevelKey}") + val destination = + TOP_LEVEL_NAV_ITEMS[appState.navigationState.currentTopLevelKey] + ?: error("Top level nav item not found for ${appState.navigationState.currentTopLevelKey}") NiaTopAppBar( titleRes = destination.titleTextId, @@ -240,7 +241,7 @@ internal fun NiaApp( containerColor = Color.Transparent, ), onActionClick = { onTopAppBarActionClick() }, - onNavigationClick = { navigator.navigate(SearchNavKey) }, + onNavigationClick = { navigator.navigateToSearch() }, ) } @@ -257,11 +258,11 @@ internal fun NiaApp( val listDetailStrategy = rememberListDetailSceneStrategy() val entryProvider = entryProvider { - forYouEntry(navigator) - bookmarksEntry(navigator) - interestsEntry(navigator) - topicEntry(navigator) - searchEntry(navigator) + forYouEntry(navigator = navigator) + bookmarksEntry(navigator = navigator) + interestsEntry(navigator = navigator) + topicEntry(navigator = navigator) + searchEntry(navigator = navigator) } NavDisplay( diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppState.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppState.kt index 9b48149806..1ae0ee15aa 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppState.kt +++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppState.kt @@ -25,11 +25,9 @@ import com.google.samples.apps.nowinandroid.core.data.repository.UserNewsResourc import com.google.samples.apps.nowinandroid.core.data.util.NetworkMonitor import com.google.samples.apps.nowinandroid.core.data.util.TimeZoneMonitor import com.google.samples.apps.nowinandroid.core.navigation.NavigationState -import com.google.samples.apps.nowinandroid.core.navigation.rememberNavigationState import com.google.samples.apps.nowinandroid.core.ui.TrackDisposableJank -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksNavKey -import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouNavKey -import com.google.samples.apps.nowinandroid.navigation.TOP_LEVEL_NAV_ITEMS +import com.google.samples.apps.nowinandroid.navigation.getNavigationState +import com.google.samples.apps.nowinandroid.navigation.getTopLevelNavKeysWithUnreadResources import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow @@ -45,7 +43,7 @@ fun rememberNiaAppState( timeZoneMonitor: TimeZoneMonitor, coroutineScope: CoroutineScope = rememberCoroutineScope(), ): NiaAppState { - val navigationState = rememberNavigationState(ForYouNavKey, TOP_LEVEL_NAV_ITEMS.keys) + val navigationState = getNavigationState() NavigationTrackingSideEffect(navigationState) @@ -88,10 +86,7 @@ class NiaAppState( val topLevelNavKeysWithUnreadResources: StateFlow> = userNewsResourceRepository.observeAllForFollowedTopics() .combine(userNewsResourceRepository.observeAllBookmarked()) { forYouNewsResources, bookmarkedNewsResources -> - setOfNotNull( - ForYouNavKey.takeIf { forYouNewsResources.any { !it.hasBeenViewed } }, - BookmarksNavKey.takeIf { bookmarkedNewsResources.any { !it.hasBeenViewed } }, - ) + getTopLevelNavKeysWithUnreadResources(forYouNewsResources, bookmarkedNewsResources) } .stateIn( coroutineScope, diff --git a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppStateTest.kt b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppStateTest.kt index 810b77cf01..390c46cbb8 100644 --- a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppStateTest.kt +++ b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/NiaAppStateTest.kt @@ -26,9 +26,9 @@ import com.google.samples.apps.nowinandroid.core.testing.repository.TestNewsRepo import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository import com.google.samples.apps.nowinandroid.core.testing.util.TestNetworkMonitor import com.google.samples.apps.nowinandroid.core.testing.util.TestTimeZoneMonitor -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksNavKey -import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouNavKey -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.feature.bookmarks.navigation.BookmarksNavKey +import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouNavKey +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey import dagger.hilt.android.testing.HiltAndroidTest import dagger.hilt.android.testing.HiltTestApplication import kotlinx.coroutines.flow.collect diff --git a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarInsetsScreenshotTests.kt b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarInsetsScreenshotTests.kt index 3c76101933..3782ae2fcd 100644 --- a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarInsetsScreenshotTests.kt +++ b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarInsetsScreenshotTests.kt @@ -67,7 +67,7 @@ import com.google.samples.apps.nowinandroid.core.data.util.NetworkMonitor import com.google.samples.apps.nowinandroid.core.data.util.TimeZoneMonitor import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme import com.google.samples.apps.nowinandroid.core.testing.util.DefaultRoborazziOptions -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.navigation.LocalSnackbarHostState +import com.google.samples.apps.nowinandroid.navigation.bookmarks.LocalSnackbarHostState import com.google.samples.apps.nowinandroid.uitesthiltmanifest.HiltComponentActivity import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest diff --git a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarScreenshotTests.kt b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarScreenshotTests.kt index 75dc6baa74..a611ecfd36 100644 --- a/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarScreenshotTests.kt +++ b/app/src/testDemo/kotlin/com/google/samples/apps/nowinandroid/ui/SnackbarScreenshotTests.kt @@ -40,7 +40,7 @@ import com.google.samples.apps.nowinandroid.core.data.util.NetworkMonitor import com.google.samples.apps.nowinandroid.core.data.util.TimeZoneMonitor import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme import com.google.samples.apps.nowinandroid.core.testing.util.DefaultRoborazziOptions -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.navigation.LocalSnackbarHostState +import com.google.samples.apps.nowinandroid.navigation.bookmarks.LocalSnackbarHostState import com.google.samples.apps.nowinandroid.uitesthiltmanifest.HiltComponentActivity import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest diff --git a/benchmarks/README.md b/benchmarks/README.md index c2bbf2a2ab..40422fc4ff 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -11,42 +11,19 @@ config: nodePlacementStrategy: SIMPLE --- graph TB - subgraph :feature - direction TB - subgraph :feature:settings - direction TB - :feature:settings:impl[impl]:::android-library - end - subgraph :feature:foryou - direction TB - :feature:foryou:api[api]:::android-library - :feature:foryou:impl[impl]:::android-library - end - subgraph :feature:bookmarks - direction TB - :feature:bookmarks:api[api]:::android-library - :feature:bookmarks:impl[impl]:::android-library - end - subgraph :feature:search - direction TB - :feature:search:api[api]:::android-library - :feature:search:impl[impl]:::android-library - end - subgraph :feature:interests - direction TB - :feature:interests:api[api]:::android-library - :feature:interests:impl[impl]:::android-library - end - subgraph :feature:topic - direction TB - :feature:topic:api[api]:::android-library - :feature:topic:impl[impl]:::android-library - end - end subgraph :sync direction TB :sync:work[work]:::android-library end + subgraph :feature + direction TB + :feature:bookmarks[bookmarks]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:search[search]:::android-feature + :feature:settings[settings]:::android-feature + :feature:topic[topic]:::android-feature + end subgraph :core direction TB :core:analytics[analytics]:::android-library @@ -63,6 +40,7 @@ graph TB :core:notifications[notifications]:::android-library :core:ui[ui]:::android-library end + :navigation[navigation]:::android-library :benchmarks[benchmarks]:::android-test :app[app]:::android-application @@ -72,18 +50,10 @@ graph TB :app -.-> :core:data :app -.-> :core:designsystem :app -.-> :core:model + :app -.-> :core:navigation :app -.-> :core:ui - :app -.-> :feature:bookmarks:api - :app -.-> :feature:bookmarks:impl - :app -.-> :feature:foryou:api - :app -.-> :feature:foryou:impl - :app -.-> :feature:interests:api - :app -.-> :feature:interests:impl - :app -.-> :feature:search:api - :app -.-> :feature:search:impl - :app -.-> :feature:settings:impl - :app -.-> :feature:topic:api - :app -.-> :feature:topic:impl + :app -.-> :feature:settings + :app -.-> :navigation :app -.-> :sync:work :benchmarks -.->|testedApks| :app :core:data -.-> :core:analytics @@ -105,43 +75,35 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:bookmarks:api --> :core:navigation - :feature:bookmarks:impl -.-> :core:data - :feature:bookmarks:impl -.-> :core:designsystem - :feature:bookmarks:impl -.-> :core:ui - :feature:bookmarks:impl -.-> :feature:bookmarks:api - :feature:bookmarks:impl -.-> :feature:topic:api - :feature:foryou:api --> :core:navigation - :feature:foryou:impl -.-> :core:designsystem - :feature:foryou:impl -.-> :core:domain - :feature:foryou:impl -.-> :core:notifications - :feature:foryou:impl -.-> :core:ui - :feature:foryou:impl -.-> :feature:foryou:api - :feature:foryou:impl -.-> :feature:topic:api - :feature:interests:api --> :core:navigation - :feature:interests:impl -.-> :core:designsystem - :feature:interests:impl -.-> :core:domain - :feature:interests:impl -.-> :core:ui - :feature:interests:impl -.-> :feature:interests:api - :feature:interests:impl -.-> :feature:topic:api - :feature:search:api -.-> :core:domain - :feature:search:api --> :core:navigation - :feature:search:impl -.-> :core:designsystem - :feature:search:impl -.-> :core:domain - :feature:search:impl -.-> :core:ui - :feature:search:impl -.-> :feature:interests:api - :feature:search:impl -.-> :feature:search:api - :feature:search:impl -.-> :feature:topic:api - :feature:settings:impl -.-> :core:data - :feature:settings:impl -.-> :core:designsystem - :feature:settings:impl -.-> :core:ui - :feature:topic:api -.-> :core:designsystem - :feature:topic:api --> :core:navigation - :feature:topic:api -.-> :core:ui - :feature:topic:impl -.-> :core:data - :feature:topic:impl -.-> :core:designsystem - :feature:topic:impl -.-> :core:ui - :feature:topic:impl -.-> :feature:topic:api + :feature:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:bookmarks -.-> :feature:topic + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :core:ui + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui + :navigation -.-> :core:designsystem + :navigation -.-> :core:model + :navigation -.-> :core:navigation + :navigation -.-> :feature:bookmarks + :navigation -.-> :feature:foryou + :navigation -.-> :feature:interests + :navigation -.-> :feature:search + :navigation -.-> :feature:settings + :navigation -.-> :feature:topic :sync:work -.-> :core:analytics :sync:work -.-> :core:data :sync:work -.-> :core:notifications diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 8000fbadfb..166b54907f 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -78,13 +78,9 @@ gradlePlugin { id = libs.plugins.nowinandroid.android.library.asProvider().get().pluginId implementationClass = "AndroidLibraryConventionPlugin" } - register("androidFeatureImpl") { - id = libs.plugins.nowinandroid.android.feature.impl.get().pluginId - implementationClass = "AndroidFeatureImplConventionPlugin" - } - register("androidFeatureApi") { - id = libs.plugins.nowinandroid.android.feature.api.get().pluginId - implementationClass = "AndroidFeatureApiConventionPlugin" + register("androidFeature") { + id = libs.plugins.nowinandroid.android.feature.get().pluginId + implementationClass = "AndroidFeatureConventionPlugin" } register("androidLibraryJacoco") { id = libs.plugins.nowinandroid.android.library.jacoco.get().pluginId diff --git a/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt deleted file mode 100644 index 969cf96d4d..0000000000 --- a/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.google.samples.apps.nowinandroid.libs -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.dependencies - -class AndroidFeatureApiConventionPlugin : Plugin { - override fun apply(target: Project) { - with(target) { - apply(plugin = "nowinandroid.android.library") - apply(plugin = "org.jetbrains.kotlin.plugin.serialization") - - dependencies { - "api"(project(":core:navigation")) - } - } - } -} diff --git a/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidFeatureConventionPlugin.kt similarity index 89% rename from build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt rename to build-logic/convention/src/main/kotlin/AndroidFeatureConventionPlugin.kt index 500e3e9830..516436f5ed 100644 --- a/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidFeatureConventionPlugin.kt @@ -23,11 +23,12 @@ import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies -class AndroidFeatureImplConventionPlugin : Plugin { +class AndroidFeatureConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { apply(plugin = "nowinandroid.android.library") apply(plugin = "nowinandroid.hilt") + apply(plugin = "org.jetbrains.kotlin.plugin.serialization") extensions.configure { testOptions.animationsDisabled = true @@ -44,6 +45,9 @@ class AndroidFeatureImplConventionPlugin : Plugin { "implementation"(libs.findLibrary("androidx.navigation3.runtime").get()) "implementation"(libs.findLibrary("androidx.tracing.ktx").get()) + "testImplementation"(project(":navigation")) + "testImplementation"(project(":core:navigation")) + "androidTestImplementation"( libs.findLibrary("androidx.lifecycle.runtimeTesting").get(), ) diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 3e7831dcac..55cee1243b 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -32,10 +32,4 @@ dependencies { implementation(libs.androidx.lifecycle.viewModel.navigation3) testImplementation(libs.truth) - - androidTestImplementation(libs.androidx.compose.ui.test.junit4) - androidTestImplementation(libs.androidx.test.ext) - androidTestImplementation(libs.androidx.compose.ui.testManifest) - androidTestImplementation(libs.androidx.lifecycle.viewModel.testing) - androidTestImplementation(libs.truth) } diff --git a/feature/bookmarks/api/.gitignore b/feature/bookmarks/.gitignore similarity index 100% rename from feature/bookmarks/api/.gitignore rename to feature/bookmarks/.gitignore diff --git a/feature/bookmarks/impl/README.md b/feature/bookmarks/README.md similarity index 78% rename from feature/bookmarks/impl/README.md rename to feature/bookmarks/README.md index 123a842f6c..ef84d59784 100644 --- a/feature/bookmarks/impl/README.md +++ b/feature/bookmarks/README.md @@ -13,15 +13,8 @@ config: graph TB subgraph :feature direction TB - subgraph :feature:bookmarks - direction TB - :feature:bookmarks:api[api]:::android-library - :feature:bookmarks:impl[impl]:::android-library - end - subgraph :feature:topic - direction TB - :feature:topic:api[api]:::android-library - end + :feature:bookmarks[bookmarks]:::android-feature + :feature:topic[topic]:::android-feature end subgraph :core direction TB @@ -33,7 +26,6 @@ graph TB :core:datastore-proto[datastore-proto]:::android-library :core:designsystem[designsystem]:::android-library :core:model[model]:::jvm-library - :core:navigation[navigation]:::android-library :core:network[network]:::android-library :core:notifications[notifications]:::android-library :core:ui[ui]:::android-library @@ -56,15 +48,13 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:bookmarks:api --> :core:navigation - :feature:bookmarks:impl -.-> :core:data - :feature:bookmarks:impl -.-> :core:designsystem - :feature:bookmarks:impl -.-> :core:ui - :feature:bookmarks:impl -.-> :feature:bookmarks:api - :feature:bookmarks:impl -.-> :feature:topic:api - :feature:topic:api -.-> :core:designsystem - :feature:topic:api --> :core:navigation - :feature:topic:api -.-> :core:ui + :feature:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:bookmarks -.-> :feature:topic + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; diff --git a/feature/bookmarks/api/README.md b/feature/bookmarks/api/README.md deleted file mode 100644 index 7a97f09bed..0000000000 --- a/feature/bookmarks/api/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# `:feature:bookmarks:api` - -## Module dependency graph - - -```mermaid ---- -config: - layout: elk - elk: - nodePlacementStrategy: SIMPLE ---- -graph TB - subgraph :feature - direction TB - subgraph :feature:bookmarks - direction TB - :feature:bookmarks:api[api]:::android-library - end - end - subgraph :core - direction TB - :core:navigation[navigation]:::android-library - end - - :feature:bookmarks:api --> :core:navigation - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
📋 Graph legend - -```mermaid -graph TB - application[application]:::android-application - feature[feature]:::android-feature - library[library]:::android-library - jvm[jvm]:::jvm-library - - application -.-> feature - library --> jvm - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
- diff --git a/feature/bookmarks/api/build.gradle.kts b/feature/bookmarks/api/build.gradle.kts deleted file mode 100644 index a514686158..0000000000 --- a/feature/bookmarks/api/build.gradle.kts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - alias(libs.plugins.nowinandroid.android.feature.api) -} - -android { - namespace = "com.google.samples.apps.nowinandroid.feature.bookmarks.api" -} \ No newline at end of file diff --git a/feature/bookmarks/impl/build.gradle.kts b/feature/bookmarks/build.gradle.kts similarity index 81% rename from feature/bookmarks/impl/build.gradle.kts rename to feature/bookmarks/build.gradle.kts index e8162afffc..479ec32e14 100644 --- a/feature/bookmarks/impl/build.gradle.kts +++ b/feature/bookmarks/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,17 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.bookmarks.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.bookmarks" } dependencies { implementation(projects.core.data) - implementation(projects.feature.bookmarks.api) - implementation(projects.feature.topic.api) + implementation(projects.feature.topic) testImplementation(projects.core.testing) diff --git a/feature/bookmarks/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreenTest.kt b/feature/bookmarks/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreenTest.kt similarity index 97% rename from feature/bookmarks/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreenTest.kt rename to feature/bookmarks/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreenTest.kt index 0b73a7918f..81f070de7b 100644 --- a/feature/bookmarks/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreenTest.kt +++ b/feature/bookmarks/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.impl +package com.google.samples.apps.nowinandroid.feature.bookmarks import androidx.activity.ComponentActivity import androidx.compose.runtime.CompositionLocalProvider @@ -36,7 +36,6 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.testing.TestLifecycleOwner import com.google.samples.apps.nowinandroid.core.testing.data.userNewsResourcesTestData import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.R import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test diff --git a/feature/bookmarks/impl/src/main/AndroidManifest.xml b/feature/bookmarks/src/main/AndroidManifest.xml similarity index 100% rename from feature/bookmarks/impl/src/main/AndroidManifest.xml rename to feature/bookmarks/src/main/AndroidManifest.xml diff --git a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt similarity index 98% rename from feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt rename to feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt index 65bc4acf2f..e2c175a493 100644 --- a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt +++ b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.impl +package com.google.samples.apps.nowinandroid.feature.bookmarks import androidx.annotation.VisibleForTesting import androidx.compose.foundation.Image @@ -74,10 +74,9 @@ import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent import com.google.samples.apps.nowinandroid.core.ui.TrackScrollJank import com.google.samples.apps.nowinandroid.core.ui.UserNewsResourcePreviewParameterProvider import com.google.samples.apps.nowinandroid.core.ui.newsFeed -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.R @Composable -internal fun BookmarksScreen( +fun BookmarksScreen( onTopicClick: (String) -> Unit, onShowSnackbar: suspend (String, String?) -> Boolean, modifier: Modifier = Modifier, diff --git a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModel.kt b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModel.kt similarity index 97% rename from feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModel.kt rename to feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModel.kt index f36c9d31fd..f936024855 100644 --- a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModel.kt +++ b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModel.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.impl +package com.google.samples.apps.nowinandroid.feature.bookmarks import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf diff --git a/feature/bookmarks/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/api/navigation/BookmarksNavKey.kt b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/navigation/BookmarksNavKey.kt similarity index 84% rename from feature/bookmarks/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/api/navigation/BookmarksNavKey.kt rename to feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/navigation/BookmarksNavKey.kt index 988266ffc3..a9d6303ae0 100644 --- a/feature/bookmarks/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/api/navigation/BookmarksNavKey.kt +++ b/feature/bookmarks/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/navigation/BookmarksNavKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation +package com.google.samples.apps.nowinandroid.feature.bookmarks.navigation import androidx.navigation3.runtime.NavKey import kotlinx.serialization.Serializable diff --git a/feature/bookmarks/api/src/main/res/drawable/feature_bookmarks_api_mg_empty_bookmarks.xml b/feature/bookmarks/src/main/res/drawable/feature_bookmarks_api_mg_empty_bookmarks.xml similarity index 100% rename from feature/bookmarks/api/src/main/res/drawable/feature_bookmarks_api_mg_empty_bookmarks.xml rename to feature/bookmarks/src/main/res/drawable/feature_bookmarks_api_mg_empty_bookmarks.xml diff --git a/feature/bookmarks/api/src/main/res/values/strings.xml b/feature/bookmarks/src/main/res/values/strings.xml similarity index 100% rename from feature/bookmarks/api/src/main/res/values/strings.xml rename to feature/bookmarks/src/main/res/values/strings.xml diff --git a/feature/bookmarks/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModelTest.kt b/feature/bookmarks/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModelTest.kt similarity index 89% rename from feature/bookmarks/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModelTest.kt rename to feature/bookmarks/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModelTest.kt index 66ce0744f7..d1339ce6d5 100644 --- a/feature/bookmarks/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksViewModelTest.kt +++ b/feature/bookmarks/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksViewModelTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,14 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.impl +package com.google.samples.apps.nowinandroid.feature.bookmarks import com.google.samples.apps.nowinandroid.core.data.repository.CompositeUserNewsResourceRepository import com.google.samples.apps.nowinandroid.core.testing.data.newsResourcesTestData import com.google.samples.apps.nowinandroid.core.testing.repository.TestNewsRepository import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository import com.google.samples.apps.nowinandroid.core.testing.util.MainDispatcherRule -import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState.Loading -import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState.Success -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.BookmarksViewModel +import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher @@ -62,7 +60,7 @@ class BookmarksViewModelTest { @Test fun stateIsInitiallyLoading() = runTest { - assertEquals(Loading, viewModel.feedUiState.value) + assertEquals(NewsFeedUiState.Loading, viewModel.feedUiState.value) } @Test @@ -72,7 +70,7 @@ class BookmarksViewModelTest { newsRepository.sendNewsResources(newsResourcesTestData) userDataRepository.setNewsResourceBookmarked(newsResourcesTestData[0].id, true) val item = viewModel.feedUiState.value - assertIs(item) + assertIs(item) assertEquals(item.feed.size, 1) } @@ -87,7 +85,7 @@ class BookmarksViewModelTest { viewModel.removeFromSavedResources(newsResourcesTestData[0].id) // Verify list of saved resources is now empty val item = viewModel.feedUiState.value - assertIs(item) + assertIs(item) assertEquals(item.feed.size, 0) assertTrue(viewModel.shouldDisplayUndoBookmark) } @@ -100,7 +98,7 @@ class BookmarksViewModelTest { newsRepository.sendNewsResources(newsResourcesTestData) userDataRepository.setNewsResourceBookmarked(newsResourcesTestData[0].id, true) val itemBeforeViewed = viewModel.feedUiState.value - assertIs(itemBeforeViewed) + assertIs(itemBeforeViewed) assertFalse(itemBeforeViewed.feed.first().hasBeenViewed) // When @@ -108,7 +106,7 @@ class BookmarksViewModelTest { // Then val item = viewModel.feedUiState.value - assertIs(item) + assertIs(item) assertTrue(item.feed.first().hasBeenViewed) } @@ -122,7 +120,7 @@ class BookmarksViewModelTest { viewModel.removeFromSavedResources(newsResourcesTestData[0].id) assertTrue(viewModel.shouldDisplayUndoBookmark) val itemBeforeUndo = viewModel.feedUiState.value - assertIs(itemBeforeUndo) + assertIs(itemBeforeUndo) assertEquals(0, itemBeforeUndo.feed.size) // When @@ -131,7 +129,7 @@ class BookmarksViewModelTest { // Then assertFalse(viewModel.shouldDisplayUndoBookmark) val item = viewModel.feedUiState.value - assertIs(item) + assertIs(item) assertEquals(1, item.feed.size) } } diff --git a/feature/bookmarks/impl/.gitignore b/feature/foryou/.gitignore similarity index 100% rename from feature/bookmarks/impl/.gitignore rename to feature/foryou/.gitignore diff --git a/feature/foryou/impl/README.md b/feature/foryou/README.md similarity index 78% rename from feature/foryou/impl/README.md rename to feature/foryou/README.md index 8c12460f48..5695dd5d1e 100644 --- a/feature/foryou/impl/README.md +++ b/feature/foryou/README.md @@ -13,15 +13,7 @@ config: graph TB subgraph :feature direction TB - subgraph :feature:foryou - direction TB - :feature:foryou:api[api]:::android-library - :feature:foryou:impl[impl]:::android-library - end - subgraph :feature:topic - direction TB - :feature:topic:api[api]:::android-library - end + :feature:foryou[foryou]:::android-feature end subgraph :core direction TB @@ -34,7 +26,6 @@ graph TB :core:designsystem[designsystem]:::android-library :core:domain[domain]:::android-library :core:model[model]:::jvm-library - :core:navigation[navigation]:::android-library :core:network[network]:::android-library :core:notifications[notifications]:::android-library :core:ui[ui]:::android-library @@ -59,16 +50,10 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:foryou:api --> :core:navigation - :feature:foryou:impl -.-> :core:designsystem - :feature:foryou:impl -.-> :core:domain - :feature:foryou:impl -.-> :core:notifications - :feature:foryou:impl -.-> :core:ui - :feature:foryou:impl -.-> :feature:foryou:api - :feature:foryou:impl -.-> :feature:topic:api - :feature:topic:api -.-> :core:designsystem - :feature:topic:api --> :core:navigation - :feature:topic:api -.-> :core:ui + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; diff --git a/feature/foryou/api/README.md b/feature/foryou/api/README.md deleted file mode 100644 index 81223ecacd..0000000000 --- a/feature/foryou/api/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# `:feature:foryou:api` - -## Module dependency graph - - -```mermaid ---- -config: - layout: elk - elk: - nodePlacementStrategy: SIMPLE ---- -graph TB - subgraph :feature - direction TB - subgraph :feature:foryou - direction TB - :feature:foryou:api[api]:::android-library - end - end - subgraph :core - direction TB - :core:navigation[navigation]:::android-library - end - - :feature:foryou:api --> :core:navigation - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
📋 Graph legend - -```mermaid -graph TB - application[application]:::android-application - feature[feature]:::android-feature - library[library]:::android-library - jvm[jvm]:::jvm-library - - application -.-> feature - library --> jvm - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
- diff --git a/feature/foryou/api/build.gradle.kts b/feature/foryou/api/build.gradle.kts deleted file mode 100644 index 99ac324a27..0000000000 --- a/feature/foryou/api/build.gradle.kts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - alias(libs.plugins.nowinandroid.android.feature.api) -} - -android { - namespace = "com.google.samples.apps.nowinandroid.feature.foryou.api" -} - -dependencies { - api(projects.core.navigation) -} diff --git a/feature/foryou/api/src/main/AndroidManifest.xml b/feature/foryou/api/src/main/AndroidManifest.xml deleted file mode 100644 index 51d0cfc2e0..0000000000 --- a/feature/foryou/api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - \ No newline at end of file diff --git a/feature/foryou/impl/build.gradle.kts b/feature/foryou/build.gradle.kts similarity index 86% rename from feature/foryou/impl/build.gradle.kts rename to feature/foryou/build.gradle.kts index 7964f8c4fc..1c2f1babe1 100644 --- a/feature/foryou/impl/build.gradle.kts +++ b/feature/foryou/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,13 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) alias(libs.plugins.roborazzi) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.foryou.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.foryou" testOptions.unitTests.isIncludeAndroidResources = true } @@ -29,8 +29,6 @@ dependencies { implementation(libs.accompanist.permissions) implementation(projects.core.domain) implementation(projects.core.notifications) - implementation(projects.feature.foryou.api) - implementation(projects.feature.topic.api) implementation(libs.androidx.activity.compose) testImplementation(libs.hilt.android.testing) @@ -40,4 +38,4 @@ dependencies { androidTestImplementation(libs.bundles.androidx.compose.ui.test) androidTestImplementation(projects.core.testing) -} \ No newline at end of file +} diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png deleted file mode 100644 index d7e5af23b1..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png deleted file mode 100644 index 4bc0969af6..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png deleted file mode 100644 index e52802664d..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png deleted file mode 100644 index 3cecfec336..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png deleted file mode 100644 index cbe01938bf..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png deleted file mode 100644 index 2ef02d5cea..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png deleted file mode 100644 index 849fd488bf..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_foldable.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_foldable.png deleted file mode 100644 index 6ea161e108..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_foldable.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone.png deleted file mode 100644 index eb7de80093..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png deleted file mode 100644 index 693db55fff..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png and /dev/null differ diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_tablet.png b/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_tablet.png deleted file mode 100644 index ffa2b22622..0000000000 Binary files a/feature/foryou/impl/src/test/screenshots/ForYouScreenTopicSelection_tablet.png and /dev/null differ diff --git a/feature/foryou/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenTest.kt b/feature/foryou/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt similarity index 98% rename from feature/foryou/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenTest.kt rename to feature/foryou/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt index fc4fc02419..a3792520bc 100644 --- a/feature/foryou/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenTest.kt +++ b/feature/foryou/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou import androidx.activity.ComponentActivity import androidx.compose.foundation.layout.Box @@ -32,7 +32,6 @@ import com.google.samples.apps.nowinandroid.core.rules.GrantPostNotificationsPer import com.google.samples.apps.nowinandroid.core.testing.data.followableTopicTestData import com.google.samples.apps.nowinandroid.core.testing.data.userNewsResourcesTestData import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState -import com.google.samples.apps.nowinandroid.feature.foryou.api.R import org.junit.Rule import org.junit.Test diff --git a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreen.kt b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt similarity index 99% rename from feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreen.kt rename to feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt index 0ae916db32..3fe41229b1 100644 --- a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreen.kt +++ b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou +import android.Manifest import android.net.Uri import android.os.Build.VERSION import android.os.Build.VERSION_CODES @@ -103,7 +104,6 @@ import com.google.samples.apps.nowinandroid.core.ui.TrackScrollJank import com.google.samples.apps.nowinandroid.core.ui.UserNewsResourcePreviewParameterProvider import com.google.samples.apps.nowinandroid.core.ui.launchCustomChromeTab import com.google.samples.apps.nowinandroid.core.ui.newsFeed -import com.google.samples.apps.nowinandroid.feature.foryou.api.R @Composable fun ForYouScreen( @@ -452,7 +452,7 @@ private fun NotificationPermissionEffect() { if (LocalInspectionMode.current) return if (VERSION.SDK_INT < VERSION_CODES.TIRAMISU) return val notificationsPermissionState = rememberPermissionState( - android.Manifest.permission.POST_NOTIFICATIONS, + Manifest.permission.POST_NOTIFICATIONS, ) LaunchedEffect(notificationsPermissionState) { val status = notificationsPermissionState.status diff --git a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModel.kt b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt similarity index 98% rename from feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModel.kt rename to feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt index c54551c0bb..4b6cd39c94 100644 --- a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModel.kt +++ b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModel.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel diff --git a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/OnboardingUiState.kt b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/OnboardingUiState.kt similarity index 95% rename from feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/OnboardingUiState.kt rename to feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/OnboardingUiState.kt index d31749bb5b..70634b4c53 100644 --- a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/OnboardingUiState.kt +++ b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/OnboardingUiState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic diff --git a/feature/foryou/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/api/navigation/ForYouNavKey.kt b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/navigation/ForYouNavKey.kt similarity index 84% rename from feature/foryou/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/api/navigation/ForYouNavKey.kt rename to feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/navigation/ForYouNavKey.kt index d61ae5a20c..29d21273d3 100644 --- a/feature/foryou/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/api/navigation/ForYouNavKey.kt +++ b/feature/foryou/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/navigation/ForYouNavKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.api.navigation +package com.google.samples.apps.nowinandroid.feature.foryou.navigation import androidx.navigation3.runtime.NavKey import kotlinx.serialization.Serializable diff --git a/feature/foryou/api/src/main/res/drawable/feature_foryou_api_ic_icon_placeholder.xml b/feature/foryou/src/main/res/drawable/feature_foryou_api_ic_icon_placeholder.xml similarity index 100% rename from feature/foryou/api/src/main/res/drawable/feature_foryou_api_ic_icon_placeholder.xml rename to feature/foryou/src/main/res/drawable/feature_foryou_api_ic_icon_placeholder.xml diff --git a/feature/foryou/api/src/main/res/values/strings.xml b/feature/foryou/src/main/res/values/strings.xml similarity index 93% rename from feature/foryou/api/src/main/res/values/strings.xml rename to feature/foryou/src/main/res/values/strings.xml index f0595944f4..f4c08bd67d 100644 --- a/feature/foryou/api/src/main/res/values/strings.xml +++ b/feature/foryou/src/main/res/values/strings.xml @@ -21,4 +21,5 @@ Navigate up What are you interested in? Updates from topics you follow will appear here. Follow some things to get started. - \ No newline at end of file + Now in Android + diff --git a/feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenScreenshotTests.kt b/feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenScreenshotTests.kt similarity index 96% rename from feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenScreenshotTests.kt rename to feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenScreenshotTests.kt index d0d73860eb..b8884f5a8b 100644 --- a/feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouScreenScreenshotTests.kt +++ b/feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenScreenshotTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou import androidx.activity.ComponentActivity import androidx.compose.runtime.Composable @@ -31,8 +31,8 @@ import com.google.samples.apps.nowinandroid.core.testing.util.captureMultiDevice import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState.Success import com.google.samples.apps.nowinandroid.core.ui.UserNewsResourcePreviewParameterProvider -import com.google.samples.apps.nowinandroid.feature.foryou.impl.OnboardingUiState.NotShown -import com.google.samples.apps.nowinandroid.feature.foryou.impl.OnboardingUiState.Shown +import com.google.samples.apps.nowinandroid.feature.foryou.OnboardingUiState.NotShown +import com.google.samples.apps.nowinandroid.feature.foryou.OnboardingUiState.Shown import dagger.hilt.android.testing.HiltTestApplication import org.hamcrest.Matchers import org.junit.Before diff --git a/feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModelTest.kt b/feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt similarity index 99% rename from feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModelTest.kt rename to feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt index 5008b484c7..812544c0cb 100644 --- a/feature/foryou/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/ForYouViewModelTest.kt +++ b/feature/foryou/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/ForYouViewModelTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl +package com.google.samples.apps.nowinandroid.feature.foryou import androidx.lifecycle.SavedStateHandle import com.google.samples.apps.nowinandroid.core.analytics.AnalyticsEvent diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenLoading_foldable.png similarity index 100% rename from feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_foldable.png rename to feature/foryou/src/test/screenshots/ForYouScreenLoading_foldable.png diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_phone.png b/feature/foryou/src/test/screenshots/ForYouScreenLoading_phone.png similarity index 100% rename from feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_phone.png rename to feature/foryou/src/test/screenshots/ForYouScreenLoading_phone.png diff --git a/feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenLoading_tablet.png similarity index 100% rename from feature/foryou/impl/src/test/screenshots/ForYouScreenLoading_tablet.png rename to feature/foryou/src/test/screenshots/ForYouScreenLoading_tablet.png diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png index e4ecf6d959..23fe4930a4 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_foldable.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png new file mode 100644 index 0000000000..e08d08a7d3 Binary files /dev/null and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png new file mode 100644 index 0000000000..0bd4ebc3f3 Binary files /dev/null and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_phone_dark.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png index 53891bdc19..037cda750a 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedAndLoading_tablet.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png index ba669e8f83..ba1b611dbf 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_foldable.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png new file mode 100644 index 0000000000..cdf15836c9 Binary files /dev/null and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_phone.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png index e92ae04815..4a5a4cb437 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenPopulatedFeed_tablet.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png index 3ae1bee949..b0d9319329 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_foldable.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png index 0938678b24..eb7de80093 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png index 084d031a5d..693db55fff 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_phone_dark.png differ diff --git a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png index 35f59e54cf..4d6b1021aa 100644 Binary files a/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png and b/feature/foryou/src/test/screenshots/ForYouScreenTopicSelection_tablet.png differ diff --git a/feature/foryou/api/.gitignore b/feature/interests/.gitignore similarity index 100% rename from feature/foryou/api/.gitignore rename to feature/interests/.gitignore diff --git a/feature/interests/impl/README.md b/feature/interests/README.md similarity index 100% rename from feature/interests/impl/README.md rename to feature/interests/README.md diff --git a/feature/interests/api/README.md b/feature/interests/api/README.md deleted file mode 100644 index ef580df7ca..0000000000 --- a/feature/interests/api/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# `:feature:interests:api` - -## Module dependency graph - - -```mermaid ---- -config: - layout: elk - elk: - nodePlacementStrategy: SIMPLE ---- -graph TB - subgraph :feature - direction TB - subgraph :feature:interests - direction TB - :feature:interests:api[api]:::android-library - end - end - subgraph :core - direction TB - :core:navigation[navigation]:::android-library - end - - :feature:interests:api --> :core:navigation - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
📋 Graph legend - -```mermaid -graph TB - application[application]:::android-application - feature[feature]:::android-feature - library[library]:::android-library - jvm[jvm]:::jvm-library - - application -.-> feature - library --> jvm - -classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; -classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; -classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000; -classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000; -classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000; -classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; -``` - -
- diff --git a/feature/interests/api/build.gradle.kts b/feature/interests/api/build.gradle.kts deleted file mode 100644 index 7a2dfd65ee..0000000000 --- a/feature/interests/api/build.gradle.kts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - alias(libs.plugins.nowinandroid.android.feature.api) -} - -android { - namespace = "com.google.samples.apps.nowinandroid.feature.interests.api" -} \ No newline at end of file diff --git a/feature/interests/api/src/main/AndroidManifest.xml b/feature/interests/api/src/main/AndroidManifest.xml deleted file mode 100644 index 51d0cfc2e0..0000000000 --- a/feature/interests/api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - \ No newline at end of file diff --git a/feature/interests/impl/build.gradle.kts b/feature/interests/build.gradle.kts similarity index 86% rename from feature/interests/impl/build.gradle.kts rename to feature/interests/build.gradle.kts index fedc7fba6d..73971fac6e 100644 --- a/feature/interests/impl/build.gradle.kts +++ b/feature/interests/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,19 +15,17 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) alias(libs.plugins.nowinandroid.android.library.jacoco) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.interests.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.interests" testOptions.unitTests.isIncludeAndroidResources = true } dependencies { implementation(projects.core.domain) - implementation(projects.feature.topic.api) - implementation(projects.feature.interests.api) implementation(libs.androidx.compose.material3) implementation(libs.androidx.compose.material3.adaptive) implementation(libs.androidx.compose.material3.adaptive.layout) @@ -41,8 +39,9 @@ dependencies { testImplementation(libs.androidx.test.espresso.core) testImplementation(libs.hilt.android.testing) testImplementation(projects.uiTestHiltManifest) - testImplementation(projects.feature.topic.impl) + testImplementation(projects.feature.topic) testImplementation(libs.androidx.navigation.testing) + testImplementation(projects.sync.syncTest) androidTestImplementation(libs.bundles.androidx.compose.ui.test) androidTestImplementation(projects.core.testing) diff --git a/feature/interests/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreenTest.kt b/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreenTest.kt similarity index 95% rename from feature/interests/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreenTest.kt rename to feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreenTest.kt index 8a10a478bc..9e91ebf462 100644 --- a/feature/interests/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreenTest.kt +++ b/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl +package com.google.samples.apps.nowinandroid.feature.interests import androidx.activity.ComponentActivity import androidx.compose.runtime.Composable @@ -29,7 +29,7 @@ import org.junit.Before import org.junit.Rule import org.junit.Test import com.google.samples.apps.nowinandroid.core.ui.R as CoreUiR -import com.google.samples.apps.nowinandroid.feature.interests.api.R as InterestsR +import com.google.samples.apps.nowinandroid.feature.interests.R as InterestsR /** * UI test for checking the correct behaviour of the Interests screen; diff --git a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsDetailPlaceholder.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsDetailPlaceholder.kt similarity index 93% rename from feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsDetailPlaceholder.kt rename to feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsDetailPlaceholder.kt index 2a03019d37..c746e57e10 100644 --- a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsDetailPlaceholder.kt +++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsDetailPlaceholder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl +package com.google.samples.apps.nowinandroid.feature.interests import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -33,7 +33,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme -import com.google.samples.apps.nowinandroid.feature.interests.api.R @Composable fun InterestsDetailPlaceholder(modifier: Modifier = Modifier) { diff --git a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreen.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt similarity index 96% rename from feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreen.kt rename to feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt index 689b5bbf0b..21818056c8 100644 --- a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsScreen.kt +++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl +package com.google.samples.apps.nowinandroid.feature.interests import androidx.compose.foundation.layout.Column import androidx.compose.material3.Text @@ -32,7 +32,6 @@ import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic import com.google.samples.apps.nowinandroid.core.ui.DevicePreviews import com.google.samples.apps.nowinandroid.core.ui.FollowableTopicPreviewParameterProvider import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent -import com.google.samples.apps.nowinandroid.feature.interests.api.R @Composable fun InterestsScreen( diff --git a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsViewModel.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel.kt similarity index 93% rename from feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsViewModel.kt rename to feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel.kt index f79d79d091..6f4975f4a3 100644 --- a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/InterestsViewModel.kt +++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/InterestsViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl +package com.google.samples.apps.nowinandroid.feature.interests import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel @@ -23,7 +23,7 @@ import com.google.samples.apps.nowinandroid.core.data.repository.UserDataReposit import com.google.samples.apps.nowinandroid.core.domain.GetFollowableTopicsUseCase import com.google.samples.apps.nowinandroid.core.domain.TopicSortField import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject diff --git a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/TabContent.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt similarity index 98% rename from feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/TabContent.kt rename to feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt index d8a09c8f0a..2a888d8518 100644 --- a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/TabContent.kt +++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/TabContent.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl +package com.google.samples.apps.nowinandroid.feature.interests import androidx.compose.foundation.gestures.Orientation import androidx.compose.foundation.layout.Box diff --git a/feature/interests/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/api/navigation/InterestsNavKey.kt b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavKey.kt similarity index 86% rename from feature/interests/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/api/navigation/InterestsNavKey.kt rename to feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavKey.kt index cd6c631a27..f6d647077c 100644 --- a/feature/interests/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/api/navigation/InterestsNavKey.kt +++ b/feature/interests/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.api.navigation +package com.google.samples.apps.nowinandroid.feature.interests.navigation import androidx.navigation3.runtime.NavKey import kotlinx.serialization.Serializable diff --git a/feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml b/feature/interests/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml similarity index 100% rename from feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml rename to feature/interests/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml diff --git a/feature/interests/api/src/main/res/values/strings.xml b/feature/interests/src/main/res/values/strings.xml similarity index 100% rename from feature/interests/api/src/main/res/values/strings.xml rename to feature/interests/src/main/res/values/strings.xml diff --git a/feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsListDetailScreenTest.kt b/feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsListDetailScreenTest.kt similarity index 92% rename from feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsListDetailScreenTest.kt rename to feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsListDetailScreenTest.kt index 0975216d14..64271a80a9 100644 --- a/feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsListDetailScreenTest.kt +++ b/feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsListDetailScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ @file:OptIn(ExperimentalMaterial3AdaptiveApi::class) -package com.google.samples.apps.nowinandroid.interests.impl +package com.google.samples.apps.nowinandroid.interests import androidx.annotation.StringRes import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @@ -38,11 +38,11 @@ import com.google.samples.apps.nowinandroid.core.model.data.Topic import com.google.samples.apps.nowinandroid.core.navigation.Navigator import com.google.samples.apps.nowinandroid.core.navigation.rememberNavigationState import com.google.samples.apps.nowinandroid.core.navigation.toEntries -import com.google.samples.apps.nowinandroid.feature.interests.api.R -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey -import com.google.samples.apps.nowinandroid.feature.interests.impl.LIST_PANE_TEST_TAG -import com.google.samples.apps.nowinandroid.feature.interests.impl.navigation.interestsEntry -import com.google.samples.apps.nowinandroid.feature.topic.impl.navigation.topicEntry +import com.google.samples.apps.nowinandroid.feature.interests.LIST_PANE_TEST_TAG +import com.google.samples.apps.nowinandroid.feature.interests.R +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.navigation.interests.interestsEntry +import com.google.samples.apps.nowinandroid.navigation.topic.topicEntry import com.google.samples.apps.nowinandroid.uitesthiltmanifest.HiltComponentActivity import dagger.hilt.android.testing.HiltAndroidRule import dagger.hilt.android.testing.HiltAndroidTest @@ -56,7 +56,6 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config import javax.inject.Inject -import kotlin.getValue import kotlin.properties.ReadOnlyProperty private const val EXPANDED_WIDTH = "w1200dp-h840dp" diff --git a/feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsViewModelTest.kt b/feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsViewModelTest.kt similarity index 95% rename from feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsViewModelTest.kt rename to feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsViewModelTest.kt index 4e964b52b7..d4095a0b0c 100644 --- a/feature/interests/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/impl/InterestsViewModelTest.kt +++ b/feature/interests/src/test/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsViewModelTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.interests.impl +package com.google.samples.apps.nowinandroid.interests import androidx.lifecycle.SavedStateHandle import androidx.navigation.testing.invoke @@ -24,9 +24,9 @@ import com.google.samples.apps.nowinandroid.core.model.data.Topic import com.google.samples.apps.nowinandroid.core.testing.repository.TestTopicsRepository import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository import com.google.samples.apps.nowinandroid.core.testing.util.MainDispatcherRule -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey -import com.google.samples.apps.nowinandroid.feature.interests.impl.InterestsUiState -import com.google.samples.apps.nowinandroid.feature.interests.impl.InterestsViewModel +import com.google.samples.apps.nowinandroid.feature.interests.InterestsUiState +import com.google.samples.apps.nowinandroid.feature.interests.InterestsViewModel +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher diff --git a/feature/foryou/impl/.gitignore b/feature/search/.gitignore similarity index 100% rename from feature/foryou/impl/.gitignore rename to feature/search/.gitignore diff --git a/feature/search/api/README.md b/feature/search/README.md similarity index 87% rename from feature/search/api/README.md rename to feature/search/README.md index a468f649d8..4404631af5 100644 --- a/feature/search/api/README.md +++ b/feature/search/README.md @@ -1,4 +1,4 @@ -# `:feature:search:api` +# `:feature:search` ## Module dependency graph @@ -13,10 +13,7 @@ config: graph TB subgraph :feature direction TB - subgraph :feature:search - direction TB - :feature:search:api[api]:::android-library - end + :feature:search[search]:::android-feature end subgraph :core direction TB @@ -26,11 +23,12 @@ graph TB :core:database[database]:::android-library :core:datastore[datastore]:::android-library :core:datastore-proto[datastore-proto]:::android-library + :core:designsystem[designsystem]:::android-library :core:domain[domain]:::android-library :core:model[model]:::jvm-library - :core:navigation[navigation]:::android-library :core:network[network]:::android-library :core:notifications[notifications]:::android-library + :core:ui[ui]:::android-library end :core:data -.-> :core:analytics @@ -49,8 +47,12 @@ graph TB :core:network --> :core:model :core:notifications -.-> :core:common :core:notifications --> :core:model - :feature:search:api -.-> :core:domain - :feature:search:api --> :core:navigation + :core:ui --> :core:analytics + :core:ui --> :core:designsystem + :core:ui --> :core:model + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; diff --git a/feature/search/api/.gitignore b/feature/search/api/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/feature/search/api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/feature/search/api/src/main/AndroidManifest.xml b/feature/search/api/src/main/AndroidManifest.xml deleted file mode 100644 index 312b22fd33..0000000000 --- a/feature/search/api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/feature/search/impl/build.gradle.kts b/feature/search/build.gradle.kts similarity index 79% rename from feature/search/impl/build.gradle.kts rename to feature/search/build.gradle.kts index 8425b29f3e..3f078a7839 100644 --- a/feature/search/impl/build.gradle.kts +++ b/feature/search/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,23 +15,20 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) alias(libs.plugins.nowinandroid.android.library.jacoco) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.search.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.search" } dependencies { implementation(projects.core.domain) - implementation(projects.feature.interests.api) - implementation(projects.feature.search.api) - implementation(projects.feature.topic.api) testImplementation(projects.core.testing) androidTestImplementation(libs.bundles.androidx.compose.ui.test) androidTestImplementation(projects.core.testing) -} \ No newline at end of file +} diff --git a/feature/search/impl/.gitignore b/feature/search/impl/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/feature/search/impl/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/feature/search/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreenTest.kt b/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt similarity index 91% rename from feature/search/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreenTest.kt rename to feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt index 3cb93530fc..01bd9f0e81 100644 --- a/feature/search/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreenTest.kt +++ b/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import androidx.activity.ComponentActivity import androidx.compose.ui.test.assertCountEquals @@ -29,14 +29,12 @@ import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performScrollToIndex import com.google.samples.apps.nowinandroid.core.data.model.RecentSearchQuery -import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig.DARK -import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.ANDROID +import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig +import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand 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.testing.data.followableTopicTestData import com.google.samples.apps.nowinandroid.core.testing.data.newsResourcesTestData -import com.google.samples.apps.nowinandroid.core.ui.R.string -import com.google.samples.apps.nowinandroid.feature.search.api.R import org.junit.Before import org.junit.Rule import org.junit.Test @@ -62,8 +60,8 @@ class SearchScreenTest { bookmarkedNewsResources = setOf("1", "3"), viewedNewsResources = setOf("1", "2", "4"), followedTopics = emptySet(), - themeBrand = ANDROID, - darkThemeConfig = DARK, + themeBrand = ThemeBrand.ANDROID, + darkThemeConfig = DarkThemeConfig.DARK, shouldHideOnboarding = true, useDynamicColor = false, ) @@ -71,12 +69,14 @@ class SearchScreenTest { @Before fun setup() { composeTestRule.activity.apply { - clearSearchContentDesc = getString(R.string.feature_search_api_clear_search_text_content_desc) - clearRecentSearchesContentDesc = getString(R.string.feature_search_api_clear_recent_searches_content_desc) + clearSearchContentDesc = + getString(R.string.feature_search_api_clear_search_text_content_desc) + clearRecentSearchesContentDesc = + getString(R.string.feature_search_api_clear_recent_searches_content_desc) followButtonContentDesc = - getString(string.core_ui_interests_card_follow_button_content_desc) + getString(com.google.samples.apps.nowinandroid.core.ui.R.string.core_ui_interests_card_follow_button_content_desc) unfollowButtonContentDesc = - getString(string.core_ui_interests_card_unfollow_button_content_desc) + getString(com.google.samples.apps.nowinandroid.core.ui.R.string.core_ui_interests_card_unfollow_button_content_desc) topicsString = getString(R.string.feature_search_api_topics) updatesString = getString(R.string.feature_search_api_updates) tryAnotherSearchString = getString(R.string.feature_search_api_try_another_search) + diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/RecentSearchQueriesUiState.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/RecentSearchQueriesUiState.kt similarity index 93% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/RecentSearchQueriesUiState.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/RecentSearchQueriesUiState.kt index 5b85166647..8aa5bb3b8c 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/RecentSearchQueriesUiState.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/RecentSearchQueriesUiState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import com.google.samples.apps.nowinandroid.core.data.model.RecentSearchQuery diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchResultUiState.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchResultUiState.kt similarity index 96% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchResultUiState.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchResultUiState.kt index 7a6f37087c..aaf7dba7dd 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchResultUiState.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchResultUiState.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic import com.google.samples.apps.nowinandroid.core.model.data.UserNewsResource diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreen.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt similarity index 99% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreen.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt index bb7164f2a9..8a0ad549c8 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchScreen.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import androidx.compose.foundation.clickable import androidx.compose.foundation.gestures.Orientation @@ -93,10 +93,10 @@ import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState.Success import com.google.samples.apps.nowinandroid.core.ui.R.string import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent import com.google.samples.apps.nowinandroid.core.ui.newsFeed -import com.google.samples.apps.nowinandroid.feature.search.api.R as searchR +import com.google.samples.apps.nowinandroid.feature.search.R as searchR @Composable -internal fun SearchScreen( +fun SearchScreen( onBackClick: () -> Unit, onInterestsClick: () -> Unit, onTopicClick: (String) -> Unit, diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchUiStatePreviewParameterProvider.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchUiStatePreviewParameterProvider.kt similarity index 96% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchUiStatePreviewParameterProvider.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchUiStatePreviewParameterProvider.kt index 1bda620c61..257d8b68e9 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchUiStatePreviewParameterProvider.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchUiStatePreviewParameterProvider.kt @@ -16,7 +16,7 @@ @file:Suppress("ktlint:standard:max-line-length") -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import androidx.compose.ui.tooling.preview.PreviewParameterProvider import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModel.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt similarity index 98% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModel.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt index 13628de70f..36947880e9 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModel.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModel.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel diff --git a/feature/search/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/api/navigation/SearchNavKey.kt b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/navigation/SearchNavKey.kt similarity index 84% rename from feature/search/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/api/navigation/SearchNavKey.kt rename to feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/navigation/SearchNavKey.kt index 9588a84044..9463bc3e6f 100644 --- a/feature/search/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/api/navigation/SearchNavKey.kt +++ b/feature/search/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/navigation/SearchNavKey.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.api.navigation +package com.google.samples.apps.nowinandroid.feature.search.navigation import androidx.navigation3.runtime.NavKey import kotlinx.serialization.Serializable diff --git a/feature/search/api/src/main/res/values/strings.xml b/feature/search/src/main/res/values/strings.xml similarity index 100% rename from feature/search/api/src/main/res/values/strings.xml rename to feature/search/src/main/res/values/strings.xml diff --git a/feature/search/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt similarity index 84% rename from feature/search/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModelTest.kt rename to feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index a1f089b998..7c2a4268ec 100644 --- a/feature/search/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl +package com.google.samples.apps.nowinandroid.feature.search import androidx.lifecycle.SavedStateHandle import com.google.samples.apps.nowinandroid.core.analytics.NoOpAnalyticsHelper @@ -27,10 +27,6 @@ import com.google.samples.apps.nowinandroid.core.testing.repository.TestSearchCo import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository import com.google.samples.apps.nowinandroid.core.testing.repository.emptyUserData import com.google.samples.apps.nowinandroid.core.testing.util.MainDispatcherRule -import com.google.samples.apps.nowinandroid.feature.search.impl.RecentSearchQueriesUiState.Success -import com.google.samples.apps.nowinandroid.feature.search.impl.SearchResultUiState.EmptyQuery -import com.google.samples.apps.nowinandroid.feature.search.impl.SearchResultUiState.Loading -import com.google.samples.apps.nowinandroid.feature.search.impl.SearchResultUiState.SearchNotReady import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch @@ -79,7 +75,7 @@ class SearchViewModelTest { @Test fun stateIsInitiallyLoading() = runTest { - assertEquals(Loading, viewModel.searchResultUiState.value) + assertEquals(SearchResultUiState.Loading, viewModel.searchResultUiState.value) } @Test @@ -90,7 +86,7 @@ class SearchViewModelTest { viewModel.onSearchQueryChanged("") - assertEquals(EmptyQuery, viewModel.searchResultUiState.value) + assertEquals(SearchResultUiState.EmptyQuery, viewModel.searchResultUiState.value) } @Test @@ -111,7 +107,7 @@ class SearchViewModelTest { viewModel.onSearchTriggered("kotlin") val result = viewModel.recentSearchQueriesUiState.value - assertIs(result) + assertIs(result) } @Test @@ -120,7 +116,7 @@ class SearchViewModelTest { viewModel.onSearchQueryChanged("") - assertEquals(SearchNotReady, viewModel.searchResultUiState.value) + assertEquals(SearchResultUiState.SearchNotReady, viewModel.searchResultUiState.value) } @Test @@ -138,11 +134,12 @@ class SearchViewModelTest { fun searchTextWithThreeSpaces_isEmptyQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) - val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } + val collectJob = + launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } viewModel.onSearchQueryChanged(" ") - assertIs(viewModel.searchResultUiState.value) + assertIs(viewModel.searchResultUiState.value) collectJob.cancel() } @@ -151,11 +148,12 @@ class SearchViewModelTest { fun searchTextWithThreeSpacesAndOneLetter_isEmptyQuery() = runTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) - val collectJob = launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } + val collectJob = + launch(UnconfinedTestDispatcher()) { viewModel.searchResultUiState.collect() } viewModel.onSearchQueryChanged(" a") - assertIs(viewModel.searchResultUiState.value) + assertIs(viewModel.searchResultUiState.value) collectJob.cancel() } diff --git a/feature/interests/api/.gitignore b/feature/settings/.gitignore similarity index 100% rename from feature/interests/api/.gitignore rename to feature/settings/.gitignore diff --git a/feature/settings/impl/README.md b/feature/settings/README.md similarity index 91% rename from feature/settings/impl/README.md rename to feature/settings/README.md index 88aadd9602..0efd9d4bfa 100644 --- a/feature/settings/impl/README.md +++ b/feature/settings/README.md @@ -13,10 +13,7 @@ config: graph TB subgraph :feature direction TB - subgraph :feature:settings - direction TB - :feature:settings:impl[impl]:::android-library - end + :feature:settings[settings]:::android-feature end subgraph :core direction TB @@ -50,9 +47,9 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:settings:impl -.-> :core:data - :feature:settings:impl -.-> :core:designsystem - :feature:settings:impl -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; diff --git a/feature/settings/impl/build.gradle.kts b/feature/settings/build.gradle.kts similarity index 89% rename from feature/settings/impl/build.gradle.kts rename to feature/settings/build.gradle.kts index d398e61037..95315c7f1d 100644 --- a/feature/settings/impl/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,13 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) alias(libs.plugins.nowinandroid.android.library.jacoco) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.settings.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.settings" } dependencies { diff --git a/feature/settings/impl/.gitignore b/feature/settings/impl/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/feature/settings/impl/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/feature/settings/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt b/feature/settings/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt similarity index 94% rename from feature/settings/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt rename to feature/settings/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt index f0f69a424d..217d8045d2 100644 --- a/feature/settings/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt +++ b/feature/settings/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialogTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,11 @@ import androidx.compose.ui.test.onNodeWithText import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig.DARK import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.ANDROID import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.DEFAULT -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Loading -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Success +import com.google.samples.apps.nowinandroid.feature.settings.R +import com.google.samples.apps.nowinandroid.feature.settings.SettingsDialog +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Loading +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Success +import com.google.samples.apps.nowinandroid.feature.settings.UserEditableSettings import org.junit.Rule import org.junit.Test diff --git a/feature/settings/impl/src/main/AndroidManifest.xml b/feature/settings/src/main/AndroidManifest.xml similarity index 100% rename from feature/settings/impl/src/main/AndroidManifest.xml rename to feature/settings/src/main/AndroidManifest.xml diff --git a/feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialog.kt b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt similarity index 97% rename from feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialog.kt rename to feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt index b2758e286e..3e5d4d51ea 100644 --- a/feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsDialog.kt +++ b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ @file:Suppress("ktlint:standard:max-line-length") -package com.google.samples.apps.nowinandroid.feature.settings.impl +package com.google.samples.apps.nowinandroid.feature.settings import android.content.Intent import androidx.compose.animation.AnimatedVisibility @@ -66,9 +66,9 @@ import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.ANDROID import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.DEFAULT import com.google.samples.apps.nowinandroid.core.ui.TrackScreenViewEvent -import com.google.samples.apps.nowinandroid.feature.settings.impl.R.string -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Loading -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Success +import com.google.samples.apps.nowinandroid.feature.settings.R.string +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Loading +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Success @Composable fun SettingsDialog( diff --git a/feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModel.kt b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModel.kt similarity index 90% rename from feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModel.kt rename to feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModel.kt index 274f916d13..13efa9a195 100644 --- a/feature/settings/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModel.kt +++ b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModel.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,15 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.settings.impl +package com.google.samples.apps.nowinandroid.feature.settings import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Loading -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Success +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Loading +import com.google.samples.apps.nowinandroid.feature.settings.SettingsUiState.Success import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.SharingStarted.Companion.WhileSubscribed import kotlinx.coroutines.flow.StateFlow diff --git a/feature/settings/impl/src/main/res/values/strings.xml b/feature/settings/src/main/res/values/strings.xml similarity index 100% rename from feature/settings/impl/src/main/res/values/strings.xml rename to feature/settings/src/main/res/values/strings.xml diff --git a/feature/settings/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModelTest.kt b/feature/settings/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModelTest.kt similarity index 75% rename from feature/settings/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModelTest.kt rename to feature/settings/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModelTest.kt index 1d275f745a..c76de0e6fc 100644 --- a/feature/settings/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/impl/SettingsViewModelTest.kt +++ b/feature/settings/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsViewModelTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,12 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.settings.impl +package com.google.samples.apps.nowinandroid.feature.settings -import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig.DARK -import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand.ANDROID +import com.google.samples.apps.nowinandroid.core.model.data.DarkThemeConfig +import com.google.samples.apps.nowinandroid.core.model.data.ThemeBrand import com.google.samples.apps.nowinandroid.core.testing.repository.TestUserDataRepository import com.google.samples.apps.nowinandroid.core.testing.util.MainDispatcherRule -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Loading -import com.google.samples.apps.nowinandroid.feature.settings.impl.SettingsUiState.Success import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.test.UnconfinedTestDispatcher @@ -47,21 +45,21 @@ class SettingsViewModelTest { @Test fun stateIsInitiallyLoading() = runTest { - assertEquals(Loading, viewModel.settingsUiState.value) + assertEquals(SettingsUiState.Loading, viewModel.settingsUiState.value) } @Test fun stateIsSuccessAfterUserDataLoaded() = runTest { backgroundScope.launch(UnconfinedTestDispatcher()) { viewModel.settingsUiState.collect() } - userDataRepository.setThemeBrand(ANDROID) - userDataRepository.setDarkThemeConfig(DARK) + userDataRepository.setThemeBrand(ThemeBrand.ANDROID) + userDataRepository.setDarkThemeConfig(DarkThemeConfig.DARK) assertEquals( - Success( + SettingsUiState.Success( UserEditableSettings( - brand = ANDROID, - darkThemeConfig = DARK, + brand = ThemeBrand.ANDROID, + darkThemeConfig = DarkThemeConfig.DARK, useDynamicColor = false, ), ), diff --git a/feature/interests/impl/.gitignore b/feature/topic/.gitignore similarity index 100% rename from feature/interests/impl/.gitignore rename to feature/topic/.gitignore diff --git a/feature/topic/impl/README.md b/feature/topic/README.md similarity index 100% rename from feature/topic/impl/README.md rename to feature/topic/README.md diff --git a/feature/topic/api/.gitignore b/feature/topic/api/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/feature/topic/api/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/feature/topic/api/README.md b/feature/topic/api/README.md deleted file mode 100644 index 62103d57b5..0000000000 --- a/feature/topic/api/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# :feature:topic:api module -## Dependency graph -![Dependency graph](../../../docs/images/graphs/dep_graph_feature_topic_api.svg) diff --git a/feature/topic/api/build.gradle.kts b/feature/topic/api/build.gradle.kts deleted file mode 100644 index 923a9b38bb..0000000000 --- a/feature/topic/api/build.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -plugins { - alias(libs.plugins.nowinandroid.android.feature.api) - alias(libs.plugins.nowinandroid.android.feature.impl) - alias(libs.plugins.nowinandroid.android.library.compose) -} - -android { - namespace = "com.google.samples.apps.nowinandroid.feature.topic.api" -} \ No newline at end of file diff --git a/feature/topic/impl/build.gradle.kts b/feature/topic/build.gradle.kts similarity index 87% rename from feature/topic/impl/build.gradle.kts rename to feature/topic/build.gradle.kts index fdf37c32e0..e45fb0182d 100644 --- a/feature/topic/impl/build.gradle.kts +++ b/feature/topic/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,17 @@ */ plugins { - alias(libs.plugins.nowinandroid.android.feature.impl) + alias(libs.plugins.nowinandroid.android.feature) alias(libs.plugins.nowinandroid.android.library.compose) alias(libs.plugins.nowinandroid.android.library.jacoco) } android { - namespace = "com.google.samples.apps.nowinandroid.feature.topic.impl" + namespace = "com.google.samples.apps.nowinandroid.feature.topic" } dependencies { implementation(projects.core.data) - implementation(projects.feature.topic.api) implementation(libs.androidx.compose.material3.adaptive.navigation3) @@ -35,4 +34,4 @@ dependencies { androidTestImplementation(libs.bundles.androidx.compose.ui.test) androidTestImplementation(projects.core.testing) -} \ No newline at end of file +} diff --git a/feature/topic/impl/.gitignore b/feature/topic/impl/.gitignore deleted file mode 100644 index 42afabfd2a..0000000000 --- a/feature/topic/impl/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/feature/topic/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt b/feature/topic/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt similarity index 93% rename from feature/topic/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt rename to feature/topic/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt index 5f6782160a..0770e1e5bb 100644 --- a/feature/topic/impl/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt +++ b/feature/topic/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreenTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,10 @@ import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performScrollToNode import com.google.samples.apps.nowinandroid.core.testing.data.followableTopicTestData import com.google.samples.apps.nowinandroid.core.testing.data.userNewsResourcesTestData -import com.google.samples.apps.nowinandroid.feature.topic.api.R +import com.google.samples.apps.nowinandroid.feature.topic.NewsUiState +import com.google.samples.apps.nowinandroid.feature.topic.R +import com.google.samples.apps.nowinandroid.feature.topic.TopicScreen +import com.google.samples.apps.nowinandroid.feature.topic.TopicUiState import org.junit.Before import org.junit.Rule import org.junit.Test diff --git a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreen.kt b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicScreen.kt similarity index 97% rename from feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreen.kt rename to feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicScreen.kt index 5c802f225b..65fcd8adf7 100644 --- a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicScreen.kt +++ b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicScreen.kt @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.topic.impl +package com.google.samples.apps.nowinandroid.feature.topic import androidx.annotation.VisibleForTesting import androidx.compose.foundation.gestures.Orientation @@ -69,7 +69,6 @@ import com.google.samples.apps.nowinandroid.core.ui.TrackScrollJank import com.google.samples.apps.nowinandroid.core.ui.UserNewsResourcePreviewParameterProvider import com.google.samples.apps.nowinandroid.core.ui.userNewsResourceCardItems import com.google.samples.apps.nowinandroid.core.ui.R as UiR -import com.google.samples.apps.nowinandroid.feature.topic.api.R as TopicR @Composable fun TopicScreen( @@ -125,7 +124,7 @@ internal fun TopicScreen( TopicUiState.Loading -> item { NiaLoadingWheel( modifier = modifier, - contentDesc = stringResource(id = TopicR.string.feature_topic_api_loading), + contentDesc = stringResource(id = R.string.feature_topic_api_loading), ) } diff --git a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModel.kt similarity index 98% rename from feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt rename to feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModel.kt index 8f780f0254..8865da463f 100644 --- a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt +++ b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModel.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.topic.impl +package com.google.samples.apps.nowinandroid.feature.topic import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope diff --git a/feature/topic/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/api/navigation/TopicNavKey.kt b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/navigation/TopicNavKey.kt similarity index 76% rename from feature/topic/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/api/navigation/TopicNavKey.kt rename to feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/navigation/TopicNavKey.kt index eb10b0cdd7..6cf4dd5fbf 100644 --- a/feature/topic/api/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/api/navigation/TopicNavKey.kt +++ b/feature/topic/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/navigation/TopicNavKey.kt @@ -14,17 +14,10 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.topic.api.navigation +package com.google.samples.apps.nowinandroid.feature.topic.navigation import androidx.navigation3.runtime.NavKey -import com.google.samples.apps.nowinandroid.core.navigation.Navigator import kotlinx.serialization.Serializable @Serializable data class TopicNavKey(val id: String) : NavKey - -fun Navigator.navigateToTopic( - topicId: String, -) { - navigate(TopicNavKey(topicId)) -} diff --git a/feature/topic/api/src/main/res/values/strings.xml b/feature/topic/src/main/res/values/strings.xml similarity index 100% rename from feature/topic/api/src/main/res/values/strings.xml rename to feature/topic/src/main/res/values/strings.xml diff --git a/feature/topic/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModelTest.kt b/feature/topic/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModelTest.kt similarity index 98% rename from feature/topic/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModelTest.kt rename to feature/topic/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModelTest.kt index 1bbf844c14..357563aa45 100644 --- a/feature/topic/impl/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModelTest.kt +++ b/feature/topic/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/topic/TopicViewModelTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.topic.impl +package com.google.samples.apps.nowinandroid.feature.topic import com.google.samples.apps.nowinandroid.core.data.repository.CompositeUserNewsResourceRepository import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b4bbd187e4..6183b3dcf6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -196,8 +196,7 @@ nowinandroid-android-application-compose = { id = "nowinandroid.android.applicat nowinandroid-android-application-firebase = { id = "nowinandroid.android.application.firebase" } nowinandroid-android-application-flavors = { id = "nowinandroid.android.application.flavors" } nowinandroid-android-application-jacoco = { id = "nowinandroid.android.application.jacoco" } -nowinandroid-android-feature-impl = { id = "nowinandroid.android.feature.impl" } -nowinandroid-android-feature-api = { id = "nowinandroid.android.feature.api" } +nowinandroid-android-feature = { id = "nowinandroid.android.feature" } nowinandroid-android-library = { id = "nowinandroid.android.library" } nowinandroid-android-library-compose = { id = "nowinandroid.android.library.compose" } nowinandroid-android-library-jacoco = { id = "nowinandroid.android.library.jacoco" } diff --git a/navigation/.gitignore b/navigation/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/navigation/.gitignore @@ -0,0 +1 @@ +/build diff --git a/feature/search/impl/README.md b/navigation/README.md similarity index 65% rename from feature/search/impl/README.md rename to navigation/README.md index 04800005c5..bf30284f87 100644 --- a/feature/search/impl/README.md +++ b/navigation/README.md @@ -1,4 +1,4 @@ -# `:feature:search:impl` +# `:navigation` ## Module dependency graph @@ -13,19 +13,12 @@ config: graph TB subgraph :feature direction TB - subgraph :feature:search - direction TB - :feature:search:api[api]:::android-library - :feature:search:impl[impl]:::android-library - end - subgraph :feature:interests - direction TB - :feature:interests:api[api]:::android-library - end - subgraph :feature:topic - direction TB - :feature:topic:api[api]:::android-library - end + :feature:bookmarks[bookmarks]:::android-feature + :feature:foryou[foryou]:::android-feature + :feature:interests[interests]:::android-feature + :feature:search[search]:::android-feature + :feature:settings[settings]:::android-feature + :feature:topic[topic]:::android-feature end subgraph :core direction TB @@ -43,6 +36,7 @@ graph TB :core:notifications[notifications]:::android-library :core:ui[ui]:::android-library end + :navigation[navigation]:::android-library :core:data -.-> :core:analytics :core:data --> :core:common @@ -63,18 +57,35 @@ graph TB :core:ui --> :core:analytics :core:ui --> :core:designsystem :core:ui --> :core:model - :feature:interests:api --> :core:navigation - :feature:search:api -.-> :core:domain - :feature:search:api --> :core:navigation - :feature:search:impl -.-> :core:designsystem - :feature:search:impl -.-> :core:domain - :feature:search:impl -.-> :core:ui - :feature:search:impl -.-> :feature:interests:api - :feature:search:impl -.-> :feature:search:api - :feature:search:impl -.-> :feature:topic:api - :feature:topic:api -.-> :core:designsystem - :feature:topic:api --> :core:navigation - :feature:topic:api -.-> :core:ui + :feature:bookmarks -.-> :core:data + :feature:bookmarks -.-> :core:designsystem + :feature:bookmarks -.-> :core:ui + :feature:bookmarks -.-> :feature:topic + :feature:foryou -.-> :core:designsystem + :feature:foryou -.-> :core:domain + :feature:foryou -.-> :core:notifications + :feature:foryou -.-> :core:ui + :feature:interests -.-> :core:designsystem + :feature:interests -.-> :core:domain + :feature:interests -.-> :core:ui + :feature:search -.-> :core:designsystem + :feature:search -.-> :core:domain + :feature:search -.-> :core:ui + :feature:settings -.-> :core:data + :feature:settings -.-> :core:designsystem + :feature:settings -.-> :core:ui + :feature:topic -.-> :core:data + :feature:topic -.-> :core:designsystem + :feature:topic -.-> :core:ui + :navigation -.-> :core:designsystem + :navigation -.-> :core:model + :navigation -.-> :core:navigation + :navigation -.-> :feature:bookmarks + :navigation -.-> :feature:foryou + :navigation -.-> :feature:interests + :navigation -.-> :feature:search + :navigation -.-> :feature:settings + :navigation -.-> :feature:topic classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000; classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000; diff --git a/navigation/build.gradle.kts b/navigation/build.gradle.kts new file mode 100644 index 0000000000..76e0587dd1 --- /dev/null +++ b/navigation/build.gradle.kts @@ -0,0 +1,40 @@ +/* + * Copyright 2026 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + alias(libs.plugins.nowinandroid.android.library) + alias(libs.plugins.nowinandroid.android.library.compose) + alias(libs.plugins.nowinandroid.hilt) +} + +android { + namespace = "com.google.samples.apps.nowinandroid.navigation" +} + +dependencies { + implementation(projects.core.designsystem) + implementation(projects.core.model) + implementation(projects.core.navigation) + implementation(projects.feature.bookmarks) + implementation(projects.feature.foryou) + implementation(projects.feature.interests) + implementation(projects.feature.search) + implementation(projects.feature.settings) + implementation(projects.feature.topic) + + implementation(libs.androidx.compose.material3.adaptive.navigation3) + implementation(libs.androidx.navigation3.runtime) + implementation(libs.androidx.hilt.lifecycle.viewModelCompose) +} diff --git a/navigation/consumer-rules.pro b/navigation/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/navigation/proguard-rules.pro b/navigation/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/navigation/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/feature/topic/api/src/main/AndroidManifest.xml b/navigation/src/main/AndroidManifest.xml similarity index 82% rename from feature/topic/api/src/main/AndroidManifest.xml rename to navigation/src/main/AndroidManifest.xml index 27a3ea8b09..bea660c36b 100644 --- a/feature/topic/api/src/main/AndroidManifest.xml +++ b/navigation/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ - + + + diff --git a/feature/search/api/build.gradle.kts b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/NavigatorExtensions.kt similarity index 53% rename from feature/search/api/build.gradle.kts rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/NavigatorExtensions.kt index d7ea6fc5fe..d5407d5858 100644 --- a/feature/search/api/build.gradle.kts +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/NavigatorExtensions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,18 @@ * limitations under the License. */ -plugins { - alias(libs.plugins.nowinandroid.android.feature.api) -} +package com.google.samples.apps.nowinandroid.navigation -android { - namespace = "com.google.samples.apps.nowinandroid.feature.search.api" -} +import com.google.samples.apps.nowinandroid.core.navigation.Navigator +import com.google.samples.apps.nowinandroid.feature.search.navigation.SearchNavKey +import com.google.samples.apps.nowinandroid.feature.topic.navigation.TopicNavKey -dependencies { - implementation(projects.core.domain) +fun Navigator.navigateToTopic( + topicId: String, +) { + navigate(TopicNavKey(topicId)) } +fun Navigator.navigateToSearch() { + navigate(SearchNavKey) +} diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt similarity index 78% rename from app/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt index 7021e4fa0c..7c66481ac9 100644 --- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/TopLevelNavItem.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,14 +18,13 @@ package com.google.samples.apps.nowinandroid.navigation import androidx.annotation.StringRes import androidx.compose.ui.graphics.vector.ImageVector -import com.google.samples.apps.nowinandroid.R import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksNavKey -import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouNavKey -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.R as bookmarksR -import com.google.samples.apps.nowinandroid.feature.foryou.api.R as forYouR -import com.google.samples.apps.nowinandroid.feature.search.api.R as searchR +import com.google.samples.apps.nowinandroid.feature.bookmarks.navigation.BookmarksNavKey +import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouNavKey +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.feature.bookmarks.R as bookmarksR +import com.google.samples.apps.nowinandroid.feature.foryou.R as forYouR +import com.google.samples.apps.nowinandroid.feature.search.R as searchR /** * Type for the top level navigation items in the application. Contains UI information about the @@ -49,7 +48,7 @@ val FOR_YOU = TopLevelNavItem( selectedIcon = NiaIcons.Upcoming, unselectedIcon = NiaIcons.UpcomingBorder, iconTextId = forYouR.string.feature_foryou_api_title, - titleTextId = R.string.app_name, + titleTextId = forYouR.string.feature_foryou_api_app_name, ) val BOOKMARKS = TopLevelNavItem( diff --git a/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/Utils.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/Utils.kt new file mode 100644 index 0000000000..433b00cab6 --- /dev/null +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/Utils.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2026 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.samples.apps.nowinandroid.navigation + +import androidx.compose.runtime.Composable +import androidx.navigation3.runtime.NavKey +import com.google.samples.apps.nowinandroid.core.model.data.UserNewsResource +import com.google.samples.apps.nowinandroid.core.navigation.NavigationState +import com.google.samples.apps.nowinandroid.core.navigation.rememberNavigationState +import com.google.samples.apps.nowinandroid.feature.bookmarks.navigation.BookmarksNavKey +import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouNavKey + +fun getTopLevelNavKeysWithUnreadResources( + forYouNewsResources: List, + bookmarkedNewsResources: List, +): Set = setOfNotNull( + ForYouNavKey.takeIf { forYouNewsResources.any { !it.hasBeenViewed } }, + BookmarksNavKey.takeIf { bookmarkedNewsResources.any { !it.hasBeenViewed } }, +) + +@Composable +fun getNavigationState(): NavigationState = + rememberNavigationState(startKey = ForYouNavKey, topLevelKeys = TOP_LEVEL_NAV_ITEMS.keys) + +fun NavigationState.shouldShowGradientBackground(): Boolean = currentTopLevelKey == ForYouNavKey diff --git a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/navigation/BookmarksEntryProvider.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/bookmarks/BookmarksEntryProvider.kt similarity index 80% rename from feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/navigation/BookmarksEntryProvider.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/bookmarks/BookmarksEntryProvider.kt index 4679656517..d6c869aa6e 100644 --- a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/navigation/BookmarksEntryProvider.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/bookmarks/BookmarksEntryProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.bookmarks.impl.navigation +package com.google.samples.apps.nowinandroid.navigation.bookmarks import androidx.compose.material3.SnackbarDuration.Short import androidx.compose.material3.SnackbarHostState @@ -23,9 +23,9 @@ import androidx.compose.runtime.compositionLocalOf import androidx.navigation3.runtime.EntryProviderScope import androidx.navigation3.runtime.NavKey import com.google.samples.apps.nowinandroid.core.navigation.Navigator -import com.google.samples.apps.nowinandroid.feature.bookmarks.api.navigation.BookmarksNavKey -import com.google.samples.apps.nowinandroid.feature.bookmarks.impl.BookmarksScreen -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic +import com.google.samples.apps.nowinandroid.feature.bookmarks.BookmarksScreen +import com.google.samples.apps.nowinandroid.feature.bookmarks.navigation.BookmarksNavKey +import com.google.samples.apps.nowinandroid.navigation.navigateToTopic fun EntryProviderScope.bookmarksEntry(navigator: Navigator) { entry { diff --git a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/foryou/ForYouEntryProvider.kt similarity index 70% rename from feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/foryou/ForYouEntryProvider.kt index 4bdc7368ca..a6fd48ee38 100644 --- a/feature/foryou/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/impl/navigation/ForYouEntryProvider.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/foryou/ForYouEntryProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.foryou.impl.navigation +package com.google.samples.apps.nowinandroid.navigation.foryou import androidx.navigation3.runtime.EntryProviderScope import androidx.navigation3.runtime.NavKey import com.google.samples.apps.nowinandroid.core.navigation.Navigator -import com.google.samples.apps.nowinandroid.feature.foryou.api.navigation.ForYouNavKey -import com.google.samples.apps.nowinandroid.feature.foryou.impl.ForYouScreen -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic +import com.google.samples.apps.nowinandroid.feature.foryou.ForYouScreen +import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouNavKey +import com.google.samples.apps.nowinandroid.navigation.navigateToTopic fun EntryProviderScope.forYouEntry(navigator: Navigator) { entry { diff --git a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/navigation/InterestsEntryProvider.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/interests/InterestsEntryProvider.kt similarity index 76% rename from feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/navigation/InterestsEntryProvider.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/interests/InterestsEntryProvider.kt index b92f462ebf..38807b0e69 100644 --- a/feature/interests/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/interests/impl/navigation/InterestsEntryProvider.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/interests/InterestsEntryProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.interests.impl.navigation +package com.google.samples.apps.nowinandroid.navigation.interests import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.material3.adaptive.navigation3.ListDetailSceneStrategy @@ -22,11 +22,11 @@ import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.navigation3.runtime.EntryProviderScope import androidx.navigation3.runtime.NavKey import com.google.samples.apps.nowinandroid.core.navigation.Navigator -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey -import com.google.samples.apps.nowinandroid.feature.interests.impl.InterestsDetailPlaceholder -import com.google.samples.apps.nowinandroid.feature.interests.impl.InterestsScreen -import com.google.samples.apps.nowinandroid.feature.interests.impl.InterestsViewModel -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic +import com.google.samples.apps.nowinandroid.feature.interests.InterestsDetailPlaceholder +import com.google.samples.apps.nowinandroid.feature.interests.InterestsScreen +import com.google.samples.apps.nowinandroid.feature.interests.InterestsViewModel +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.navigation.navigateToTopic @OptIn(ExperimentalMaterial3AdaptiveApi::class) fun EntryProviderScope.interestsEntry(navigator: Navigator) { diff --git a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/search/SearchEntryProvider.kt similarity index 68% rename from feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/search/SearchEntryProvider.kt index 4e3baf3437..24b5025d88 100644 --- a/feature/search/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/search/impl/navigation/SearchEntryProvider.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/search/SearchEntryProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,15 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.search.impl.navigation +package com.google.samples.apps.nowinandroid.navigation.search import androidx.navigation3.runtime.EntryProviderScope import androidx.navigation3.runtime.NavKey import com.google.samples.apps.nowinandroid.core.navigation.Navigator -import com.google.samples.apps.nowinandroid.feature.interests.api.navigation.InterestsNavKey -import com.google.samples.apps.nowinandroid.feature.search.api.navigation.SearchNavKey -import com.google.samples.apps.nowinandroid.feature.search.impl.SearchScreen -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic +import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsNavKey +import com.google.samples.apps.nowinandroid.feature.search.SearchScreen +import com.google.samples.apps.nowinandroid.feature.search.navigation.SearchNavKey +import com.google.samples.apps.nowinandroid.navigation.navigateToTopic fun EntryProviderScope.searchEntry(navigator: Navigator) { entry { diff --git a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/navigation/TopicEntryProvider.kt b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/topic/TopicEntryProvider.kt similarity index 74% rename from feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/navigation/TopicEntryProvider.kt rename to navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/topic/TopicEntryProvider.kt index b091ca7011..122f845c75 100644 --- a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/navigation/TopicEntryProvider.kt +++ b/navigation/src/main/kotlin/com/google/samples/apps/nowinandroid/navigation/topic/TopicEntryProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Android Open Source Project + * Copyright 2026 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.feature.topic.impl.navigation +package com.google.samples.apps.nowinandroid.navigation.topic import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi import androidx.compose.material3.adaptive.navigation3.ListDetailSceneStrategy @@ -22,11 +22,11 @@ import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.navigation3.runtime.EntryProviderScope import androidx.navigation3.runtime.NavKey import com.google.samples.apps.nowinandroid.core.navigation.Navigator -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.TopicNavKey -import com.google.samples.apps.nowinandroid.feature.topic.api.navigation.navigateToTopic -import com.google.samples.apps.nowinandroid.feature.topic.impl.TopicScreen -import com.google.samples.apps.nowinandroid.feature.topic.impl.TopicViewModel -import com.google.samples.apps.nowinandroid.feature.topic.impl.TopicViewModel.Factory +import com.google.samples.apps.nowinandroid.feature.topic.TopicScreen +import com.google.samples.apps.nowinandroid.feature.topic.TopicViewModel +import com.google.samples.apps.nowinandroid.feature.topic.TopicViewModel.Factory +import com.google.samples.apps.nowinandroid.feature.topic.navigation.TopicNavKey +import com.google.samples.apps.nowinandroid.navigation.navigateToTopic @OptIn(ExperimentalMaterial3AdaptiveApi::class) fun EntryProviderScope.topicEntry(navigator: Navigator) { diff --git a/settings.gradle.kts b/settings.gradle.kts index 73a1d9d6a6..e2a761e14e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -48,6 +48,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include(":app") include(":app-nia-catalog") include(":benchmarks") +include(":navigation") include(":core:analytics") include(":core:common") include(":core:data") @@ -66,17 +67,12 @@ include(":core:screenshot-testing") include(":core:testing") include(":core:ui") -include(":feature:foryou:api") -include(":feature:foryou:impl") -include(":feature:interests:api") -include(":feature:interests:impl") -include(":feature:bookmarks:api") -include(":feature:bookmarks:impl") -include(":feature:topic:api") -include(":feature:topic:impl") -include(":feature:search:api") -include(":feature:search:impl") -include(":feature:settings:impl") +include(":feature:foryou") +include(":feature:interests") +include(":feature:bookmarks") +include(":feature:topic") +include(":feature:search") +include(":feature:settings") include(":lint") include(":sync:work") include(":sync:sync-test")