1026 Commits

Author SHA1 Message Date
Tony
2fd0208605 Use Launcher.getLauncher(Context) instead of type-casting.
Bug: 32010039
Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
2016-10-07 12:50:01 -07:00
Hyunyoung Song
df7ef68bbf Refactors in UserEventDispatcher
- LaunchSource -> LogContainer

Change-Id: I71bfee992fb1ba7ae80e824d419f7bf8d3020999
2016-10-06 17:52:22 -07:00
Hyunyoung Song
0de011705b Code sanitization
- Removed bad method/class name typos

Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
2016-10-06 10:57:29 -07:00
Jon Miranda
f3e35d9331 Add logging for long presses. Reset elapsed timer when changing containers.
This is the first CL in a series of logging-related CLs. Upcoming CLs will
include using Commands (HOME_INTENT, BACK) and "tapping outside" of a container
logic.

Change-Id: I62f0a08c7a9d9fce0baa5c12c67e21f63ab16a7c
2016-10-05 15:22:23 -07:00
Tony Wickham
10236d6ac7 Update pre-drag lifecycle for apps with shortcuts.
- First of all, deferred drag has been renamed to pre-drag
  to avoid confusion with the existing deferred end drag.
- For normal drags, the cycle is still startDrag -->
  onDragStart --> onDrop --> onDropComplete --> onDragEnd.
- Pre-drags have two additional callbacks: onPreDragStart
  and onPreDragEnd. onPreDragStart is called between
  startDrag and onDragStart, and onPreDragEnd is called
  at the same time as onDragStart or onDragEnd.
- If the pre-drag has not transitioned to a full drag before
  onDragEnd, onDragStart and onDropComplete are skipped
  (onDrop is still called to allow the DragView to animate).

Change-Id: Icd7a8f75d5fcc159f9a52758c22ab6eae3edb9e2
2016-10-04 12:26:35 -07:00
Hyunyoung Song
1784d579f4 Consume ACTION_UP when fling is detected on top of icon
am: 035a516e18

Change-Id: I0eb8f0c83e1a1611d8bb3b9309d69b8df7c7a19d
2016-09-30 23:29:32 +00:00
Hyunyoung Song
035a516e18 Consume ACTION_UP when fling is detected on top of icon
Bug: Adam found out that when you swipe down fast on an icon, you can
launch search AND launch an app. Only one should trigger and not both.

Change-Id: I66b9df26d8bb355f011d057dafd45f90f59b82ae
2016-09-30 16:13:55 -07:00
Sunny Goyal
fe770c9feb Cleaning up restore instance state logic
Restore instance state is only used for first binding. But in case of restore,
the binding happens synchronously, so there is not need to store the bundle
in a global variable

Change-Id: Ibc496bcd7c0d171056b8afc69f2c4d9a1270d40c
2016-09-28 11:35:13 -07:00
Tony
5eea1e89dd resolve merge conflicts of 6e74e89 to ub-launcher3-master
Change-Id: I34e449ca3a91ee06e1983ac3a83cb7ca53567a91
2016-09-23 19:43:35 -07:00
Tony Wickham
6e74e899d3 Refactor shortcuts drag and drop.
- Instead of creating our own drag view within the container, and
  handling logic to determine when to start a real drag, we start
  the drag immediately and just defer onDragStart().
- To determine when the deferred drag should start, we add a
  DeferDragCondition to DragOptions. The default DeferDragCondition
  never defers a drag, but is overridden for apps with shortcuts
  to defer until the icon is dragged a given distance.
- Because the drag is handled in DragController, including checking
  when to start the deferred drag, DeepShortcutsContainer no longer
  needs to handle touch events and ShortcutsContainerListener has
  been removed.

This change has several immediate benefits:
- The code is much cleaner, because it allows touch handling to be
  done by the DragController through the normal drag flow, without
  recreating logic in ShortcutsContainerListener/DeepShortcutContainer.
