// Path: lib/src/main/java/mortar/lib/application/MortarApplication.java
// public abstract class MortarApplication extends Application {
// 
//   private MortarScope rootScope;
// 
//   @Override public void onCreate() {
//     super.onCreate();
// 
//     ObjectGraph applicationGraph = ObjectGraph.create(getRootScopeModules());
//     Injector.setApplicationGraph(applicationGraph);
//     rootScope = Mortar.createRootScope(isBuildConfigDebug(), applicationGraph);
//   }
// 
//   protected abstract Object[] getRootScopeModules();
// 
//   public abstract boolean isBuildConfigDebug();
// 
//   public MortarScope getRootScope() {
//     return rootScope;
//   }
// 
// }
// 
// Path: lib/src/main/java/mortar/lib/view/FlowOwnerView.java
// public abstract class FlowOwnerView extends FrameLayout implements CanShowScreen<Blueprint> {
// 
//   private AbstractScreenConductor<Blueprint> mScreenConductor;
// 
//   public FlowOwnerView(Context context, AttributeSet attrs) {
//     super(context, attrs);
//     Mortar.inject(context, this);
//   }
// 
//   @Override protected void onFinishInflate() {
//     super.onFinishInflate();
//     ButterKnifeWrapper.get().inject(this);
//     //noinspection unchecked
//     mScreenConductor = createScreenConductor(getContext());
//   }
// 
//   public Flow getFlow() {
//     return getPresenter().getFlow();
//   }
// 
//   protected abstract FlowOwner getPresenter();
// 
//   @Override
//   public void showScreen(Blueprint screen, Flow.Direction direction) {
//     mScreenConductor.showScreen(screen, direction);
//   }
// 
//   protected AbstractScreenConductor createScreenConductor(Context context) {
//     return new AnimatedScreenConductor(context, this);
//   }
// 
//   @Override protected void onAttachedToWindow() {
//     super.onAttachedToWindow();
//     //noinspection unchecked
//     getPresenter().takeView(this);
//   }
// 
//   @Override protected void onDetachedFromWindow() {
//     super.onDetachedFromWindow();
//     //noinspection unchecked
//     getPresenter().dropView(this);
//   }
// 
// }


import android.app.Activity;
import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.ViewGroup;
import mortar.Blueprint;
import mortar.Mortar;
import mortar.MortarActivityScope;
import mortar.MortarScope;
import mortar.lib.application.MortarApplication;
import mortar.lib.view.FlowOwnerView;
import static android.content.Intent.ACTION_MAIN;
import static android.content.Intent.CATEGORY_LAUNCHER;
package mortar.lib.activity;




/**
 * Hooks up the {@link mortar.MortarActivityScope}. Loads the main view
 * and lets it know about up button and back button presses.
 */
public abstract class MortarActivity extends Activity implements ResumeAndPauseActivity {

  private MortarActivityScope mActivityScope;
  private final ResumeAndPauseOwner mResumeAndPauseOwner = new ResumeAndPauseOwner();
  private boolean mIsRunning = false;

  protected abstract Blueprint getNewActivityScreen();
  
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Application application = getApplication();
// Path: lib/src/main/java/mortar/lib/application/MortarApplication.java
// public abstract class MortarApplication extends Application {
// 
//   private MortarScope rootScope;
// 
//   @Override public void onCreate() {
//     super.onCreate();
// 
//     ObjectGraph applicationGraph = ObjectGraph.create(getRootScopeModules());
//     Injector.setApplicationGraph(applicationGraph);
//     rootScope = Mortar.createRootScope(isBuildConfigDebug(), applicationGraph);
//   }
// 
//   protected abstract Object[] getRootScopeModules();
// 
//   public abstract boolean isBuildConfigDebug();
// 
//   public MortarScope getRootScope() {
//     return rootScope;
//   }
// 
// }
// 
// Path: lib/src/main/java/mortar/lib/view/FlowOwnerView.java
// public abstract class FlowOwnerView extends FrameLayout implements CanShowScreen<Blueprint> {
// 
//   private AbstractScreenConductor<Blueprint> mScreenConductor;
// 
//   public FlowOwnerView(Context context, AttributeSet attrs) {
//     super(context, attrs);
//     Mortar.inject(context, this);
//   }
// 
//   @Override protected void onFinishInflate() {
//     super.onFinishInflate();
//     ButterKnifeWrapper.get().inject(this);
//     //noinspection unchecked
//     mScreenConductor = createScreenConductor(getContext());
//   }
// 
//   public Flow getFlow() {
//     return getPresenter().getFlow();
//   }
// 
//   protected abstract FlowOwner getPresenter();
// 
//   @Override
//   public void showScreen(Blueprint screen, Flow.Direction direction) {
//     mScreenConductor.showScreen(screen, direction);
//   }
// 
//   protected AbstractScreenConductor createScreenConductor(Context context) {
//     return new AnimatedScreenConductor(context, this);
//   }
// 
//   @Override protected void onAttachedToWindow() {
//     super.onAttachedToWindow();
//     //noinspection unchecked
//     getPresenter().takeView(this);
//   }
// 
//   @Override protected void onDetachedFromWindow() {
//     super.onDetachedFromWindow();
//     //noinspection unchecked
//     getPresenter().dropView(this);
//   }
// 
// }


// Path: lib/src/main/java/mortar/lib/activity/MortarActivity.java
import android.app.Activity;
import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.ViewGroup;
import mortar.Blueprint;
import mortar.Mortar;
import mortar.MortarActivityScope;
import mortar.MortarScope;
import mortar.lib.application.MortarApplication;
import mortar.lib.view.FlowOwnerView;
import static android.content.Intent.ACTION_MAIN;
import static android.content.Intent.CATEGORY_LAUNCHER;

package mortar.lib.activity;




/**
 * Hooks up the {@link mortar.MortarActivityScope}. Loads the main view
 * and lets it know about up button and back button presses.
 */
public abstract class MortarActivity extends Activity implements ResumeAndPauseActivity {

  private MortarActivityScope mActivityScope;
  private final ResumeAndPauseOwner mResumeAndPauseOwner = new ResumeAndPauseOwner();
  private boolean mIsRunning = false;

  protected abstract Blueprint getNewActivityScreen();
  
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Application application = getApplication();
    if ( !(application instanceof MortarApplication) ) {