mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Add low priority section in DM tab #3463
This commit is contained in:
parent
ca2794193c
commit
ac8303bb99
3 changed files with 34 additions and 7 deletions
1
changelog.d/3463.feature
Normal file
1
changelog.d/3463.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Add low priority section in DM tab
|
|
@ -52,7 +52,7 @@ class GroupRoomListSectionBuilder(
|
|||
|
||||
when (mode) {
|
||||
RoomListDisplayMode.PEOPLE -> {
|
||||
// 3 sections Invites / Fav / Dms
|
||||
// 4 sections Invites / Fav / Dms / Low Priority
|
||||
buildPeopleSections(sections, activeGroupAwareQueries, actualGroupId)
|
||||
}
|
||||
RoomListDisplayMode.ROOMS -> {
|
||||
|
@ -218,7 +218,19 @@ class GroupRoomListSectionBuilder(
|
|||
) {
|
||||
it.memberships = listOf(Membership.JOIN)
|
||||
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, null, null)
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, false, null)
|
||||
it.activeGroupId = actualGroupId
|
||||
}
|
||||
|
||||
addSection(
|
||||
sections,
|
||||
activeSpaceAwareQueries,
|
||||
R.string.low_priority_header,
|
||||
false
|
||||
) {
|
||||
it.memberships = listOf(Membership.JOIN)
|
||||
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, true, null)
|
||||
it.activeGroupId = actualGroupId
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +243,6 @@ class GroupRoomListSectionBuilder(
|
|||
withQueryParams(
|
||||
{ query.invoke(it) },
|
||||
{ roomQueryParams ->
|
||||
|
||||
val name = stringProvider.getString(nameRes)
|
||||
session.getFilteredPagedRoomSummariesLive(roomQueryParams)
|
||||
.also {
|
||||
|
|
|
@ -261,7 +261,8 @@ class SpaceRoomListSectionBuilder(
|
|||
|
||||
private fun buildDmSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
|
||||
if (autoAcceptInvites.showInvites()) {
|
||||
addSection(sections = sections,
|
||||
addSection(
|
||||
sections = sections,
|
||||
activeSpaceUpdaters = activeSpaceAwareQueries,
|
||||
nameRes = R.string.invitations_header,
|
||||
notifyOfLocalEcho = true,
|
||||
|
@ -273,7 +274,8 @@ class SpaceRoomListSectionBuilder(
|
|||
}
|
||||
}
|
||||
|
||||
addSection(sections,
|
||||
addSection(
|
||||
sections,
|
||||
activeSpaceAwareQueries,
|
||||
R.string.bottom_action_favourites,
|
||||
false,
|
||||
|
@ -284,7 +286,8 @@ class SpaceRoomListSectionBuilder(
|
|||
it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null)
|
||||
}
|
||||
|
||||
addSection(sections,
|
||||
addSection(
|
||||
sections,
|
||||
activeSpaceAwareQueries,
|
||||
R.string.bottom_action_people_x,
|
||||
false,
|
||||
|
@ -292,7 +295,19 @@ class SpaceRoomListSectionBuilder(
|
|||
) {
|
||||
it.memberships = listOf(Membership.JOIN)
|
||||
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, null, null)
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, false, null)
|
||||
}
|
||||
|
||||
addSection(
|
||||
sections,
|
||||
activeSpaceAwareQueries,
|
||||
R.string.low_priority_header,
|
||||
false,
|
||||
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
|
||||
) {
|
||||
it.memberships = listOf(Membership.JOIN)
|
||||
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
|
||||
it.roomTagQueryFilter = RoomTagQueryFilter(false, true, null)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue