From 4a782e457ccde553d82f4627514c060d9083a94c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 2 Jan 2024 20:18:20 +0100 Subject: [PATCH] Update queue list when toggling 'keep sorted' (#6853) --- .../main/java/de/danoeh/antennapod/dialog/ItemSortDialog.java | 2 ++ .../java/de/danoeh/antennapod/fragment/QueueFragment.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ItemSortDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ItemSortDialog.java index 3090dd6a5..cd6cc4b0a 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ItemSortDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ItemSortDialog.java @@ -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(); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index dbaeb836c..1e32ee465 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -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; }