Coder Social home page Coder Social logo

cadar's Introduction

Cadar

Android solution which represents month and list calendars views and possibility to display events: just set of events and recurrent as well, but with limitations. For events processing I was using Ical4J library.

Example of most common using:

Add to your layout:
 <io.github.memfis19.cadar.view.MonthCalendar
        android:id="@+id/monthCalendar"
        android:layout_width="match_parent"
        android:layout_height="300dp" />
Using in code:
MonthCalendarConfiguration.Builder builder = new MonthCalendarConfiguration.Builder(this);
monthCalendar.setCalendarPrepareCallback(this);
monthCalendar.prepareCalendar(builder.build());

monthCalendar.setOnDayChangeListener(new OnDayChangeListener() {
    @Override
    public void onDayChanged(Calendar calendar) {
        Toast.makeText(MonthCalendarActivity.this, calendar.getTime().toString(), Toast.LENGTH_SHORT).show();
      }
    });
monthCalendar.setOnMonthChangeListener(new OnMonthChangeListener() {
    @Override
    public void onMonthChanged(Calendar calendar) {
        Toast.makeText(MonthCalendarActivity.this, calendar.getTime().toString(), Toast.LENGTH_SHORT).show();
      }
    });
...

@Override
public void onCalendarReady(CalendarController calendar) {
   monthCalendar.displayEvents(events, new DisplayEventCallback() {
   @Override
     public void onEventsDisplayed() {

     }
 });
}
Don't forget to release calendar:
@Override
protected void onDestroy() {
   super.onDestroy();
   monthCalendar.releaseCalendar();
}

For more specific using please look at sample project.

Events processing:

Events processing implemented in most simple way, each event has start date - date of start and end date - date of event end. Please notice that event does not have duration. so there is not exist stop date. Each event next periods for recurrency processting: none, every week, every 2 week, every 3 week, every 4 week, every month, every year. If event does npt have end date and repeat period set to none, that will single event, in case even has any other repeat period without end date, it will be endless event.

Month and list calendars limited in time, by defualt they displayed for 3 years. You are able to extend it via calendar configurations. In case if you want to use list and month calendars coupled, then you need to keep the same configuration settings for them.

One more important thing to know about event processing

In some cases during event processing, periods of calculaction may overlap and in this case events can be duplicated, to avoid this please override equals() and hashCode() methods in your model class which implements Event. For more details please look at sample source code.

How to add to your project?

compile 'io.github.memfis19:cadar:0.1.1'

Know issue

-Library has not release yet, so it will be extended in future.
-Not full documentation will be fixed soon.

Roadmap

-Add more documentation;
-Extend event's recurring settings;
-Add more tools to customize list calendar UI.

Bugs and Feedback

For bugs, feature requests, and discussion please use GitHub Issues.

LICENSE

MIT License
Copyright (c) 2016 Rodion Surzhenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cadar's People

Contributors

memfis19 avatar

Watchers

 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.