Commit Graph

505 Commits

Author SHA1 Message Date
Andy Wickham
be8981442a Revert^2 "Change Overview Actions to round buttons."
f849f2856f

Fix: 293081298

Change-Id: Iaf1553770329ec3a6c6d8a2d9d81b60203e79ed8
2023-07-26 20:56:05 +00:00
Greg Kaiser
b095594afd Merge "Revert "Change Overview Actions to round buttons."" into udc-qpr-dev 2023-07-25 16:44:28 +00:00
Greg Kaiser
f849f2856f Revert "Change Overview Actions to round buttons."
Revert submission 23784078-overview-actions

Reason for revert: b/293081298

Reverted changes: /q/submissionid:23784078-overview-actions

Change-Id: I185cfc6baf8dd2243f6fb5a585c926f9df3b3934
2023-07-25 14:27:28 +00:00
Thales Lima
d9f4d93cbf Merge "Add twoPanelId attribute for responsive grid in device profile" into udc-qpr-dev 2023-07-24 21:24:00 +00:00
Andy Wickham
f98949cac3 Change Overview Actions to round buttons.
If floating search is active in Overview (flag enabled and we are
the active Launcher), these buttons will be aligned to the search
bar relative to the bottom of the screen. Otherwise, the buttons
will be aligned below the active task like before.

Demo for Launcher3 build:
https://drive.google.com/file/d/1fVzRRnW5AFDMPkW-E8_w4BOCzTAOURQ_/view?usp=drive_link&resourcekey=0-6-EbFZXkBqcu0rw7uuEzjw

Bug: 292000892
Test: Manual with floating enabled/disabled and
SEPARATE_RECENTS_ACTIVITY enabled/disabled (simulating not being
the active Launcher). Also tested with a 3P Launcher, Nova.
Flag: N/A; this change is enabled by default, but also verified
UI looks correct with ENABLE_FLOATING_SEARCH_BAR.

Change-Id: Ia45f88d2c691c4525b1e73cca4707498d058a917
2023-07-22 07:43:17 +00:00
Jordan Silva
575c3bddec Add twoPanelId attribute for responsive grid in device profile
Three new attributes were created to be used in device profile. These attributes will provide the responsive specs for two panel devices.

Fix: 292204121
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: DeviceProfileDumpTest
Test: DeviceProfileResponsiveDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Change-Id: I35c93e16dde043b0fd611b81bf2de74e3621818e
2023-07-21 12:00:43 +01:00
Jordan Silva
c118fb5dea Implement responsive grid for foldables 4x4 grid
Bug: 277064862
Fix: 289888732
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: DeviceProfileResponsiveDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Test: ResponsiveHomeScreenImageTest
Test: ResponsiveAllAppsImageTest
Test: ResponsiveFolderImageTest
Change-Id: Idf21fc0dc71f9cea474dc9515a4695ccaf6bc094
2023-07-20 11:37:00 +01:00
Jordan Silva
8bd7af2b3f Improving responsive grid xml parser
Refactors AllAppsSpecs, FolderSpecs and WorkspaceSpecs initialization to use the same code to parse the xml with different map function. This CL improves the readability of the code and remove code duplication.

Fix: 286538013
Flag: ENABLE_RESPONSIVE_WORKSPACE
Test: AllAppsSpecsTes
Test: CalculatedAllAppsSpecTest
Test: CalculatedFolderSpecsTest
Test: CalculatedWorkspaceSpecTest
Test: FolderSpecsTest
Test: WorkspaceSpecsTest
Test: DeviceProfileResponsiveDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Change-Id: Iec5863619399efd2e80f3db46b75c4d785e1656f
2023-07-18 18:03:16 +01:00
Thales Lima
4cfd9509e6 Fix responsive folders
Fix: 284155638
Test: DeviceProfileResponsiveDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I462b696747343b154c1c39c0dc2075022623194e
2023-07-10 14:01:28 +01:00
Jordan Silva
12fae110b7 Decrease icon size by steps for folders
Resize the icon so that it fits within the cell. This will stop the icon from being cut off if it is larger than the cell.

