-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NT-1916: Feature flag comment threading #1243
Changes from 5 commits
8e7351c
4f4b46f
8495aa4
cc3e2d9
89526df
3a67a5f
fa5d0a8
d43005c
3889ac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import com.kickstarter.libs.ExperimentsClientType | |
import com.kickstarter.libs.KSCurrency | ||
import com.kickstarter.libs.RefTag | ||
import com.kickstarter.libs.models.OptimizelyExperiment | ||
import com.kickstarter.libs.models.OptimizelyFeature | ||
import com.kickstarter.libs.rx.transformers.Transformers.combineLatestPair | ||
import com.kickstarter.libs.rx.transformers.Transformers.errors | ||
import com.kickstarter.libs.rx.transformers.Transformers.ignoreValues | ||
|
@@ -219,6 +220,9 @@ interface ProjectViewModel { | |
/** Emits when we should start [com.kickstarter.ui.activities.CommentsActivity]. */ | ||
fun startCommentsActivity(): Observable<Pair<Project, ProjectData>> | ||
|
||
/** Emits when we should start [com.kickstarter.ui.activities. TODO: DEFINE NAME https://kickstarter.atlassian.net/browse/NT-1920]. */ | ||
fun startCommentsThreadedActivity(): Observable<Pair<Project, ProjectData>> | ||
|
||
/** Emits when we should start the creator bio [com.kickstarter.ui.activities.CreatorBioActivity]. */ | ||
fun startCreatorBioWebViewActivity(): Observable<Project> | ||
|
||
|
@@ -308,6 +312,7 @@ interface ProjectViewModel { | |
private val showUpdatePledgeSuccess = PublishSubject.create<Void>() | ||
private val startCampaignWebViewActivity = PublishSubject.create<ProjectData>() | ||
private val startCommentsActivity = PublishSubject.create<Pair<Project, ProjectData>>() | ||
private val startCommentsThreadedActivity = PublishSubject.create<Pair<Project, ProjectData>>() | ||
private val startCreatorBioWebViewActivity = PublishSubject.create<Project>() | ||
private val startCreatorDashboardActivity = PublishSubject.create<Project>() | ||
private val startLoginToutActivity = PublishSubject.create<Void>() | ||
|
@@ -482,11 +487,19 @@ interface ProjectViewModel { | |
.subscribe(this.startCreatorBioWebViewActivity) | ||
|
||
currentProject | ||
.filter { !optimizely.isFeatureEnabled(OptimizelyFeature.Key.COMMENT_THREADING) } | ||
.compose<Project>(takeWhen(this.commentsTextViewClicked)) | ||
.compose<Pair<Project, ProjectData>>(combineLatestPair(projectData)) | ||
.compose(bindToLifecycle()) | ||
.subscribe(this.startCommentsActivity) | ||
|
||
currentProject | ||
.filter { optimizely.isFeatureEnabled(OptimizelyFeature.Key.COMMENT_THREADING) } | ||
.compose<Project>(takeWhen(this.commentsTextViewClicked)) | ||
.compose<Pair<Project, ProjectData>>(combineLatestPair(projectData)) | ||
.compose(bindToLifecycle()) | ||
.subscribe(this.startCommentsThreadedActivity) | ||
|
||
currentProject | ||
.compose<Project>(takeWhen(this.creatorDashboardButtonClicked)) | ||
.compose(bindToLifecycle()) | ||
|
@@ -1069,6 +1082,9 @@ interface ProjectViewModel { | |
@NonNull | ||
override fun startCommentsActivity(): Observable<Pair<Project, ProjectData>> = this.startCommentsActivity | ||
|
||
@NonNull | ||
override fun startCommentsThreadedActivity(): Observable<Pair<Project, ProjectData>> = this.startCommentsThreadedActivity | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I think to keep parity with iOS, we are eventually going to name the comments activity There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
|
||
@NonNull | ||
override fun startCreatorBioWebViewActivity(): Observable<Project> = this.startCreatorBioWebViewActivity | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leighdouglas you can start the new activity in this method, for the task https://kickstarter.atlassian.net/browse/NT-1920
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! will do as soon as this lands and will update my PR