Giter Site home page Giter Site logo

calendarlibrary's Introduction

Android Calendar Library

MonthView YearView
alt tab alt tab

Usage

In order to use this library in your project add the below dependencies is your project's build.gradle file

...
dependencies {
    compile 'com.github.ik024:calendar-lib:2.0.1'
}
...

MonthView Example

Add the following in your xml file:

<com.github.ik024.calendar_lib.MonthView 
        android:id="@+id/calendar_month_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"/>

Implement the MonthViewClickListener in your Activity:

public class MonthViewDemo extends AppCompatActivity implements MonthViewClickListeners{
...

 @Override
    public void dateClicked(Date dateClicked) {
        Toast.makeText(this, dateClicked.toString(), Toast.LENGTH_LONG).show();
    }
    
...    
}

For more refer MonthViewDemo.java file.

Customizations

Following attributes can be customized:

 <attr name="currentDayTextColorMV" format="color"/>
 <attr name="monthNameTextColorMV" format="color"/>
 <attr name="daysOfMonthTextColorMV" format="color"/>
 <attr name="daysOfWeekTextColorMV" format="color"/>
 <attr name="eventDayBackgroundColorMV" format="color"/>
 <attr name="eventDayTextColorMV" format="color"/>
 <attr name="calendarBackgroundColorMV" format="color" />
 <attr name="monthNameBackgroundColorMV" format="color" />
 <attr name="prevButtonBackgroundResourceMV" format="reference" />
 <attr name="nextButtonBackgroundResourceMV" format="reference" />

YearView Example

Add the following in your xml file:

<com.github.ik024.calendar_lib.YearView 
        android:id="@+id/calendar_year_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"/>

Implement the YearViewClickListener in your Activity:

public class MonthViewDemo extends AppCompatActivity implements YearViewClickListeners{
...

@Override
    public void dateClicked(int year, int month, int day) {
        Toast.makeText(this, "year: "+year+";\nmonth: "+month+";\nday: "+day, Toast.LENGTH_LONG).show();
        //TODO: Perform your actions based on year or month or day clicked
    }
    
...    
}

For more refer YearViewDemo.java file.

Customizations

Following attributes can be customized:

 <attr name="currentDayTextColorYV" format="color"/>
 <attr name="monthNameTextColorYV" format="color"/>
 <attr name="daysOfMonthTextColorYV" format="color"/>
 <attr name="daysOfWeekTextColorYV" format="color"/>
 <attr name="eventDayBackgroundColorYV" format="color"/>
 <attr name="eventDayTextColorYV" format="color"/>
 <attr name="calendarBackgroundColorYV" format="color" />
 <attr name="monthNameBackgroundColorYV" format="color" />
 <attr name="displayYearTextColorYV" format="color" />
 <attr name="headerBackgroundColorYV" format="color" />
 <attr name="prevButtonBackgroundResourceYV" format="reference" />
 <attr name="nextButtonBackgroundResourceYV" format="reference" />

calendarlibrary's People

Contributors

ismkhanh avatar

Watchers

James Cloos avatar Lerist 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.