From 5026415e451d6416c9cc2469f7aa9c3339223a78 Mon Sep 17 00:00:00 2001 From: Daniele Date: Sun, 5 Sep 2021 11:28:57 +0200 Subject: [PATCH] Filter --- .../danieleverducci/subitobeers/ui/BeersFragment.kt | 9 ++++++++- app/src/main/res/values/themes.xml | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/it/danieleverducci/subitobeers/ui/BeersFragment.kt b/app/src/main/java/it/danieleverducci/subitobeers/ui/BeersFragment.kt index b3b1c60..cda5b09 100644 --- a/app/src/main/java/it/danieleverducci/subitobeers/ui/BeersFragment.kt +++ b/app/src/main/java/it/danieleverducci/subitobeers/ui/BeersFragment.kt @@ -122,7 +122,14 @@ class BeersFragment : Fragment(), BeersRepository.Listener, BeerRecyclerAdapter. } val year = if (type == FILTERTYPE.SINCE) repo.filter.brewedAfterYear else repo.filter.brewedBeforeYear val month = if (type == FILTERTYPE.SINCE) repo.filter.brewedAfterMonth else repo.filter.brewedBeforeMonth - val dpd = DatePickerDialog(requireContext(), listener, year, month - 1,1) + val dpd = DatePickerDialog(requireContext(), R.style.beer_date_picker_dialog, listener, year, month - 1,1) + // Try to hide unused day spinner + val daySpinnerId = Resources.getSystem().getIdentifier("day", "id", "android") + if (daySpinnerId != 0) { + val daySpinnerView = dpd.datePicker.findViewById(daySpinnerId) + if (daySpinnerView != null) + daySpinnerView.visibility = View.GONE + } dpd.show() } diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 315e29c..d5fcfe1 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -11,6 +11,16 @@ @color/black ?attr/colorPrimaryVariant - + + + + + \ No newline at end of file