// Path: sample/src/main/java/net/derohimat/samplebasemvp/di/component/ApplicationComponent.java
// @Singleton
// @Component(modules = {ApplicationModule.class})
// public interface ApplicationComponent {
// 
//     void inject(MainPresenter mainPresenter);
// 
//     void inject(DetailPresenter detailPresenter);
// 
//     void inject(BaseApplication baseApplication);
// 
//     void inject(UnauthorisedInterceptor unauthorisedInterceptor);
// 
//     APIService apiService();
// 
//     EventBus eventBus();
// 
//     PreferencesHelper prefsHelper();
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/di/module/ApplicationModule.java
// @Module
// public class ApplicationModule {
// 
//     private final BaseApplication mBaseApplication;
// 
//     public ApplicationModule(BaseApplication baseApplication) {
//         this.mBaseApplication = baseApplication;
//     }
// 
//     @Provides
//     @Singleton
//     public BaseApplication provideApplication() {
//         return mBaseApplication;
//     }
// 
//     @Provides
//     @Singleton
//     public APIService provideApiService() {
//         return APIService.Factory.create(mBaseApplication);
//     }
// 
//     @Provides
//     @Singleton
//     public EventBus eventBus() {
//         return new EventBus();
//     }
// 
//     @Provides
//     @Singleton
//     public PreferencesHelper prefsHelper() {
//         return new PreferencesHelper(mBaseApplication);
//     }
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/events/AuthenticationErrorEvent.java
// public class AuthenticationErrorEvent {
//     public AuthenticationErrorEvent() {
//     }
// }


import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.support.annotation.VisibleForTesting;
import net.derohimat.samplebasemvp.di.component.ApplicationComponent;
import net.derohimat.samplebasemvp.di.component.DaggerApplicationComponent;
import net.derohimat.samplebasemvp.di.module.ApplicationModule;
import net.derohimat.samplebasemvp.events.AuthenticationErrorEvent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
import rx.Scheduler;
import rx.schedulers.Schedulers;
import timber.log.Timber;
package net.derohimat.samplebasemvp;






public class BaseApplication extends Application {

    @Inject
    EventBus mEventBus;
    private Scheduler mScheduler;
    private ApplicationComponent mApplicationComponent;

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

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

        boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));

        if (isDebuggable) {
            Timber.plant(new Timber.DebugTree());
        }

// Path: sample/src/main/java/net/derohimat/samplebasemvp/di/component/ApplicationComponent.java
// @Singleton
// @Component(modules = {ApplicationModule.class})
// public interface ApplicationComponent {
// 
//     void inject(MainPresenter mainPresenter);
// 
//     void inject(DetailPresenter detailPresenter);
// 
//     void inject(BaseApplication baseApplication);
// 
//     void inject(UnauthorisedInterceptor unauthorisedInterceptor);
// 
//     APIService apiService();
// 
//     EventBus eventBus();
// 
//     PreferencesHelper prefsHelper();
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/di/module/ApplicationModule.java
// @Module
// public class ApplicationModule {
// 
//     private final BaseApplication mBaseApplication;
// 
//     public ApplicationModule(BaseApplication baseApplication) {
//         this.mBaseApplication = baseApplication;
//     }
// 
//     @Provides
//     @Singleton
//     public BaseApplication provideApplication() {
//         return mBaseApplication;
//     }
// 
//     @Provides
//     @Singleton
//     public APIService provideApiService() {
//         return APIService.Factory.create(mBaseApplication);
//     }
// 
//     @Provides
//     @Singleton
//     public EventBus eventBus() {
//         return new EventBus();
//     }
// 
//     @Provides
//     @Singleton
//     public PreferencesHelper prefsHelper() {
//         return new PreferencesHelper(mBaseApplication);
//     }
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/events/AuthenticationErrorEvent.java
// public class AuthenticationErrorEvent {
//     public AuthenticationErrorEvent() {
//     }
// }


// Path: sample/src/main/java/net/derohimat/samplebasemvp/BaseApplication.java
import android.app.Application;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.support.annotation.VisibleForTesting;
import net.derohimat.samplebasemvp.di.component.ApplicationComponent;
import net.derohimat.samplebasemvp.di.component.DaggerApplicationComponent;
import net.derohimat.samplebasemvp.di.module.ApplicationModule;
import net.derohimat.samplebasemvp.events.AuthenticationErrorEvent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import javax.inject.Inject;
import rx.Scheduler;
import rx.schedulers.Schedulers;
import timber.log.Timber;

package net.derohimat.samplebasemvp;






public class BaseApplication extends Application {

    @Inject
    EventBus mEventBus;
    private Scheduler mScheduler;
    private ApplicationComponent mApplicationComponent;

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

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

        boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));

        if (isDebuggable) {
            Timber.plant(new Timber.DebugTree());
        }

        mApplicationComponent = DaggerApplicationComponent.builder().applicationModule(new ApplicationModule(this)).build();