-
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCE 馃棧] (Sub)category name on cards #357
Conversation
DiscoveryAdapter now takes a list of Pair<Project, DiscoveryParams> to check whether project subcategory should be shown. Showing subcategory when not looking at subcategory page. Still need to do Project We Love logic and tests.
Added staffPicks boolean to Project model. Added style for tag text. Added documentation for project card VM. Fixed DiscoveryFragmentViewModelTest. Fixed ProjectCardHolderViewModelTest. Started adding tests for new outputs in ProjectCardHolderViewModelTest.
@@ -212,6 +216,14 @@ public ViewModel(final @NonNull Environment environment) { | |||
.subscribe(p -> this.koala.trackViewedUpdate(p, KoalaContext.Update.ACTIVITY_SAMPLE)); | |||
} | |||
|
|||
private List<Pair<Project, DiscoveryParams>> combineProjectsAndParams(final @NonNull List<Project> projects, final @NonNull DiscoveryParams params) { | |||
final ArrayList<Pair<Project, DiscoveryParams>> projectAndParams = new ArrayList<>(projects.size()); | |||
for (int i = 0; i < projects.size(); i++) { |
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.
Haven't used one of these in a while 馃檭
app/src/main/java/com/kickstarter/viewmodels/ProjectCardHolderViewModel.java
Show resolved
Hide resolved
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.
this.projectWeLoveIsGone = this.project | ||
.map(Project::staffPick) | ||
.compose(coalesce(false)) | ||
.compose(combineLatestPair(this.discoveryParams.map(DiscoveryParams::staffPicks).compose(coalesce(false)))) |
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.
Why is the coalese(false)
opposed to taking in a value?
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.
staffPick
is @Nullable
. If it is null, we want to force it to be false.
what
Projects We Love
when project is a staff pick but hiding when viewing the staff picks filter.ProjectCardHolderViewModel
since there wasn't anysee
All Projects 聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 Staff Picks/Projects We Love
Root category 聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 Subcategory
Added documentation for
me