Skip to content

Commit

Permalink
Add option to automatically flip to the time page when a date is sele…
Browse files Browse the repository at this point in the history
…cted, enabled by default. REsolves #1788.
  • Loading branch information
afollestad committed May 1, 2019
1 parent cded846 commit 686baf2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fun MaterialDialog.dateTimePicker(
currentDateTime: Calendar? = null,
requireFutureDateTime: Boolean = false,
show24HoursView: Boolean = false,
autoFlipToTime: Boolean = true,
dateTimeCallback: DateTimeCallback = null
): MaterialDialog {
customView(
Expand Down Expand Up @@ -76,6 +77,9 @@ fun MaterialDialog.dateTimePicker(
setActionButtonEnabled(
POSITIVE, !requireFutureDateTime || futureTime
)
if (autoFlipToTime) {
getPager().currentItem = 1
}
}
}

Expand Down

0 comments on commit 686baf2

Please sign in to comment.