Commit Graph

141 Commits

Author SHA1 Message Date
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Vinit Nayak
c7293179d0 Space out 3 button nav on taskbar
* Add additional margin on nav buttons if
there's overlap w/ contextual button
* End spacing is dependent on grid layout

Bug: 223724516
Test: Tested on unfolded with different
grid sizes.

Change-Id: Ie814f35cd1f35629744050ee3f7242c5a8599883
2022-07-25 13:15:11 -07:00
Thales Lima
b8c0595d42 Add new hotseat bottom margin options
This changes how the hotseat height is calculated and by consequence how spaces are distributed in the workspace as well. This is the first of a series of changes that will improve and streamline workspace calculations.

Bug: 228998463
Fix: 234023782
Fix: 230191631
Fix: 232914299
Fix: 236238226
Test: manual, HSV and comparing to mocks
Change-Id: If021e8ba2c7c24c0bf9f27a1aa7aa946792ed04f
2022-07-05 15:33:47 +01:00
Alex Chau
b065b4b05a Revert "Add logs for InvariantDeviceProfile.getDeviceProfile"
This reverts commit d3e8cc40b4.

Reason for revert: b/231312158 is fixed, log is no longer needed
Fix: 231851651

Change-Id: I3ea8b9d14e7eb6f8f9c794c5d15cdfc94153d392
2022-06-17 09:36:00 +00:00
Alex Chau
661f02de18 Use normalized CachedDisplayInfo as key
- For system Launcher, migrate to use getPossibleMaximumWindowMetrics instead of getDisplays
- Removed usage of displayId
- In estimateInternalDisplayBounds, use CachedDisplayInfo directly as a key
- When cache retunrs null for the current display (e.g. the 3P launcher case), invalidate the cache and estimate again, and only add to supportedBounds if current display is not found in the new cache

Bug: 227459045
Bug: 198965093
Test: manual
Change-Id: Ibcc05ba483ed31a40d16e3cf49c3f3d43af68cf6
2022-06-09 11:36:47 +01:00
Thales Lima
425f6828f1 Fix hotseat width to span a number of columns
Fix: 227344807
Fix: 231283023
Test: manual
Change-Id: Iad0f38c2323be6d9752a8e509fc7e1164edbcf4e
2022-05-11 10:09:03 -03:00
Sunny Goyal
b0416cc478 Merge changes from topic "revert-17983445-hotseat_span-WQWWPUHOTD" into tm-dev
* changes:
  Revert "Fix hotseat width to span a number of columns"
  Revert "Update workspace, cell layout, shortcut and widget, and cell size calculations."
2022-05-09 23:14:38 +00:00
Sunny Goyal
89a89d63a4 Revert "Fix hotseat width to span a number of columns"
Revert submission 17983445-hotseat_span

Reason for revert: b/231283023
Reverted Changes:
Ice4e37929:Fix hotseat width to span a number of columns
I9ed508490:Fix hotseat width to span a number of columns

Change-Id: Iabf67c5efd8155131a0c8a88192ddd671a43747b
2022-05-09 19:32:07 +00:00
Alex Chau
d3e8cc40b4 Add logs for InvariantDeviceProfile.getDeviceProfile
Logged Configuration, DisplayMetrics, rotation and DisplayController.Info

Bug: 231312158
Test: manual
Change-Id: I03ffa80c150b1cb1a31e09ed67026a40cfe97fd2
2022-05-03 18:03:29 +01:00
Thales Lima
828875cd12 Fix hotseat width to span a number of columns
Bug: 227344807
Test: manual
Change-Id: Ice4e37929bcbb8c9cf3af340e67b6bec002578bd
2022-04-29 14:56:30 +00:00
Thales Lima
c1ea50a43d Merge "Make inline qsb part of grid attrs" into tm-dev 2022-03-31 08:30:10 +00:00
Thales Lima
12d0eff037 Make inline qsb part of grid attrs
This should make it more configurable, and be independent of the screen size set by the user.

Fix: 223726518
Test: atest Launcher3Tests:HotseatSizeTest
Test: atest Launcher3Tests:InlineQsbTest
Change-Id: If04f3fb0f556103f60b580c757a9fc06da561516
2022-03-30 20:57:57 +01:00
Thales Lima
080d890383 Add border space to all apps cells
Also remove tablet condition, phones should also follow the workspace size.

Fix: 218638090
Test: visual and HSV
Change-Id: Ib201011391c28c0f1dcd0ce8645c3191655a7227
2022-03-30 11:56:27 +01:00
Thales Lima
b7ef569591 Change size of All Apps bottom sheet
This brings the size of the bottom sheet closer to the spec provided by UX. For that type of flexibility to be possible, more attributes are introduced and some calculations had to be changed.

This shouldn't affect phones.

