// Path: AuthProject/app/src/main/java/com/zhy/authproject/AuthApplication.java
// public class AuthApplication extends Application{
//     private AppComponent appComponent;
// 
//     public static AuthApplication get(Context context){
//         return (AuthApplication) context.getApplicationContext();
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         appComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
//     }
// 
// 
//     public AppComponent getAppComponent(){
//         return appComponent;
//     }
// 
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/module/base/BaseActivity.java
// public abstract class BaseActivity extends AppCompatActivity{
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setupActivityComponent();
//     }
//     public abstract void setupActivityComponent();
// 
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.CursorLoader;
import android.content.Loader;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.zhy.authproject.AuthApplication;
import com.zhy.authproject.R;
import com.zhy.authproject.module.base.BaseActivity;
import java.util.ArrayList;
import java.util.List;
import static android.Manifest.permission.READ_CONTACTS;
        // Set up the login form.
        mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
        populateAutoComplete();

        mPasswordView = (EditText) findViewById(R.id.password);
        mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
                if (id == R.id.login || id == EditorInfo.IME_NULL) {
                    attemptLogin();
                    return true;
                }
                return false;
            }
        });

        Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
        mEmailSignInButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                attemptLogin();
            }
        });

        mLoginFormView = findViewById(R.id.login_form);
        mProgressView = findViewById(R.id.login_progress);
    }

    @Override
    public void setupActivityComponent() {
// Path: AuthProject/app/src/main/java/com/zhy/authproject/AuthApplication.java
// public class AuthApplication extends Application{
//     private AppComponent appComponent;
// 
//     public static AuthApplication get(Context context){
//         return (AuthApplication) context.getApplicationContext();
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         appComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).build();
//     }
// 
// 
//     public AppComponent getAppComponent(){
//         return appComponent;
//     }
// 
// }
// 
// Path: AuthProject/app/src/main/java/com/zhy/authproject/module/base/BaseActivity.java
// public abstract class BaseActivity extends AppCompatActivity{
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setupActivityComponent();
//     }
//     public abstract void setupActivityComponent();
// 
// }


// Path: AuthProject/app/src/main/java/com/zhy/authproject/module/login/LoginActivity.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.CursorLoader;
import android.content.Loader;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.zhy.authproject.AuthApplication;
import com.zhy.authproject.R;
import com.zhy.authproject.module.base.BaseActivity;
import java.util.ArrayList;
import java.util.List;
import static android.Manifest.permission.READ_CONTACTS;

        // Set up the login form.
        mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
        populateAutoComplete();

        mPasswordView = (EditText) findViewById(R.id.password);
        mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
                if (id == R.id.login || id == EditorInfo.IME_NULL) {
                    attemptLogin();
                    return true;
                }
                return false;
            }
        });

        Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
        mEmailSignInButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                attemptLogin();
            }
        });

        mLoginFormView = findViewById(R.id.login_form);
        mProgressView = findViewById(R.id.login_progress);
    }

    @Override
    public void setupActivityComponent() {
        AuthApplication.get(this).getAppComponent().plus(new LoginModule(this)).inject(this);