From bd61ed726931fd18d4e8c88137775be52ed4638f Mon Sep 17 00:00:00 2001 From: Vandolf Estrellado Date: Mon, 24 Jul 2017 08:21:02 -0400 Subject: [PATCH] Created the App, BaseActivity, BaseFragment, and custom PerActivity, PerFragment, and PerChildFragment Scopes. Closes #3 --- .../vestrel00/daggerbutterknifemvp/App.java | 46 ++++++++++++ .../daggerbutterknifemvp/AppComponent.java | 30 ++++++++ .../daggerbutterknifemvp/AppModule.java | 27 +++++++ .../inject/PerActivity.java | 34 +++++++++ .../inject/PerChildFragment.java | 42 +++++++++++ .../inject/PerFragment.java | 34 +++++++++ .../inject/package-info.java | 24 +++++++ .../daggerbutterknifemvp/package-info.java | 20 ++++++ .../ui/common/BaseActivity.java | 66 +++++++++++++++++ .../ui/common/BaseActivityModule.java | 34 +++++++++ .../ui/common/BaseChildFragmentModule.java | 46 ++++++++++++ .../ui/common/BaseFragment.java | 72 +++++++++++++++++++ .../ui/common/BaseFragmentModule.java | 49 +++++++++++++ .../ui/common/package-info.java | 20 ++++++ .../daggerbutterknifemvp/ui/package-info.java | 20 ++++++ 15 files changed, 564 insertions(+) create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/App.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppComponent.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppModule.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerActivity.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerChildFragment.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerFragment.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/package-info.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/package-info.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivity.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivityModule.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseChildFragmentModule.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragment.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragmentModule.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/package-info.java create mode 100644 app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/package-info.java diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/App.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/App.java new file mode 100644 index 0000000..35bacb0 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/App.java @@ -0,0 +1,46 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp; + +import android.app.Activity; +import android.app.Application; + +import javax.inject.Inject; + +import dagger.android.AndroidInjector; +import dagger.android.DispatchingAndroidInjector; +import dagger.android.HasActivityInjector; + +/** + * The Android {@link Application}. + */ +public class App extends Application implements HasActivityInjector { + + @Inject + DispatchingAndroidInjector activityInjector; + + @Override + public void onCreate() { + super.onCreate(); + DaggerAppComponent.create().inject(this); + } + + @Override + public AndroidInjector activityInjector() { + return activityInjector; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppComponent.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppComponent.java new file mode 100644 index 0000000..99ad7cd --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppComponent.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp; + +import javax.inject.Singleton; + +import dagger.Component; + +/** + * Injects application dependencies. + */ +@Singleton +@Component(modules = AppModule.class) +interface AppComponent { + void inject(App app); +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppModule.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppModule.java new file mode 100644 index 0000000..d95936f --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/AppModule.java @@ -0,0 +1,27 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp; + +import dagger.Module; +import dagger.android.AndroidInjectionModule; + +/** + * Provides application-wide dependencies. + */ +@Module(includes = AndroidInjectionModule.class) +abstract class AppModule { +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerActivity.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerActivity.java new file mode 100644 index 0000000..9684602 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerActivity.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.inject; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import javax.inject.Scope; + +/** + * A custom scoping annotation that specifies that the lifespan of a dependency be the same as that + * of an Activity. + * + * This is used to annotate dependencies that behave like a singleton within the lifespan of an + * Activity, Fragment, and child Fragments instead of the entire Application. + */ +@Scope +@Retention(RetentionPolicy.RUNTIME) +public @interface PerActivity { +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerChildFragment.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerChildFragment.java new file mode 100644 index 0000000..e70b086 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerChildFragment.java @@ -0,0 +1,42 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.inject; + +import android.app.Fragment; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import javax.inject.Scope; + +/** + * A custom scoping annotation that specifies that the lifespan of a dependency be the same as that + * of a child Fragment (a fragment inside a fragment that is added using + * {@link Fragment#getChildFragmentManager()}). + *

+ * This is used to annotate dependencies that behave like a singleton within the lifespan of a + * child Fragment instead of the entire Application, Activity, or parent Fragment. + *

+ * Note that this does not support a child fragment within a child fragment as conflicting scopes + * will occur. Child fragments within child fragments should usually be avoided. However, if + * another level of child fragment is required, then another scope would need to be created + * (perhaps PerGrandChild custom scope annotation). + */ +@Scope +@Retention(RetentionPolicy.RUNTIME) +public @interface PerChildFragment { +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerFragment.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerFragment.java new file mode 100644 index 0000000..997775d --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/PerFragment.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.inject; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import javax.inject.Scope; + +/** + * A custom scoping annotation that specifies that the lifespan of a dependency be the same as that + * of a Fragment. + * + * This is used to annotate dependencies that behave like a singleton within the lifespan of a + * Fragment and child Fragments instead of the entire Application or Activity. + */ +@Scope +@Retention(RetentionPolicy.RUNTIME) +public @interface PerFragment { +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/package-info.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/package-info.java new file mode 100644 index 0000000..2787d5e --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/inject/package-info.java @@ -0,0 +1,24 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +/** + * Contains the different custom scopes used. + *

+ * Note that the standard {@link javax.inject.Singleton} scope is used as the application scope + * (there is no PerApplication scope annotation). This is done in order to support singleton + * scoped classes from other libraries (which do not have access to this project's custom scopes). + */ +package com.vestrel00.daggerbutterknifemvp.inject; \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/package-info.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/package-info.java new file mode 100644 index 0000000..3d6af0c --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +/** + * Contains the {@link android.app.Application}. + */ +package com.vestrel00.daggerbutterknifemvp; \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivity.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivity.java new file mode 100644 index 0000000..8362ac8 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivity.java @@ -0,0 +1,66 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.ui.common; + +import android.app.Activity; +import android.app.Fragment; +import android.app.FragmentManager; +import android.os.Bundle; +import android.support.annotation.Nullable; + +import javax.inject.Inject; +import javax.inject.Named; + +import dagger.android.AndroidInjection; +import dagger.android.AndroidInjector; +import dagger.android.DispatchingAndroidInjector; +import dagger.android.HasFragmentInjector; + +/** + * Abstract Activity for all Activities to extend. + *

+ * DEPENDENCY INJECTION + * We could extend {@link dagger.android.DaggerActivity} so we can get the boilerplate + * dagger code for free. However, we want to avoid inheritance (if possible and it is in this case) + * so that we have to option to inherit from something else later on if needed. + */ +public abstract class BaseActivity extends Activity implements HasFragmentInjector { + + @Inject + @Named(BaseActivityModule.ACTIVITY_FRAGMENT_MANAGER) + protected FragmentManager fragmentManager; + + @Inject + DispatchingAndroidInjector fragmentInjector; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + AndroidInjection.inject(this); + super.onCreate(savedInstanceState); + } + + @Override + public final AndroidInjector fragmentInjector() { + return fragmentInjector; + } + + protected final void addFragment(int containerViewId, Fragment fragment) { + fragmentManager.beginTransaction() + .add(containerViewId, fragment) + .commit(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivityModule.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivityModule.java new file mode 100644 index 0000000..326ef4d --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivityModule.java @@ -0,0 +1,34 @@ +package com.vestrel00.daggerbutterknifemvp.ui.common; + +import android.app.Activity; +import android.app.FragmentManager; +import android.content.Context; + +import com.vestrel00.daggerbutterknifemvp.inject.PerActivity; + +import javax.inject.Named; + +import dagger.Binds; +import dagger.Module; +import dagger.Provides; + +/** + * Provides base activity dependencies. This must be included in all activity modules, which must + * provide a concrete implementation of {@link Activity}. + */ +@Module +public abstract class BaseActivityModule { + + static final String ACTIVITY_FRAGMENT_MANAGER = "BaseActivityModule.activityFragmentManager"; + + @Binds + @PerActivity + abstract Context activityContext(Activity activity); + + @Provides + @Named(ACTIVITY_FRAGMENT_MANAGER) + @PerActivity + static FragmentManager activityFragmentManager(Activity activity) { + return activity.getFragmentManager(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseChildFragmentModule.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseChildFragmentModule.java new file mode 100644 index 0000000..06e1d59 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseChildFragmentModule.java @@ -0,0 +1,46 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.ui.common; + +import android.app.Fragment; + +import dagger.Module; + +/** + * Provides base fragment dependencies. This must be included in all child fragment modules, which + * must provide a concrete implementation of the child {@link Fragment} and named + * {@link #CHILD_FRAGMENT}. + *

+ * Note that a different {@link javax.inject.Named} for the {@link Fragment} is required in order to + * remove any ambiguity about which fragment is being provided in a child fragment. For example, + * we have parent fragment P and child fragment C. Parent fragment P will provide the Fragment + * reference using the {@link BaseFragmentModule#FRAGMENT} name. Child fragment C will provide the + * Fragment reference using the {@link #CHILD_FRAGMENT} name. + *

+ * If the parent and child fragments are not uniquely named, then the child fragment and its + * dependencies will not know which Fragment is provided to it. It could be the parent fragment + * or the child fragment. Hence the ambiguity, which causes a compile error of + * "android.app.Fragment is bound multiple times". + */ +@Module +public abstract class BaseChildFragmentModule { + + /** + * See class documentation regarding the need for this name. + */ + public static final String CHILD_FRAGMENT = "BaseChildFragmentModule.childFragment"; +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragment.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragment.java new file mode 100644 index 0000000..a0f459f --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragment.java @@ -0,0 +1,72 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.ui.common; + +import android.app.Fragment; +import android.app.FragmentManager; +import android.content.Context; + +import javax.inject.Inject; +import javax.inject.Named; + +import dagger.android.AndroidInjection; +import dagger.android.AndroidInjector; +import dagger.android.DispatchingAndroidInjector; +import dagger.android.HasFragmentInjector; + +/** + * Abstract Fragment for all Fragments and child Fragments to extend. This contains some boilerplate + * dependency injection code and activity {@link Context}. + *

+ * DEPENDENCY INJECTION + * We could extend {@link dagger.android.DaggerFragment} so we can get the boilerplate + * dagger code for free. However, we want to avoid inheritance (if possible and it is in this case) + * so that we have to option to inherit from something else later on if needed. + *

+ * VIEW BINDING + * This fragment handles view bind and unbinding. + */ +public abstract class BaseFragment extends Fragment implements HasFragmentInjector { + + @Inject + protected Context activityContext; + + // Note that this should not be used within a child fragment. + @Inject + @Named(BaseFragmentModule.CHILD_FRAGMENT_MANAGER) + protected FragmentManager childFragmentManager; + + @Inject + DispatchingAndroidInjector fragmentInjector; + + @Override + public void onAttach(Context context) { + AndroidInjection.inject(this); + super.onAttach(context); + } + + @Override + public final AndroidInjector fragmentInjector() { + return fragmentInjector; + } + + protected final void addChildFragment(int containerViewId, Fragment fragment) { + childFragmentManager.beginTransaction() + .add(containerViewId, fragment) + .commit(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragmentModule.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragmentModule.java new file mode 100644 index 0000000..db93c95 --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseFragmentModule.java @@ -0,0 +1,49 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +package com.vestrel00.daggerbutterknifemvp.ui.common; + +import android.app.Fragment; +import android.app.FragmentManager; + +import com.vestrel00.daggerbutterknifemvp.inject.PerFragment; + +import javax.inject.Named; + +import dagger.Module; +import dagger.Provides; + +/** + * Provides base fragment dependencies. This must be included in all fragment modules, which must + * provide a concrete implementation of {@link Fragment} and named {@link #FRAGMENT}. + */ +@Module +public abstract class BaseFragmentModule { + + /** + * See {@link BaseChildFragmentModule} class documentation regarding the need for this name. + */ + public static final String FRAGMENT = "BaseFragmentModule.fragment"; + + static final String CHILD_FRAGMENT_MANAGER = "BaseFragmentModule.childFragmentManager"; + + @Provides + @Named(CHILD_FRAGMENT_MANAGER) + @PerFragment + static FragmentManager childFragmentManager(@Named(FRAGMENT) Fragment fragment) { + return fragment.getChildFragmentManager(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/package-info.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/package-info.java new file mode 100644 index 0000000..c6065eb --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +/** + * Contains common classes used throughout the ui package. + */ +package com.vestrel00.daggerbutterknifemvp.ui.common; \ No newline at end of file diff --git a/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/package-info.java b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/package-info.java new file mode 100644 index 0000000..f8859df --- /dev/null +++ b/app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017 Vandolf Estrellado + * + * 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. + */ + +/** + * Contains all of the different UI components (activities and fragments) of the app. + */ +package com.vestrel00.daggerbutterknifemvp.ui; \ No newline at end of file