Skip to content

Commit 687d874

Browse files
committed
Add icon for lexicographical descendant sorting
1 parent d5048f4 commit 687d874

File tree

2 files changed

+41
-12
lines changed

2 files changed

+41
-12
lines changed

app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -622,18 +622,29 @@ public boolean onSupportNavigateUp() {
622622
* Updates sorting method icon.
623623
*/
624624
private void updateSortMethodIcon(CategorySortingMethod method) {
625-
if (method == CategorySortingMethod.SORT_LEXICOGRAPHICAL_ASC) {
626-
activityBinding.sortingMethod.setImageResource(R.drawable.alphabetical_asc);
627-
activityBinding.sortingMethod.setContentDescription(getString(R.string.sort_last_modified));
628-
if (SDK_INT >= O) {
629-
activityBinding.sortingMethod.setTooltipText(getString(R.string.sort_last_modified));
630-
}
631-
} else {
632-
activityBinding.sortingMethod.setImageResource(R.drawable.modification_desc);
633-
activityBinding.sortingMethod.setContentDescription(getString(R.string.sort_alphabetically));
634-
if (SDK_INT >= O) {
635-
activityBinding.sortingMethod.setTooltipText(getString(R.string.sort_alphabetically));
636-
}
625+
switch (method){
626+
case SORT_MODIFIED_DESC :
627+
activityBinding.sortingMethod.setImageResource(R.drawable.modification_desc);
628+
activityBinding.sortingMethod.setContentDescription(getString(R.string.sort_alphabetically));
629+
if (SDK_INT >= O) {
630+
activityBinding.sortingMethod.setTooltipText(getString(R.string.sort_alphabetically));
631+
}
632+
break;
633+
case SORT_LEXICOGRAPHICAL_ASC:
634+
activityBinding.sortingMethod.setImageResource(R.drawable.alphabetical_asc);
635+
activityBinding.sortingMethod.setContentDescription(getString(R.string.sort_alphabetically));
636+
if (SDK_INT >= O) {
637+
activityBinding.sortingMethod.setTooltipText(getString(R.string.sort_alphabetically));
638+
}
639+
break;
640+
case SORT_LEXICOGRAPHICAL_DESC:
641+
activityBinding.sortingMethod.setImageResource(R.drawable.alphabetical_desc);
642+
activityBinding.sortingMethod.setContentDescription(getString(R.string.sort_last_modified));
643+
if (SDK_INT >= O) {
644+
activityBinding.sortingMethod.setTooltipText(getString(R.string.sort_last_modified));
645+
}
646+
break;
647+
default: throw new IllegalStateException("Unknown method: " + method.name());
637648
}
638649
}
639650

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Nextcloud Notes - Android Client
4+
~
5+
~ SPDX-FileCopyrightText: 2018-2024 Google LLC
6+
~ SPDX-FileCopyrightText: 2018-2024 Andy Scherzinger
7+
~ SPDX-License-Identifier: Apache-2.0
8+
-->
9+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
10+
android:width="26dp"
11+
android:height="26dp"
12+
android:viewportWidth="26"
13+
android:viewportHeight="26">
14+
15+
<path
16+
android:fillColor="#757575"
17+
android:pathData="M 20.401 13.623 L 18.877 13.621 L 18.868 20.218 L 17.228 18.57 L 16.145 19.651 L 19.627 23.145 L 23.12 19.663 L 22.039 18.58 L 20.392 20.219 Z M 15.034 1.85 L 15.034 3.104 L 10.691 9.337 L 10.691 9.412 L 15.1 9.412 L 15.1 11.209 L 7.847 11.209 L 7.847 10.03 L 12.292 3.695 L 12.292 3.638 L 8.268 3.638 L 8.268 1.85 Z M 13.051 12.122 L 15.981 21.48 L 13.678 21.48 L 12.949 18.952 L 10.244 18.952 L 9.571 21.48 L 7.352 21.48 L 10.244 12.122 Z M 12.64 17.437 L 12.05 15.454 L 11.807 14.545 L 11.573 13.646 L 11.545 13.646 L 11.339 14.555 L 11.114 15.472 L 10.553 17.437 Z" />
18+
</vector>

0 commit comments

Comments
 (0)