├── sample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ └── layout │ │ │ └── activity_main.xml │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── library ├── gradle.properties ├── src │ └── main │ │ ├── assets │ │ └── fonts │ │ │ └── Roboto-Medium.ttf │ │ ├── res │ │ ├── values-h330dp │ │ │ └── dimens.xml │ │ ├── values-w560dp-land │ │ │ └── dimens.xml │ │ ├── drawable-v21 │ │ │ ├── mdtp_material_button_background.xml │ │ │ └── mdtp_material_button_selected.xml │ │ ├── drawable │ │ │ ├── mdtp_material_button_background.xml │ │ │ ├── mdtp_material_button_selected.xml │ │ │ ├── mdtp_done_background_color_dark.xml │ │ │ └── mdtp_done_background_color.xml │ │ ├── values-v16 │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── color │ │ │ ├── mdtp_done_text_color.xml │ │ │ ├── mdtp_done_text_color_dark.xml │ │ │ ├── mdtp_date_picker_year_selector.xml │ │ │ └── mdtp_date_picker_selector.xml │ │ ├── layout │ │ │ ├── hdp_mdtp_date_time_picker_dialog.xml │ │ │ ├── hdp_mdtp_date_picker_view_animator.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_view_animator.xml │ │ │ ├── hdp_mdtp_year_label_text_view.xml │ │ │ ├── hdp_mdtp_hijri_year_label_text_view.xml │ │ │ ├── hdp_mdtp_date_picker_header_view.xml │ │ │ ├── hdp_mdtp_time_title_view.xml │ │ │ ├── hdp_mdtp_time_title_view_v2.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_header_view.xml │ │ │ ├── hdp_mdtp_date_picker_header_view_v2.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_header_view_v2.xml │ │ │ ├── hdp_mdtp_date_picker_dialog.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_dialog.xml │ │ │ ├── hdp_mdtp_date_picker_dialog_v2.xml │ │ │ └── hdp_mdtp_hijri_date_picker_dialog_v2.xml │ │ ├── drawable-land │ │ │ ├── mdtp_done_background_color_dark.xml │ │ │ └── mdtp_done_background_color.xml │ │ ├── drawable-land-v19 │ │ │ └── mdtp_done_background_color.xml │ │ ├── drawable-v19 │ │ │ └── mdtp_done_background_color.xml │ │ ├── values-w270dp-h560dp │ │ │ └── dimens.xml │ │ ├── layout-land │ │ │ ├── hdp_mdtp_time_title_view_v2.xml │ │ │ ├── hdp_mdtp_date_picker_header_view_v2.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_header_view_v2.xml │ │ │ ├── hdp_mdtp_date_picker_dialog_v2.xml │ │ │ ├── hdp_mdtp_hijri_date_picker_dialog_v2.xml │ │ │ ├── hdp_mdtp_date_picker_dialog.xml │ │ │ └── hdp_mdtp_hijri_date_picker_dialog.xml │ │ ├── values-land │ │ │ └── dimens.xml │ │ ├── values-sw600dp-land │ │ │ └── dimens.xml │ │ ├── layout-w270dp-h560dp │ │ │ ├── hdp_mdtp_date_picker_dialog.xml │ │ │ └── hdp_mdtp_hijri_date_picker_dialog.xml │ │ ├── layout-sw600dp │ │ │ ├── hdp_mdtp_date_picker_dialog.xml │ │ │ └── hdp_mdtp_hijri_date_picker_dialog.xml │ │ ├── values │ │ │ └── styles.xml │ │ ├── layout-sw600dp-land │ │ │ ├── hdp_mdtp_date_picker_dialog.xml │ │ │ └── hdp_mdtp_hijri_date_picker_dialog.xml │ │ ├── values-zh-rCN │ │ │ └── strings.xml │ │ ├── values-zh-rHK │ │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ │ └── strings.xml │ │ ├── values-ja │ │ │ └── strings.xml │ │ ├── values-ko │ │ │ └── strings.xml │ │ ├── values-am │ │ │ └── strings.xml │ │ ├── values-iw │ │ │ └── strings.xml │ │ ├── values-af │ │ │ └── strings.xml │ │ ├── values-lo-rLA │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ ├── values-th │ │ │ └── strings.xml │ │ ├── values-da │ │ │ └── strings.xml │ │ ├── values-in │ │ │ └── strings.xml │ │ ├── values-vi │ │ │ └── strings.xml │ │ ├── values-en-rGB │ │ │ └── strings.xml │ │ ├── values-en-rIN │ │ │ └── strings.xml │ │ ├── values-hi │ │ │ └── strings.xml │ │ ├── values-mr-rIN │ │ │ └── strings.xml │ │ ├── values-si-rLK │ │ │ └── strings.xml │ │ ├── values-is-rIS │ │ │ └── strings.xml │ │ ├── values-km-rKH │ │ │ └── strings.xml │ │ ├── values-mn-rMN │ │ │ └── strings.xml │ │ ├── values-ms-rMY │ │ │ └── strings.xml │ │ ├── values-pl │ │ │ └── strings.xml │ │ ├── values-sv │ │ │ └── strings.xml │ │ ├── values-tr │ │ │ └── strings.xml │ │ ├── values-ar │ │ │ └── strings.xml │ │ ├── values-cs │ │ │ └── strings.xml │ │ ├── values-fa │ │ │ └── strings.xml │ │ ├── values-ka-rGE │ │ │ └── strings.xml │ │ ├── values-sl │ │ │ └── strings.xml │ │ ├── values-mk-rMK │ │ │ └── strings.xml │ │ ├── values-ro │ │ │ └── strings.xml │ │ ├── values-uk │ │ │ └── strings.xml │ │ ├── values-ur-rPK │ │ │ └── strings.xml │ │ ├── values-kk-rKZ │ │ │ └── strings.xml │ │ ├── values-ky-rKG │ │ │ └── strings.xml │ │ ├── values-nb │ │ │ └── strings.xml │ │ ├── values-ru │ │ │ └── strings.xml │ │ ├── values-sk │ │ │ └── strings.xml │ │ ├── values-uz-rUZ │ │ │ └── strings.xml │ │ ├── values-el │ │ │ └── strings.xml │ │ ├── values-hr │ │ │ └── strings.xml │ │ ├── values-my-rMM │ │ │ └── strings.xml │ │ ├── values-lv │ │ │ └── strings.xml │ │ ├── values-ne-rNP │ │ │ └── strings.xml │ │ ├── values-sw │ │ │ └── strings.xml │ │ ├── values-hy-rAM │ │ │ └── strings.xml │ │ ├── values-sr │ │ │ └── strings.xml │ │ ├── values-bg │ │ │ └── strings.xml │ │ ├── values-hu │ │ │ └── strings.xml │ │ ├── values-zu │ │ │ └── strings.xml │ │ └── values-ca │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── net │ │ └── alhazmy13 │ │ └── hijridatepicker │ │ ├── date │ │ ├── hijri │ │ │ ├── SimpleMonthAdapter.java │ │ │ ├── SimpleDayPickerView.java │ │ │ ├── DatePickerController.java │ │ │ └── AccessibleDateAnimator.java │ │ └── gregorian │ │ │ ├── SimpleMonthAdapter.java │ │ │ ├── SimpleDayPickerView.java │ │ │ ├── DatePickerController.java │ │ │ └── AccessibleDateAnimator.java │ │ ├── TypefaceHelper.java │ │ ├── AccessibleTextView.java │ │ ├── AccessibleLinearLayout.java │ │ └── VerticalTextView.java └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── HijriDatePicker.iml └── gradle.properties /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':library', ':sample' 2 | -------------------------------------------------------------------------------- /library/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=MaterialDateTimePicker 2 | POM_ARTIFACT_ID=materialdatetimepicker 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /library/src/main/assets/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/library/src/main/assets/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alhazmy13/HijriDatePicker/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /library/src/main/res/values-h330dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 252dp 4 | 300dip 5 | 6 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 01 08:02:21 AST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /library/src/main/res/values-w560dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 270dp 4 | 270dip 5 | 270dip 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-v21/mdtp_material_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/mdtp_material_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-v21/mdtp_material_button_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/mdtp_material_button_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # Android Studio Navigation editor temp files 31 | .navigation/ 32 | 33 | # Android Studio captures folder 34 | captures/ 35 | 36 | # Intellij 37 | *.iml.idea 38 | .DS_Store 39 | .idea 40 | -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/wdullaer/Downloads/android-sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 19 9 | targetSdkVersion 29 10 | versionCode 1 11 | versionName "1.0.2" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | lintOptions { 20 | abortOnError false 21 | } 22 | 23 | 24 | } 25 | 26 | dependencies { 27 | implementation project(':library') 28 | implementation fileTree(dir: 'libs', include: ['*.jar']) 29 | implementation 'com.google.android.material:material:1.1.0' 30 | implementation "androidx.appcompat:appcompat:1.1.0" 31 | } 32 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /HijriDatePicker.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | android.enableJetifier=true 20 | android.useAndroidX=true -------------------------------------------------------------------------------- /library/src/main/res/values-v16/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | sans-serif-light 20 | 21 | -------------------------------------------------------------------------------- /library/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/res/color/mdtp_done_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /library/src/main/res/color/mdtp_done_text_color_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_time_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/res/color/mdtp_date_picker_year_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/mdtp_done_background_color_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-land/mdtp_done_background_color_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/color/mdtp_date_picker_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-land/mdtp_done_background_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-land-v19/mdtp_done_background_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/drawable/mdtp_done_background_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/drawable-v19/mdtp_done_background_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_picker_view_animator.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_date_picker_view_animator.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /library/src/main/res/values-w270dp-h560dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 23 | 24 | 230dp 25 | 190dp 26 | 30dp 27 | 100dp 28 | 30dp 29 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_year_label_text_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_year_label_text_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 25 | -------------------------------------------------------------------------------- /library/src/main/res/values-v16/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 22 | 23 | 26 | 27 | 30 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_picker_header_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 27 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_time_title_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_time_title_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_date_picker_header_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 27 | -------------------------------------------------------------------------------- /library/src/main/java/net/alhazmy13/hijridatepicker/date/hijri/SimpleMonthAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.alhazmy13.hijridatepicker.date.hijri; 18 | 19 | import android.content.Context; 20 | 21 | /** 22 | * An adapter for a list of {@link SimpleMonthView} items. 23 | */ 24 | public class SimpleMonthAdapter extends MonthAdapter { 25 | 26 | public SimpleMonthAdapter(Context context, DatePickerController controller) { 27 | super(context, controller); 28 | } 29 | 30 | @Override 31 | public MonthView createMonthView(Context context) { 32 | final MonthView monthView = new SimpleMonthView(context, null, mController); 33 | return monthView; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/java/net/alhazmy13/hijridatepicker/date/gregorian/SimpleMonthAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.alhazmy13.hijridatepicker.date.gregorian; 18 | 19 | import android.content.Context; 20 | 21 | /** 22 | * An adapter for a list of {@link SimpleMonthView} items. 23 | */ 24 | public class SimpleMonthAdapter extends MonthAdapter { 25 | 26 | public SimpleMonthAdapter(Context context, DatePickerController controller) { 27 | super(context, controller); 28 | } 29 | 30 | @Override 31 | public MonthView createMonthView(Context context) { 32 | final MonthView monthView = new SimpleMonthView(context, null, mController); 33 | return monthView; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_picker_header_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | 17 | 18 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_date_picker_header_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.novoda.bintray-release' 3 | //./gradlew clean build bintrayUpload 4 | 5 | 6 | publish { 7 | userOrg = 'alhazmy13' 8 | groupId = 'net.alhazmy13.hijridatepicker' 9 | artifactId = 'library' 10 | uploadName = 'HijriDatePicker-v2' 11 | publishVersion = '3.0.3' 12 | desc = 'Hijri Date Picker' 13 | dryRun = false 14 | website = 'https://github.com/alhzmy13/HijriDatePicker' 15 | } 16 | 17 | 18 | android { 19 | compileSdkVersion 29 20 | buildToolsVersion "29.0.3" 21 | 22 | defaultConfig { 23 | minSdkVersion 19 24 | targetSdkVersion 29 25 | versionCode 1 26 | versionName "1.0.2" 27 | } 28 | buildTypes { 29 | release { 30 | minifyEnabled false 31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 32 | } 33 | } 34 | lintOptions { 35 | abortOnError false 36 | } 37 | 38 | 39 | } 40 | 41 | dependencies { 42 | implementation fileTree(dir: 'libs', include: ['*.jar']) 43 | implementation 'com.google.android.material:material:1.1.0' 44 | implementation "androidx.appcompat:appcompat:1.1.0" 45 | implementation "androidx.constraintlayout:constraintlayout:1.1.3" 46 | 47 | api group: 'com.github.msarhan', name: 'ummalqura-calendar', version:'2.0.2' 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /library/src/main/res/layout-land/hdp_mdtp_time_title_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/layout-land/hdp_mdtp_date_picker_header_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/src/main/res/layout-land/hdp_mdtp_hijri_date_picker_header_view_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /library/src/main/java/net/alhazmy13/hijridatepicker/date/hijri/SimpleDayPickerView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.alhazmy13.hijridatepicker.date.hijri; 18 | 19 | import android.content.Context; 20 | import android.util.AttributeSet; 21 | 22 | /** 23 | * A DayPickerView customized for {@link SimpleMonthAdapter} 24 | */ 25 | public class SimpleDayPickerView extends DayPickerView { 26 | 27 | public SimpleDayPickerView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | } 30 | 31 | public SimpleDayPickerView(Context context, DatePickerController controller) { 32 | super(context, controller); 33 | } 34 | 35 | @Override 36 | public MonthAdapter createMonthAdapter(Context context, DatePickerController controller) { 37 | return new SimpleMonthAdapter(context, controller); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 200dip 22 | 240dip 23 | 24 | 30dp 25 | 100dp 26 | 30dp 27 | 28 | 220dp 29 | 170dp 30 | 308dp 31 | 220dp 32 | 33 | 220dip 34 | 270dip 35 | 36 | -------------------------------------------------------------------------------- /library/src/main/java/net/alhazmy13/hijridatepicker/date/gregorian/SimpleDayPickerView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package net.alhazmy13.hijridatepicker.date.gregorian; 18 | 19 | import android.content.Context; 20 | import android.util.AttributeSet; 21 | 22 | /** 23 | * A DayPickerView customized for {@link SimpleMonthAdapter} 24 | */ 25 | public class SimpleDayPickerView extends DayPickerView { 26 | 27 | public SimpleDayPickerView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | } 30 | 31 | public SimpleDayPickerView(Context context, DatePickerController controller) { 32 | super(context, controller); 33 | } 34 | 35 | @Override 36 | public MonthAdapter createMonthAdapter(Context context, DatePickerController controller) { 37 | return new SimpleMonthAdapter(context, controller); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /library/src/main/res/values-sw600dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 45dp 23 | 14dp 24 | 220dp 25 | 456dp 26 | 16dp 27 | 64dp 28 | 32dp 29 | 16dp 30 | 6dip 31 | 5dip 32 | 96dip 33 | 48dip 34 | 400dip 35 | 36 | -------------------------------------------------------------------------------- /library/src/main/res/layout-w270dp-h560dp/hdp_mdtp_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/res/layout-sw600dp/hdp_mdtp_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/res/layout-w270dp-h560dp/hdp_mdtp_hijri_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_date_picker_dialog_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/res/layout-sw600dp/hdp_mdtp_hijri_date_picker_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/res/layout/hdp_mdtp_hijri_date_picker_dialog_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /library/src/main/java/net/alhazmy13/hijridatepicker/TypefaceHelper.java: -------------------------------------------------------------------------------- 1 | package net.alhazmy13.hijridatepicker; 2 | 3 | 4 | import android.content.Context; 5 | import android.graphics.Typeface; 6 | 7 | import androidx.collection.SimpleArrayMap; 8 | 9 | /* 10 | Each call to Typeface.createFromAsset will load a new instance of the typeface into memory, 11 | and this memory is not consistently get garbage collected 12 | http://code.google.com/p/android/issues/detail?id=9904 13 | (It states released but even on Lollipop you can see the typefaces accumulate even after 14 | multiple GC passes) 15 | You can detect this by running: 16 | adb shell dumpsys meminfo com.your.packagenage 17 | You will see output like: 18 | Asset Allocations 19 | zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K 20 | zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K 21 | zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K 22 | zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Regular.ttf: 123K 23 | zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K 24 | */ 25 | public class TypefaceHelper { 26 | 27 | private static final SimpleArrayMap cache = new SimpleArrayMap<>(); 28 | 29 | public static Typeface get(Context c, String name) { 30 | synchronized (cache) { 31 | if (!cache.containsKey(name)) { 32 | Typeface t = Typeface.createFromAsset( 33 | c.getAssets(), String.format("fonts/%s.ttf", name)); 34 | cache.put(name, t); 35 | return t; 36 | } 37 | return cache.get(name); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/src/main/res/layout-land/hdp_mdtp_date_picker_dialog_v2.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /library/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | false 19 | 20 | 24 | 25 | 29 | 30 | 36 | 37 |