<commit_before>package com.vishnus1224.teamworkapidemo.ui.presenter;

import com.vishnus1224.teamworkapidemo.di.scope.PerActivity;
import com.vishnus1224.teamworkapidemo.ui.view.LoginView;

import javax.inject.Inject;

/**
 * Created by Vishnu on 8/14/2016.
 */
@PerActivity
public class LoginPresenter implements BasePresenter<LoginView> {

    private LoginView loginView;

    @Inject
    public LoginPresenter(){

    }

    @Override
    public void onViewAttached(LoginView loginView) {

        this.loginView = loginView;
    }

    @Override
    public void onViewDetached(LoginView loginView) {

        this.loginView = null;

    }

    public void loginUser(){



    }
}
<commit_msg>login presenter for handling all operations related to login<commit_after>package com.vishnus1224.teamworkapidemo.ui.presenter;

import com.vishnus1224.rxjavateamworkclient.model.AccountResponse;
import com.vishnus1224.teamworkapidemo.di.scope.PerActivity;
import com.vishnus1224.teamworkapidemo.ui.view.LoginView;
import com.vishnus1224.teamworkapidemo.usecase.UseCase;

import java.net.UnknownHostException;

import javax.inject.Inject;
import javax.inject.Named;

import rx.Subscriber;

/**
 * Created by Vishnu on 8/14/2016.
 */
@PerActivity
public class LoginPresenter implements BasePresenter<LoginView> {

    private UseCase useCase;

    private LoginView loginView;

    @Inject
    public LoginPresenter(@Named("authentication") UseCase useCase) {

        this.useCase = useCase;

    }

    @Override
    public void onViewAttached(LoginView loginView) {

        this.loginView = loginView;

    }

    @Override
    public void onViewDetached(LoginView loginView) {

        useCase.unSubscribe();

        this.loginView = null;

    }

    public void loginUser() {

        loginView.showProgressDialog();

        useCase.execute(new Subscriber<AccountResponse>() {

            @Override
            public void onCompleted() {

                hideProgressDialog();

            }

            @Override
            public void onError(Throwable e) {

                hideProgressDialog();

                if (e instanceof UnknownHostException) {

                    loginView.showError("No Internet Connection");

                } else {

                    loginView.showError("Authorization Failed");

                }

            }

            @Override
            public void onNext(AccountResponse accountResponse) {



            }
        });

    }

    public void cancelLogin() {

        useCase.unSubscribe();

    }

    private void hideProgressDialog() {

        loginView.hideProgressDialog();

    }
}

{'fraction_non_alphanumeric': 0.08534743202416918, 'fraction_numerical': 0.017371601208459216, 'mean_word_length': 2.5179282868525896, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4235571', 'n_tokens_mistral': 835, 'n_tokens_neox': 747, 'n_words': 147}