Commit Graph

99 Commits

Author SHA1 Message Date
Sebastian Franco
5bf936ac16 Preventing the text on ButtonDropTarget.resizeTextToFit size to go below 0
Bug: 260984829
Test: atest HomeScreenEditStateImageTest
Change-Id: I4aba76de512aedf5b4c921593fe43099700eb773
2022-12-02 14:05:24 -08:00
Pat Manning
e63dd25a54 Use full screen width for drop target buttons to support higher screen densities from truncating text.
Scale oversized text down if after all computations it will still be truncated at higher densities.

Fix: 239401464
Test: manual. To follow up with screenshot test: b/241386128
Change-Id: Ie088d0631b0d13beb2d9f9d5396a56f7b971dee1
2022-08-30 14:57:42 +01:00
Alex Chau
158caf466c Only setup SecondaryDropTarget in onDragStart
- In LauncherAccessibilityDelegate.getsupportedActions, it calls supportsAccessibilityDrop on each button regardless if DropTargetBar is visible or not. SecondaryDropTarget.supportsAccessibilityDrop attempts to setupUi which causes measure/layout of DropTargetBar (as well as DragLayer) each time LauncherAccessibilityDelegate.getsupportedActions is called
- To avoid this, only setupUi in onDragStart. In other cases don't call setUi.
- Also fixed a bug that when accessibility is on, upon dragging a suggested app, the secondary action suddenly changed to Uninstall

Fix: 233383721
Test: Enable accessibility, observe no excessive amount of onLayout is called on DropTargetBar
Change-Id: I4d1a00d320cceed81fa1312b5fc5f1081637bea8
2022-05-25 11:04:42 +00:00
Alex Chau
906d882f91 Update drop target button alignment across devices
- Partial re-land of http://ag/18520765
- Layout the buttons from center of screen for two panels, or from center of workspace for all other cases

Bug: 229789612
Fix: 231706480
Fix: 232063941
Fix: 232283628
Test: manual
Change-Id: Icbc9e2a19140ce3127d5dfe9f798a8ada336cea8
2022-05-23 15:08:52 +00:00
Pat Manning
b29dabce18 Revert "Update drop target button alignment across devices."
This reverts commit 27bfcaa651.

Reason for revert: b/232636570

Bug: 229789612
Bug: 231711806
Bug: 231706480
Bug: 232063941
Bug: 232283628
Change-Id: Ic83515173f4a64228a80f63d75db938243cbf625
2022-05-20 18:20:26 +00:00
Pat Manning
27bfcaa651 Update drop target button alignment across devices.
Fix: 229789612
Fix: 231711806
Fix: 231706480
Fix: 232063941
Fix: 232283628
Test: manual.
Change-Id: I75d649b953ad1607dbba87a8f758884ff938b6dc
2022-05-12 13:49:58 +00:00
Sebastian Franco
d2d8e97a65 Make the text for the drop target buttons fit if it's too long.
The text "Don't suggest app" is too long when the device language
is GE or JA, or if you make the text bigger in settings.

Before truncating the text completely we are going to try to make
the text smaller until it gets to a predefined value
(button_drop_target_min_text_size).

Test: Change the language to German (Deutch) and install a new app and drag it to the workspace to see the button "App nicht vorschlagen"
Test: Also, a nice way to test is to go to SecondaryDropTarget#setupUi and hardcode the option to always show "Don't suggest app"
Fix: 221480721
Change-Id: I99def4e23cd17109a297aecaa620cef7a0d137e7
2022-04-07 16:39:29 +00:00
TreeHugger Robot
74f7d5e0b8 Merge "Fix the remove button icon not centered when the home screen is in landscape." into sc-v2-dev am: 8935b22cd7 am: 763405dfca
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16087348

Change-Id: I29b9912fdf63a922b5cf8904be768c1e481b5e6c
2021-10-26 00:35:36 +00:00
Sebastian Franco
63d1a181e5 Fix the remove button icon not centered when the home screen is in landscape.
To fix it I put the bounds of the Icon/drawable when the text is not visible.

