Event in calendar android

Содержание
  1. Android Essentials: Adding Events to the User’s Calendar
  2. Step 0: Getting Started
  3. Step 1: Create the Calendar Intent
  4. Step 2: Seeding Calendar Details
  5. Step 3: Seeding Calendar Dates and Times
  6. Step 4: Event Configuration Details
  7. Step 5: Configuring Recurring Events
  8. Conclusion
  9. Android Custom Calendar with events
  10. marcohc/roboto-calendar-view
  11. roboto-calendar-view — Deprecated — Use this amazing calendar instead…
  12. Roboto Calendar View
  13. Sample
  14. Compatibility
  15. Usage
  16. Gradle
  17. SimpleMobileTools/Simple-Calendar
  18. Simple-Calendar — A simple calendar with events, customizable widget and no ads.
  19. Simple Calendar
  20. Applandeo/Material-Calendar-View
  21. Material-Calendar-View — Material Calendar View for Android
  22. Material-Calendar-View
  23. Features
  24. How to migrate from previous version to 1.4.0?
  25. How to use?
  26. Adding events with icons:
  27. Clicks handling:
  28. Getting a selected days in the picker mode:
  29. Setting a current date:
  30. Setting minumum and maximum dates:
  31. Setting disabled dates:
  32. Previous and forward page change listeners:
  33. Customization
  34. Colors customization:
  35. Translations:
  36. Date Picker Dialog
  37. Getting date handling:
  38. Customization:
  39. Changelog
  40. Version 1.4.0:
  41. prolificinteractive/material-calendarview
  42. material-calendarview — A Material design back port of Android’s CalendarView
  43. Material Calendar View
  44. Installation
  45. Usage
  46. Documentation
  47. Customization
  48. Events, Highlighting, Custom Selectors, and More!
  49. Recent Changes
  50. Major Change in 1.5.0
  51. Major Change in 1.4.0
  52. Riontech/CustomCalendar
  53. CustomCalendar — Custom Calendar with Decorator and Detail view
  54. Custom Android Calendar
  55. #Usage
  56. TODOs
  57. MOLO17/CustomizableCalendar
  58. CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour
  59. CustomizableCalendar
  60. Features
  61. Limitations
  62. Gradle
  63. Dependencies
  64. How to customize
  65. HeaderView
  66. WeekDaysView
  67. SubView
  68. CalendarRecyclerView

Android Essentials: Adding Events to the User’s Calendar

The latest version of the Android SDK, code-named Ice Cream Sandwich, reached developers this week. For the first time, the SDK provides access to the Calendar application in a legitimate fashion. One of the most common tasks that developers often want to be able to do is create new events in the user’s calendar, so today we’ll show you how.

The Calendar is a common application that users rely upon on their Android devices. Applications can access the Calendar using the new APIs available in Android 4.0. Adding new events to the Calendar is simple and requires no special application permissions.

Note: The user is responsible for configuring the Calendar application with the appropriate Calendar accounts (e.g. Microsoft Exchange).

Step 0: Getting Started

This tutorial assumes you have a project that supports Android 4.0 (API Level 14 compatible) and that you are compiling with the latest tools. It also assumes that you’ve properly configured the Calendar application on the Android emulator (or a suitable device, when one becomes available in the coming weeks).

Step 1: Create the Calendar Intent

In order to prompt the user to create a calendar event in their existing calendar, you’ll need to create the appropriate intent. This intent will launch the Calendar application with a screen that allows them to create a new event. The user must confirm this event and can add or change any of the event data associated with the event.

The intent to create a calendar event is shown below:

This code simply launches the intent. It does not set any of the calendar data associated with the event.

Step 2: Seeding Calendar Details

You can seed the information associated with a calendar event by supplying a number of intent extras. Extras can be used to describe event details, the date and time of the event, as well as calendar event settings like whether the event can be seen by others and whether it is busy or available time. The typical calendar event settings are all available as Extras. For example, the following intent call supplies some title and description information about an event:

