Commit Graph

60 Commits

Author SHA1 Message Date
Sunny Goyal
e7da062d9a Fixing WidgetBottomSheet getting cut off around insets
Bug: 265639220
Test: Verified on device
Flag: N/A
Change-Id: If595fde8e84a226aef82f41caa0be913b22d99c2
2023-05-05 23:15:31 +00:00
Fengjiang Li
11f873da0b [Predictive Back] Add extra bottom space in taskbar all apps to home
Bug: 272797556
Test: manual
Change-Id: Ie84117d4211c382544c9ed8e1226bf70b2bd382d
2023-03-15 10:14:48 -07:00
Sihua Ma
16180801e8 Update widget picker row logic to resolve cropping
Using pixels instead of cell spans for calculating the widget picker row
binding logic.

Before: https://screenshot.googleplex.com/3uXX2m7xWh3om5t
Now: https://screenshot.googleplex.com/C593mrQfqTahNrQ

Test: Manual
Fix: 269790954
Change-Id: Ib591a6f6d3cf8b72766e0714b9bc8ceb86b2ba4f
2023-03-06 13:41:24 -08:00
Fengjiang Li
cb640da2bb [Predictive Back] Widget to home polish: show extra rows at bottom during animation
1. setClipChildren(false) for WidgetFullSheet and content view during animation
2. setClipToOutline(true) for WidgetsRecyclerView and provide ViewOutlineProvider to expand bottom by 5% of height
3. Override calculateExtraLayoutSpace() for ScrollableLayoutManager
4. Manually modify AbstractSlideInView#mContent's background drawable during scale animation

bug: b/260956481
Test: manual

Change-Id: Ic391639de887cf4a70bc4965dc0b1fd9bc12dd2c
2023-02-15 15:33:29 -08:00
Thales Lima
28a8b9f158 Add a scrim to AllApps and Widgets
Check the size of the scrim and draw on the bottom of AllApps and Widgets.
Add a padding to the bottom of AllApps and Widgets so content is above the scrim.
Change the color of nav buttons for better accessibility.
Correct width of the Widgets sheets to be the same as AllApps sheet.

Fixes: 221107977
Fixes: 214215594
Test: manual, HSV and Window
Change-Id: Ib7510ffcd80231de7fefcdef65b422174dd74593
2022-05-12 09:38:24 -03:00
Alina Zaidi
fc6837bb65 Do not reorder recommended widgets in widget picker.
This is to show them in ranking order sent by aiai.

Bug: b/201079509
Test: Added unit test in WidgetsTableUtilTest

Change-Id: I366ecaee8bc157aca185f633462d95fbd1dd180b
2021-09-29 15:52:47 +01:00
Steven Ng
6e54d62abd Allow WidgetsBottomSheet to wrap its content
Test: manual. See videos in b/200036849
Fix: 200036849
Change-Id: I64bc162834c715b48a4571ee95be7543e60bd6d8
2021-09-21 16:26:26 +01:00
Sunny Goyal
ed2a55f413 Removing widget preview caching
> All previews are generated on demand when the corresponding
  header expands
> Using ItemAnimator to animate layout changes when preview loads

Bug: 196238313
Test: Manual
Change-Id: I0cb859c8443c2c536399e4063f58baecfc7416ad
2021-08-17 17:50:30 -07:00
Steven Ng
24c16de329 Use 32dp as the content margin for widgets pickers in large screen
devices

Test: manual
Bug: 194369046
Change-Id: I7376eab59d57bdd9ccc8a64e9f321358e09ee579
2021-07-27 12:00:52 +01:00
Steven Ng
16c9ebabbf Merge "Fix shortcut size calcuation" into sc-dev am: 372e85106d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15259646

Change-Id: I5b37dc1971d67afbc3923774db2256459e389ae6
2021-07-13 14:10:25 +00:00
Steven Ng
6fe115b2ae Fix shortcut size calcuation
Shortcut size should be the size of all apps icon + padding

Test: Check shortcuts and widgets are shown without crash in the
      following surfaces with display & font set to largest and
      display cutout enabled. Repeat the same test with normal
      display setting and no cutout.
      1. Full widgets picker
      2. Bottom widgets picker
      3. Pin widget dialog
Fix: 193422438
Change-Id: Ibfebf94e92eed5e9cd1dd4196d98823b0e4dda6b
2021-07-13 12:46:31 +01:00
Steven Ng
452e8b8512 Correct # of cells estimation that can fit horizontally in widgets
picker

Fix: 192661517
Test: check widgets are fit correctly in both full & bottom widgets
      picker in portrait and landscape in different grid settings.
