Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
muraee committed Jan 17, 2017
1 parent f5e595a commit 7de12cf
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ ![Download](https://api.bintray.com/packages/mulham-raee/maven/horizontal-calendar/images/download.svg) ](https://bintray.com/mulham-raee/maven/horizontal-calendar/_latestVersion)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

A horizontal calendar view for Android
A material horizontal calendar view for Android based on `RecyclerView`.

![demo](/art/demo.gif)

Expand Down Expand Up @@ -94,6 +94,53 @@ horizontalCalendar.setCalendarListener(new HorizontalCalendarListener() {
});
```

## Customization
You can customize it directly inside your layout:

```xml
<devs.mulham.horizontalcalendar.HorizontalCalendarView
android:id="@+id/calendarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
app:textColorNormal="#bababa"
app:textColorSelected="#FFFF"
app:selectorColor="#c62828" // default to colorAccent.
app:selectedDateBackground="#00ffffff"/>
```

Or you can do it programmatically in your Activity using the **Builder**:

```java
HorizontalCalendar horizontalCalendar = new HorizontalCalendar.Builder(this, R.id.calendarView)
.startDate(startDate.getTime())
.endDate(endDate.getTime())
.datesNumberOnScreen(5) // Number of Dates cells shown on screen (Recommended 5)
.dayFormat("EEE") // WeekDay text format
.dayNumberFormat("dd") // Date format
.textColor(Color.LTGRAY, Color.WHITE) // Text color for none selected Dates, Text color for selected Date.
.selectedDateBackground(Color.TRANSPARENT) // Background color of the selected date cell.
.selectorColor(Color.RED) // Color of the selection indicator bar (default to colorAccent).
.build();
```

## Features
- You can select a specific **Date** programmatically with the option whether to play the animation or not, with:
```java
horizontalCalendar.selectDate(Date date, boolean immediate); // set immediate to false to ignore animation.
// or simply
horizontalCalendar.goToday(boolean immediate);
```

- Check if two dates' **days** are equal:
```java
horizontalCalendar.isDatesDaysEquals(Date date1, Date date2);
```

- Check if a date is contained in the Calendar:
```java
horizontalCalendar.contains(Date date);
```
## Contributing
Contributions are welcome, feel free to submit a pull request.

Expand Down

0 comments on commit 7de12cf

Please sign in to comment.