All Projects → Twinkle942910 → Monthyearpicker

Twinkle942910 / Monthyearpicker

Licence: apache-2.0
Fancy year and month picker library for your android app

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Monthyearpicker

Rrule
JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
Stars: ✭ 2,249 (+6147.22%)
Mutual labels:  library, calendar
Calendarview
Calendar View Library
Stars: ✭ 71 (+97.22%)
Mutual labels:  library, calendar
Calendar Base
Base methods for generating calendars using JavaScript.
Stars: ✭ 342 (+850%)
Mutual labels:  library, calendar
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+27202.78%)
Mutual labels:  library, calendar
Material Calendar View
📅 Material Design Calendar compatible with API 11+
Stars: ✭ 360 (+900%)
Mutual labels:  library, calendar
Nim Libsodium
Nim wrapper for the libsodium library
Stars: ✭ 32 (-11.11%)
Mutual labels:  library
Swipebacklayout
SwipeBack is an android library that can finish a activity by using gesture.
Stars: ✭ 977 (+2613.89%)
Mutual labels:  library
Jenkins Library
Shared Library for Jenkine Pipeline
Stars: ✭ 32 (-11.11%)
Mutual labels:  library
Datasafe
Datasafe - flexible and secure data storage and document sharing using cryptographic message syntax for data encryption
Stars: ✭ 32 (-11.11%)
Mutual labels:  library
Autoplayvideos
Android library to auto-play/pause videos from url in recyclerview.
Stars: ✭ 981 (+2625%)
Mutual labels:  library
Versioncontrol git
VersionControl_Git is a library that provides OO interface to handle Git repository.
Stars: ✭ 35 (-2.78%)
Mutual labels:  library
Lib9wada
Wonderful library with lots of useful functions, algorithms and data structures in C, link it with -l9wada
Stars: ✭ 35 (-2.78%)
Mutual labels:  library
Rhashmap
Robin Hood hash map library
Stars: ✭ 33 (-8.33%)
Mutual labels:  library
Angular Library Starter Kit
Angular 5 Library Starter Kit based on Angular-CLI
Stars: ✭ 35 (-2.78%)
Mutual labels:  library
Tina
a powerful android network library base on okhttp
Stars: ✭ 32 (-11.11%)
Mutual labels:  library
Hhcustomcorner
Awesome library to customize corners of UIView and UIButton. Now you can customize each corner differently
Stars: ✭ 36 (+0%)
Mutual labels:  library
Simple Sh Datascience
A collection of Bash scripts and Dockerfiles to install data science Tool, Lib and application
Stars: ✭ 32 (-11.11%)
Mutual labels:  library
Calendarview
Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Stars: ✭ 7,998 (+22116.67%)
Mutual labels:  calendar
Unicode Bidirectional
A Javascript implementation of the Unicode 9.0.0 Bidirectional Algorithm
Stars: ✭ 35 (-2.78%)
Mutual labels:  library
React Calendar
A React Native inspired date list renderer
Stars: ✭ 34 (-5.56%)
Mutual labels:  calendar

MonthYearPicker

Fancy year and month picker library for your android app

How to use?

Maven

<dependency>
  <groupId>com.github.twinkle942910</groupId>
  <artifactId>monthyearpicker</artifactId>
  <version>0.0.1</version>
  <type>aar</type>
</dependency>

Gradle

dependencies {
    compile 'com.github.twinkle942910:monthyearpicker:0.0.1'
}

Demonstration

And you can pick a year You can pick a month

You can simply create your dialog in code, using next lines

Calendar calendar = Calendar.getInstance();
calendar.set(2010,01,01);

YearMonthPickerDialog yearMonthPickerDialog = new YearMonthPickerDialog(this, calendar, new YearMonthPickerDialog.OnDateSetListener() {
            @Override
            public void onYearMonthSet(int year, int month) {
                Calendar calendar = Calendar.getInstance();
                calendar.set(Calendar.YEAR, year);
                calendar.set(Calendar.MONTH, month);

                SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM yyyy");

                yearMonth.setText(dateFormat.format(calendar.getTime()));
            }
        });

1st argument - Context.

2nd - Calendar.

3nd - Date set listener.

And after this just show it whenever you need it to appear.

yearMonthPickerDialog.show();

If you want to add your style then add themeId to the constructor as a third argument

for exemple:

Add your custom style to android resources

   <!-- Dialog default theme. -->
    <style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
        <item name="colorControlNormal">@android:color/white</item>
        <item name="colorControlActivated">@color/colorPrimary</item>
        <item name="textColorAlertDialogListItem">@android:color/white</item>
        <item name="colorAccent">@color/colorPrimary</item>
        <item name="android:textColorPrimary">@android:color/black</item>
        <item name="android:windowBackground">@drawable/dialog_background</item>
    </style>

It would add colors to the controls and text. Then add a content drawable for backgound. Example:

<?xml version="1.0" encoding="utf-8"?>

<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetLeft="16dp"
    android:insetTop="16dp"
    android:insetRight="16dp"
    android:insetBottom="16dp">

    <shape android:shape="rectangle">
        <corners android:radius="2dp" />
        <solid android:color="@color/colorMainBackground" />
    </shape>

</inset>

use example : R.style.MyDialogTheme

And you will have your custom theme applied.

Customizing dialog title

If you want to change title text color, then add a int color value as a 4th constructor parameter.

use example : R.color.MyTextTitleColor

Also, if you want to change color of title view, you have to change you main theme primary color, because it depends on it's value.

Set a custom year range

If you want the displayed values of year vary within a range, you have to set the first (min) and the last (max) year:

yearMonthPickerDialog.setMinYear(2000);
yearMonthPickerDialog.setMaxYear(2020);

Check demonstraction project for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].