Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyeonkyoon/architecture-samples
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: android/architecture-samples
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 6,384 additions and 6,711 deletions.
  1. +0 −92 .circleci/config.yml
  2. +23 −0 .github/ci-gradle.properties
  3. +60 −0 .github/workflows/build_test.yaml
  4. +31 −0 .github/workflows/copy-branch.yml
  5. +43 −0 .google/packaging.yaml
  6. +0 −20 .travis.yml
  7. +26 −26 README.md
  8. +0 −174 app/build.gradle
  9. +200 −0 app/build.gradle.kts
  10. +0 −2 app/proguardTest-rules.pro
  11. +120 −0 ...est/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskScreenTest.kt
  12. +224 −0 ...oidTest/java/com/example/android/architecture/blueprints/todoapp/data/source/local/TaskDaoTest.kt
  13. +92 −0 ...dTest/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsScreenTest.kt
  14. +118 −0 ...dTest/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailScreenTest.kt
  15. +194 −0 ...c/androidTest/java/com/example/android/architecture/blueprints/todoapp/tasks/AppNavigationTest.kt
  16. +279 −0 ...src/androidTest/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreenTest.kt
  17. +311 −0 app/src/androidTest/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksTest.kt
  18. +0 −241 ...droidTestMock/java/com/example/android/architecture/blueprints/todoapp/tasks/AppNavigationTest.kt
  19. +0 −315 ...droidTestMock/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksActivityTest.kt
  20. +0 −31 app/src/androidTestMock/java/com/example/android/architecture/blueprints/todoapp/tasks/TestUtils.kt
  21. +26 −0 app/src/debug/AndroidManifest.xml
  22. +23 −0 app/src/debug/java/com/example/android/architecture/blueprints/todoapp/HiltTestActivity.kt
  23. +15 −15 app/src/main/AndroidManifest.xml
  24. +0 −59 app/src/main/java/com/example/android/architecture/blueprints/todoapp/Event.kt
  25. +0 −40 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/ScrollChildSwipeRefreshLayout.kt
  26. +39 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/TodoActivity.kt
  27. +6 −11 app/src/main/java/com/example/android/architecture/blueprints/todoapp/TodoApplication.kt
  28. +119 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/TodoNavGraph.kt
  29. +106 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/TodoNavigation.kt
  30. +0 −60 app/src/main/java/com/example/android/architecture/blueprints/todoapp/ViewModelFactory.kt
  31. +0 −79 .../main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragment.kt
  32. +158 −0 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskScreen.kt
  33. +96 −87 ...main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskViewModel.kt
  34. +187 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/DefaultTaskRepository.kt
  35. +92 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/ModelMappingExt.kt
  36. +0 −44 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/Result.kt
  37. +12 −15 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/Task.kt
  38. +12 −16 ...mple/android/architecture/blueprints/todoapp/data/{source/TasksRepository.kt → TaskRepository.kt}
  39. +0 −167 ...in/java/com/example/android/architecture/blueprints/todoapp/data/source/DefaultTasksRepository.kt
  40. +0 −54 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/source/TasksDataSource.kt
  41. +37 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/source/local/LocalTask.kt
  42. +29 −33 .../com/example/android/architecture/blueprints/todoapp/data/source/local/{TasksDao.kt → TaskDao.kt}
  43. +0 −109 ...ava/com/example/android/architecture/blueprints/todoapp/data/source/local/TasksLocalDataSource.kt
  44. +4 −5 ...c/main/java/com/example/android/architecture/blueprints/todoapp/data/source/local/ToDoDatabase.kt
  45. +28 −0 ...java/com/example/android/architecture/blueprints/todoapp/data/source/network/NetworkDataSource.kt
  46. +37 −0 .../main/java/com/example/android/architecture/blueprints/todoapp/data/source/network/NetworkTask.kt
  47. +52 −0 .../com/example/android/architecture/blueprints/todoapp/data/source/network/TaskNetworkDataSource.kt
  48. +60 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/di/CoroutinesModule.kt
  49. +69 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/di/DataModules.kt
  50. +0 −57 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsFragment.kt
  51. +142 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsScreen.kt
  52. +4 −4 app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsUtils.kt
  53. +56 −30 ...c/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsViewModel.kt
  54. +0 −108 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailFragment.kt
  55. +212 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailScreen.kt
  56. +85 −72 ...c/main/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailViewModel.kt
  57. +0 −71 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksActivity.kt
  58. +0 −78 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksAdapter.kt
  59. +3 −2 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksFilterType.kt
  60. +0 −166 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksFragment.kt
  61. +0 −41 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksListBindings.kt
  62. +348 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksScreen.kt
  63. +105 −157 app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModel.kt
  64. +8 −9 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/util/{FragmentExt.kt → Async.kt}
  65. +56 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ComposeUtils.kt
  66. +32 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/CoroutinesUtils.kt
  67. +0 −50 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/EspressoIdlingResource.kt
  68. +3 −3 ...ain/java/com/example/android/architecture/blueprints/todoapp/util/SimpleCountingIdlingResource.kt
  69. +187 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/TodoDrawer.kt
  70. +223 −0 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/TopAppBars.kt
  71. +0 −80 app/src/main/java/com/example/android/architecture/blueprints/todoapp/util/ViewExt.kt
  72. +13 −14 app/src/main/res/drawable/drawer_item_color.xml
  73. +14 −14 app/src/main/res/drawable/ic_add.xml
  74. +14 −15 app/src/main/res/drawable/ic_assignment_turned_in_24dp.xml
  75. +14 −14 app/src/main/res/drawable/ic_check_circle_96dp.xml
  76. +14 −14 app/src/main/res/drawable/ic_done.xml
  77. +14 −14 app/src/main/res/drawable/ic_edit.xml
  78. +14 −14 app/src/main/res/drawable/ic_filter_list.xml
  79. +14 −14 app/src/main/res/drawable/ic_list.xml
  80. +14 −14 app/src/main/res/drawable/ic_menu.xml
  81. +14 −14 app/src/main/res/drawable/ic_statistics.xml
  82. +14 −15 app/src/main/res/drawable/ic_statistics_100dp.xml
  83. +14 −14 app/src/main/res/drawable/ic_statistics_24dp.xml
  84. +14 −15 app/src/main/res/drawable/ic_verified_user_96dp.xml
  85. +13 −14 app/src/main/res/drawable/list_completed_touch_feedback.xml
  86. +13 −14 app/src/main/res/drawable/touch_feedback.xml
  87. +13 −14 app/src/main/res/font/opensans_font.xml
  88. +0 −92 app/src/main/res/layout/addtask_frag.xml
  89. +0 −41 app/src/main/res/layout/nav_header.xml
  90. +0 −82 app/src/main/res/layout/statistics_frag.xml
  91. +0 −61 app/src/main/res/layout/task_item.xml
  92. +0 −126 app/src/main/res/layout/taskdetail_frag.xml
  93. +0 −68 app/src/main/res/layout/tasks_act.xml
  94. +0 −118 app/src/main/res/layout/tasks_frag.xml
  95. +0 −27 app/src/main/res/menu/drawer_actions.xml
  96. +0 −26 app/src/main/res/menu/filter_tasks.xml
  97. +0 −24 app/src/main/res/menu/taskdetail_fragment_menu.xml
  98. +0 −33 app/src/main/res/menu/tasks_fragment_menu.xml
  99. +0 −84 app/src/main/res/navigation/nav_graph.xml
  100. +15 −15 app/src/main/res/values-v21/styles.xml
  101. +16 −16 app/src/main/res/values-w820dp/dimens.xml
  102. +13 −14 app/src/main/res/values/attrs.xml
  103. +15 −15 app/src/main/res/values/colors.xml
  104. +17 −17 app/src/main/res/values/dimens.xml
  105. +22 −15 app/src/main/res/values/strings.xml
  106. +16 −15 app/src/main/res/values/styles.xml
  107. +0 −82 app/src/mock/java/com/example/android/architecture/blueprints/todoapp/ServiceLocator.kt
  108. +0 −109 ...c/mock/java/com/example/android/architecture/blueprints/todoapp/data/FakeTasksRemoteDataSource.kt
  109. +0 −86 app/src/prod/java/com/example/android/architecture/blueprints/todoapp/ServiceLocator.kt
  110. +0 −126 ...a/com/example/android/architecture/blueprints/todoapp/data/source/remote/TasksRemoteDataSource.kt
  111. +0 −137 ...t/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskFragmentTest.kt
  112. +0 −135 ...sharedTest/java/com/example/android/architecture/blueprints/todoapp/data/source/FakeRepository.kt
  113. +0 −192 ...edTest/java/com/example/android/architecture/blueprints/todoapp/data/source/local/TasksDaoTest.kt
  114. +0 −183 ...com/example/android/architecture/blueprints/todoapp/data/source/local/TasksLocalDataSourceTest.kt
  115. +0 −108 ...est/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsFragmentTest.kt
  116. +0 −103 ...est/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailFragmentTest.kt
  117. +0 −345 ...rc/sharedTest/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksFragmentTest.kt
  118. +0 −112 ...edTest/java/com/example/android/architecture/blueprints/todoapp/util/DataBindingIdlingResource.kt
  119. +0 −36 ...rc/sharedTest/java/com/example/android/architecture/blueprints/todoapp/util/TasksRepositoryExt.kt
  120. +0 −81 ...test/java/com/example/android/architecture/blueprints/todoapp/FakeFailingTasksRemoteDataSource.kt
  121. +0 −75 app/src/test/java/com/example/android/architecture/blueprints/todoapp/LiveDataTestUtil.kt
  122. +0 −33 app/src/test/java/com/example/android/architecture/blueprints/todoapp/TestUtil.kt
  123. +68 −58 .../java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskViewModelTest.kt
  124. +285 −0 ...c/test/java/com/example/android/architecture/blueprints/todoapp/data/DefaultTaskRepositoryTest.kt
  125. +0 −284 ...ava/com/example/android/architecture/blueprints/todoapp/data/source/DefaultTasksRepositoryTest.kt
  126. +0 −87 app/src/test/java/com/example/android/architecture/blueprints/todoapp/data/source/FakeDataSource.kt
  127. +19 −19 ...c/test/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsUtilsTest.kt
  128. +39 −52 ...st/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsViewModelTest.kt
  129. +87 −104 ...st/java/com/example/android/architecture/blueprints/todoapp/taskdetail/TaskDetailViewModelTest.kt
  130. +77 −124 app/src/test/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksViewModelTest.kt
  131. +0 −72 build.gradle
  132. +23 −0 build.gradle.kts
  133. +3 −3 gradle.properties
  134. +59 −0 gradle/init.gradle.kts
  135. +154 −0 gradle/libs.versions.toml
  136. BIN gradle/wrapper/gradle-wrapper.jar
  137. +1 −2 gradle/wrapper/gradle-wrapper.properties
  138. +192 −112 gradlew
  139. +92 −90 gradlew.bat
  140. +33 −0 renovate.json
  141. BIN screenshots/screenshots.png
  142. BIN screenshots/todoapp.gif
  143. +0 −1 settings.gradle
  144. +33 −0 settings.gradle.kts
  145. +1 −0 shared-test/.gitignore
  146. +48 −0 shared-test/build.gradle.kts
  147. +17 −0 shared-test/src/main/AndroidManifest.xml
  148. +28 −0 shared-test/src/main/java/com/example/android/architecture/blueprints/todoapp/CustomTestRunner.kt
  149. +11 −21 ...ared-test/src/main}/java/com/example/android/architecture/blueprints/todoapp/MainCoroutineRule.kt
  150. +152 −0 ...test/src/main/java/com/example/android/architecture/blueprints/todoapp/data/FakeTaskRepository.kt
  151. +79 −0 ...rc/main/java/com/example/android/architecture/blueprints/todoapp/data/source/local/FakeTaskDao.kt
  152. +27 −0 .../com/example/android/architecture/blueprints/todoapp/data/source/network/FakeNetworkDataSource.kt
  153. +44 −0 ...d-test/src/main/java/com/example/android/architecture/blueprints/todoapp/di/DatabaseTestModule.kt
  154. +39 −0 ...test/src/main/java/com/example/android/architecture/blueprints/todoapp/di/RepositoryTestModule.kt
  155. +16 −0 spotless/copyright.kt
  156. +15 −0 spotless/copyright.kts
  157. +16 −0 spotless/copyright.xml