- The janky second haptic feedback has been removed (now it vibrates
  when you long press, like everywhere else, but not again when the
  shortcuts close after dragging a distance).
- Drops are animated, instead of just popping the icon back into place.

Bug: 30769920
Bug: 30465972
Bug: 31533078
Change-Id: I679b412b72fbf6c3895d76963311eb5010c8e8db
2016-09-23 18:44:47 -07:00
Sunny Goyal
c2f72b0bb8 Merge "Resize only one widget at a time" into ub-launcher3-master 2016-09-23 23:23:03 +00:00
Sunny Goyal
6ad72f02fd Resize only one widget at a time
> Removing logic to have multiple widgets in resize mode
> Making ResizeFrame a touch controller, so that it fits well with
other touch interaction in drag layer
> Chaning the method names in touch controller, so that it do not
overlaps with the default View methods

Change-Id: I85d4dbdfc82d078781adbce137dfaaea59c9c83d
2016-09-23 16:02:49 -07:00
Tony Wickham
a07b9335e4 Stop jumping to workspace from hotseat on quick drop.
am: dbf08b4aee

Change-Id: Id1a4c65f14810dcf3e6534796d797603070c5d68
2016-09-23 00:37:12 +00:00
Tony Wickham
dbf08b4aee Stop jumping to workspace from hotseat on quick drop.
Regression occurred in ag/1315317.

In that change, Launcher#enterSpringLoadedDragMode() was moved from
the end of startDrag() to the end of onDragStart(). This changed the
sequence of events from:

beginDragShared() --> DragController#startDrag() --> onDragStart -->
dropTarget.onDragOver() --> Launcher#enterSpringLoadedDragMode()

to:

beginDragShared() --> DragController#startDrag() --> onDragStart -->
Launcher#enterSpringLoadedDragMode() --> onDragOver()

Basically, the key difference is that onDragOver() is called after
enterSpringLoadedDragMode(). This matters, because onDragOver()
returns early if Workspace#transitionStateShouldAllowDrop() returns
false, which it does during the spring loaded transition. This meant
that onDragOver() didn't update the layout to be Hotseat, and thus
the current workspace page was used as default, since that is what
was set in onDragEnter(). To fix it, I've copied the logic in
onDragOver() that checks to see if the drag is over the hotseat first
to a new method that onDragEnter() now calls as well.

Bug: 31245181
Change-Id: Ie758921b25fc96516a09c32bdc9706da941522df
2016-09-20 16:48:42 -07:00
Hyunyoung Song
cbf371cddc Fixing issue where overview->normal workspace mode cannot be done by tapping b/31458165
am: f99370c2a9

Change-Id: Id5c7b068fae21a2c4941390bf99db413581ede44
2016-09-16 19:45:06 +00:00
Hyunyoung Song
f99370c2a9 Fixing issue where overview->normal workspace mode cannot be done by tapping
b/31458165

Because workspaceInModalState makes the VerticalFlingDetector
to consume the touch input, click is not detected in Overview mode.

Placed pulldown to search behind a feature flag.

Change-Id: I31ab69f57944a18e6b264c4f2ed2d0c1175cd940
2016-09-16 12:03:27 -07:00
Hyunyoung Song
ae02616a17 Pull down should start search. b/31458165
am: 46133612b4

Change-Id: I1147a69e6dd9fbfb614b8740a30e6c840948435a
2016-09-15 17:58:47 +00:00
Hyunyoung Song
46133612b4 Pull down should start search.
b/31458165

Change-Id: If4821e3d89a05a00551af6a5209ebc1693a1389b
2016-09-15 10:48:25 -07:00
Sunny Goyal
2eea42fcb9 Using DragObject for folder drop instead of maintaining states when drag starts from inside a folder
am: e393d3af36

Change-Id: I44abfbed5ea0a8125b8c5ca50ecdf3a205de8775
2016-09-12 20:29:45 +00:00
Sunny Goyal
e393d3af36 Using DragObject for folder drop instead of maintaining states when
drag starts from inside a folder

