Skip to content

a1573595/WeekCalendar

Repository files navigation

Read this in other languages: English, 中文.

WeekCalendar

A custom calendar for the week.

Supported Android Versions

  • Android 4.0 Jelly Bean(API level 16) or higher.

Gradle

allprojects {
    repositories {
    ...
    
    maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.a1573595:WeekCalendar:1.0.1'
}

Usage

Define ClockCounter on your xml.

<com.a1573595.weekcalendar.WeekCalendar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="32dp"
    app:wc_borderRes="@drawable/star"
    app:wc_focusedTextColor="@android:color/holo_red_light"
    app:wc_textColor="@android:color/holo_red_light" />

Set listener.

binding.weekCalendar.setOnSelectedListener {
	...
}

Attribute

Attribute Type Default Description
wc_startTimeSeconds integer System.currentTimeMillis() / 1000 start time
wc_borderRes reference R.drawable.oval_gray border icon resource
wc_textColor color #000000 text color
wc_focusedTextColor color #ffffff focused text color
wc_isScrollable boolean true scrollable
wc_isItemTouchable boolean true item touchable