// Path: app/src/main/java/com/sefford/material/sample/common/injection/modules/ApplicationModule.java
// @Module(
//         includes = {
//                 CoreModule.class,
//                 DevelopmentLoggingModule.class,
//         },
//         injects = {
//                 // Application
//                 MaterialApplication.class,
//                 // Activities
//                 BaseActivity.class,
//         },
//         complete = true,
//         library = true
// )
// public class ApplicationModule {
// 
//     public static final String APPLICATION = "app";
// 
//     final Context context;
// 
//     public ApplicationModule(Context context) {
//         this.context = context;
//     }
// 
//     @Provides
//     @Named(APPLICATION)
//     public Context provideApplicationContext() {
//         return context;
//     }
// 
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/common/injection/modules/DevelopmentLoggingModule.java
// @Module(library = true,
//         complete = true)
// public class DevelopmentLoggingModule {
// 
//     @Provides
//     @Singleton
//     public Logger provideLogger(DevelopmentLogger logger) {
//         return logger;
//     }
// 
//     @Provides
//     @Singleton
//     public Loggable provideLog(Logger log) {
//         return log;
//     }
// }


import android.app.Application;
import com.sefford.material.sample.common.injection.modules.ApplicationModule;
import com.sefford.material.sample.common.injection.modules.DevelopmentLoggingModule;
import dagger.ObjectGraph;
/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * 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.sefford.material.sample.common.ui.application;


/**
 * MaterialApplication application with the initialization of app-wide injection modules.
 */
public class MaterialApplication extends Application {


    /**
     * Object Injection Graph for development/production.
     * <p/>
     * We don't care this is static as the Application will live as long as the execution.
     */
    ObjectGraph objectGraph;

    @Override
    public void onCreate() {
        super.onCreate();

        // Initialize Dagger's Dependency injection object Graph
        objectGraph = initializeGraph();
        objectGraph.inject(this);
    }

    ObjectGraph initializeGraph() {
// Path: app/src/main/java/com/sefford/material/sample/common/injection/modules/ApplicationModule.java
// @Module(
//         includes = {
//                 CoreModule.class,
//                 DevelopmentLoggingModule.class,
//         },
//         injects = {
//                 // Application
//                 MaterialApplication.class,
//                 // Activities
//                 BaseActivity.class,
//         },
//         complete = true,
//         library = true
// )
// public class ApplicationModule {
// 
//     public static final String APPLICATION = "app";
// 
//     final Context context;
// 
//     public ApplicationModule(Context context) {
//         this.context = context;
//     }
// 
//     @Provides
//     @Named(APPLICATION)
//     public Context provideApplicationContext() {
//         return context;
//     }
// 
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/common/injection/modules/DevelopmentLoggingModule.java
// @Module(library = true,
//         complete = true)
// public class DevelopmentLoggingModule {
// 
//     @Provides
//     @Singleton
//     public Logger provideLogger(DevelopmentLogger logger) {
//         return logger;
//     }
// 
//     @Provides
//     @Singleton
//     public Loggable provideLog(Logger log) {
//         return log;
//     }
// }


// Path: app/src/main/java/com/sefford/material/sample/common/ui/application/MaterialApplication.java
import android.app.Application;
import com.sefford.material.sample.common.injection.modules.ApplicationModule;
import com.sefford.material.sample.common.injection.modules.DevelopmentLoggingModule;
import dagger.ObjectGraph;

/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * 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.sefford.material.sample.common.ui.application;


/**
 * MaterialApplication application with the initialization of app-wide injection modules.
 */
public class MaterialApplication extends Application {


    /**
     * Object Injection Graph for development/production.
     * <p/>
     * We don't care this is static as the Application will live as long as the execution.
     */
    ObjectGraph objectGraph;

    @Override
    public void onCreate() {
        super.onCreate();

        // Initialize Dagger's Dependency injection object Graph
        objectGraph = initializeGraph();
        objectGraph.inject(this);
    }

    ObjectGraph initializeGraph() {
        return ObjectGraph.create(new ApplicationModule(this),