Skip to content
A simple library to display a horizontal calendar with custom start and end date, and mark events with a background
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea first commit Dec 10, 2019
app
gradle/wrapper first commit Dec 10, 2019
horizontalcalendar first commit Dec 10, 2019
.gitignore
README.md Update README.md Dec 11, 2019
build.gradle first commit Dec 10, 2019
gradle.properties
gradlew
gradlew.bat first commit Dec 10, 2019
settings.gradle first commit Dec 10, 2019

README.md

Horizontal Calendar View

A simple library to display a horizontal calendar with custom start and end date, and mark events with a background

Installation

Use Gradle to install the library, just add the following in app level build.gradle file

implementation 'com.github.akshittyagi205:HorizontalCalendarView:v1.0.0'

Usage

See the sample app to check the implementation of the library

In MainActivity.java

HorizontalCalendarView calendarView = findViewById(R.id.calendar);

Calendar starttime = Calendar.getInstance();
starttime.add(Calendar.MONTH,-6);

Calendar endtime = Calendar.getInstance();
endtime.add(Calendar.MONTH,6);

ArrayList datesToBeColored = new ArrayList();
datesToBeColored.add(Tools.getFormattedDateToday());

calendarView.setUpCalendar(starttime.getTimeInMillis(), 
                endtime.getTimeInMillis(), 
                datesToBeColored, 
                new HorizontalCalendarView.OnCalendarListener() {
            @Override
            public void onDateSelected(String date) {
                Toast.makeText(MainActivity.this,date+" clicked!",Toast.LENGTH_SHORT).show();
            }
        });

In activity_main.xml

<in.akshit.horizontalcalendar.HorizontalCalendarView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/calendar"/>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

You can’t perform that action at this time.