{"id":13396349,"url":"https://github.com/code-troopers/android-betterpickers","last_synced_at":"2025-12-16T14:36:59.109Z","repository":{"id":7564795,"uuid":"8918733","full_name":"code-troopers/android-betterpickers","owner":"code-troopers","description":"[NO LONGER MAINTAINED] Android library for better Picker DialogFragments","archived":false,"fork":false,"pushed_at":"2020-04-01T12:50:44.000Z","size":16810,"stargazers_count":2680,"open_issues_count":112,"forks_count":567,"subscribers_count":135,"default_branch":"master","last_synced_at":"2024-05-22T09:07:30.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-troopers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGE_LOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-21T01:45:18.000Z","updated_at":"2024-05-01T09:28:47.000Z","dependencies_parsed_at":"2022-09-26T22:00:58.957Z","dependency_job_id":null,"html_url":"https://github.com/code-troopers/android-betterpickers","commit_stats":null,"previous_names":["derekbrameyer/android-betterpickers"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-troopers%2Fandroid-betterpickers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-troopers%2Fandroid-betterpickers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-troopers%2Fandroid-betterpickers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-troopers%2Fandroid-betterpickers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-troopers","download_url":"https://codeload.github.com/code-troopers/android-betterpickers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243499823,"owners_count":20300698,"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":[],"created_at":"2024-07-30T18:00:46.640Z","updated_at":"2025-12-16T14:36:58.497Z","avatar_url":"https://github.com/code-troopers.png","language":"Java","readme":"# /!\\ This Project is no longer maintained /!\\ \n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.code-troopers.betterpickers/library.svg?style=flat)](https://repo1.maven.org/maven2/com/code-troopers/betterpickers/library/)\n[![API](https://img.shields.io/badge/API-9%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=9)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Betterpickers-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/118)\n\n[![Built With Cloudbees](https://www.cloudbees.com/sites/default/files/styles/large/public/Button-Built-on-CB-1.png?itok=3Tnkun-C)](https://codetroopers.ci.cloudbees.com/job/betterpickers-master/)\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_calendar_date.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_radial_time.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_recurrence.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_time_zone.png\" width=\"120\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_date.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_expiration.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_hms.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_number.png\" width=\"120\"\u003e  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_time.png\" width=\"120\"\u003e\n\n\nDialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numbers, and other things.\n\nTry out the sample application on [Google Play][6].\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.codetroopers.betterpickersapp\"\u003e\n  \u003cimg alt=\"BetterPickers Samples on Google Play\"\n         src=\"https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png\" width=\"140\" /\u003e\n\u003c/a\u003e\n\nIncluding in Your Project\n=========================\n### Gradle\n\n```groovy\ncompile 'com.code-troopers.betterpickers:library:3.1.0'\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.code-troopers.betterpickers\u003c/groupId\u003e\n  \u003cartifactId\u003elibrary\u003c/artifactId\u003e\n  \u003cversion\u003e3.1.0\u003c/version\u003e\n  \u003ctype\u003eaar\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nUsage\n=====\n\n*For a working implementation of this project see the `sample/` folder.*\n\n### Calendar Date Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        CalendarDatePickerDialogFragment cdp = new CalendarDatePickerDialogFragment()\n                .setOnDateSetListener(SampleCalendarDateBasicUsage.this)\n                .setFirstDayOfWeek(Calendar.SUNDAY)\n                .setPreselectedDate(towDaysAgo.getYear(), towDaysAgo.getMonthOfYear() - 1, towDaysAgo.getDayOfMonth())\n                .setDateRange(minDate, null)\n                .setDoneText(\"Yay\")\n                .setCancelText(\"Nop\")\n                .setThemeDark(true);\n        cdp.show(getSupportFragmentManager(), FRAG_TAG_DATE_PICKER);\n    }\n});\n```\n\n### Radial Time Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        RadialTimePickerDialogFragment rtpd = new RadialTimePickerDialogFragment()\n                .setOnTimeSetListener(SampleRadialTimeBasicUsage.this)\n                .setStartTime(10, 10)\n                .setDoneText(\"Yay\")\n                .setCancelText(\"Nop\")\n                .setThemeDark(true);\n        rtpd.show(getSupportFragmentManager(), FRAG_TAG_TIME_PICKER);\n    }\n});\n```\n\n### Recurrence Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        FragmentManager fm = getSupportFragmentManager();\n        Bundle bundle = new Bundle();\n        Time time = new Time();\n        time.setToNow();\n        bundle.putLong(RecurrencePickerDialogFragment.BUNDLE_START_TIME_MILLIS, time.toMillis(false));\n        bundle.putString(RecurrencePickerDialogFragment.BUNDLE_TIME_ZONE, time.timezone);\n        bundle.putString(RecurrencePickerDialogFragment.BUNDLE_RRULE, mRrule);\n        bundle.putBoolean(RecurrencePickerDialogFragment.BUNDLE_HIDE_SWITCH_BUTTON, true);\n\n        RecurrencePickerDialogFragment rpd = new RecurrencePickerDialogFragment();\n        rpd.setArguments(bundle);\n        rpd.setOnRecurrenceSetListener(SampleRecurrenceBasicUsage.this);\n        rpd.show(fm, FRAG_TAG_RECUR_PICKER);\n    }\n});\n```\n\n### Timezone Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        FragmentManager fm = getSupportFragmentManager();\n        Bundle bundle = new Bundle();\n        Time time = new Time();\n        time.setToNow();\n        bundle.putLong(TimeZonePickerDialogFragment.BUNDLE_START_TIME_MILLIS, time.toMillis(false));\n        bundle.putString(TimeZonePickerDialogFragment.BUNDLE_TIME_ZONE, time.timezone);\n        bundle.putString(RecurrencePickerDialogFragment.BUNDLE_RRULE, mRrule);\n\n        TimeZonePickerDialogFragment tzpd = new TimeZonePickerDialogFragment();\n        tzpd.setArguments(bundle);\n        tzpd.setOnTimeZoneSetListener(SampleTimeZoneBasicUsage.this);\n        tzpd.show(fm, FRAG_TAG_TIME_ZONE_PICKER);\n    }\n});\n```\n\n### Date Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        DatePickerBuilder dpb = new DatePickerBuilder()\n                .setFragmentManager(getSupportFragmentManager())\n                .setStyleResId(R.style.BetterPickersDialogFragment)\n                .setYearOptional(true);\n        dpb.show();\n    }\n});\n```\n\n### Expiration Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        ExpirationPickerBuilder epb = new ExpirationPickerBuilder()\n                  .setFragmentManager(getSupportFragmentManager())\n                  .setStyleResId(R.style.BetterPickersDialogFragment)\n                  .setMinYear(2000);\n        epb.show();\n    }\n});\n```\n\n### HMS Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        HmsPickerBuilder hpb = new HmsPickerBuilder()\n                .setFragmentManager(getSupportFragmentManager())\n                .setStyleResId(R.style.BetterPickersDialogFragment);\n        hpb.show();\n    }\n});\n```\n\n### Number Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        NumberPickerBuilder npb = new NumberPickerBuilder()\n                .setFragmentManager(getSupportFragmentManager())\n                .setStyleResId(R.style.BetterPickersDialogFragment)\n                .setLabelText(\"LBS.\");\n        npb.show();\n}\n});\n```\n\n### Time Picker\n\n```java\nbutton.setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        TimePickerBuilder tpb = new TimePickerBuilder()\n                .setFragmentManager(getSupportFragmentManager())\n                .setStyleResId(R.style.BetterPickersDialogFragment);\n        tpb.show();\n    }\n});\n```\n\nTheming\n=======\n*For a demonstration of theming, see the `sample/` folder.*\n\n### Calendar Date Picker / Radial Time Picker\n\n  1. Use attributes that allow you to customize pickers\n\n        bpHeaderBackgroundColor     ::\n        bpHeaderUnselectedTextColor ::\n        bpHeaderSelectedTextColor   ::\n        bpBodyBackgroundColor       ::\n        bpBodySelectedTextColor     ::\n        bpBodyUnselectedTextColor   ::\n        bpButtonsBackgroundColor    ::\n        bpButtonsTextColor          ::\n        -- Calendar Date Picker\n        bpPreHeaderBackgroundColor  ::\n        bpDisabledDayTextColor      ::\n        -- Radial Time Picker\n        bpRadialBackgroundColor     ::\n        bpRadialTextColor           ::\n        bpRadialPointerColor        ::\n        bpAmPmCircleColor           ::\n\n  2. Create your own custom theme in `styles.xml`:\n\n    ```xml\n    \u003cstyle name=\"MyCustomBetterPickersDialogs\" parent=\"BetterPickersRadialTimePickerDialog.PrimaryColor\"\u003e\n        \u003citem name=\"bpPreHeaderBackgroundColor\"\u003e@color/holo_red_dark\u003c/item\u003e\n        \u003citem name=\"bpHeaderBackgroundColor\"\u003e@color/holo_red_light\u003c/item\u003e\n        \u003citem name=\"bpHeaderSelectedTextColor\"\u003e@color/holo_orange_dark\u003c/item\u003e\n        \u003citem name=\"bpHeaderUnselectedTextColor\"\u003e@android:color/white\u003c/item\u003e\n\n        \u003citem name=\"bpBodyBackgroundColor\"\u003e@color/holo_blue_dark\u003c/item\u003e\n        \u003citem name=\"bpBodySelectedTextColor\"\u003e@color/holo_orange_dark\u003c/item\u003e\n        \u003citem name=\"bpBodyUnselectedTextColor\"\u003e@android:color/white\u003c/item\u003e\n\n        \u003citem name=\"bpRadialBackgroundColor\"\u003e@color/holo_orange_dark\u003c/item\u003e\n        \u003citem name=\"bpRadialTextColor\"\u003e@color/holo_purple\u003c/item\u003e\n        \u003citem name=\"bpRadialPointerColor\"\u003e@android:color/black\u003c/item\u003e\n\n        \u003citem name=\"bpButtonsBackgroundColor\"\u003e@color/holo_green_dark\u003c/item\u003e\n        \u003citem name=\"bpButtonsTextColor\"\u003e@color/holo_orange_dark\u003c/item\u003e\n    \u003c/style\u003e\n    ```\n\n  3. Instantiate your `DialogFragment` using your custom theme:\n\n  ```java\n  RadialTimePickerDialogFragment rtpd = new RadialTimePickerDialogFragment()\n         .setOnTimeSetListener(SampleRadialTimeThemeCustom.this)\n         .setThemeCustom(R.style.MyCustomBetterPickersDialogs);\n  rtpd.show(getSupportFragmentManager(), FRAG_TAG_TIME_PICKER);\n  ```\n  4. Result\n\n  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_calendar_date_customized.png\" width=\"120\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/code-troopers/android-betterpickers/master/sample/imagery/screenshot_radial_time_customized.png\" width=\"120\"\u003e\n\n### Date Picker / Expiration Picker / HMS Picker / Number Picker / Time Picker\n\n\n  1. You can use your own themes if you'd like to change certain attributes.  BetterPickers currently allows for customization of the following attributes:\n\n        bpDialogBackground       :: the drawable (preferably a 9-patch) used as a window background for the DialogFragment\n        bpTextColor              :: the color (optionally state list) for all text in the DialogFragment\n        bpDeleteIcon             :: the drawable (optionally state list) for the delete button\n        bpCheckIcon              :: the drawable (optionally state list) for the check button in the DateDialogPicker\n        bpKeyBackground          :: the drawable (optionally state list) for the keyboard buttons\n        bpButtonBackground       :: the drawable (optionally state list) for the Set, Cancel, and Delete buttons\n        bpDividerColor           :: the color used for the DialogFragment dividers\n        bpKeyboardIndicatorColor :: the color used for the ViewPagerIndicator on the DateDialogPicker\n\n  2. Create your own custom theme in `styles.xml`:\n\n  ```xml\n  \u003cstyle name=\"MyCustomBetterPickerTheme\"\u003e\n      \u003citem name=\"bpDialogBackground\"\u003e@drawable/custom_dialog_background\u003c/item\u003e\n      \u003citem name=\"bpTextColor\"\u003e@color/custom_text_color\u003c/item\u003e\n      \u003citem name=\"bpDeleteIcon\"\u003e@drawable/ic_backspace_custom\u003c/item\u003e\n      \u003citem name=\"bpCheckIcon\"\u003e@drawable/ic_check_custom\u003c/item\u003e\n      \u003citem name=\"bpKeyBackground\"\u003e@drawable/key_background_custom\u003c/item\u003e\n      \u003citem name=\"bpButtonBackground\"\u003e@drawable/button_background_custom\u003c/item\u003e\n      \u003citem name=\"bpDividerColor\"\u003e@color/custom_divider_color\u003c/item\u003e\n      \u003citem name=\"bpKeyboardIndicatorColor\"\u003e@color/custom_keyboard_indicator_color\u003c/item\u003e\n  \u003c/style\u003e\n  ```\n\n  3. Instantiate your `DialogFragment` using your custom theme:\n\n  ```java\n  DatePickerBuilder dpb = new DatePickerBuilder()\n      .setFragmentManager(getSupportFragmentManager())\n      .setStyleResId(R.style.MyCustomBetterPickerTheme);\n  dpb.show();\n  ```\n\nActionbarsherlock compatibility\n===============================\nIf you use actionbarsherlock which is not compatible with appcompat-v7 you can use the latest version of the library on the 1.x.x branch.\n\nYou can view the readme [here](README_1.6.0.md)\n\nChangeLog\n=========\nChange log file is available [here](CHANGE_LOG.md)\n\nContribution\n============\n\n### Pull requests are welcome!\n\nFeel free to contribute to BetterPickers.\n\nIf you've fixed a bug or have a feature you've added, just create a pull request.\n\nIf you've found a bug, want a new feature, or have other questions, [file an issue][10]. We will try to answer as soon as possible.\n\n\n### Applications using BetterPickers\n\nPlease send a pull request if you would like to be added here.\n\nIcon | Application\n------------ | -------------\n\u003cimg src=\"https://lh6.ggpht.com/wG3RSgReZcIcKsqFfsKSibR-j1UYfOekNmtY8x0n0mjWJT84U2V3l2lh3TmxeXfJis0z=w300\" width=\"48\" height=\"48\" /\u003e | [Trello]\n\u003cimg src=\"https://lh3.ggpht.com/OuJF91ba0PiNItxw_zAqwjarenly_LiaeaPJQOHBrVWPsGzydjUZ1ANp1wVDpU4cLsE=w300\" width=\"48\" height=\"48\" /\u003e | [Navig'Tours]\n\u003cimg src=\"https://lh3.googleusercontent.com/wgzBdz0-R999n1uo6qKJmIzPCt3ShM2lSM6oHmpz9HQKHhbuU0hGYwYhTJx_2QmAhic=w300\" width=\"48\" height=\"48\" /\u003e | [Sleep Well]\n\u003cimg src=\"https://lh3.googleusercontent.com/h30IiTNjNayoas5zhbeE38ajB-rsW9Cpz-AOnZnBIuwoOVMMnKZxDQ1RYRLZYLW8Jxc=w300\" width=\"48\" height=\"48\" /\u003e | [Dayon Alarm]\n\u003cimg src=\"http://imgur.com/ayz4NSY.png\" width=\"48\" height=\"48\" /\u003e | [Driving Timer]\n\u003cimg src=\"https://lh6.ggpht.com/p_j7PAV7YnvGl1ONtQ3OcqtIBpEeocH0okXpy2Hmaztwz8k9BBPLMvUnup6ptG4HxjE=w300\" width=\"48\" height=\"48\" /\u003e | [TVShow Time]\n\n\n\n\nCredits\n=======\n\nThanks to [Derek Brameyer][15] for the initial version.\n\nThanks to [JakeWharton][11] for his work on [ViewPagerIndicator][9].\n\nThanks to [OAK][12] and [WillowTree Apps][13] for Maven assistance and possible future improvements.\n\nThanks to all contributors !\n\nLicense\n=======\n\n    Copyright 2013 Derek Brameyer, Code-Troopers\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\n [5]: https://raw.github.com/code-troopers/android-betterpickers/master/sample/imagery/web_feature_graphic.png\n [6]: https://play.google.com/store/apps/details?id=com.codetroopers.betterpickersapp\n [7]: http://developer.android.com/guide/developing/projects/projects-eclipse.html\n [8]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject\n [9]: http://viewpagerindicator.com/\n [10]: https://github.com/code-troopers/android-betterpickers/issues/new\n [11]: https://plus.google.com/108284392618554783657/posts\n [12]: http://willowtreeapps.github.io/OAK/\n [13]: http://www.willowtreeapps.com/\n [15]: https://github.com/derekbrameyer/\n\n [Trello]:https://play.google.com/store/apps/details?id=com.trello\n [Navig'Tours]: https://play.google.com/store/apps/details?id=com.codetroopers.transport.tours\n [Sleep Well]: https://play.google.com/store/apps/details?id=com.processingbox.jevaisbiendormir\n [Dayon Alarm]: https://play.google.com/store/apps/details?id=com.atesfactory.dayon\n [Driving Timer]: https://play.google.com/store/apps/details?id=tk.leoforney.drivingtimer\n [TVShow Time]: https://play.google.com/store/apps/details?id=com.tozelabs.tvshowtime\n","funding_links":[],"categories":["Index `(light-weight pages)`","选择器(Picker)","Index","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-troopers%2Fandroid-betterpickers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-troopers%2Fandroid-betterpickers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-troopers%2Fandroid-betterpickers/lists"}