├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── dictionaries
│ └── Adil.xml
├── encodings.xml
├── gradle.xml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── markdown-navigator.xml
├── markdown-navigator
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── MaterialPickerDialog
├── bintray.gradle
├── build.gradle
├── install.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── adil
│ │ └── dev
│ │ └── lib
│ │ └── materialnumberpicker
│ │ ├── adapter
│ │ ├── GenderAdapter.java
│ │ └── NumberPickerAdapter.java
│ │ ├── dialog
│ │ ├── GenderPickerDialog.java
│ │ └── NumberPickerDialog.java
│ │ └── model
│ │ ├── GenderModel.java
│ │ └── IntervalModel.java
│ └── res
│ ├── drawable
│ ├── ic_round_shape_selected.xml
│ └── ic_round_shape_unselected.xml
│ ├── layout
│ ├── gender_picker_dialog.xml
│ ├── interval_picker_dialog.xml
│ └── picker_item.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ └── strings.xml
├── README.md
├── app
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── adil
│ │ └── dev
│ │ └── lib
│ │ └── material_number_picker
│ │ └── MainActivity.java
│ └── res
│ ├── layout
│ └── activity_main.xml
│ ├── 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-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenshot_1.png
├── screenshot_2.png
└── settings.gradle
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/dictionaries/Adil.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
18 |
19 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | Abstraction issuesJava
39 |
40 |
41 | Android > Lint > Correctness
42 |
43 |
44 | Android > Lint > Internationalization > Bidirectional Text
45 |
46 |
47 | Android > Lint > Performance
48 |
49 |
50 | Android > Lint > Security
51 |
52 |
53 | Android > Lint > Usability
54 |
55 |
56 | Android Lint for Kotlin
57 |
58 |
59 | Assignment issuesGroovy
60 |
61 |
62 | Assignment issuesJava
63 |
64 |
65 | Class structureJava
66 |
67 |
68 | Cloning issuesJava
69 |
70 |
71 | Code style issuesJava
72 |
73 |
74 | Concurrency annotation issuesJava
75 |
76 |
77 | Control FlowGroovy
78 |
79 |
80 | Control flow issuesJava
81 |
82 |
83 | Declaration redundancyJava
84 |
85 |
86 | Dependency issuesJava
87 |
88 |
89 | Encapsulation issuesJava
90 |
91 |
92 | Error handlingGroovy
93 |
94 |
95 | Error handlingJava
96 |
97 |
98 | General
99 |
100 |
101 | Groovy
102 |
103 |
104 | Inheritance issuesJava
105 |
106 |
107 | Initialization issuesJava
108 |
109 |
110 | Internationalization issuesJava
111 |
112 |
113 | JUnit issuesJava
114 |
115 |
116 | Java
117 |
118 |
119 | Memory issuesJava
120 |
121 |
122 | Method MetricsGroovy
123 |
124 |
125 | Naming ConventionsGroovy
126 |
127 |
128 | Naming conventionsJava
129 |
130 |
131 | Numeric issuesJava
132 |
133 |
134 | Pattern Validation
135 |
136 |
137 | Performance issuesJava
138 |
139 |
140 | Potentially confusing code constructsGroovy
141 |
142 |
143 | Probable bugsGroovy
144 |
145 |
146 | Probable bugsJava
147 |
148 |
149 | Resource management issuesJava
150 |
151 |
152 | Security issuesJava
153 |
154 |
155 | Serialization issuesJava
156 |
157 |
158 | TestNGJava
159 |
160 |
161 | Threading issuesGroovy
162 |
163 |
164 | Threading issuesJava
165 |
166 |
167 | Visibility issuesJava
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | 1.8
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/bintray.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.jfrog.bintray'
2 |
3 | version = '0.0.1'
4 |
5 | if (project.hasProperty("android")) { // Android libraries
6 | task sourcesJar(type: Jar) {
7 | classifier = 'sources'
8 | from android.sourceSets.main.java.srcDirs
9 | }
10 |
11 | task javadoc(type: Javadoc) {
12 | source = android.sourceSets.main.java.srcDirs
13 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
14 | }
15 | } else { // Java libraries
16 | task sourcesJar(type: Jar, dependsOn: classes) {
17 | classifier = 'sources'
18 | from sourceSets.main.allSource
19 | }
20 | }
21 |
22 | task javadocJar(type: Jar, dependsOn: javadoc) {
23 | classifier = 'javadoc'
24 | from javadoc.destinationDir
25 | }
26 |
27 | artifacts {
28 | archives javadocJar
29 | archives sourcesJar
30 | }
31 |
32 | // Bintray
33 | Properties properties = new Properties()
34 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
35 |
36 | bintray {
37 | user = properties.getProperty("bintray.user")
38 | key = properties.getProperty("bintray.apikey")
39 |
40 | configurations = ['archives']
41 | pkg {
42 | repo = 'maven'
43 | name = 'AndroidMaterialPickerDialog'
44 | desc = 'Simple Material Picker Dialog Library which offer developers different kind of material dialogs like, gender picker, number picker.'
45 | websiteUrl = 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog'
46 | issueTrackerUrl = websiteUrl+'/issues'
47 | vcsUrl = 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog.git'
48 | licenses = ["Apache-2.0"]
49 | githubRepo = 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog' //Optional Github repository
50 | githubReleaseNotesFile = 'README.md' //Optional Github readme file
51 | publish = true
52 | publicDownloadNumbers = true
53 | version {
54 | desc = 'Simple Material Picker Dialog Library which offer developers different kind of material dialogs like, gender picker, number picker.'
55 | gpg {
56 | sign = true //Determines whether to GPG sign the files. The default is false
57 | passphrase = properties.getProperty("bintray.gpg.password")
58 | //Optional. The passphrase for GPG signing'
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 | apply plugin: "com.jfrog.bintray"
4 |
5 | // This is the library version used when deploying the artifact
6 | version = "1.0.3"
7 | //./gradlew bintrayUpload
8 | android {
9 | compileSdkVersion 25
10 | buildToolsVersion "25.0.2"
11 |
12 | defaultConfig {
13 | minSdkVersion 14
14 | targetSdkVersion 25
15 | versionCode 1
16 | versionName "1.0"
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | compile fileTree(dir: 'libs', include: ['*.jar'])
28 | compile 'com.android.support:appcompat-v7:25.1.1'
29 | compile 'com.android.support:design:25.1.1'
30 | compile 'com.android.support:cardview-v7:25.1.1'
31 | compile 'com.android.support:recyclerview-v7:25.1.1'
32 |
33 | }
34 |
35 | def siteUrl = 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog' // Homepage URL of the library
36 | def gitUrl = 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog.git' // Git repository URL
37 | group = "com.github.ch-muhammad-adil"
38 |
39 | install {
40 | repositories.mavenInstaller {
41 | // This generates POM.xml with proper parameters
42 | pom {
43 | project {
44 | packaging 'aar'
45 |
46 | // Add your description here
47 | name 'com.github.ch-muhammad-adil:mpd'
48 | description = 'Simple Material Picker Dialog Library which offer developers different kind of material dialogs like, gender picker, number picker.'
49 | url siteUrl
50 |
51 | // Set your license
52 | licenses {
53 | license {
54 | name 'The Apache Software License, Version 2.0'
55 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
56 | }
57 | }
58 | developers {
59 | developer {
60 | id 'ch-muhammad-adil'
61 | name 'Muhammad Adil'
62 | email 'chmuhammadadil7@gmail.com'
63 | }
64 | }
65 | scm {
66 | connection gitUrl
67 | developerConnection gitUrl
68 | url siteUrl
69 | }
70 | }
71 | }
72 | }
73 | }
74 |
75 | task sourcesJar(type: Jar) {
76 | from android.sourceSets.main.java.srcDirs
77 | classifier = 'sources'
78 | }
79 |
80 | task javadoc(type: Javadoc) {
81 | source = android.sourceSets.main.java.srcDirs
82 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
83 | }
84 |
85 | task javadocJar(type: Jar, dependsOn: javadoc) {
86 | classifier = 'javadoc'
87 | from javadoc.destinationDir
88 | }
89 | artifacts {
90 | archives javadocJar
91 | archives sourcesJar
92 | }
93 |
94 | Properties properties = new Properties()
95 | properties.load(project.rootProject.file('local.properties').newDataInputStream())
96 |
97 | // https://github.com/bintray/gradle-bintray-plugin
98 | bintray {
99 | user = properties.getProperty("bintray.user")
100 | key = properties.getProperty("bintray.apikey")
101 |
102 | configurations = ['archives']
103 | pkg {
104 | repo = "maven"
105 | // it is the name that appears in bintray when logged
106 | name = "MaterialPickerDialog"
107 | websiteUrl = siteUrl
108 | vcsUrl = gitUrl
109 | licenses = ["Apache-2.0"]
110 |
111 | publish = true
112 | version {
113 | gpg {
114 | sign = true //Determines whether to GPG sign the files. The default is false
115 | passphrase = properties.getProperty("bintray.gpg.password") //Optional. The passphrase for GPG signing'
116 | }
117 | }
118 | }
119 | }
120 |
121 |
122 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/install.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.github.dcendents.android-maven'
2 |
3 | group = 'com.github.ch-muhammad-adil'
4 |
5 | install {
6 | repositories.mavenInstaller {
7 | pom {
8 | project {
9 | packaging 'aar'
10 | groupId 'com.github.ch-muhammad-adil'
11 | artifactId 'MPD'
12 |
13 | name 'MaterialPickerDialog'
14 | description 'Simple Material Picker Dialog Library which offer developers different kind of material dialogs like, gender picker, number picker.'
15 | url 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog'
16 |
17 | licenses {
18 | license {
19 | name 'The Apache Software License, Version 2.0'
20 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
21 | }
22 | }
23 | developers {
24 | developer {
25 | id 'ch-muhammad-adil'
26 | name 'Muhammad Adil'
27 | email 'chmuhammadadil7@gmail.com'
28 | }
29 | }
30 | scm {
31 | connection 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog.git'
32 | developerConnection 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog.git'
33 | url 'https://github.com/ch-muhammad-adil/Android-Material-Picker-Dialog'
34 |
35 | }
36 | }
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/MaterialPickerDialog/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 /Users/Adil/Library/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 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/java/adil/dev/lib/materialnumberpicker/adapter/GenderAdapter.java:
--------------------------------------------------------------------------------
1 | package adil.dev.lib.materialnumberpicker.adapter;
2 |
3 | import android.content.Context;
4 | import android.os.Vibrator;
5 | import android.support.v4.content.ContextCompat;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.FrameLayout;
11 | import android.widget.TextView;
12 |
13 | import java.util.ArrayList;
14 |
15 | import adil.dev.lib.materialnumberpicker.R;
16 | import adil.dev.lib.materialnumberpicker.model.GenderModel;
17 |
18 |
19 | /**
20 | * Created by Adil on 08/01/2016.
21 | */
22 | public class GenderAdapter extends RecyclerView.Adapter {
23 |
24 | Context mContext;
25 | LayoutInflater inflater;
26 | ArrayList dataList = new ArrayList<>();
27 | ItemClickCallBack itemClickCallBack;
28 |
29 | public GenderAdapter(Context context) {
30 | this.mContext = context;
31 | inflater = LayoutInflater.from(context);
32 | initList();
33 | }
34 |
35 | public void setOnItemClickCallBack(ItemClickCallBack onItemClickCallBack) {
36 | this.itemClickCallBack = onItemClickCallBack;
37 | }
38 |
39 | @Override
40 | public DialogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
41 | return new DialogViewHolder(inflater.inflate(R.layout.picker_item, parent, false));
42 | }
43 |
44 | @Override
45 | public void onBindViewHolder(DialogViewHolder holder, int position) {
46 | holder.number.setText(dataList.get(position).getGender());
47 | if (dataList.get(position).isHasFocus()) {
48 | holder.number.setBackgroundResource(R.drawable.ic_round_shape_selected);
49 | holder.number.setTextColor(ContextCompat.getColor(mContext,R.color.MPD_pickerItemTextColorSelected));
50 | } else {
51 | holder.number.setBackgroundResource(R.drawable.ic_round_shape_unselected);
52 | holder.number.setTextColor(ContextCompat.getColor(mContext,R.color.MPD_pickerItemTextColorUnSelected));
53 | }
54 | }
55 |
56 | private void initList() {
57 |
58 | dataList.add(new GenderModel(mContext.getString(R.string.MPD_male), true));
59 | dataList.add(new GenderModel(mContext.getString(R.string.MPD_female), false));
60 |
61 | }
62 |
63 | @Override
64 | public int getItemCount() {
65 | return dataList.size();
66 | }
67 |
68 | int focusedItem = 0;
69 |
70 | class DialogViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
71 | TextView number;
72 | FrameLayout itemParent;
73 |
74 |
75 | public DialogViewHolder(View itemView) {
76 | super(itemView);
77 | number = (TextView) itemView.findViewById(R.id.text_number);
78 | itemParent = (FrameLayout) itemView.findViewById(R.id.item_parent);
79 | itemParent.setOnClickListener(this);
80 |
81 | }
82 |
83 |
84 | @Override
85 | public void onClick(View v) {
86 | Vibrator vb = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
87 | vb.vibrate(30);
88 | if (v.getId() == R.id.item_parent) {
89 | if (focusedItem <= -1) {
90 | focusedItem = getLayoutPosition();
91 | dataList.get(getLayoutPosition()).setHasFocus(true);
92 | notifyItemChanged(getLayoutPosition());
93 | } else {
94 | dataList.get(focusedItem).setHasFocus(false);
95 | notifyItemChanged(focusedItem);
96 | focusedItem = getLayoutPosition();
97 | dataList.get(getLayoutPosition()).setHasFocus(true);
98 | notifyItemChanged(getLayoutPosition());
99 | }
100 | itemClickCallBack.onItemClicked(dataList.get(getLayoutPosition()).getGender());
101 | }
102 | }
103 | }
104 |
105 | public interface ItemClickCallBack {
106 | public void onItemClicked(String gender);
107 | }
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/java/adil/dev/lib/materialnumberpicker/adapter/NumberPickerAdapter.java:
--------------------------------------------------------------------------------
1 | package adil.dev.lib.materialnumberpicker.adapter;
2 |
3 | import android.content.Context;
4 | import android.os.Vibrator;
5 | import android.support.v4.content.ContextCompat;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.FrameLayout;
11 | import android.widget.TextView;
12 |
13 | import java.util.ArrayList;
14 |
15 | import adil.dev.lib.materialnumberpicker.R;
16 | import adil.dev.lib.materialnumberpicker.model.IntervalModel;
17 |
18 |
19 | /**
20 | * Created by Adil on 26/11/2015.
21 | */
22 | public class NumberPickerAdapter extends RecyclerView.Adapter {
23 |
24 | Context mContext;
25 | LayoutInflater inflater;
26 | ArrayList dataList = new ArrayList<>();
27 | ItemClickCallBack itemClickCallBack;
28 | ValueAvailableListener valueAvailableListener;
29 | NumberPickerAdapter instance;
30 |
31 | public NumberPickerAdapter(Context context, ItemClickCallBack itemClickCallBack,ValueAvailableListener valueAvailableListener, int start, int last) {
32 | this.mContext = context;
33 | inflater = LayoutInflater.from(context);
34 | this.itemClickCallBack = itemClickCallBack;
35 | this.valueAvailableListener=valueAvailableListener;
36 | initList(start,last);
37 | instance = this;
38 | }
39 |
40 | @Override
41 | public DialogViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
42 | return new DialogViewHolder(inflater.inflate(R.layout.picker_item, parent, false));
43 | }
44 |
45 | public void findForItemToShow(int value){
46 | int position=-1;
47 | for(int i=0;ilast){
38 | throw new IllegalStateException("Start value must be smaller than last value");
39 | }
40 | this.callBack = callBack;
41 | this.mContext = context;
42 | this.selectNumber = start;
43 | this.start = start;
44 | this.last = last;
45 | }
46 |
47 | public static NumberPickerDialog getInstance() {
48 | return instance;
49 | }
50 |
51 | @Override
52 | protected void onCreate(Bundle savedInstanceState) {
53 | super.onCreate(savedInstanceState);
54 | requestWindowFeature(Window.FEATURE_NO_TITLE);
55 | setContentView(R.layout.interval_picker_dialog);
56 | getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
57 | instance = this;
58 | initViews();
59 | initValues();
60 | initValuesInViews();
61 | setOnClickListener();
62 | }
63 |
64 | RecyclerView recyclerView;
65 | TextView okView, cancelView;
66 | EditText selectedTextView;
67 |
68 | private void initViews() {
69 | recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
70 | okView = (TextView) findViewById(R.id.ok);
71 | cancelView = (TextView) findViewById(R.id.cancel);
72 | selectedTextView = (EditText) findViewById(R.id.dialog_selected_value);
73 | }
74 |
75 | private void initValues() {
76 |
77 | }
78 |
79 | LinearLayoutManager linearLayoutManager;
80 |
81 | private void initValuesInViews() {
82 | linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
83 | recyclerView.setLayoutManager(linearLayoutManager);
84 | recyclerView.setItemAnimator(new DefaultItemAnimator());
85 | if (last - start <= -1)
86 | recyclerView.setItemViewCacheSize(100000);
87 | else
88 | recyclerView.setItemViewCacheSize(last - start);
89 | selectedTextView.setText(String.valueOf(start));
90 | selectNumber = start;
91 |
92 | SnapHelper snapHelper = new LinearSnapHelper();
93 | snapHelper.attachToRecyclerView(recyclerView);
94 |
95 | recyclerView.setAdapter(new NumberPickerAdapter(mContext, this, this, start, last));
96 | }
97 |
98 | private void setOnClickListener() {
99 |
100 |
101 | selectedTextView.addTextChangedListener(new TextWatcher() {
102 | @Override
103 | public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
104 |
105 | }
106 |
107 | @Override
108 | public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
109 | Vibrator vb = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
110 | try {
111 | int value = Integer.parseInt(charSequence.toString());
112 |
113 | if (value >= start && value <= last) {
114 | ((NumberPickerAdapter) recyclerView.getAdapter()).findForItemToShow(value);
115 | } else if (value < start) {
116 | selectNumber = value;
117 | // selectedTextView.setError("value can not be lower than " + start);
118 | vb.vibrate(50);
119 | } else if (value > last) {
120 | selectNumber = value;
121 | // selectedTextView.setError("value can not be higher than " + last);
122 | vb.vibrate(50);
123 | }
124 | } catch (NumberFormatException e) {
125 | selectedTextView.setError(mContext.getString(R.string.MPD_empty_message));
126 | }
127 | }
128 |
129 | @Override
130 | public void afterTextChanged(Editable editable) {
131 |
132 | }
133 | });
134 |
135 | cancelView.setOnClickListener(new View.OnClickListener() {
136 | @Override
137 | public void onClick(View v) {
138 | dismiss();
139 | }
140 | });
141 | okView.setOnClickListener(new View.OnClickListener() {
142 | @Override
143 | public void onClick(View v) {
144 | if (selectedTextView.getText().toString().isEmpty()||selectedTextView.getText().toString().equals("-")) {
145 | selectedTextView.setError(mContext.getString(R.string.MPD_empty_message));
146 | } else if (selectNumber < start || selectNumber > last) {
147 | selectedTextView.setError(mContext.getString(R.string.MPD_incorrect_message));
148 | } else {
149 | callBack.onSelectingValue(selectNumber);
150 | dismiss();
151 | }
152 | }
153 | });
154 | }
155 |
156 | @Override
157 | public void onItemClicked(int selectedNumber, int position) {
158 | this.selectNumber = selectedNumber;
159 | selectedTextView.setText(String.valueOf(selectedNumber));
160 | selectedTextView.setError(null);
161 | linearLayoutManager.scrollToPositionWithOffset(position, 0);
162 | }
163 |
164 | @Override
165 | public void onValueAvailable(int value, int position) {
166 | this.selectNumber = value;
167 | linearLayoutManager.scrollToPositionWithOffset(position, 0);
168 | }
169 |
170 | public interface NumberPickerCallBack {
171 | public void onSelectingValue(int value);
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/java/adil/dev/lib/materialnumberpicker/model/GenderModel.java:
--------------------------------------------------------------------------------
1 | package adil.dev.lib.materialnumberpicker.model;
2 |
3 | /**
4 | * Created by Adil on 08/01/2016.
5 | */
6 | public class GenderModel {
7 | String gender;
8 | boolean hasFocus;
9 |
10 | public GenderModel(String gender, boolean hasFocus) {
11 | this.gender = gender;
12 | this.hasFocus = hasFocus;
13 | }
14 |
15 | public String getGender() {
16 | return gender;
17 | }
18 |
19 | public void setGender(String gender) {
20 | this.gender = gender;
21 | }
22 |
23 | public boolean isHasFocus() {
24 | return hasFocus;
25 | }
26 |
27 | public void setHasFocus(boolean hasFocus) {
28 | this.hasFocus = hasFocus;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/java/adil/dev/lib/materialnumberpicker/model/IntervalModel.java:
--------------------------------------------------------------------------------
1 | package adil.dev.lib.materialnumberpicker.model;
2 |
3 | /**
4 | * Created by Adil on 03/12/2015.
5 | */
6 | public class IntervalModel {
7 | int value;
8 | boolean hasFocus;
9 |
10 | public IntervalModel(int value, boolean hasFocus) {
11 | this.value = value;
12 | this.hasFocus = hasFocus;
13 | }
14 |
15 | public int getValue() {
16 | return value;
17 | }
18 |
19 | public void setValue(int value) {
20 | this.value = value;
21 | }
22 |
23 | public boolean isHasFocus() {
24 | return hasFocus;
25 | }
26 |
27 | public void setHasFocus(boolean hasFocus) {
28 | this.hasFocus = hasFocus;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/drawable/ic_round_shape_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
10 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/drawable/ic_round_shape_unselected.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
7 |
10 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/layout/gender_picker_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
27 |
28 |
38 |
39 |
40 |
41 |
47 |
48 |
55 |
56 |
57 |
62 |
63 |
72 |
73 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/layout/interval_picker_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
27 |
28 |
44 |
45 |
46 |
47 |
53 |
54 |
63 |
64 |
65 |
70 |
71 |
80 |
81 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/layout/picker_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
22 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #C5CAE9
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 | #33FF4081
8 |
9 |
10 | #3F51B5
11 | #C5CAE9
12 | #FFF
13 | #FFF
14 | #00FFFFFF
15 | @color/MPD_primaryColor
16 | #444
17 | #ccffffff
18 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 80dp
4 | 80dp
5 | 80dp
6 | 5dp
7 |
--------------------------------------------------------------------------------
/MaterialPickerDialog/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MaterialNumberPicker
3 |
4 | done
5 | cancel
6 | Male
7 | Female
8 | value can not be empty
9 | please select correct value
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android Material Picker Dialog
2 | This Library provides a very simple implementation of some android material picker's dialogs which were not available as open source library.
3 | It includes android **Number/Interval picker** which can
4 | be used as **Year picker**, **Month picker** and **any time duration Picker**.
5 | It also includes **Material Gender Picker Dialog** which was much required.
6 |
7 | #Screenshots
8 | 
9 |
10 |
11 | ##Compile Library jCenter
12 | ```groovy
13 | dependencies {
14 | ....
15 | compile 'com.github.ch-muhammad-adil:MaterialPickerDialog:1.0.3'
16 | ....
17 | }
18 | ```
19 |
20 | ##Compile Library maven
21 |
22 | ```groovy
23 | dependencies {
24 | repositories {
25 | mavenCentral()
26 | }
27 | compile 'com.github.ch-muhammad-adil:MaterialPickerDialog:1.0.3'
28 | }
29 | ```
30 |
31 |
32 | ##Simple Code for Number Picker
33 |
34 | ```java
35 |
36 | ////Using NumberPicker as an interval
37 |
38 | NumberPickerDialog dialog=new NumberPickerDialog(MainActivity.this, -50, 50, new NumberPickerDialog.NumberPickerCallBack() {
39 | @Override
40 | public void onSelectingValue(int value) {
41 | Toast.makeText(MainActivity.this, "Selected "+String.valueOf(value), Toast.LENGTH_SHORT).show();
42 | }
43 | });
44 | dialog.show();
45 |
46 | ////Using number picker as year interval
47 |
48 | NumberPickerDialog dialog=new NumberPickerDialog(MainActivity.this, 1992, 2017, new NumberPickerDialog.NumberPickerCallBack() {
49 | @Override
50 | public void onSelectingValue(int value) {
51 | Toast.makeText(MainActivity.this, "Selected Year "+String.valueOf(value), Toast.LENGTH_SHORT).show();
52 | }
53 | });
54 | dialog.show();
55 |
56 | ```
57 |
58 |
59 | ##Simple Code for Gender Picker
60 |
61 | ```java
62 |
63 | ////Using gender picker
64 |
65 | GenderPickerDialog dialog=new GenderPickerDialog(MainActivity.this);
66 | dialog.setOnSelectingGender(new GenderPickerDialog.OnGenderSelectListener() {
67 | @Override
68 | public void onSelectingGender(String value) {
69 | Toast.makeText(MainActivity.this, "Selected "+value, Toast.LENGTH_SHORT).show();
70 | }
71 | });
72 | dialog.show();
73 |
74 | ```
75 | ##Do Add permissions for vibration in your menifest file.
76 |
77 | ```xml
78 |
79 | ```
80 |
81 | ##Color Attributes of Material Picker Dialog
82 |
83 | If you override these attributes in your _**colors.xml**_ file under _**res/values**_
84 | you can customize your **material picker dialog**
85 | ```xml
86 |
87 |
88 |
89 | @color/primaryColor
90 | #C5CAE9
91 | #FFF
92 | #00FFFFFF
93 | @color/MPD_primaryColor
94 | #444
95 | #bbffffff
96 | #FFF
97 |
98 |
99 | ```
100 |
101 |
102 | ##Localization Attributes
103 | You can update any text and message or you can add localization using these attributes. You just need to override these **string attributes** in your **_strings.xml_** file under **_res/values_**.
104 |
105 | ```xml
106 |
107 | done
108 | cancel
109 | Male
110 | Female
111 | value can not be empty
112 | please select correct value
113 |
114 | ```
115 |
116 | ##TODO
117 | * Number Picker Requires support for reverse ordering
118 | * Orientation change control is not handled yet in case if user changes orientation and dialog is open
119 | * Need to add horizontal movement of number picker items
120 |
121 | This is my first implementation of any open source library so your suggestions will be really helpful"
122 |
123 | ### Licence
124 |
125 | > Licensed under the Apache License, Version 2.0 (the "License");
126 | > you may not use this work except in compliance with the License.
127 | > You may obtain a copy of the License in the LICENSE file, or at:
128 | >
129 | > [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
130 | >
131 | > Unless required by applicable law or agreed to in writing, software
132 | > distributed under the License is distributed on an "AS IS" BASIS,
133 | > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134 | > See the License for the specific language governing permissions and
135 | > limitations under the License.
136 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.2"
6 | defaultConfig {
7 | applicationId "adil.dev.lib.material_number_picker"
8 | minSdkVersion 14
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:25.1.1'
25 | compile project(':MaterialPickerDialog')
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/app/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 /Users/Adil/Library/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 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/adil/dev/lib/material_number_picker/MainActivity.java:
--------------------------------------------------------------------------------
1 | package adil.dev.lib.material_number_picker;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.view.View;
6 | import android.widget.Toast;
7 |
8 | import adil.dev.lib.materialnumberpicker.dialog.GenderPickerDialog;
9 | import adil.dev.lib.materialnumberpicker.dialog.NumberPickerDialog;
10 |
11 | public class MainActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_main);
17 | findViewById(R.id.number_picker).setOnClickListener(new View.OnClickListener() {
18 | @Override
19 | public void onClick(View view) {
20 | NumberPickerDialog dialog=new NumberPickerDialog(MainActivity.this, -50, 50, new NumberPickerDialog.NumberPickerCallBack() {
21 | @Override
22 | public void onSelectingValue(int value) {
23 | Toast.makeText(MainActivity.this, "Selected "+String.valueOf(value), Toast.LENGTH_SHORT).show();
24 | }
25 | });
26 | dialog.show();
27 | }
28 | });
29 | findViewById(R.id.year_picker).setOnClickListener(new View.OnClickListener() {
30 | @Override
31 | public void onClick(View view) {
32 | NumberPickerDialog dialog=new NumberPickerDialog(MainActivity.this, 1992, 2017, new NumberPickerDialog.NumberPickerCallBack() {
33 | @Override
34 | public void onSelectingValue(int value) {
35 | Toast.makeText(MainActivity.this, "Selected Year "+String.valueOf(value), Toast.LENGTH_SHORT).show();
36 | }
37 | });
38 | dialog.show();
39 | }
40 | });
41 | findViewById(R.id.gender_picker).setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View view) {
44 | GenderPickerDialog dialog=new GenderPickerDialog(MainActivity.this);
45 | dialog.setOnSelectingGender(new GenderPickerDialog.OnGenderSelectListener() {
46 | @Override
47 | public void onSelectingGender(String value) {
48 | Toast.makeText(MainActivity.this, "Selected "+value, Toast.LENGTH_SHORT).show();
49 | }
50 | });
51 | dialog.show();
52 | }
53 | });
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
21 |
27 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #ffd640
6 |
7 |
8 |
9 |
10 |
11 | @color/primaryColor
12 | #C5CAE9
13 | #FFF
14 | #00FFFFFF
15 | @color/MPD_primaryColor
16 | #444
17 | #bbffffff
18 | #FFF
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Android Material Number Picker Dialog
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | // mavenCentral()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:2.2.3'
10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
11 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | // mavenCentral()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
26 | //apply plugin: 'com.jfrog.bintray'
27 | //apply plugin: 'com.github.dcendents.android-maven'
28 | //apply plugin: 'java'
29 |
--------------------------------------------------------------------------------
/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 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
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-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/screenshot_1.png
--------------------------------------------------------------------------------
/screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ch-muhammad-adil/Android-Material-Picker-Dialog/cf33c2b796a845f7406c5e94ea58685575374219/screenshot_2.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':MaterialPickerDialog'
2 |
--------------------------------------------------------------------------------