// Path: app/src/main/java/com/ragdroid/dahaka/app/AppComponent.java
// @Singleton
// @Component(modules = {
//         AppModule.class,
//         ApiModule.class,
//         AppBindingModule.class,
//         AndroidSupportInjectionModule.class})
// public interface AppComponent extends AndroidInjector<DaggerApplication> {
// 
// 
//     UserComponent.Builder userBuilder();
// 
//     UserManager getUserManager();
// 
//     void inject(DahakaApplication instance);
// 
//     @Component.Builder
//     interface Builder {
// 
//         AppComponent build();
// 
//         @BindsInstance
//         Builder application(Application application);
//         Builder apiModule(ApiModule apiModule);
//     }
// 
// }
// 
// Path: app/src/main/java/com/ragdroid/dahaka/app/UserManager.java
// @Singleton
// public class UserManager implements HasActivityInjector {
// 
// 
//     private final PokemonService service;
//     private final UserComponent.Builder userComponentBuilder;
//     @Inject DispatchingAndroidInjector<Activity> activityInjector;
// 
//     private Pokemon pokemonCache;
// 
//     private UserComponent userComponent;
// 
//     @Inject
//     public UserManager(PokemonService service, UserComponent.Builder builder) {
//         this.service = service;
//         this.userComponentBuilder = builder;
//     }
// 
//     public Flowable<Pokemon> loginWithUserName(String userName) {
//         return getPokemonMaybeFromCache()
//                 .concatWith(service.getPokemon(userName).toMaybe())
//                 .take(1)
//                 .doOnNext(this::createUserSession);
//     }
// 
//     private void createUserSession(Pokemon pokemon) {
//         userComponent = userComponentBuilder
//                 .pokeMon(pokemon)
//                 .build();
//         userComponent.inject(this);
//     }
// 
// 
//     private Maybe<Pokemon> getPokemonMaybeFromCache() {
//         if (pokemonCache != null) {
//             return Maybe.just(pokemonCache);
//         } else {
//             return Maybe.empty();
//         }
//     }
// 
//     public boolean isLoggedIn() {
//         return userComponent != null;
//     }
// 
//     public void logOut() {
//         pokemonCache = null;
//         userComponent = null;
//     }
// 
//     @Override
//     public AndroidInjector<Activity> activityInjector() {
//         return activityInjector;
//     }
// }


import android.app.Activity;
import android.app.Application;
import android.databinding.DataBindingComponent;
import android.databinding.DataBindingUtil;
import com.ragdroid.dahaka.app.AppComponent;
import com.ragdroid.dahaka.app.DaggerAppComponent;
import com.ragdroid.dahaka.app.DaggerAppDataBindingComponent;
import com.ragdroid.dahaka.app.UserManager;
import javax.inject.Inject;
import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasActivityInjector;
package com.ragdroid.dahaka;




/**
 * Created by garimajain on 13/08/17.
 */

public class DahakaApplication extends Application implements HasActivityInjector {

    @Inject DispatchingAndroidInjector<Activity> activityInjector;
// Path: app/src/main/java/com/ragdroid/dahaka/app/AppComponent.java
// @Singleton
// @Component(modules = {
//         AppModule.class,
//         ApiModule.class,
//         AppBindingModule.class,
//         AndroidSupportInjectionModule.class})
// public interface AppComponent extends AndroidInjector<DaggerApplication> {
// 
// 
//     UserComponent.Builder userBuilder();
// 
//     UserManager getUserManager();
// 
//     void inject(DahakaApplication instance);
// 
//     @Component.Builder
//     interface Builder {
// 
//         AppComponent build();
// 
//         @BindsInstance
//         Builder application(Application application);
//         Builder apiModule(ApiModule apiModule);
//     }
// 
// }
// 
// Path: app/src/main/java/com/ragdroid/dahaka/app/UserManager.java
// @Singleton
// public class UserManager implements HasActivityInjector {
// 
// 
//     private final PokemonService service;
//     private final UserComponent.Builder userComponentBuilder;
//     @Inject DispatchingAndroidInjector<Activity> activityInjector;
// 
//     private Pokemon pokemonCache;
// 
//     private UserComponent userComponent;
// 
//     @Inject
//     public UserManager(PokemonService service, UserComponent.Builder builder) {
//         this.service = service;
//         this.userComponentBuilder = builder;
//     }
// 
//     public Flowable<Pokemon> loginWithUserName(String userName) {
//         return getPokemonMaybeFromCache()
//                 .concatWith(service.getPokemon(userName).toMaybe())
//                 .take(1)
//                 .doOnNext(this::createUserSession);
//     }
// 
//     private void createUserSession(Pokemon pokemon) {
//         userComponent = userComponentBuilder
//                 .pokeMon(pokemon)
//                 .build();
//         userComponent.inject(this);
//     }
// 
// 
//     private Maybe<Pokemon> getPokemonMaybeFromCache() {
//         if (pokemonCache != null) {
//             return Maybe.just(pokemonCache);
//         } else {
//             return Maybe.empty();
//         }
//     }
// 
//     public boolean isLoggedIn() {
//         return userComponent != null;
//     }
// 
//     public void logOut() {
//         pokemonCache = null;
//         userComponent = null;
//     }
// 
//     @Override
//     public AndroidInjector<Activity> activityInjector() {
//         return activityInjector;
//     }
// }


// Path: app/src/main/java/com/ragdroid/dahaka/DahakaApplication.java
import android.app.Activity;
import android.app.Application;
import android.databinding.DataBindingComponent;
import android.databinding.DataBindingUtil;
import com.ragdroid.dahaka.app.AppComponent;
import com.ragdroid.dahaka.app.DaggerAppComponent;
import com.ragdroid.dahaka.app.DaggerAppDataBindingComponent;
import com.ragdroid.dahaka.app.UserManager;
import javax.inject.Inject;
import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasActivityInjector;

package com.ragdroid.dahaka;




/**
 * Created by garimajain on 13/08/17.
 */

public class DahakaApplication extends Application implements HasActivityInjector {

    @Inject DispatchingAndroidInjector<Activity> activityInjector;
    @Inject UserManager userManager;