Commit a2c66fc
committed
feat(widget): Enhance home apps widget with icons and improve update mechanism
This commit introduces several improvements to the home apps widget:
- **Icon Display:** The widget now displays app icons alongside app names.
- A new function `createWidgetTextWithIcon` in `HomeAppsWidgetProvider.kt` handles rendering the app icon and label as a single Bitmap.
- `item_home_app.xml` has been updated to use an `ImageView` (`appIcon`) instead of a `TextView` to display this combined image.
- Icon loading logic now considers icon packs and provides a fallback to system icons.
- Icon tinting is applied based on the dominant color of the icon.
- **Widget Update Trigger:**
- A new utility function `updateHomeWidget` in `SystemUtils.kt` has been created to send an update broadcast to the `HomeAppsWidgetProvider`.
- This function is now called from `SettingsFragment.kt` whenever relevant settings that affect the home widget's appearance are changed (e.g., home app selection, app color, icon pack). This ensures the widget reflects changes immediately.
- **Layout Adjustments:**
- Padding has been reduced in `widget_word_of_the_day.xml`, `widget_fab.xml`, and `widget_home_apps.xml` for a more compact appearance.
- Padding in `item_home_app.xml` is now applied to the `ImageView` to control spacing around the icon and text.
These changes provide a more visually appealing and responsive home screen widget.
Signed-off-by: CreativeCodeCat <wayne6324@gmail.com>1 parent ee5017f commit a2c66fc
File tree
7 files changed
+127
-30
lines changed- app/src/main
- java/com/github/droidworksstudio/mlauncher
- helper
- ui
- widgets/home
- res/layout
7 files changed
+127
-30
lines changedLines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
633 | 636 | | |
634 | 637 | | |
635 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
636 | 651 | | |
637 | 652 | | |
638 | 653 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
831 | 832 | | |
832 | 833 | | |
833 | 834 | | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
834 | 838 | | |
835 | 839 | | |
836 | 840 | | |
| |||
1416 | 1420 | | |
1417 | 1421 | | |
1418 | 1422 | | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1419 | 1426 | | |
1420 | 1427 | | |
1421 | 1428 | | |
| |||
1576 | 1583 | | |
1577 | 1584 | | |
1578 | 1585 | | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
1579 | 1589 | | |
1580 | 1590 | | |
1581 | 1591 | | |
| |||
Lines changed: 94 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
| 17 | + | |
11 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
| |||
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
25 | | - | |
26 | | - | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
45 | | - | |
46 | 52 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 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 | + | |
50 | 84 | | |
51 | | - | |
52 | | - | |
| 85 | + | |
| 86 | + | |
53 | 87 | | |
54 | | - | |
| 88 | + | |
55 | 89 | | |
56 | 90 | | |
57 | 91 | | |
58 | 92 | | |
59 | 93 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 94 | + | |
64 | 95 | | |
65 | | - | |
| 96 | + | |
66 | 97 | | |
67 | | - | |
| 98 | + | |
68 | 99 | | |
69 | 100 | | |
70 | 101 | | |
71 | 102 | | |
72 | 103 | | |
73 | 104 | | |
74 | 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 | + | |
75 | 151 | | |
76 | 152 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
10 | 9 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
15 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments