From ebb60b1f6a2438da480c8530d1fdc00457220235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korn=C3=A9l=20Szekeres?= Date: Thu, 3 Apr 2025 23:02:44 +0200 Subject: [PATCH 1/3] Fix null id exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kornél Szekeres --- .../it/niedermann/owncloud/notes/main/MainActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java index 159c41d0f..30d3e0374 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java @@ -262,8 +262,13 @@ protected void onCreate(Bundle savedInstanceState) { updateSortMethodIcon(methodOfCategory.second); activityBinding.sortingMethod.setOnClickListener((v) -> { if (methodOfCategory.first != null) { + int newId = 0; + if (methodOfCategory.second != null) + { + newId = methodOfCategory.second.getId(); + } //Rotate for next sorting method - var newMethod = CategorySortingMethod.findById(methodOfCategory.second.getId() + 1); + var newMethod = CategorySortingMethod.findById(newId + 1); final var modifyLiveData = mainViewModel.modifyCategoryOrder(methodOfCategory.first, newMethod); modifyLiveData.observe(this, (next) -> modifyLiveData.removeObservers(this)); } From 20f540c971b2d83f1a72582949b93800deffc363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korn=C3=A9l=20Szekeres?= Date: Thu, 3 Apr 2025 23:11:22 +0200 Subject: [PATCH 2/3] Fix sorting during category selected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kornél Szekeres --- .../it/niedermann/owncloud/notes/main/MainViewModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java index 96776b2c1..a6c15aca8 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainViewModel.java @@ -16,7 +16,7 @@ import static it.niedermann.owncloud.notes.main.slots.SlotterUtil.fillListByInitials; import static it.niedermann.owncloud.notes.main.slots.SlotterUtil.fillListByTime; import static it.niedermann.owncloud.notes.shared.model.CategorySortingMethod.SORT_MODIFIED_DESC; -import static it.niedermann.owncloud.notes.shared.model.CategorySortingMethod.SORT_LEXICOGRAPHICAL_ASC; +import static it.niedermann.owncloud.notes.shared.model.CategorySortingMethod.SORT_LEXICOGRAPHICAL_DESC; import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.DEFAULT_CATEGORY; import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.FAVORITES; import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.RECENT; @@ -273,6 +273,9 @@ public LiveData> getNotesListLiveData() { } private List fromNotes(List noteList, @NonNull NavigationCategory selectedCategory, @Nullable CategorySortingMethod sortingMethod) { + if(sortingMethod == SORT_LEXICOGRAPHICAL_DESC){ + Collections.reverse(noteList); + } if (selectedCategory.getType() == DEFAULT_CATEGORY) { final String category = selectedCategory.getCategory(); if (category != null) { @@ -284,9 +287,6 @@ private List fromNotes(List noteList, @NonNull NavigationCategory se if (sortingMethod == SORT_MODIFIED_DESC) { return fillListByTime(getApplication(), noteList); } - if(sortingMethod != SORT_LEXICOGRAPHICAL_ASC){ - Collections.reverse(noteList); - } return fillListByInitials(getApplication(), noteList); } From 03331beb79fe37c6d5eeb7395a664a92884fbf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korn=C3=A9l=20Szekeres?= Date: Thu, 3 Apr 2025 23:18:00 +0200 Subject: [PATCH 3/3] Add creator name to alphabetical_desc.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kornél Szekeres --- app/src/main/res/drawable/alphabetical_desc.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/drawable/alphabetical_desc.xml b/app/src/main/res/drawable/alphabetical_desc.xml index c97617a74..99e4c6965 100644 --- a/app/src/main/res/drawable/alphabetical_desc.xml +++ b/app/src/main/res/drawable/alphabetical_desc.xml @@ -4,6 +4,7 @@ ~ ~ SPDX-FileCopyrightText: 2018-2024 Google LLC ~ SPDX-FileCopyrightText: 2018-2024 Andy Scherzinger + ~ SPDX-FileCopyrightText: 2024-2025 Kornél Szekeres ~ SPDX-License-Identifier: Apache-2.0 -->