@ -0,0 +1,58 @@
|
||||
# Now in Android Project
|
||||
|
||||
Now in Android is a native Android mobile application written in Kotlin. It provides regular news
|
||||
about Android development. Users can choose to follow topics, be notified when new content is
|
||||
available, and bookmark items.
|
||||
|
||||
## Architecture
|
||||
|
||||
This project is a modern Android application that follows the official architecture guidance from Google. It is a reactive, single-activity app that uses the following:
|
||||
|
||||
- **UI:** Built entirely with Jetpack Compose, including Material 3 components and adaptive layouts for different screen sizes.
|
||||
- **State Management:** Unidirectional Data Flow (UDF) is implemented using Kotlin Coroutines and `Flow`s. `ViewModel`s act as state holders, exposing UI state as streams of data.
|
||||
- **Dependency Injection:** Hilt is used for dependency injection throughout the app, simplifying the management of dependencies and improving testability.
|
||||
- **Navigation:** Navigation is handled by Jetpack Navigation 2 for Compose, allowing for a declarative and type-safe way to navigate between screens.
|
||||
- **Data:** The data layer is implemented using the repository pattern.
|
||||
- **Local Data:** Room and DataStore are used for local data persistence.
|
||||
- **Remote Data:** Retrofit and OkHttp are used for fetching data from the network.
|
||||
- **Background Processing:** WorkManager is used for deferrable background tasks.
|
||||
|
||||
## Modules
|
||||
|
||||
The main Android app lives in the `app/` folder. Feature modules live in `feature/` and core and shared modules in `core/`.
|
||||
|
||||
## Commands to Build & Test
|
||||
|
||||
The app and Android libraries have two product flavors: `demo` and `prod`, and two build types: `debug` and `release`.
|
||||
|
||||
- Build: `./gradlew assemble{Variant}`. Typically `assembleDemoDebug`.
|
||||
- Fix linting/formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
|
||||
- Run local tests: `./gradlew {variant}Test`
|
||||
- Run single test: `./gradlew {variant}Test --tests "com.example.myapp.MyTestClass"`
|
||||
- Run local screenshot tests: `./gradlew verifyRoborazziDemoDebug`
|
||||
|
||||
### Instrumented tests
|
||||
|
||||
- Gradle-managed devices to run on device tests: `./gradlew pixel6api31aospDebugAndroidTest`. Also `pixel4api30aospatdDebugAndroidTest` and `pixelcapi30aospatdDebugAndroidTest`.
|
||||
|
||||
### Creating tests
|
||||
|
||||
#### Instrumented tests
|
||||
|
||||
- Tests for UI features should only use `ComposeTestRule` with a `ComponentActivity`.
|
||||
- Bigger tests live in the `:app` module and they can start activities like `MainActivity`.
|
||||
|
||||
#### Local tests
|
||||
|
||||
- [kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) for most assertions
|
||||
- [cashapp/turbine](https://github.com/cashapp/turbine) for complex coroutine tests
|
||||
- [google/truth](https://github.com/google/truth) for assertions
|
||||
|
||||
## Continuous integration
|
||||
|
||||
- The workflows are defined in `.github/workflows/*.yaml` and they contain various checks.
|
||||
- Screenshot tests are generated by CI, so they shouldn't be checked into the repo from a workstation.
|
||||
|
||||
## Version control and code location
|
||||
|
||||
- The project uses git and is hosted in https://github.com/android/nowinandroid.
|
||||
@ -0,0 +1 @@
|
||||
* @dturner
|
||||
@ -1,3 +1,58 @@
|
||||
# :app-nia-catalog module
|
||||
## Dependency graph
|
||||

|
||||
# `:app-nia-catalog`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
:core:designsystem[designsystem]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
:core:ui[ui]:::android-library
|
||||
end
|
||||
:app-nia-catalog[app-nia-catalog]:::android-application
|
||||
|
||||
:app-nia-catalog -.-> :core:designsystem
|
||||
:app-nia-catalog -.-> :core:ui
|
||||
:core:ui --> :core:analytics
|
||||
:core:ui --> :core:designsystem
|
||||
:core:ui --> :core:model
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,178 @@
|
||||
# :app module
|
||||
## Dependency graph
|
||||

|
||||
# `:app`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
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 :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
:core:common[common]:::jvm-library
|
||||
:core:data[data]:::android-library
|
||||
: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
|
||||
:benchmarks[benchmarks]:::android-test
|
||||
:app[app]:::android-application
|
||||
|
||||
:app -.->|baselineProfile| :benchmarks
|
||||
:app -.-> :core:analytics
|
||||
:app -.-> :core:common
|
||||
:app -.-> :core:data
|
||||
:app -.-> :core:designsystem
|
||||
:app -.-> :core:model
|
||||
: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 -.-> :sync:work
|
||||
:benchmarks -.->|testedApks| :app
|
||||
:core:data -.-> :core:analytics
|
||||
:core:data --> :core:common
|
||||
:core:data --> :core:database
|
||||
:core:data --> :core:datastore
|
||||
:core:data --> :core:network
|
||||
:core:data -.-> :core:notifications
|
||||
:core:database --> :core:model
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
:core:domain --> :core:data
|
||||
:core:domain --> :core:model
|
||||
:core:network --> :core:common
|
||||
:core:network --> :core:model
|
||||
:core:notifications -.-> :core:common
|
||||
:core:notifications --> :core:model
|
||||
: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
|
||||
:sync:work -.-> :core:analytics
|
||||
:sync:work -.-> :core:data
|
||||
:sync:work -.-> :core:notifications
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
# Repackage classes into the default package to reduce the size of descriptors.
|
||||
-repackageclasses
|
||||
@ -1,72 +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.
|
||||
*/
|
||||
|
||||
package com.google.samples.apps.nowinandroid.navigation
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.navigation.compose.NavHost
|
||||
import com.google.samples.apps.nowinandroid.feature.bookmarks.navigation.bookmarksScreen
|
||||
import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouBaseRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.foryou.navigation.forYouSection
|
||||
import com.google.samples.apps.nowinandroid.feature.interests.navigation.navigateToInterests
|
||||
import com.google.samples.apps.nowinandroid.feature.search.navigation.searchScreen
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.navigation.navigateToTopic
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.navigation.topicScreen
|
||||
import com.google.samples.apps.nowinandroid.navigation.TopLevelDestination.INTERESTS
|
||||
import com.google.samples.apps.nowinandroid.ui.NiaAppState
|
||||
import com.google.samples.apps.nowinandroid.ui.interests2pane.interestsListDetailScreen
|
||||
|
||||
/**
|
||||
* Top-level navigation graph. Navigation is organized as explained at
|
||||
* https://d.android.com/jetpack/compose/nav-adaptive
|
||||
*
|
||||
* The navigation graph defined in this file defines the different top level routes. Navigation
|
||||
* within each route is handled using state and Back Handlers.
|
||||
*/
|
||||
@Composable
|
||||
fun NiaNavHost(
|
||||
appState: NiaAppState,
|
||||
onShowSnackbar: suspend (String, String?) -> Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val navController = appState.navController
|
||||
NavHost(
|
||||
navController = navController,
|
||||
startDestination = ForYouBaseRoute,
|
||||
modifier = modifier,
|
||||
) {
|
||||
forYouSection(
|
||||
onTopicClick = navController::navigateToTopic,
|
||||
) {
|
||||
topicScreen(
|
||||
showBackButton = true,
|
||||
onBackClick = navController::popBackStack,
|
||||
onTopicClick = navController::navigateToTopic,
|
||||
)
|
||||
}
|
||||
bookmarksScreen(
|
||||
onTopicClick = navController::navigateToInterests,
|
||||
onShowSnackbar = onShowSnackbar,
|
||||
)
|
||||
searchScreen(
|
||||
onBackClick = navController::popBackStack,
|
||||
onInterestsClick = { appState.navigateToTopLevelDestination(INTERESTS) },
|
||||
onTopicClick = navController::navigateToInterests,
|
||||
)
|
||||
interestsListDetailScreen()
|
||||
}
|
||||
}
|
||||
@ -1,76 +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.
|
||||
*/
|
||||
|
||||
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.navigation.BookmarksRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouBaseRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.foryou.navigation.ForYouRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsRoute
|
||||
import kotlin.reflect.KClass
|
||||
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 destinations in the application. Contains metadata about the destination
|
||||
* that is used in the top app bar and common navigation UI.
|
||||
*
|
||||
* @param selectedIcon The icon to be displayed in the navigation UI when this destination is
|
||||
* selected.
|
||||
* @param unselectedIcon The icon to be displayed in the navigation UI when this destination is
|
||||
* not selected.
|
||||
* @param iconTextId Text that to be displayed in the navigation UI.
|
||||
* @param titleTextId Text that is displayed on the top app bar.
|
||||
* @param route The route to use when navigating to this destination.
|
||||
* @param baseRoute The highest ancestor of this destination. Defaults to [route], meaning that
|
||||
* there is a single destination in that section of the app (no nested destinations).
|
||||
*/
|
||||
enum class TopLevelDestination(
|
||||
val selectedIcon: ImageVector,
|
||||
val unselectedIcon: ImageVector,
|
||||
@StringRes val iconTextId: Int,
|
||||
@StringRes val titleTextId: Int,
|
||||
val route: KClass<*>,
|
||||
val baseRoute: KClass<*> = route,
|
||||
) {
|
||||
FOR_YOU(
|
||||
selectedIcon = NiaIcons.Upcoming,
|
||||
unselectedIcon = NiaIcons.UpcomingBorder,
|
||||
iconTextId = forYouR.string.feature_foryou_title,
|
||||
titleTextId = R.string.app_name,
|
||||
route = ForYouRoute::class,
|
||||
baseRoute = ForYouBaseRoute::class,
|
||||
),
|
||||
BOOKMARKS(
|
||||
selectedIcon = NiaIcons.Bookmarks,
|
||||
unselectedIcon = NiaIcons.BookmarksBorder,
|
||||
iconTextId = bookmarksR.string.feature_bookmarks_title,
|
||||
titleTextId = bookmarksR.string.feature_bookmarks_title,
|
||||
route = BookmarksRoute::class,
|
||||
),
|
||||
INTERESTS(
|
||||
selectedIcon = NiaIcons.Grid3x3,
|
||||
unselectedIcon = NiaIcons.Grid3x3,
|
||||
iconTextId = searchR.string.feature_search_interests,
|
||||
titleTextId = searchR.string.feature_search_interests,
|
||||
route = InterestsRoute::class,
|
||||
),
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2025 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.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
|
||||
|
||||
/**
|
||||
* Type for the top level navigation items in the application. Contains UI information about the
|
||||
* current route that is used in the top app bar and common navigation UI.
|
||||
*
|
||||
* @param selectedIcon The icon to be displayed in the navigation UI when this destination is
|
||||
* selected.
|
||||
* @param unselectedIcon The icon to be displayed in the navigation UI when this destination is
|
||||
* not selected.
|
||||
* @param iconTextId Text that to be displayed in the navigation UI.
|
||||
* @param titleTextId Text that is displayed on the top app bar.
|
||||
*/
|
||||
data class TopLevelNavItem(
|
||||
val selectedIcon: ImageVector,
|
||||
val unselectedIcon: ImageVector,
|
||||
@StringRes val iconTextId: Int,
|
||||
@StringRes val titleTextId: Int,
|
||||
)
|
||||
|
||||
val FOR_YOU = TopLevelNavItem(
|
||||
selectedIcon = NiaIcons.Upcoming,
|
||||
unselectedIcon = NiaIcons.UpcomingBorder,
|
||||
iconTextId = forYouR.string.feature_foryou_api_title,
|
||||
titleTextId = R.string.app_name,
|
||||
)
|
||||
|
||||
val BOOKMARKS = TopLevelNavItem(
|
||||
selectedIcon = NiaIcons.Bookmarks,
|
||||
unselectedIcon = NiaIcons.BookmarksBorder,
|
||||
iconTextId = bookmarksR.string.feature_bookmarks_api_title,
|
||||
titleTextId = bookmarksR.string.feature_bookmarks_api_title,
|
||||
)
|
||||
|
||||
val INTERESTS = TopLevelNavItem(
|
||||
selectedIcon = NiaIcons.Grid3x3,
|
||||
unselectedIcon = NiaIcons.Grid3x3,
|
||||
iconTextId = searchR.string.feature_search_api_interests,
|
||||
titleTextId = searchR.string.feature_search_api_interests,
|
||||
)
|
||||
|
||||
val TOP_LEVEL_NAV_ITEMS = mapOf(
|
||||
ForYouNavKey to FOR_YOU,
|
||||
BookmarksNavKey to BOOKMARKS,
|
||||
InterestsNavKey(null) to INTERESTS,
|
||||
)
|
||||
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright 2024 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.ui.interests2pane
|
||||
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.navigation.toRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsRoute
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import javax.inject.Inject
|
||||
|
||||
const val TOPIC_ID_KEY = "selectedTopicId"
|
||||
|
||||
@HiltViewModel
|
||||
class Interests2PaneViewModel @Inject constructor(
|
||||
private val savedStateHandle: SavedStateHandle,
|
||||
) : ViewModel() {
|
||||
|
||||
val route = savedStateHandle.toRoute<InterestsRoute>()
|
||||
val selectedTopicId: StateFlow<String?> = savedStateHandle.getStateFlow(
|
||||
key = TOPIC_ID_KEY,
|
||||
initialValue = route.initialTopicId,
|
||||
)
|
||||
|
||||
fun onTopicClick(topicId: String?) {
|
||||
savedStateHandle[TOPIC_ID_KEY] = topicId
|
||||
}
|
||||
}
|
||||
@ -1,169 +0,0 @@
|
||||
/*
|
||||
* Copyright 2024 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.ui.interests2pane
|
||||
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.annotation.Keep
|
||||
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
|
||||
import androidx.compose.material3.adaptive.WindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.layout.AnimatedPane
|
||||
import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffold
|
||||
import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffoldRole
|
||||
import androidx.compose.material3.adaptive.layout.PaneAdaptedValue
|
||||
import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem
|
||||
import androidx.compose.material3.adaptive.layout.calculatePaneScaffoldDirective
|
||||
import androidx.compose.material3.adaptive.navigation.ThreePaneScaffoldNavigator
|
||||
import androidx.compose.material3.adaptive.navigation.rememberListDetailPaneScaffoldNavigator
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.key
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.Saver
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.google.samples.apps.nowinandroid.feature.interests.InterestsRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.interests.navigation.InterestsRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.TopicDetailPlaceholder
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.navigation.TopicRoute
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.navigation.navigateToTopic
|
||||
import com.google.samples.apps.nowinandroid.feature.topic.navigation.topicScreen
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.UUID
|
||||
|
||||
@Serializable internal object TopicPlaceholderRoute
|
||||
|
||||
// TODO: Remove @Keep when https://issuetracker.google.com/353898971 is fixed
|
||||
@Keep
|
||||
@Serializable internal object DetailPaneNavHostRoute
|
||||
|
||||
fun NavGraphBuilder.interestsListDetailScreen() {
|
||||
composable<InterestsRoute> {
|
||||
InterestsListDetailScreen()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun InterestsListDetailScreen(
|
||||
viewModel: Interests2PaneViewModel = hiltViewModel(),
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo = currentWindowAdaptiveInfo(),
|
||||
) {
|
||||
val selectedTopicId by viewModel.selectedTopicId.collectAsStateWithLifecycle()
|
||||
InterestsListDetailScreen(
|
||||
selectedTopicId = selectedTopicId,
|
||||
onTopicClick = viewModel::onTopicClick,
|
||||
windowAdaptiveInfo = windowAdaptiveInfo,
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
|
||||
@Composable
|
||||
internal fun InterestsListDetailScreen(
|
||||
selectedTopicId: String?,
|
||||
onTopicClick: (String) -> Unit,
|
||||
windowAdaptiveInfo: WindowAdaptiveInfo,
|
||||
) {
|
||||
val listDetailNavigator = rememberListDetailPaneScaffoldNavigator(
|
||||
scaffoldDirective = calculatePaneScaffoldDirective(windowAdaptiveInfo),
|
||||
initialDestinationHistory = listOfNotNull(
|
||||
ThreePaneScaffoldDestinationItem(ListDetailPaneScaffoldRole.List),
|
||||
ThreePaneScaffoldDestinationItem<Nothing>(ListDetailPaneScaffoldRole.Detail).takeIf {
|
||||
selectedTopicId != null
|
||||
},
|
||||
),
|
||||
)
|
||||
BackHandler(listDetailNavigator.canNavigateBack()) {
|
||||
listDetailNavigator.navigateBack()
|
||||
}
|
||||
|
||||
var nestedNavHostStartRoute by remember {
|
||||
val route = selectedTopicId?.let { TopicRoute(id = it) } ?: TopicPlaceholderRoute
|
||||
mutableStateOf(route)
|
||||
}
|
||||
var nestedNavKey by rememberSaveable(
|
||||
stateSaver = Saver({ it.toString() }, UUID::fromString),
|
||||
) {
|
||||
mutableStateOf(UUID.randomUUID())
|
||||
}
|
||||
val nestedNavController = key(nestedNavKey) {
|
||||
rememberNavController()
|
||||
}
|
||||
|
||||
fun onTopicClickShowDetailPane(topicId: String) {
|
||||
onTopicClick(topicId)
|
||||
if (listDetailNavigator.isDetailPaneVisible()) {
|
||||
// If the detail pane was visible, then use the nestedNavController navigate call
|
||||
// directly
|
||||
nestedNavController.navigateToTopic(topicId) {
|
||||
popUpTo<DetailPaneNavHostRoute>()
|
||||
}
|
||||
} else {
|
||||
// Otherwise, recreate the NavHost entirely, and start at the new destination
|
||||
nestedNavHostStartRoute = TopicRoute(id = topicId)
|
||||
nestedNavKey = UUID.randomUUID()
|
||||
}
|
||||
listDetailNavigator.navigateTo(ListDetailPaneScaffoldRole.Detail)
|
||||
}
|
||||
|
||||
ListDetailPaneScaffold(
|
||||
value = listDetailNavigator.scaffoldValue,
|
||||
directive = listDetailNavigator.scaffoldDirective,
|
||||
listPane = {
|
||||
AnimatedPane {
|
||||
InterestsRoute(
|
||||
onTopicClick = ::onTopicClickShowDetailPane,
|
||||
highlightSelectedTopic = listDetailNavigator.isDetailPaneVisible(),
|
||||
)
|
||||
}
|
||||
},
|
||||
detailPane = {
|
||||
AnimatedPane {
|
||||
key(nestedNavKey) {
|
||||
NavHost(
|
||||
navController = nestedNavController,
|
||||
startDestination = nestedNavHostStartRoute,
|
||||
route = DetailPaneNavHostRoute::class,
|
||||
) {
|
||||
topicScreen(
|
||||
showBackButton = !listDetailNavigator.isListPaneVisible(),
|
||||
onBackClick = listDetailNavigator::navigateBack,
|
||||
onTopicClick = ::onTopicClickShowDetailPane,
|
||||
)
|
||||
composable<TopicPlaceholderRoute> {
|
||||
TopicDetailPlaceholder()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
|
||||
private fun <T> ThreePaneScaffoldNavigator<T>.isListPaneVisible(): Boolean =
|
||||
scaffoldValue[ListDetailPaneScaffoldRole.List] == PaneAdaptedValue.Expanded
|
||||
|
||||
@OptIn(ExperimentalMaterial3AdaptiveApi::class)
|
||||
private fun <T> ThreePaneScaffoldNavigator<T>.isDetailPaneVisible(): Boolean =
|
||||
scaffoldValue[ListDetailPaneScaffoldRole.Detail] == PaneAdaptedValue.Expanded
|
||||
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Copyright 2025 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.
|
||||
#
|
||||
|
||||
sdk = 35
|
||||
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 198 KiB After Width: | Height: | Size: 198 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 216 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 97 KiB |
@ -0,0 +1,178 @@
|
||||
# `:benchmarks`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
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 :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
:core:common[common]:::jvm-library
|
||||
:core:data[data]:::android-library
|
||||
: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
|
||||
:benchmarks[benchmarks]:::android-test
|
||||
:app[app]:::android-application
|
||||
|
||||
:app -.->|baselineProfile| :benchmarks
|
||||
:app -.-> :core:analytics
|
||||
:app -.-> :core:common
|
||||
:app -.-> :core:data
|
||||
:app -.-> :core:designsystem
|
||||
:app -.-> :core:model
|
||||
: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 -.-> :sync:work
|
||||
:benchmarks -.->|testedApks| :app
|
||||
:core:data -.-> :core:analytics
|
||||
:core:data --> :core:common
|
||||
:core:data --> :core:database
|
||||
:core:data --> :core:datastore
|
||||
:core:data --> :core:network
|
||||
:core:data -.-> :core:notifications
|
||||
:core:database --> :core:model
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
:core:domain --> :core:data
|
||||
:core:domain --> :core:model
|
||||
:core:network --> :core:common
|
||||
:core:network --> :core:model
|
||||
:core:notifications -.-> :core:common
|
||||
:core:notifications --> :core:model
|
||||
: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
|
||||
:sync:work -.-> :core:analytics
|
||||
:sync:work -.-> :core:data
|
||||
:sync:work -.-> :core:notifications
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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<Project> {
|
||||
override fun apply(target: Project) {
|
||||
with(target) {
|
||||
apply(plugin = "nowinandroid.android.library")
|
||||
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
|
||||
|
||||
dependencies {
|
||||
"api"(project(":core:navigation"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2025 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.configureGraphTasks
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
|
||||
class RootPlugin : Plugin<Project> {
|
||||
override fun apply(target: Project) {
|
||||
require(target.path == ":")
|
||||
target.subprojects { configureGraphTasks() }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,353 @@
|
||||
/*
|
||||
* Copyright 2025 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
|
||||
|
||||
import com.android.utils.associateWithNotNull
|
||||
import com.google.samples.apps.nowinandroid.PluginType.Unknown
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.artifacts.ProjectDependency
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.provider.MapProperty
|
||||
import org.gradle.api.provider.Property
|
||||
import org.gradle.api.tasks.CacheableTask
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.OutputFile
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity.NONE
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.kotlin.dsl.assign
|
||||
import org.gradle.kotlin.dsl.register
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
import kotlin.text.RegexOption.DOT_MATCHES_ALL
|
||||
|
||||
/**
|
||||
* Generates module dependency graphs with `graphDump` task, and update the corresponding `README.md` file with `graphUpdate`.
|
||||
*
|
||||
* This is not an optimal implementation and could be improved if needed:
|
||||
* - [Graph.invoke] is **recursively** searching through dependent projects (although in practice it will never reach a stack overflow).
|
||||
* - [Graph.invoke] is entirely re-executed for all projects, without re-using intermediate values.
|
||||
* - [Graph.invoke] is always executed during Gradle's Configuration phase (but takes in general less than 1 ms for a project).
|
||||
*
|
||||
* The resulting graphs can be configured with `graph.ignoredProjects` and `graph.supportedConfigurations` properties.
|
||||
*/
|
||||
private class Graph(
|
||||
private val root: Project,
|
||||
private val dependencies: MutableMap<Project, Set<Pair<Configuration, Project>>> = mutableMapOf(),
|
||||
private val plugins: MutableMap<Project, PluginType> = mutableMapOf(),
|
||||
private val seen: MutableSet<String> = mutableSetOf(),
|
||||
) {
|
||||
|
||||
private val ignoredProjects = root.providers.gradleProperty("graph.ignoredProjects")
|
||||
.map { it.split(",").toSet() }
|
||||
.orElse(emptySet())
|
||||
private val supportedConfigurations =
|
||||
root.providers.gradleProperty("graph.supportedConfigurations")
|
||||
.map { it.split(",").toSet() }
|
||||
.orElse(setOf("api", "implementation", "baselineProfile", "testedApks"))
|
||||
|
||||
operator fun invoke(project: Project = root): Graph {
|
||||
if (project.path in seen) return this
|
||||
seen += project.path
|
||||
plugins.putIfAbsent(
|
||||
project,
|
||||
PluginType.entries.firstOrNull { project.pluginManager.hasPlugin(it.id) } ?: Unknown,
|
||||
)
|
||||
dependencies.compute(project) { _, u -> u.orEmpty() }
|
||||
project.configurations
|
||||
.matching { it.name in supportedConfigurations.get() }
|
||||
.associateWithNotNull { it.dependencies.withType<ProjectDependency>().ifEmpty { null } }
|
||||
.flatMap { (c, value) -> value.map { dep -> c to project.project(dep.path) } }
|
||||
.filter { (_, p) -> p.path !in ignoredProjects.get() }
|
||||
.forEach { (configuration: Configuration, projectDependency: Project) ->
|
||||
dependencies.compute(project) { _, u -> u.orEmpty() + (configuration to projectDependency) }
|
||||
invoke(projectDependency)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
fun dependencies(): Map<String, Set<Pair<String, String>>> = dependencies
|
||||
.mapKeys { it.key.path }
|
||||
.mapValues { it.value.mapTo(mutableSetOf()) { (c, p) -> c.name to p.path } }
|
||||
|
||||
fun plugins() = plugins.mapKeys { it.key.path }
|
||||
}
|
||||
|
||||
/**
|
||||
* Declaration order is important, as only the first match will be retained.
|
||||
*/
|
||||
internal enum class PluginType(val id: String, val ref: String, val style: String) {
|
||||
AndroidApplication(
|
||||
id = "nowinandroid.android.application",
|
||||
ref = "android-application",
|
||||
style = "fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
AndroidFeature(
|
||||
id = "nowinandroid.android.feature",
|
||||
ref = "android-feature",
|
||||
style = "fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
AndroidLibrary(
|
||||
id = "nowinandroid.android.library",
|
||||
ref = "android-library",
|
||||
style = "fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
AndroidTest(
|
||||
id = "nowinandroid.android.test",
|
||||
ref = "android-test",
|
||||
style = "fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
Jvm(
|
||||
id = "nowinandroid.jvm.library",
|
||||
ref = "jvm-library",
|
||||
style = "fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
Unknown(
|
||||
id = "?",
|
||||
ref = "unknown",
|
||||
style = "fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000",
|
||||
),
|
||||
}
|
||||
|
||||
internal fun Project.configureGraphTasks() {
|
||||
if (!buildFile.exists()) return // Ignore root modules without build file
|
||||
val dumpTask = tasks.register<GraphDumpTask>("graphDump") {
|
||||
val graph = Graph(this@configureGraphTasks).invoke()
|
||||
projectPath = this@configureGraphTasks.path
|
||||
dependencies = graph.dependencies()
|
||||
plugins = graph.plugins()
|
||||
output = this@configureGraphTasks.layout.buildDirectory.file("mermaid/graph.txt")
|
||||
legend = this@configureGraphTasks.layout.buildDirectory.file("mermaid/legend.txt")
|
||||
}
|
||||
tasks.register<GraphUpdateTask>("graphUpdate") {
|
||||
projectPath = this@configureGraphTasks.path
|
||||
input = dumpTask.flatMap { it.output }
|
||||
legend = dumpTask.flatMap { it.legend }
|
||||
output = this@configureGraphTasks.layout.projectDirectory.file("README.md")
|
||||
}
|
||||
}
|
||||
|
||||
@CacheableTask
|
||||
private abstract class GraphDumpTask : DefaultTask() {
|
||||
|
||||
@get:Input
|
||||
abstract val projectPath: Property<String>
|
||||
|
||||
@get:Input
|
||||
abstract val dependencies: MapProperty<String, Set<Pair<String, String>>>
|
||||
|
||||
@get:Input
|
||||
abstract val plugins: MapProperty<String, PluginType>
|
||||
|
||||
@get:OutputFile
|
||||
abstract val output: RegularFileProperty
|
||||
|
||||
@get:OutputFile
|
||||
abstract val legend: RegularFileProperty
|
||||
|
||||
override fun getDescription() = "Dumps project dependencies to a mermaid file."
|
||||
|
||||
@TaskAction
|
||||
operator fun invoke() {
|
||||
output.get().asFile.writeText(mermaid())
|
||||
legend.get().asFile.writeText(legend())
|
||||
logger.lifecycle(output.get().asFile.toPath().toUri().toString())
|
||||
}
|
||||
|
||||
private fun mermaid() = buildString {
|
||||
val dependencies: Set<Dependency> = dependencies.get()
|
||||
.flatMapTo(mutableSetOf()) { (project, entries) -> entries.map { it.toDependency(project) } }
|
||||
// FrontMatter configuration (not supported yet on GitHub.com)
|
||||
appendLine(
|
||||
// language=YAML
|
||||
"""
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
""".trimIndent(),
|
||||
)
|
||||
// Graph declaration
|
||||
appendLine("graph TB")
|
||||
// Nodes and subgraphs
|
||||
val (rootProjects, nestedProjects) = dependencies
|
||||
.map { listOf(it.project, it.dependency) }.flatten().toSet()
|
||||
.plus(projectPath.get()) // Special case when this specific module has no other dependency
|
||||
.groupBy { it.substringBeforeLast(":") }
|
||||
.entries.partition { it.key.isEmpty() }
|
||||
|
||||
val orderedGroups = nestedProjects.groupBy {
|
||||
if (it.key.count { char -> char == ':' } > 1) it.key.substringBeforeLast(":") else ""
|
||||
}
|
||||
|
||||
orderedGroups.forEach { (outerGroup, innerGroups) ->
|
||||
if (outerGroup.isNotEmpty()) {
|
||||
appendLine(" subgraph $outerGroup")
|
||||
appendLine(" direction TB")
|
||||
}
|
||||
innerGroups.sortedWith(
|
||||
compareBy(
|
||||
{ (group, _) ->
|
||||
dependencies.filter { dep ->
|
||||
val toGroup = dep.dependency.substringBeforeLast(":")
|
||||
toGroup == group && dep.project.substringBeforeLast(":") != group
|
||||
}.count()
|
||||
},
|
||||
{ -it.value.size },
|
||||
),
|
||||
).forEach { (group, projects) ->
|
||||
val indent = if (outerGroup.isNotEmpty()) 4 else 2
|
||||
appendLine(" ".repeat(indent) + "subgraph $group")
|
||||
appendLine(" ".repeat(indent) + " direction TB")
|
||||
projects.sorted().forEach {
|
||||
appendLine(it.alias(indent = indent + 2, plugins.get().getValue(it)))
|
||||
}
|
||||
appendLine(" ".repeat(indent) + "end")
|
||||
}
|
||||
if (outerGroup.isNotEmpty()) {
|
||||
appendLine(" end")
|
||||
}
|
||||
}
|
||||
|
||||
rootProjects.flatMap { it.value }.sortedDescending().forEach {
|
||||
appendLine(it.alias(indent = 2, plugins.get().getValue(it)))
|
||||
}
|
||||
// Links
|
||||
if (dependencies.isNotEmpty()) appendLine()
|
||||
dependencies
|
||||
.sortedWith(compareBy({ it.project }, { it.dependency }, { it.configuration }))
|
||||
.forEach { appendLine(it.link(indent = 2)) }
|
||||
// Classes
|
||||
appendLine()
|
||||
PluginType.entries.forEach { appendLine(it.classDef()) }
|
||||
}
|
||||
|
||||
private fun legend() = buildString {
|
||||
appendLine("graph TB")
|
||||
listOf(
|
||||
"application" to PluginType.AndroidApplication,
|
||||
"feature" to PluginType.AndroidFeature,
|
||||
"library" to PluginType.AndroidLibrary,
|
||||
"jvm" to PluginType.Jvm,
|
||||
).forEach { (name, type) ->
|
||||
appendLine(name.alias(indent = 2, type))
|
||||
}
|
||||
appendLine()
|
||||
listOf(
|
||||
Dependency("application", "implementation", "feature"),
|
||||
Dependency("library", "api", "jvm"),
|
||||
).forEach {
|
||||
appendLine(it.link(indent = 2))
|
||||
}
|
||||
appendLine()
|
||||
PluginType.entries.forEach { appendLine(it.classDef()) }
|
||||
}
|
||||
|
||||
private class Dependency(val project: String, val configuration: String, val dependency: String)
|
||||
|
||||
private fun Pair<String, String>.toDependency(project: String) =
|
||||
Dependency(project, configuration = first, dependency = second)
|
||||
|
||||
private fun String.alias(indent: Int, pluginType: PluginType): String = buildString {
|
||||
append(" ".repeat(indent))
|
||||
append(this@alias)
|
||||
append("[").append(substringAfterLast(":")).append("]:::")
|
||||
append(pluginType.ref)
|
||||
}
|
||||
|
||||
private fun Dependency.link(indent: Int) = buildString {
|
||||
append(" ".repeat(indent))
|
||||
append(project).append(" ")
|
||||
append(
|
||||
when (configuration) {
|
||||
"api" -> "-->"
|
||||
"implementation" -> "-.->"
|
||||
else -> "-.->|$configuration|"
|
||||
},
|
||||
)
|
||||
append(" ").append(dependency)
|
||||
}
|
||||
|
||||
private fun PluginType.classDef() = "classDef $ref $style;"
|
||||
}
|
||||
|
||||
@CacheableTask
|
||||
private abstract class GraphUpdateTask : DefaultTask() {
|
||||
|
||||
@get:Input
|
||||
abstract val projectPath: Property<String>
|
||||
|
||||
@get:InputFile
|
||||
@get:PathSensitive(NONE)
|
||||
abstract val input: RegularFileProperty
|
||||
|
||||
@get:InputFile
|
||||
@get:PathSensitive(NONE)
|
||||
abstract val legend: RegularFileProperty
|
||||
|
||||
@get:OutputFile
|
||||
abstract val output: RegularFileProperty
|
||||
|
||||
override fun getDescription() = "Updates Markdown file with the corresponding dependency graph."
|
||||
|
||||
@TaskAction
|
||||
operator fun invoke() = with(output.get().asFile) {
|
||||
if (!exists()) {
|
||||
createNewFile()
|
||||
writeText(
|
||||
"""
|
||||
# `${projectPath.get()}`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph--> <!--endregion-->
|
||||
|
||||
""".trimIndent(),
|
||||
)
|
||||
}
|
||||
val mermaid = input.get().asFile.readText().trimTrailingNewLines()
|
||||
val legend = legend.get().asFile.readText().trimTrailingNewLines()
|
||||
val regex = """(<!--region graph-->)(.*?)(<!--endregion-->)""".toRegex(DOT_MATCHES_ALL)
|
||||
val text = readText().replace(regex) { match ->
|
||||
val (start, _, end) = match.destructured
|
||||
"""
|
||||
|$start
|
||||
|```mermaid
|
||||
|$mermaid
|
||||
|```
|
||||
|
|
||||
|<details><summary>📋 Graph legend</summary>
|
||||
|
|
||||
|```mermaid
|
||||
|$legend
|
||||
|```
|
||||
|
|
||||
|</details>
|
||||
|$end
|
||||
""".trimMargin()
|
||||
}
|
||||
writeText(text)
|
||||
}
|
||||
|
||||
private fun String.trimTrailingNewLines() = lines()
|
||||
.dropLastWhile(String::isBlank)
|
||||
.joinToString(System.lineSeparator())
|
||||
}
|
||||
@ -1,3 +1,48 @@
|
||||
# :core:analytics module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:analytics`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
end
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,48 @@
|
||||
# :core:common module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:common`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:common[common]:::jvm-library
|
||||
end
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,73 @@
|
||||
# :core:data-test module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:data-test`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
:core:common[common]:::jvm-library
|
||||
:core:data[data]:::android-library
|
||||
:core:data-test[data-test]:::android-library
|
||||
:core:database[database]:::android-library
|
||||
:core:datastore[datastore]:::android-library
|
||||
:core:datastore-proto[datastore-proto]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
:core:network[network]:::android-library
|
||||
:core:notifications[notifications]:::android-library
|
||||
end
|
||||
|
||||
:core:data -.-> :core:analytics
|
||||
:core:data --> :core:common
|
||||
:core:data --> :core:database
|
||||
:core:data --> :core:datastore
|
||||
:core:data --> :core:network
|
||||
:core:data -.-> :core:notifications
|
||||
:core:data-test --> :core:data
|
||||
:core:database --> :core:model
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
:core:network --> :core:common
|
||||
:core:network --> :core:model
|
||||
:core:notifications -.-> :core:common
|
||||
:core:notifications --> :core:model
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,71 @@
|
||||
# :core:data module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:data`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:analytics[analytics]:::android-library
|
||||
:core:common[common]:::jvm-library
|
||||
:core:data[data]:::android-library
|
||||
:core:database[database]:::android-library
|
||||
:core:datastore[datastore]:::android-library
|
||||
:core:datastore-proto[datastore-proto]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
:core:network[network]:::android-library
|
||||
:core:notifications[notifications]:::android-library
|
||||
end
|
||||
|
||||
:core:data -.-> :core:analytics
|
||||
:core:data --> :core:common
|
||||
:core:data --> :core:database
|
||||
:core:data --> :core:datastore
|
||||
:core:data --> :core:network
|
||||
:core:data -.-> :core:notifications
|
||||
:core:database --> :core:model
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
:core:network --> :core:common
|
||||
:core:network --> :core:model
|
||||
:core:notifications -.-> :core:common
|
||||
:core:notifications --> :core:model
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,51 @@
|
||||
# :core:database module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:database`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:database[database]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
end
|
||||
|
||||
:core:database --> :core:model
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright 2025 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.core.database.dao
|
||||
|
||||
import android.content.Context
|
||||
import androidx.room.Room
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import com.google.samples.apps.nowinandroid.core.database.NiaDatabase
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
|
||||
internal abstract class DatabaseTest {
|
||||
|
||||
private lateinit var db: NiaDatabase
|
||||
protected lateinit var newsResourceDao: NewsResourceDao
|
||||
protected lateinit var topicDao: TopicDao
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
db = run {
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
Room.inMemoryDatabaseBuilder(
|
||||
context,
|
||||
NiaDatabase::class.java,
|
||||
).build()
|
||||
}
|
||||
newsResourceDao = db.newsResourceDao()
|
||||
topicDao = db.topicDao()
|
||||
}
|
||||
|
||||
@After
|
||||
fun teardown() = db.close()
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright 2024 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.core.database.dao
|
||||
|
||||
import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
internal class TopicDaoTest : DatabaseTest() {
|
||||
|
||||
@Test
|
||||
fun getTopics() = runTest {
|
||||
insertTopics()
|
||||
|
||||
val savedTopics = topicDao.getTopicEntities().first()
|
||||
|
||||
assertEquals(
|
||||
listOf("1", "2", "3"),
|
||||
savedTopics.map { it.id },
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTopic() = runTest {
|
||||
insertTopics()
|
||||
|
||||
val savedTopicEntity = topicDao.getTopicEntity("2").first()
|
||||
|
||||
assertEquals("performance", savedTopicEntity.name)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTopics_oneOff() = runTest {
|
||||
insertTopics()
|
||||
|
||||
val savedTopics = topicDao.getOneOffTopicEntities()
|
||||
|
||||
assertEquals(
|
||||
listOf("1", "2", "3"),
|
||||
savedTopics.map { it.id },
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getTopics_byId() = runTest {
|
||||
insertTopics()
|
||||
|
||||
val savedTopics = topicDao.getTopicEntities(setOf("1", "2"))
|
||||
.first()
|
||||
|
||||
assertEquals(listOf("compose", "performance"), savedTopics.map { it.name })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun insertTopic_newEntryIsIgnoredIfAlreadyExists() = runTest {
|
||||
insertTopics()
|
||||
topicDao.insertOrIgnoreTopics(
|
||||
listOf(testTopicEntity("1", "compose")),
|
||||
)
|
||||
|
||||
val savedTopics = topicDao.getOneOffTopicEntities()
|
||||
|
||||
assertEquals(3, savedTopics.size)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun upsertTopic_existingEntryIsUpdated() = runTest {
|
||||
insertTopics()
|
||||
topicDao.upsertTopics(
|
||||
listOf(testTopicEntity("1", "newName")),
|
||||
)
|
||||
|
||||
val savedTopics = topicDao.getOneOffTopicEntities()
|
||||
|
||||
assertEquals(3, savedTopics.size)
|
||||
assertEquals("newName", savedTopics.first().name)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun deleteTopics_byId_existingEntriesAreDeleted() = runTest {
|
||||
insertTopics()
|
||||
topicDao.deleteTopics(listOf("1", "2"))
|
||||
|
||||
val savedTopics = topicDao.getOneOffTopicEntities()
|
||||
|
||||
assertEquals(1, savedTopics.size)
|
||||
assertEquals("3", savedTopics.first().id)
|
||||
}
|
||||
|
||||
private suspend fun insertTopics() {
|
||||
val topicEntities = listOf(
|
||||
testTopicEntity("1", "compose"),
|
||||
testTopicEntity("2", "performance"),
|
||||
testTopicEntity("3", "headline"),
|
||||
)
|
||||
topicDao.insertOrIgnoreTopics(topicEntities)
|
||||
}
|
||||
}
|
||||
|
||||
private fun testTopicEntity(
|
||||
id: String = "0",
|
||||
name: String,
|
||||
) = TopicEntity(
|
||||
id = id,
|
||||
name = name,
|
||||
shortDescription = "",
|
||||
longDescription = "",
|
||||
url = "",
|
||||
imageUrl = "",
|
||||
)
|
||||
@ -1,3 +1,48 @@
|
||||
# :core:datastore-proto module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:datastore-proto`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:datastore-proto[datastore-proto]:::android-library
|
||||
end
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,58 @@
|
||||
# :core:datastore-test module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:datastore-test`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:common[common]:::jvm-library
|
||||
:core:datastore[datastore]:::android-library
|
||||
:core:datastore-proto[datastore-proto]:::android-library
|
||||
:core:datastore-test[datastore-test]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
end
|
||||
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
:core:datastore-test -.-> :core:common
|
||||
:core:datastore-test -.-> :core:datastore
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,55 @@
|
||||
# :core:datastore module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:datastore`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:common[common]:::jvm-library
|
||||
:core:datastore[datastore]:::android-library
|
||||
:core:datastore-proto[datastore-proto]:::android-library
|
||||
:core:model[model]:::jvm-library
|
||||
end
|
||||
|
||||
:core:datastore -.-> :core:common
|
||||
:core:datastore --> :core:datastore-proto
|
||||
:core:datastore --> :core:model
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -1,3 +1,48 @@
|
||||
# :core:designsystem module
|
||||
## Dependency graph
|
||||

|
||||
# `:core:designsystem`
|
||||
|
||||
## Module dependency graph
|
||||
|
||||
<!--region graph-->
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
layout: elk
|
||||
elk:
|
||||
nodePlacementStrategy: SIMPLE
|
||||
---
|
||||
graph TB
|
||||
subgraph :core
|
||||
direction TB
|
||||
:core:designsystem[designsystem]:::android-library
|
||||
end
|
||||
|
||||
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;
|
||||
```
|
||||
|
||||
<details><summary>📋 Graph legend</summary>
|
||||
|
||||
```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;
|
||||
```
|
||||
|
||||
</details>
|
||||
<!--endregion-->
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
#
|
||||
# Copyright 2025 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.
|
||||
#
|
||||
|
||||
sdk = 35
|
||||
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 873 B |