Giter Site home page Giter Site logo

mydynamiccalendarlibrary's Introduction

MyDynamicCalendarLibrary

This is an Android Library for developer to use customized calendar with all type of views and features, like Month View, Week View, Day View, Agenda, Add Events, Add Holiday etc. So all of these features contain in one calendar.
Example is available in app module.

screenshot screenshot screenshot screenshot

##Download

###Gradle dependency:

  • Add the following to your project level build.gradle:
allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}
  • Add this to your app build.gradle:
dependencies {
	compile 'com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1'
}

screenshot

##Usage

  • Add MyDynamicRecyclerView in xml file or dynamicaly careate in java file.
    <com.desai.vatsal.mydynamiccalendar.MyDynamicCalendar
        android:id="@+id/myCalendar"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
	
	MyDynamicCalendar myCalendar = new MyDynamicCalendar(this);
  • Design Calendar View
    myCalendar.setCalendarBackgroundColor("#eeeeee");	or	 myCalendar.setCalendarBackgroundColor(R.color.gray);
    myCalendar.setHeaderBackgroundColor("#454265");
    myCalendar.setHeaderTextColor("#ffffff");
    myCalendar.setNextPreviousIndicatorColor("#245675");
    myCalendar.setWeekDayLayoutBackgroundColor("#965471");
    myCalendar.setWeekDayLayoutTextColor("#246245");
    myCalendar.setExtraDatesOfMonthBackgroundColor("#324568");
    myCalendar.setExtraDatesOfMonthTextColor("#756325");
    myCalendar.setDatesOfMonthBackgroundColor("#145687");
    myCalendar.setDatesOfMonthTextColor("#745632");
    myCalendar.setCurrentDateBackgroundColor(R.color.black);
    myCalendar.setCurrentDateTextColor("#00e600");
    myCalendar.setBelowMonthEventTextColor("#425684");
    myCalendar.setBelowMonthEventDividerColor("#635478");
  • Manage Saturday & Sunday
   // set all saturday off(Holiday) - default value is false
   // isSaturdayOff(true/false, date_background_color, date_text_color);
   myCalendar.isSaturdayOff(true, "#ffffff", "#ff0000");

   // set all sunday off(Holiday) - default value is false
   // isSundayOff(true/false, date_background_color, date_text_color);
   myCalendar.isSundayOff(true, "#ffffff", "#ff0000");
  • Manage Events
    myCalendar.setEventCellBackgroundColor("#852365");
    myCalendar.setEventCellTextColor("#425684");

    // Add event  -  addEvent(event_date, event_start_time, event_end_time, event_title)
    myCalendar.addEvent("5-10-2016", "8:00", "8:15", "Today Event 1");
    myCalendar.addEvent("05-10-2016", "8:15", "8:30", "Today Event 2");
    myCalendar.addEvent("05-10-2016", "8:30", "8:45", "Today Event 3");

    // Get list of event with detail
    myCalendar.getEventList(new GetEventListListener() {
        @Override
        public void eventList(ArrayList<EventModel> eventList) {

        }
    });

    // updateEvent(position, event_date, event_start_time, event_end_time, event_title)
    myCalendar.updateEvent(0, "5-10-2016", "8:00", "8:15", "Today Event 111111");

    // Delete single event
    myCalendar.deleteEvent(2);

    // Delete all events
    myCalendar.deleteAllEvent();
  • Manage Holiday
    myCalendar.setHolidayCellBackgroundColor("#654248");
    myCalendar.setHolidayCellTextColor("#d590bb");

    // set holiday date clickable true/false
    myCalendar.setHolidayCellClickable(false);

    // Add holiday  -  addHoliday(holiday_date)
    myCalendar.addHoliday("2-11-2016");
    myCalendar.addHoliday("13-11-2016");
    myCalendar.addHoliday("8-10-2016");
    myCalendar.addHoliday("10-12-2016");
  • Navigate to particular date
    // setCalendarDate(date, month, year)
    myCalendar.setCalendarDate(5, 10, 2016);
  • Month View
    // show month view
    myCalendar.showMonthView();

    // date click listener
    myCalendar.setOnDateClickListener(new OnDateClickListener() {
        @Override
        public void onClick(Date date) {

        }

        @Override
        public void onLongClick(Date date) {

        }
    });
  • Month View With Event List (Show event on event date click)
    // show month view with events
    myCalendar.showMonthViewWithBelowEvents();

    // date click listener
    myCalendar.setOnDateClickListener(new OnDateClickListener() {
        @Override
        public void onClick(Date date) {

        }

        @Override
        public void onLongClick(Date date) {

        }
    });
  • Week View
    // show week view
    myCalendar.showWeekView();

    // date click listener
    myCalendar.setOnDateClickListener(new OnDateClickListener() {
        @Override
        public void onClick(Date date) {

        }

        @Override
        public void onLongClick(Date date) {

        }
    });

    // week view blank cell click listener
    myCalendar.setOnWeekDayViewClickListener(new OnWeekDayViewClickListener() {
        @Override
        public void onClick(String date, String time) {

        }

        @Override
        public void onLongClick(String date, String time) {

        }
    });

    // single event cell click listener
    myCalendar.setOnEventClickListener(new OnEventClickListener() {
        @Override
        public void onClick() {

        }

        @Override
        public void onLongClick() {

        }
    });
  • Day View
    // show day view
    myCalendar.showDayView();

    // day view blank cell click listener
    myCalendar.setOnWeekDayViewClickListener(new OnWeekDayViewClickListener() {
        @Override
        public void onClick(String date, String time) {

        }

        @Override
        public void onLongClick(String date, String time) {

        }
    });

    // single event cell click listener
    myCalendar.setOnEventClickListener(new OnEventClickListener() {
        @Override
        public void onClick() {

        }

        @Override
        public void onLongClick() {

        }
    });
  • Agenda View
    // show agenda view
    myCalendar.showAgendaView();

    // date click listener
    myCalendar.setOnDateClickListener(new OnDateClickListener() {
        @Override
        public void onClick(Date date) {

        }

        @Override
        public void onLongClick(Date date) {

        }
    });

