Commit fc9287f
committed
Feat: Enhance Private Space UI and Logic
This commit introduces several improvements to the Private Space feature:
- **New Private Space FAB**: A Floating Action Button (FAB) is added to `fragment_home.xml` and managed in `HomeFragment.kt` to toggle the Private Space lock. Its visibility is dependent on Private Space being set up. The icon changes to reflect the locked/unlocked state.
- **Toast Behavior Change**: Toasts for Private Space lock/unlock actions are now suppressed in `HomeFragment.kt` and `SettingsFragment.kt` when toggling the lock. The toast in `PrivateSpaceManager.kt` is now conditional based on the `showToast` parameter.
- **Receiver Logic Update**: `PrivateSpaceReceiver.kt` now listens for `Intent.ACTION_USER_UNLOCKED` instead of `Intent.ACTION_PROFILE_AVAILABLE`. It will only show an "unlocked" toast if mLauncher is the default launcher.
- **Settings Visibility**: The "TogglePrivateSpace" action and the Private Spaces settings item in `SettingsFragment.kt` now check `isPrivateSpaceSetUp()` instead of `isPrivateSpaceSupported()` to determine visibility, ensuring these options only appear if Private Space has been configured.
- **Layout Adjustment**: The new `privateLayout` containing the FAB is included in the list of views whose margins are adjusted in `HomeFragment.kt`.1 parent 9bf749c commit fc9287f
File tree
5 files changed
+69
-20
lines changed- app/src/main
- java/com/github/droidworksstudio/mlauncher
- helper
- receivers
- utils
- ui
- res/layout
5 files changed
+69
-20
lines changedLines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
Lines changed: 29 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
709 | | - | |
| 708 | + | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
858 | 878 | | |
859 | 879 | | |
860 | 880 | | |
861 | 881 | | |
862 | 882 | | |
863 | 883 | | |
864 | | - | |
| 884 | + | |
| 885 | + | |
865 | 886 | | |
866 | 887 | | |
867 | 888 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
426 | | - | |
| 425 | + | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
180 | 200 | | |
181 | 201 | | |
182 | 202 | | |
| |||
0 commit comments