// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/navigation/Navigator.java
// @Singleton
// public final class Navigator {
// 
//     @Inject
//     Navigator() {
//     }
// 
//     public void toExample1(Context context) {
//         Intent intent = new Intent(context, Example1Activity.class);
//         context.startActivity(intent);
//     }
// 
//     public void toExample2(Context context) {
//         Intent intent = new Intent(context, Example2Activity.class);
//         context.startActivity(intent);
//     }
// 
//     public void toExample3(Context context) {
//         Intent intent = new Intent(context, Example3Activity.class);
//         context.startActivity(intent);
//     }
// }


import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasFragmentInjector;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import com.vestrel00.daggerbutterknifemvp.navigation.Navigator;
import javax.inject.Inject;
import javax.inject.Named;
import dagger.android.AndroidInjection;
/*
 * Copyright 2018 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;





/**
 * Abstract Activity for all Activities to extend.
 * <p>
 * <b>DEPENDENCY INJECTION</b>
 * 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
    protected Navigator navigator;

    /**
     * A reference to the FragmentManager is injected and used instead of the getter method. This
     * enables ease of mocking and verification in tests (in case Activity needs testing).
     *
     * For more details, see https://github.com/vestrel00/android-dagger-butterknife-mvp/pull/52
     */
    @Inject
    @Named(BaseActivityModule.ACTIVITY_FRAGMENT_MANAGER)
    FragmentManager fragmentManager;

// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/navigation/Navigator.java
// @Singleton
// public final class Navigator {
// 
//     @Inject
//     Navigator() {
//     }
// 
//     public void toExample1(Context context) {
//         Intent intent = new Intent(context, Example1Activity.class);
//         context.startActivity(intent);
//     }
// 
//     public void toExample2(Context context) {
//         Intent intent = new Intent(context, Example2Activity.class);
//         context.startActivity(intent);
//     }
// 
//     public void toExample3(Context context) {
//         Intent intent = new Intent(context, Example3Activity.class);
//         context.startActivity(intent);
//     }
// }


// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/BaseActivity.java
import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasFragmentInjector;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentManager;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import com.vestrel00.daggerbutterknifemvp.navigation.Navigator;
import javax.inject.Inject;
import javax.inject.Named;
import dagger.android.AndroidInjection;

/*
 * Copyright 2018 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;





/**
 * Abstract Activity for all Activities to extend.
 * <p>
 * <b>DEPENDENCY INJECTION</b>
 * 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
    protected Navigator navigator;

    /**
     * A reference to the FragmentManager is injected and used instead of the getter method. This
     * enables ease of mocking and verification in tests (in case Activity needs testing).
     *
     * For more details, see https://github.com/vestrel00/android-dagger-butterknife-mvp/pull/52
     */
    @Inject
    @Named(BaseActivityModule.ACTIVITY_FRAGMENT_MANAGER)
    FragmentManager fragmentManager;

    @Inject