Change-Id: Ic1b0589b7ccf62ff1ec1fd5713b4249ba58246a5
2021-07-08 16:23:38 +01:00
Yogisha Dixit
658c5dafd4 Log widgets source.
Test: manual
(1) Upgrading to new DB version is successful (no errors thrown in logcat)
(2) Widgets that were added with the old DB version have CONTAINER_UNKNOWN as their source container
(3) Widgets that are added with the new DB version still log source container after reboot
Bug: 185778648
Change-Id: Iaa38f0be6bc4cb0d29842f9a2ea0d08de000c930
2021-06-30 17:48:14 +00:00
Steven Ng
fbe1836627 Extract common measurement in widgets pickers to its base class
Bug: 191644950
Test: 1. Open the full widget picker. Observe the clock widgets'
         previews are shown properly. Then, rotate the screen and
         observe the clock widgets' previews are shown properly.
      2. Open the bottom widgets picker for clock. Observe the
         clock widgets' previews are shown properly. Then, rotate
         the screen and observe the clock widgets' previews are shown
         properly.
      3. Repeat 1, 2 after changing the system navigation from button
         to gesture.
Change-Id: I564fc2ce0baf3103ae77499380ad69ec38ac6930
2021-06-28 14:55:27 +01:00
Steven Ng
53e8b46f66 Measure WidgetsBottomPicker again when the number of spans changes
Bug: In onMeasure, we calculate the number of spans that can be fit
horizontally. If the number of spans has changed, we re-organize
widgets shown in the table. However, after that, we didn't measure
WidgetsBottomPicker and its children again. As a result, the newly
added widget previews' dimensions are never measured.

Test: Long press clock app and then click widgets. Rotates the screen
      and observe widgets correctly shown.
Fix: 191644950
Change-Id: Iae94fba5b137807483e061d785b18d59defb013e
2021-06-24 18:16:05 +01:00
Alina Zaidi
dfa6aa828c Update bottom widget picker and pin widget dialog layout in landscape mode.
Bug: 189726613
Test: Manually tested
Change-Id: I048740f949571423ab53bbb01e7128d9981b1ce7
2021-06-15 14:27:57 +01:00
Alina Zaidi
9d24de1353 Add more education tips for widgets. (1/3)
Show Arrow education tip on WidgetsBottomSheet. This tip is shown only
once either in widgets full sheet or bottom sheet.

Test: Tested manually
Bug: 185354491
Change-Id: I6d770ed0906a5cb0f5bcfe6ae0cd327b790cf164
2021-05-25 10:50:02 +01:00
Alina Zaidi
d80cec62b4 Modify pin widget dialog open-close animation.
Pin widget sheet should open from bottom up and close on drag down.
Behaviour with navigation bar is similar to that of widgets bottom sheet.

Add a drag layer and reuse AbstractSlideInView for open-close
animation.

Test: Tested manually- opening, closing through dragging/ cancel button/
back button. Adding widget to screen by dragging/ add to home screen
button.
Bug: 186124244

Change-Id: I4b77d5bdd4ed1689b651847dfed69d19cafa7456
2021-05-14 17:59:50 +01:00
Steven Ng
57347bd6b7 Only show collapse handle when the bottom widgets picker is scrollable
Test: Go to contact bottom widgets picker. No collapse handle is
      shown because the content isn't scrollable. Go to Google calendar
      bottom widget picker. Collapse handle is hown because the content
      is scrollable.
Bug: 185134663
Change-Id: Ic6109c055a072aa1cf3521f829833fd5f4cece0f
2021-05-06 17:39:49 +01:00
Steven Ng
6fe7df3fa8 Fix WidgetsBottomSheet inset bug after orientation change
Reset the inset upon orientation change

Test: Open bottom widgets picker. Rotate the screen from portrait
      to landscape and then back to portrait. Observe the correct
      inset is set.
Bug: 183601302
Change-Id: I88432a49b2601df843fe33911fd7acdde66d06c4
2021-04-27 22:11:42 +01:00
Steven Ng
ca24216cc1 Fix drag-n-drop from the pin widget flow
Bug: 185011050
Test: Add a shortcut from Google drive app.

Change-Id: Iec5911a60cbb3ffa96228707539222cc1a5fda90
2021-04-13 15:42:12 +01:00
Pierre Barbier de Reuille
ad16a7b1df Restore drag&drop from WidgetsBottomSheet
Fix: 184917820
Test: By hand with various widgets
Change-Id: I488b960daaa83c38aa1bd3cac5b94767ff656103
2021-04-12 14:39:14 +01:00
Steven Ng
02c4f65e67 Fix scrolling in WidgetsBottomSheet
Popup container shouldn't intercept the scroll event if its child
scroll view isn't scrolled to the top yet.

Test: manual
Bug: 183599207
Change-Id: I434ba5e91b154e9862f22c08cd01c9d459e6707b
2021-03-24 14:51:19 +00:00
Steven Ng
867ff5f60c Update title of bottom widgets tray
Only use the "app name" instead of "app name widgets" as title
Remove "Touch & hold to move a widget" subtitle.