Fix: 288075868
Test: DeviceProfileAlternativeDisplaysDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I67c703d89bb7f54a457793490b8251584363dedc
2023-06-28 21:06:49 +01:00
Thales Lima
93ee8fcb30 Decrease the padding between app icon and label
The app icon size in XMLs are 10% larger because of http://b/235886078, so we need to remove that from the padding between the icon and the label.

Bug: 235886078
Fix: 279142287
Test: DeviceProfileDumpTest
Flag: N/A
Change-Id: I2662c30252dc4e06d4767dbe7125a99a02ce2b64
2023-06-28 16:12:52 +01:00
Jordan Silva
637f4eb2f3 Update DeviceProfile to calculate responsive grid for folders
It uses the new responsive folder calculations and specs when responsive grid is enabled. The grid has to have folderSpecsId defined to use the new specifications, otherwise it will use the current scalable grid implementation.

Fix: 284155638
Test: DeviceProfileDumpTest
Test: ResponsiveHomeScreenFolderImageTest
Test: HomeScreenFolderImageTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I535cff4bb00e969f782447a898230fe2b2c05cc9
2023-06-21 12:18:58 +01:00
Thales Lima
2759aa345b Decrease icon size by steps
When the icon can't fit the cell size, decrease it by steps defined by UX until it fits or reach a minimum size.

Fix: 283929701
Test: DeviceProfileAlternativeDisplaysDumpTest
Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest
Test: IconSizeStepsTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I2875b669c0a24ecd1c4d785a33e2cffb78c9fe76
2023-06-20 20:37:38 +01:00
Thales Lima
abfe364629 Implement calculations of Responsive Grid for AllApps
All Apps follow the same sizes as the workspace, so we copy the measurements to AllApps values.

Bug: 284152932
Test: HomeScreenAllAppsImageTest
Test: DeviceProfileDumpTest
Test: HomeScreenResponsiveAllAppsImageTest
Test: DeviceProfileResponsiveDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I12743a6ac5ab5f1a8bc911511bdc7e12b2261d86
2023-06-16 10:19:19 +00:00
Thales Lima
eb83006b0b Merge "Correct AllApps horizontal padding" into udc-qpr-dev 2023-06-13 11:04:47 +00:00
Andy Wickham
bd9a180fbc Allow LauncherState to define floating search side margins.
This lets home screen align to workspace icons while All Apps
aligns with those icons. In addition, on tablets where the QSB
is inlined with the hotseat, floating search bar can also move
horizontally accordingly.

Bug: 275635606
Bug: 259619990
Test: Manual on tablet as well as foldable.
Flag: ENABLE_FLOATING_SEARCH_BAR

Change-Id: I67745c66390736cdf39d969ef7767096ae13c671
2023-06-13 00:28:59 +00:00
Andy Wickham
64896f3098 Put the "floating" in ENABLE_FLOATING_SEARCH_BAR.
This means adding the search view to the drag layer, so it can
persist and animate across Launcher states (i.e. Home, All Apps,
Overview, Overview from App).

Some high level things:
 - LauncherState now has a flag indicating if the floating
   search bar should be visible, as well as a method indicating
   how high it should rest when the keyboard is not showing. By
   default the height is set negative if the flag is not present,
   so the search bar will rest off screen in that state.
 - LauncherState also has a new method indicating if the search
   bar should show as a pill when not focused. Currently this is
   done in phone portrait mode in all apps and overview.
 - SearchUiManager now has a method for gestures to hint that
   the search bar will be focused or unfocused soon, e.g. for
   the app -> overview case, we hint that it will be focused
   when crossing the threshold, and unfocused if retracting.
   This allows the search bar to animate during the gesture
   and take or release focus after the state change completes.
 - AllAppsTransitionController lets the apps panel translate in
   from the bottom of the screen, for example when coming from
   an app and we don't want to pop it in halfway up the screen.
   Instead it can slide in gracefully from behind the keyboard
   and floating search bar.
 - KeyboardInsetAnimationCallback can now notify listeners of
   keyboard alpha changes during controlled animations. And
   StateAnimationConfig has a new animation type to control
   the keyboard alpha during the all apps transition.
 - This new ANIM_ALL_APPS_KEYBOARD_FADE is used to pop the
   keyboard in at the threshold for going from an app to all apps.
   Note that its position moves linearly before this, so the
   search bar starts moving up accordingly before the keyboard
   alpha is non-0.

