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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bca/spaces dnd #3502

Merged
merged 5 commits into from
Jun 18, 2021
Merged

Feature/bca/spaces dnd #3502

merged 5 commits into from
Jun 18, 2021

Conversation

BillCarsonFr
Copy link
Member

Fixes #3501
Add support for top level space custom ordering

dnd

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/spaces_dnd branch from a3aa663 to c322a46 Compare June 14, 2021 13:22
@BillCarsonFr BillCarsonFr added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Jun 14, 2021
@BillCarsonFr BillCarsonFr requested a review from ganfra June 14, 2021 13:25
return this
}

class TestSpaceComparator : Comparator<Pair<String, String?>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

val TestSpaceComparator = compareBy<Pair<String, String?>, String?>(nullsLast()) { it.second }
		.thenBy { it.first }

Copy link
Member Author

Choose a reason for hiding this comment

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

didn't know about the nullsLast, that's why I did the comparator

Copy link
Member

Choose a reason for hiding this comment

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

compareBy looks very powerful, but a bit hard to read and understand what it actually does at first sight :)

Copy link
Member Author

Choose a reason for hiding this comment

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

we have 5 or 6 Comparator that could be implemented with thenBy

Copy link
Contributor

Choose a reason for hiding this comment

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

This might be a tiny bit easier to read. (Comes with a hint of overhead but it's up to you)

compareBy<Pair<String, String?>> {""}
    .thenBy(nullsLast()) { it.second }
    .thenBy { it.first }

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, some small remark. Can you fix the issues reported by the CI please?
I will test on my device

@BillCarsonFr BillCarsonFr force-pushed the feature/bca/spaces_dnd branch from c322a46 to be0797d Compare June 17, 2021 12:24
@BillCarsonFr BillCarsonFr force-pushed the feature/bca/spaces_dnd branch from ff56726 to 944c964 Compare June 17, 2021 12:44
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update, I merge it!

@bmarty bmarty merged commit 5325c76 into develop Jun 18, 2021
@bmarty bmarty deleted the feature/bca/spaces_dnd branch June 18, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User defined top level spaces ordering
3 participants