1026 Commits

Author SHA1 Message Date
Tony Wickham
9a8d11f930 FastBitmapDrawable can draw an icon badge (notification count)
- Added BadgeInfo to contain data to be shown in a badge
  (currently just notification count).
- Added BadgeRenderer in DeviceProfile to contain things
  relevant to drawing the badge, such as size and Paint's.
- Added IconPalette to compute colors for the badge based
  on a dominant color (will also be used for notifications)
- FastBitmapDrawable uses these classes to draw the badge.

Bug: 32410600
Change-Id: I6595a4879943357590f7d20c22594691a573ecaf
2017-01-13 10:58:10 -08:00
Sunny Goyal
87f784c285 Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context

Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
2017-01-11 12:52:03 -08:00
Sunny Goyal
76dbf6fafd Fixing onPageBeginTransition not being called when scrolling overlay
Bug: 33693546
Change-Id: If212a196648fbb2c725ca4800a157ec24f278ca8
2017-01-04 09:29:16 -08:00
Mario Bertschler
83d40e0608 Merge "Fixes a bug where the user ends in freescroll state even for regular workspace mode." into ub-launcher3-master 2016-12-29 23:33:01 +00:00
Sunny Goyal
c6b833dcbb Merge "Removing all compatibility code below Lollipop" into ub-launcher3-master 2016-12-29 21:29:31 +00:00
Mario Bertschler
dcc26fc693 Fixes a bug where the user ends in freescroll state even for regular workspace mode.
The bug happened while reordering pages in overview mode and clicking the back button.
The fix is to check the precodition in enableFreeScroll if we are in a valid state for enabling freescroll (currently only overview mode).

Bug: 33347786
Change-Id: Icc3005fd431569e2b9e3f52d2249de8ba8d13eab
2016-12-29 12:03:35 -08:00
Jon Miranda
c9c57631a9 Fix clipping of drag outline by increasing padding.
Low resolution will be addressed in future CL.

Bug: 31915722
Change-Id: I6bdd32b7a30819fde1f15473a63ac280029b6715
2016-12-20 10:08:42 -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
aecb7cf97c Updating edge scrolling logic during drag and drop
Activating scroll to left when the either the visualCenter or the touchX
enters the left screen first or right screen.
Previously only the touch point was being considered to activating the scroll
zone. But visual center is used everywhere else for actual drop location. So
depending on the touch point relative to the picked icon, the touch zone could
seem smaller or larger.
Using both points (touch and visualCenter) will increase the scroll zone area
with minimal effect on the drop location calculation.

Bug: 31946075
Change-Id: I4eb5146c0f0a05e8d024313d67f8e040e0b29dec
2016-12-16 11:29:06 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
338dee9dd7 Merge "Ensuring that ShortcutInfo always has an icon" into ub-launcher3-master 2016-12-16 00:21:29 +00:00
Jonathan Miranda
99d814e54b Merge "Restore original scaleRectAboutCenter method." into ub-launcher3-master 2016-12-15 19:36:40 +00:00
Jon Miranda
6f6a06ac47 Restore original scaleRectAboutCenter method.
Change-Id: Ibb49c56aab29d1223a0ab36476a32d565566eb25
2016-12-15 11:26:43 -08:00
Sunny Goyal
6c46a6d324 Using java_style enum generation for proto
This makes it easier to track various method parameters and simplifies
debug logging

Change-Id: Ib7c3d52590d0c36b2c8460c889ee3bead3454569
2016-12-15 09:30:35 -08:00
Sunny Goyal
f5440cbd6c Removing FeatureFlag.LAUNCHER3_LEGACY_WORKSPACE_DND and corresponding logic
Change-Id: Ie10c087b4f72ee27be5bf12e2c81be5b7a3a6176
2016-12-15 08:05:09 -08:00
Jon Miranda
e96798e885 Smooth animation when dropping a widget in multi-window mode.
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
2016-12-14 16:30:20 -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
Sunny Goyal
1cd01b023a Ensuring that ShortcutInfo always has an icon
> Making iconBitmap public instead of a getter (similar to AppInfo)
> Removing getIcon() which can lead to IO on UI thread
> Removing updateIcon and handling the update at the caller

Bug: 21325319
Change-Id: I6a49b9043f974e9629ea25e77012d97cc04c0594
2016-12-13 10:31:12 -08:00
Tony Wickham
72537e44f6 Merge "Move icon back to original cell if a quick drag would cause reorder." into ub-launcher3-master 2016-12-12 22:17:02 +00:00
TreeHugger Robot
2a2b1ad8fd Merge "Lower the transition threshold for dropping on Workspace." into ub-launcher3-master 2016-12-12 22:02:55 +00:00
Tony Wickham
251ab6e847 Lower the transition threshold for dropping on Workspace.
Old threshold: 0.5f
New threshold: 0.25f