Fix: 202811811
Test: Manually Tested.
Change-Id: Ieff54a73e819c4b3a61e28fd76faf93a84b67666
2021-10-25 17:34:11 -05: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
031418c6e1 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 22:42:55 +00:00
Steven Ng
4ba1f8097f Merge "Remove drop target button drawable padding if text isn't hidden" into sc-v2-dev am: 3de51d518d am: f7418f95c1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15371938

Change-Id: I44c1e04eef206a4f26cbb0b7e9470fbf979e2017
2021-07-27 13:58:33 +00:00
Steven Ng
a1dcbce15a Remove drop target button drawable padding if text isn't hidden
Test: manual
Fix: 194320733
Change-Id: I12adeaf37cee5a0fcf383641f24b7750f14daf27
2021-07-26 17:10:56 +01: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
Pierre Barbier de Reuille
2881801c7b 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: If573641e4bb5a98ed6b5008e00f70f4bbe492c24
2021-06-30 14:13:56 +01:00
Yogisha Dixit
3893eefe75 resolve merge conflicts of 1491ec31c5 to sc-v2-dev
Test: manual
Bug: 192076258
Change-Id: I44e02383cd8ce386811e24a1c4fd6ce62e38f90f
2021-06-25 17:23:22 +00:00
Yogisha Dixit
c0ac1dda74 Update widget manipulation colors.
Spec:
* Resize frame: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.OeO4S0j
* Drop target bar: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.vXfwHn8

Test: manual
Bug: 187910396
Change-Id: I6fd433796970c428841ee96e45ee4fca1ded3665
Merged-In: I6fd433796970c428841ee96e45ee4fca1ded3665
2021-06-25 08:43:29 +00:00
Yogisha Dixit
3cbd7e3c33 Update widget manipulation colors.
Spec:
* Resize frame: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.OeO4S0j
* Drop target bar: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.vXfwHn8

Test: manual
Bug: 187910396
Change-Id: I6fd433796970c428841ee96e45ee4fca1ded3665
2021-06-24 21:02:08 +01:00
Yogisha Dixit
d417d36615 Merge "Center drop target icons in landscape mode." into sc-dev am: 3287dd9fa7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14980961

Change-Id: Id3f175c250acc0a40b9662c20c28c73c9fd35c13
2021-06-17 09:45:50 +00:00
Sunny Goyal
0c299cb324 Merge "Simplifying the drop animation code" into sc-v2-dev 2021-06-16 23:18:16 +00:00
Yogisha Dixit
58c5e65763 Center drop target icons in landscape mode.
Spec: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.vXfwHn8

Test: manual
Bug: 187376586
Change-Id: I2025ba75061a5ca3a004dfef2b33cdbcc17a1408
2021-06-16 20:55:56 +01:00
Yogisha Dixit
ed052ab212 Fix drop target icons being truncated.
The icons were being truncated due to incorrect viewport width/height
values for the vector drawable.

Test: manual
Bug: 187036287
Change-Id: Ie2d0ffe815501d2e943146a79cb4ede379ce0ecf
2021-06-16 14:07:38 +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
Yogisha Dixit
2ff963b0c7 Use a selector instead of loading resource for drop target.
Test: manual
Bug: 187355401,187035471
Change-Id: I65fef2c810c791c3282bd4a087359f6cff774cc4
2021-06-04 12:10:06 +01:00
Alex Chau
a02eddc144 Handle config changes in Launcher
- This is practically a revert to http://ag/c/13687966/5 and refactored to use DisplayController.DisplayInfoChangeListener
- Make Launcher handle size and density change so transition is less janky when screen size changes
- Added fix in RecentsView to update state and TaskView when display profile changes
- Removed 720dp specific resoureces
- Removed unused widget_section_indent
- Removed unnecessary all_apps_background_canvas 600dp override that is not needed in AllApps+
- Moved remaining dp specific into DeviceProfile
- Simplified allowRotation logic to use single variable in DeviceProfile to determine if allow rotation is enabled by default

