Skip to content

myDario/DarioWeekDayPicker

Repository files navigation

DarioWeekDayPicker

A localized weekday picker for Android

Install

root build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

app build.gradle file:

implementation 'com.github.myDario:DarioWeekDayPicker:1.0.2'

Usage

<com.labstyle.darioweekdaypicker.DarioWeekDayPicker
    android:id="@+id/weekdayPicker"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

Selection change listener

findViewById<DarioWeekDayPicker>(R.id.weekdayPicker).onSelectionChanged = { indexList ->
    // ...
}

Select weekday at runtime

with (findViewById<DarioWeekDayPicker>(R.id.weekdayPicker)) {
    clearSelection()
    setSelected(weekdayIndex = 0, selected = true)
}