android library dialog month picker

Overview

RackMonthPicker

android library dialog month picker

Screenshots

Download

Download via Maven:

Add the JitPack repository to your build file

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add the dependency

<dependency>
        <groupId>com.github.kal72</groupId>
        <artifactId>RackMonthPicker</artifactId>
        <version>1.6.1</version>
</dependency>

via Gradle:

Add it in your root build.gradle at the end of repositories

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency

dependencies {
        implementation 'com.github.kal72:RackMonthPicker:1.6.1'
}

How to use :

 new RackMonthPicker(this)
 	 .setLocale(Locale.ENGLISH)
         .setPositiveButton(new DateMonthDialogListener() {
               @Override
               public void onDateMonth(int month, int startDate, int endDate, int year, String monthLabel) {

               }
          })
          .setNegativeButton(new OnCancelMonthDialogListener() {
                @Override
                public void onCancel(AlertDialog dialog) {

                }
          }).show();

adding .setPositiveText(String text) or .setNegativeText(String Text) to change the text of a button.
adding .setLocale(Locale.ENGLISH) to change language.
adding .setColorTheme(R.color.primary) to change color theme.
adding .setSelectedMonth(4) to change default month selected. adding .setMonthType(MonthType) to show month by text or number.

Once the dialog is shown, you can dismiss it:

RackMonthPicker rackMonthPicker = new RackMonthPicker(this)
            .......
            .show();

rackMonthPicker.dismiss();

Contributing

Contributions are welcome!

Comments
  • setSelectedYear() is a Critical Update needed.

    setSelectedYear() is a Critical Update needed.

    Sir, @lutvie72 When the picker opened in january, 2018 its showing 2017 as year. When we click next button it is changed to 2019 and then clicked previous it came to 2018. So the update is very important. We are waiting for the update.

    opened by habeebrahmanomr 9
  • Set Custom Month while creating/showing the Dialog

    Set Custom Month while creating/showing the Dialog

    Is there any way to set custom month while creating the month picker dialog? Currently, it shows January as the selected month everytime we show the dialog, there should be the option to set custom month to show as the selected month in the dialog.

    Any plan to add that feature?

    opened by Shajeel-Afzal 2
  • End date issue

    End date issue

    @kal72 First .. nice picker keep on. Second .. Please just update

    cal.set(Calendar.MONTH, selectedItem);
    

    Calendar month index start from 0

    public int getEndDate() {
            Calendar cal = Calendar.getInstance();
            cal.set(Calendar.MONTH, selectedItem + 1);
            cal.set(Calendar.DAY_OF_MONTH, selectedItem + 1);
            int maxDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
            return maxDay;
        }
    
    opened by dev-hussein 1
  • can you make an option to show the months as numbers ?

    can you make an option to show the months as numbers ?

    can you make an option to show the months as numbers ? for Example instead of Dec it could show 12 ..so all the numeric values of the months can show instead of words ? Can you also localize the months ?

    opened by j2emanue 1
  • Can i Change Month Name

    Can i Change Month Name

    Can i modify month name manually ... for ex .. i need to use this lib in other language so .... i wanna change month name in other language... Can i do this.

    opened by deshario 1
  • Drawable Internationalization

    Drawable Internationalization

    Hi!, How did you create each month name drawable? I want to use your library in my project, but I need it in spanish.

    I would love to help you with some Internationalization But I don't know how to create those resources (jan, jan_cicle, ...)

    opened by gringoh 1
  • Make sure to use 'getActivity()'

    Make sure to use 'getActivity()'

    Attention: RackMonthPicker monthPicker = new RackMonthPicker(getActivity()) In my case, a crash was caused because I was passing View.getContext().getApplicationContext() as Context to the Builder. This was fixed by using getActivity() instead.

    The exception:

    java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:355) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:324) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:285) at android.support.v7.app.AppCompatDialog.setContentView(AppCompatDialog.java:83) at android.support.v7.app.AlertController.installContent(AlertController.java:225) at android.support.v7.app.AlertDialog.onCreate(AlertDialog.java:257) at android.app.Dialog.dispatchOnCreate(Dialog.java:394) at android.app.Dialog.show(Dialog.java:295) at com.rackspira.kristiawan.rackmonthpicker.RackMonthPicker$Builder.build(RackMonthPicker.java:136) at com.rackspira.kristiawan.rackmonthpicker.RackMonthPicker.show(RackMonthPicker.java:47) at com.artursworld.nccn.model.wizard.psychosocial.PastPsychoSocialStep$2.onClick(PastPsychoSocialStep.java:202) at android.view.View.performClick(View.java:5198) at android.widget.CompoundButton.performClick(CompoundButton.java:122) at android.view.View$PerformClick.run(View.java:21147) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

    opened by lidox 1
