Commit e3a3a88
committed
feat: persist and enhance discovery platform selection
- Implement persistent storage for the selected discovery platform in `TweaksRepository`.
- Add `observeDiscoveryPlatform` to `HomeViewModel` to reactively update the UI state when the platform preference changes.
- Rename `HomeAction.SwitchFilterPlatform` to `SwitchDiscoveryPlatform` and ensure the selection is saved to preferences.
- Enhance the `PlatformsPopup` UI with `AnimatedVisibility` for smoother transitions and updated Material3 styling.
- Refactor `TweaksRepositoryImpl` to move preference keys to a companion object and include new logic for handling `DiscoveryPlatform`.
- Add a helper method `fromName` to `DiscoveryPlatform` for easier deserialization from stored preferences.1 parent f1b9197 commit e3a3a88
6 files changed
Lines changed: 83 additions & 40 deletions
File tree
- core
- data/src/commonMain/kotlin/zed/rainxch/core/data/repository
- domain/src/commonMain/kotlin/zed/rainxch/core/domain
- model
- repository
- feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation
Lines changed: 27 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 20 | | |
32 | 21 | | |
33 | 22 | | |
| |||
156 | 145 | | |
157 | 146 | | |
158 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
Lines changed: 17 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
61 | | - | |
62 | 59 | | |
63 | 60 | | |
64 | 61 | | |
| |||
241 | 238 | | |
242 | 239 | | |
243 | 240 | | |
244 | | - | |
| 241 | + | |
245 | 242 | | |
246 | 243 | | |
247 | 244 | | |
| |||
590 | 587 | | |
591 | 588 | | |
592 | 589 | | |
593 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| |||
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
| 610 | + | |
609 | 611 | | |
610 | 612 | | |
611 | 613 | | |
| |||
618 | 620 | | |
619 | 621 | | |
620 | 622 | | |
621 | | - | |
622 | | - | |
623 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
624 | 626 | | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
| 631 | + | |
629 | 632 | | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
633 | | - | |
| 636 | + | |
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
| |||
645 | 648 | | |
646 | 649 | | |
647 | 650 | | |
648 | | - | |
| 651 | + | |
649 | 652 | | |
650 | 653 | | |
651 | 654 | | |
652 | 655 | | |
653 | 656 | | |
654 | | - | |
655 | | - | |
656 | | - | |
| 657 | + | |
| 658 | + | |
657 | 659 | | |
658 | 660 | | |
659 | 661 | | |
| |||
Lines changed: 28 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
123 | 136 | | |
124 | 137 | | |
125 | 138 | | |
| |||
147 | 160 | | |
148 | 161 | | |
149 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
150 | 167 | | |
151 | 168 | | |
152 | 169 | | |
153 | 170 | | |
154 | 171 | | |
155 | | - | |
156 | 172 | | |
| 173 | + | |
157 | 174 | | |
158 | 175 | | |
159 | 176 | | |
| |||
269 | 286 | | |
270 | 287 | | |
271 | 288 | | |
272 | | - | |
273 | | - | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
274 | 292 | | |
275 | 293 | | |
276 | 294 | | |
| |||
291 | 309 | | |
292 | 310 | | |
293 | 311 | | |
294 | | - | |
295 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
296 | 315 | | |
297 | 316 | | |
298 | 317 | | |
| |||
309 | 328 | | |
310 | 329 | | |
311 | 330 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 331 | + | |
315 | 332 | | |
316 | 333 | | |
317 | 334 | | |
| |||
421 | 438 | | |
422 | 439 | | |
423 | 440 | | |
424 | | - | |
| 441 | + | |
425 | 442 | | |
426 | 443 | | |
427 | 444 | | |
428 | 445 | | |
429 | 446 | | |
430 | 447 | | |
431 | 448 | | |
432 | | - | |
| 449 | + | |
433 | 450 | | |
434 | 451 | | |
435 | 452 | | |
| |||
0 commit comments