92 changes: 0 additions & 92 deletions .circleci/config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright 2020 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
#
# http://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.
#

org.gradle.daemon=false
org.gradle.parallel=false
org.gradle.jvmargs=-Xmx5120m
org.gradle.workers.max=2

kotlin.incremental=false
kotlin.compiler.execution.strategy=in-process
60 changes: 60 additions & 0 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build_test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
api-level: [29]

steps:
- uses: actions/checkout@v4

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
ls /dev/kvm
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86
disable-animations: true
script: ./gradlew connectedCheck --stacktrace

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.api-level }}
path: ./app/build/reports/androidTests


31 changes: 31 additions & 0 deletions .github/workflows/copy-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Duplicates default main branch to the old master branch

name: Duplicates main to old master branch

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "copy-branch"
copy-branch:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it,
# but specifies master branch (old default).
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git merge origin/main
git push
43 changes: 43 additions & 0 deletions .google/packaging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (C) 2020 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.
#
# GOOGLE SAMPLE PACKAGING DATA
#
# This file is used by Google as part of our samples packaging process.
# End users may safely ignore this file. It has no relevance to other systems.
---
status: PUBLISHED
technologies: [Android, JetpackCompose, Coroutines]
categories:
- AndroidTesting
- AndroidArchitecture
- AndroidArchitectureUILayer
- AndroidArchitectureDataLayer
- AndroidArchitectureStateProduction
- AndroidArchitectureStateHolder
- AndroidArchitectureUIEvents
- JetpackComposeTesting
- JetpackComposeArchitectureAndState
- JetpackComposeNavigation
languages: [Kotlin]
solutions:
- Mobile
- Flow
- JetpackHilt
- JetpackRoom
- JetpackNavigation
- JetpackLifecycle
github: android/architecture-samples
level: INTERMEDIATE
license: apache2
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Android Architecture Blueprints v2
<p align="center">
<img src="https://github.com/googlesamples/android-architecture/wiki/images/aab-logov2.png" alt="Illustration by Virginia Poltrack"/>
</p>
# Android Architecture Samples

