Material Calendar View


Source link: https://github.com/prolificinteractive/material-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.

Usage

  1. Add compile 'com.prolificinteractive:material-calendarview:1.4.3' to your dependencies.
  2. Add MaterialCalendarView into your layouts or view hierarchy.
  3. Set a OnDateSelectedListener or call MaterialCalendarView.getSelectedDates() when you need it.

Javadoc Available Here

Example:

<com.prolificinteractive.materialcalendarview.MaterialCalendarView
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/calendarView"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:mcv_showOtherDates="all"
  app:mcv_selectionColor="#00F"
  />

@Experimental

CalendarMode.WEEK and all week mode functionality is officially marked @Experimental. All APIs marked @Experimental are subject to change quickly and should not be used in production code. They are allowed for testing and feedback.

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.

See other changes in the CHANGELOG.

Major Change in 1.3.0

  • Breaking change: getTileSize is deprecated. Use getTileWidth or getTileHeight.
  • Added goToNext and goToPrevious API to programmatically trigger paging
  • Allow users to click on dates outside of current month with setAllowClickDaysOutsideCurrentMonth
  • Set tile width/height separately rather than single tile size with setTileWidth and setTileHeight
  • Attributes: mcv_tileWidth, mcv_tileHeight, mcv_calendarMode
  • TalkBack APIs: setContentDescriptionArrowPast, ArrowFuture, Calendar

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.

Custom Selectors and Colors

If you provide custom drawables or colors, you'll want to make sure they respond to state. Check out the documentation for custom states.

Contributing

Would you like to contribute? Fork us and send a pull request! Be sure to checkout our issues first.

License

Material Calendar View is Copyright (c) 2017 Prolific Interactive. It may be redistributed under the terms specified in the LICENSE file.

Maintainers

Material Calendar View is maintained and funded by Prolific Interactive. The names and logos are trademarks of Prolific Interactive.

Resources

Kaffeine is a Kotlin-flavored Android library for accelerating development.

Kotlin for Android helps not to write boilerplate code with instantiating abstract or interfaces instances. The purpose of the library is to save time of writing code using Android SDK wrapping as much as possible common functionality.

The library uses one of the coolest feature of the Kotlin language inline almost everywhere, that prevents overhead code.

A collection of Kotlin extensions for Android, based on KotlinAndroidLib and Android Kotlin Extensions.

This library allows you to play Ogg Live Streams on any Android device. It is based on JOrbis so everything is written in Java code.

A library brings numerous handy classes and methods to help us concatenating and performing CRUD SQLs in Android SQLite.

Just a simple pull-down-to-refresh ListView.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes