// Path: app/src/main/java/com/hitherejoe/pickr/PickrApplication.java
// public class PickrApplication extends Application {
// 
//     ApplicationComponent mApplicationComponent;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree());
// 
//         mApplicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public static PickrApplication get(Context context) {
//         return (PickrApplication) context.getApplicationContext();
//     }
// 
//     public ApplicationComponent getComponent() {
//         return mApplicationComponent;
//     }
// 
//     // Needed to replace the component with a test specific one
//     public void setComponent(ApplicationComponent applicationComponent) {
//         mApplicationComponent = applicationComponent;
//     }
// }
// 
// Path: app/src/main/java/com/hitherejoe/pickr/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     void inject(MainActivity mainActivity);
// 
//     Application application();
//     DataManager dataManager();
//     Bus eventBus();
// }


import android.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.hitherejoe.pickr.PickrApplication;
import com.hitherejoe.pickr.injection.component.ApplicationComponent;
package com.hitherejoe.pickr.ui.activity;



public class BaseActivity extends AppCompatActivity {

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                FragmentManager fm = getFragmentManager();
                if (fm.getBackStackEntryCount() > 0) {
                    fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
                } else {
                    finish();
                }
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    protected ApplicationComponent applicationComponent() {
// Path: app/src/main/java/com/hitherejoe/pickr/PickrApplication.java
// public class PickrApplication extends Application {
// 
//     ApplicationComponent mApplicationComponent;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree());
// 
//         mApplicationComponent = DaggerApplicationComponent.builder()
//                 .applicationModule(new ApplicationModule(this))
//                 .build();
//     }
// 
//     public static PickrApplication get(Context context) {
//         return (PickrApplication) context.getApplicationContext();
//     }
// 
//     public ApplicationComponent getComponent() {
//         return mApplicationComponent;
//     }
// 
//     // Needed to replace the component with a test specific one
//     public void setComponent(ApplicationComponent applicationComponent) {
//         mApplicationComponent = applicationComponent;
//     }
// }
// 
// Path: app/src/main/java/com/hitherejoe/pickr/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     void inject(MainActivity mainActivity);
// 
//     Application application();
//     DataManager dataManager();
//     Bus eventBus();
// }


// Path: app/src/main/java/com/hitherejoe/pickr/ui/activity/BaseActivity.java
import android.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.hitherejoe.pickr.PickrApplication;
import com.hitherejoe.pickr.injection.component.ApplicationComponent;

package com.hitherejoe.pickr.ui.activity;



public class BaseActivity extends AppCompatActivity {

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                FragmentManager fm = getFragmentManager();
                if (fm.getBackStackEntryCount() > 0) {
                    fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
                } else {
                    finish();
                }
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    protected ApplicationComponent applicationComponent() {
        return PickrApplication.get(this).getComponent();