Commit Graph

88 Commits

Author SHA1 Message Date
Tony Wickham
00f89fbbf6 Fix taskbar drag view scale when returning to original icon
- Use getSourceVisualDragBounds() if the target view is BubbleTextView;
  this accounts for padding as well as extra ring inset for
  PredictedAppIcon
- Also ensure we always use the final drag view scale when switching to
  the system drag and drop, instead of using the current scale which
  might be in the process of animating

Test: drag regular and predicted icons in taskbar, but drop it in a
region that doesn't accept it (e.g. the taskbar itself), check that the
return animation scales and offsets more correctly than before
Bug: 269814838

Change-Id: Ie8398b2617340e1d2568773563aa0263a3366940
2023-02-22 03:41:03 +00:00
Sunny Goyal
239d6e9b8d Adding support for customizing shortcut pinning logic
> Allowing support for overring shortcut badge
> Updating pendingShortcutInfo so that the
  handler can be easily overridden

Bug: 268253894
Test: Verified on device
Change-Id: I3184cb6494bc98c7eed33798b35b4e6e6a1e7ddc
2023-02-17 18:07:23 +00:00
Federico Baron
7f823d10b4 Fix bug where dragging icons in folders causes error
The error was caused by delta being larger than the range, which leads to an UnsupportedOperationException: "Final position of the spring cannot be greater than the max value". With this change, delta will never be greater than range.

Fix: 261674632
Test: 1. Settings > Display > Display size and text >>> Set display size to the biggest
2. Make folder
3. Go to landscape mode
4. Open folder
5. Quickly drag icon in folder
6. Verify that Launcher doesn't stop and drag is successful

Change-Id: I6c81755750acf0de8693b98caad8e7dab3e9f58a
2022-12-22 22:51:28 +00:00
Sihua Ma
ecc272447c Fill the fade-in ImageView with its content for the cross fade animation
The cross fade function of DragView tries to match the shapes of the fade-in and fade-out views. However, ImageView (the fade-in view) by default only tries to match at least one axis between the content (the final view) and the bound (the ImageView bounding box). We need to make sure that the content fully fills the bound to exactly match the shapes.

Test: Manual
Fix: 221496442
Change-Id: I7c142d52b7bfbd0e266a917c27cbd40691fbf3c2
2022-06-22 20:59:32 +00:00
Jon Miranda
a82a7dc205 Clear all DragView in onResume
- Multiple users reports view getting stuck on screen. This CL
  clears all DragView when user leaves launcher.
- Moved to onResume to not interfere with start up time,
  and also aligned with when we remove AbstractFloatingView.
- Root cause still undetermined, but happens enough that it warrants
  a temp fix.

Bug: 162636845
Test: drag and drop configurable widget
      (widget that gets dropped then opens up a
       configuration activity)
Change-Id: I532b5274a1308c53f67c23c5c8ca07f2b7f9802c
2022-05-10 11:48:32 -07:00
Schneider Victor-tulias
fb252e7ce1 Add taskbar TAPL tests
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices

Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
2022-03-10 13:02:35 -08:00
TreeHugger Robot
49141ccf2e Merge "Revert "Clear all DragView in onSaveInstanceState"" 2022-02-17 20:45:46 +00:00
Jon Miranda
0aa263c5a0 Do not theme icons when the original view is not themed.
Fixes bug where animations uses themed icons in All Apps, where the
icons are not themed.

We want the DragView themed since all valid drop locations will have it
appear themed.

Bug: 215650713
Test: open/close an app from All Apps
Change-Id: I9969ce4921831dd12858ed9b0fe64379e9e3b188
2022-02-15 13:16:22 -08:00
Jon Miranda
baf1ef55ab Revert "Clear all DragView in onSaveInstanceState"
This reverts commit 14d6771aae
to fix bootline regression.

Bug: 210383463
Test: manual
Change-Id: I5a0dadee59bfd6b5a164fd2ca3ecdd1885cb4134
2022-02-14 20:26:40 -08:00
Jon Miranda
5902269fed Merge "Clear all DragView in onSaveInstanceState" into sc-v2-dev am: 7ac2a71b94 am: 48d82e2c19
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16425110

Change-Id: I8e7d3a99a70a50352ed51674a7aa9e0c4f970cea
2021-12-10 19:11:28 +00:00
Jon Miranda
14d6771aae Clear all DragView in onSaveInstanceState
Multiple users reports view getting stuck on screen. This CL
clears all DragView when user leaves launcher.

Root cause still undetermined, but happens enough that it warrants
a temp fix.