Fixes: 180803696
Test: manual
Change-Id: Iea0a7d1a0e14dc3613152dd3b3887450a2e1fc2f
2021-05-10 18:50:02 +01:00
Yogisha Dixit
a3a6f51b12 Update drop target styling based for BC.
Spec: https://docs.google.com/presentation/d/1UxdDh8EFhPbdRWRwzjbpgL-j02ew4Ew3eG3XBCeoYdo/edit#slide=id.vXfwHn8

Demo: https://drive.google.com/file/d/1ZIa3Dgo85vdVkfPm7aGJDyctZQR_c8Xx/view?usp=sharing

Test: manual
Bug: 184713740
Change-Id: I17dbbf1f7bbc40939cfc0fedb506a35f39ecc2e3
2021-04-29 09:18:05 +00:00
Steven Ng
cf93ef6cc9 Fix cast exception when dropping widgets to a drop target
When inflating a widget directly in the DragView, I've overridden
the layout param to FrameLayout.LayoutParam. Before drag complete,
we should restore the previous layout param.

Test: Drag a widget to a drop target. No crash is observed.
Bug: 186111130
Change-Id: Ifd33d57a886496ab31d4e741870b0ae18ca9ce4e
2021-04-22 17:45:16 +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
Steven Ng
6a2acfaa59 Add an 65% opacity for workspace elements drag over button drop target
Also remove the draggable item hover top button color change.

Test: Manual
Bug: 183193201
Change-Id: Id80622b8c0152180c47c0c9ebff8aa8bc2a5c2be
2021-03-22 13:20:48 +00:00
Sunny Goyal
a4647b681f Adding support for keyboard based drag and drop
For keyboard DnD, we use Accessible DnD implementation.
A placeholder FloatingView draws the focus indicator
for the virtual views

Test: Visible
Bug: 178781566
Change-Id: I632fc7377dffa1e05e3f0a9c3ad18641deb5a1a4
2021-02-05 13:05:24 -08:00
Winson Chung
f99351888c Revert "Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ...""
This reverts commit 087a9e39b6.

Change-Id: I05b17a6e4aaaef6de3c2fa26aad45a39eb2833f9
2020-10-23 09:27:48 -07:00
Alistair Delva
087a9e39b6 Revert "Merge commit '8d14dbe041199d611839140f1c9285fd4174e9f4' ..."
Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert "Merging from ub-launcher3-master @ build 6877130"

Revert submission 12738409-merge_ub-launcher3-master_6877130

Reason for revert: Introduced crashes to global presubmit

Reverted Changes:
I624658ce6:Merge commit '8d14dbe041199d611839140f1c9285fd4174...
Iccd2f1e3a:Merging from ub-launcher3-master @ build 6877130
I791d64951:Merging from ub-launcher3-master @ build 6877130
Icdd32ab01:Merging from ub-launcher3-master @ build 6877130

Bug: 169963211
Change-Id: I77a4ae59e823147beae8dd7cb9b54ccdace2c7f4
2020-10-05 14:46:26 +00:00
Hyunyoung Song
95786e077d Good riddance UserEventDispatcher
Bug: 165675920
Bug: 161381246

TL;DR;;
- nano -> lite proto
- add all the missing logs to WW
- pin item related logging fix
- Removed logging for assistant

sgrep "com.android.launcher3.userevent.nano." | cut -f1 -d: | xargs sed -i -e 's/userevent\.nano\./userevent\./g'

Change-Id: Ie2a49fdd891cacbd7ef40a1dc9e41ff0574c7517
2020-09-27 13:41:49 -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
55bdeed7bb Removing various reflection based animations, to allow for better proguarding
Change-Id: If9df24ea4170e8a3d336057d1c3dc800934fc1ac
2018-09-21 18:21:04 +00:00
Tony Wickham
6a71a5bd77 Add undo snackbar for deleting items
- Add methods to ModelWriter to prepareForUndoDelete, then
  enqueueDeleteRunnable, followed by commitDelete or abortDelete.