Bug: 218638090
Test: visual, with dumpsys and HSV
Change-Id: Ieee7580d80d8e100837b1cdd7a1455c4d65612dc
2022-03-22 12:19:46 +00:00
Thales Lima
44cc3a2e21 Add more border space options
This give options to landscape layouts to have different border options

Bug: 222109350
Test: manual and HSV
Change-Id: If823dd09c945438f77e57ff80a8a0c4fc0b4c8a6
2022-03-18 14:28:24 +00:00
Sunny Goyal
187b16cb91 Updating window manager estimation logic:
> Moving the code from ApiWrapper to Resource overlays for better maintainability
> Accounting for display cutouts in insets estimation
> Using same logic in display controller and view inset dispatching

Test: Verified on device
Bug: 221961069
Change-Id: I78466353563692ce3f7512b0146ef8b61ef14bc0
2022-03-09 11:15:58 -08:00
Alex Chau
6ed408f59f Use less icons in hotseat when in 3 button nav for tablet
- We have less space on tablets when 3 button nav is enabled because QSB is now inline with the icons. This creates a new attribute to define how many icons should be shown when in that mode. This could be used for other grids in the future as well.
- InvariantDeviceProfile now listens for nav mode changes

Fixes 214882090, 221420204
Test: manual

Change-Id: I012432a1a322c4e5505e46a1198c841ab124aaa6
2022-03-07 18:38:05 +00:00
Alex Chau
29a96adaab Fix restore not migrating to new grid
- In reinitializeAfterRestore, use db path instead of grid name to check if migration is necessary, so migration will still happen if grid names are renamed. Also, only remove the target db path instead of all non source db paths, which are not necessary to be removed.
- In LauncherBackupAgent, remove old files before restoring to avoid old files from overriding restored files e.g. grid name in shared preferences
- Make sure InvariantDeviceProfile is intialize before we set pending to false, so unsupported grids can still be initialized and then be migratead
- Renamed 6x5 grid so it no longer collides with 4x4

Fix: 218500583
Test: Restore backup from supported and unsupported grids
Change-Id: Ic78e0bc7dc44ad86bd217c736b88708ad488ac0b
2022-02-11 18:15:06 +00:00
Jon Miranda
fd48b0c988 Add All Apps entry button to Taskbar.
- Opens All Apps when clicked
- Fades button in/out when transitioning b/w Hotseat & Taskbar

Bug: 205803230
Test: manual
      ensures alpha gets reset properly
      clicking button opens all apps
Change-Id: I1b96bae734aa9fd9308931d6312e3d65559d4284
2022-01-31 17:22:58 -08:00
Thales Lima
9df1ba0847 Merge "create 6x5 scalable grid for tablets" 2022-01-14 12:21:58 +00:00
TreeHugger Robot
27981bac2a Merge "Allow column size of search container to be configured" 2022-01-07 18:35:13 +00:00
Thales Lima
dd027348dd create 6x5 scalable grid for tablets
Create more attributes for landscape and fix the space between icons in the hotseat. The dimensions are correct but some size might differ from mocks because of device scaling, qsb position and insets not finalized.

Bug: 210118169
Test: visual, using HSV and Window
Change-Id: Ie505923dce2e30133eb1e5c9c83c33a2895147f2
2022-01-07 12:54:37 +00:00
Thales Lima
bb7d3881fe launcher: more options for all apps icon sizes
Different postures now require different icons sizes, changes in spaces and text size. This should give enough options to change the sizes in All Apps the same was as in the home screen.

Bug: 202708085
Test: visual, using HSV and Window
Change-Id: I40a28f27a19b5728a950a4b43f4239c1ba26c2a4
2022-01-05 15:55:16 +00:00
Thales Lima
6e7f36c86a add attributes for hotseat space
Hotseat now follows the size of workspace icons and should have different spaces based on the grid and posture of the device. It also has more icons.

Fixes: 204488528
Test: HSV and Window
Change-Id: I534df95dda6dc7de3f810632f2cab3822bf78416
2022-01-05 12:54:53 +00:00
Thales Lima
85c942fcc9 rename display-option attributes
Rename the attributes to make it more standardized and to be easier to check the multiple variants.

Bug: 202708085
Test: compile and run different launchers
Change-Id: I18b981877b9160bd3801a02567d52b49747d50d4
2022-01-05 10:54:29 +00:00
Alex Chau
9fee3fd379 Allow column size of search container to be configured
- Added numSearchContainerColumns in grid-option to control search container's width, defaults to numColumns if not specified

Bug: 210127246
Test: manual
Change-Id: I0c2594f0eeab8844dcff9468e603282a09fae0bd
2021-12-10 17:55:51 +00:00
Alex Chau
1c883d861e Add launcher grid spec for tablet
- Introduced device_category to allow grids to be only enabled for certain device types. By default grids are enabled for all device types, so old OEM device_profiles aren't affected
  - Removed device_profiles_split.xml as a result and merged with device_profiles.xml
