Last active
May 16, 2017 08:42
-
-
Save mauricegavin/0e81d2895694931f75a0df0121944a9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mauricegavin.core.ui.viewModels; | |
import android.support.annotation.NonNull; | |
import com.mauricegavin.core.ui.activities.ActivityResult; | |
import com.mauricegavin.core.ui.displayModel.ActivityDisplayModel; | |
import com.mauricegavin.core.ui.presenter.BasePresenterInput; | |
import rx.Observable; | |
import rx.subjects.PublishSubject; | |
/** | |
* Created by maurice on 15/12/2016. | |
*/ | |
abstract public class ActivityViewModel<ActivityDisplayModelT extends ActivityDisplayModel, | |
PresenterInputT extends BasePresenterInput> | |
extends BaseViewModel<ActivityDisplayModelT, PresenterInputT> { | |
private final PublishSubject<ActivityResult> activityResult = PublishSubject.create(); | |
public ActivityViewModel() { | |
super(); | |
} | |
/** | |
* Takes activity result data from the activity. | |
*/ | |
public void activityResult(final @NonNull ActivityResult activityResult) { | |
this.activityResult.onNext(activityResult); | |
} | |
// Accessors | |
@NonNull protected Observable<ActivityResult> activityResult() { | |
return activityResult; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment