EasyCalendar


Source link: https://github.com/shichaohui/EasyCalendar

EasyCalendar

Quickly customize the calendar UI. You can use EasyCalendar to quickly get the calendar style UI.

Feature

  • Custom layout for title.
  • Custom layout for date.
  • Show or hide divider for date.
  • Show or hide overflow date.
  • Listen to date's view be clicked.

Screenshot

Gradle

compile 'com.sch.calendar:easy-calendar:1.0.1' 

Attributes

name format description
titleColor color set color for title
titleLayout reference custom layout for title
weekColor color set color for week
weekBackground color|reference set background for week bar
monthBackground color|reference set backgroung for month layout
dateDividerColor color set color for divider of date
dateDividerSize dimension set size for divider of date
imgLastMonth reference set image for button of last month
imgNextMonth reference set image for button of next month
language enum china: ??, english: English

API

  1. Show or hide overflow date.
/**  * If true, show whole calendar.  * e.g. showing date is April, if show whole calendar, 03/30 and 05/01 will show.  */ public void setShowOverflowDate(boolean showOverflowDate);
  public boolean isShowOverflowDate();
  1. Set format for title.
/**  * Constructs a <code>SimpleDateFormat</code> using the given pattern and  * the default date format symbols for the given locale.  * <b>Note:</b> This constructor may not support all locales.  * For full coverage, use the factory methods in the {
@link DateFormat
}
  * class.  *  * @param pattern the pattern describing the date and time format  * @param locale  the locale whose date format symbols should be used  */ public void setTitleFormat(String pattern, Locale locale);
  1. Set a listener for callback when date was clicked.
/**  * Set listener for date be clicked.  *  * @param onDateClickedListener listener  */ public void setOnDateClickedListener(OnDateClickedListener onDateClickedListener);
  1. Set a listener for callback when showing month changed.
/**  * Set listener for current showing month changed.  *  * @param onMonthChangedListener listener  */ public void setOnMonthChangedListener(final OnMonthChangedListener onMonthChangedListener);
  1. Set can or can't change month by drag.
/**  * Set drag enable for page.  */ public void setCanDrag(boolean canDrag);
  /**  * Return drag enable of page.  */ public boolean canDrag();
  1. Set can or can't fling when finger off screen.
/**  * Set fling enable for page.  */ public void setCanFling(boolean canFling);
  /**  * Return fling enable of page.  */ public boolean canFling();
  1. Set the visibility of the button for the month of switch.
/**  * Set button visible for last month.  *  * @param visibility {
@link Visibility
}
  */ public void setLastMonthButtonVisibility(@Visibility int visibility);
  /**  * Set button visible for next month.  *  * @param visibility {
@link Visibility
}
  */ public void setNextMonthButtonVisibility(@Visibility int visibility);
  1. Get view of today.
/**  * Return item view of today. If today not showing, return null?  */ public View getTodayItemView();
  1. Set the calendar size will wrap content or not. Use this api you can set the calendar size will wrap content or not. if true, the layout's height will auto change with animation when month changed.
/**  * Set the layout will wrap content or not.  *  * @param scaleEnable if true, the layout will wrap content.  */ public void setScaleEnable(boolean scaleEnable);

Custom UI for date

You can use default UI for date by SampleVagueAdapter. Default UI only show date.

calendarView.setVagueAdapter(new SampleVagueAdapter());

You can custom UI for date by extend VagueAdapter , e.g. custom UI for checkin.

// layout_checkin_calendar_item must hava a TextView that's id is tv_day_of_month calendarView.setVagueAdapter(new MyVagueAdapter(R.layout.layout_checkin_calendar_item));
  private class MyVagueAdapter extends VagueAdapter<Map<String, Map<String, Checkin>>> {

/** 
  * @params dateLayout layout resource id for date, must hava a TextView that's id is tv_day_of_month 
  */
  MyVagueAdapter(@LayoutRes int dateLayout) {

super(dateLayout);

  
}

@Override
  public void onBindVague(View itemView, int year, @Month int month, @DayOfMonth int dayOfMonth) {

// do something, show custom data  
  
}

@Override
  public void flagToday(View todayView) {

// do something, set a flag for today's view
  
}

@Override
  public void flagNotToday(View dayView, Date date) {

  // do something, set a flag for not today's view
  
}
 
}

License

 Copyright 2017 StoneHui
 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. 

Resources

Simple library that helps developers to create awesome sliding android app tutorial.

This is a Gradle plugin, for Android developers, that automates app versioning.

A simple countdown View for the Android framework.

This project is aimed at providing a simple API to build SQLite query statements. This library does nothing but build statements; it's not an ORM. The API syntax is inspired from the jOOQ library.

An android TextView that supports highlighting parts or all of the text contained in it.

It is a custom implementation of nested timeline view using RecyclerView.

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