Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Neil Alexander
element-android
Commits
91d8ee2a
Commit
91d8ee2a
authored
May 11, 2021
by
Valere
Browse files
Space panel room ordering
parent
f9820cde
Changes
1
Hide whitespace changes
Inline
Side-by-side
vector/src/main/java/im/vector/app/features/spaces/SpaceSummaryController.kt
View file @
91d8ee2a
...
@@ -43,6 +43,8 @@ class SpaceSummaryController @Inject constructor(
...
@@ -43,6 +43,8 @@ class SpaceSummaryController @Inject constructor(
var
callback
:
Callback
?
=
null
var
callback
:
Callback
?
=
null
private
var
viewState
:
SpaceListViewState
?
=
null
private
var
viewState
:
SpaceListViewState
?
=
null
private
val
subSpaceComparator
:
Comparator
<
SpaceChildInfo
>
=
compareBy
<
SpaceChildInfo
>
{
it
.
order
}.
thenBy
{
it
.
childRoomId
}
init
{
init
{
requestModelBuild
()
requestModelBuild
()
}
}
...
@@ -132,13 +134,13 @@ class SpaceSummaryController @Inject constructor(
...
@@ -132,13 +134,13 @@ class SpaceSummaryController @Inject constructor(
}
}
rootSpaces
rootSpaces
?.
sortedBy
{
it
.
displayName
}
?.
sortedBy
{
it
.
roomId
}
?.
forEach
{
groupSummary
->
?.
forEach
{
groupSummary
->
val
isSelected
=
selected
is
RoomGroupingMethod
.
BySpace
&&
groupSummary
.
roomId
==
selected
.
space
()
?.
roomId
val
isSelected
=
selected
is
RoomGroupingMethod
.
BySpace
&&
groupSummary
.
roomId
==
selected
.
space
()
?.
roomId
// does it have children?
// does it have children?
val
subSpaces
=
groupSummary
.
spaceChildren
?.
filter
{
childInfo
->
val
subSpaces
=
groupSummary
.
spaceChildren
?.
filter
{
childInfo
->
summaries
?.
indexOfFirst
{
it
.
roomId
==
childInfo
.
childRoomId
}
!=
-
1
summaries
?.
indexOfFirst
{
it
.
roomId
==
childInfo
.
childRoomId
}
!=
-
1
}
}
?.
sortedWith
(
subSpaceComparator
)
val
hasChildren
=
(
subSpaces
?.
size
?:
0
)
>
0
val
hasChildren
=
(
subSpaces
?.
size
?:
0
)
>
0
val
expanded
=
expandedStates
[
groupSummary
.
roomId
]
==
true
val
expanded
=
expandedStates
[
groupSummary
.
roomId
]
==
true
...
@@ -183,7 +185,7 @@ class SpaceSummaryController @Inject constructor(
...
@@ -183,7 +185,7 @@ class SpaceSummaryController @Inject constructor(
// does it have children?
// does it have children?
val
subSpaces
=
childSum
.
spaceChildren
?.
filter
{
childInfo
->
val
subSpaces
=
childSum
.
spaceChildren
?.
filter
{
childInfo
->
summaries
.
indexOfFirst
{
it
.
roomId
==
childInfo
.
childRoomId
}
!=
-
1
summaries
.
indexOfFirst
{
it
.
roomId
==
childInfo
.
childRoomId
}
!=
-
1
}
}
?.
sortedWith
(
subSpaceComparator
)
val
expanded
=
expandedStates
[
childSum
.
roomId
]
==
true
val
expanded
=
expandedStates
[
childSum
.
roomId
]
==
true
val
isSelected
=
selected
is
RoomGroupingMethod
.
BySpace
&&
childSum
.
roomId
==
selected
.
space
()
?.
roomId
val
isSelected
=
selected
is
RoomGroupingMethod
.
BySpace
&&
childSum
.
roomId
==
selected
.
space
()
?.
roomId
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment