A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.

Overview

SublimePicker

A customizable view that provisions picking of a date, time & recurrence option, all from a single user-interface. You can also view 'SublimePicker' as a collection of material-styled (API 23) DatePicker, TimePicker & RecurrencePicker, backported to API 14.

With the release of version 2, SublimePicker now allows date-range selection.

All three components have been converted to views, which enables us to add/embed them anywhere - add them to a 'Dialog', a 'PopupWindow', or use them as any regular android widget.

Almost all styling possibilities have been exposed through attrs. If something has been missed, please bring it to my attention.

SublimePicker provides a single point of entry to all three pickers. What I mean is that once SublimePicker is available for interaction, the user can select a date, a time & a recurrence option without leaving the picker.

Gradle dependency

compile 'com.appeaser.sublimepickerlibrary:sublimepickerlibrary:2.1.2'

Walkthrough

Following screenshots have been taken from the sample application: Get it on Google Play

Launching into DatePicker:

Version 2 allows date-range selection using SublimeOptions#setCanPickDateRange(boolean). Picking date range is one fluent gesture which begins with a long-press on the intended start-date, followed by a drag onto the intended end-date. The range can span as many days, months or years, as needed. During a drag, approaching the left/right edge of date picker scrolls the previous/next month into view.

Date range selection:

Landscape:

Date range selection spanning multiple months:

Button at bottom-left corner can be used to switch to TimePicker:

Landscape:

The overflow button at top-right opens the RecurrencePicker:

Choosing Custom... from this menu brings you to RecurrenceOptionCreator:

Picking Until a date from the bottom spinner & clicking on the date shows a stripped down version of DatePicker:

Sample Application:

Results of the selection in sample application (single date):

Results of the selection in sample application (date range):

How-tos will be added in a day or two...

License

