This project is a binding for Android WeekView Library Version 1.2.6
Xamarin Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
- Week view calendar
- Day view calendar
- Custom styling
- Horizontal and vertical scrolling
- Infinite horizontal scrolling
- Live preview of custom styling in xml preview window
- Import the BindingsWeekView.dll into your project Or add binding project to your Refereneces. Or using NuGet:
Install-Package Xamarin.Android.Itium.WeekView -Version 1.0.0
-
Add WeekView in your xml layout:
<com.alamkanak.weekview.WeekView android:id="@+id/weekView" android:layout_width="match_parent" android:layout_height="match_parent" app:eventTextColor="@android:color/white" app:textSize="12sp" app:hourHeight="60dp" app:headerColumnPadding="8dp" app:headerColumnTextColor="#8f000000" app:headerRowPadding="12dp" app:columnGap="8dp" app:noOfVisibleDays="3" app:headerRowBackgroundColor="#ffefefef" app:dayBackgroundColor="#05000000" app:todayBackgroundColor="#1848adff" app:headerColumnBackground="#ffffffff"/>
-
Write the following code:
// Get a reference for the week view in the layout.
mWeekView = (WeekView)FindViewById(Resource.Id.weekView);
// Show a toast message about the touched event.
mWeekView.SetOnEventClickListener(this);
// The week view has infinite scrolling horizontally. We have to provide the events of a
// month every time the month changes on the week view.
mWeekView.MonthChangeListener = this;
// Set long press listener for events.
mWeekView.EventLongPress += (object sender, WeekView.EventLongPressEventArgs e) => { };
-
Implement WeekView.IEventClickListener, WeekView.IEventLongPressListener, MonthLoader.IMonthChangeListener according to your need.
-
Provide the events for the
WeekView
inWeekView.IMonthChangeListener
OnMonthChange callback. Please remember that the calendar pre-loads events of three consecutive months to enable lag-free scrolling.
public IList<WeekViewEvent> OnMonthChange(int newYear, int newMonth)
{
// Populate the week view with some events.
List<WeekViewEvent> events = new List<WeekViewEvent>();
return events;
}
Version 1.2.6
- Add empty view click listener
- Fix padding bug
- Fix bug when setting colors of different components
- Add ability to turn off fling gesture
- Add example of how to load events asynchronously in the sample app