Change-Id: I073b59c194d0bd483d579bbcb638b116b09590a0
2016-09-09 17:25:38 -07:00
Sunny Goyal
40452cf468 Using ItemInfoMatcher in place of similar interfaces and utility methods
Change-Id: I7337b819fe8f42f7a5a1481b5ed5d99a8cf583c4
2016-09-08 15:39:50 -07:00
Sunny Goyal
52851aa3fd Fixing topView not being considered in all places when calculating accessible
and focusable views

Bug: 30563273
Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
2016-09-02 10:52:07 -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
Hyunyoung Song
61bcfba335 Merge "Support user event logging for drag and drop b/30039490" into ub-launcher3-calgary-polish 2016-09-01 21:51:25 +00:00
Hyunyoung Song
59a238095e Support user event logging for drag and drop
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
2016-09-01 12:47:12 -07:00
Sunny Goyal
dfc8b6685b Preventing unnecessary setLayout calls in workspace
Separating getSystemProperty in a separate method

Change-Id: I88716e796e29ac27ef25afa41077a8f29eb65f25
2016-08-30 14:06:51 -07:00
Sunny Goyal
d1602ddfdf Merge "Moving the state changes during drag-n-drop from startDrag to onDragStart" into ub-launcher3-calgary-polish 2016-08-16 17:47:59 +00:00
Hyunyoung Song
8ce6063c4a Set launch source target correctly for user event logging
Before, everything is set to APP_ICON
With this changed, pinned shortcuts are set to DEEPSHORTCUT

Change-Id: I3e17de63f58693525236290ef5cb1f909f1d6098
2016-08-15 16:22:20 -07:00
Sunny Goyal
06e21a2587 Moving the state changes during drag-n-drop from startDrag to onDragStart
This will allow drag controller to optinally defer drag, based on some
threshold, by simply deferring the callback onDragStart

Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
2016-08-15 10:08:16 -07:00
Sunny Goyal
d3b87ef196 Adding quiet mode support for shortcuts
> LauncherApps returns empty list when the user is locked. Not relying on
LauncherApps in this case
> When the user is locked, removing all dynamic shortcuts
> Loading shortcuts from DB when the user is locked
> Verifying the shortcuts again when the user is available

Bug: 30411561
Change-Id: Ib6eb372c5b009cadb86a8f6e781f3f3cbf787ceb
2016-07-29 16:10:31 -07:00
Winson Chung
c42087e5c0 Merge changes I33da0d7f,I36c31609 into ub-launcher3-calgary
* changes:
  Working around incorrect wallpaper offsets being calculated in RTL.
  Fixing RTL wallpaper scrolling.
2016-07-29 05:49:20 +00:00
Winson
c7d2e83c15 Working around incorrect wallpaper offsets being calculated in RTL.
- When launcher starts up, onCreate() triggers the launcher model loader
  to start, which calls bindScreens() to add the workspace pages.  
  However, layout does not happen until the device is unlocked, which 
  means that even though the default screen index and children are there
  the page scrolls are calculated incorrectly, and even in RTL, the 
  page scroll for the 0th screen is zero (it should be at the right
  most edge of the workspace).  This CL works around this by deferring 
  until the first layout after bindScreens() to unlock the wallpaper
  offset from its default bounds.  The workaround is only applied when 
  the launcher activity is first created.

Bug: 28795125
Change-Id: I33da0d7f934f5337d26e69f068f579a32897a837
2016-07-28 16:21:20 -07:00
Sunny Goyal
a2454ad2d8 Launcher shortcuts animations update.
> The shortcut container closes with an animation
> When opening/closing the animation only the icon scales
and not the title and drag handle
> When dragging the icon, it starts from the original icon position and
moves under the user finger. The container grows to follow the drag view.