- Add Snackbar floating view
- Show Undo snackbar when dropping or flinging to delete target; if the
  undo action is clicked, we abort the delete, otherwise we commit it.

Bug: 24238108
Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
2018-08-30 16:22:25 -07:00
Mehdi Alizadeh
bda47cf925 Refactors ButtonDropTarget to add extension data
Also fixes a bug where DeleteDropTarget was logging Remove instead of
Cancel.

Bug: 78793340
Test: Enable verbose logging and manual test
Change-Id: I0f0cfff070eab003ebb745292630bc6ce3243f4d
2018-05-02 14:20:09 -07:00
Mehdi Alizadeh
3e024c0e1c Fixes the incorrect hover icon color in drop bar when dark theme
Bug: 78641863
Test: Manual test with dark and light wallpapers
Change-Id: Ic3fb68f5c5f746482a7f23b11284e30ac3e10168
2018-04-30 16:05:25 -07:00
Winson Chung
1054d4e8f2 Revert "Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets""
This reverts commit f502e5faec.

Reason for revert: Reverting post-build

Change-Id: I09eb292dbbbe37ffaf3abc477aa2ddb5700093b8
2018-03-05 19:39:21 +00:00
Winson Chung
f502e5faec Revert "Adding support for hiding widgets from the widget tray and reconfiguring widgets"
This reverts commit b29a5fa55c.

Reason for revert: Temporary revert for build.

Change-Id: I58045ad1ce28d398a5216ba4fbbcdba1196942ec
2018-03-05 18:06:52 +00:00
Sunny Goyal
b29a5fa55c Adding support for hiding widgets from the widget tray and reconfiguring widgets
> Removing AppInfo target
> Switching between uninstall and setup based on the drag view

Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca
2018-03-02 13:20:09 -08:00
Jon Miranda
df1ffb950a Fix bug where Cancel/Remove drop target text was not being updated.
Bug: 72644671
Change-Id: I8a042230b1a61b6ccd8a9c53bc09177f065351b0
2018-02-06 10:38:26 -08:00
Sunny Goyal
d1b3f5cb38 Using same layout for drop-target bar in landscape and portrait
> Adding a tooltip on drag over when the text is not visible

Bug: 71709920
Change-Id: I1897a8dacd191fb1aeaec37f5d5c73c49517192a
2018-01-19 12:16:54 -08:00
Sunny Goyal
ac00cba35c Simplifying workspace layout
Instead of creating workspace view larger than the screen size (so that it can be
zoomed out), restricting the size to the parent size and bypassing the drag events
directly to Workspace (since the workspace is smaller when zoomed out, it might not
qualify for all events otherwise).

Change-Id: I45e213dd6d16bec5feb6e7cf90bc6f7de4c6d305
2017-11-13 16:00:06 -08:00
Sunny Goyal
5bc6b6f14c Consolidating various interpolators
Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
2017-10-26 16:38:55 -07:00
Sunny Goyal
7268ed6c27 Merge "Caching the uninstall disabled state for each userHandle" into ub-launcher3-master 2017-10-26 21:07:42 +00:00
Sunny Goyal
3e3f44c3ad Exposing the state manager directly instead of providing various helper methods for state change
Bug: 67678570
Change-Id: If3d05c804c034ffa5e403da8eaa23e85e373c863
2017-10-25 13:41:13 -07:00
Sunny Goyal
0236d0b0ba Caching the uninstall disabled state for each userHandle
> Removing static access to varios drop targets
> Creating a cache at UI level with 5sec timeout

Bug: 67104426
Change-Id: Ide6e2e0c01606f9b5fb9281f95dc009873c18fb9
2017-10-24 14:55:54 -07:00