Bug: 162636845
Test: manual
Change-Id: I532b5274a1308c53f67c23c5c8ca07f2b7f9802c
2021-12-08 17:47:33 -08:00
Sunny Goyal
d872a97bd0 Updating icon badging logic
Bug: 201682172
Test: Manual
Change-Id: I57421b0c77e12f1cd464e532d2a1383c2cf93981
2021-12-02 22:14:25 +00:00
sfufa@google.com
1c5e607940 [Search] Scale up small search icons on drag start
Bug: 199341710
Test: manual
Change-Id: I243c3e84e3093d4a9c605b187a625c0580d9933f
2021-10-05 18:09:26 -07:00
Sunny Goyal
e6935d895a Merge "Simplifying color extraction registration logic" into sc-v2-dev 2021-07-29 06:53:15 +00: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
Tony Wickham
27ab9d96eb Let TaskbarDragView scale up before switching to system drag view
Test: Long press taskbar icons, ensure they aniamte the scale up
Fixes: 182981908
Change-Id: I573fe66c93ebf995b3f56f2c003dee987687b6a7
2021-07-28 08:03:14 -10:00
Steven Ng
f3d23f67bd Scale widget previews
This CL covers drag requests initiated from Launcher.java but not from
other activities.

Test: Manual
Bug: 193144010
Change-Id: Ieb862d689afe81a5b35aedeb9a277de08c775230
2021-07-15 12:22:37 +01:00
Pierre Barbier de Reuille
2fa6e35341 Merge "resolve merge conflicts of 25e37a85ae to sc-v2-dev" into sc-v2-dev 2021-07-01 11:50:42 +00: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
Steven Ng
39a87fda17 Fix widget animation truncated at drop if a widget is resized
Set the widget outline to DragView rather than the content view
hosting a Picture record of AppWidgetHostView at drop.

Bug: 191646816
Test: Manual
Change-Id: I901743f8ba392de37f3ef69ca386c4b36bfebd7f
Merged-In: I901743f8ba392de37f3ef69ca386c4b36bfebd7f
2021-07-01 09:22:25 +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
Tony Wickham
c7cbf254f3 Let DragView use ActivityContext instead of Launcher
- Make DragView abstract and extended by LauncherDragView for the explicitly Launcher-specific parts.
- Some other methods like Utilities.getFullDrawable() now accept (Activity)Context rather than Launcher.

Test: Compiles and runs, manual drag and drop
Bug: 182981908
Change-Id: I77b7a2e48ce864dd711c3232217fdba4d60c546f
2021-05-25 15:35:55 -07:00
Sunny Goyal
80b25cfd5d Fix widget drop animation
When removing content from the dragView, replace it with a snapshot
so that the preview remains the same

Test: Drag a widget and observe the drop animation is shown.
Bug: 187423667
Change-Id: I1e726f50a2b3d0a5f1562297cccf47a435affd02
2021-05-12 09:58:05 -07:00
Sunny Goyal
9ab43772ab Adding support for using themed icons on workspace
Bug: 183641907
Test: Manual

Change-Id: Ieda7e73b3ae4dfe3009e3f23754aff5f8826a967
2021-05-03 20:00:38 -07: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
Sunny Goyal
572aca4ce2 Moving some common functionality to IconLoaderLib
Bug: 183641907
Test: Manual
Change-Id: Icfc7ebb140e4e1678b0715beee2e0e513e707b9e
2021-03-25 10:06:53 -07:00
Steven Ng
30dd1d65f6 Apply local color extraction during drag-n-drop
Test: Drag a test widget around and observe local extract color
      is applied.

Bug: b/182282587, b/182816217
Change-Id: If63a9d91ceb2102d5d913bca85997b8be07b1adf
2021-03-17 18:10:51 +00: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
Sunny Goyal
eaf7a95546 Changing minimum supported Launcher version to 26
Change-Id: I49fcf874430ac53c3246371e179fbd828e14e4da
2020-07-29 17:30:19 -07:00
Sunny Goyal
35e7d38681 Abstracting out state handler logic into base classes so that it can
also be used in different activity

Change-Id: Ic5e60b21e1429c71f1cd4e7041e70bf4fc9761b7
2020-05-11 16:38:26 -07:00
Sunny Goyal
aeec80ddbb Creating default implementation for state lisnter method
> The transition start is used rarely

