Skip to content

Commit 7be9147

Browse files
committed
fix: sort graph shares by type and display name
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
1 parent 6f129f9 commit 7be9147

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎owncloudApp/src/main/java/com/owncloud/android/presentation/sharing/GraphSharesAdapter.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class GraphSharesAdapter : RecyclerView.Adapter<GraphSharesAdapter.GraphShareVie
7474
fun setShares(shares: List<MemberPermission>, roles: List<OCRole>) {
7575
this.rolesMap = roles.associate { it.id to it.displayName }
7676
val sortedShares = shares.sortedWith(
77-
compareByDescending<MemberPermission> { share -> roles.indexOfFirst { it.id in share.roles } }
78-
.thenBy { it.displayName }
77+
compareBy<MemberPermission> { it.isGroup }
78+
.thenBy { it.displayName.lowercase() }
7979
)
8080
val diffResult = DiffUtil.calculateDiff(GraphSharesDiffUtil(this.shares, sortedShares))
8181
this.shares = sortedShares

0 commit comments

Comments
 (0)