Commit b097e04
committed
fix(ui): Display death date and age for deceased persons
This commit adds support for displaying death dates and calculating the age at death on the person detail screen. It also refactors the birthdate display to handle deceased individuals by omitting the "years old" suffix when a death date is present.
### Key Changes:
* **`PersonDetailContent.kt`**:
* Updated the UI to check for and display a person's death date (`endDate`).
* Calculates and displays the age at death if both birth and death dates are available.
* Modified the birthdate display logic: if the person is deceased, it now only shows the birthdate without the current age.
* Refactored `DateTimeFormatter` initialization for better consistency across date fields.
* **`AfinityPersonDetail.kt` & `JellyfinModelExtensions.kt`**:
* Added `endDate` to the `AfinityPersonDetail` model and updated the mapping logic to extract this field from the data source.
* **`strings.xml`**:
* Added new string resources for deceased status: `person_born_deceased_fmt`, `person_died_fmt`, and `person_died_no_age_fmt`.1 parent e19a51e commit b097e04
File tree
4 files changed
+41
-8
lines changed- app/src/main
- java/com/makd/afinity
- data/models
- extensions
- media
- ui/person/components
- res/values
4 files changed
+41
-8
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | | - | |
| 443 | + | |
443 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
444 | 451 | | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
449 | 474 | | |
450 | | - | |
451 | | - | |
452 | 475 | | |
453 | 476 | | |
454 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
455 | 482 | | |
456 | 483 | | |
457 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| |||
0 commit comments