summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget/WidgetsContainerView.java
Commit message (Collapse)AuthorAgeFilesLines
* Converting widget panel into a floating viewSunny Goyal2017-10-131-243/+0
| | | | | | | | | | | | | > The widget panel is only inflated when needed > Using the swipe up/down interaction for widgets tray > Removing additional view wrappers from all-apps > Widget tray is preserved across activity recreation > Launcher no longer has WIDGET state, the actual code around the states will be removed in a follow-up cl Bug: 67678570 Bug: 67585158 Change-Id: Ia29a7c33ec81e6c53cc24e2906b7022b6f41755b
* Removing some methods from the DragSourceSunny Goyal2017-10-031-19/+0
| | | | | | | This makes is easier to create new DragSource and sets up proper default values in DragOptions Change-Id: I6cb0b1df41b9730cf29f785fe85fe7f0b573ee3a
* Remove flicker when multiple apps are added/removed/updated on widget trayHyunyoung Song2017-08-231-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 36718342 1.The flicker was also happening partially because notifyWidgetProviderChanged callback also made the entire widget list to update in addition to packageManager update. 2. Now that adapter calls notifyItemInserted, Removed, the recycler view uses it's internal animation to elegantly move items or insert them. (added benefit!) 3. Added tests for WidgetsListAdapterTest $ adb shell am instrument -w -e class com.android.launcher3.widget.WidgetsListAdapterTest com.google.android.apps.nexuslauncher.tests/android.support.test.runner.AndroidJUnitRunner com.android.launcher3.widget.WidgetsListAdapterTest:. Time: 0.337 OK (6 test) Change-Id: I0818d546532631bf889fae560118decff64ec5a4 Signed-off-by: Hyunyoung Song <hyunyoungs@google.com>
* Removing view.isInTouchMode() because plaform returns false whenMario Bertschler2017-06-221-2/+0
| | | | | | | | using a mouse on long click. Bug: 38204847 Change-Id: I5b10e8251f4f0a7b148c0404d5939a0fa8325a46
* Add support for system shortcuts in popup containerTony Wickham2017-03-301-0/+7
| | | | | | | | | | | | - Currently the system shortcuts are just widgets and app info - As shortcuts, they live in ShortcutsItemView - They are populated either as icons only (if there are deep shortcuts) or as icons + text - Widgets are disabled until binding them is complete (we request for them to be bound on long-press now). We should revisit this. Bug: 34940468 Change-Id: Ia51d002c3b3ede87658bdab57abfc3eeca1ed242
* Add WidgetsAndMore bottom sheetTony Wickham2017-03-301-10/+12
| | | | | | | | | | | - Contains two rows, one for widgets, and one for "configurable shortcuts" that have customization activities - Extends AbstractFloatingView and uses VerticalPullDetector for touch interactions - No way to show this currently; will add options to popup in followup Bug: 34940468 Change-Id: Iab62c2cb89428f91119c9c86f9db886496c321fd
* Updating the preview generation logic so that it aligns better withSunny Goyal2017-01-271-66/+6
| | | | | | | | | | | | 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
* Improving widget handling for pinItemRequestSunny Goyal2017-01-271-10/+3
| | | | | | | | | | > Preloading widget view while dragging for smoother transition > Skipping config activity and sending confirmation to the caller when widget is dropped Bug: 33584624 Change-Id: Ib23e5964298296d12d9c93f38aefdf924a07368e
* Adding support for new APIs in O related to configurable shortcutsSunny Goyal2017-01-191-1/+1
| | | | | | | | > Config activities can now return PinItemRequest which can be used to pin deep shortcuts Bug: 33584624 Change-Id: Ic0df436bd79e069615b9d60d24eb7594b824b2da
* Removing static Context access using LauncherAppStateSunny Goyal2017-01-111-2/+2
| | | | | | | | > This ensures that LauncherAppState is only accessed in the presence of a valid context Bug: 33032833 Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
* Using java_style enum generation for protoSunny Goyal2016-12-151-1/+2
| | | | | | | This makes it easier to track various method parameters and simplifies debug logging Change-Id: Ib7c3d52590d0c36b2c8460c889ee3bead3454569
* Smooth animation when dropping a widget in multi-window mode.Jon Miranda2016-12-141-1/+1
| | | | | | | | | | Factored in app widget scaling in methods related to estimating widget size and positions. ie. Dropping a widget that needs to be resized to fit in the workspace. Bug: 32176631 Change-Id: I106fe12041565a090047f146a07d4bc80a074b4a
* Refactoring FlingToDeleteSunny Goyal2016-12-131-16/+2
| | | | | | | | | | > 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
* Fixing static instance of Indexer being created in the modelSunny Goyal2016-10-191-3/+5
| | | | | | | | | | | | Indexer depends on the locale and should be created when ever the config changes. Moving the widget indexing to the adapter (similar to allApps) which gets created whenever the activity is recreated. This fixes the bug where widgets indexing breaks if locale changes while launcher process is alive Also fixing the bug in widget model cloning where the HashMap was not cloning the underlying ArrayList Change-Id: I7dbe6290e73299c4c07aa7fa564077a2649e1a4c
* Show error toast messages when there is no room for the item when icon is ↵Jon Miranda2016-10-181-18/+0
| | | | | | | | | | | not to be added to folder. * when user tries to add item to full hot seat from workspace. * when user tries to add item to full home screen from workspace. * refactored so that Workspace handles displaying error messages. Bug: 15574422 Change-Id: Ibc98c7f45bc0c646dc4636660fba62be9db22ac0
* Refactors in UserEventDispatcherHyunyoung Song2016-10-061-1/+1
| | | | | | - LaunchSource -> LogContainer Change-Id: I71bfee992fb1ba7ae80e824d419f7bf8d3020999
* Code sanitizationHyunyoung Song2016-10-061-1/+1
| | | | | | - Removed bad method/class name typos Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
* Move TransformingTouchDelegate logic to BaseContainerView.Jon Miranda2016-09-221-20/+2
| | | | | | | | | | | | | In ag/1460444 we used TransformingTouchDelegate to extend the touch target for the widgets list. Now both WidgetsContainerView and AllAppsContainerView will use the same TransformingTouchDelegate logic to extend the touch target for their respective lists. This is part of a larger refactor where in a follow up CL, we will handle the logic for dismissing WCV and AACV when touching outside of its content in BaseContainerView. (currently broken in WCV). Change-Id: I7fddb456bba34a6533f8824da0481d308a8b715e
* Uses a TransformingTouchDelegate to extend touch target for widgets list. ↵Jon Miranda2016-09-191-16/+17
|\ | | | | | | | | | | | | | | am: 0ef81fdc22 am: 48542731c5 Change-Id: Ia2bd1b6e5203f40ce3ef75a05712ee63ccfbf3e3
| * Uses a TransformingTouchDelegate to extend touch target for widgets list.Jon Miranda2016-09-191-16/+17
| |\ | | | | | | | | | | | | | | | am: 0ef81fdc22 Change-Id: I33962020ff1cf75e46254c24687a53fd5b2088fa
| | * Uses a TransformingTouchDelegate to extend touch target for widgets list.Jon Miranda2016-09-191-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | The widget row contents were being clipped, which made it seem like the horizontal scroll was broken. Bug: 30023607 Change-Id: I00b0c334bbb0faf166d4cd168392cc494ed732e0
| | * Support user event logging for drag and dropHyunyoung Song2016-09-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b/30039490 Supported in this CL: - DnD: drag from container [WORKSPACE|HOTSEAT|FOLDER|ALLAPPS|WIDGETS|DEEPSHORTCUTS] drag to container [HOTSEAT,WORKSPACE,FOLDER,DROPTARGETS] - Source and target can be [FOLDER_ICON, ICON, DEEPSHORTCUT, WIDGET] - $ adb shell setprop log.tag.UserEvent DEBUG will turn on debugging Change-Id: I0b8b879b80e6dce85bbde6e7794f9e0677832603 (cherry picked from commit 59a238095e82fd02355f4cb53abe01655a50b051)
* | | Moving some image handling classes to .graphics packageSunny Goyal2016-09-021-1/+2
|/ / | | | | | | Change-Id: Id6d3d0b9c345a503ff2e09f073eb4b6449e21c7e
* | Some drag and drop code refactor:Sunny Goyal2016-09-011-1/+2
| | | | | | | | | | | | | | | | | | 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
* | Support user event logging for drag and dropHyunyoung Song2016-09-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | b/30039490 Supported in this CL: - DnD: drag from container [WORKSPACE|HOTSEAT|FOLDER|ALLAPPS|WIDGETS|DEEPSHORTCUTS] drag to container [HOTSEAT,WORKSPACE,FOLDER,DROPTARGETS] - Source and target can be [FOLDER_ICON, ICON, DEEPSHORTCUT, WIDGET] - $ adb shell setprop log.tag.UserEvent DEBUG will turn on debugging Change-Id: I0b8b879b80e6dce85bbde6e7794f9e0677832603
* | Moving the state changes during drag-n-drop from startDrag to onDragStartSunny Goyal2016-08-151-10/+5
|/ | | | | | | This will allow drag controller to optinally defer drag, based on some threshold, by simply deferring the callback onDragStart Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
* Initial changes to tweak layout.Winson2016-07-201-10/+17
| | | | | | | | | | | | | | | - Adding DeviceProfile callback for when the launcher layout changes due to insets. This is necessary since there are now different layouts depending on which side the navigation bar is on - Consolidating hotseat and other layout into the device profile launcher layout logic - Making the all apps icons match the workspace icon height - Tweaking caret drawable to draw to the bounds specified to simplify layout in each orientation - Fixing minor issue with page indicator shifting in landscape - Centering overview buttons to the workspace page Bug: 30021487 Change-Id: I1866bce00b2948f3edd06168c0f88d81207e3f13
* Update Launcher to use theme colors.Andrew Sapperstein2016-06-201-2/+2
| | | | | | | | | | | | | | | | | | | Instead of using hard-coded variants of colors, use the theme color that corresponds (colorAccent, colorPrimary, etc). Updated: - "Search for more apps" text - App info drop target hover color - PageIndicatorDots - All apps & widget scroll bar & scroll popup colors - All apps section text color - widget picker background color TODO: - widget picker header color BUG: 28625102 Change-Id: I74b543ff71b8caef8cd950c8183ac84c759cb4d5
* Adding a loading view for widgets listSunny Goyal2016-05-191-0/+6
| | | | | Bug: 28427096 Change-Id: Icdc5ceed0caa1fafc97452142e4b71aa3026ddf9
* Removing dependency on LauncherCallbacks for getting the search boundsSunny Goyal2016-03-171-16/+12
| | | | | | | | | | | > Instead of handling insets in BaseContainerView, directly applying them to margins, as that scpace can't be used for scroll handling > Appliying the top and bottom padding in xml > The left & right padding is defied in xml which is reused for scroll handling Bug: 27108154 Change-Id: Ia32e6d5e8fd1bfafb1d77d1244ce2268e4da9df9
* Merge "Fix widget tray clipping due to wrong padding" into ub-launcher3-calgaryHyunyoung Song2016-03-141-1/+9
|\
| * Fix widget tray clipping due to wrong paddingHyunyoung Song2016-03-141-1/+9
| | | | | | | | | | | | | | | | b/27380335 padding was set wrong when the widget view hierarchy was being refactored in this CL: ag/870011 Change-Id: I003634acded2bbe204098c0e6fefff13d154b5d6
* | Changing the widget loading strategySunny Goyal2016-03-091-0/+4
|/ | | | | | | | | Widget is loaded only when the user enters the overview mode and we keep the list updated as long as the user is in the overview mode. Once the user leaves the overview mode, we stop responding to widget updates Bug: 26077457 Change-Id: I9e4904b8f1300bfe0d77e2bc5f59aa6963fad8d1
* Merge "Change preloading coefficient for widgets tray to improve jankness on ↵Hyunyoung Song2016-02-241-13/+1
|\ | | | | | | | | | | | | | | | | low performance devices." into ub-launcher3-burnaby-polish am: 2cb92eb2bb * commit '2cb92eb2bbfbd6ae4331657d3446f3f771aabd4b': Change preloading coefficient for widgets tray to improve jankness on low performance devices.
| * Change preloading coefficient for widgets tray to improve janknessHyunyoung Song2016-02-231-13/+1
| | | | | | | | | | | | on low performance devices. Change-Id: I6dfe1161bf596792a7fc8b3c5160a4922e177834
* | Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies ↵Sunny Goyal2016-02-231-1/+2
| | | | | | | | | | | | | | | | breakage" This reverts commit fc956e5a2a818c06ed3424e15b0aa20a3f604658. Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
* | resolve merge conflicts of a6194d3d92 to ub-launcher3-calgarySunny Goyal2016-02-191-11/+7
|\| | | | | | | Change-Id: I29b3c3bb2c070e34c78c62b8f9086e6f3c8bd277
| * Wrapping thw widgetList inside a layout, so that it has the same view ↵Sunny Goyal2016-02-191-12/+7
| | | | | | | | | | | | structure as allApps Change-Id: I28b035beb1c7e13101ec20ff671d3cad5f757c0e
* | Reverting refactoring of Folder and FolderIcon to avoid dependencies breakageSunny Goyal2016-02-171-2/+1
| | | | | | | | Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
* | Refactor FolderIcon to separate the preview effect into it's own classAdam Cohen2016-02-121-1/+1
| | | | | | | | | | | | | | -> 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
* | resolve merge conflicts of 3826bab27e to ub-launcher3-calgary.Sunny Goyal2016-02-101-26/+2
|\| | | | | | | Change-Id: I14ff2d67de4ba97628bdf651602724f9f4989173
| * Merging search bar with all appsSunny Goyal2016-02-081-26/+2
| | | | | | | | Change-Id: I78577124cd3c05d52669c3e52b0294d6eb1d194d
* | resolved conflicts for a8709ddb to ub-launcher3-masterTony Wickham2015-10-151-6/+9
|\| | | | | | | Change-Id: I172395e6e172914627b6dec721070a66520557b1
| * Fix "The specified child already has a parent" IllegalStateException.Tony Wickham2015-10-151-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was due to a race condition between removing a prebound widget view from the drag layer and adding the same view to the workspace upon dropping it; if you let go of the widget immediately after picking it up, the latter happened before the former. Specifically, the flow was: long-click a widget --> drop --> remove the view from the drag layer if it's not null (it is, so nothing happens) --> the view is finally bound/inflated and added to the drag layer --> add the view to the workspace --> already has a parent. There are actually 2 problems here: one is that the bind/inflate is asynchronous, and can therefore happen after dropping the widget view being inflated, and the other is that the view is added to the workspace even though the transition has barely started (we usually ignore drops if the transition is less than half complete). It turns out that this second problem was also due to a race condition, this time between dropping a widget or app onto the workspace and calling LauncherStateTransitionAnimation.dispatchOnLauncherTransitionStart(). If the drop happened before the dispatch, as in the case of the crash, then the drop was accepted because the transition progress was still 1.0 from the previous transition. I fixed the first problem by removing the drag layer widget view in Launcher where it is potentially used instead of Workspace. And I fixed the second problem by setting mTransitionProgress to 0 in Workspace.onLauncherTransitionPrepare(). I also added some debugging logs. Bug: 23896857 Change-Id: I66944e6d3f23b70dea15f7fb01af0763a1bfcbda
* | Added 'Cancel' drop target from all apps and widget picker.Tony Wickham2015-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | - 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
* | resolved conflicts for e78e3d73 to ub-launcher3-masterSunny Goyal2015-09-251-3/+5
|\| | | | | | | Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
| * Accessibility fixesSunny Goyal2015-09-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | 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
* | When placing a widget, go to a page with enough space.Tony Wickham2015-09-091-1/+3
| | | | | | | | | | | | | | | | | | | | The search for this page starts at the current one and continues to the right (on LTR) until a page is found that can accomodate the widget, taking possible resizing and reordering into account. Bug: 11338870 Change-Id: I2e9a310eb8f74024dca9150f55a525e1309c2f07
* | General code refactoringSunny Goyal2015-08-201-1/+1
| | | | | | | | | | | | | | | | | | > Removing utility method for isAttachedToWindow > Moving logic to calculate cell size from workspace to DeviceProfile > Replacing some constants with xml resource variables > Saving the item info using content values for better compatibility with other methods Change-Id: Idd612633d97a6241cb31148df9466031374bd5a0
* | Moving drag-drop related code into a separate package.Vadim Tryshev2015-08-201-1/+1
| | | | | | | | | | | | | | | | | | 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