- Added deviceType in InvariantDeviceProfile to replace isSplitDisplay and centralize the logic
- Only has 6x5 grid with new default layout that works better for tablets

Bug: 198575341
Test: manual
Change-Id: I03f6727ce837ffeee6321b6d7c53942338d0cf30
2021-12-08 18:22:34 +00:00
Thales Lima
6e0005af6b launcher: use same icon size for all apps drawer in foldables
For foldables, no matter the grid size, we use 60dp for icons sizes.
This also fix a bug where the icon size was always the minimum between
default and all apps, which means that for foldables it would always be
default.

Bug: 202708085
Test: visual, using HSV and Window
Change-Id: I315718a8ba7a0aaed2204ad12e6b184dda2be48e
2021-11-26 10:03:43 -03:00
Thales Lima
1de4d55d55 launcher: create a device profile for foldables
This creates a device_profiles_split.xml that will be used when the
device is a foldable. This makes the changes contained for specific
devices and make it possible to use different padding files in the
future if needed.

Bug: 191879424
Test: tested with NexusLauncher and Launcher3, in foldables and
handhelds
Test: check that 4x4 is not scalable anymore on handhelds by using HSV

Change-Id: If6ef14e3611c5252634c080643433545ce186f0d
2021-10-14 22:42:25 +01:00
Alex Chau
238aaee059 Allow 2x2 and 3x3 to be migrated after restore
- Allow disabled grid to be used during restore
- Remove all inactive grid dbFiles to allow grid migration to happen
- Set the proper grid after restore to trigger migration

Bug: 202125760
Test: Restore a 2x2,3x3 grid, icons and widgets are migrated to 4x4 grid
Test: Restore a 4x4 grid, icons and widgetse stays in original position
Change-Id: Ie59e1ca0ca56ed2de52d88cd5f51b980788afa52
2021-10-12 17:36:04 +01:00
Thales Lima
83bedbfe97 launcher: refactoring variables into arrays
There are a lot of variables that can be merged together into arrays
following some optimizations done in other places.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I1d73fbb5da2df2345ced7f46df5bae5d75d9d6b1
2021-10-08 13:36:56 +01:00
Thales Lima
78d00adcbe launcher: create more space options
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
2021-10-05 12:26:05 +01:00
Thales Lima
d90faab655 launcher: create attrs for more horizontal margin options
According to new specs, margins are different depending on orientation
and fold/unfolded. Also change the name of the variable to
horizontalMargin, since it applies the same padding to both sides.

Bug: 191879424
Test: manual and checking paddings in HSV
Change-Id: I8990c02b928a22b9f3b0cf3cbc3abf08df4daa9d
2021-09-30 14:06:56 +01:00
Samuel Fufa
abb827b376 Merge "[Foldable] Apply max width to AllApps in unfolded state." into sc-v2-dev 2021-09-29 22:07:42 +00:00
sfufa@google.com
de0132939b [Foldable] Apply max width to AllApps in unfolded state.
Since we are applying the same iconWidth in AllApps as Workspace in unfolded state, this change restricts AllApps to span only the area required to display AllApps contents and not span full available width. Unfolded/phone behavior remains the same.

Bug: 199959857
Bug: 194259694
Test: visual
Change-Id: Ie5658d566f20e825e666ef17db79a87b07dc2936
2021-09-24 15:18:01 -07:00
Tracy Zhou
c8beebf5a3 Consolidate isTablet logic across Launcher and SysUI
Fixes: 197960261
Test: Change display size; no nav bar and task bar showing at the same time
Change-Id: I56753e9389a49ca3ee455b248a041b3c1569f153
2021-09-23 15:06:53 -07:00
Thales Lima
d1df5fcaac launcher: use scalable grid in 4x4
Many changes are required to make scalable displays work correctly on
foldables. This first one is making sure that the correct number of
columns is used when calculating the used width for scalable grid. The
spaces around the workspace are not final yet.

Bug: 191879424
Test: manual
Change-Id: Idc41ed004580f1f86d8f9595d005abc72301b1e3
2021-09-17 10:43:42 +01:00
Sunny Goyal
3e9a29c4d6 Moving roboelectic tests to instrumentation tests
Bug: 196825541
Test: Presubmit
Change-Id: I197bc47181308bb0b79f3815a892b733abbcd1fd
2021-09-08 10:23:30 -04:00
Sunny Goyal
6e6f79933e Do not reload launcher when changing active display
> Updating IDP to use fixed bitmap sizes, so that the cache
  stays valid
> Caching last known windowMetrices for non-active displays and
  using estimation only when the cache is not available