Android Architecture Blueprints is a project to showcase different architectural approaches to developing Android apps. In its different branches you'll find the same app (a TODO app) implemented with small differences.
These samples showcase different architectural approaches to developing Android apps. In its different branches you'll find the same app (a TODO app) implemented with small differences.

In this branch you'll find:
* Kotlin **[Coroutines](https://kotlinlang.org/docs/reference/coroutines-overview.html)** for background operations.
* A single-activity architecture, using the **[Navigation component](https://developer.android.com/guide/navigation/navigation-getting-started)** to manage fragment operations.
* A presentation layer that contains a fragment (View) and a **ViewModel** per screen (or feature).
* Reactive UIs using **LiveData** observables and **Data Binding**.
* A **data layer** with a repository and two data sources (local using Room and remote) that are queried with one-shot operations (no listeners or data streams).
* Two **product flavors**, `mock` and `prod`, [to ease development and testing](https://android-developers.googleblog.com/2015/12/leveraging-product-flavors-in-android.html) (except in the Dagger branch).
* A collection of unit, integration and e2e **tests**, including "shared" tests that can be run on emulator/device or Robolectric.
* User Interface built with **[Jetpack Compose](https://developer.android.com/jetpack/compose)**
* A single-activity architecture, using **[Navigation Compose](https://developer.android.com/jetpack/compose/navigation)**.
* A presentation layer that contains a Compose screen (View) and a **ViewModel** per screen (or feature).
* Reactive UIs using **[Flow](https://developer.android.com/kotlin/flow)** and **[coroutines](https://kotlinlang.org/docs/coroutines-overview.html)** for asynchronous operations.
* A **data layer** with a repository and two data sources (local using Room and a fake remote).
* Two **product flavors**, `mock` and `prod`, [to ease development and testing](https://android-developers.googleblog.com/2015/12/leveraging-product-flavors-in-android.html).
* A collection of unit, integration and e2e **tests**, including "shared" tests that can be run on emulator/device.
* Dependency injection using [Hilt](https://developer.android.com/training/dependency-injection/hilt-android).

## Variations

@@ -21,25 +19,27 @@ This project hosts each sample app in separate repository branches. For more inf
### Stable samples - Kotlin
| Sample | Description |
| ------------- | ------------- |
| [master](https://github.com/googlesamples/android-architecture/tree/master) | The base for the rest of the branches. <br/>Uses Kotlin, Architecture Components, coroutines, Data Binding, etc. and uses Room as source of truth, with a reactive UI. |
| [dagger-android](https://github.com/googlesamples/android-architecture/tree/dagger-android)<br/>[[compare](https://github.com/googlesamples/android-architecture/compare/dagger-android#files_bucket)] | A simple Dagger setup that uses `dagger-android` and removes the two flavors. |
| [usecases](https://github.com/googlesamples/android-architecture/tree/usecases)<br/>[[compare](https://github.com/googlesamples/android-architecture/compare/usecases#files_bucket)] | Adds a new domain layer that uses UseCases for business logic. |
| [main](https://github.com/googlesamples/android-architecture/tree/main) | This branch |
| [service-locator](https://github.com/googlesamples/android-architecture/tree/service-locator) | A simple setup that removes Hilt in favor of a service locator |
| [livedata](https://github.com/googlesamples/android-architecture/tree/livedata) | Uses LiveData instead of StateFlow as the data stream solution |
| [usecases](https://github.com/googlesamples/android-architecture/tree/usecases) | Adds a new domain layer that uses UseCases for business logic (not using Compose yet) |
| [views](https://github.com/googlesamples/android-architecture/tree/views) | Uses Views instead of Jetpack Compose to render UI elements on the screen |
| [views-hilt](https://github.com/googlesamples/android-architecture/tree/views-hilt) | Uses Views and Hilt instead together |

### Old samples - Kotlin and Java

Blueprints v1 had a collection of samples that are not maintained anymore, but can still be useful. See [all project branches](https://github.com/googlesamples/android-architecture/branches).
## Screenshots

## Why a to-do app?
<img src="screenshots/screenshots.png" alt="Screenshot">

<img align="right" src="https://github.com/googlesamples/android-architecture/wiki/images/todoapp.gif" alt="A demo illustraating the UI of the app" width="288" height="512" style="display: inline; float: right"/>
## Why a to-do app?

The app in this project aims to be simple enough that you can understand it quickly, but complex enough to showcase difficult design decisions and testing scenarios. For more information, see the [app's specification](https://github.com/googlesamples/android-architecture/wiki/To-do-app-specification).

## What is it not?

* A UI/Material Design sample. The interface of the app is deliberately kept simple to focus on architecture. Check out [Plaid](https://github.com/android/plaid) instead.
* A complete Jetpack sample covering all libraries. Check out [Android Sunflower](https://github.com/googlesamples/android-sunflower) or the advanced [Github Browser Sample](https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample) instead.
* A real production app with network access, user authentication, etc. Check out the [Google I/O app](https://github.com/google/iosched), [Santa Tracker](https://github.com/google/santa-tracker-android) or [Tivi](https://github.com/chrisbanes/tivi) for that.
* A template. Check out the [Architecture Templates](https://github.com/android/architecture-templates) instead.
* A UI/Material Design sample. The interface of the app is deliberately kept simple to focus on architecture. Check out the [Compose Samples](https://github.com/android/compose-samples) instead.
* A complete Jetpack sample covering all libraries. Check out [Now in Android](https://github.com/android/nowinandroid) or the advanced [GitHub Browser Sample](https://github.com/googlesamples/android-architecture-components/tree/master/GithubBrowserSample) instead.
* A real production app with network access, user authentication, etc. Check out the [Now in Android app](https://github.com/android/nowinandroid) instead.

## Who is it for?

@@ -53,7 +53,7 @@ To open one of the samples in Android Studio, begin by checking out one of the s
Clone the repository:

```
git clone git@github.com:googlesamples/android-architecture.git
git clone git@github.com:android/architecture-samples.git
```
This step checks out the master branch. If you want to change to a different sample:

@@ -63,13 +63,13 @@ git checkout usecases

**Note:** To review a different sample, replace `usecases` with the name of sample you want to check out.

Finally open the `android-architecture/` directory in Android Studio.
Finally open the `architecture-samples/` directory in Android Studio.

### License


```
Copyright 2019 Google, Inc.
Copyright 2022 Google, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
Loading