Commit Graph

59 Commits

Author SHA1 Message Date
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
Schneider Victor-tulias
fff7cef9f1 Remove unused debug logs
Removing debug logs for bugs that have already been closed. These logs are filling up the logcat buffer and impeding in other test investigations.

Flag: not needed
Test: Tapl tests
Bug: 260260325
Change-Id: I4d69b904f2ea79d758cf6bef7d90d172f2eb2a91
2023-04-25 11:00:37 -07:00
Federico Baron
b326859f27 Merge "Prevent two pane widget picker code from reaching foldables" into udc-dev 2023-04-11 21:10:56 +00:00
fbaron
a3dbce41e3 Prevent two pane widget picker code from reaching foldables
Currently, there's a few sections of the code that are intended to only be reached by tablets in landscape mode that can be reached by unfolded foldables. Here, we fix this so it no longer occurs.

Bug: 277102339
Test: Verify widget picker works correctly on tablet
Change-Id: I1f2bc99072aff6d852f9ce658ab00fa33b9e02b5
2023-04-06 09:38:15 -07:00
Brian Isganitis
13e672aa76 Make navbar scrim taskbar background if taskbar is enabled.
This ensures the navbar buttons are visible on large screens where All
Apps or Widgets picker are bottom sheets.

Test: Scrim is taskbar background color on devices with taskbar.
Bug: 264463659
Change-Id: I37890c0f542db625f9aeae7648bbaed064c4d240
2023-03-31 16:40:49 -04:00
Federico Baron
002317f60c Add subclass for two pane widget picker
Since the regular widget picker and the widget picker for tablet diverge quite a bit, we added a child class for it that extends WidgetsFullSheet.java
There should be no functionality changes with this CL, it's purely changes in code structure.

Bug: 256684299
Test: Turn on LARGE_SCREEN_WIDGET_PICKER flag and verify nothing changes compared to ag/20508230.
Change-Id: Ie0e93534d7b93017cc11a05f67728155d22951f9
2023-03-24 11:48:20 -07:00
fbaron
d11a9e1d08 Widget picker two pane polish
-increase width of two pane picker
-center widgets when they're too few to overflow
-make background stretch out all the way to the bottom even when there aren't multiple widgets
-fit many widgets in one row if they fit

Bug: 256684299
Test: open widget picker and notice that all the listed fixes match the last figma added in the bug
Change-Id: Id4e8445f4ffe484c24c04fd9d1b4ffbf93a00bb2
2023-03-21 16:49:45 -07:00
Sihua Ma
a245873fed Merge "Update widget picker row logic to resolve cropping" into tm-qpr-dev 2023-03-07 18:42:46 +00: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
Brian Isganitis
fdd044e16e Expose IS_RUNNING_IN_TEST_HARNESS as static method.
This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
2023-03-03 00:17:33 +00:00
Alex Chau
3d2c062567 Change wallpaper depth in widget picker
- Also changed widget picker open/close duration, refactored the values into DeviceProfile
- Generalized MultiAdditivePropertyFactory to accept aggregator as parameter

Bug: 240580498
Test: manual
Change-Id: I6886ca514593e404b8d7b0e8ed44f20ec2b77c73
2022-09-13 12:20:56 +08:00
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
Thales Lima
4f3cf5d05f Fix widget span
Need to take the horizontal margin of the view into consideration.

Fix: 233302799
Test: manual
Change-Id: I5f584977db85d5436b22c3701f586a5b079099ae
2022-05-24 14:49:26 +01: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
Schneider Victor-tulias
9b6babf839 Translate the 3 navigation buttons to/from their in-app position when animating to/from the -1 screen, all apps and widgets.
Bug: 221455508
Test: opened all apps, widgets, -1 screen, notifications shade and keyboard in various combinations and orders; locked screen, launched app, returned home with the back/home buttons, opened overview
Change-Id: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
Merged-In: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
(cherry picked from commit 9c1a452a1d)
2022-05-02 18:45:01 +00:00
Andras Kloczl
142b054e06 Tune widget picker bottom sheet VisD for large screen
Test: Open widget picker by long pressing the home screen.
Open app specific widget picker by long pressing an app icon
that has widgets. Try both landscape and portrait, also on
phone/tablet/foldable.
Bug: 214215594