Fix: 266761289
Fix: 268845147
Fix: 267683921
Fix: 265849321
Fix: 266446733
Fix: 269301440
Bug: 275635606
Bug: 259619990
Bug: 261866704
Test: Manual with all the state transitions on phone and tablet
(also folding/unfolding foldable).
Flag: ENABLE_FLOATING_SEARCH_BAR, ENABLE_ALL_APPS_FROM_OVERVIEW
(latter just for the background app interpolator changes).

Change-Id: I6f06552e95747348a62260279626cf407bf145b0
2023-06-12 21:55:24 +00:00
Jon Miranda
cc51c84a46 Merge "Update taskbar paddings/sizes to match spec." into udc-dev am: 10b3e64d51 am: b6e38fb23f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23597945

Change-Id: Ib7fa92acf0049fae35b9dbb1c5b2676dc204556a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09 01:33:29 +00:00
Thales Lima
0bd7a37971 Correct AllApps horizontal padding
There was one extra border space being added to handheld, which makes AllApps and Workspace icons to not align.

Fix: 284151671
Test: DeviceProfileDumpTest
Test: HomeScreenAllAppsImageTest
Test: DeviceProfileResponsiveDumpTest
Test: HomeScreenAllAppsImageTest
Flag: N/A
Change-Id: I6e4a0d93336a3c59db2a25805d90adfaf7a231cf
2023-06-08 12:09:24 +01:00
Jon Miranda
95f4472ba9 Update taskbar paddings/sizes to match spec.
Bug: 282798528
Test: manual with screenshots
Change-Id: I00c646d9cd11a9015e14f8311ba2ff233d8321ac
2023-06-07 11:19:50 -07:00
Kateryna Ivanova
72fbdc7976 Merge "Migrate Interpolators from Launcher3 to the public animation library" into udc-qpr-dev 2023-05-31 15:25:40 +00:00
Thales Lima
7945649c5e Implement calculations of Responsive Grid in DeviceProfile
When a grid has a responsive spec and the feature flag is on, use the new calculations for the sizes in Workspace. This shouldn't affect Scalable grids.

Fix: 277064708
Test: HomeScreenImageTest
Test: DeviceProfileDumpTest
Test: ResponsiveHomeScreenImageTest
Test: DeviceProfileResponsiveDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: Idef3d17fbfa1b2e0c82c12e7784a7584f1ba1b88
2023-05-30 16:14:34 +00:00
Kateryna Ivanova
7120373bbc Migrate Interpolators from Launcher3 to the public animation library
Test: atest
Bug: 271850966
Change-Id: Iba999f2e753764a37d35e508e707df02388432e9
2023-05-30 07:20:38 +00:00
Thales Lima
c98b7815c6 Calculate sizes for responsive grid
This shouldn't change anything in the grids, only calculate the sizes of the grid.

Bug: 277064708
Test: CalculatedWorkspaceSpecTest
Test: WorkspaceSpecsTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: Id1f90ef44f5b869113d063bad17589e7e88d1d20
2023-05-17 10:33:36 +00:00
Thales Lima
ec5abba93b Add feature flag and attribute for responsive grid
This shouldn't change anything in the grids, only support the creation of responsive grids in the future. For now, to check that the flag works, turn it on and check the dumpsys. There is also a dump test created for this.

Fix: 277064696
Fix: 277064702
Test: DeviceProfileResponsiveDumpTest
Flag: ENABLE_RESPONSIVE_WORKSPACE
Change-Id: I1bef87043a100234bd661cd6ac00007fdc654116
2023-05-09 12:06:18 +01:00
Sunny Goyal
6c304b157d Always insetting the widget by a minimum of 6dp
Removing default widget padding logic. Also widget padding it applied
at ShortcutAndWidgetContainer so that the widgetView always has the
correct size.

Bug: 274826296
Bug: 257589413
Test: Verified using screenshots
Flags: N/A
Change-Id: Id4b5e94db6ec7b2aa3dca87b1e9ccc831b608cac
2023-05-03 12:18:33 -07:00
Jon Miranda
04f051045c Allow grids to specify if we should start align taskbar in 3 button
nav.