Test: manual

Bug: 179797520
Change-Id: I7a5954af73aa5b480096e93ade3520cef6c93f17
2021-03-22 22:23:46 +00:00
Steven Ng
267270e859 Align widgets previews top to the table layout
Test: Manual

Bug: 179797520
Change-Id: I0716432e72327b825619bc35d55cb74d9621ee6a
2021-03-22 15:26:13 +00:00
Steven Ng
ae6b34811b WidgetCell & LiveWidgetPreview cleanup
The fixes are:
1. For widgets shown in TableRow, aligns them center vertically.
   This is useful when widgets of different height are shown in
   the same row.
2. Remove background color from WidgetCell
3. Re-enable swipe in FullWidgetsSheet
4. Use the WidgetCell image as the single & long press area because
   1. Previews are now scaled to their default size. The touch area
      should already be larger for widgets that are bigger than 2.4
      cells
   2. WidgetCells also render description. If the user long press the
      description area, the drag view will not align in the middle of
      the user touch / drag area.

Test: Drag-n-drop widgets from FullWidgetsSheet, BottomWidgetsSheet
      and pin widget flow.
      In FullWidgetsSheet, swipe left and right to switch work /
      personal tab.

Video: https://drive.google.com/file/d/1Ur7PwF1a7iwGGRTZczfc0BSVu-Ta6-Vm/view?usp=sharing

Bug: 179797520
Change-Id: I6fe4bc88d1e1b35b1819d8d7f046105f5ed27043
2021-03-08 21:22:08 +00:00
Steven Ng
11773f47d2 Show widget previews in their expected cell sizes
1. Show widget previews in their expected cell sizes.
2. Update the bottom picker to use a table layout rather than
a horizontal scrollbar.
3. Move the title and cell size description to the bottom of
the preview.

Test: Run AddConfigWidgetTest
      Manually open full and bottom widgets picker and observe
      widget previews.
      Video: https://drive.google.com/file/d/1K8A8hK5B4FgPTsX3cb-Yt4a_VjI0pk-w/view?usp=sharing
Bug: 179797520
Change-Id: I938612cb2e2477ce4a3a2d6c8891a0a36fc0978c
2021-02-26 17:47:32 +00:00
Steven Ng
0be3a615d9 Render preview layout in full widgets sheet and bottom widgets sheet
Video: https://drive.google.com/file/d/1gRE0axaq6tm3R_gjSon0RR5lC8HCmwee/view?usp=sharing

Test: Install a sample app which provides a preview layout.
      Go to full widgets sheet to observe widget previews are correctly
      displayed for bitmap previews, layout previews and placeholder
      previews. Repeat the same for bottom widgets picker.
      Pin a widget from a sample app which provide a custom RemoteViews
      preview, observe the custom RemoteViews is correctly rendered.

Bug: 179797520
Change-Id: I2ccd1f77b54a2430d842ee25349fa6e54b9159dc
2021-02-16 19:34:03 +00:00
Hyunyoung Song
6b670d62df Good riddance UserEventDispatcher [1/n]
Bug: 165675920
Change-Id: I237ed4243e1724b3c370c5660673bb3966bf4811
2020-08-24 21:19:09 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
f3ac703256 Moving animation config so a separate class
Using PendingAnimation for animation builder.
This will allow us to easily add SpringAnimation to stateAnimation

Change-Id: I8d88489a5da6fc85747ef9be7c13858b441cd28a
2020-03-16 19:36:36 -07:00
vadimt
1b383af652 Not using magic constants for navbar height
Change-Id: I6783b8a2ebb059ce35748d8c3e818cbe732ff40d
2019-05-08 17:20:34 -07:00
Tony Wickham
9791bd1555 Swipe up on nav bar to go home from -1 and widgets
More specifically, any window (e.g. qsb search) or AbstractFloatingView.

NavBarToHomeTouchController now implements TouchController directly instead
of AbstractStateChangeTouchController, as it not only dealing with
launcher states. This makes it easier to override intercept logic to
handle cases like not having window focus, for example.

AbstractFloatingViews can createHintCloseAnim() to play an animation
hinting that it is about to be closed by swiping up. Widgets sheets use
this to pull back similar to the all apps transition to home.

Bug: 129976669
Change-Id: Ie157b978d9f1ee36d5fd32cea72ec02ce40878c0
2019-04-09 10:53:24 -07:00
Sunny Goyal
202ae0b0f5 Sending notification and widget changes to a listner so that
popups outside Launcher can also listen for changes

