Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Latest commit

 

History

History
92 lines (68 loc) · 3.16 KB

README.md

File metadata and controls

92 lines (68 loc) · 3.16 KB

No Maintenance Intended

DEPRECATED

This repository is now deprecated. This is no longer supported.

Xamarin WeekView

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.

First Page

Features

  • Week view calendar
  • Day view calendar
  • Custom styling
  • Horizontal and vertical scrolling
  • Infinite horizontal scrolling
  • Live preview of custom styling in xml preview window

Getting Started

  1. 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
  1. 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"/>
  2. 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) => { };
	
  1. Implement WeekView.IEventClickListener, WeekView.IEventLongPressListener, MonthLoader.IMonthChangeListener according to your need.

  2. Provide the events for the WeekView in WeekView.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;
        }

Changelog

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