Commit Graph

74 Commits

Author SHA1 Message Date
Samuel Fufa
2f0b2d3b4e Dedupe Items on Workspace for hotseat prediction
Bug:145236832
Test:Manual
Change-Id: I46da38998486c7f58aca829d33b42cbb04da515a
2019-12-03 14:39:12 -08:00
Tony Wickham
03f27013bf Log undo button click
Also fix a bug where we logged workspace swipe upon clicking undo, since
rebinding the pages causes us to reset mCurrentPage = 0 followed by
setCurrentPage(pageBoundFirst). Since the page isn't actually visibly
changing, we shouldn't log in that case.

Bug: 118758133
Change-Id: Ie87164a8c7c278680f67dee75657210bd33408a4
2019-04-25 14:22:54 -07:00
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
vadimt
422885d2ca Fixing Cancel target being seen as Remove by accessibility
Bug: 115854326
Change-Id: Ic52d7253ea47d65b18cc38c4a2242ab15c4e35fd
2019-02-15 19:55:43 -08:00
vadimt
26850a2f3f Removing "remove" accessibility action for deep shortcuts in menu
Bug: 116023881
Test: Manual
Change-Id: Ia9c25e2e1b4cbca9d2c87a17464c175733955ccf
2019-02-06 12:18:51 -08:00
Tony
f80e893163 When undoing a removal, always return to the page it came from
We were already returning to the current page, but this wasn't
always right, e.g. when removing the last item on the last page.
So now we mark the page the item was removed from, and bind that
page first when undo is clicked.

This also addresses an issue where we incorrectly returned to the
first page if currentPage = INVALID_RESTORE_PAGE, which happens if
there are no items on the first page.

Bug: 118846684
Change-Id: I4ec1f64b24ba1cc308ce08bfb3111b5981fae99b
2018-12-21 12:21:53 -08: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
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
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
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
da1dfa32d0 Creating a custom drawable to customize shadow.
> Fixing DrapTargetBar set to visible (with alpha = 0) in the start
causing unnecessary draw

Bug: 37616877
Change-Id: Iaaff96099910f504f6e2f81c9376ddacde50ff6a
2017-04-27 05:35:28 -07: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
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
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
261194387b Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage"
This reverts commit fc956e5a2a.

Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
2016-02-23 02:02:54 +00:00
Sunny Goyal
fc956e5a2a Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage
Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
2016-02-17 13:27:13 -08:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08: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
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
Winson
1f832f85d5 am 2949fb5b: Fixing talk-back folder icon removal regression.
* commit '2949fb5b16a07259e221c5c04470e90c8afb4ea8':
  Fixing talk-back folder icon removal regression.
2015-09-24 18:26:44 +00:00
Winson
2949fb5b16 Fixing talk-back folder icon removal regression.
Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
2015-09-24 18:21:16 +00:00
Winson Chung
26bfdd9d5a am a3c9fb12: Merge "Requiring key chord to delete icons and folders on the workspace" into ub-launcher3-burnaby-polish
* commit 'a3c9fb125c7449df5add990e91e0e3471e3cc776':
  Requiring key chord to delete icons and folders on the workspace
2015-09-18 18:53:48 +00:00
Tony Wickham
ab946a19d4 Flinging to the left deletes when in vertical bar layout mode.
This mode has the remove icon on the left side, so flinging to the
left makes more sense. But flinging up still works in either case.

Change-Id: I7ab40776b67659026f03f81efd43fae3375b5ba0
2015-09-16 16:28:43 -07:00
Winson
fa56b3f2f1 Requiring key chord to delete icons and folders on the workspace
- Also fixing case where the all apps button to search for more apps
  was not focusable

Bug: 20639227
Change-Id: Ie4d9092e654d3cafc0eb346b3bb744ec3e295e92
2015-09-14 19:47:19 +00:00
Winson
7089a4e197 am c0b52fef: Refactoring to ensure item deletion always removes from the DB.
* commit 'c0b52fefbc11531d560359c093484099f9d1298e':
  Refactoring to ensure item deletion always removes from the DB.
