Commit Graph

48 Commits

Author SHA1 Message Date
Sunny Goyal
1797af41d1 Cleaning up drag state management.
When the drag is started, the UI automatically goes into spring loaded mode. On a successful
drop, it is the responsibility of the {@link DropTarget} to exit out of the spring loaded
mode. If the drop was cancelled for some reason, the UI will automatically exit out of this mode.

Bug: 34692289
Change-Id: Ic611739a43bb8d9279b587aaee3039326c143e8b
2017-10-16 13:06:52 -07:00
Sunny Goyal
3dce5f3f50 Merging duplicate logic for deferred drop handling in Worksace and Folder
> All the logic is contained in UninstallDropTarget
> Also fixing a bug were mWaitingForResume was not cleared

Bug: 34692289
Change-Id: I617475ce53062902d6817954fb608198e6e03d3c
2017-10-06 09:07:36 -07:00
Sunny Goyal
1ce9c476f7 Removing some methods from the DragSource
This makes is easier to create new DragSource and sets up
proper default values in DragOptions

Change-Id: I6cb0b1df41b9730cf29f785fe85fe7f0b573ee3a
2017-10-03 16:18:46 -07:00
Jon Miranda
bfaa4a4edc Hides text on ButtonDropTargets if any of them are ellipsized.
This can happen on small devices or on devices where Font/Display size
is enlarged and when Developer Options is turned on when all three
options {Uninstall, Delete, App Info} are shown at once.

Bug: 64391860
Change-Id: If355d28087d53148114eb586efb3c26f158b3713
2017-08-24 16:27:30 -07:00
Sunny Goyal
5931ca0415 Fixing dark tint for ShadowDrawable.
Updating the dark theme for empty all-apps search drawable.

Change-Id: Ieb2018924da337bdd97eaf3adf2d32c3e3bebc73
2017-06-20 09:03:30 -07:00
Tony Wickham
6c82867a7e Add shadow to badges
- Add static method to ShadowGenerator to generate a
  circle Bitmap with a shadow.
- Move setColorScale() from DragView to Themes, and
  use it to apply color to the shadowed Bitmap.

Bug: 35744066
Change-Id: I8d1da528bbf94dc83851f0b4016361ed9f8d5349
2017-03-01 16:36:04 -08:00
Sunny Goyal
dec3a908bf Updating the preview generation logic so that it aligns better with
the drag source image

> Using common code for pending item drag (WidgetContainerView and PinItemDragListener)
> Adding a shortcut-circuit in Workspace when a pendingItem can create a shortcut
  directly. Previously the multi-window drop was routing through onActivityResult which
  was causing some state information to be lost.

Bug: 33584624
Change-Id: I0259870032185713caa9bff27092dbae6ce91199
2017-01-27 15:09:10 -08:00
Sunny Goyal
a52ecb0390 Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
2016-12-16 15:05:09 -08:00
Sunny Goyal
0f76b56865 Refactoring FlingToDelete
> Moving all fling related logic to FlingToDeleteHelper from DragController
> Removing fling related methods from DragSource and DropTarget
> Moving fling animation logic from DeleteDropTarget to FlingAnimation
> Simplifying DropTargetBar to directly look for all valid drop targets.
  This makes it easier to add new DropTarget in xml.

Change-Id: I7214d2d30c907ab93c80d92d9f9be6dda2d63354
2016-12-13 23:39:16 -08:00
Tony
2fd0208605 Use Launcher.getLauncher(Context) instead of type-casting.
Bug: 32010039
Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
2016-10-07 12:50:01 -07:00
Sunny Goyal
d139b0aa7d Adding support for multiwindow drag and drop
Change-Id: I95b46e3c3f1238307d3ef5a6c81a8e530ba0987a
2016-09-12 14:37:46 -07:00
Sunny Goyal
94b510cc68 Some drag and drop code refactor:
1) Adding DragOptions to easily extend drap functionality
2) Changing onDragStarted signature to send more information
3) Updating states for dropTargetButton based on drag event directly
4) Removing folder item based on onDragStarted and not startDrag

Change-Id: I65b684e092ddc081d086bfe2c8c1973ed170eaeb
2016-09-01 15:55:13 -07:00
Sunny Goyal
4583d09c05 Fixing broken accessibility drag
> Allow touch events on hotseat while in accessible drag as drag now
happens in spring loaded state.
> Allow drop target buttons to ignore thershold check when in
accessibility drag

Bug: 30900444
Change-Id: I88274367983fc027b2ddde3a719ca943f4f48587
2016-08-17 11:24:10 -07:00
Sunny Goyal
ae50284e0a Moving LauncherAccessibilityDelegate to Launcher to associate it with
activity lifecycle.

Change-Id: Ib815505677fa7ed74bdcfe7141b1d9bea5d7143a
2016-06-17 08:44:51 -07:00
Sunny Goyal
47328fd53f Removing the SearchDropTarget bar as it no longer contains the QSB
> Renaming it to simply DropTargetBar
> Moving AppInfo to the top bar as well
> The workspace pages will extend to the top edge (minus some padding).
Since the QSB is no longer displayed on top of every page, there is
no reason to reserve the space.
> In spring-loaded mode, the workspace cell layout will scale enough
to make room for the drop target bar at the top