Change-Id: I7b4b3a8d7421f1d4df84d49a18b465693a17bd7b
2022-03-15 14:01:59 +00:00
vadimt
89d9423321 Logging for drop bar not appearing for dragged widget
Test: presubmit
Bug: 195031154
Change-Id: I19494fc3d6d9db252570697c057fdee7f7d44521
2021-09-01 12:33:00 -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
2b90d043f6 Fix scaling on widget previews that have width / height set to
wrap_content

If the widget preview has width / height set to wrap_content, we should
set the layout param width / height to the exact dimension after
measurement. Otherwise, we will end up clipping the previews.

Test: manual
Fix: 193144010
Change-Id: I101f7c6d3dbd264fee448b85c54029d5650d6630
2021-07-22 11:19:25 +01:00
Steven Ng
2b123833ad Scale RemoteViews from requestPinAppWidget shown in AddItemActivity
Test: manual
Bug: 193144010

Change-Id: Ia2b64c32f92a43a8d71ee82f164543e1e624814a
2021-07-15 17:59:45 +01:00
Steven Ng
12b2742780 Merge "Restricts the width of pin widget dialog to 89% on large screen devices" into sc-v2-dev 2021-07-09 09:38:33 +00: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
Steven Ng
a37de9e141 Restricts the width of pin widget dialog to 89% on large screen devices
Test: manual
Fix: 193116981
Change-Id: I6ff8920a3698e6c11729b01a140a6942268f67cc
2021-07-08 16:06:50 +01:00
Steven Ng
4edea3a6a6 Set the widgets pickers' width to at most 80% of screen width on
large screen devices

Test: Phone: Open the full widgets picker and observe the width of
      the widgets picker fills the device screen width.
      Large screen devices: Open the bottom widgets picker and observe
      the width of the widgets picker only takes at most 80% of the
      devices' screen width.
      Same behavior is observed for bottom widgets picker.
Bug: 186425352
Change-Id: I801b73ea031a290fb6a7295dca826ac91841877e
2021-06-29 16:24:34 +01: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
Alina Zaidi
ecdf6575ec Add more education tips for widgets. (3/3)
Show tip on reconfigurable widget in launcher.

Bug: 185354491
Test: Manually tested tips in widget picker, all apps, and
reconfigurable widgets tip.

Change-Id: I08154c944285cac6a21c3ef4aafd878bbbccf44b
2021-06-10 14:23:47 +01:00
Alina Zaidi
8796707172 Update scrim in widget pickers.
Also adjust padding in pin widget bottom sheet.

Test: Tested manually
Bug: 189802334
Change-Id: Ic25547ab1519139afdbf07aaefeb9168cf3501ff
2021-06-02 20:39:28 +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
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
Steven Ng
e973d6f31f Render RemoteViews in LauncherAppWidgetHostView
Test: Pin a conversation widget from a notification. RemoteViews are
      rendered with the default size. Drag-n-drop from the pin widget
      dialog works fine.
Bug: 185934141

Change-Id: Idb76cce2807e55e7b42e2e044712519857beb202
2021-04-21 15:43:51 +01:00
Pierre Barbier de Reuille
ad41a56166 Stop trying to draw a view not attached to the view tree
The behavior of the framework when we try to do so is undefined. In our
case, it almost work, but no clipping is applied, which is a problem for
Android S (before that, widget couldn't use clipping in the first
place).

Instead of drawing the view through a drawable, this really add the view
and adds also a badge ImageView for badges instead of drawing them
indirectly.

Note that, temporarily, we have to re-allow drawing the view after it
has been attached, but the underlying framework bug being fixed, this
should be fine (I tested it and it really seems to be).

Bug: 183609936
Test: Using hand designed app (see bug)
Change-Id: I929ef8fc81c98c49406f2d940cd5efc28319886d
2021-04-07 15:51:43 +01:00
Steven Ng
0226d1ad79 Replace DragView bitmap with drawable
This is a preliminary work for local color extraction. In order to
apply local colors extracted from wallpaper to AppWidgetHostView
during drag, we need to hold a reference of the dragging
AppWidgetHostView.

In this CL, the following changes are made:
1. Instead of using bitmap image directly for icons, folders, shortcuts,
   legacy widget drawable preview, a BitmapDrawable wrapper is
    introduced.
2. Introduce a WidgetHostViewDraggableDrawable which draws
   LauncherAppWidgetHostView directly to canvas. No more bitmap
   generation overhead.
3. Remove drag outline from the drag logic because this will be replaced
   by a new grid color hint UI: https://screenshot.googleplex.com/7jBEVeuxFecFKKT.png

