Skip to content

Commit

Permalink
Bump version to 1.9.0 and update Readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasschuerg committed Feb 2, 2024
1 parent 800528f commit dad582d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,41 @@
[![Build Status](https://www.bitrise.io/app/6ba47c24369dd52a/status.svg?token=XyF0AXasZwgKuoub_tJUYA&branch=master)](https://www.bitrise.io/app/6ba47c24369dd52a)

# Android Week View
Android library for displaying an overview of events for a week like in a schedule(us) or timetable(uk).

It's the week view initially used in Schedule Deluxe (https://play.google.com/store/apps/details?id=com.tobiasschuerg.stundenplan),
Android library for displaying an overview of events for a week
like in a schedule(us) or timetable(uk).

It's the week view initially used in Schedule
Deluxe (https://play.google.com/store/apps/details?id=com.tobiasschuerg.stundenplan),
which is now outsourced in favor of a better modularization.

<img src="https://github.com/tobiasschuerg/android-week-view/blob/master/meta/device-2018-02-24-121341.png" height="400">

## Usage:

See `SampleActivity.kt` for how to use the week view.

### In short:

1. Attach the view to your layout:

```xml
<de.tobiasschuerg.weekview.view.WeekView
android:id="@+id/week_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:accent_color="@color/colorAccent"
app:start_hour="8"
app:end_hour="15" />

<de.tobiasschuerg.weekview.view.WeekView android:id="@+id/week_view"
android:layout_width="match_parent" android:layout_height="wrap_content"
app:accent_color="@color/colorAccent" app:start_hour="8" app:end_hour="15" />
```

2. Configure how events are displayed (optional):

```kotlin
val config = EventConfig(showSubtitle = false, showTimeEnd = false)
weekView.eventConfig = config
weekView.setShowNowIndicator(true)
```

3Add events:

```kotlin
val nowEvent = Event.Single(
id = 1337,
Expand All @@ -44,10 +50,15 @@ val nowEvent = Event.Single(
weekView.addEvent(nowEvent)
```

## Desugaring:

Starting from version 1.8.0, Android Week View has switched from JakeWharton's ThreeTen Backport
to desugaring for `java.time`-API.

## Get it

1. Add it in your root build.gradle at the end of repositories:

```gradle
allprojects {
repositories {
Expand All @@ -56,7 +67,9 @@ allprojects {
}
}
```

2. Step 2. Add the dependency

```gradle
dependencies {
compile 'com.github.tobiasschuerg:android-week-view:-SNAPSHOT'
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.lib_version = '1.8.1' // this lib
ext.kotlin_version = '1.9.20'
ext.lib_version = '1.9.0' // this lib
ext.kotlin_version = '1.9.22'

repositories {
google()
Expand Down Expand Up @@ -31,6 +31,6 @@ allprojects {
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}

0 comments on commit dad582d

Please sign in to comment.