From dcfca720649343f64b04b1d3c152a71d4f312f9c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 May 2019 22:46:06 +0200 Subject: [PATCH] show the numeric sorting checkbox only at sorting by name or path --- .../gallery/pro/dialogs/ChangeSortingDialog.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt index 680fbe254..c1286a7e4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/ChangeSortingDialog.kt @@ -25,7 +25,7 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti view = activity.layoutInflater.inflate(R.layout.dialog_change_sorting, null).apply { use_for_this_folder_divider.beVisibleIf(showFolderCheckbox) - sorting_dialog_numeric_sorting.beVisibleIf(showFolderCheckbox) + sorting_dialog_numeric_sorting.beVisibleIf(showFolderCheckbox && (currSorting and SORT_BY_NAME != 0 || currSorting and SORT_BY_PATH != 0)) sorting_dialog_numeric_sorting.isChecked = currSorting and SORT_USE_NUMERIC_VALUE != 0 sorting_dialog_use_for_this_folder.beVisibleIf(showFolderCheckbox) @@ -46,6 +46,9 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val isDirectorySorti private fun setupSortRadio() { val sortingRadio = view.sorting_dialog_radio_sorting + sortingRadio.setOnCheckedChangeListener { group, checkedId -> + view.sorting_dialog_numeric_sorting.beVisibleIf(checkedId == sortingRadio.sorting_dialog_radio_name.id || checkedId == sortingRadio.sorting_dialog_radio_path.id) + } val sortBtn = when { currSorting and SORT_BY_PATH != 0 -> sortingRadio.sorting_dialog_radio_path