Change-Id: I2eb2d8374a6806381e1c682eaef3cc35f30693df
2019-02-11 16:23:11 -08:00
Sunny Goyal
1642f7173f Removing ViewScrim and cutom drawing code
Bug: 109828640
Change-Id: I2cab0215a32c2ca6bc331d48083fcc00ada05c3b
2018-09-18 11:41:02 -07:00
Sunny Goyal
db6cdb07e8 Exposing some private methods to easily customize widgets popup
Change-Id: Ie7bd879200b1f14d472ff03fd64429930651a39f
2018-08-02 14:41:08 -07:00
Sunny Goyal
de75321542 Fixing wrong accessibility focus when opening a floating view
> Using common logic for announcing a floating view for widgets and folders

Bug: 79091095
Bug: 79748886
Change-Id: Ibb3fe48e68e724f50d69f51a03d3b35ad0baf625
2018-05-16 13:11:00 -07:00
Sunny Goyal
6639a5dfe0 Updating the scrim and landscpae ui
> Instead of views, using a custom class to draw the color scrims
> All-apps has full screen UI
> Quickstep does not have search box in landscape

Bug: 73085356
Change-Id: I360a78a2ade0134daad29fe712796cd39a381fbb
2018-03-01 11:23:46 -08:00
Sunny Goyal
e15e2a8267 Adding an empty page in Recents view corresponding to workspace
The page is aligned to the workspace card and shows a widgets button
in the empty region

Change-Id: I479c47a2fbac4b3ef1aaf833d9fe82b5d7e10ddc
2017-12-19 10:06:15 -08:00
Sunny Goyal
5bc6b6f14c Consolidating various interpolators
Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
2017-10-26 16:38:55 -07:00
Sunny Goyal
aeb1643ec6 Launcher state management cleanup
> Removing Widgets and related states
> Fixing different durations being used when opening/closing all-apps
> Removing some unnecessary object allocations when changing state without animation
> Differentiating widget bootm sheel and full sheet in logs

Bug: 67678570
Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
2017-10-17 12:42:08 -07:00
Sunny Goyal
f1fbc3fbe7 Converting widget panel into a floating view
> The widget panel is only inflated when needed
> Using the swipe up/down interaction for widgets tray
> Removing additional view wrappers from all-apps
> Widget tray is preserved across activity recreation
> Launcher no longer has WIDGET state, the actual code around
  the states will be removed in a follow-up cl

Bug: 67678570
Bug: 67585158
Change-Id: Ia29a7c33ec81e6c53cc24e2906b7022b6f41755b
2017-10-13 18:47:54 -07:00
TreeHugger Robot
661e558321 Merge "Removing unnecessary layout pass happening due when chaning gradientView visibility" into ub-launcher3-master 2017-10-05 22:09:24 +00:00
Sunny Goyal
3792096688 Allowing the widgetBottomSheet to be dragged
even when the touch is started from outside the panel

Removing various instanceOf checks in onNewIntent and onBackPress
and moving all the corresponding logging in the FloatingView
This simplifies handling of panel specific log and avoids
missing a particular panel type in the if-else statement.

Bug: 64751884
Bug: 64751923
Change-Id: I98f5aae18560a64be73c9efcf495479740d49a00
2017-10-02 16:18:52 -07:00
Sunny Goyal
d66e3b6a65 Removing unnecessary layout pass happening due when chaning gradientView visibility
Change-Id: I0d8f0c2c995885143156a27536b0a2185d5eb0b8
2017-10-02 15:27:21 -07:00
Tony
3b7c865e04 Merge commit 'refs/changes/84/2659484/1' of sso://googleplex-android/platform/packages/apps/Launcher3 into am-860fd7dd-f3a3-4500-8fc2-78d473322b94
Change-Id: I0b39a20cee47d4aba4a033196db3df78b2357b7b
2017-08-03 17:06:19 -07:00
Tony Wickham
2bc5c995f6 Add new GradientView just for WidgetsBottomSheet
Reusing the one behind all apps caused problems when
opening widgets sheets from all apps.

Bug: 64344341
Change-Id: Ia964d8456645c78614f94693f9538dbac4f566a0
2017-08-03 15:42:03 -07:00
Mario Bertschler
254bd42729 Merging ScrimView into GradientView
Less banding, less drawing for All Apps Transition.

Bug: 63873246

Change-Id: I6c7c856e2939a10db7e44b266c1d6d51334fd152
2017-07-26 14:33:22 -07:00
Mario Bertschler
a0465afe8d Merging ScrimView into GradientView
Less banding, less drawing for All Apps Transition.

Bug: 63873246

Change-Id: I6c7c856e2939a10db7e44b266c1d6d51334fd152
2017-07-26 13:23:34 -07:00
Sunny Goyal
b72d8b2c8b Using common fling detection logic for notification and all-apps
> Refactoring SwipeDetector to both allow vertical and horizontal swipes
> Using SwipeDetector and common overscroll effect for notification swipes
  instead of a separate logic

Change-Id: Ib706ee179811ade59ddb68184e1c202365d147c4
2017-07-20 01:33:10 -07:00