Change-Id: I0d33f0f6372eb4ef89bfbb66968612693b7c6033
2020-04-24 15:41:29 -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
9b18010990 Decoupling some drag and drop code handling
> Removing some special checks around accessibility drag
> Unifying folder alarm code path for accessible and normal DnD
> Maintaining mDragStartTime inside the dragDriver instead of the callers
> Simplifying some accessibility callbacks

Future cl will create a Accessibility DragDriver and unify it with
other DnD flow

Change-Id: I1919ef218de0174678110f271b450bcb9aaf4a5c
2020-03-18 12:41:42 -07:00
Sunny Goyal
14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00
Sunny Goyal
6fe3eec95c Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
2019-08-20 14:36:17 -07:00
Hyunyoung Song
f69426c484 Add shape detection logic only for circle icons
b/119330044

Change-Id: I93042effa8417167d844f073275e8b941e861e60
2019-06-03 14:05:20 -07:00
Sunny Goyal
9fd2d0ee0a Fix crash when launching some apps which require icons to be loaded on
the model thread

Change-Id: I945a94c458d872b41e44b4b3a2d023f85d8a7c88
2019-05-23 18:13:43 -07:00
Sunny Goyal
5686333117 Adding a utility class to cache views at an activity level
Bug: 122345781
Change-Id: I9a939e0b19c06c1089c1ceb515f8b97fb5dbb49e
2019-05-22 14:23:12 -07:00
Sunny Goyal
dedda05568 Using a proxy activity for startActivityForResult
This ensures that the home task is never blocked by a different task

Bug: 74500048
Change-Id: I01fd26f1d6242e39b2d8fabac5e064b748aebe62
2019-05-15 16:33:06 -07:00
Jon Miranda
4028575ba0 Fade in badges on top of icons after swipe up animation.
Bug: 123900446
Change-Id: I54e367e0be72781e24d13ec6ea64dbddd85fb0bd
2019-05-15 09:37:24 -07:00
Sunny Goyal
6bbf6004f8 Removing ShortcutInfoCompat and directly using ShortcutInfo
Change-Id: I2842689e192a206c0d31558c8126eae1c7904598
2019-04-22 15:39:40 -07:00
Jon Miranda
3145839f65 Fix bug caused by trying to set background to AdaptiveIconDrawable.
Solution is to flatten the drawable when useDrawableAsIs is true.

Bug: 123900446
Change-Id: I3b86db201ef4fccf10ac42ec367c0538573b7ad8
2019-03-04 20:54:53 -08:00
Jon Miranda
1a49fb5733 Transform closing window to icon on workspace using adaptive icons.
With adaptive icons, we can have FloatingIconView match the shape
and size of the closing window, regardless of the icon shape.

FloatingIconView starts off as a rounded rect (same corners as task view)
and then morphs into the icon shape using FolderShape#createRevealAnimator
in reverse.

Decided to add FeatureFlag.ADAPTIVE_ICON_WINDOW_ANIM since there are still
some issues with folders, badges, and a visible jump when swapping the
FloatingIconView with the original icon.

Bug: 123900446

Change-Id: I94969eea6d5f4b932a84a11eb403611276042b46
2019-03-01 12:48:25 -08:00
Hyunyoung Song
848d86ad32 Remove shape detection logic for icon legacy treatment
Bug: 117991192

Change-Id: Ife2047e7b36099daa4526c471e5c70554f068de1
2018-10-22 15:08:50 -07:00
Hyunyoung Song
cda96a5b43 Setup make icon-loader library
Bug: 115891474

Test: make -j10 icon-loader
Next step: Launcher will depend on icon-loader in next CL

Change-Id: I797ddb857cf8be79f3be6ca2f174c593ca3713a5
2018-10-19 14:33:46 -07:00
Hyunyoung Song
48cb7bc7a4 Move IconNormalizer/ShadowGenerator/LauncherIcons to icons package
Bug: 115891474

Sending out the package name changing CL first before I make
LauncherIconsHandler and tests around it.

Change-Id: Ic10479a06333e1435b392a7072cd08782e710cbd
2018-09-26 11:57:37 -07:00
TreeHugger Robot
e1c4a90635 Merge "Migrating to android-x" into ub-launcher3-master 2018-08-14 22:53:40 +00:00
Sunny Goyal
d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
Sunny Goyal
f0b6db7fa8 Removing static launcher activity dependency from FirstFrameAnimationHelper
Static dependency does not work in the presence of multiple activities and
when the main activity is not Launcher (eg in fallback recents). Instead
creating FirstFrameAnimatorHelper on demand for individual animations.

Change-Id: I17bb69bbaaca92f0db994fb56fd784302c57d543
2018-08-13 16:10:18 -07:00