-1

I am trying to display datepicker with both portrait and landscape orientation.

I have also add

android:configChanges="orientation|screenSize"

but when I am changing orientation datepicker does not show properly look at the screenshorts.

enter image description here

after change orientation it look like

enter image description here

anyone have idea about it ??

Jai Khambhayta
  • 4,198
  • 2
  • 22
  • 29

1 Answers1

2
 DatePickerBuilder().setFragmentManager(childFragmentManager)
            .setYearOptional(true)
            .setDayOfMonth(localDate.dayOfMonth)
            .setMonthOfYear(localDate.monthOfYear - 1)
            .setYear(localDate.year)
            .addDatePickerDialogHandler({ ref, year, month, day ->
                date = LocalDate().withYear(year)
                        .withMonthOfYear(month + 1)
                        .withDayOfMonth(day).toString(OnTimePreferences.dateFormat)
            })
            .setStyleResId(R.style.BetterPickersDialogFragment_Light)
            .show()

try this in your code......