mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
Merge pull request #9463 from nextcloud/highlightSortOrder
Correctly highlight selected sort order
This commit is contained in:
commit
60aa2becf3
3 changed files with 8 additions and 4 deletions
|
@ -364,7 +364,7 @@ public class UploadFilesActivity extends DrawerActivity implements LocalFileList
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSortingOrderChosen(FileSortOrder selection) {
|
public void onSortingOrderChosen(FileSortOrder selection) {
|
||||||
preferences.setSortOrder(FileSortOrder.Type.uploadFilesView, selection);
|
preferences.setSortOrder(FileSortOrder.Type.localFileListView, selection);
|
||||||
mFileListFragment.sortFiles(selection);
|
mFileListFragment.sortFiles(selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,8 +133,12 @@ public class LocalFileListFragment extends ExtendedListFragment implements
|
||||||
|
|
||||||
listDirectory(mContainerActivity.getInitialDirectory());
|
listDirectory(mContainerActivity.getInitialDirectory());
|
||||||
|
|
||||||
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.uploadFilesView);
|
mSortButton.setOnClickListener(v -> {
|
||||||
mSortButton.setOnClickListener(v -> openSortingOrderDialogFragment(requireFragmentManager(), sortOrder));
|
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
|
||||||
|
openSortingOrderDialogFragment(requireFragmentManager(), sortOrder);
|
||||||
|
});
|
||||||
|
|
||||||
|
FileSortOrder sortOrder = preferences.getSortOrderByType(FileSortOrder.Type.localFileListView);
|
||||||
mSortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder));
|
mSortButton.setText(DisplayUtils.getSortOrderStringId(sortOrder));
|
||||||
|
|
||||||
setGridSwitchButton();
|
setGridSwitchButton();
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class FileSortOrder {
|
||||||
public static final Map<String, FileSortOrder> sortOrders;
|
public static final Map<String, FileSortOrder> sortOrders;
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
trashBinView, localFileListView, uploadFilesView
|
trashBinView, localFileListView
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
HashMap<String, FileSortOrder> temp = new HashMap<>();
|
HashMap<String, FileSortOrder> temp = new HashMap<>();
|
||||||
|
|
Loading…
Reference in a new issue