Change-Id: I2baf607310335dd576c9d9fcbb75ab708f47ac03
2016-06-06 16:15:46 -07:00
Tony Wickham
855b1b5fff Add distance threshold for dragged items before accepted by targets.
With the new spring-loaded workspace, items are often very close to
button drop targets (e.g. App Info) at the start of a drag. This
threshold makes it less likely to accidentally drop on a target.

Bug: 24099531
Change-Id: I4912ceeb0b63958816177c7bde073e825176d987
2016-03-29 12:41:14 -07:00
Sunny Goyal
f37a21412a Defining separate layouts for horizontal and vertical drop target bars
instead of chaning the layouts in DeviceProfile

Bug: 27721989
Change-Id: I9a22c21e643f4fd0058c9be5e9d705aaf7649204
2016-03-24 17:29:23 -07:00
Sunny Goyal
9eba1fd75e Refactoring WallpaperOffsetInterpolator to a new file
Removing some us unused methods

Change-Id: Ife790e5ca6848fa13dc3fab1bba1e6220bf83743
2015-10-16 09:02:25 -07:00
Tony Wickham
9aae47f8a6 Added 'Cancel' drop target from all apps and widget picker.
- Reuse DeleteDropTarget since it's the same effect, but with "Cancel"
  instead of "Remove" if supportsDeleteDropTarget() returns false.
- Rename related strings (but not their values)

Bug: 24104015
Bug: 24099531
Change-Id: Ia9fbcaa17bb17f7aa31df1f830298da01544c178
2015-10-05 10:58:15 -07:00
Sunny Goyal
93809cc316 am 9ccacb54: Merge "Fixing \'Item removed\' announced twice when using accessible DnD" into ub-launcher3-burnaby-polish
* commit '9ccacb544bfcb6b444edf09b1b37f955ae57168c':
  Fixing 'Item removed' announced twice when using accessible DnD
2015-10-01 18:28:51 +00:00
Sunny Goyal
9ccacb544b Merge "Fixing 'Item removed' announced twice when using accessible DnD" into ub-launcher3-burnaby-polish 2015-10-01 18:25:28 +00:00
Sunny Goyal
1f604dfbc7 am d21301e6: Cancelling the stateannouncer when entering button drop target
* commit 'd21301e674377ecd72bd14f32b52c68fabcfd3be':
  Cancelling the stateannouncer when entering button drop target
2015-09-25 21:09:28 +00:00
Sunny Goyal
d21301e674 Cancelling the stateannouncer when entering button drop target
Change-Id: Ia10298e1d4862fc5f46894fa6d934207d6e9c117
2015-09-25 12:17:08 -07:00
Sunny Goyal
7aaa841c35 Fixing 'Item removed' announced twice when using accessible DnD
Change-Id: I2d8781155619d22a41c3f363be7909d411c62fa9
2015-09-25 12:06:13 -07:00
Sunny Goyal
9d4380856f resolved conflicts for e78e3d73 to ub-launcher3-master
Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
2015-09-25 11:50:16 -07:00
Sunny Goyal
e78e3d734b Accessibility fixes
1) Use a different content description for temporary new page
2) Use different accessibility description for add widget toast
3) Announce when an item is deleted
4) Announce when hovering over a drop target
5) Announce state during drag-n-drop and widget resize (similar to seekbar)

Bug: 23573321, 24057944
Change-Id: Icabb317625e70c78e11c0b4f99b9339172d93594
2015-09-25 10:22:47 -07:00
Tony Wickham
b54c4a3d86 Added BaseDropTargetBar, which SearchDropTargetBar extends.
This is to allow for a future AppInfoDropTargetBar.

Change-Id: I5e66129919226eaef1ba1ddb0c0c99d0a6dc48df
2015-09-15 10:42:24 -07:00
Vadim Tryshev
fedca43d39 Moving drag-drop related code into a separate package.
This is per an earlier CR comment "we should probably move all this code to its own package (launcher3.dragndrop) in a separate cl".

I'm not moving DragSource because it's referred from gsa code.

Bug: 22609426
Change-Id: Ia7204dab99c0c395c66b77143a2d60411153f5f3
2015-08-20 07:45:57 -07:00
Sunny Goyal
c268148f06 resolved conflicts for merge of 9fc953b9 to ub-launcher3-master
Change-Id: Ia3e845a2e336c846cceefdc2d1e8c6786753f1b1
2015-08-17 14:43:41 -07:00
Sunny Goyal
9fc953b94d Version code cleanup
> Renaming Lmp to Lollipop
  > Lollipop_MR1 instead of directly using 22
  > Using M APIs directly instead of reflection

Change-Id: I10a307f46e3be15b3299f549a2fd7e0e215a6a1b
2015-08-17 13:26:01 -07:00
Sunny Goyal
aa8ef119f1 Refactoring ItemInfo
> Changing dragObject to ItemInfo
> Removing dropPos which is always null
> Removing requiresDbUpdate which is only used in CellLayout

