Update queue list when toggling 'keep sorted' (#6853)

This commit is contained in:
ByteHamster 2024-01-02 20:18:20 +01:00 committed by GitHub
parent c5093c9ff9
commit 4a782e457c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -27,6 +27,8 @@ public class ItemSortDialog extends BottomSheetDialogFragment {
@Nullable Bundle savedInstanceState) {
viewBinding = SortDialogBinding.inflate(inflater);
populateList();
viewBinding.keepSortedCheckbox.setOnCheckedChangeListener(
(buttonView, isChecked) -> ItemSortDialog.this.onSelectionChanged());
return viewBinding.getRoot();
}

View File

@ -546,9 +546,11 @@ public class QueueFragment extends Fragment implements MaterialToolbar.OnMenuIte
if (UserPreferences.isQueueKeepSorted()) {
sortOrder = UserPreferences.getQueueKeepSortedOrder();
}
View view = super.onCreateView(inflater, container, savedInstanceState);
final View view = super.onCreateView(inflater, container, savedInstanceState);
viewBinding.keepSortedCheckbox.setVisibility(View.VISIBLE);
viewBinding.keepSortedCheckbox.setChecked(UserPreferences.isQueueKeepSorted());
// Disable until something gets selected
viewBinding.keepSortedCheckbox.setEnabled(UserPreferences.isQueueKeepSorted());
return view;
}