Test: Add: add widgets, shortcuts from widgets tray.
           add icons from all apps.
           create folder.
      Drag: drag existing widgets, shortcuts, folders and icons around

Bug: 182282587
Change-Id: Ia45ff756ea5bb80cf0761f0727a9453d50c204c0
2021-03-16 00:02:38 +00:00
Steven Ng
7ec893fb8e Update widget toast strings
Test: Tap on widgets and shortcuts in all widget tray and observe
      correct string is shown.

Bug: 179797520
Change-Id: I0e274017d4af1de506afbb819ab91f6575d7bb8e
2021-03-10 17:35:51 +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
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
Samuel Fufa
ffd2b6d25e Search support for widgets with config activity
Shows widget preview in search if widget requires config.

preview: https://drive.google.com/file/d/1q1ROu7-OUGfskDMRxXPNQMdr3T-WMMkv/view?usp=sharing
Bug: 168321831
Test: Manual
Change-Id: I6c1c168ebac4ce33a4234e8a417eba789f664f43
2020-11-10 10:16:02 -06: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
vadimt
e277fec466 Events checking for long press events
Also fixing duplicate long press events resulting from both framework
and Launcher own detection reporting long presses.

Change-Id: Ib46de5bd60850f1c5578992c8c1172ddbc0961f3
2020-03-31 19:08:17 -07:00
Samuel Fufa
a579ddc9c8 Refactor logging to capture Target hierarchy
Instead of creating a fixed number of targets, we now pass an ArrayList
of targets to. Any class implementing
LogContainerProviders#fillInLogContainerData can setup it's own target
and add it to the ArrayList, It can also pass the ArrayList to other
LogContainerProvider to capture full Target hierarchy.

Bug: 147305863
Change-Id: I0063c692120fb9e1cff2d8902c5da972d0623418
2020-03-06 13:49:19 -08:00
Samuel Fufa
ccebfbe273 Clean up work profile
This includes
- Dismiss work edu on launcher state change
- Remove work tab flash on first setup
- Make edu bottom sheet adopt theme color
- Fix Work toggle bottom inset


Bug: 149200572
Bug: 149197172
Bug: 149199058
Bug: 149215103
Bug: 149198955
Bug: 145595763
Bug:149481723

Test: Manual
Change-Id: I39a30782b80fd3a66bede55754fa30a940d2caee
2020-02-19 19:33:09 +00:00
vadimt
2ea348ff87 Removing flake when 2 long-press events happened on single long press
There is some unknown to me logic in Launcher that sometimes duplicates
the long-press event . This causes flakes whenTAPL expects one long
press, but the actual sequence is 2 events.

That duplication logic seems to be related to race conditions is is hard
to repro. For now, just removing long-press verification. I'll start
with more deterministic events.

Bug: 147806932
Change-Id: I03841131bf8cae88011824f660f2c7b1906592f4
2020-01-16 17:10:55 -08:00
vadimt
252d012ed0 TAPL: Verifying some interactions with system
Investigation of TAPL failures, especially flakes is complex, partially
because it’s hard to tell whether it’s Launcher who is wrong or the
system.

We need to introduce a framework that looks at Launcher interaction with
the system and reports when interactions deviate from the expected
course, and who made the first wrong step.

This is first, proof-of-concept CL.

It analyzes long-press events. We had multiple cases when long-presses
didn’t happen or happened unexpectedly.

Launcher registers the events, TAPL retrieves and compares against the
sequence of expected regular expressions. This diagnostic is used when
something fails and at the end of public methods.

Change-Id: I07aa3a027267c03422c99c73ccd8808445c55fe8
2020-01-15 13:31:18 -08:00
Sunny Goyal
73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08: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
8c48d8bea6 Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
2019-01-29 11:29:52 -08:00
Sunny Goyal
066ace1b88 Replacing setAlphaComponent with setAlphaComponentBound for better animation interpolation
setAlphaComponent throws expetion for invalid range, which can cause brashes in overshoot
interpolation

Bug: 118390004
Change-Id: Ic9c5ff3d660eba353b982c4c47ccfaf329b3e296
2018-11-06 09:59:03 -08:00
Sunny Goyal
1642f7173f Removing ViewScrim and cutom drawing code
Bug: 109828640
Change-Id: I2cab0215a32c2ca6bc331d48083fcc00ada05c3b
2018-09-18 11:41:02 -07:00