Commit Graph

970 Commits

Author SHA1 Message Date
Steven Ng
cea65b75d8 Fix wallpaper parallax calculation for large screen devices
Test: manual
Bug: 193403434
Change-Id: Ifaed71f8c3645b012def02a9ea36fc3fb29bac00
2021-08-05 16:05:50 +01:00
TreeHugger Robot
1e46696161 Merge "Fix Workspace item move issues when using Talkback" into sc-v2-dev 2021-08-04 10:48:22 +00:00
Andras Kloczl
e32e8641d6 Fix Workspace item move issues when using Talkback
- fix the crash when an item was moved onto the right panel
- fix the issue that prevented the user from moving an item from the left panel

Test: manual
Bug: 194903736
Change-Id: Ib41f5d6d08e8815a52631ef952d32dcf899455e2
2021-08-04 11:04:19 +02:00
Steven Ng
61cfa57ad8 Correct cell layout spacing in n-panels UI
Test: manual
Fix: 184966000
Change-Id: I6940413c24f41df0b1ffcfd4bec4b0c5c3497b6d
2021-08-03 16:40:41 +01:00
Steven Ng
2a5c594855 Fix cell size calculation in large screen devices
Test: Digital clock widget is no longer cropped.
Bug: 184966000, 194784402
Change-Id: I26c406da1e10232019f34620a4d2bc0dbafcbb31
2021-07-30 11:14:11 +01:00
Sunny Goyal
69a8eecdc9 Simplifying color extraction registration logic
> Calulating correct location irrespective of transient
  state (scale/translation)
> Removing extraction pause/resume logic
> Simplifying location calculation and registration (only use one location instead of a list)

Bug: 194732483
Test: Manual
Change-Id: I255d83761bff5e09c9fb0a5e398d0be0c1d0956f
2021-07-28 15:43:13 -07:00
Sunny Goyal
12e3f1f2f7 Removing UI dependency from LauncherModel in case of 2-panel layout
Bug: 175939730
Bug: 192431856
Bug: 185515153
Test: Manual
Change-Id: I8baa1cf9e5a8a04d5b8bc38c1f4b0755265cd8a9
2021-07-22 10:34:25 -07:00
Thales Lima
e445774ab5 launcher: correct page spacing for multiple panels
This fixes 2 things:
- adding the correct space between pages as insets (eg camera) were
being discarded
- adding the space between pages instead of between panels as was before

This solution should work with more panels and don't create problems for
phones, where panels = 1.

Fixes 193194192
Test: manual testing in unfolded state in portrait and landscape, both
rotations

Change-Id: Ia3b148ceb773c6d5b6f8848ced07d7f9c1459e92
2021-07-22 09:41:43 +00:00
Sunny Goyal
711c596c86 Binding Taskbar directly from Launcher model
This allows taskbar to be loaded even in case of 3P Launchers
and removes dependency on LauncherActivity lifecycle

Bug: 187353581
Bug: 188788621
Test: Manual
Change-Id: I5a0988e0697b41677d4c58f0213aef14ec0c0972
2021-07-15 12:43:11 -07:00
Pierre Barbier de Reuille
41f78f1e13 resolve merge conflicts of 25e37a85ae to sc-v2-dev
Change-Id: I78062d68d051a5f3c369214929f569b17c5a3471
Fix: 192532604
Bug: 192354264
Test: Manual
Merged-In: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
2021-07-01 09:47:10 +00:00
Pierre Barbier de Reuille
43e17301c4 Correct color extraction on App Widget drop.
Disable color extraction on drop until the workspace is back to its
normal size, then re-enable it and force re-coloring. This needs to
happen if the drop is on the workspace, but also if the drop is on the
secondary target.

Fix: 192354264
Test: Manual, see bug for details.
Change-Id: I79203f68843d59384503aa76f4813d886e98afa3
Merged-In: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
2021-06-30 18:50:41 +01:00
Steven Ng
f5555fcb8e Merge "Add null check before detach content view from dragView at onDropComplete" into sc-dev am: 5b786ca88d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15042822

