+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *
+ * http://www.apache.org/licenses/LICENSE-2.0 + *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.fernandocejas.android10.sample.presentation.mvp.presenter;
+
+import com.fernandocejas.android10.sample.presentation.mvp.view.View;
+
+/**
+ * Interface representing a Presenter in a model view presenter (MVP) pattern.
+ */
+public interface Presenter
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.fernandocejas.android10.sample.presentation.mvp.presenter;
+
+import com.fernandocejas.android10.sample.domain.User;
+import com.fernandocejas.android10.sample.domain.exception.DefaultErrorBundle;
+import com.fernandocejas.android10.sample.domain.exception.ErrorBundle;
+import com.fernandocejas.android10.sample.domain.interactor.DefaultObserver;
+import com.fernandocejas.android10.sample.domain.interactor.GetUserDetails;
+import com.fernandocejas.android10.sample.domain.interactor.GetUserDetails.Params;
+import com.fernandocejas.android10.sample.presentation.internal.di.PerActivity;
+import com.fernandocejas.android10.sample.presentation.mapper.UserModelDataMapper;
+import com.fernandocejas.android10.sample.presentation.model.UserModel;
+import com.fernandocejas.android10.sample.presentation.mvp.view.UserDetailsView;
+
+import javax.inject.Inject;
+
+/**
+ * {@link Presenter} that controls communication between views and models of the presentation
+ * layer.
+ */
+@PerActivity
+public class UserDetailsPresenter extends BasePresenter
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.fernandocejas.android10.sample.presentation.mvp.presenter;
+
+import com.fernandocejas.android10.sample.domain.User;
+import com.fernandocejas.android10.sample.domain.exception.DefaultErrorBundle;
+import com.fernandocejas.android10.sample.domain.interactor.DefaultObserver;
+import com.fernandocejas.android10.sample.domain.interactor.GetUserList;
+import com.fernandocejas.android10.sample.presentation.internal.di.PerActivity;
+import com.fernandocejas.android10.sample.presentation.mapper.UserModelDataMapper;
+import com.fernandocejas.android10.sample.presentation.model.UserModel;
+import com.fernandocejas.android10.sample.presentation.mvp.view.UserListView;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.inject.Inject;
+
+/**
+ * {@link Presenter} that controls communication between views and models of the presentation
+ * layer.
+ */
+@PerActivity
+public class UserListPresenter extends BasePresenter> {
+
+ @Override
+ public void onComplete() {
+ view.hideLoading();
+ }
+
+ @Override
+ public void onError(Throwable e) {
+ view.hideLoading();
+ view.showError(new DefaultErrorBundle((Exception) e));
+ view.showRetry();
+ }
+
+ @Override
+ public void onNext(List
> {
-
- @Override public void onComplete() {
- UserListPresenter.this.hideViewLoading();
- }
-
- @Override public void onError(Throwable e) {
- UserListPresenter.this.hideViewLoading();
- UserListPresenter.this.showErrorMessage(new DefaultErrorBundle((Exception) e));
- UserListPresenter.this.showViewRetry();
- }
-
- @Override public void onNext(List