|
39 | 39 | * @param <M> The type of model which can be handled
|
40 | 40 | */
|
41 | 41 | public abstract class RxRequestAction<RM, M> extends RequestAction<RM, M> implements Cancelable {
|
| 42 | + public static final Object NO_RESULT = new Object(); |
| 43 | + |
42 | 44 | protected CompositeDisposable mDisposable;
|
43 | 45 | protected boolean mUnsubscribeOnNewRequest = true;
|
44 | 46 |
|
@@ -73,7 +75,6 @@ protected void onMakeRequest(final Context context, final View view, final Strin
|
73 | 75 | @Override
|
74 | 76 | public void onSuccess(RM response) {
|
75 | 77 | onResponseSuccess(context, view, actionType, model, response);
|
76 |
| - onResponseCompleted(context, view, actionType, model); |
77 | 78 | }
|
78 | 79 |
|
79 | 80 | @Override
|
@@ -135,35 +136,4 @@ public void cancel() {
|
135 | 136 | @Nullable
|
136 | 137 | protected abstract Single<RM> getRequest(Context context, View view, String actionType, M model, @Nullable Object payload);
|
137 | 138 |
|
138 |
| - /** |
139 |
| - * Called when request observable emits "onComplete" event. |
140 |
| - * Hides progress dialog if enabled |
141 |
| - * |
142 |
| - * @param context The Context, which generally get from view by {@link View#getContext()} |
143 |
| - * @param view The view, which can be used for prepare any visual effect (like animation), |
144 |
| - * Generally it is that view which was clicked and initiated action to fire |
145 |
| - * @param actionType Type of the action which was executed. |
146 |
| - * @param oldModel The model which was used in request. |
147 |
| - */ |
148 |
| - protected void onResponseCompleted(Context context, View view, String actionType, M oldModel) { |
149 |
| - if (mShowProgressEnabled) hideProgressDialog(); |
150 |
| - } |
151 |
| - |
152 |
| - /** |
153 |
| - * Called on request observable emits "onNext" event. |
154 |
| - * Overrides super, so that does not hide progress dialog but calls {@link #notifyOnActionFired} here. |
155 |
| - * See {@link #onResponseCompleted(Context, View, String, Object)} for that. |
156 |
| - * |
157 |
| - * @param context The Context, which generally get from view by {@link View#getContext()} |
158 |
| - * @param view The view, which can be used for prepare any visual effect (like animation), |
159 |
| - * Generally it is that view which was clicked and initiated action to fire |
160 |
| - * @param actionType Type of the action which was executed. |
161 |
| - * @param oldModel The model which was used in request. |
162 |
| - * @param response network response |
163 |
| - */ |
164 |
| - @Override |
165 |
| - protected void onResponseSuccess(Context context, View view, String actionType, M oldModel, RM response) { |
166 |
| -// super.onResponseSuccess(context, view, actionType, oldModel, response); |
167 |
| - notifyOnActionFired(view, actionType, oldModel, response); |
168 |
| - } |
169 | 139 | }
|
0 commit comments