Releases(1.6.2)
Owner
Kristiawan Adi L
Software Engineer
Kristiawan Adi L
A simple library which gives you custom design CalendarView with dialog functionality and event handlers.

CalendarView A simple library which gives you custom design CalendarView with dialog functionality and event handlers. 1: CalendarView Demo Screen 1.1

Shahzad Afridi (Opriday) 49 Oct 28, 2022
Android library for better Picker DialogFragments

DialogFragments modeled after the AOSP Clock and Calendar apps to improve UX for picking time, date, numbers, and other things.

Code-Troopers 2.7k Dec 29, 2022
Asimov-flagz-kt - Feature flags library based on Togglz library

Asimov Flagz Feature flags library based on Togglz library. Installation Gradle

Nicolas Bottarini 1 Jan 8, 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
Joda-Time library with Android specialization

Android has built-in date and time handling - why bother with a library? If you've worked with Java's Date and Calendar classes you can probably answer this question yourself, but if not, check out Joda-Time's list of benefits.

Daniel Lew 2.6k Dec 9, 2022
Android NTP time library. Get the true current time impervious to device clock time changes

TrueTime for Android Make sure to check out our counterpart too: TrueTime, an NTP library for Swift. NTP client for Android. Calculate the date and ti

Instacart 1.3k Jan 4, 2023
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 Jan 7, 2023
CustomizableCalendar is a library that allows you to create your calendar, customizing UI and behaviour

CustomizableCalendar This library allows you to create a completely customizable calendar. You can use CustomizableCalendar to create your calendar, c

MOLO17 216 Dec 6, 2022
KotlinX multiplatform date/time library

kotlinx-datetime A multiplatform Kotlin library for working with date and time. See Using in your projects for the instructions how to setup a depende

Kotlin 1.6k Jan 5, 2023
Multiplatform Date and time library for Kotlin

Klock is a Date & Time library for Multiplatform Kotlin. It is designed to be as allocation-free as possible using Kotlin inline classes, to be consis

null 681 Dec 19, 2022
A Kotlin Multiplatform library for working with dates and times

Island Time A Kotlin Multiplatform library for working with dates and times, heavily inspired by the java.time library. Features: A full set of date-t

Erik Christensen 71 Dec 28, 2022
Additions for Kotlin's date & time library kotlinx-datetime

fluid-time Additions for Kotlin's date & time library kotlinx-datetime. kotlinx-datetime is very early stage and not as actively developed as other of

Marc Knaup 39 Nov 11, 2022
java.time Kotlin extension functions library.

Java Time Kotlin extension functions. Background Java Time became integrated to the JDK as of Java 8. It was a huge improvement over its Date predeces

Sami Eljabali 31 Mar 15, 2022
Kmpcalendar - A calendar library and views written for kotlin multiplatform

KMPCalendarView Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compo

Anmol Verma 2 Oct 7, 2022
A Jetpack Compose library for handling calendar component rendering.

Compose Calendar Compose Calendar is a composable handling all complexity of rendering calendar component and date selection. Due to flexibility provi

Bogusz Pawłowski 181 Dec 22, 2022
📅 Minimal Calendar - This calendar library is built with jetpack compose. Easy, simple, and minimal.

?? Minimal Calendar This calendar library is built with jetpack compose. Easy, simple, and minimal. Latest version The stable version of the library i

Minjae Kim 16 Sep 14, 2022
An adaptation of the JSR-310 backport for Android.

ThreeTen Android Backport An adaptation of the JSR-310 backport for Android. Attention: Development on this library is winding down. Please consider s

Jake Wharton 3.5k Dec 11, 2022
A better calendar for Android

Caldroid Caldroid is a fragment that display calendar with dates in a month. Caldroid can be used as embedded fragment, or as dialog fragment. User ca

Roomorama 1.4k Nov 29, 2022
Standalone Android widget for picking a single date from a calendar view.

TimesSquare for Android Standalone Android widget for picking a single date from a calendar view. Usage Include CalendarPickerView in your layout XML.

Square 4.4k Dec 20, 2022