Copyright (c) 2018 Vikram Kakkar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • How to use and styling of pickers.

    How to use and styling of pickers.

    I have gone through your sample app on playstore and it looks pretty good even in below lollipop devices. I really appreciate your work. It would be better if you provide a bit more explanation regarding how to use and styling of pickers to suit app requirements. Also a gradle dependency for the library project will be much appreciated.

    opened by makk909 24
  • Support API 15

    Support API 15

    When I run the sample code. I got the following error.

    12-13 08:05:46.404: E/AndroidRuntime(13857): FATAL EXCEPTION: main 12-13 08:05:46.404: E/AndroidRuntime(13857): android.view.InflateException: Binary XML file line #15: Error inflating class com.appeaser.sublimepickerlibrary.SublimePicker 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:466) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepicker.SublimePickerFragment.onCreateView(SublimePickerFragment.java:92) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1613) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.os.Handler.handleCallback(Handler.java:605) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.os.Handler.dispatchMessage(Handler.java:92) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.os.Looper.loop(Looper.java:154) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.app.ActivityThread.main(ActivityThread.java:4895) 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Method.invokeNative(Native Method) 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Method.invoke(Method.java:511) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 12-13 08:05:46.404: E/AndroidRuntime(13857): at dalvik.system.NativeStart.main(Native Method) 12-13 08:05:46.404: E/AndroidRuntime(13857): Caused by: java.lang.reflect.InvocationTargetException 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.constructNative(Native Method) 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createView(LayoutInflater.java:586) 12-13 08:05:46.404: E/AndroidRuntime(13857): ... 20 more 12-13 08:05:46.404: E/AndroidRuntime(13857): Caused by: android.view.InflateException: Binary XML file line #42: Error inflating class com.appeaser.sublimepickerlibrary.recurrencepicker.SublimeRecurrencePicker 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:459) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.SublimePicker.initializeLayout(SublimePicker.java:211) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.SublimePicker.(SublimePicker.java:189) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.SublimePicker.(SublimePicker.java:184) 12-13 08:05:46.404: E/AndroidRuntime(13857): ... 23 more 12-13 08:05:46.404: E/AndroidRuntime(13857): Caused by: java.lang.reflect.InvocationTargetException 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.constructNative(Native Method) 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createView(LayoutInflater.java:586) 12-13 08:05:46.404: E/AndroidRuntime(13857): ... 30 more 12-13 08:05:46.404: E/AndroidRuntime(13857): Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class com.appeaser.sublimepickerlibrary.recurrencepicker.RecurrenceOptionCreator 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createView(LayoutInflater.java:606) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:459) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-13 08:05:46.404: E/AndroidRuntime(13857): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.recurrencepicker.SublimeRecurrencePicker.initializeLayout(SublimeRecurrencePicker.java:135) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.recurrencepicker.SublimeRecurrencePicker.(SublimeRecurrencePicker.java:120) 12-13 08:05:46.404: E/AndroidRuntime(13857): at com.appeaser.sublimepickerlibrary.recurrencepicker.SublimeRecurrencePicker.(SublimeRecurrencePicker.java:113) 12-13 08:05:46.404: E/AndroidRuntime(13857): ... 33 more 12-13 08:05:46.404: E/AndroidRuntime(13857): Caused by: java.lang.reflect.InvocationTargetException 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.constructNative(Native Method) 12-13 08:05:46.404: E/AndroidRuntime(13857): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 12-13 08:05:46.404: E/AndroidRuntime(13857): at

    opened by aadhk 10
  • Supporting API 14

    Supporting API 14

    Hi, I'll love to use your library but I'd need it to work with API 14. Is there any hope to make it work with API 14?

    I'd just need a simple DatePickerDialog, if I force the use of the library in my manifest... would it crash my app?

    Thanks in advance

    opened by fncapps 6
  • SublimeDatePicker displays wrong week name in Chinese in API 19

    SublimeDatePicker displays wrong week name in Chinese in API 19

    In China we call Monday "星期一". The first two characters means "week" and the last character determines which day in a week. When I use SublimeDatePicker, it only displays "星" for all days of a week: screenshot_2015-08-06-14-40-54 This only occurs in API 19(I didn't test Android 4.2 but I did test on 4.3 and above, at those versions it displays correctly). Maybe we should change DateFormat pattern or sth.

    opened by ywwynm 6
  • prefix attributes such as firstDayOfWeek with sp

    prefix attributes such as firstDayOfWeek with sp

    SublimeePicker has conflicting attributes with other libraries. Some attributes are already prefixed with "sp", would it be possible to prefix all attributes with sp?

    opened by siderakis 5
  • Add the possibilities to select a date range

    Add the possibilities to select a date range

    Hello, Your library is very usefull with a good design.

    Can you add the possibilite to select a range of dates like this library : http://android-arsenal.com/details/1/127

    Thank you

    enhancement 
    opened by AndroFlo 5
  • Possibilty to return null as

    Possibilty to return null as "no date selected"?

    I need the possibilty to return that the user doesn't want to set a date. I/the user start with "no date" and I need that the user also could go back to the initial value "no date".

    opened by Rainer-Lang 4
  • No clue how to use this library

    No clue how to use this library

    Even with the added wiki pages I have absolutely no clue how to get this to work. I tried copying the kotlin code from the example for converting to java later but I get an Unresolved reference for import android.support.v4.app.DialogFragment and so the extends DialogFragment() doesn't work either. Am I missing something?

    opened by PresidentDoggo 1
  • issue when using kotlin

    issue when using kotlin

    java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter recurrenceRule at blackburn.io.audigo_android.DateTimePickerFragment$listenerAdapter$1.onDateTimeRecurrenceSet(DateTimePickerFragment.kt) at com.appeaser.sublimepickerlibrary.SublimePicker$2.onOkay(SublimePicker.java:159) at com.appeaser.sublimepickerlibrary.common.ButtonLayout.onClick(ButtonLayout.java:222) at android.view.View.performClick(View.java:6205) at android.widget.TextView.performClick(TextView.java:11103) at android.view.View$PerformClick.run(View.java:23653) at android.os.Handler.handleCallback(Handler.java:751)

    when onDateTimeRecurrenceSet is called, errors like above happen, cuz one of the override PickerCallback funtions (onDateTimeRecurrenceSet) has recurrenceRule which cannot be set as Optional even if recurrenceRule is not nullable..

    opened by Hpark11 1
  • Monthly - On every second Tuesday etc..

    Monthly - On every second Tuesday etc..

    How can the user change the "on every SECOND tuesday of the month" to third or whatever he wants? I don't find an option in the GUI.

    But it must be supported because the recurrence rule send the sceond back ;-)

    opened by chrisonline 1
  • I am getting NoSuchFieldError after showing the dialog

    I am getting NoSuchFieldError after showing the dialog

    I have added the code as in the sample app, but have set the options to show only the recurrence picker. But after "show" I get this error: aused by: java.lang.NoSuchFieldError: No field date_picker_day_picker of type I in class Lcom/appeaser/sublimepickerlibrary/R$id; or its superclasses (declaration of 'com.appeaser.sublimepickerlibrary.R$id' appears in /data/data/com.colapps.reminder/files/instant-run/dex/slice-slice_4-classes.dex) at com.appeaser.sublimepickerlibrary.datepicker.SublimeDatePicker.initializeLayout(SublimeDatePicker.java:264)

    The line who is crashing is in onCreateView in my RecurrencPickerDialogFragment: SublimePicker sublimePicker = (SublimePicker) getActivity().getLayoutInflater() .inflate(R.layout.sublime_picker, container);

    What do I miss?

    opened by chrisonline 1
  • Several issues on using SublimePicker.

    Several issues on using SublimePicker.

    SublimePicker is amazing but it's so difficult to use without good documentation. I have figured out some stuff but I am having the following problems:

    • Is there a way to only allow users to choose current and future dates (not past dates) ? I have tried to use setDateParams(Calendar startCal, Calendar endCal) method, but it doesn't do anything

    • Is there a way to disable the "repeat Options" button. it disappears when using setPickerToShow(SublimeOptions.Picker.DATE_PICKER); option but I also want to have a time picking option together with the date so when I addsetPickerToShow(SublimeOptions.Picker.TIME_PICKER); The app crashes with the following exception: The picker you have requested to show(DATE_PICKER) is not activated. Use setDisplayOptions(int) to activate it, or use an activated Picker with setPickerToShow(Picker). and I have used SetDisplayOptions method but it doesn't work.

    • Is there a way to change the theme of the Dialogue?

    Thanks in advance. Also, let me know if there is another good option for android range date and time picker.

    opened by leoull 1
  • NullPointerException on SublimeOptions$Picker.name()

    NullPointerException on SublimeOptions$Picker.name()

    Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.appeaser.sublimepickerlibrary.helpers.SublimeOptions$Picker.name()' on a null object reference at com.appeaser.sublimepickerlibrary.SublimePicker$SavedState.writeToParcel + 499(SublimePicker.java:499) at android.os.Parcel.writeParcelable + 1699(Parcel.java:1699) at android.os.Parcel.writeValue + 1605(Parcel.java:1605) at android.os.Parcel.writeSparseArray + 1019(Parcel.java:1019) at android.os.Parcel.writeValue + 1630(Parcel.java:1630) at android.os.Parcel.writeArrayMapInternal + 891(Parcel.java:891) at android.os.BaseBundle.writeToParcelInner + 1579(BaseBundle.java:1579) at android.os.Bundle.writeToParcel + 1233(Bundle.java:1233) at android.os.Parcel.writeBundle + 931(Parcel.java:931) at android.os.Parcel.writeValue + 1596(Parcel.java:1596) at android.os.Parcel.writeArrayMapInternal + 891(Parcel.java:891) at android.os.BaseBundle.writeToParcelInner + 1579(BaseBundle.java:1579) at android.os.Bundle.writeToParcel + 1233(Bundle.java:1233) at android.app.IActivityManager$Stub$Proxy.activityStopped + 3871(IActivityManager.java:3871) at android.app.servertransaction.PendingTransactionActions$StopInfo.run + 144(PendingTransactionActions.java:144) at android.os.Handler.handleCallback + 873(Handler.java:873) at android.os.Handler.dispatchMessage + 99(Handler.java:99) at android.os.Looper.loop + 214(Looper.java:214) at android.app.ActivityThread.main + 7037(ActivityThread.java:7037) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 494(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main + 965(ZygoteInit.java:965)

    opened by daniebruwer 0
  • Added an alternate range selection mode

    Added an alternate range selection mode

    Added a new way to select date ranges, similar to the one Airbnb uses.

    After the user selects the first date and chooses a second date, it will automatically create a range between those two dates. Ex: I first select 2nd of March and then select 10th of March it will select this date range without the need to long press and drag.

    If you want to select another date, just chose a date and you can go through the process of range selection again.

    opened by adriancoman 6
