Skip to content

Commit

Permalink
Merge pull request #11 from deni1s/master
Browse files Browse the repository at this point in the history
Add scroll to date method
  • Loading branch information
andrewjapar authored Feb 8, 2020
2 parents 424f49c + 7a5a1d9 commit 1bf6a88
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ class CalendarPicker : RecyclerView {
refreshData()
}

fun scrollToDate(date: Date) {
val index =
mCalendarData.indexOfFirst { it is CalendarEntity.Day && it.date.isTheSameDay(date) }
require(index > -1) { "Date to scroll must be included in your Calendar Range Date" }
scrollToPosition(index)
}

fun showDayOfWeekTitle(show: Boolean) {
mShowDayOfWeekTitle = show
}
Expand Down

0 comments on commit 1bf6a88

Please sign in to comment.