Merge pull request #491 from Aga-C/fix-custom-not-set

Added setting custom sorting on move to top/bottom
This commit is contained in:
Tibor Kaputa 2022-02-03 22:36:04 +01:00 committed by GitHub
commit 3e60f0f600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -151,6 +151,7 @@ class ChecklistAdapter(
} }
private fun moveSelectedItemsToTop() { private fun moveSelectedItemsToTop() {
activity.config.sorting = SORT_BY_CUSTOM
selectedKeys.reversed().forEach { checklistId -> selectedKeys.reversed().forEach { checklistId ->
val position = items.indexOfFirst { it.id == checklistId } val position = items.indexOfFirst { it.id == checklistId }
val tempItem = items[position] val tempItem = items[position]
@ -163,6 +164,7 @@ class ChecklistAdapter(
} }
private fun moveSelectedItemsToBottom() { private fun moveSelectedItemsToBottom() {
activity.config.sorting = SORT_BY_CUSTOM
selectedKeys.forEach { checklistId -> selectedKeys.forEach { checklistId ->
val position = items.indexOfFirst { it.id == checklistId } val position = items.indexOfFirst { it.id == checklistId }
val tempItem = items[position] val tempItem = items[position]