// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java
// public enum DaggerUtil {
//     INSTANCE;
// 
//     private StopwatchComponent stopwatchComponent;
// 
//     @NonNull
//     public StopwatchComponent getStopwatchComponent() {
//         checkNotNull();
//         return stopwatchComponent;
//     }
// 
//     private void checkNotNull() {
//         if (stopwatchComponent == null) {
//             throw new IllegalStateException("StopwatchComponent is null. setComponent() must be called first!");
//         }
//     }
// 
//     public void setComponent(@NonNull StopwatchComponent component) {
//         stopwatchComponent = component;
//     }
// }
// 
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java
// @AutoValue
// public abstract class Lap implements Parcelable {
// 
//     static final Lap BAD_LAP = create(-1L, -1L);
// 
//     public static Lap create(long duration, long endTime) {
//         return new AutoValue_Lap(duration, endTime);
//     }
// 
//     abstract long duration();
// 
//     abstract long endTime();
// 
//     // Manual Parcelable implementation because auto-value-parcel does not work with AIDL yet.
//     // Tools bug: https://code.google.com/p/android/issues/detail?id=224480
//     public static final Parcelable.Creator<Lap> CREATOR = new
//             Parcelable.Creator<Lap>() {
//                 public Lap createFromParcel(Parcel in) {
//                     return Lap.create(in);
//                 }
// 
//                 public Lap[] newArray(int size) {
//                     return new Lap[size];
//                 }
//             };
// 
//     private static Lap create(Parcel in) {
//         return Lap.create(in.readLong(), in.readLong());
//     }
// 
//     @Override
//     public void writeToParcel(Parcel out, int flags) {
//         out.writeLong(duration());
//         out.writeLong(endTime());
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// }
// 
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/view/TimeTeller.java
// public interface TimeTeller {
// 
//     /**
//      * Sets the current time to {@param timeInMillis}.
//      */
//     void tellTime(long timeInMillis);
// }


import com.autonomousapps.reactivestopwatch.R;
import com.autonomousapps.reactivestopwatch.di.DaggerUtil;
import com.autonomousapps.reactivestopwatch.time.Lap;
import com.autonomousapps.reactivestopwatch.view.TimeTeller;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);

        DaggerUtil.INSTANCE.getStopwatchComponent().inject(this);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_stopwatch, container, false);
        ButterKnife.bind(this, view);

        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        presenter.attachView(this);
    }

    @Override
    public void onPause() {
        presenter.detachView();
        super.onPause();
    }

// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java
// public enum DaggerUtil {
//     INSTANCE;
// 
//     private StopwatchComponent stopwatchComponent;
// 
//     @NonNull
//     public StopwatchComponent getStopwatchComponent() {
//         checkNotNull();
//         return stopwatchComponent;
//     }
// 
//     private void checkNotNull() {
//         if (stopwatchComponent == null) {
//             throw new IllegalStateException("StopwatchComponent is null. setComponent() must be called first!");
//         }
//     }
// 
//     public void setComponent(@NonNull StopwatchComponent component) {
//         stopwatchComponent = component;
//     }
// }
// 
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java
// @AutoValue
// public abstract class Lap implements Parcelable {
// 
//     static final Lap BAD_LAP = create(-1L, -1L);
// 
//     public static Lap create(long duration, long endTime) {
//         return new AutoValue_Lap(duration, endTime);
//     }
// 
//     abstract long duration();
// 
//     abstract long endTime();
// 
//     // Manual Parcelable implementation because auto-value-parcel does not work with AIDL yet.
//     // Tools bug: https://code.google.com/p/android/issues/detail?id=224480
//     public static final Parcelable.Creator<Lap> CREATOR = new
//             Parcelable.Creator<Lap>() {
//                 public Lap createFromParcel(Parcel in) {
//                     return Lap.create(in);
//                 }
// 
//                 public Lap[] newArray(int size) {
//                     return new Lap[size];
//                 }
//             };
// 
//     private static Lap create(Parcel in) {
//         return Lap.create(in.readLong(), in.readLong());
//     }
// 
//     @Override
//     public void writeToParcel(Parcel out, int flags) {
//         out.writeLong(duration());
//         out.writeLong(endTime());
//     }
// 
//     @Override
//     public int describeContents() {
//         return 0;
//     }
// }
// 
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/view/TimeTeller.java
// public interface TimeTeller {
// 
//     /**
//      * Sets the current time to {@param timeInMillis}.
//      */
//     void tellTime(long timeInMillis);
// }


// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragment.java
import com.autonomousapps.reactivestopwatch.R;
import com.autonomousapps.reactivestopwatch.di.DaggerUtil;
import com.autonomousapps.reactivestopwatch.time.Lap;
import com.autonomousapps.reactivestopwatch.view.TimeTeller;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);

        DaggerUtil.INSTANCE.getStopwatchComponent().inject(this);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_stopwatch, container, false);
        ButterKnife.bind(this, view);

        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        presenter.attachView(this);
    }

    @Override
    public void onPause() {
        presenter.detachView();
        super.onPause();
    }

    @Override