Here we set the title, location, and description access for the event using the appropriate intent Extras. These fields will be set in a form that displays for the user to confirm the event in their calendar.

Читайте также:  Hik connect android mobile client

Step 3: Seeding Calendar Dates and Times

Calendar events are associated with specific dates and times. Some events have a specific time window and others are “all day” events. You can specify the date and time of an event using extras as well.

Here we set the event to be an all day event on a specific date. You can also set much more fine-grained events by simply using the two extras for the beginning and ending time.

Step 4: Event Configuration Details

There are several other intent extras you can seed as well. These include whether or not others can see the event (access level) and whether or not the time should be shown as busy or available (availability)

You could set these extras as follows:

Here we include an extra setting to set the access of this event in the calendar to private. We set the availability during the event’s time period to busy (no other events can overlap).

Step 5: Configuring Recurring Events

There are one-time events, like our pig roast, and then there are recurring events, like by-weekly meetings. You can seed the recurrence rule using an intent extra, like this:

The RRULE intent extra takes a standard iCalendar recurrence rule format (see RFC 5544 for details). For example, the one above creates a recurrence rule for an event that occurs every Tuesday and Thursday for 5 weeks.

Conclusion

The Calendar application has been available on the Android platform for a long time, but there have been no documented APIs for accessing it: until now. Android 4.0 (API Level 14) includes a full Calendar content provider which can be used to access the user’s calendar information, provided the application has the appropriate permissions. However, one of the simplest and most common tasks, adding a new event to a user’s calendar, requires no special permissions and is very easy to implement.

Источник

Android Custom Calendar with events

Jun 4, 2018 · 12 min read

Some links for android cutom calendarviews

marcohc/roboto-calendar-view

roboto-calendar-view — Deprecated — Use this amazing calendar instead…

Roboto Calendar View

Android Roboto Calendar View provides an easy and customizable calendar view using the awesome library Calligraphy for fonts

Sample

A sample application is available inside of the library

Compatibility

This library is compatible from API 14.

Usage

Take a look of the sample Activity.

You can override any style and customize your calendar.

Gradle

This library uses the awesome tool

Add the repository to your general build.gradle:

And then add the library in your specific project build.gradle:

SimpleMobileTools/Simple-Calendar

Simple-Calendar — A simple calendar with events, customizable widget and no ads.

Simple Calendar

A simple calendar with events and a customizable widget.

An of f line calendar without any other calendar integration. You can easily create recurring events and setup reminders, it can also display week numbers.

Contains a resizable 4×4 widget where you can customize the color of the text, as well as the alpha and the color of the background.

Contains no ads or unnecessary permissions. It is fully open-source, provides customizable colors.

The Storage permission is needed only for exporting or importing events from .ics files.

The Contacts permission is used only at importing contact birthdays and anniversaries.

This app is just one piece of a bigger series of apps. You can find the rest of them at http://www.simplemobiletools.com

Applandeo/Material-Calendar-View

Material-Calendar-View — Material Calendar View for Android

Material-Calendar-View

Material-Calendar-View is a simple and customizable calendar widget for Android based on Material Design. The widget has two funcionalities: a date picker to select dates (available as an XML widget and a dialog) and a classic calendar. The date picker can work either as a single day picker, many days picker or range picker.

Читайте также:  Android pathdata что это

We described a simple usage of the component in this article.

Features

  • Material Design
  • Single date picker
  • Many dates picker
  • Range picker
  • Events icons
  • Fully colors customization

How to migrate from previous version to 1.4.0?

We have renamed setOnPreviousButtonClickListener() and setOnForwardButtonClickListener() so please refer to Previous and forward buttons listeners.

How to use?

Make sure you are using the newest com.android.support:appcompat-v7.

Make sure you have defined the jcenter() repository in project’s build.gradle file:

Add the dependency to module’s build.gradle file:

To your XML layout file add:

