0

I am missing few features in my Date picker dialogue using Kotlin

  • Missing Cancel & OK buttons
  • Today is not highlighted when the dialogue opened (today is 19 and 18 is highlighted)

Can someone please tell me how to fix this

Here is the theme code

<style name="DialogTheme" parent="Theme.AppCompat.Light.Dialog">
        <item name="colorAccent">@color/crimsonAccent</item>-->
        <item name="android:colorControlActivated">@color/accent</item>
        <item name="android:headerBackground">@color/prim</item>
        <item name="android:datePickerMode">calendar</item>
    </style>

enter image description here

3
  • How did you create this DatePicker? Commented Mar 20, 2022 at 1:35
  • Just a observation, you said that "Today is not highlighted when the dialogue opened (today is 19 and 18 is highlighted)" but if you observe, the 19 is in a different color because it is highlighted. The 18 is selected when you open the date picker because your upper date limit might be setted to yesterday. Commented Mar 20, 2022 at 1:51
  • @Tenfour04, Here is my code private val datePickerDialog by lazy { DatePickerDialog(requireActivity(), R.style.DialogTheme).apply { setTitle(R.string.select_date) Commented Mar 20, 2022 at 13:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.