// Path: lib/src/main/java/mortar/lib/presenter/ResumeAndPausePresenter.java
// public abstract class ResumeAndPausePresenter<V extends View> extends ViewPresenter<V> 
//     implements ResumesAndPauses {
// 
//   private ResumeAndPauseOwner mResumeAndPauseOwner = null;
//   private boolean mIsRunning = false;
//   
//   @Override protected void onEnterScope(MortarScope scope) {
//     super.onEnterScope(scope);
//     
//     Activity activity = MortarUtil.getActivity(getView().getContext());
//     if (activity instanceof ResumeAndPauseActivity) {
//       mResumeAndPauseOwner = ((ResumeAndPauseActivity) activity).getResumeAndPausePresenter();
//     } else {
//       throw new RuntimeException(String.format("Cannot use %s inside an activity that doesn't " +
//           "implement %s.", ResumeAndPausePresenter.class.getSimpleName(), 
//           ResumeAndPauseActivity.class.getSimpleName()));
//     }
//     
//     mResumeAndPauseOwner.register(scope, this);
//   }
// 
//   @Override public void onResume() {
//     mIsRunning = true;
//   }
// 
//   @Override public void onPause() {
//     mIsRunning = false;
//   }
// 
//   @Override protected void onExitScope() {
//     if (mIsRunning) {
//       // Mortar keeps it's scoped in a HashMap which doesn't keep order.
//       // Without this sometimes onPause would run after onExitScope, and other times before.
//       onPause();
//     }
//     super.onExitScope();
//   }
// 
//   @Override public boolean isRunning() {
//     return mIsRunning;
//   }
// }
// 
// Path: sample/src/main/java/view/SampleView2.java
// public class SampleView2 extends MortarLinearLayout {
// 
//   @Inject SampleScreen2.Presenter2 mPresenter;
// 
//   public SampleView2(Context context, AttributeSet attrs) {
//     super(context, attrs);
//   }
// 
//   @Override protected ViewPresenter getPresenter() {
//     return mPresenter;
//   }
//   
//   @OnClick(R.id.toScreen1) public void onToScreen1Click() {
//     mPresenter.goToScreen1();
//   }
//   
// }


import android.os.Bundle;
import android.util.Log;
import javax.inject.Inject;
import javax.inject.Singleton;
import flow.Flow;
import flow.Layout;
import mortar.Blueprint;
import mortar.MortarScope;
import mortar.lib.presenter.ResumeAndPausePresenter;
import mortar.lib.sample.R;
import view.SampleView2;
package mortar.lib.sample.screen;




@Layout(R.layout.screen_sample2)
public class SampleScreen2 implements Blueprint {
  @Override public String getMortarScopeName() {
    return SampleScreen2.class.getName();
  }

  @Override public Object getDaggerModule() {
    return new Module();
  }
  
  @dagger.Module(
      addsTo = ActivityScreen.Module.class,
      injects = {
          Presenter2.class,
          SampleView2.class
      },
      library = true
  )
  class Module {
    
  }
  
// Path: lib/src/main/java/mortar/lib/presenter/ResumeAndPausePresenter.java
// public abstract class ResumeAndPausePresenter<V extends View> extends ViewPresenter<V> 
//     implements ResumesAndPauses {
// 
//   private ResumeAndPauseOwner mResumeAndPauseOwner = null;
//   private boolean mIsRunning = false;
//   
//   @Override protected void onEnterScope(MortarScope scope) {
//     super.onEnterScope(scope);
//     
//     Activity activity = MortarUtil.getActivity(getView().getContext());
//     if (activity instanceof ResumeAndPauseActivity) {
//       mResumeAndPauseOwner = ((ResumeAndPauseActivity) activity).getResumeAndPausePresenter();
//     } else {
//       throw new RuntimeException(String.format("Cannot use %s inside an activity that doesn't " +
//           "implement %s.", ResumeAndPausePresenter.class.getSimpleName(), 
//           ResumeAndPauseActivity.class.getSimpleName()));
//     }
//     
//     mResumeAndPauseOwner.register(scope, this);
//   }
// 
//   @Override public void onResume() {
//     mIsRunning = true;
//   }
// 
//   @Override public void onPause() {
//     mIsRunning = false;
//   }
// 
//   @Override protected void onExitScope() {
//     if (mIsRunning) {
//       // Mortar keeps it's scoped in a HashMap which doesn't keep order.
//       // Without this sometimes onPause would run after onExitScope, and other times before.
//       onPause();
//     }
//     super.onExitScope();
//   }
// 
//   @Override public boolean isRunning() {
//     return mIsRunning;
//   }
// }
// 
// Path: sample/src/main/java/view/SampleView2.java
// public class SampleView2 extends MortarLinearLayout {
// 
//   @Inject SampleScreen2.Presenter2 mPresenter;
// 
//   public SampleView2(Context context, AttributeSet attrs) {
//     super(context, attrs);
//   }
// 
//   @Override protected ViewPresenter getPresenter() {
//     return mPresenter;
//   }
//   
//   @OnClick(R.id.toScreen1) public void onToScreen1Click() {
//     mPresenter.goToScreen1();
//   }
//   
// }


// Path: sample/src/main/java/mortar/lib/sample/screen/SampleScreen2.java
import android.os.Bundle;
import android.util.Log;
import javax.inject.Inject;
import javax.inject.Singleton;
import flow.Flow;
import flow.Layout;
import mortar.Blueprint;
import mortar.MortarScope;
import mortar.lib.presenter.ResumeAndPausePresenter;
import mortar.lib.sample.R;
import view.SampleView2;

package mortar.lib.sample.screen;




@Layout(R.layout.screen_sample2)
public class SampleScreen2 implements Blueprint {
  @Override public String getMortarScopeName() {
    return SampleScreen2.class.getName();
  }

  @Override public Object getDaggerModule() {
    return new Module();
  }
  
  @dagger.Module(
      addsTo = ActivityScreen.Module.class,
      injects = {
          Presenter2.class,
          SampleView2.class
      },
      library = true
  )
  class Module {
    
  }
  
  @Singleton public static class Presenter2 extends ResumeAndPausePresenter<SampleView2> {