Adding events with icons:

Clicks handling:

Getting a selected days in the picker mode:

If you want to get all selected days, especially if you use multi date or range picker you should use the following code:

…or if you want to get the first selected day, for example in case of using single date picker, you can use:

Setting a current date:

Setting minumum and maximum dates:

Setting disabled dates:

Previous and forward page change listeners:

Customization

If you want to use calendar in the picker mode, you have to use the following tags:

  • app:type=»one_day_picker»
  • app:type=»many_days_picker»
  • app:type=»range_picker»

Colors customization:

  • Header color: app:headerColor=»[color]»
  • Header label color: app:headerLabelColor=»[color]»
  • Previous button image resource: app:previousButtonSrc=»[drawable]»
  • Forward button image resource: app:forwardButtonSrc=»[drawable]»
  • Abbreviations bar color: app:abbreviationsBarColor=»[color]»
  • Abbreviations labels color: app:abbreviationsLabelsColor=»[color]»
  • Calendar pages color: app:pagesColor=»[color]»
  • Selection color in picker mode: app:selectionColor=»[color]»
  • Selection label color in picker mode: app:selectionLabelColor=»[color]»
  • Days labels color: app:daysLabelsColor=»[color]»
  • Color of visible days labels from previous and next month page: app:anotherMonthsDaysLabelsColor=»[color]»
  • Disabled days labels color: app:disabledDaysLabelsColor=»[color]»
  • Today label color: app:todayLabelColor=»[color]»

Translations:

To translate months names, abbreviations of days, “TODAY”, “OK” and “CANCEL” buttons, just add below tags to your strings.xml file:

Date Picker Dialog

To use another picker type replace CalendarView.ONE_DAY_PICKER with CalendarView.MANY_DAYS_PICKER or CalendarView.RANGE_PICKER .

Getting date handling:

Customization:

Changelog

Version 1.4.0:

  • More color customization (abbreviations, calendar pages, labels colors)
  • Changed onNavigationButtonClickListeners to onCalendarPageChangeListeners
  • Added page change listeners to dialog pickers
  • Added onDayClickListener to pickers (not dialog pickers)
  • Added ability to insert list of disabled days

prolificinteractive/material-calendarview

material-calendarview — A Material design back port of Android’s CalendarView

Material Calendar View

A Material design back port of Android’s CalendarView. The goal is to have a Material look and feel, rather than 100% parity with the platform’s implementation.

Installation

Step 1. Add the JitPack repository to your build file

Step 2. Add the dependency

Usage

  1. Add MaterialCalendarView into your layouts or view hierarchy.
  2. Set a OnDateSelectedListener or call MaterialCalendarView.getSelectedDates() when you need it.

Documentation

Make sure to check all the documentation available here.

Customization

One of the aims of this library is to be customizable. The many options include:

Events, Highlighting, Custom Selectors, and More!

All of this and more can be done via the decorator api. Please check out the decorator documentation.

Recent Changes

Major Change in 1.5.0

We recently updated to the latest gradle and decided to move over our libraries to the hosting service Jitpack. Please refer to the installation section for more details.

Major Change in 1.4.0

  • Breaking Change: setFirstDayOfWeek , setMin/MaxDate , and setCalendarDisplayMode are moved to a State object. This was necessary because it was unclear that these were not simple setters—individually, they were side effecting and triggered full adapter/date range recalculations. Typical usage of the view involves setting all these invariants up front during onCreate and it was unknown to the user that setting all 4 of these would create a lot of waste. Not to mention certain things were side effecting—some would reset the current day or selected date. As a result, the same 4 methods called in a different order could result in a different state, which is bad.
  • For most cases you will simply need to replace setting those invariants with:
  • mcv.state().edit() .setFirstDayOfWeek(Calendar.WEDNESDAY) .setMinimumDate(CalendarDay.from(2016, 4, 3)) .setMaximumDate(CalendarDay.from(2016, 5, 12)) .setCalendarDisplayMode(CalendarMode.WEEKS) .commit();
  • mcv.state().edit() will retain previously set values; mcv.newState() will create a new state using default values. Calling commit will trigger the rebuild of adapters and date ranges. It is recommended these state changes occur as the first modification to MCV (before configuring anything else like current date or selected date); we make no guarantee those modifications will be retained when the state is modified.
  • See CUSTOMIZATION_BUILDER for usage details.
  • New: setSelectionMode(SELECTION_MODE_RANGE) was added to allow 2 dates to be selected and have the entire range of dates selected. Much thanks to papageorgiouk for his work on this feature.
