// Path: AuthProject/app/src/main/java/com/zhy/authproject/di/AppComponent.java
// @Singleton
// @Component(modules = {AppModule.class, ApiModule.class})
// public interface AppComponent {
//     LoginComponent plus(LoginModule loginModule);
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/di/AppModule.java
// @Module
// public class AppModule {
//     private final Application application;
// 
//     public AppModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     public Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     public PreferencesManager provideSharedPreferences(){
//         return  new PreferencesManager(application);
//     }
// 
// }


import android.app.Application;
import android.content.Context;
import com.zhy.authproject.di.AppComponent;
import com.zhy.authproject.di.AppModule;
import com.zhy.authproject.di.DaggerAppComponent;
package com.zhy.authproject;



/**
 * Created by zhanghaoye on 10/21/16.
 */

public class AuthApplication extends Application{
    private AppComponent appComponent;

    public static AuthApplication get(Context context){
        return (AuthApplication) context.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();
// Path: AuthProject/app/src/main/java/com/zhy/authproject/di/AppComponent.java
// @Singleton
// @Component(modules = {AppModule.class, ApiModule.class})
// public interface AppComponent {
//     LoginComponent plus(LoginModule loginModule);
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/di/AppModule.java
// @Module
// public class AppModule {
//     private final Application application;
// 
//     public AppModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     public Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     public PreferencesManager provideSharedPreferences(){
//         return  new PreferencesManager(application);
//     }
// 
// }


// Path: AuthProject/app/src/main/java/com/zhy/authproject/AuthApplication.java
import android.app.Application;
import android.content.Context;
import com.zhy.authproject.di.AppComponent;
import com.zhy.authproject.di.AppModule;
import com.zhy.authproject.di.DaggerAppComponent;

package com.zhy.authproject;



/**
 * Created by zhanghaoye on 10/21/16.
 */

public class AuthApplication extends Application{
    private AppComponent appComponent;

    public static AuthApplication get(Context context){
        return (AuthApplication) context.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        appComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();