The threshold is used when dragging to Workspace from any
drag source other than Workspace, including Hotseat. This
lowered threshold is more forgiving for faster drags.

Bug: 33210055
Change-Id: Ic121fb4b7caa3ea66abb48a8a3f3bd36f3365749
2016-12-12 13:56:36 -08:00
Tony Wickham
0c7852f822 Allow long-press on workspace immediately after dropping.
Previously the touch was consumed until the transition from
spring-loaded to normal workspace finished, leading long
presses to trigger on the background rather than on apps.
This made it difficult to move multiple icons consecutively.

Bug: 29631912
Change-Id: I259e618c81f56bc40d08a5d63ddbbf3c82a76baf
2016-12-12 12:51:27 -08:00
Jonathan Miranda
72169102db Merge "Scale widgets when dragging and dropping in multi-window mode." into ub-launcher3-master 2016-12-08 18:43:17 +00:00
Jon Miranda
f7ff3fe58a Scale widgets when dragging and dropping in multi-window mode.
This change mimics the non-MW mode behavior when dragging and
dropping widgets by taking the app widget scale into consideration.
This ensures a consistant drag and drop experience between
MW mode and non-MW mode.

* Uses cell data (cell height/width, spanX/Y) to get the expected
widget sizes.
* Scales sizes when necessary.

Bug: 32176631
Change-Id: Icdaf73ecd89a30e57fe7f405292d793f2d6a3ee8
2016-12-08 10:28:51 -08:00
Sunny Goyal
d5462aa31b Simplifyling widget inflation and addition flow.
> Removing insert parameter used to select the index of the view.
  ShortcutAndWidgetContainer no longet relies on the index and instead
  uses x and y to refer a particulat view.
> Creating helper methods to easily insert the icon by passing ItemInfo
  directly. LauncherModel.addItemToDatabase synchronously updates the
  ItemInfo with proper postion information. So we can directly use the
  info instead of passing each parameter separately.

 Bug: 32904959

Change-Id: I021c1b818f2f42604b95a6970e06aacc7211292a
2016-12-07 13:16:08 -08:00
Tony Wickham
5dc7435b33 Move icon back to original cell if a quick drag would cause reorder.
Most likely the user accidentally dragged the icon, so let's not
rearrange their home screen.

Bug: 30378199
Change-Id: I815a0817bca3b0d212324a58842b1f59dfdf0b91
2016-12-07 10:33:16 -08:00
Tony Wickham
4633be64e8 Fix for mTransitionProgress not being updated throughout animation.
Change-Id: I8f792794b7bc6edff081383b5a0a74af04a744ad
2016-12-06 17:11:35 -08:00
Jon Miranda
feba90fe80 Added logging for HOME_INTENT and BACK commands.
Document: go/false-longpress-overview

Change-Id: If6ba4996c861a44f4950b41acb4246e3a483d8f2
2016-11-21 17:01:24 -08:00
Hyunyoung Song
0860e41d50 Add logging for workspace rearrangement in overview mode
am: 0d4899026c

Change-Id: Ie6569ecafdd63981e167a910f852a8133697ae81
2016-11-21 19:48:08 +00:00
Sunny Goyal
db2fa049a6 Merge "Moving saving state transtion listener logic to individual views" into ub-launcher3-master 2016-11-18 01:17:51 +00:00
Hyunyoung Song
0d4899026c Add logging for workspace rearrangement in overview mode
b/32457561

Change-Id: Ic38fbd540616a74f26c19a09ab4247fe8f9174b4
2016-11-17 20:48:18 +00:00
Tony Wickham
075b878842 Merge "Animate icons back to where they were picked up." into ub-launcher3-master 2016-11-15 19:53:32 +00:00
Sunny Goyal
db36437931 Moving saving state transtion listener logic to individual views
Change-Id: If5402b6961d7d6be0c50778f27a8746ed6f1bbfb
2016-11-14 17:43:31 -08:00
Sunny Goyal
c48a89e59c Merge "Calling buildLayer only on views which are actually visible" into ub-launcher3-master 2016-11-07 18:09:43 +00:00
Tony Wickham
ea62fe0be1 Animate icons back to where they were picked up.
We do this for pre-dragged icons instead of calling onDrop().
- Removes need for special logic in onDrop() to check if mIsInPreDrag
- Dropping from pre-drag in all apps also animates instead of jumping

We also do this when dropping an icon while still transitioning
to spring-loaded mode, to avoid having a janky jump at the end
- Bug: 27135377