Change-Id: Idc12dd2613200ce6e9901856b14c4ce0c5946fb6
2021-06-23 21:17:48 +00:00
Steven Ng
92335ed7bd Add null check before detach content view from dragView at onDropComplete
Test: Drop a conversation widget on a configuration button. No crash
      is observed.
Fix: 191762933
Change-Id: I483c6f4dbc9fc6c096383682284a4c854707f583
2021-06-22 23:26:05 +01:00
Sunny Goyal
0c299cb324 Merge "Simplifying the drop animation code" into sc-v2-dev 2021-06-16 23:18:16 +00:00
TreeHugger Robot
c51564bb7a Merge "Reattach LauncherAppWidgetHostView to its parent after canceling drag" into sc-dev am: 4176cb33bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14970490

Change-Id: I5a92dc73ce2dcde24ea5fd7d826211e9d35a717e
2021-06-16 22:39:09 +00:00
Steven Ng
a5e1453779 Reattach LauncherAppWidgetHostView to its parent after canceling drag
onDrop isn't called if the drag is canceled at Launcher.onPause. Let's
also reattach LauncherAppWidgetHostView to its parent in this case.

Test: long press and hold a widget and, at the same time, press the
      power button. Don't let go of the long press and press the power
      button. No crash observed.
Fix: 190950646
Change-Id: Id52a51291863b7ef63c861eb6dc23b015484be65
2021-06-15 00:01:04 +01:00
Andras Kloczl
dbf577af46 Add left widget panel to Launcher home when unfolded
Test: manual
Bug: 175939730
Change-Id: I9831e7fa95084db12953ec7cb2eb725e7549e01d
2021-06-14 12:22:05 +02:00
TreeHugger Robot
c13b47f7bf Merge "Fix CellLayout cast exception when drag is canceled" into sc-dev am: 76f5572648
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14948453

Change-Id: I4d23a6d0cc1806761bf9655ba8d823813ec8b630
2021-06-12 12:39:52 +00:00
Steven Ng
77a1393c44 Fix CellLayout cast exception when drag is canceled
Test: Long press a widget and then release when the resize frame is
      shown. Then, click the content of the widget to launch the
      widget's activity. Go back to home screen and then immediately
      long press the same widget again. No crash was observed.
Bug: 189814379
Change-Id: I4232ecf9d9d9efaba817b7777314f0814bb7ef21
2021-06-11 20:18:21 +01:00
Sunny Goyal
1721ccf385 Simplifying the drop animation code
> Removing some unused parameters

Bug: 190524398
Test: Manual
Change-Id: Iea0c2e7a9d30a10fd7443ea57992c59ea60badf8
2021-06-08 14:43:57 -07:00
Steven Ng
0ed1b41464 Merge "Exact widget sizes functionalities into an utility class" into sc-dev am: 84fe7e3a1e
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14881307

Change-Id: I5202727f975ce463179674cd54ba8d4b75063f9d
2021-06-08 19:12:12 +00:00
Steven Ng
22b6039270 Exact widget sizes functionalities into an utility class
Test: resize widget, move widget, add widget.
Bug: 189975670
Change-Id: Ia0bc2297891e1cfa33697e985064db5d1dcdfc8b
2021-06-08 11:42:48 +01:00
Steven Ng
8e74a1f2a7 Merge "Show app widget resize frame after launcher state change" into sc-dev am: c58b204926
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14733440

Change-Id: I347e1fae2221f478cc7cab478e3924ea8a131eb8
2021-06-01 21:31:34 +00:00
Steven Ng
6ed0112871 Merge "Fix add extra empty screen logic" into sc-dev am: a45ea6cf33
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14717704

Change-Id: I69033f2b4ca9f3508ed31125bb9b74a09dd32829
2021-06-01 21:31:30 +00:00
Steven Ng
c58b204926 Merge "Show app widget resize frame after launcher state change" into sc-dev 2021-06-01 21:11:01 +00:00
Steven Ng
7e3d96c620 Show app widget resize frame after launcher state change
When this bug occurs, the resize frame coordinate is incorrect because
the launcher state animation has not finished when the drag view
finishes animating back to its original position.

Test: Quickly long press and release a widget from the home screen.
      Observe the resize frame is correctly shown around the widget.

