{"id":15025804,"url":"https://github.com/muraee/horizontal-calendar","last_synced_at":"2025-10-05T00:39:40.719Z","repository":{"id":97550503,"uuid":"79040742","full_name":"muraee/Horizontal-Calendar","owner":"muraee","description":"A material horizontal calendar view for Android based on RecyclerView","archived":false,"fork":false,"pushed_at":"2020-07-15T19:48:11.000Z","size":1443,"stargazers_count":1214,"open_issues_count":73,"forks_count":229,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-09-26T13:02:25.021Z","etag":null,"topics":["android","androidview","calendar","datepicker","horizontal","material","recyclerview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muraee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-15T15:23:06.000Z","updated_at":"2025-09-20T10:08:12.000Z","dependencies_parsed_at":"2023-05-19T19:00:25.721Z","dependency_job_id":null,"html_url":"https://github.com/muraee/Horizontal-Calendar","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/muraee/Horizontal-Calendar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muraee%2FHorizontal-Calendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muraee%2FHorizontal-Calendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muraee%2FHorizontal-Calendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muraee%2FHorizontal-Calendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muraee","download_url":"https://codeload.github.com/muraee/Horizontal-Calendar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muraee%2FHorizontal-Calendar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278395892,"owners_count":25979685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","androidview","calendar","datepicker","horizontal","material","recyclerview"],"created_at":"2024-09-24T20:03:03.241Z","updated_at":"2025-10-05T00:39:40.670Z","avatar_url":"https://github.com/muraee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horizontal Calendar\n\n[![Download](https://api.bintray.com/packages/mulham-raee/maven/horizontal-calendar/images/download.svg) ](https://bintray.com/mulham-raee/maven/horizontal-calendar/_latestVersion)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA material horizontal calendar view for Android based on `RecyclerView`.\n\n![showcase](/art/showCase.png)\n\n## Installation\n\nThe library is hosted on jcenter, add this to your **build.gradle**:\n\n```gradle\nrepositories {\n      jcenter()\n    }\n    \ndependencies {\n      compile 'devs.mulham.horizontalcalendar:horizontalcalendar:1.3.4'\n    }\n```\n\n## Prerequisites\n\nThe minimum API level supported by this library is **API 14 (ICE_CREAM_SANDWICH)**.\n\n## Usage\n\n- Add `HorizontalCalendarView` to your layout file, for example:\n\n```xml\n\u003candroid.support.design.widget.AppBarLayout\u003e\n\t\t............ \n\t\t\n        \u003cdevs.mulham.horizontalcalendar.HorizontalCalendarView\n            android:id=\"@+id/calendarView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"@color/colorPrimary\"\n            app:textColorSelected=\"#FFFF\"/\u003e\n            \n\u003c/android.support.design.widget.AppBarLayout\u003e\n```\n\n- In your Activity or Fragment, define your **start** and **end** dates to set the range of the calendar:\n\n```java\n/* starts before 1 month from now */\nCalendar startDate = Calendar.getInstance();\nstartDate.add(Calendar.MONTH, -1);\n\n/* ends after 1 month from now */\nCalendar endDate = Calendar.getInstance();\nendDate.add(Calendar.MONTH, 1);\n```\n\n- Then setup `HorizontalCalendar` in your **Activity** through its Builder: \n\n```java\nHorizontalCalendar horizontalCalendar = new HorizontalCalendar.Builder(this, R.id.calendarView)\n                .range(startDate, endDate)\n                .datesNumberOnScreen(5)\n                .build();\n```\n\n- Or if you are using a **Fragment**:\n\n```java\nHorizontalCalendar horizontalCalendar = new HorizontalCalendar.Builder(rootView, R.id.calendarView)\n\t...................\n```\n\n- To listen to date change events you need to set a listener:\n\n```java\nhorizontalCalendar.setCalendarListener(new HorizontalCalendarListener() {\n            @Override\n            public void onDateSelected(Calendar date, int position) {\n                //do something\n            }\n        });\n```\n\n- You can also listen to **scroll** and **long press** events by overriding each perspective method within **HorizontalCalendarListener**:\n\n```java\nhorizontalCalendar.setCalendarListener(new HorizontalCalendarListener() {\n            @Override\n            public void onDateSelected(Calendar date, int position) {\n\n            }\n\n            @Override\n            public void onCalendarScroll(HorizontalCalendarView calendarView, \n            int dx, int dy) {\n                \n            }\n\n            @Override\n            public boolean onDateLongClicked(Calendar date, int position) {\n                return true;\n            }\n        });\n```\n\n## Customization\n\n- You can customize it directly inside your **layout**:\n\n```xml\n\u003cdevs.mulham.horizontalcalendar.HorizontalCalendarView\n            android:id=\"@+id/calendarView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            app:textColorNormal=\"#bababa\"\n            app:textColorSelected=\"#FFFF\"\n            app:selectorColor=\"#c62828\"  //default to colorAccent\n            app:selectedDateBackground=\"@drawable/myDrawable\"/\u003e\n```\n\n- Or you can do it programmatically in your **Activity** or **Fragment** using `HorizontalCalendar.Builder`:\n\n```java\nHorizontalCalendar horizontalCalendar = new HorizontalCalendar.Builder(this, R.id.calendarView)\n                .range(Calendar startDate, Calendar endDate)\n                .datesNumberOnScreen(int number)   // Number of Dates cells shown on screen (default to 5).\n                .configure()    // starts configuration.\n                    .formatTopText(String dateFormat)       // default to \"MMM\".\n                    .formatMiddleText(String dateFormat)    // default to \"dd\".\n                    .formatBottomText(String dateFormat)    // default to \"EEE\".\n                    .showTopText(boolean show)              // show or hide TopText (default to true).\n                    .showBottomText(boolean show)           // show or hide BottomText (default to true).\n                    .textColor(int normalColor, int selectedColor)    // default to (Color.LTGRAY, Color.WHITE).\n                    .selectedDateBackground(Drawable background)      // set selected date cell background.\n                    .selectorColor(int color)               // set selection indicator bar's color (default to colorAccent).\n                .end()          // ends configuration.\n                .defaultSelectedDate(Calendar date)    // Date to be selected at start (default to current day `Calendar.getInstance()`).\n                .build();\n```\n\n#### More Customizations\n\n```java\nbuilder.configure()\n           .textSize(float topTextSize, float middleTextSize, float bottomTextSize)\n           .sizeTopText(float size)\n           .sizeMiddleText(float size)\n           .sizeBottomText(float size)\n           .colorTextTop(int normalColor, int selectedColor)\n           .colorTextMiddle(int normalColor, int selectedColor)\n           .colorTextBottom(int normalColor, int selectedColor)\n       .end()\n```\n\n## Months Mode\nHorizontalCalendar can display only **Months** instead of Dates by adding `mode(HorizontalCalendar.Mode.MONTHS)` to the builder, for example:\n\n```java\nhorizontalCalendar = new HorizontalCalendar.Builder(this, R.id.calendarView)\n                .range(Calendar startDate, Calendar endDate)\n                .datesNumberOnScreen(int number)\n                .mode(HorizontalCalendar.Mode.MONTHS)\n                .configure()\n                    .formatMiddleText(\"MMM\")\n                    .formatBottomText(\"yyyy\")\n                    .showTopText(false)\n                    .showBottomText(true)\n                    .textColor(Color.LTGRAY, Color.WHITE)\n                .end()\n                .defaultSelectedDate(defaultSelectedDate)\n```\n\n## Events\nA list of Events can be provided for each Date which will be represented as circle indicators under the Date with:\n\n```java\nbuilder.addEvents(new CalendarEventsPredicate() {\n\n                    @Override\n                    public List\u003cCalendarEvent\u003e events(Calendar date) {\n                        // test the date and return a list of CalendarEvent to assosiate with this Date.\n                    }\n                })\n```\n\n## Reconfiguration\nHorizontalCalendar configurations can be changed after initialization:\n \n- Change calendar dates range:\n```java\nhorizontalCalendar.setRange(Calendar startDate, Calendar endDate);\n```\n \n- Change default(not selected) items style:\n```java\nhorizontalCalendar.getDefaultStyle()\n        .setColorTopText(int color)\n        .setColorMiddleText(int color)\n        .setColorBottomText(int color)\n        .setBackground(Drawable background);      \n```\n\n- Change selected item style:\n```java\nhorizontalCalendar.getSelectedItemStyle()\n        .setColorTopText(int color)\n        ..............\n```\n\n- Change formats, text sizes and selector color:\n```java\nhorizontalCalendar.getConfig()\n        .setSelectorColor(int color)\n        .setFormatTopText(String format)\n        .setSizeTopText(float size)\n        ..............\n```\n\n### Important\n**Make sure to call `horizontalCalendar.refresh();` when you finish your changes**\n\n## Features\n\n- Disable specific dates with `HorizontalCalendarPredicate`, a unique style for disabled dates can be specified as well with `CalendarItemStyle`:\n```java\nbuilder.disableDates(new HorizontalCalendarPredicate() {\n                           @Override\n                           public boolean test(Calendar date) {\n                               return false;    // return true if this date should be disabled, false otherwise.\n                           }\n       \n                           @Override\n                           public CalendarItemStyle style() {\n                               return null;     // create and return a new Style for disabled dates, or null if no styling needed.\n                           }\n                       })\n```\n\n- Select a specific **Date** programmatically with the option whether to play the animation or not:\n```java\nhorizontalCalendar.selectDate(Calendar date, boolean immediate); // set immediate to false to ignore animation.\n\t// or simply\nhorizontalCalendar.goToday(boolean immediate);\n```\n\n- Check if a date is contained in the Calendar:\n```java\nhorizontalCalendar.contains(Calendar date);\n```\n\n- Check if two dates are equal (year, month, day of month):\n```java\nUtils.isSameDate(Calendar date1, Calendar date2);\n```\n\n- Get number of **days** between two dates:\n```java\nUtils.daysBetween(Calendar startInclusive, Calendar endExclusive);\n```\n\n## Contributing\n\nContributions are welcome, feel free to submit a pull request.\n\n## License\n\n\u003e Copyright 2017  Mulham Raee\n\u003e \n\u003e Licensed under the Apache License, Version 2.0 (the \"License\");\n\u003e you may not use this file except in compliance with the License.\n\u003e You may obtain a copy of the License at\n       http://www.apache.org/licenses/LICENSE-2.0\n\n\u003e Unless required by applicable law or agreed to in writing, software\n\u003e distributed under the License is distributed on an \"AS IS\" BASIS,\n\u003e WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\u003e See the [License](/LICENSE) for the specific language governing\n\u003e permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuraee%2Fhorizontal-calendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuraee%2Fhorizontal-calendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuraee%2Fhorizontal-calendar/lists"}