Skip to content
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

Merged
merged 8 commits into from
Oct 18, 2018
Merged

Conversation

eoji
Copy link
Contributor

@eoji eoji commented Oct 18, 2018

what

  • Displaying subcategory when viewing root categories or all projects(including staff picks, saved, recommendations, and backed by people you follow).
  • Displaying category when a project's category is a root category. (but hiding if you're looking at a root category filter)
  • Displaying Projects We Love when project is a staff pick but hiding when viewing the staff picks filter.
  • Hiding both potential tags when project is not a staff pick and you're filtered by the project's category.
  • Added documentation to the outputs of ProjectCardHolderViewModel since there wasn't any

see

All Projects 聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 Staff Picks/Projects We Love


Root category 聽聽聽聽聽聽聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 聽聽聽聽聽聽 Subcategory

Added documentation for

me

image

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.
@eoji eoji requested a review from Rcureton October 18, 2018 17:21
@eoji
Copy link
Contributor Author

eoji commented Oct 18, 2018

@@ -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++) {
Copy link
Contributor

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 馃檭

Copy link
Contributor

@Rcureton Rcureton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and now we have these cool tags!

this.projectWeLoveIsGone = this.project
.map(Project::staffPick)
.compose(coalesce(false))
.compose(combineLatestPair(this.discoveryParams.map(DiscoveryParams::staffPicks).compose(coalesce(false))))
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@eoji eoji merged commit 60c856b into master Oct 18, 2018
@eoji eoji deleted the io/category-name-on-cards branch October 18, 2018 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants