14 | * Even though Dagger allows annotating a {@link Component @Component} as a singleton, the code 15 | * itself must ensure only one instance of the class is created. This is done in {@link 16 | * ToDoApplication}. 17 | */ 18 | @Singleton 19 | @Component(modules = {TasksRepositoryModule.class, ApplicationModule.class}) 20 | public interface TasksRepositoryComponent { 21 | 22 | TasksRepository getTasksRepository(); 23 | } 24 | -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-dagger/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksComponent.java: -------------------------------------------------------------------------------- 1 | package <%= appPackage %>.tasks; 2 | 3 | import <%= appPackage %>.ToDoApplication; 4 | import <%= appPackage %>.data.source.TasksRepositoryComponent; 5 | import <%= appPackage %>.util.FragmentScoped; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * This is a Dagger component. Refer to {@link ToDoApplication} for the list of Dagger components 11 | * used in this application. 12 | *
13 | * Because this component depends on the {@link TasksRepositoryComponent}, which is a singleton, a 14 | * scope must be specified. All fragment components use a custom scope for this purpose. 15 | */ 16 | @FragmentScoped 17 | @Component(dependencies = TasksRepositoryComponent.class, modules = TasksPresenterModule.class) 18 | public interface TasksComponent { 19 | 20 | void inject(TasksActivity activity); 21 | } 22 | -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-rxjava/app/src/main/java/com/example/android/architecture/blueprints/todoapp/BasePresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016, The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package <%= appPackage %>; 18 | 19 | public interface BasePresenter { 20 | 21 | void subscribe(); 22 | 23 | void unsubscribe(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Some methods are only called from tests, so make sure the shrinker keeps them. 2 | -keep class com.example.android.architecture.blueprints.** { *; } 3 | 4 | -keep class android.support.v4.widget.DrawerLayout { *; } 5 | -keep class android.support.test.espresso.IdlingResource { *; } 6 | -keep class com.google.common.base.Preconditions { *; } 7 | 8 | # For Guava: 9 | -dontwarn javax.annotation.** 10 | -dontwarn javax.inject.** 11 | -dontwarn sun.misc.Unsafe 12 | 13 | # Proguard rules that are applied to your test apk/code. 14 | -ignorewarnings 15 | 16 | -keepattributes *Annotation* 17 | 18 | -dontnote junit.framework.** 19 | -dontnote junit.runner.** 20 | 21 | -dontwarn android.test.** 22 | -dontwarn android.support.test.** 23 | -dontwarn org.junit.** 24 | -dontwarn org.hamcrest.** 25 | -dontwarn com.squareup.javawriter.JavaWriter 26 | # Uncomment this if you use Mockito 27 | -dontwarn org.mockito.** -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-clean/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Some methods are only called from tests, so make sure the shrinker keeps them. 2 | -keep class com.example.android.architecture.blueprints.** { *; } 3 | 4 | -keep class android.support.v4.widget.DrawerLayout { *; } 5 | -keep class android.support.test.espresso.IdlingResource { *; } 6 | -keep class com.google.common.base.Preconditions { *; } 7 | 8 | # For Guava: 9 | -dontwarn javax.annotation.** 10 | -dontwarn javax.inject.** 11 | -dontwarn sun.misc.Unsafe 12 | 13 | # Proguard rules that are applied to your test apk/code. 14 | -ignorewarnings 15 | 16 | -keepattributes *Annotation* 17 | 18 | -dontnote junit.framework.** 19 | -dontnote junit.runner.** 20 | 21 | -dontwarn android.test.** 22 | -dontwarn android.support.test.** 23 | -dontwarn org.junit.** 24 | -dontwarn org.hamcrest.** 25 | -dontwarn com.squareup.javawriter.JavaWriter 26 | # Uncomment this if you use Mockito 27 | -dontwarn org.mockito.** -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-dagger/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Some methods are only called from tests, so make sure the shrinker keeps them. 2 | -keep class com.example.android.architecture.blueprints.** { *; } 3 | 4 | -keep class android.support.v4.widget.DrawerLayout { *; } 5 | -keep class android.support.test.espresso.IdlingResource { *; } 6 | -keep class com.google.common.base.Preconditions { *; } 7 | 8 | # For Guava: 9 | -dontwarn javax.annotation.** 10 | -dontwarn javax.inject.** 11 | -dontwarn sun.misc.Unsafe 12 | 13 | # Proguard rules that are applied to your test apk/code. 14 | -ignorewarnings 15 | 16 | -keepattributes *Annotation* 17 | 18 | -dontnote junit.framework.** 19 | -dontnote junit.runner.** 20 | 21 | -dontwarn android.test.** 22 | -dontwarn android.support.test.** 23 | -dontwarn org.junit.** 24 | -dontwarn org.hamcrest.** 25 | -dontwarn com.squareup.javawriter.JavaWriter 26 | # Uncomment this if you use Mockito 27 | -dontwarn org.mockito.** -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-loaders/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Some methods are only called from tests, so make sure the shrinker keeps them. 2 | -keep class com.example.android.architecture.blueprints.** { *; } 3 | 4 | -keep class android.support.v4.widget.DrawerLayout { *; } 5 | -keep class android.support.test.espresso.IdlingResource { *; } 6 | -keep class com.google.common.base.Preconditions { *; } 7 | 8 | # For Guava: 9 | -dontwarn javax.annotation.** 10 | -dontwarn javax.inject.** 11 | -dontwarn sun.misc.Unsafe 12 | 13 | # Proguard rules that are applied to your test apk/code. 14 | -ignorewarnings 15 | 16 | -keepattributes *Annotation* 17 | 18 | -dontnote junit.framework.** 19 | -dontnote junit.runner.** 20 | 21 | -dontwarn android.test.** 22 | -dontwarn android.support.test.** 23 | -dontwarn org.junit.** 24 | -dontwarn org.hamcrest.** 25 | -dontwarn com.squareup.javawriter.JavaWriter 26 | # Uncomment this if you use Mockito 27 | -dontwarn org.mockito.** -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-clean/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-databinding/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-contentproviders/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Some methods are only called from tests, so make sure the shrinker keeps them. 2 | -keep class com.example.android.architecture.blueprints.** { *; } 3 | 4 | -keep class android.support.v4.widget.DrawerLayout { *; } 5 | -keep class android.support.test.espresso.IdlingResource { *; } 6 | -keep class com.google.common.base.Preconditions { *; } 7 | 8 | # For Guava: 9 | -dontwarn javax.annotation.** 10 | -dontwarn javax.inject.** 11 | -dontwarn sun.misc.Unsafe 12 | 13 | # Proguard rules that are applied to your test apk/code. 14 | -ignorewarnings 15 | 16 | -keepattributes *Annotation* 17 | 18 | -dontnote junit.framework.** 19 | -dontnote junit.runner.** 20 | 21 | -dontwarn android.test.** 22 | -dontwarn android.support.test.** 23 | -dontwarn org.junit.** 24 | -dontwarn org.hamcrest.** 25 | -dontwarn com.squareup.javawriter.JavaWriter 26 | # Uncomment this if you use Mockito 27 | -dontwarn org.mockito.** -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-dagger/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-loaders/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-rxjava/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvvm-databinding/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-contentproviders/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-dagger/app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsComponent.java: -------------------------------------------------------------------------------- 1 | package <%= appPackage %>.statistics; 2 | 3 | import <%= appPackage %>.ToDoApplication; 4 | import <%= appPackage %>.data.source.TasksRepositoryComponent; 5 | import <%= appPackage %>.util.FragmentScoped; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * This is a Dagger component. Refer to {@link ToDoApplication} for the list of Dagger components 11 | * used in this application. 12 | *
13 | * Because this component depends on the {@link TasksRepositoryComponent}, which is a singleton, a
14 | * scope must be specified. All fragment components use a custom scope for this purpose.
15 | */
16 | @FragmentScoped
17 | @Component(dependencies = TasksRepositoryComponent.class, modules = StatisticsPresenterModule.class)
18 | public interface StatisticsComponent {
19 |
20 | void inject(StatisticsActivity statisticsActivity);
21 | }
22 |
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvvm-databinding/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
13 | * Because this component depends on the {@link TasksRepositoryComponent}, which is a singleton, a 14 | * scope must be specified. All fragment components use a custom scope for this purpose. 15 | */ 16 | @FragmentScoped 17 | @Component(dependencies = TasksRepositoryComponent.class, modules = TaskDetailPresenterModule.class) 18 | public interface TaskDetailComponent { 19 | 20 | void inject(TaskDetailActivity taskDetailActivity); 21 | } 22 | 23 | -------------------------------------------------------------------------------- /generators/app/templates/todo-mvp-dagger/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskComponent.java: -------------------------------------------------------------------------------- 1 | package <%= appPackage %>.addedittask; 2 | 3 | import <%= appPackage %>.ToDoApplication; 4 | import <%= appPackage %>.data.source.TasksRepositoryComponent; 5 | import <%= appPackage %>.util.FragmentScoped; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * This is a Dagger component. Refer to {@link ToDoApplication} for the list of Dagger components 11 | * used in this application. 12 | *
13 | * Because this component depends on the {@link TasksRepositoryComponent}, which is a singleton, a
14 | * scope must be specified. All fragment components use a custom scope for this purpose.
15 | */
16 | @FragmentScoped
17 | @Component(dependencies = TasksRepositoryComponent.class,
18 | modules = AddEditTaskPresenterModule.class)
19 | public interface AddEditTaskComponent {
20 |
21 | void inject(AddEditTaskActivity addEditTaskActivity);
22 | }
23 |
--------------------------------------------------------------------------------
/generators/app/templates/todo-databinding/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Some methods are only called from tests, so make sure the shrinker keeps them.
2 | -keep class com.example.android.architecture.blueprints.** { *; }
3 |
4 | -keep class android.support.v4.widget.DrawerLayout { *; }
5 | -keep class android.support.test.espresso.IdlingResource { *; }
6 | -keep class com.google.common.base.Preconditions { *; }
7 | -keep class android.databinding.** { *; }
8 |
9 | # For Guava:
10 | -dontwarn javax.annotation.**
11 | -dontwarn javax.inject.**
12 | -dontwarn sun.misc.Unsafe
13 |
14 | # Proguard rules that are applied to your test apk/code.
15 | -ignorewarnings
16 |
17 | -keepattributes *Annotation*
18 |
19 | -dontnote junit.framework.**
20 | -dontnote junit.runner.**
21 |
22 | -dontwarn android.test.**
23 | -dontwarn android.support.test.**
24 | -dontwarn org.junit.**
25 | -dontwarn org.hamcrest.**
26 | -dontwarn com.squareup.javawriter.JavaWriter
27 | # Uncomment this if you use Mockito
28 | -dontwarn org.mockito.**
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvvm-databinding/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Some methods are only called from tests, so make sure the shrinker keeps them.
2 | -keep class com.example.android.architecture.blueprints.** { *; }
3 |
4 | -keep class android.support.v4.widget.DrawerLayout { *; }
5 | -keep class android.support.test.espresso.IdlingResource { *; }
6 | -keep class com.google.common.base.Preconditions { *; }
7 | -keep class android.databinding.** { *; }
8 |
9 | # For Guava:
10 | -dontwarn javax.annotation.**
11 | -dontwarn javax.inject.**
12 | -dontwarn sun.misc.Unsafe
13 |
14 | # Proguard rules that are applied to your test apk/code.
15 | -ignorewarnings
16 |
17 | -keepattributes *Annotation*
18 |
19 | -dontnote junit.framework.**
20 | -dontnote junit.runner.**
21 |
22 | -dontwarn android.test.**
23 | -dontwarn android.support.test.**
24 | -dontwarn org.junit.**
25 | -dontwarn org.hamcrest.**
26 | -dontwarn com.squareup.javawriter.JavaWriter
27 | # Uncomment this if you use Mockito
28 | -dontwarn org.mockito.**
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvp-dagger/app/src/main/java/com/example/android/architecture/blueprints/todoapp/addedittask/AddEditTaskPresenterModule.java:
--------------------------------------------------------------------------------
1 | package <%= appPackage %>.addedittask;
2 |
3 | import android.support.annotation.Nullable;
4 |
5 | import dagger.Module;
6 | import dagger.Provides;
7 |
8 | /**
9 | * This is a Dagger module. We use this to pass in the View dependency to the
10 | * {@link AddEditTaskPresenter}.
11 | */
12 | @Module
13 | public class AddEditTaskPresenterModule {
14 |
15 | private final AddEditTaskContract.View mView;
16 |
17 | private String mTaskId;
18 |
19 | public AddEditTaskPresenterModule(AddEditTaskContract.View view, @Nullable String taskId) {
20 | mView = view;
21 | mTaskId = taskId;
22 | }
23 |
24 | @Provides
25 | AddEditTaskContract.View provideAddEditTaskContractView() {
26 | return mView;
27 | }
28 |
29 | @Provides
30 | @Nullable
31 | String provideTaskId() {
32 | return mTaskId;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvp-dagger/app/src/prod/java/com/example/android/architecture/blueprints/todoapp/data/source/TasksRepositoryModule.java:
--------------------------------------------------------------------------------
1 | package <%= appPackage %>.data.source;
2 |
3 | import android.content.Context;
4 |
5 | import <%= appPackage %>.data.source.local.TasksLocalDataSource;
6 | import <%= appPackage %>.data.source.remote.TasksRemoteDataSource;
7 |
8 | import javax.inject.Singleton;
9 |
10 | import dagger.Module;
11 | import dagger.Provides;
12 |
13 | /**
14 | * This is used by Dagger to inject the required arguments into the {@link TasksRepository}.
15 | */
16 | @Module
17 | public class TasksRepositoryModule {
18 |
19 | @Singleton
20 | @Provides
21 | @Local
22 | TasksDataSource provideTasksLocalDataSource(Context context) {
23 | return new TasksLocalDataSource(context);
24 | }
25 |
26 | @Singleton
27 | @Provides
28 | @Remote
29 | TasksDataSource provideTasksRemoteDataSource() {
30 | return new TasksRemoteDataSource();
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvvm-databinding/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/TasksNavigator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016, The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package <%= appPackage %>.tasks;
18 |
19 | /**
20 | * Defines the navigation actions that can be called from the task list screen.
21 | */
22 | public interface TasksNavigator {
23 |
24 | void addNewTask();
25 | }
26 |
--------------------------------------------------------------------------------
/generators/app/templates/todo-mvp-clean/app/src/main/java/com/example/android/architecture/blueprints/todoapp/tasks/domain/filter/TaskFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016, The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package <%= appPackage %>.tasks.domain.filter;
18 |
19 | import <%= appPackage %>.tasks.domain.model.Task;
20 |
21 | import java.util.List;
22 |
23 | public interface TaskFilter {
24 | List