Merge pull request #9463 from nextcloud/highlightSortOrder

Correctly highlight selected sort order
This commit is contained in:
Álvaro Brey 2021-12-09 15:33:02 +01:00 committed by GitHub
commit 60aa2becf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View file

@ -364,7 +364,7 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
@Override
public void onSortingOrderChosen(FileSortOrder selection) {
preferences.setSortOrder(FileSortOrder.Type.uploadFilesView, selection);
preferences.setSortOrder(FileSortOrder.Type.localFileListView, selection);
mFileListFragment.sortFiles(selection);
}

View file

@ -133,8 +133,12 @@ public class LocalFileListFragment extends ExtendedListFragment implements
listDirectory(mContainerActivity.getInitialDirectory());
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.uploadFilesView);
mSortButton.setOnClickListener(v -> openSortingOrderDialogFragment(requireFragmentManager(), sortOrder));
mSortButton.setOnClickListener(v -> {
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
openSortingOrderDialogFragment(requireFragmentManager(), sortOrder);
});
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
mSortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder));
setGridSwitchButton();

View file

@ -51,7 +51,7 @@ public class FileSortOrder {
public static final Map<String, FileSortOrder> sortOrders;
public enum Type {
trashBinView, localFileListView, uploadFilesView
trashBinView, localFileListView
}
static {
HashMap<String, FileSortOrder> temp = new HashMap<>();