Owner
Vikram
Vikram
Facebook-Styled-Image-Picker - Facebook Styled Image Picker

Facebook-Styled-Image-Picker Facebook Styled Gallery Files picker. One or multip

Hashim Tahir 11 Sep 27, 2022
Time-DatePicker - A Simple Time Date Picker With Kotlin

Time-DatePicker Time.DatePicker.mp4

Faysal Hossain 0 Jan 19, 2022
Nepali Date Picker library in Jetpack compose for android with Date conversion from BS to AD and vice-versa

Nepali Date picker Converter - Re in Compose This is a re-work of Nepali Date Picker Converter in jetpack compose and kotlin. English Locale Nepali Lo

Kiran Gyawali 4 Dec 23, 2022
Pick a date or time on Android in style

Material DateTime Picker - Select a time/date in style Material DateTime Picker tries to offer you the date and time pickers as shown in the Material

null 4.7k Jan 4, 2023
A date time range picker for android written in Kotlin

DateTimeRangePicker A date time range picker for android Usage Firstly, grab latest release of the library via JitPack. And note that, it utilizes Jod

SkedGo 501 Dec 31, 2022
Material3 themed Jetpack Compose date & time pickers.

Compose material3 Date1 and Time pickers Highly customizable Jetpack Compose components with material3 support for date & time picking. Contents Lates