Bug: 259712417
Test: check layout on tablet
      check layout on multi_display devices

Change-Id: I282f51e5d76a30e9ad9d8c52d03d4853e965d65a
2023-04-05 10:29:51 -07:00
Jon Miranda
9c478b6c29 Add taskbarIconSize to GridOption/DisplayOptions
- Renamed variables to make it more clear what they represent
- DeviceProfile will be source of truth for taskbar
  sizes

Bug: 265144213
Test: phone, multi-display, tablet
Change-Id: Id9c19d15a65894fd7645e0f876a4b6527b713c34
Flag: ENABLE_TRANSIENT_TASKBAR=true
2023-03-24 12:29:11 -07:00
Thales Lima
7eee74b3f8 Scale folder if it doesn't fit the screen
Scale folder attrs if a full folder doesn't fit the screen width. This will make icons and text smaller than the workspace.

As a follow-up, another bug will be created to only scale full folders instead of all folders.

Bug: 271554689
Test: manually create a full folder, change the display size to large+
Change-Id: I47dc4bd4fe0c9eae989095fc1d179b81d350ef77
2023-03-17 14:13:04 -03:00
Jon Miranda
e17a949950 Align taskbar to the left/right in 3 button nav for certain devices.
Otherwise we position the taskbar in the center.

Bug: 259712417
Fixes: 267997547
Test: transient taskbar unaffected
      persistent taskbar
      - test on small tablet
      - test on large tablet
      - test LTR and RTL

Change-Id: Ieb0a304d9963ebf583bc4ef2deaab747019e8d6d
2023-03-09 22:33:18 +00:00
Alex Chau
8aa3f00238 Land ENABLE_TASKBAR_IN_OVERVIEW
Fix: 270393449
Test: manual
Change-Id: I731bfa8ee86154fd034781e27272abc81a6fe6c6
2023-02-28 20:18:32 +00:00
Helen Cheuk
599109b23f Update folder row and column for 5x5 grid to 4x4. Update dump method to include changed properties and add dump test for 5x5 grid
Originally folder row and column for 5x5 grid was 3x3. This change is to update it to 4x4 in config to increase the max number of cells displayed. It also adds corresponding test for 5x5 grid and includes numFolderRows and numFolderColumns in the dump string

Fix: 265139500
Test: DeviceProfileDumpTest
Change-Id: I09fe3eac8113a147cb895988e5424471e4e772e5
2023-02-24 14:40:50 +00:00
Thales Lima
ffc68b0516 Rename variables for better understanding
Fix: 263097925
Test: build
Change-Id: I495a2bda4d301d1660d394d978940669ef404ce7
2023-02-20 16:40:19 +00:00
Helen Cheuk
e76291f55c Pad large screen hotseat in RTL 3 button nav mode by swapping left and right padding to avoid overlapping with nav buttons
Hotseat was overlapped with 3 navigation buttons in large screen RTL mode. This fix is to pad hotseat properly by swapping the left and right paddings in RTL mode
Bug: 268178394
Test: manual

Change-Id: I2b073a1b532bf3aae3ab1bec98ad70713742c672
2023-02-16 14:43:01 +00:00
Sunny Goyal
c424941565 Merge "Updating Drawables as per GraphicsUtils changes" into tm-qpr-dev 2023-02-10 16:46:19 +00:00
Sunny Goyal
799e12077b Updating Drawables as per GraphicsUtils changes
Bug: 266661614
Test: Presubmit
Change-Id: Ia3d0e0bc7a2b019d234e3bca71e893d5c4c54ca8
2023-02-09 16:14:04 -08:00
Thales Lima
fcb6a5fc06 Merge "Improvements for All Apps on different display sizes" into tm-qpr-dev 2023-02-08 10:02:17 +00:00
Pat Manning
cbedc7ed08 Merge "Move overview actions to task menu when no focused task." into tm-qpr-dev 2023-02-03 13:51:54 +00:00
Jon Miranda
2b25ded506 Update notification dot renderer when we update the taskbar icon size.
Test: swipe to home with an app that has a notification dot
      observe no jump in dot size
Bug: 264709741

