• Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Material (Gregorian - Hijri) Date & Time Picker

Hijri Date Picker (UmAlQuraCalendar)

This library offers a hijri (Islamic Calendar) Date Picker designed on Google's Material Design Principals For Pickers for Android 5.0 (API 21) +.

Demo Hijri
Time Gregorian

You can report any issue on issues page. Note: If you speak Arabic, you can submit issues with Arabic language and I will check them. :)

Installation

Maven

<dependency>
<groupId>net.alhazmy13.hijridatepicker</groupId>
<artifactId>library</artifactId>
<version>3.0.0</version>
</dependency>

Gradle

dependencies {
	compile 'net.alhazmy13.hijridatepicker:library:3.0.0'
}

Usage

The library follows the same API as other pickers in the Android framework. After adding the library, you need to:

  1. Implement an onDateSet
  2. Create a HijriCalendarDialog using the supplied factory
  3. Theme the pickers

Implement an OnTimeSetListener/OnDateSetListener

In order to receive the date set in the picker, you will need to implement the OnDateSetListener interfaces. Typically this will be the Dialog that creates the Pickers. The callbacks use the same API as the standard Android pickers.

Note: Months start from 0.

 // TimePickerDialog
 @Override
    public void onTimeSet(TimePickerDialog view, int hourOfDay, int minute, int second) {
        // YOUR CODE
    }
 // GregorianDatePickerDialog
   @Override
    public void onDateSet(GregorianDatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
        //YOUR CODE
    }
    
    // HijriDatePickerDialog
       @Override
    public void onDateSet(HijriDatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
        //YOUR CODE
    }
    

Create a GregorianDatePickerDialog

You will need to create a new instance of GregorianDatePickerDialog . Once the dialogs are configured, you can call show().

Calendar now = Calendar.getInstance();
GregorianDatePickerDialog dpd = GregorianDatePickerDialog.newInstance(
		  this,
		  now.get(Calendar.YEAR),
		  now.get(Calendar.MONTH),
		  now.get(Calendar.DAY_OF_MONTH));
dpd.show(getFragmentManager(), "GregorianDatePickerDialog");

Create a HijriDatePickerDialog

Same as GregorianDatePickerDialog but you need to use UmmalquraCalendar insted of Calendar class.

UmmalquraCalendar now = new UmmalquraCalendar();
HijriDatePickerDialog dpd = HijriDatePickerDialog.newInstance(
		  this,
		  now.get(UmmalquraCalendar.YEAR),
		  now.get(UmmalquraCalendar.MONTH),
		  now.get(UmmalquraCalendar.DAY_OF_MONTH));
dpd.show(getFragmentManager(), "HijriDatePickerDialog");

TimePickerDialog

Calendar now = Calendar.getInstance();
TimePickerDialog tpd = TimePickerDialog.newInstance(
                        this,
                        now.get(Calendar.HOUR_OF_DAY),
                        now.get(Calendar.MINUTE),
                        mode24Hours.isChecked()
                );

Credits

License

Copyright 2015 alhazmy

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.

More Repositories

1

MediaPicker

Media Picker is an Android Libary that lets you to select multiple images or video
Java
268
star
2

Synology-NAS-monitoring

influxDB, Grafana, snmp and telegraf
Shell
197
star
3

ImageFilters

Image Filter is an Android Libary that lets you to Filtering any image
Makefile
91
star
4

Saudi-ID-Validator

Saudi-ID-Validator (Swift, Kotlin, Java, Go, JS, Python, TypeScript, PHP, Scala, ruby, c#, vb, SQL, C++, SQL and Dart)
Swift
81
star
5

MediaRecorderDialog

Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but with this dialog you can do all thats with only one dialog.
Java
72
star
6

Gota

Simplifying Android Permissions
Java
70
star
7

aws-serverless-skeleton

A Serverless skeleton project using Python
Python
41
star
8

AndroidWordCloud

Android Word Cloud
Java
39
star
9

Catcho

No Force close messages anymore!
Java
35
star
10

MediaGallery

Android image slideshow with circular scrolling and custom view.
Java
30
star
11

PrayerTimesSwift

Prayer Times provides a set of handy functions to calculate prayer times for any location around the world
Swift
29
star
12

PrayerTimes

Prayer Times provides a set of handy functions to calculate prayer times for any location around the world, based on a variety of calculation methods currently used in Muslim communities.
Java
24
star
13

pwa-angular4

A progressive webapp with Angular 4 (PLEASE NOTE: angular 5 support PWA )
TypeScript
13
star
14

CacheWithNetworkDemo-Android

Dagger+Retrofit+Realm+Gson+Clean Architecture+MVP
Java
12
star
15

Contact-Form-7-Submission-limit

Contact form 7 submission limit
PHP
11
star
16

Angular4-word-cloud

Word cloud directive for Angular4
JavaScript
10
star
17

IBAN-Validator

Iban Validator (Swift, Kotlin, Java)
Swift
10
star
18

Simple-SQLite-Project-with-Android

Java
4
star
19

microservices-example

Python
4
star
20

discourse-cognito-auth

Ruby
3
star
21

alhazmy13

3
star
22

ResistorsOpenCV

A python project using OpenCV to identify and calculate resistors' values from a webcam feed.
Python
3
star
23

RadioButtonSwift3

Custom radio button for swift 3
Swift
3
star
24

MacScripts

A list of shell commands and tools specific to OS X.
Shell
3
star
25

ActivityCleanArchitecture_Template

Template for Android Studio to create an empty activity with Clean Architecture approach
FreeMarker
3
star
26

arcdps-squad-notes-plugin

A Plugin for arcdps, that tracks squad members and add notes next to each member.
C++
2
star
27

CleanSwift_Template

Clean Swift Xcode Template
Makefile
2
star
28

ghost-casper-rtl

CSS
2
star
29

Spara

Save/Restore Activity's member
Java
2
star
30

plex-tvtime-webhook

Sync Plex with TvTime using Plex WebHook.
TypeScript
2
star
31

RestAPI-using-Slim-Framework

PHP
1
star
32

UglyKotlinProject

Kotlin
1
star
33

DemoWatchOS

Demo project for communication between a watchOS and iOS app using WCSession
Swift
1
star
34

javamail-android

Automatically exported from code.google.com/p/javamail-android
Java
1
star
35

streamdeck-sensibo

Control your Sensibo air conditioners from stream deck
JavaScript
1
star