Maroš Šeleng 35 Jan 31, 2023
An android app that can calculate the minutes from the date the user entered, till today.

AgeInMinutesApp An android app that can calculate the minutes from the date the user entered, till today. If user tap Select Date button, Calender dia

Gurkan 0 Mar 16, 2022
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Supratim 1.3k Dec 14, 2022
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Supratim 1.3k Dec 14, 2022
Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.

Android Week View Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling. Fea

Raquib-ul Alam (Kanak) 3.4k Jan 3, 2023
Android time range picker

TimeRangePicker TimeRangePicker is a library which can be used to select a time range. WARNING Requires android-support-v4 Description This library pr

Titto Jose 422 Nov 10, 2022
A customizable, easy-to-use, and functional circular time range picker library for Android

A customizable, easy-to-use, and functional circular time range picker library for Android. Use this library to mimic Apple's iOS or Samsung's bedtime picker.

Joery Droppers 251 Dec 30, 2022
Amazing Dynamic Time UI :clock1030: :hourglass: and More

FlatTimeCollection Amazing Dynamic Time UI ?? ⌛ for Android To help you design your Layout. it is Not just a UI, But it contains a CountDownTimer with

Anas Altair 72 Apr 28, 2022
A Material design back port of Android's CalendarView

Material Calendar View A Material design back port of Android's CalendarView. The goal is to have a Material look and feel, rather than 100% parity wi

Prolific Interactive 5.8k Jan 5, 2023
📅 Material Design Calendar compatible with API 11+

> Prettier and simpler Material Design CalendarView MaterialCalendarView is a prettier and simpler, material design calendar that allows full customiz

BlackBox Vision 365 Nov 21, 2022
📅 Material Design Calendar compatible with API 11+

> Prettier and simpler Material Design CalendarView MaterialCalendarView is a prettier and simpler, material design calendar that allows full customiz

BlackBox Vision 366 Jan 1, 2023
Monet color system with Material You

Monet Google's Monet color system (Android 12 Beta 2) library. Usage Jetpack Compose Generate Monet color palette monetColorsOf(Color, darkTheme) Loca

null 5 Feb 16, 2022
An android library which provides a compact calendar view much like the one used in google calenders.

CompactCalendarView CompactCalendarView is a simple calendar view which provides scrolling between months. It's based on Java's Date and Calendar clas

SundeepK 1.5k Dec 9, 2022
Android calendar view (like card)

android-calendar-card (Google Play Demo) Android calendar view (like card) Simple and easy to modify Author: Michał Szwarc #CalendarCardPager License

Michał Szwarc 473 Nov 10, 2022