├── .gitignore ├── .idea ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── shagi │ │ └── materialdatepicker │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── shagi │ │ │ └── example │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── font │ │ ├── harmonia.xml │ │ ├── harmonia_sans_light.otf │ │ ├── harmonia_sans_procyr_black.otf │ │ ├── harmonia_sans_procyr_semibd.OTF │ │ └── harmonia_sans_regular.otf │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-v16 │ │ └── styles.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── shagi │ └── materialdatepicker │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── shagi │ │ └── materialdatepicker │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ └── fonts │ │ │ └── Roboto-Medium.ttf │ ├── java │ │ └── com │ │ │ └── shagi │ │ │ └── materialdatepicker │ │ │ ├── GravitySnapHelper.java │ │ │ ├── HapticFeedbackController.java │ │ │ ├── TypefaceHelper.java │ │ │ ├── Utils.java │ │ │ ├── VerticalTextView.java │ │ │ └── date │ │ │ ├── AccessibleDateAnimator.java │ │ │ ├── DatePickerController.java │ │ │ ├── DatePickerFragmentDialog.java │ │ │ ├── DateRangeLimiter.java │ │ │ ├── DayPickerView.java │ │ │ ├── DefaultDateRangeLimiter.java │ │ │ ├── MonthAdapter.java │ │ │ ├── MonthView.java │ │ │ ├── SimpleDayPickerView.java │ │ │ ├── SimpleMonthAdapter.java │ │ │ ├── SimpleMonthView.java │ │ │ └── YearPickerView.java │ └── res │ │ ├── color │ │ ├── amdp_date_picker_selector.xml │ │ ├── amdp_date_picker_year_selector.xml │ │ ├── amdp_done_text_color.xml │ │ └── amdp_done_text_color_dark.xml │ │ ├── drawable-hdpi │ │ └── amdp_arrow_down.png │ │ ├── drawable-land │ │ ├── amdp_done_background_color.xml │ │ └── amdp_done_background_color_dark.xml │ │ ├── drawable-mdpi │ │ └── amdp_arrow_down.png │ │ ├── drawable-v21 │ │ ├── amdp_material_button_background.xml │ │ └── amdp_material_button_selected.xml │ │ ├── drawable-xhdpi │ │ └── amdp_arrow_down.png │ │ ├── drawable-xxhdpi │ │ └── amdp_arrow_down.png │ │ ├── drawable-xxxhdpi │ │ └── amdp_arrow_down.png │ │ ├── drawable │ │ ├── amdp_border_black_outline_white_back.xml │ │ ├── amdp_done_background_color.xml │ │ ├── amdp_done_background_color_dark.xml │ │ ├── amdp_material_button_background.xml │ │ └── amdp_material_button_selected.xml │ │ ├── layout-land │ │ └── amdp_date_picker_dialog.xml │ │ ├── layout-sw600dp-land │ │ └── amdp_date_picker_dialog.xml │ │ ├── layout-sw600dp │ │ └── amdp_date_picker_dialog.xml │ │ ├── layout-w270dp-h560dp │ │ └── amdp_date_picker_dialog.xml │ │ ├── layout │ │ ├── amdp_date_picker_dialog.xml │ │ ├── amdp_date_picker_header_view.xml │ │ ├── amdp_date_picker_selected_date.xml │ │ ├── amdp_date_picker_view_animator.xml │ │ ├── amdp_done_button.xml │ │ └── amdp_year_label_text_view.xml │ │ ├── values-af │ │ └── strings.xml │ │ ├── values-am │ │ └── strings.xml │ │ ├── values-ar │ │ └── strings.xml │ │ ├── values-bg │ │ └── strings.xml │ │ ├── values-bn-rBD │ │ └── strings.xml │ │ ├── values-ca │ │ └── strings.xml │ │ ├── values-cs │ │ └── strings.xml │ │ ├── values-da │ │ └── strings.xml │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-el │ │ └── strings.xml │ │ ├── values-en-rGB │ │ └── strings.xml │ │ ├── values-en-rIN │ │ └── strings.xml │ │ ├── values-es-rUS │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-et-rEE │ │ └── strings.xml │ │ ├── values-eu-rES │ │ └── strings.xml │ │ ├── values-fa │ │ └── strings.xml │ │ ├── values-fi │ │ └── strings.xml │ │ ├── values-fr-rCA │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-gl-rES │ │ └── strings.xml │ │ ├── values-h330dp │ │ └── dimens.xml │ │ ├── values-hi │ │ └── strings.xml │ │ ├── values-hr │ │ └── strings.xml │ │ ├── values-hu │ │ └── strings.xml │ │ ├── values-hy-rAM │ │ └── strings.xml │ │ ├── values-in │ │ └── strings.xml │ │ ├── values-is-rIS │ │ └── strings.xml │ │ ├── values-it │ │ └── strings.xml │ │ ├── values-iw │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-ka-rGE │ │ └── strings.xml │ │ ├── values-kk-rKZ │ │ └── strings.xml │ │ ├── values-km-rKH │ │ └── strings.xml │ │ ├── values-kn-rIN │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ ├── values-ky-rKG │ │ └── strings.xml │ │ ├── values-land │ │ └── dimens.xml │ │ ├── values-lo-rLA │ │ └── strings.xml │ │ ├── values-lt │ │ └── strings.xml │ │ ├── values-lv │ │ └── strings.xml │ │ ├── values-mk-rMK │ │ └── strings.xml │ │ ├── values-ml-rIN │ │ └── strings.xml │ │ ├── values-mn-rMN │ │ └── strings.xml │ │ ├── values-mr-rIN │ │ └── strings.xml │ │ ├── values-ms-rMY │ │ └── strings.xml │ │ ├── values-my-rMM │ │ └── strings.xml │ │ ├── values-nb │ │ └── strings.xml │ │ ├── values-ne-rNP │ │ └── strings.xml │ │ ├── values-nl │ │ └── strings.xml │ │ ├── values-pl │ │ └── strings.xml │ │ ├── values-pt-rPT │ │ └── strings.xml │ │ ├── values-pt │ │ └── strings.xml │ │ ├── values-ro │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-si-rLK │ │ └── strings.xml │ │ ├── values-sk │ │ └── strings.xml │ │ ├── values-sl │ │ └── strings.xml │ │ ├── values-sr │ │ └── strings.xml │ │ ├── values-sv │ │ └── strings.xml │ │ ├── values-sw │ │ └── strings.xml │ │ ├── values-sw600dp-land │ │ └── dimens.xml │ │ ├── values-sw600dp │ │ └── dimens.xml │ │ ├── values-ta-rIN │ │ └── strings.xml │ │ ├── values-te-rIN │ │ └── strings.xml │ │ ├── values-th │ │ └── strings.xml │ │ ├── values-tl │ │ └── strings.xml │ │ ├── values-tr │ │ └── strings.xml │ │ ├── values-uk │ │ └── strings.xml │ │ ├── values-ur-rPK │ │ └── strings.xml │ │ ├── values-uz-rUZ │ │ └── strings.xml │ │ ├── values-v16 │ │ ├── strings.xml │ │ └── styles.xml │ │ ├── values-vi │ │ └── strings.xml │ │ ├── values-w270dp-h560dp │ │ └── dimens.xml │ │ ├── values-w560dp-land │ │ └── dimens.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rHK │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ ├── values-zu │ │ └── strings.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── shagi │ └── materialdatepicker │ └── ExampleUnitTest.java ├── screenshot_1.png ├── screenshot_2.png ├── screenshot_3.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/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 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/ 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | # External native build folder generated in Android Studio 2.2 and later 43 | .externalNativeBuild 44 | 45 | # Google Services (e.g. APIs or Firebase) 46 | google-services.json 47 | 48 | # Freeline 49 | freeline.py 50 | freeline/ 51 | freeline_project_description.json -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AlmostMaterialDatepicker 2 | 3 | Date picker made in material design style with some additional spinner for more convenient use. 4 | 5 | ![screenshot](screenshot_1.png) ![screenshot](screenshot_2.png) ![screenshot](screenshot_3.png) 6 | 7 | # Install 8 | To add this library to your project, you must add the JitPack repo to your root build.gradle file... 9 | 10 | ```groovy 11 | allprojects { 12 | repositories { 13 | ... 14 | jcenter() 15 | } 16 | } 17 | ``` 18 | 19 | Then include this in your dependencies block 20 | 21 | ``` 22 | implementation('com.shagi:material-datepicker:1.3') { 23 | exclude group: 'com.android.support' 24 | } 25 | ``` 26 | 27 | # Usage 28 | 29 | ```kotlin 30 | val dialog = DatePickerFragmentDialog.newInstance({ view, year, monthOfYear, dayOfMonth -> 31 | Toast.makeText(applicationContext, 32 | "year $year month $monthOfYear day $dayOfMonth", 33 | Toast.LENGTH_SHORT).show() 34 | }, 2017, 11, 4) 35 | 36 | dialog.show(supportFragmentManager, "tag") 37 | 38 | /* Possible params 39 | dialog.setMaxDate(System.currentTimeMillis()) 40 | dialog.setMinDate(System.currentTimeMillis()) 41 | dialog.setYearRange(2000, 2010) 42 | dialog.setCancelColor(Color.MAGENTA) 43 | dialog.setOkColor(Color.MAGENTA) 44 | dialog.setAccentColor(Color.MAGENTA) 45 | dialog.setCancelText("Out") 46 | dialog.setOkText("Fine") 47 | */ 48 | ``` 49 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/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 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/ 38 | 39 | # Keystore files 40 | *.jks 41 | 42 | # External native build folder generated in Android Studio 2.2 and later 43 | .externalNativeBuild 44 | 45 | # Google Services (e.g. APIs or Firebase) 46 | google-services.json 47 | 48 | # Freeline 49 | freeline.py 50 | freeline/ 51 | freeline_project_description.json -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 27 9 | defaultConfig { 10 | applicationId "com.shagi.materialdatepicker" 11 | minSdkVersion 14 12 | targetSdkVersion 27 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 28 | implementation 'com.android.support:appcompat-v7:27.0.2' 29 | 30 | 31 | implementation project(":library") 32 | 33 | testImplementation 'junit:junit:4.12' 34 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 35 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 36 | } 37 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/shagi/materialdatepicker/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.shagi.materialdatepicker 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.shagi.materialdatepicker", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/shagi/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.shagi.example 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import android.widget.Toast 6 | import com.shagi.materialdatepicker.date.DatePickerFragmentDialog 7 | import kotlinx.android.synthetic.main.activity_main.* 8 | import java.text.SimpleDateFormat 9 | import java.util.* 10 | 11 | class MainActivity : AppCompatActivity() { 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContentView(R.layout.activity_main) 16 | 17 | button.setOnClickListener { 18 | val dialog = DatePickerFragmentDialog.newInstance({ view, year, monthOfYear, dayOfMonth -> 19 | val calendar = Calendar.getInstance() 20 | calendar.set(year, monthOfYear, dayOfMonth) 21 | 22 | val simpleDateFormat = SimpleDateFormat("yyyy-MMM-dd", Locale.getDefault()) 23 | 24 | Toast.makeText(applicationContext, simpleDateFormat.format(calendar.time), Toast.LENGTH_SHORT).show() 25 | }, 2017, 11, 4) 26 | dialog.show(supportFragmentManager, "tag") 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/font/harmonia.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/font/harmonia_sans_light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shagiz/AlmostMaterialDatepicker/5d2bf80e4743804f88fa3bb57873764c58fff7e9/app/src/main/res/font/harmonia_sans_light.otf -------------------------------------------------------------------------------- /app/src/main/res/font/harmonia_sans_procyr_black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shagiz/AlmostMaterialDatepicker/5d2bf80e4743804f88fa3bb57873764c58fff7e9/app/src/main/res/font/harmonia_sans_procyr_black.otf -------------------------------------------------------------------------------- /app/src/main/res/font/harmonia_sans_procyr_semibd.OTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shagiz/AlmostMaterialDatepicker/5d2bf80e4743804f88fa3bb57873764c58fff7e9/app/src/main/res/font/harmonia_sans_procyr_semibd.OTF -------------------------------------------------------------------------------- /app/src/main/res/font/harmonia_sans_regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shagiz/AlmostMaterialDatepicker/5d2bf80e4743804f88fa3bb57873764c58fff7e9/app/src/main/res/font/harmonia_sans_regular.otf -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |