{"id":15033007,"url":"https://github.com/sundeepk/compactcalendarview","last_synced_at":"2025-05-15T00:09:30.273Z","repository":{"id":32201532,"uuid":"35775200","full_name":"SundeepK/CompactCalendarView","owner":"SundeepK","description":"An android library which provides a compact calendar view much like the one used in google calenders.","archived":false,"fork":false,"pushed_at":"2024-03-22T09:43:28.000Z","size":10259,"stargazers_count":1521,"open_issues_count":165,"forks_count":427,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-10-29T15:35:05.490Z","etag":null,"topics":["android","android-library","android-ui","animation","calendar","compactcalendarview","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SundeepK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-17T17:19:25.000Z","updated_at":"2024-10-27T21:00:40.000Z","dependencies_parsed_at":"2024-05-03T15:36:45.221Z","dependency_job_id":null,"html_url":"https://github.com/SundeepK/CompactCalendarView","commit_stats":{"total_commits":485,"total_committers":19,"mean_commits":"25.526315789473685","dds":0.6432989690721649,"last_synced_commit":"e74e0eeb913744bdcaea6e9df53268441f9dbf8d"},"previous_names":["sundeepk/compactcalenderview"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SundeepK%2FCompactCalendarView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SundeepK%2FCompactCalendarView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SundeepK%2FCompactCalendarView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SundeepK%2FCompactCalendarView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SundeepK","download_url":"https://codeload.github.com/SundeepK/CompactCalendarView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248781275,"owners_count":21160704,"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","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","android-library","android-ui","animation","calendar","compactcalendarview","java"],"created_at":"2024-09-24T20:19:54.851Z","updated_at":"2025-04-13T20:38:20.459Z","avatar_url":"https://github.com/SundeepK.png","language":"Java","readme":"# CompactCalendarView [![Build Status](https://travis-ci.org/SundeepK/CompactCalendarView.svg?branch=master)](https://travis-ci.org/SundeepK/CompactCalendarView)\nCompactCalendarView is a simple calendar view which provides scrolling between months. It's based on Java's Date and Calendar classes. It provides a simple api to query for dates and listeners for specific events.  For example, when the calendar has scrolled to a new month or a day has been selected.\nStill under active development.\n\n\u003cimg src=\"https://github.com/SundeepK/CompactCalendarView/blob/master/images/compact-calendar-view-example-multi-events.png\" width=\"500\"\u003e\n\n# Contributing  \nPlease raise an issue of the requirement so that a discussion can take before any code is written, even if you intend to raise a pull request. Please see setup for testing.\n\n# Testing\nCompactCalendarView makes use of screenshot-tests-for-android (https://github.com/facebook/screenshot-tests-for-android). This is for UI testing. Since screenshot-tests-for-android takes screenshots, we need a way to ensure images can be reproduced consistently. To do this, a specific emulator is used to run tests.\nUnfortunately, an older emulator is used for now. New pull requests which change functionality some how should aim to create new screenshot tests or unit tests if possible. To run this locally, run the below commands:\n\nPre-requisite (Also refer to .travis.yml):\n- Python\n- Python pillow installed \n- Install android-19 (can be done through android sdk manager or command line).\n\nAndroid 19 emulator is used because it seems to be a fast enough on travis-ci and because x86 emulators are not supported on travis-ci. Newer android version is possible but build times will increase.\n\nInstall the abi and accept:\n ```bash\n$ $ANDROID_HOME/tools/bin/sdkmanager 'system-images;android-22;default;armeabi-v7a'\n ```\n\nCreate the emulator:\n```bash\n$ echo no | $ANDROID_HOME/tools/bin/avdmanager create avd --force -n testCompactCalendarEmulator -k \"system-images;android-22;default;armeabi-v7a\"\n```\n\nCreate sd card (creating in current dir):\nAny problems with sdcard are best solved by deleting and trying again\n```bash\n$ mksdcard -l sdcard 100M sdcard\n```\n\nRun emulator (with out audio and window):\n```bash\n$ $ANDROID_HOME/emulator/emulator -avd testCompactCalendarEmulator -no-audio -no-window -sdcard sdcard \u0026\n```\n\nRun emulator and watch(with audio and window):\n```bash\n$ $ANDROID_HOME/emulator/emulator -avd testCompactCalendarEmulator -sdcard sdcard \n```\n\nRunning the tests to verify that the current tests pass and to check which tests are not producing the same screenshot:\n```bash\n$ ./gradlew verifyMode screenshotTests \n```\n\nTo generate new screenshots if new tests have been added:\n```bash\n$ ./gradlew recordMode screenshotTests \n```\n\nRun the unit tests like below:\n```bash\n$ ./gradlew test\n```\n\n## Android studio emulator\nIt's possible to test using android studio emulator. However, it must be android 19 and and 480x800 screen resolution. One example is the Nexus S emulator. Just start the emulator and execute the gradle commands to run the tests. Emulator should be found automatically.\n\n# Open/Close animations\nThe library supports opening/closing with or without animations. \n\n![ScreenShot](https://github.com/SundeepK/CompactCalendarView/blob/master/images/compact_calendar_animation.gif)\n\n# Example usage\nIt is possible to change the appearance of the view via a few properties. This includes the background color, text color, textsize color of the current day and the color of the first day of the month.\n\n\n```xml\n    \u003ccom.github.sundeepk.compactcalendarview.CompactCalendarView\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/compactcalendar_view\"\n        android:layout_width=\"fill_parent\"\n        android:paddingRight=\"10dp\"\n        android:paddingLeft=\"10dp\"\n        android:layout_height=\"250dp\"\n        app:compactCalendarTargetHeight=\"250dp\"\n        app:compactCalendarTextSize=\"12sp\"\n        app:compactCalendarBackgroundColor=\"#ffe95451\"\n        app:compactCalendarTextColor=\"#fff\"\n        app:compactCalendarCurrentSelectedDayBackgroundColor=\"#E57373\"\n        app:compactCalendarCurrentDayBackgroundColor=\"#B71C1C\"\n        app:compactCalendarMultiEventIndicatorColor=\"#fff\"\n        /\u003e\n\n```\n\nPlease see Sample app for full example.\n\n```java\n    // ... code omitted for brevity         \n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        final CompactCalendarView compactCalendarView = (CompactCalendarView) findViewById(R.id.compactcalendar_view);\n        // Set first day of week to Monday, defaults to Monday so calling setFirstDayOfWeek is not necessary\n        // Use constants provided by Java Calendar class\n        compactCalendarView.setFirstDayOfWeek(Calendar.MONDAY);\n       \n        // Add event 1 on Sun, 07 Jun 2015 18:20:51 GMT\n        Event ev1 = new Event(Color.GREEN, 1433701251000L, \"Some extra data that I want to store.\");\n        compactCalendar.addEvent(ev1);\n\n        // Added event 2 GMT: Sun, 07 Jun 2015 19:10:51 GMT\n        Event ev2 = new Event(Color.GREEN, 1433704251000L);\n        compactCalendar.addEvent(ev2);\n\n        // Query for events on Sun, 07 Jun 2015 GMT. \n        // Time is not relevant when querying for events, since events are returned by day. \n        // So you can pass in any arbitary DateTime and you will receive all events for that day.\n        List\u003cEvent\u003e events = compactCalendar.getEvents(1433701251000L); // can also take a Date object\n        \n        // events has size 2 with the 2 events inserted previously\n        Log.d(TAG, \"Events: \" + events);\n\n        // define a listener to receive callbacks when certain events happen.\n        compactCalendarView.setListener(new CompactCalendarView.CompactCalendarViewListener() {\n            @Override\n            public void onDayClick(Date dateClicked) {\n                List\u003cEvent\u003e events = compactCalendarView.getEvents(dateClicked);\n                Log.d(TAG, \"Day was clicked: \" + dateClicked + \" with events \" + events);\n            }\n\n            @Override\n            public void onMonthScroll(Date firstDayOfNewMonth) {\n                Log.d(TAG, \"Month was scrolled to: \" + firstDayOfNewMonth);\n            }\n        });\n    }\n\n```\n\nYou can modify indicators using a preset of styles, below is an example, but few other combinations are also possible:\n\n![ScreenShot](https://github.com/SundeepK/CompactCalendarView/blob/master/images/compact-calendar-customised-indicators.png)\n\nNote that the calendar makes no attempt to de-duplicate events for the same exact DateTime. This is something that you must handle your self if it is important to your use case.\n\n# Locale specific settings\nIt's possible to set the locale so that weekday column names are automatically set by the calendar.\n```java\n        CompactCalendarView compactCalendarView = (CompactCalendarView) findViewById(R.id.compactcalendar_view);\n        compactCalendarView.setLocale(Locale.CHINESE);\n        compactCalendarView.setUseThreeLetterAbbreviation(true);\n```\n\n\u003cimg src=\"https://github.com/SundeepK/CompactCalendarView/blob/master/images/chinese-locale-daynames.png\" width=\"400\"\u003e\n\n```gradle\ndependencies {\n    compile 'com.github.sundeepk:compact-calendar-view:3.0.0'\n}\n```\n\n```\nThe MIT License (MIT)\n\nCopyright (c) [2018] [Sundeepk]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundeepk%2Fcompactcalendarview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsundeepk%2Fcompactcalendarview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsundeepk%2Fcompactcalendarview/lists"}