@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
@Override public void accept(LoginResponse response) throws Exception { getDataManager().updateUserInfo( response.getAccessToken(), response.getUserId(), DataManager.LoggedInMode.LOGGED_IN_MODE_FB, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
@Override public void accept(LoginResponse response) throws Exception { getDataManager().updateUserInfo( response.getAccessToken(), response.getUserId(), DataManager.LoggedInMode.LOGGED_IN_MODE_SERVER, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
@Override public void accept(LoginResponse response) throws Exception { getDataManager().updateUserInfo( response.getAccessToken(), response.getUserId(), DataManager.LoggedInMode.LOGGED_IN_MODE_GOOGLE, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
getMvpView().onError(R.string.empty_email); return; getMvpView().onError(R.string.invalid_email); return; getMvpView().onError(R.string.empty_password); return; getMvpView().showLoading();
@Override public void onFacebookLoginClick() { getMvpView().showLoading();
@Override public void onGoogleLoginClick() { getMvpView().showLoading();
@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
@Override public void accept(Throwable throwable) throws Exception { if (!isViewAttached()) { return; } getMvpView().hideLoading(); // handle the login error here if (throwable instanceof ANError) { ANError anError = (ANError) throwable; handleApiError(anError); } } }));
getMvpView().onError(R.string.empty_email); return; getMvpView().onError(R.string.invalid_email); return; getMvpView().onError(R.string.empty_password); return; getMvpView().showLoading();
@Override public void accept(LoginResponse response) throws Exception { getInteractor().updateUserInfo( response.getAccessToken(), response.getUserId(), AppConstants.LoggedInMode.LOGGED_IN_MODE_GOOGLE, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
@Override public void accept(LoginResponse response) throws Exception { getInteractor().updateUserInfo( response.getAccessToken(), response.getUserId(), AppConstants.LoggedInMode.LOGGED_IN_MODE_FB, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
@Override public void accept(LoginResponse response) throws Exception { getInteractor().updateUserInfo( response.getAccessToken(), response.getUserId(), AppConstants.LoggedInMode.LOGGED_IN_MODE_SERVER, response.getUserName(), response.getUserEmail(), response.getGoogleProfilePicUrl()); if (!isViewAttached()) { return; } getMvpView().hideLoading(); getMvpView().openMainActivity(); } }, new Consumer<Throwable>() {
@Override public void onGoogleLoginClick() { getMvpView().showLoading();
@Override public void onFacebookLoginClick() { getMvpView().showLoading();