Bug: 186370472
Change-Id: I6bfba2e85e3354a215c26203dd22df13db3b8b83
2021-06-01 12:20:32 +01:00
Steven Ng
1ef7e145d2 Fix add extra empty screen logic
The bug occurred when there are two widgets in a CellLayout. When
dragging one of the widget, ShortcutAndWidgetContainer#getChildCount
returns 1 rather than 2 because the LauncherAppWidgetHostView of the
widget in drag has been detached from its parent and reattached to
DragView (introduced in ag/14234627).

Test: Place only two widgets on the last page of the home screen. Drag
      one widget. The new page indicator on the right is shown.
Bug: 188494523
Change-Id: I8255dd1b72ad7f18f4cb35a9e14ac8e61804980c
2021-05-25 23:39:40 +01:00
Andras Kloczl
55edfe55f7 Add two panel home support for page binding logic
There's a logic which prioritizes the binding for the
current page and defers the other pages' binding.
If two panel home is enabled, we want to bind both pages
together. LauncherPageRestoreHelper has been created to
contain the logic for persisting restoring and calculating
which pages to load immediately.

Test: manual + run LauncherPageRestoreHelperTest robo test
Bug: 174464691
Change-Id: I57ac3f7150303b95b272e922f44bda26f9d5ce2a
2021-05-24 23:22:06 +02:00
Winson Chung
bd2fa26bda Tweak ordering of first match search
- Tweak iteration for finding first match, go by operator priority and
  check each cell layout by order to return the first view that matches
- Also reset the launch cookie in cases where we're launching a task
  that doesn't support cookies (ie. via prediction), otherwise we may
  still try to associate it with the last launched cookie later

Fixes: 187720286
Test: Swipe up from various icon types across hotseat/workspace
Change-Id: I71c4c13c442b0884b2247589685f976eaaeb30a4
Signed-off-by: Winson Chung <winsonc@google.com>
2021-05-20 14:50:33 -07:00
Sunny Goyal
01b32466c3 Revert "Revert "Exposing AnimatorListeners in StateManager to receive both success and failure callback""
This reverts commit d7f11d5fb9.

Reason for revert: Fixed initial error
Bug: 185554764

Change-Id: I32cc49f9b3820166736ceb347f33577939aa6efa
2021-05-13 10:23:35 -07:00
TreeHugger Robot
7c58b4c7dc Merge "Revert "Exposing AnimatorListeners in StateManager to receive both success and failure callback"" into sc-dev 2021-05-12 23:37:33 +00:00
Winson Chung
d7f11d5fb9 Revert "Exposing AnimatorListeners in StateManager to receive both success and failure callback"
This reverts commit a75f576890.

Reason for revert: b/187887269
Bug: 187887269

Change-Id: I8a56ff7054e71cf30b113fdaa213397dae0c53cb
2021-05-12 21:25:22 +00:00
TreeHugger Robot
d7c6e44ba9 Merge "Exposing AnimatorListeners in StateManager to receive both success and failure callback" into sc-dev 2021-05-11 22:21:42 +00:00
Winson Chung
76e27f6d5d Merge "End scroller if it has already reached the final position" into sc-dev 2021-05-11 21:52:45 +00:00
Sunny Goyal
a75f576890 Exposing AnimatorListeners in StateManager to receive both success and failure callback
Updating various callers to use onSuccess or onEnd appropriately

Test: Manual
Bug: 185554764
Change-Id: I357dd1fdbe111e7a30d4c8dee520fbd7d9956b7d
2021-05-11 13:53:14 -07:00
Winson Chung
8542541b2b End scroller if it has already reached the final position
- The system overscroller seems to take a long time to settle even
  after the final position has been reached, so if that has already
  happened and there is no edge effect, then just end the scroller.
- Remove unused code related to SmoothPageView

Bug: 184983443
Test: Quickswitch and ensure we finish the recents animation after it settles
Change-Id: I9fa72ddd6b6e0d38b6f622c776a2ac5f5b055760
2021-05-11 12:59:14 -07:00
Sunny Goyal
5996937798 Removing Launcher dependency from Folders
This allows opening/closing folders without a Launcher context