Bug: 28980830
Change-Id: Ic0353c30b682d1f018cbf4d62e8a6e8e7d7d4664
2016-07-27 17:37:23 -07:00
Sunny Goyal
e117f53f36 Merge "Fade QSB with the workspace as the overlay enters" into ub-launcher3-calgary 2016-07-28 00:23:04 +00:00
Adam Cohen
2a82afd6f6 Fade QSB with the workspace as the overlay enters
Change-Id: Iadab9d9f051a85f6772a5d54d38534fcf1b029d7
2016-07-27 17:00:20 -07:00
Sunny Goyal
10923b30a2 Removing shadow and badging from the icon which is shown in the menu
These are added as soon as the icon is added to the workspace

Bug: 28980830
Change-Id: I725d2ee8994324f09d9ecf7bbbb0090a7ceb5769
2016-07-26 14:18:09 -07:00
Winson
8f288aac99 Ensure that we update the preview layout rule when not animating.
Bug: 28166173
Change-Id: Ibf0245f2dd667216ccabb23a1b279b1801d60cac
2016-07-25 17:12:32 -07:00
Sunny Goyal
157793dda4 Increasing the size of the drag icon when a shortcut is dragged
Change-Id: I7d768657300d3229e05d1eb18aec3720a9098ffc
2016-07-21 15:18:24 -07:00
Sunny Goyal
71b3d1c38e Optimizing open shortcuts container lookep
findviewById does a DFS, inseat only looking at the first level children

Change-Id: Idc028a56648ca026c6022425e3a6e7453fa91986
2016-07-20 17:42:58 -07:00
Sunny Goyal
5bc04e67f7 Merge "Protecting QSB scroll while transition animation is running." into ub-launcher3-calgary 2016-07-20 18:59:20 +00:00
Sunny Goyal
c553c33ae6 Protecting QSB scroll while transition animation is running.
During transition animation the qorkspace scroll changes while the actual
workspace UI is mostly stable. This causes the QSB to animate while the
pages are not changing.
Bug: 30229069

Change-Id: I66ec41276c0e26164d20da6a5e0e251975390428
2016-07-20 11:20:37 -07:00
Winson
1f06427266 Initial changes to tweak layout.
- 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
2016-07-20 10:17:08 -07:00
Peter Schiller
bbff2926f8 Remove caret in overview mode
Bug: 30162951
Change-Id: I71f585e4ae6dfba9dc1d18cd00e45d081cabd4b3
2016-07-19 12:35:16 -07:00
Peter Schiller
a30b51ceb2 Adding stateful caret drawable
Change-Id: Iba30da09f882297f789c405f932fef10617bba89
2016-07-14 17:22:49 -07:00
Sunny Goyal
01440c6e83 Adding a view to indicate space blocked by QSB when QSB is hidden
Change-Id: Ifc6b1f2a7312e7919582887ea67bfe900668b70f
2016-07-14 15:12:37 -07:00
Sunny Goyal
6178f13e2d Moving the QSB out of the cell layout to the Drag layer
This allows better edge matching for the QSB. The QSB position
is kept synchronized with the page scroll and all-apps transition.
But its not visible in spring loaded and overview mode

Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
2016-07-13 12:37:08 -07:00
Sunny Goyal
b30562da1e Merge "Adding support for non-zero left insets" into ub-launcher3-calgary 2016-07-09 23:25:44 +00:00
Sunny Goyal
53fe1f26d3 Updating page indicator content description to indicate click target
for apps list

Bug: 29777235
Change-Id: Ia3dc20db7ec06455429389de5752b9bcfff15555
2016-07-08 08:49:34 -07:00
Sunny Goyal
6c2975e7e3 Adding support for non-zero left insets
Bug: 29613069
Change-Id: Ifdf9bcce7ecdedc510f3be8a4dc10eb8da7c4bf1
2016-07-07 16:54:58 -07:00
Sunny Goyal
e49a97aba0 Changing isExternalDragWidget to isDragWidget as workspace goes to
modal state even when dragging from workspace

Bug: 29900481
Change-Id: I60ce6073b1c06ed19c75a341f9b73f6a147be889
2016-07-07 15:28:07 -07:00