// Path: app/src/main/java/com/wiseass/profiler/createaccount/CreateAccountActivity.java
// public class CreateAccountActivity extends AppCompatActivity {
//     private static final String CREATE_FRAGMENT = "CREATE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_create_account);
// 
//         manager = this.getFragmentManager();
// 
//         //set up fragment
//         CreateAccountFragment fragment = (CreateAccountFragment)
//                 manager.findFragmentByTag(CREATE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = CreateAccountFragment.newInstance();
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_create_fragment,
//                 CREATE_FRAGMENT
//         );
// 
//     }
// }
// 
// Path: app/src/prod/java/com/wiseass/profiler/data/auth/AuthInjection.java
// public class AuthInjection {
// 
//     public static AuthSource provideAuthSource(){
//         return FirebaseAuthService.getInstance();
//     }
// 
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/scheduler/SchedulerInjection.java
// public class SchedulerInjection {
// 
//     public static BaseSchedulerProvider provideSchedulerProvider(){
//         return ImmediateSchedulerProvider.getInstance();
//     }
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/profilepage/ProfilePageActivity.java
// public class ProfilePageActivity extends AppCompatActivity {
//     private static final String PAGE_FRAGMENT = "PAGE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_profile_page);
// 
//         manager = this.getFragmentManager();
// 
//         ProfilePageFragment fragment = (ProfilePageFragment) manager.findFragmentByTag(PAGE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = ProfilePageFragment.newInstance();
//         }
// 
//         FragmentTransaction transaction = manager.beginTransaction();
//         transaction.replace(R.id.cont_profile_page_fragment, fragment, PAGE_FRAGMENT)
//                 .commit();
// 
//     }
// }


import android.content.Intent;
import android.os.Bundle;
import android.app.Fragment;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.wiseass.profiler.R;
import com.wiseass.profiler.createaccount.CreateAccountActivity;
import com.wiseass.profiler.data.auth.AuthInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.profilepage.ProfilePageActivity;
package com.wiseass.profiler.login;




/**
 * Responsibilities:
 * This is a View (in MVP). It manages drawing/inflating the user interface, and
 * it tells the Presenter when a UI Input event has occured.
 *
 * Really dumb. It tries not to make any decisions itself.
 */
public class LoginFragment extends Fragment implements LoginContract.View {
    private Button login, register;
    private TextView emailLabel, passwordLabel;
    private EditText emailInput, passwordInput;
    private ProgressBar progressBar;
    private View contentContainer;

    private LoginContract.Presenter presenter;

    @Override
    public void setPresenter(LoginContract.Presenter presenter) {
        this.presenter = presenter;
    }

    public LoginFragment() {
    }

    public static LoginFragment newInstance() {
        return new LoginFragment();
    }

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

    @Override
    public void onActivityCreated (Bundle savedInstanceState){
        super.onActivityCreated(savedInstanceState);
        if (presenter == null) {
            presenter = new LoginPresenter(
// Path: app/src/main/java/com/wiseass/profiler/createaccount/CreateAccountActivity.java
// public class CreateAccountActivity extends AppCompatActivity {
//     private static final String CREATE_FRAGMENT = "CREATE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_create_account);
// 
//         manager = this.getFragmentManager();
// 
//         //set up fragment
//         CreateAccountFragment fragment = (CreateAccountFragment)
//                 manager.findFragmentByTag(CREATE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = CreateAccountFragment.newInstance();
//         }
// 
//         ActivityUtils.addFragmentToActivity(manager,
//                 fragment,
//                 R.id.cont_create_fragment,
//                 CREATE_FRAGMENT
//         );
// 
//     }
// }
// 
// Path: app/src/prod/java/com/wiseass/profiler/data/auth/AuthInjection.java
// public class AuthInjection {
// 
//     public static AuthSource provideAuthSource(){
//         return FirebaseAuthService.getInstance();
//     }
// 
// }
// 
// Path: app/src/mock/java/com/wiseass/profiler/data/scheduler/SchedulerInjection.java
// public class SchedulerInjection {
// 
//     public static BaseSchedulerProvider provideSchedulerProvider(){
//         return ImmediateSchedulerProvider.getInstance();
//     }
// 
// }
// 
// Path: app/src/main/java/com/wiseass/profiler/profilepage/ProfilePageActivity.java
// public class ProfilePageActivity extends AppCompatActivity {
//     private static final String PAGE_FRAGMENT = "PAGE_FRAGMENT";
// 
//     private FragmentManager manager;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_profile_page);
// 
//         manager = this.getFragmentManager();
// 
//         ProfilePageFragment fragment = (ProfilePageFragment) manager.findFragmentByTag(PAGE_FRAGMENT);
// 
//         if (fragment == null){
//             fragment = ProfilePageFragment.newInstance();
//         }
// 
//         FragmentTransaction transaction = manager.beginTransaction();
//         transaction.replace(R.id.cont_profile_page_fragment, fragment, PAGE_FRAGMENT)
//                 .commit();
// 
//     }
// }


// Path: app/src/main/java/com/wiseass/profiler/login/LoginFragment.java
import android.content.Intent;
import android.os.Bundle;
import android.app.Fragment;
import android.support.annotation.StringRes;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.wiseass.profiler.R;
import com.wiseass.profiler.createaccount.CreateAccountActivity;
import com.wiseass.profiler.data.auth.AuthInjection;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.profilepage.ProfilePageActivity;

package com.wiseass.profiler.login;




/**
 * Responsibilities:
 * This is a View (in MVP). It manages drawing/inflating the user interface, and
 * it tells the Presenter when a UI Input event has occured.
 *
 * Really dumb. It tries not to make any decisions itself.
 */
public class LoginFragment extends Fragment implements LoginContract.View {
    private Button login, register;
    private TextView emailLabel, passwordLabel;
    private EditText emailInput, passwordInput;
    private ProgressBar progressBar;
    private View contentContainer;

    private LoginContract.Presenter presenter;

    @Override
    public void setPresenter(LoginContract.Presenter presenter) {
        this.presenter = presenter;
    }

    public LoginFragment() {
    }

    public static LoginFragment newInstance() {
        return new LoginFragment();
    }

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

    @Override
    public void onActivityCreated (Bundle savedInstanceState){
        super.onActivityCreated(savedInstanceState);
        if (presenter == null) {
            presenter = new LoginPresenter(
                    AuthInjection.provideAuthSource(),