##License

    Apache Version 2.0

    Copyright 2016.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

mydynamiccalendarlibrary's People

Contributors

vatsaldesai92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mydynamiccalendarlibrary's Issues

scroll

hi my dear friend

this is perfect
thanks

1- in day view mod or in week view mod it is better when scrolling events , the time sheet scrolled too
events scrolled but time sheet(left side of events list) not scrolled , thats must be scrolled Together

2- when person click on event (in month view mod) , it is better the view automatically changed to day or week view mod(Based on the settings) and show event in list

3- when today day in calendar has an event , after click on it , event does not show

excuse me
English is not my native language
I apologize for the mistake

Change Time Format

Hi,

I want to know how can I change the time format, instead of the 13 to 23 for 01 to 11 pm and 00 to 12 am on the lateral time side . How can I do that?

Can't add the library to my project

I tried to add the dependency but gave me these errors
**Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1.
Open File
Show Details
**

I also added the maven

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.android.nour.intro"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.1'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/res/assets/'] } }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.firebase:firebase-auth:12.0.1'
    implementation 'com.facebook.android:facebook-android-sdk:4.31.0'
    implementation 'com.google.android.gms:play-services-auth:12.0.1'
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.android.support:appcompat-v7:27.+'
    implementation 'com.android.support:support-v4:27.+'
    implementation 'com.android.support:design:27.+'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.google.firebase:firebase-database:12.0.1'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    //Added libraries
    implementation 'com.github.alamkanak:android-week-view:1.2.6'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'com.github.d-max:spots-dialog:0.7@aar'
    implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
    implementation 'com.github.medyo:fancybuttons:1.8.4'
    implementation 'com.shaishavgandhi:login-buttons:0.1.2'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.github.alamkanak:android-week-view:1.2.6'
    implementation 'com.github.vatsaldesai92:MyDynamicCalendarLibrary:1.0.1'
   
}
apply plugin: 'com.google.gms.google-services'

}

Unable to scroll view all events if the height is set to match_parent

When I set the height and width to match_parent it doesn't show all the event list. It shows just a few events in drop down when viewing in any view like month, week or daily view. I've to set the height to something like 1300 dp or similar to display large amount of events list. How can I resolve this issue?

Null pointer exception

ShowWeekViewEventsListAdapter -> ll_month_events -> null pointer exception
Line number 79

var "dateModelList" is null in "setDayView"

If i start my project by "myCalendar.showDayView();" an exception is thrown.

A work arround is start with a "myCalendar.showMonthView();" and after that "myCalendar.showDayView()". This is beacuse "showDayView" is not initializing "dateModelList" but it is doing a "dateModelList.clear()"

BY the way, i havent been able to make the setOnEventClickListener works, any would be appreciated.

thanks

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.