Commit cd09225
committed
Refactor: Improve Calendar UI, Navigation, and Introduce Year Picker
This commit introduces several enhancements to the PersianDatePicker library, focusing on UI improvements, navigation refinements, and the addition of a year picker functionality.
**Key Changes:**
- **UI Enhancements & Animations:**
- Implemented `AnimatedContent` for transitions when switching between `Picker` and `Input` display modes in `PersianDatePicker`.
- Added `AnimatedContent` for month day items in `MonthGrid` for smoother visual feedback.
- Introduced `AnimatedVisibility` for the new `YearPicker` dropdown.
- **Year Picker Implementation:**
- Added a new `YearPicker` composable in `io.github.faridsolgi.view.internal.PersianCalender.kt`.
- This allows users to select a year from a grid within a dropdown menu.
- The `YearPicker` is integrated into `NavigationMonthAndYearSelection`.
- Added `SelectionYearLabelTextFont` to `PersianDatePickerTokens` for styling the year picker.
- **Navigation and State:**
- The `NavigationMonthAndYearSelection` now receives `colors` to style the `YearPicker`.
- Updated `PersianDatePickerPreview` to initialize `rememberPersianDatePickerState` with a `yearRange`.
- **Code Organization & Styling:**
- Removed `ExposedDropdownMenuBox` and `ExposedDropdownMenu` from the previous year selection implementation.
- Replaced with a custom dropdown implementation using `Card` and `LazyVerticalGrid` for the `YearPicker`.
- Added constants `RecommendedSizeForAccessibility`, `MaxCalendarRows`, and `YearsInRow` for better layout management in `PersianCalender.kt`.
- Minor UI adjustments like adding spacers and using `ProvideTextStyle` for the year picker label.
- **Build Configuration:**
- Updated library version from `0.0.3` to `0.0.10` in `library/build.gradle.kts`.
These changes aim to provide a more interactive and user-friendly experience for selecting dates, particularly with the new year picking capability.1 parent ec21a23 commit cd09225
File tree
4 files changed
+105
-59
lines changed- library
- src/commonMain/kotlin/io/github/faridsolgi
- domain/model
- view
- internal
4 files changed
+105
-59
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: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
55 | | - | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 92 | | |
87 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
88 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
89 | 110 | | |
90 | | - | |
91 | | - | |
92 | 111 | | |
93 | | - | |
94 | 112 | | |
95 | 113 | | |
96 | 114 | | |
| |||
100 | 118 | | |
101 | 119 | | |
102 | 120 | | |
103 | | - | |
| 121 | + | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| |||
121 | 139 | | |
122 | 140 | | |
123 | 141 | | |
124 | | - | |
125 | | - | |
126 | 142 | | |
127 | 143 | | |
128 | 144 | | |
| |||
Lines changed: 72 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | | - | |
30 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| 40 | + | |
34 | 41 | | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| 96 | + | |
88 | 97 | | |
89 | 98 | | |
90 | 99 | | |
| |||
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
| |||
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
| 224 | + | |
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
219 | 230 | | |
220 | 231 | | |
221 | | - | |
| 232 | + | |
222 | 233 | | |
223 | 234 | | |
224 | 235 | | |
| |||
244 | 255 | | |
245 | 256 | | |
246 | 257 | | |
247 | | - | |
248 | 258 | | |
249 | | - | |
| 259 | + | |
250 | 260 | | |
251 | 261 | | |
| 262 | + | |
252 | 263 | | |
253 | 264 | | |
254 | 265 | | |
255 | 266 | | |
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 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
284 | 274 | | |
285 | | - | |
286 | | - | |
287 | | - | |
| 275 | + | |
| 276 | + | |
288 | 277 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 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 | + | |
296 | 318 | | |
297 | | - | |
298 | | - | |
| 319 | + | |
| 320 | + | |
299 | 321 | | |
300 | 322 | | |
301 | 323 | | |
302 | 324 | | |
303 | 325 | | |
304 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
0 commit comments