> Only reloading model if IDP change could have affected the model
> Remove unnecessary listeners from IDP which are already controlled by
  model lifecycle

Bug: 191657065
Test: Manual
Change-Id: Ia8e6dfafd0977e62aa3fcf367ad79f7a49b2df51
2021-08-26 15:55:21 -07:00
Alex Chau
1e4484669d Remove widget panel
- Remove all usage of LEFT_PANEL_ID and fixed left panel code
- For preview renderer, load screen 0 + screen 1 instead
- Added a split display specific default workspace layout, with a placeholder app to pass test before we implement page pairing(b/196376162)
- Known issue: If screenId 1 is deleted, right panel will disappear from Wallpaepr & Style because there is no screenId 1. Will be resovled after page pairing(b/196376162)

Bug: 175939730
Test: manual and TaplTestsLauncher3#testWorkSpace
Change-Id: Icac1c94165c14a49c17897c45355b6cdc4d87e91
2021-08-13 21:48:35 +01:00
Thales Lima
7ec8382044 launcher: hide grid options for foldables
Some grid options are too dense for foldables (those with 5 icons), so
we are hiding them on those devices.

This also move the parsing to be done on InvariantDeviceProfile only.

Fixes: 183140646
Test: open Wallpaper & style and change app grid options
Change-Id: I771571db02709db5d0f814236060c57ce0180cd1
2021-08-13 16:07:05 +00:00
Andras Kloczl
30fe9152d5 Update two panel specific launcher home icon sizing
Test: manual
Bug: 191879424
Change-Id: I4f51616004d78036ad801298bb5ba72af8de3f30
2021-08-12 18:46:01 +01:00
Sunny Goyal
68031ca3f9 Storing form factor as part of backup and disabling restore if form-factor is different
Bug: 195301649
Test: Manual
Change-Id: I9a9c4bc9246f40af2209cb914b3966319bc78bff
2021-08-04 09:51:04 -07:00
TreeHugger Robot
853186578d Merge "Prevents a ConcurrentModificationException in Widget" into sc-dev am: 3a37543fb9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15001812

Change-Id: I6aa3f859df6a706716081d4258200eafeafcada3
2021-06-17 01:09:54 +00:00
Pinyao Ting
9cd63c97ce Prevents a ConcurrentModificationException in Widget
InvariantDeviceProfile.supportedProfiles can be modified in respect to
configuration changes. This CL ensures the list was cloned before access
to prevent ConcurrentModificationException

Bug: 191231591
Test: manual
Change-Id: I123458dcfe99af4babca2cf73733e3d2af0fad3c
2021-06-16 21:02:48 +00:00
Pat Manning
67094bfdfb Prevent clearing home between display size changes.
Split display support was previously based on the sizes of supported device profiles. If a device supporting split display increased display size too much, it could trigger a grid migration (due to number of hotseat icons displayed vs in the DB changing as it was no longer seen as split display). The migration would not run however, as the grid had not actually changed, but would still have cleard the DB in preparation of the migration.

By counting the number of supported profiles instead, we can estimate the number of screens invariant of display size changes and avoid undesired grid migrations.

Test: manual
Fix: 187689871
Bug: 187689871
Change-Id: If740c501cab0e80ef6144356ec5618ee30134ed7
2021-06-02 16:18:55 +00:00
Winson Chung
35226124e3 Removing some unused logs
Fixes: 185820525
Fixes: 177316094
Fixes: 158017601
Fixes: 180915942
Change-Id: I8ce5bde08e1728d3209762c5f061245386408825
2021-05-07 20:52:33 -07:00
Sunny Goyal
b47172bc4e Linking various settings that control icon cache to icon state
Also separating icon provider for recents from Launcher as it used a fixed size

Bug: 183641907
Test: Verified on device
Change-Id: I6ea3caa0066d1483bfb8a81f0e8aaa472c813afe
2021-05-05 23:05:38 -07:00
Sunny Goyal
19ff728b92 Adding support for determining split layout for launcher.
> Simulating the windo wmanager API to get available device
  profiles until final API
> When a device has multiple internal displays, and with both
  tablet and phone possibilities, it uses a split workspace layout

Bug: 186160341
Bug: 175782275
Test: Manual
Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-05-03 14:48:28 -07:00
Alex Chau
fd6d942220 Pass WindowContext to DisplayInfoChangeListener
- WindowContext (or updated DisplayContext for Pre-S) contains updated Resources to be used for the listener

Fixes: 181215299
Fixes: 176656141
Test: Swap between large/small screen, large sreen UI is seen
Test: Swap between font size, launcher icon text is updated
Test: Start secondary home
Test: Repeat the above tests with Utilities.ATLEAST_S hardcoded to false
Change-Id: Ib33025ac0276c84fe2b3213e9946721e5988e3da
2021-04-23 19:14:20 +01:00