Читайте также:  Взломанный resident evil 4 для андроида с

Riontech/CustomCalendar

CustomCalendar — Custom Calendar with Decorator and Detail view

Custom Android Calendar

#Usage

Add the dependency to your build.gradle.

Add the indicator to your layout.

Create object of CustomCalendar in your activity

In your acitivty onCreate initialize the object and set eventDate with count. And add it to customCalendar object by using addAnEvent method.

TODOs

  • Add Event with Plus button
  • Adding Reminders for Event, Birthday, etc
  • Awesome UI-UX

MOLO17/CustomizableCalendar

CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour

CustomizableCalendar

This library allows you to create a completely customizable calendar.
You can use CustomizableCalendar to create your calendar, customizing UI and behaviour.

Features

  • Custom header (should be implemented by the user);
  • Custom sub view (month name by default);
  • Custom weekly days view;
  • Custom date view;
  • Possibility to implement selection on day click;
  • Possibility to implement weekly day calculation;
  • Receive updates of Calendar (with AUCalendar);
  • Every change to AUCalendar is notified and automatically refreshes UI;

Limitations

  • Only portrait orientation is supported

Gradle

Dependencies

  • RecyclerView
  • Joda-Time
  • RxJava2
  • ButterKnife used on version ViewInteractor interface (you can find the explanation in the How to customize > Java section).

After that go in the Activity/Fragment where you added the CustomizableCalendar View; here you should specify the first month and the last month, to do this, create a Calendar (located in com.molo17.customizablecalendar.library.model ) object.

An example of CustomizableCalendar init is the following:

How to customize

If you want to customize the components you should create a separeted layout and add the reference to the customizable_calendar View with the tag app:layout=»@layout/your_layout»

An example of a custom layout is the following:

NOTE that ids must not be different from the ones above, so:

  • @android:id/primary for HeaderView;
  • @android:id/text1 for WeekDaysView;
  • @android:id/text2 for SubView;
  • @android:id/content for CalendarRecyclerView;

HeaderView

First (red) rectangle of the screenshot above.
It’s a RelativeLayout , you should create your own layout.

WeekDaysView

Third (light blue) rectangle of the screenshot above.
It’s a RecyclerView , the ViewHolder item is already implemented.
You can create your own ViewHolder layout using a RelativeLayout with a TextView that has @android:id/summary as id.

SubView

Second (green) rectangle of the screenshot above.
It’s a RelativeLayout , implemented by default with the name of the month centered.
If you want to create your own layout make sure to have a TextView with id @android:id/summary .

CalendarRecyclerView

Fourth (blue) rectangle of the screenshot above.
It’s a RelativeLayout , implemented by default with a LinearLayout (with a GridLayout inside) for the month and a RelativeLayout for the day.
If you want to create your own month layout you can specify app:month_layout=»@layout/your_layout» for the month and app:cell_layout=»@layout/your_layout» for the day.
Make sure to use @android:id/widget_frame as id for the GridView and @android:id/background , @android:id/startSelectingText , @android:id/stopSelectingText , @android:id/title respectively for single selection background, first day selection background (in multiple selection mode), last day selection background (in multiple selection mode) and the TextView where the day is displayed.

All code customization can be applied using the ViewInteractor .

Here are listed all of the methods with a small description:

Источник

Оцените статью