2015-09-10 22:03:57 +00:00
Winson
c0b52fefbc Refactoring to ensure item deletion always removes from the DB.
- Routing the various places where we call through to delete from
  LauncherModel through Launcher, which will delegate the removal
  of the icon from the workspace, and properly handle the removal
  of all items and their contents from the db.

Bug: 23944119

Change-Id: I022fe2b3e79da16b5af87505c4362490b8422686
2015-09-10 14:55:17 -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
42e28092b3 Removing some eclipse warnings
Change-Id: I160feaee81b262be02446885fae643c0be71b7af
2015-08-17 12:56:19 -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
Sunny Goyal
40b626b930 Updating assets
Bug: 21304080
Change-Id: I26cf435779b477f0961d8e0d56dd6b86b418a3be
2015-06-05 08:47:40 -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
ddec73471e Updating fling to delete anim
Change-Id: I1c63e88b3e605113ea66afca9dcfbc30de1d4c8e
2015-04-30 16:02:36 -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
Hyunyoung Song
3f471440a8 WidgetTray revamp work
- RecyclerView is rendering
- Animation is connected
- Drag and drop is now handled
- UI tweaking: background, margins, more to come.
- Flicker and preview not loading issue:
  fixed height for the horizontal scroll view.
- Shortcuts are added
- Widget Preview loading should support shortPress for drop
- UI tweaks left: overlay of arrow when there are more items to scroll
- icons are added in the section header
- Sorting of widget sections and widget horizontal list
- Adding all the padding constants to dimen.xml file
- RecyclerView should only support one view type

For items to be addressed in follow up patches OR CLs,
TODO is added to the comment.

b/19897708

Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
2015-04-08 19:01:34 -07:00
Adam Cohen
091440a9cb Reducing method count by eliminating synthetic accessors
Elimates 304 methods based on dex analysis

The java compiler generates sythetic accessor methods for all private
fields, methods and contructors accessed from inner classes. By marking them
package-private and @Thunk instead, sythentic accessor methods are no
longer needeed. These annotated elements should be treated as private.

Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26
2015-03-20 11:15:54 -07:00
Sunny Goyal
c9acdd51c4 Removed disableAllApps flag
Change-Id: I50ba511b8493bca2506ab6010f141c093bfa7499
2015-02-26 12:35:09 -08:00
Sunny Goyal
71b5c0b988 Adding accessibility controls
> Adding 'Remove' option to workspace items
> Adding 'Add to workspace' to all apps and widget list items, which
adds the item to the first available space, giving preference to
the current workspace screen
> Adding 'App info' and 'Uninstall' options to appropriate items

Bug: 18482913
Change-Id: Ifab7423af2d9ba502b5a2771b37bb5436b3df937
2015-01-16 17:40:41 -08:00
Adam Cohen
5940042d39 Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by
   the launcher package which can run arbitrary code.

Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
2014-12-05 16:18:41 -08:00
Sunny Goyal
8498eb40ee Not opening all apps again when AppInfo or Uninstall is selected
Bug: 17460202
Change-Id: Id67a9637324abceb5b446fff5999db2a0910401b
2014-10-16 12:09:28 -07:00
Jason Monk
6a2c77856f Add sdk version guard to UserManager use
Also switch call to getUserRestrictions to support back to JBMR2
with one call.

Bug: 17300500
Change-Id: I1205730e517c6670f6359a0d448458cae6e8a8d4
2014-09-02 13:13:24 -04:00
Adam Cohen
fe9da818cd Fix for issue 16736964
Change-Id: If150db98346fe10f62fc1160309b66d7a19e9022
2014-08-08 03:55:01 +00:00
Jason Monk
950a467b18 Don't show uninstall icon when user restricted
When the user can't uninstall apps from settings, also don't show
the icon to let them do it from here.

Change-Id: I3b203711630a4ff0ba4a5928667c9f09f9479aeb
2014-07-25 08:54:27 -04:00