// Path: app/src/main/java/com/mortarnav/MainActivity.java
// @AutoComponent(
//         dependencies = App.class,
//         superinterfaces = WithActivityDependencies.class
// )
// @AutoInjector
// @DaggerScope(MainActivity.class)
// public class MainActivity extends AppCompatActivity {
// 
//     private MortarScope scope;
//     private Navigator navigator;
// 
//     @Inject
//     protected ToolbarOwner toolbarOwner;
// 
//     @Bind(R.id.navigator_container)
//     protected NavigatorView containerView;
// 
//     @Bind(R.id.toolbar)
//     protected Toolbar toolbar;
// 
//     @Override
//     public Object getSystemService(String name) {
//         if (scope != null && scope.hasService(name)) {
//             return scope.getService(name);
//         }
// 
//         return super.getSystemService(name);
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         setContentView(R.layout.activity_main);
//         ButterKnife.bind(this);
// 
//         toolbar.setTitle("Mortar architect");
//         setSupportActionBar(toolbar);
// 
//         scope = ActivityArchitector.onCreateScope(this, savedInstanceState, new Architected() {
//             @Override
//             public Navigator createNavigator(MortarScope scope) {
//                 Navigator navigator = Navigator.create(scope, new Parceler());
//                 navigator.transitions().register(new TransitionsMapping()
//                                 .byDefault(new LateralViewTransition(new Config().duration(300)))
//                                 .show(MyPopupView.class).withTransition(new FadeModalTransition(new Config().duration(250)))
//                                 .show(MyPopup2View.class).withTransition(new BottomAppearTransition(true, new Config().duration(1000)))
// //                                .show(SlidesView.class).withTransition(new CustomFullScreenLateralTransition())
//                 );
//                 return navigator;
//             }
// 
//             @Override
//             public void configureScope(MortarScope.Builder builder, MortarScope parentScope) {
//                 MainActivityComponent component = DaggerMainActivityComponent.builder()
//                         .appComponent(parentScope.<AppComponent>getService(DaggerService.SERVICE_NAME))
//                         .build();
//                 builder.withService(DaggerService.SERVICE_NAME, component);
//             }
//         });
// 
//         DaggerService.<MainActivityComponent>get(this).inject(this);
//         toolbarOwner.takeView(toolbar);
// 
//         // it is usually the best to create the navigator after everything else
//         navigator = ActivityArchitector.onCreateNavigator(this, savedInstanceState, containerView, new HomeStackable("Default home path"));
//     }
// 
//     @Override
//     protected void onNewIntent(Intent intent) {
//         super.onNewIntent(intent);
//         navigator.delegate().onNewIntent(intent);
//     }
// 
//     @Override
//     protected void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         BundleServiceRunner.getBundleServiceRunner(scope).onSaveInstanceState(outState);
//         navigator.delegate().onSaveInstanceState(outState);
//     }
// 
//     @Override
//     protected void onStart() {
//         super.onStart();
//         navigator.delegate().onStart();
//     }
// 
//     @Override
//     protected void onStop() {
//         navigator.delegate().onStop();
//         super.onStop();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         toolbarOwner.dropView(toolbar);
// 
//         navigator.delegate().onDestroy();
//         navigator = null;
// 
//         if (isFinishing() && scope != null) {
//             scope.destroy();
//             scope = null;
//         }
// 
//         super.onDestroy();
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (navigator.delegate().onBackPressed()) {
//             return;
//         }
// 
//         super.onBackPressed();
//     }
// }
// 
// Path: app/src/main/java/com/mortarnav/presenter/BannerPresenter.java
// @DaggerScope(BannerPresenter.class)
// public class BannerPresenter extends ViewPresenter<BannerView> {
// 
//     @Inject
//     public BannerPresenter() {
// 
//     }
// 
//     @Override
//     protected void onLoad(Bundle savedInstanceState) {
//         super.onLoad(savedInstanceState);
//     }
// 
//     public void click() {
//         Timber.d("Clicked on banner!");
//     }
// }
// 
// Path: architect/src/main/java/architect/NavigatorServices.java
// public class NavigatorServices {
// 
//     /**
//      * Get service from navigator's mortar scope or its parent
//      */
//     public static <T> T getService(MortarScope scope, String name) {
//         Navigator navigator = scope.getService(Navigator.SERVICE_NAME);
//         Preconditions.checkNotNull(navigator, "Cannot find navigator in the scope");
// 
//         return navigator.getScope().getService(name);
//     }
// }
// 
// Path: architect/src/main/java/architect/Stackable.java
// public interface Stackable {
// 
//     void configureScope(MortarScope.Builder builder, MortarScope parentScope);
// }


import com.mortarnav.DaggerScope;
import com.mortarnav.MainActivity;
import com.mortarnav.MainActivityComponent;
import com.mortarnav.presenter.BannerPresenter;
import architect.NavigatorServices;
import architect.Stackable;
import architect.robot.DaggerService;
import autodagger.AutoComponent;
import mortar.MortarScope;
package com.mortarnav.stackable;



/**
 * @author Lukasz Piliszczuk - lukasz.pili@gmail.com
 */
@AutoComponent(
        dependencies = MainActivity.class,
// Path: app/src/main/java/com/mortarnav/MainActivity.java
// @AutoComponent(
//         dependencies = App.class,
//         superinterfaces = WithActivityDependencies.class
// )
// @AutoInjector
// @DaggerScope(MainActivity.class)
// public class MainActivity extends AppCompatActivity {
// 
//     private MortarScope scope;
//     private Navigator navigator;
// 
//     @Inject
//     protected ToolbarOwner toolbarOwner;
// 
//     @Bind(R.id.navigator_container)
//     protected NavigatorView containerView;
// 
//     @Bind(R.id.toolbar)
//     protected Toolbar toolbar;
// 
//     @Override
//     public Object getSystemService(String name) {
//         if (scope != null && scope.hasService(name)) {
//             return scope.getService(name);
//         }
// 
//         return super.getSystemService(name);
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         setContentView(R.layout.activity_main);
//         ButterKnife.bind(this);
// 
//         toolbar.setTitle("Mortar architect");
//         setSupportActionBar(toolbar);
// 
//         scope = ActivityArchitector.onCreateScope(this, savedInstanceState, new Architected() {
//             @Override
//             public Navigator createNavigator(MortarScope scope) {
//                 Navigator navigator = Navigator.create(scope, new Parceler());
//                 navigator.transitions().register(new TransitionsMapping()
//                                 .byDefault(new LateralViewTransition(new Config().duration(300)))
//                                 .show(MyPopupView.class).withTransition(new FadeModalTransition(new Config().duration(250)))
//                                 .show(MyPopup2View.class).withTransition(new BottomAppearTransition(true, new Config().duration(1000)))
// //                                .show(SlidesView.class).withTransition(new CustomFullScreenLateralTransition())
//                 );
//                 return navigator;
//             }
// 
//             @Override
//             public void configureScope(MortarScope.Builder builder, MortarScope parentScope) {
//                 MainActivityComponent component = DaggerMainActivityComponent.builder()
//                         .appComponent(parentScope.<AppComponent>getService(DaggerService.SERVICE_NAME))
//                         .build();
//                 builder.withService(DaggerService.SERVICE_NAME, component);
//             }
//         });
// 
//         DaggerService.<MainActivityComponent>get(this).inject(this);
//         toolbarOwner.takeView(toolbar);
// 
//         // it is usually the best to create the navigator after everything else
//         navigator = ActivityArchitector.onCreateNavigator(this, savedInstanceState, containerView, new HomeStackable("Default home path"));
//     }
// 
//     @Override
//     protected void onNewIntent(Intent intent) {
//         super.onNewIntent(intent);
//         navigator.delegate().onNewIntent(intent);
//     }
// 
//     @Override
//     protected void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         BundleServiceRunner.getBundleServiceRunner(scope).onSaveInstanceState(outState);
//         navigator.delegate().onSaveInstanceState(outState);
//     }
// 
//     @Override
//     protected void onStart() {
//         super.onStart();
//         navigator.delegate().onStart();
//     }
// 
//     @Override
//     protected void onStop() {
//         navigator.delegate().onStop();
//         super.onStop();
//     }
// 
//     @Override
//     protected void onDestroy() {
//         toolbarOwner.dropView(toolbar);
// 
//         navigator.delegate().onDestroy();
//         navigator = null;
// 
//         if (isFinishing() && scope != null) {
//             scope.destroy();
//             scope = null;
//         }
// 
//         super.onDestroy();
//     }
// 
//     @Override
//     public void onBackPressed() {
//         if (navigator.delegate().onBackPressed()) {
//             return;
//         }
// 
//         super.onBackPressed();
//     }
// }
// 
// Path: app/src/main/java/com/mortarnav/presenter/BannerPresenter.java
// @DaggerScope(BannerPresenter.class)
// public class BannerPresenter extends ViewPresenter<BannerView> {
// 
//     @Inject
//     public BannerPresenter() {
// 
//     }
// 
//     @Override
//     protected void onLoad(Bundle savedInstanceState) {
//         super.onLoad(savedInstanceState);
//     }
// 
//     public void click() {
//         Timber.d("Clicked on banner!");
//     }
// }
// 
// Path: architect/src/main/java/architect/NavigatorServices.java
// public class NavigatorServices {
// 
//     /**
//      * Get service from navigator's mortar scope or its parent
//      */
//     public static <T> T getService(MortarScope scope, String name) {
//         Navigator navigator = scope.getService(Navigator.SERVICE_NAME);
//         Preconditions.checkNotNull(navigator, "Cannot find navigator in the scope");
// 
//         return navigator.getScope().getService(name);
//     }
// }
// 
// Path: architect/src/main/java/architect/Stackable.java
// public interface Stackable {
// 
//     void configureScope(MortarScope.Builder builder, MortarScope parentScope);
// }


// Path: app/src/main/java/com/mortarnav/stackable/BannerStackable.java
import com.mortarnav.DaggerScope;
import com.mortarnav.MainActivity;
import com.mortarnav.MainActivityComponent;
import com.mortarnav.presenter.BannerPresenter;
import architect.NavigatorServices;
import architect.Stackable;
import architect.robot.DaggerService;
import autodagger.AutoComponent;
import mortar.MortarScope;

package com.mortarnav.stackable;



/**
 * @author Lukasz Piliszczuk - lukasz.pili@gmail.com
 */
@AutoComponent(
        dependencies = MainActivity.class,
        target = BannerPresenter.class)