Display weekdays and choose a day using DayBar.
1.Add jitpack repository to your project's build.gradle(Project:...)
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2.Add the dependency in build.gradle(Module:app)
implementation 'com.github.5hahryar:DayBar:Tag'
<com.shahryar.daybar.DayBar
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
dayBar.setOnDayChangedListener(object: DayBar.OnDayChangedListener {
override fun onSelectedDayChanged(date: HashMap<String, String>, chip: DayBarChip) {
TODO("Do something")
}
})
Indicate chips by index
dayBar.setIndicationByIndex(listOf(2, 6))
Indicate chips by day
dayBar.setIndicationByDay(listOf(31, 3))
Override colors in colors.xml
<color name="day_bar_chip_background_color">#6200EE</color>
<color name="day_bar_chip_text_color_selected">#FFF</color>
<color name="day_bar_chip_text_color">#6200EE</color>
<color name="day_bar_chip_stroke_color">#6200EE</color>
<color name="day_bar_chip_indicator_color">#6200EE</color>
First copy your .ttf file to font resource directory
<com.shahryar.daybar.DayBar
...
app:font="@font/myfont_regular"/>
Reach out to me at [email protected]
Feel free to make any contributions.