{"id":13643309,"url":"https://github.com/florent37/SingleDateAndTimePicker","last_synced_at":"2025-04-21T01:32:23.258Z","repository":{"id":46160620,"uuid":"75409471","full_name":"florent37/SingleDateAndTimePicker","owner":"florent37","description":"You can now select a date and a time with only one widget !","archived":true,"fork":false,"pushed_at":"2023-03-15T19:15:52.000Z","size":22194,"stargazers_count":1023,"open_issues_count":158,"forks_count":336,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-22T05:33:12.274Z","etag":null,"topics":["android","date","design","dialog","material","picker","range","time"],"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/florent37.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"ko_fi":"FlorentChampigny","github":"florent37"}},"created_at":"2016-12-02T15:53:14.000Z","updated_at":"2025-02-24T10:51:22.000Z","dependencies_parsed_at":"2022-09-23T06:10:50.943Z","dependency_job_id":"619f4ceb-a7a3-4011-8a42-b91991ffa08e","html_url":"https://github.com/florent37/SingleDateAndTimePicker","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florent37%2FSingleDateAndTimePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florent37%2FSingleDateAndTimePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florent37%2FSingleDateAndTimePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/florent37%2FSingleDateAndTimePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/florent37","download_url":"https://codeload.github.com/florent37/SingleDateAndTimePicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982607,"owners_count":21355732,"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","date","design","dialog","material","picker","range","time"],"created_at":"2024-08-02T01:01:45.632Z","updated_at":"2025-04-21T01:32:18.248Z","avatar_url":"https://github.com/florent37.png","language":"Java","readme":"# SingleDateAndTimePicker\n\nYou can now select a date and a time with only one widget !\n\n\n\u003ca href=\"https://goo.gl/WXW8Dc\"\u003e\n  \u003cimg alt=\"Android app on Google Play\" src=\"https://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\n\u003c/a\u003e\n\n\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/new_video.gif)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n# Usage\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n            //.bottomSheet()\n            //.curved()\n            //.stepSizeMinutes(15)\n            //.displayHours(false)\n            //.displayMinutes(false)\n            //.todayText(\"aujourd'hui\")\n            .displayListener(new SingleDateAndTimePickerDialog.DisplayListener() {\n                @Override\n                public void onDisplayed(SingleDateAndTimePicker picker) {\n                    // Retrieve the SingleDateAndTimePicker\n                }\n                                \n                @Override\n                public void onClosed(SingleDateAndTimePicker picker) {\n                    // On dialog closed \n                }\n            })\n            .title(\"Simple\")\n            .listener(new SingleDateAndTimePickerDialog.Listener() {\n                @Override\n                public void onDateSelected(Date date) {\n                    \n                }\n            }).display();\n```\n\n## Select 2 dates\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/double_small_crop.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```java\nnew DoubleDateAndTimePickerDialog.Builder(context)\n            //.bottomSheet()\n            //.curved()\n            //.stepSizeMinutes(15)\n            .title(\"Double\")\n            .tab0Text(\"Depart\")\n            .tab1Text(\"Return\")\n            .listener(new DoubleDateAndTimePickerDialog.Listener() {\n                @Override\n                public void onDateSelected(List\u003cDate\u003e dates) {\n                \n                }\n        }).display();\n```\n\n## Display days, months and years\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/years_crop.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(this)\n            .bottomSheet()\n            .curved()\n            .displayMinutes(false)\n            .displayHours(false)\n            .displayDays(false)\n            .displayMonth(true)\n            .displayYears(true)\n            .displayDaysOfMonth(true)\n            .display();\n```\n\n## Include in a layout\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/layout_small.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```xml\n\u003ccom.github.florent37.singledateandtimepicker.SingleDateAndTimePicker\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"230dp\"\n        app:picker_curved=\"true\"\n        app:picker_cyclic=\"true\"\n        app:picker_visibleItemCount=\"7\"\n        /\u003e\n```\n\n# iOS like :P\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/ios_simple_crop.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n                                    .bottomSheet()\n                                    .curved()\n```\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/ios_double_crop.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```java\nnew DoubleDateAndTimePickerDialog.Builder(context)\n                                    .bottomSheet()\n                                    .curved()\n```\n\n# Customisation\n\nYou can change the minutes steps (default : 5min)\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n            .stepSizeMinutes(15)\n            .display();\n```\n\nAnd change some colors\n\n[![screen](https://raw.githubusercontent.com/florent37/SingleDateAndTimePicker/master/media/custom_colors.png)](https://www.github.com/florent37/SingleDateAndTimePicker)\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n            .backgroundColor(Color.BLACK)\n            .mainColor(Color.GREEN)\n            .titleColor(Color.WHITE)\n            .display();\n```\n\n# Date range\n\nRequire user to select a date between a range\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n            .defaultDate(defaultDate)\n            .minDateRange(minDate)\n            .maxDateRange(maxDate)\n            .display();\n```\n\nOr simply require user to select a future date\n\n```java\nnew SingleDateAndTimePickerDialog.Builder(context)\n            .mustBeOnFuture()\n            .display();\n```\n\n# Changing typeface\n\n```java\nfinal SingleDateAndTimePicker singleDateAndTimePicker2 = findViewById(R.id.single_day_picker2);\nsingleDateAndTimePicker2.setTypeface(ResourcesCompat.getFont(this, R.font.dinot_regular));\n```\n\nOr pass it as an attribute in the XML layout. (See XML section on how to use it.)\n\n# XML\n\nSome/most options are also available via XML:\n\n```\n    \u003ccom.github.florent37.singledateandtimepicker.SingleDateAndTimePicker\n        android:id=\"@+id/single_day_picker\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        app:picker_itemSpacing=\"6dp\"\n        app:picker_curvedMaxAngle=\"45\"\n        app:picker_curved=\"true\"\n        app:picker_selectorColor=\"@android:color/transparent\"\n        app:picker_stepSizeHours=\"2\"\n        app:picker_stepSizeMinutes=\"5\"\n        app:picker_cyclic=\"false\"        \n        app:picker_dayCount=\"31\"\n        app:picker_mustBeOnFuture=\"true\"\n        app:picker_visibleItemCount=\"7\"\n        app:fontFamily=\"@font/dinot_bold\"\n        /\u003e\n```\n\n* picker_itemSpacing: Margin between items. Only has effect with\n  height=wrap-content\n* picker_curvedMaxAngle sets the max angle of top/bottom items. If 45\n  then the visible 'window' of the wheel is a 'quarter' of the circle.\n  If 90 (default) its rolling on a half-circle\n* `app:fontFamily` or `android:fontFamily` sets the typeface/font to be\n  used with the date picker.\n  Note - For api below v-16 use `app:fontFamily`\n\nGet divider lines around selected by overwriting one or more of\n```\n    \u003ccolor name=\"picker_default_divider_color\"\u003e@android:color/transparent\u003c/color\u003e\n    \u003cdimen name=\"picker_default_divider_height\"\u003e1dp\u003c/dimen\u003e\n    \u003cdrawable name=\"picker_default_divider\"\u003e@drawable/picker_divider\u003c/drawable\u003e\n```\nUse in conjuction with\n`app:picker_selectorColor=\"@android:color/transparent\"` on layout.\n\n# Download\n\n\u003ca href='https://ko-fi.com/A160LCC' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\nIn your module [![Download](https://api.bintray.com/packages/florent37/maven/SingleDateAndTimePicker/images/download.svg)](https://bintray.com/florent37/maven/SingleDateAndTimePicker/_latestVersion)\n```groovy\nimplementation 'com.github.florent37:singledateandtimepicker:2.2.7'\n//compatible with androidX\n```\n\n# Credits\n\nAuthor: Florent Champigny\n\nBlog : [http://www.tutos-android-france.com/](http://www.tutos-android-france.com/)\n\nFiches Plateau Moto : [https://www.fiches-plateau-moto.fr/](https://www.fiches-plateau-moto.fr/)\n\n\u003ca href=\"https://goo.gl/WXW8Dc\"\u003e\n  \u003cimg alt=\"Android app on Google Play\" src=\"https://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\n\u003c/a\u003e\n\n\n\u003ca href=\"https://plus.google.com/+florentchampigny\"\u003e\n  \u003cimg alt=\"Follow me on Google+\"\n       src=\"https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/gplus.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://twitter.com/florent_champ\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/twitter.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/in/florentchampigny\"\u003e\n  \u003cimg alt=\"Follow me on LinkedIn\"\n       src=\"https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/linkedin.png\" /\u003e\n\u003c/a\u003e\n\n\nLicense\n--------\n\n    Copyright 2016 florent37, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":["https://ko-fi.com/FlorentChampigny","https://github.com/sponsors/florent37","https://ko-fi.com/A160LCC'"],"categories":["日历时间"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorent37%2FSingleDateAndTimePicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorent37%2FSingleDateAndTimePicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorent37%2FSingleDateAndTimePicker/lists"}