package com.mortarnav.stackable;

import android.content.Context;
import android.view.View;

import com.mortarnav.DaggerScope;
import com.mortarnav.MainActivityComponent;
import com.mortarnav.presenter.HomePresenter;
import com.mortarnav.view.HomeAdditionalCustomView;
import com.mortarnav.view.HomeView;

import org.parceler.Parcel;
import org.parceler.ParcelConstructor;

import architect.StackablePath;
import architect.robot.DaggerService;
import dagger.Provides;
import mortar.MortarScope;

/**
 * Manually created StackablePath
 * You should rather use @AutoStackable if you can
 *
 * @author Lukasz Piliszczuk - lukasz.pili@gmail.com
 */
@Parcel(parcelsIndex = false)
public class HomeStackable implements StackablePath {

    String name;

    @ParcelConstructor
    public HomeStackable(String name) {
        this.name = name;
    }

    @Override
    public View createView(Context context) {
        return new HomeView(context);
    }

    @Override
    public void configureScope(MortarScope.Builder builder, MortarScope parentScope) {
        builder.withService(DaggerService.SERVICE_NAME, DaggerHomePath_Component.builder()
                .mainActivityComponent(parentScope.<MainActivityComponent>getService(DaggerService.SERVICE_NAME))
                .module(new Module())
                .build());
    }

    @dagger.Module
    public class Module {

        @Provides
        @DaggerScope(Component.class)
        public HomePresenter providesPresenter() {
            return new HomePresenter(name);
        }
    }

    @dagger.Component(dependencies = MainActivityComponent.class, modules = Module.class)
    @DaggerScope(Component.class)
    public interface Component {

        void inject(HomeView view);

        void inject(HomeAdditionalCustomView view);
    }
}

@@ -1109,20 +1109,25 @@
 ggerHome
-Path
+Stackable
 _Compone

Fix typo.