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