diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-04-23 16:40:55 +0300 |
---|---|---|
committer | Niedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com> | 2020-04-24 15:12:11 +0300 |
commit | 7824f1f4663dbde718617023992768a3dda5c20d (patch) | |
tree | f4926f2fb31ea2823a61f025ebfaf4d8b82f6e5a /app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java | |
parent | e6bf689c120ea83b7980df14afeb18cfc870d12f (diff) |
Use neutral buttons
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java index d5a3c5e6f..85ecf7d3c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java @@ -27,14 +27,7 @@ public class FilterDialogFragment extends BrandedDialogFragment { private static final String KEY_BOARD_ID = "board_id"; private MainViewModel viewModel; - - private DialogFilterBinding binding; - private SyncManager syncManager; - private OverdueFilterAdapter overdueAdapter; - - private Account account; - private long boardId; private FilterInformation filterInformation; @Override @@ -51,10 +44,10 @@ public class FilterDialogFragment extends BrandedDialogFragment { throw new IllegalArgumentException(KEY_ACCOUNT + " and " + KEY_BOARD_ID + " must be provided as arguments"); } - this.boardId = args.getLong(KEY_BOARD_ID); - this.account = (Account) args.getSerializable(KEY_ACCOUNT); + long boardId = args.getLong(KEY_BOARD_ID); + Account account = (Account) args.getSerializable(KEY_ACCOUNT); - if (this.boardId == 0L || this.account == null) { + if (boardId == 0L || account == null) { throw new IllegalArgumentException(KEY_ACCOUNT + " and " + KEY_BOARD_ID + " must be valid localIds and not be 0 or null"); } } @@ -72,7 +65,7 @@ public class FilterDialogFragment extends BrandedDialogFragment { final AlertDialog.Builder dialogBuilder = new BrandedAlertDialogBuilder(requireContext()); - binding = DialogFilterBinding.inflate(requireActivity().getLayoutInflater()); + it.niedermann.nextcloud.deck.databinding.DialogFilterBinding binding = DialogFilterBinding.inflate(requireActivity().getLayoutInflater()); overdueAdapter = new OverdueFilterAdapter(requireContext()); binding.overdue.setAdapter(overdueAdapter); binding.overdue.setSelection(overdueAdapter.getPosition(this.filterInformation.getDueType())); @@ -88,11 +81,12 @@ public class FilterDialogFragment extends BrandedDialogFragment { } }); - syncManager = new SyncManager(requireActivity()); + SyncManager syncManager = new SyncManager(requireActivity()); return dialogBuilder .setTitle(R.string.simple_filter) .setView(binding.getRoot()) - .setNegativeButton(android.R.string.cancel, null) + .setNeutralButton(android.R.string.cancel, null) + .setNegativeButton(R.string.simple_clear, (a, b) -> viewModel.postFilterInformation(null)) .setPositiveButton(R.string.simple_filter, (a, b) -> viewModel.postFilterInformation(filterInformation)) .create(); } |