-
Notifications
You must be signed in to change notification settings - Fork 741
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
Feature/bca/spaces dnd #3502
Conversation
a3aa663
to
c322a46
Compare
return this | ||
} | ||
|
||
class TestSpaceComparator : Comparator<Pair<String, String?>> { |
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.
val TestSpaceComparator = compareBy<Pair<String, String?>, String?>(nullsLast()) { it.second }
.thenBy { it.first }
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.
didn't know about the nullsLast, that's why I did the comparator
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.
compareBy
looks very powerful, but a bit hard to read and understand what it actually does at first sight :)
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.
we have 5 or 6 Comparator that could be implemented with thenBy
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 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 }
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.
LGTM, some small remark. Can you fix the issues reported by the CI please?
I will test on my device
matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/SpaceOrderUtils.kt
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/StringOrderUtils.kt
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt
Show resolved
Hide resolved
c322a46
to
be0797d
Compare
ff56726
to
944c964
Compare
+ klint fix
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.
Thanks for the update, I merge it!
Fixes #3501
Add support for top level space custom ordering