Bug: 187353581
Test: Manual
Change-Id: Id73a40445a23004eb554f0422d286aa0ff6b3c41
2021-05-10 14:01:43 -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
Sunny Goyal
4ed0fb5074 Removing dependency on wallpaper colors and using theme resources
Bug: 184676715
Test: Manual
Change-Id: Ie9a9a784c4a8a8cd484bfd8ea463deedcd4deed6
2021-04-27 16:29:08 -07:00
Winson Chung
b837f5040e Merge "Add support for swiping back to the shortcut that launched the activity" into sc-dev 2021-04-23 07:37:37 +00:00
TreeHugger Robot
a8775d6ef9 Merge "New spring overscroll in pagedView" into sc-dev 2021-04-23 01:04:35 +00:00
Winson Chung
2b093941e1 Add support for swiping back to the shortcut that launched the activity
Bug: 129067201
Test: Open a shortcut on the workspace, go home

Change-Id: If5d3c3e8e93f09af50aa4994094657347890ef45
Signed-off-by: Winson Chung <winsonc@google.com>
2021-04-22 17:00:47 -07:00
Sunny Goyal
c39db7321f New spring overscroll in pagedView
> Using EdgeEffect in PagedView for overscroll
> Keeping RecentsView overscroll similar to S, by created a custom EdgeEffect

Bug: 183966408
Test: Manual
Change-Id: Ia547cf14ea315468b12a4ff5f389ac2d2beceafa
2021-04-22 16:28:30 -07:00
Jon Miranda
c9ad2dd6c7 Add new app close implementation.
- We remove the fling completely
- We set damping to 1 for x/y springs so there is no
  bounciness, and updated the stiffness and bounds to tighten
  up the path to the final location.
- During the animation, we translate all launcher content
  down
- When the x/y springs, and rect animator all finish,
  we use a spring to bounce the launcher content back up

- Added AppCloseConfig so that the entire animation can
  be defined in one location, with getter methods so that
  all the involved parties of the animation can access the
  current value.
- The animations are all defined linearly, and then
  interpolated over using a 3 point curve.

Building behind feature flag as we tune the values.

Bug: 173107751
Test: manual, visual
Change-Id: I83ad0fa2c4234cf30004240d43e191354595adc8
2021-04-22 16:11:11 -04:00
Steven Ng
3242720ce7 Inflate LauncherAppWidgetHostView directly in DragView
Also removes AppWidgetHostViewDrawable

Bug: 183609936
Test: drag-n-drop icons, folders, widgets, shortcuts

Change-Id: I26d8b05b9f9171037f2459fa2389e7e02c8ca6dc
2021-04-20 00:26:07 +01:00
Sunny Goyal
e36664d541 Turn DragView into a FrameLayout
Bug: 183609936
Test: drag-n-drop icons, folders, widgets, shortcuts
Change-Id: I030b36cd59ac6d0ced3263baca13108825ab2296
2021-04-20 00:19:06 +01:00
Adam Cohen
f7ca3b4e3f Update drag and drop visualizations
=> Remove the bitmap-based icon outline
=> Add simple cell based location preview of drop location
=> Round corners of page outlines
=> Get rid of page background for focused page
=> Update colors to use system accent color

Bug: 185163323

Test: manual

Change-Id: Id604c59201536967e25236f305eeeb0aafc9c022
2021-04-15 12:45:24 -07:00
András Klöczl
ea2b30d7fd Merge "Fix app close animation for two panel home" into sc-dev 2021-03-31 09:14:22 +00:00
Andras Kloczl
35d23a62f0 Fix app close animation for two panel home
Change getFirstMatchForAppClose to check all the visible
pages not just the page with the currentPage index.

Test: manual
Bug: 183606840
Change-Id: If5280797f821f7d10f82376aeef5e8eb4d352e2a
2021-03-31 00:09:07 +02:00
Andras Kloczl
3a4ba0bec3 Fix two panel home folder opening display issue
Change the rect calculation logic that is used to
display an opening folder. If multiple panels are
displayed then we calculate the union of the pages.

Test: manual
Bug: 181962118
Change-Id: I504f22890115ceebc16d60929149fe634bf820d0
2021-03-29 22:51:57 +02:00