Change-Id: I5d56fe57e74ed7b094477ecd8727152f3f522042
2023-02-02 23:10:42 +00:00
Pat Manning
7b8f766b85 Move overview actions to task menu when no focused task.
Bug: 265641913
Test: manual
Change-Id: I03a88275b399940468246a69365f76f7deda724e
2023-02-02 11:37:15 +00:00
Thales Lima
e9273ea743 Improvements for All Apps on different display sizes
Bug: 262912817
Test: DeviceProfileAlternativeDisplaysDumpTest
Change-Id: I50e980183b4d5c1a46cca8f1c867b866b9eae4b5
2023-02-01 11:34:12 +00:00
Thales Lima
d852d65693 Create attr for padding between icon and text in cells
Bug: 265210314
Test: DeviceProfileDumpTest
Change-Id: I00af790d0c21c35f1cbce1362e63d3ab8259244a
Merged-In: I00af790d0c21c35f1cbce1362e63d3ab8259244a
2023-01-26 22:50:18 +00:00
Nicolò Mazzucato
1207e773e2 Merge changes I2c1e440b,I805d56d4 into tm-qpr-dev
* changes:
  Add OPTIMIZE_MEASURE flag to QuickSteplauncher window
  Log device profile changes in perfetto traces
2023-01-19 19:42:26 +00:00
Nicolo' Mazzucato
cb7bd50247 Log device profile changes in perfetto traces
This is needed to easily spot unwanted DeviceProfile changes in perfetto traces, as each one causes many new inflation and slows down the ui thread considerably.

Test: recorded trace with this log
Bug: 258214245
Change-Id: I805d56d4dfe1c08d7f28215c0462d01fcaece84e
2023-01-17 14:54:11 +00:00
Alex Chau
85d664efaa Use transient taskbar size/margin to calculate taskbar position for persistent taskbar
- DeviceProfileTest should use persistent taskbar in 3-button mode

Fix: 260596114
Test: DeviceProfileTest
Change-Id: Iadcca218dab2bc2eedc006c86dbbe3f9a0fa5e51
2023-01-16 17:00:46 +00:00
Alex Chau
06f36e8568 Reduce icon/text simultaneously when cellHeight is not enough for largest display size
- Follow-up of http://ag/20691430
- Reduce iconDrawablePaddingPx to further recover space
- Then proportional reduce both iconSizePx and iconTextSizePx
- This will result in larger icon/text size in px when going from larger to largest for most devices
- For extremely large desnity (> largest for most devices), iconSizePx/iconTextSizePx will inevitably reduce due to smaller availalbe space

Fix: 264149604
Test: test different density between larger and largest, check that icon/text size continues to grow in px
Change-Id: I1633566b9372acf1393c7e997598cb3e46c4a507
2023-01-10 18:11:59 +00:00
Alex Chau
37292eb230 Merge "folderChild icon and text size should follow the respective configuration" into tm-qpr-dev 2022-12-20 19:01:14 +00:00
Alex Chau
0d4f1ac30e folderChild icon and text size should follow the respective configuration
- Use mTypeIndex instead of always INDEX_LANDSCAPE or INDEX_DEFAULT to make sure they follow the workspcae icon/text size

Fix: 262446829
Test: DeviceProfileDumpTest
Change-Id: I9fc37b41114a34e35108330a8d599556bff77eef
2022-12-20 12:36:05 +00:00
Alex Chau
1b276a1ba7 Add transientTaskbarMargin above taskbar in overview
- Also removed transient_taskbar_two_panels_size and use sw720dp override instead, to be consistent with how we handle small vs large tablet in overview
- Also made isTransientTaskbar mockable so we can test that in DeviceProfileDumpTest

Bug: 260596114
Test: DeviceProfileDumpTest
Change-Id: I3c2236b95d91246e9581531478e3c97601cfb2ec
2022-12-19 17:23:27 +00:00
Thales Lima
6a59006592 Polish hotseat and taskbar with 3 buttons
Change margin spaces and logic of how many items the hotseat and taskbar should show.

Fix: 246424857
Test: DeviceProfileDumpTest
Test: HotseatWidthCalculationTest
Change-Id: I8ec71c56a0aa362483c43d6400c762d12cf45f5b
2022-12-17 11:20:21 +00:00