Commit 49c3d85
committed
Refactor: Improve Date Picker UI, Input Mode, and Accessibility
This commit introduces several enhancements to the PersianDatePicker library, focusing on UI improvements, a new date input mode, and better accessibility.
**Key Changes:**
- **Date Input Mode:**
- Added `PersianDateEnterSection` composable in `PersianDatePicker.kt` to allow users to input dates manually.
- Implemented `DateVisualTransformation.kt` to format the input as `YYYY/MM/DD`.
- Added input validation for date patterns and year ranges, displaying error messages.
- New string resources for date input labels, hints, and error messages added to `strings.xml`.
- **Calendar UI and UX Enhancements:**
- Renamed `PersianDatePickerCalender` to `PersianDatePickerCalendar`.
- Improved animations for month and day transitions.
- Updated `MonthGrid`:
- Displays weekday headers (`شنبه`, `یکشنبه`, etc.).
- `PersianDatePickerColors` now includes `weekdaysColor`.
- Better visual distinction for selected day, today's date, and current year in the year picker.
- Improved `YearPicker`:
- The dropdown now scrolls to the currently selected year when expanded.
- Enhanced visual styling for selected and current years.
- Added content descriptions for better accessibility in `PersianCalender.kt` for navigation buttons, day items, and year/month selection.
- **Color Customization:**
- Added `weekdaysColor` to `PersianDatePickerColors` and `PersianDatePickerDefaults` to allow customization of weekday label colors.
- **Code Structure and Refinements:**
- Constants like `DAYS_IN_WEEK`, `YEARS_IN_ROW`, `MAX_CALENDAR_ROWS` are now defined in `PersianCalender.kt`.
- Improved use of `remember` for better performance and to avoid unnecessary recompositions.
- General code cleanup and styling improvements.
- **Dependency and Version Updates:**
- Library version updated to `0.0.12-beta1` in `library/build.gradle.kts`.
These changes aim to provide a more flexible and user-friendly date picking experience, along with better adherence to accessibility standards.1 parent cd09225 commit 49c3d85
File tree
7 files changed
+402
-152
lines changed- library
- src/commonMain
- composeResources/values
- kotlin/io/github/faridsolgi
- domain/model
- util
- view
- internal
7 files changed
+402
-152
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
Lines changed: 94 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
11 | 9 | | |
12 | | - | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| 21 | + | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
39 | 57 | | |
| 58 | + | |
| 59 | + | |
40 | 60 | | |
41 | | - | |
| 61 | + | |
42 | 62 | | |
| 63 | + | |
| 64 | + | |
43 | 65 | | |
44 | 66 | | |
| 67 | + | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
| |||
63 | 86 | | |
64 | 87 | | |
65 | 88 | | |
66 | | - | |
67 | 89 | | |
68 | 90 | | |
69 | 91 | | |
| |||
93 | 115 | | |
94 | 116 | | |
95 | 117 | | |
96 | | - | |
97 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
98 | 121 | | |
99 | 122 | | |
100 | 123 | | |
101 | 124 | | |
102 | 125 | | |
103 | 126 | | |
104 | | - | |
| 127 | + | |
105 | 128 | | |
106 | 129 | | |
107 | 130 | | |
108 | | - | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
111 | 134 | | |
112 | 135 | | |
113 | 136 | | |
114 | 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 | + | |
115 | 200 | | |
116 | 201 | | |
117 | 202 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
0 commit comments