Giter Club home page Giter Club logo

calendar-day-view's Introduction

Calendar-Day-View

Calendar Day View

install:

via Jcenter

compile 'com.framgia.library.calendardayview:library:1.0.4'

or via JitPack (to get current code)

project/build.gradle

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

module/build.gradle

compile 'com.github.khacpv:Calendar-Day-View:master-SNAPSHOT'

How to use:

<!-- If you want the calendar scrollable -->
<ScrollView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      >
      <com.framgia.library.calendardayview.CalendarDayView
          android:id="@+id/dayView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:eventPaddingLeft="10dp"
          app:dayHeight="@dimen/dayHeight"/>
  </ScrollView>

Create your model Event.java class by implement IEvent & IPopupEvent

Event implements IEvent, IPopupEvent {

    @Override
    public IPopupEvent getPopup() {...}
    
    ...
}

See MainActivity.java to know how to add events into calendar-day-view

{
      int eventColor = getResources().getColor(R.color.eventColor4);
      Calendar timeStart = Calendar.getInstance();
      timeStart.set(Calendar.HOUR_OF_DAY,16);
      timeStart.set(Calendar.MINUTE,15);
      Calendar timeEnd = (Calendar) timeStart.clone();
      timeEnd.add(Calendar.HOUR_OF_DAY, 1);
      timeEnd.add(Calendar.MINUTE,30);
      Event event = new Event(3, timeStart, timeEnd, "event 6", "house", eventColor);
      event.setBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.avatar));
      event.setTitle("event 2 this is test");
      event.setDescription("Yuong alsdf");
      event.setQuote("Google map");
      events.add(event);
  }

  CalendarDayView.setEvents(events);

Contribution

If you've found an error, please file an issue.

Patches and new samples are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

calendar-day-view's People

Contributors

khacpv avatar mdb694 avatar venky-123 avatar

Watchers

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