{"id":13643518,"url":"https://github.com/k0shk0sh/RetainedDateTimePickers","last_synced_at":"2025-04-21T02:30:32.339Z","repository":{"id":57720660,"uuid":"69377665","full_name":"k0shk0sh/RetainedDateTimePickers","owner":"k0shk0sh","description":"Android Library to help you with your date \u0026 time pickers while retaining the instance of the pickers on orientation change.","archived":false,"fork":false,"pushed_at":"2017-01-21T01:17:41.000Z","size":727,"stargazers_count":106,"open_issues_count":0,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-09T15:42:48.612Z","etag":null,"topics":["android-library","datepickerdialog","orientation-changes","picker","timepickerdialog"],"latest_commit_sha":null,"homepage":null,"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/k0shk0sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-27T16:40:49.000Z","updated_at":"2024-06-27T13:02:08.000Z","dependencies_parsed_at":"2022-09-05T18:01:21.886Z","dependency_job_id":null,"html_url":"https://github.com/k0shk0sh/RetainedDateTimePickers","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FRetainedDateTimePickers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FRetainedDateTimePickers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FRetainedDateTimePickers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k0shk0sh%2FRetainedDateTimePickers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k0shk0sh","download_url":"https://codeload.github.com/k0shk0sh/RetainedDateTimePickers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249986022,"owners_count":21356310,"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-library","datepickerdialog","orientation-changes","picker","timepickerdialog"],"created_at":"2024-08-02T01:01:48.706Z","updated_at":"2025-04-21T02:30:31.803Z","avatar_url":"https://github.com/k0shk0sh.png","language":"Java","readme":"# RetainedDateTimePickers\nAndroid Library to help you with your date \u0026 time pickers while retaining the instance of the pickers on orientation change.\n\n# Installation\n\n#### Gradle\n```groovy\ncompile 'com.github.k0shk0sh:RetainedDateTimePickers:1.0.2'\n```\n\n#### Maven\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.k0shk0sh\u003c/groupId\u003e\n  \u003cartifactId\u003eRetainedDateTimePickers\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.2\u003c/version\u003e\n  \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n=====\n\nYour `Activity` or `Fragment` must implement `DatePickerCallback` and or `TimePickerCallback` to receive the selected date \u0026 selected time if \napplicable.\n\nRetainedDateTimePickers should be treated as any normal `DialogFragment`:\n\n- DatePickerDialog Only \n```java\nDatePickerFragmentDialog.newInstance().show(getSupportFragmentManager(), \"DatePickerFragmentDialog\");\n```\n\n- TimePickerDialog Only\n```java\n//default  12 hours format\nTimePickerFragmentDialog.newInstance().show(getSupportFragmentManager(), \"TimePickerFragmentDialog\");\n//24 hours format\nTimePickerFragmentDialog.newInstance(true).show(getSupportFragmentManager(), \"TimePickerFragmentDialog\");\n```\n\n- DateTimePickerDialog \n```java\nDatePickerFragmentDialog.newInstance(true).show(getSupportFragmentManager(), \"DatePickerFragmentDialog\");\n```\n\n- Date \u0026 Time PickerDialog Customization\n```java\nDatePickerFragmentDialog.newInstance(\n        DateTimeBuilder.get()\n                .withTime(true)\n                .with24Hours(true)\n                .withSelectedDate(currentDate.getTimeInMillis())\n                .withMinDate(minDate.getTimeInMillis())\n                .withMaxDate(maxDate.getTimeInMillis())\n                .withCurrentHour(12)\n                .withCurrentMinute(30)\n                .withTheme(R.style.PickersTheme))\n        .show(getSupportFragmentManager(), \"DatePickerFragmentDialog\");\n```\n\n\n\u003e **To understand more how the library works, please take a look at the sample app.**\n\n\nScreenshots \n======\n\n- **Pickers Portrait Mode**\n\u003cbr/\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/date_picker_portrait.png\" width=\"250\" height=\"444\" /\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/time_picker_portrait.png\" width=\"250\" height=\"444\" /\u003e\n- **Pickers Landscape Mode**\n\u003cbr/\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/date_picker_land.png\"  height=\"250\" width=\"444\"/\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/time_picker_land.png\" height=\"250\" width=\"444\" /\u003e\n- **Pickers Custom Themes via Styles**\n\u003cbr/\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/custom_theme_date.png\" width=\"250\" height=\"444\" /\u003e\n\u003cimg src=\"https://raw.github.com/k0shk0sh/RetainedDateTimePickers/master/art/custom_theme_time.png\" width=\"250\" height=\"444\" /\u003e\n\n\n# Why this library?\n\n* DatePickerDialog \u0026 TimePickerDialog are not retained on orientation change, you'd do a lot of work to retain them, this library simplify that.\n* It uses DatePickerDialog \u0026 TimePickerDialog internally.\n* Its simple to use.\n* Its Customizable (Support Custom Themes). \n* Minimum API is 16, but it'll probably work in API 9 and above, just make sure you test it out (we use `Support Fragment`).  \n\n\n# Dependency\n\nAndroid Support Fragment Library ``v24.2.1``\n\n**Pull requests are welcomed.**\n\n# Copyright Notice\n\nCopyright (C) 2016 Kosh.\nLicensed under the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)\nlicense (see the LICENSE file).\n","funding_links":[],"categories":["日历时间"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0shk0sh%2FRetainedDateTimePickers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk0shk0sh%2FRetainedDateTimePickers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk0shk0sh%2FRetainedDateTimePickers/lists"}