Giter Site home page Giter Site logo

bonetcalendarview's Introduction

BonetCalendarView

A customizable Calendar View for Android, supporting API's from 9 and above. Allows user to pick the day from a month as well as wuickly navigate through months.

Screenshots were taken from a Galaxy Ace Duos running Android 2.3.6 and a Moto G running 4.4.2.

Setup

The BonetCalendarView does not require any support library, you just need to clone the repository and import to your workspace.

Then, right click on the project you want to add the view, Properties -> Android -> Add (in the library section) and choose BonetCalendarView from the list. That's it!

Features

A calendar for every phone

The BonetCalendarView framework works with any android distribution, with no need for support libraries.

Quickly navigate through months

Say the calendar is displaying September 2013 but for some reason you want to select November 2014. Do you really want to press next 14 times? Not here. Tap the title, and the caelndar will let you choose which month you want. From 14 presses to 3! Cool huh?

Easy to customize

This calendar was built so that you can easily implement your own view. We provide simple list and grid displays, but we know that you want a calendar that fits your app. Customize the way each cell or row will be shown, or even create something that doesn't use any of them. Just a handful of lines and done

How to Use It

After adding the library reference to your project, it's time to create your calendar. You can do this either by adding via the layout xml, or via code.

The calendar won't work until you initialize it with the desired view configuration:

BtCalendarView cv = new BtCalendarView(this);
cv.initializeAsGrid();

or

BtCalendarView cv = new BtCalendarView(this);
cv.initializeAsGrid();

or

BtCalendarView cv = new BtCalendarView(this);
cv.initialize(CustomMonthViewProvider,CustomYearViewProvider);

Customizing the Month and Day pickers

To allow you to use your creativity to displays months and years in any way you can think, we provide two abstract classes to help: BtMonthViewProvider and BtYearViewProvider. They have two main methods:

public View getView() 

This method is the heart of the classes. Here you are asked to create the view that will display the year/month. We provide two implementations for the BtMonthViewProvider: one that displays the days in a list and another that displays them as a grid (just like a calendar). Displaying as a list can be cool when there are details of the day could be displayed (like events for example). For the year, we just provide the one that displays months in a list.

public void updateView()

Tell the calendar how the view you created should be updated

In the example app we give two custom implementations of the providers, and that also highlights the selected date. Take a look!

Customizing the right / left buttons and the title

Customization of this elements can be done by using the methods:

BtCalendarView cv = new BtCalendarView(this);
cv.getLeftButton();
cv.getRightButton();
cv.getTitleTextView();

Help us!

Tried it? Did you like it? That much? What about helping us continue to improve this one and maybe come up with new ones? Two ways you could do this:

  1. Share! Tell your coworkers, friends, fellow programmers, your dog! Don't be selfish.
  2. Contribute! Do you think you just created the most awesome version of our calendar? Tell us by raising an issue, we could add you as a contributor.
  3. Donate! If you are feeling generous enough consider donating so we can buy our coffee. We need fuel too. Click the button below

PayPayl donate button

License

This library in under the Apache v2 License

bonetcalendarview's People

Contributors

ebonet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.