Change-Id: I753ddaae0880c8a9bfee5a1266095ff34610284a
2015-06-30 10:26:49 -07:00
Winson Chung
7501adf4b7 Ensure that we use the system long press duration when dragging from AllApps.
- Removing some old code out of LauncherAppState

Bug: 21559400
Change-Id: I3c586094efb7ad8a17d2169bc8aaccf6b0df40a2
2015-06-05 10:52:57 -07:00
Sunny Goyal
316490e636 Removing some synthetic method creation
> Make package-private and @Thunk all private methods and constructors accessed from inner classes.

Change-Id: Ie5913860a0c33e48e9bf68f9b5b1699f64c2f174
2015-06-02 10:04:59 -07:00
Sunny Goyal
3a644ed1ce Using color filter when animating the drop target instead to TransitionDrawable
> No more flickering when crossfading between two bitmaps in small duration
> Allows us to control the color directly without depending on the assets

Change-Id: Ie7ed8bb94baf560e9b939cca624ed1bad457732c
2015-05-21 10:30:46 -07:00
Sunny Goyal
e0cab303b8 Setting drawable to droptarget in the code to avoid multiple drawable inflation
Change-Id: Ib713b3051e2707d46a4ee0090aed2db1d2e641b9
2015-05-20 16:41:08 -07:00
Sunny Goyal
7066003b20 Various lint error fixes.
> Fixing some RTL errors by specifying both marginStart and marginLeft
> Moving all layout direction checks to Utilities
> Explicitely adding @TargetApi before every method

Change-Id: Ibe9c52b93b5a6adeadb27ace2b312770fd732ea0
2015-05-14 12:28:07 -07:00
Sunny Goyal
ddec73471e Updating fling to delete anim
Change-Id: I1c63e88b3e605113ea66afca9dcfbc30de1d4c8e
2015-04-30 16:02:36 -07:00
Sunny Goyal
65d076b2ff Merge "Enabling accessibility drag and drop in folder" into ub-launcher3-burnaby 2015-04-30 00:43:55 +00:00
Sunny Goyal
fe0d1f2458 Animating dragview color change when dragging over ButtonDropTarget
Change-Id: I642438be681769812302dba0b6deca38f89f7a16
2015-04-29 11:25:16 -07:00
Sunny Goyal
e9b651eef1 Enabling accessibility drag and drop in folder
> Moving DragAndDropAccessibilityDelegate to a separate class
> Using getFocusedVirtualView() instead of using DownX and downY
> Updating various accessibility strings

Bug: 19776741

Change-Id: I85c2551d4d6172c30702e68f41b114bb999655b6
2015-04-28 16:06:46 -07:00
Sunny Goyal
1a70cef988 Accessibility fixes
> Enabling top bar buttons in accessibility drag-drop
> Unifying logic to show delete/uninstall/app-info targets
> Announcing cell loction as 1-index instead of 0-index

Change-Id: Ibc7801f77e938b2646f0655462cbe9b7f781818b
2015-04-24 10:47:56 -07:00
Sunny Goyal
fa401a10e7 Updating drop button targets
> Splitting DeleteDropTarget into delete and uninstall
> Showing UninstallDropTarget for app shortcuts on workspace
> Showing InfoDropTarget only when developer options is enabled

Change-Id: I4396571d2199d1581bb9c733aef88ab9b0ebd79d
2015-04-16 15:52:04 -07:00
Adam Cohen
e9a5119836 Revert "Adding debugging and naive fix for issue 15334203"
This reverts commit ed11c14003.

Change-Id: Ifc46769477e590512cc5ab79a69063c0341f52b2
2014-06-04 01:24:03 +00:00
Adam Cohen
ed11c14003 Adding debugging and naive fix for issue 15334203
-> To be reverted, just need signed build.

Change-Id: I6a83e55067d8d2564bb3c4f0c314befbb2793f09
2014-06-03 18:11:15 -07:00
Michael Jurka
34c2e6cf7a Clean up imports 2013-12-13 16:20:53 +01:00
Winson Chung
156ab5b22e Fixing issue where migration all apps folder couldn't be picked up.
- Ensuring that we add items to the non-primary home page
- Fixing issue with drop-target touch handling on tablets

Change-Id: Iea5a383dc735a8f6044a00982f05789f8328ab63
2013-07-12 15:12:32 -07:00
Adam Cohen
7d30a37007 Porting PagedView from KG to gain simplified scaling model, reordering
-> We are no longer scaling individual Celllayouts, instead we are scaling
   the entire Workspace (and the CellLayouts come along for the ride)
-> Due to the above change, many assumptions were broken. In particular,
   our drag and drop / animation archiecture is fairly fragile due to the
   frequent and complex mapping of points between different bits of the
   hierarchy. This CL contains a number of fixes which address such
   breakages.

Change-Id: I2e630eab17528729b764b61f587858f6499fd318
2013-07-08 18:32:57 -07:00
Daniel Sandler
325dc23624 Launcher2 is now Launcher3.
Changes include
  - moving from com.android.launcher{,2} to
    com.android.launcher3
  - removing wallpapers
  - new temporary icon

Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b
2013-06-05 23:30:20 -04:00