Change-Id: I4548c3e2fef3423d1ba36057fb53807b1b4ad0fc
2016-11-02 15:07:57 -07:00
Sunny Goyal
cce078099c Fixing screen center not getting calculated properly
Bug: 32578597
Change-Id: Icdf5dc2d82eab3d90b380736d7256ca2d9b2df2e
2016-11-01 14:01:10 -07:00
Tony Wickham
968c283f22 Merge "Restore mDragInfo when deferring onDropComplete() for uninstall." into ub-launcher3-master 2016-10-27 21:05:52 +00:00
Sunny Goyal
b5e65c8bd3 Calling buildLayer only on views which are actually visible
> Creating a common listener for handling buildLayer logic

Bug: 30138067
Change-Id: I803ef78b48e07e5ae5922e0392d390f274a87d75
2016-10-26 18:34:21 -07:00
Sunny Goyal
9ccafbff26 Removing custom dispatchDraw logic and letting the system handle
selecting appropriate children for drawing.

> System already skips children which are outside the bounds. Originally
this logic was added because workspace layout is larger than the screen, and
we need to selectivly skip more children. But over time we have added many
special conditions and at present workspace actually draws more children than
needed at any given time.
> Fixing bug, where onBeginPageMoving was getting called during folder open

Bug: 12116740
Change-Id: Idee18ee9cd9d348ebc4dfd82f4ff6df14e0d22d2
2016-10-26 17:14:12 -07:00
Sunny Goyal
35fe7be54e Removing some deprecated code around page layers
1) setChildrenDrawnWithCacheEnabled: deprecated
2) Removing custom logic based on isHardwareAccelerated. This check was not being
used consistantly everywhere

Bug: 29761236
Change-Id: Ic4a9c764f154497e376e37de2351fe04d1b48500
2016-10-26 13:14:03 -07:00
Tony Wickham
4feb27e6b1 Restore mDragInfo when deferring onDropComplete() for uninstall.
We moved mDragInfo = null to onDragEnd() since onDropComplete()
isn't called for pre-drags, but this led to NPE when returning
from unistall or app info since onDropComplete() is called after
onDragEnd() in this case. So now we restore a copy of mDragInfo.

Bug: 32415014
Change-Id: I7ef4fb7145c3c78039af1131e77538969db58141
2016-10-26 12:51:14 -07:00
Tony Wickham
d1f034708b Don't move to adjacent page if it is full when dropping on it.
Bug: 32003721
Change-Id: Ia81b75a73f510ad2a58764dec9eb7e57b9bf2dcd
2016-10-24 10:27:56 -07:00
Tony Wickham
1da143940c Merge "Mark cells as unoccupied in onDragStart instead of startDrag." into ub-launcher3-master 2016-10-19 16:48:43 +00:00
Jon Miranda
9485e5f293 Show error toast messages when there is no room for the item when icon is 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
2016-10-18 14:47:31 -07:00
Tony Wickham
4e47b5b0d6 Mark cells as unoccupied in onDragStart instead of startDrag.
Also move cleanup (resetting variables to null) to onDragEnd
instead of onDropCompleted. These changes are necessary because
pre-drags (for apps with shortcuts) don't call onDragStart
or onDropCompleted.

Bug: 32246571
Change-Id: Ib18fac64555e9158b776f9c12afc2cb807b3c355
2016-10-18 14:46:02 -07:00
Tony Wickham
6982de2485 resolve merge conflicts of 2fd0208 to ub-launcher3-master
Change-Id: I20ad6eaace81786be080e28d6eb551908add6d90
2016-10-12 14:38:43 -07:00
Tony Wickham
cf6195268d Merge "Use Launcher.getLauncher(Context) instead of type-casting." into ub-launcher3-calgary-polish 2016-10-12 21:22:05 +00:00
Sunny Goyal
9c76a9cece Announcing the final action when the drag-drop completes
am: 3f8864069b

Change-Id: Iba49c7ba1d1c2d1f4c279970bbcc3ff96af5ccc0
2016-10-11 20:12:59 +00:00
Sunny Goyal
3f8864069b Announcing the final action when the drag-drop completes
Bug:31926812
Change-Id: Id0566cc7dc15732981320807a02fb9cae8a885e6
2016-10-11 10:55:14 -07:00
Sunny Goyal
740ac7f00e Refactoring floating view opening/closing logic
> Creating a base view for floating panels with some common methods
> Moving the getOpen method to individual classes
> Moving the folder icon animation logic to folder icon
> Moving all the logic related for opening folder to Folder class

Change-Id: I898dfb6870b857cb921d2729b89618bc43ff2e88
2016-10-10 13:36:03 -07:00