Commit Graph

162 Commits

Author SHA1 Message Date
Sunny Goyal
f1fbc3fbe7 Converting widget panel into a floating view
> 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
2017-10-13 18:47:54 -07:00
TreeHugger Robot
a9e345f886 Merge "Removing some methods from the DragSource" into ub-launcher3-master 2017-10-05 17:20:58 +00:00
Sunny Goyal
d0d0703399 Removing predicted apps reset on every onResume
Predicted apps should be pushed by the called whenever they change
instead of Launcher polling them on every UI update.

Bug: 67305604
Change-Id: Ibd3d809b09b7d8fd39036f69367e8580fb90dcef
2017-10-04 10:41:43 -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
Mario Bertschler
e4f03aaa4f Merge changes from topic "am-8d2845b1-eaaf-4e07-8e47-50ed5ddb898a" into ub-launcher3-master
* changes:
  [automerger] Integrating suggested app by handling new status flags for shortcut items. am: 8ff9e1d679
  Integrating suggested app by handling new status flags for shortcut items.
2017-08-25 21:37:51 +00:00
Sunny Goyal
81a70e5dc2 Adding scrim in all-apps scrim
Bug: 64692527
Change-Id: Ib8262ad0cc3c95cd419eb9fa1dee3bbbc2d25a27
2017-08-24 15:11:18 -07:00
Mario Bertschler
8ff9e1d679 Integrating suggested app by handling new status flags for shortcut items.
Guarded via feature flag SUGGESTED_APP.

Bug: 62483883

Change-Id: I7e0c8a9875bc37c435aa4316b44322a628cd4826
2017-08-24 12:23:06 -07:00
TreeHugger Robot
b55b6264ae Merge "Remove LAUNCHER3_ALL_APPS_PULL_UP Bug: 63712253 Verified: all apps transition fully functional Verified: NO_ALL_APPS_ICON = false case also works." into ub-launcher3-dorval-polish2 2017-08-21 19:22:56 +00:00
Hyunyoung Song
d725f644b7 Remove LAUNCHER3_ALL_APPS_PULL_UP
Bug: 63712253
Verified: all apps transition fully functional
Verified: NO_ALL_APPS_ICON = false case also works.

Change-Id: I779fb7bd4927c5923da3f85590d912dbbbcdef4d
2017-08-21 11:59:14 -07:00
Sunny Goyal
b23980cc0e Fixing duplicate/inconsistent definitions for model and callbacks
> 2 implementations for filtering workspace items
> 2 implementations for binding widgets
> duplicate logic for add and update appInfo

Change-Id: Id68a49926af398478deca8ac85ab1f22341a9449
2017-08-17 11:05:56 -07:00
Jon Miranda
7dfabaa02b Fix bug where all apps items fade in.
Removes all Add/Change/Move/Remove animations by
clearing the AllAppsRecyclerView ItemAnimator.

Bug: 64675794
Change-Id: I41f975ab6be4bf48c483828ea6f109382a8a9320
2017-08-15 10:33:54 -07:00
Jon Miranda
7653a60c74 Optimize updating All Apps Predictions.
* Prefetch existing predictions in onResume.
* Only update predictions if something has been changed.
* Swap predictions in place (if possible) -- this avoids
  having to relayout all of All Apps when just the predictions
  change.

Bug: 64126588
Bug: 63711551
Change-Id: Iffa0d9d7d6f99f606dd68b7df5893d6eba1574f5
2017-07-30 11:04:58 -07:00
Jon Miranda
2d5e0e067c All Apps physics polish.
With this change, the springs will now animate if your finger
is on the RecyclerView while you hit the top/bottom.

This covers the case when the user has few apps (ie. the
RecyclerView does not scroll very much).

Bug: 64041310

Change-Id: Ia72aea05d62a6fb896fdb7df379d6c7abd188d6d
2017-07-26 20:21:07 +00:00
Sunny Goyal
2b50b53183 Updating UserEventDispatcher to make some methods accessible.
> Removing helper methods around fillInLogContainerData so that its easier to
  create events with 3 and more srcTargets
> Removing setPredictedApps from userEventDispatcher as its specific to Launcher
  and does not apply to other activities. Instead moving it to AllAppsRecyclerView

Bug: 63719473
Change-Id: Ib92621e41ede4ffe03892642ab173772b5a84dd1
2017-07-19 11:03:35 -07:00
Jon Miranda
2b35905ea7 Add overscroll to the top of All Apps.
* Overscroll at the top of all apps will occur when the user scrolls
  up, hits the top, and continues to scroll up.
* Fixed bug where All Apps jumps when the user enters overscroll
  from a scroll that doesn't start at the bottom.
* Fix bug where AllAppsRecyclerView stays translated even after
  the user has finished dragging.

Bug: 62628421
Change-Id: Ia1d230a7cc07a7cf8c1a7c5211a025034ae5f6df
2017-07-05 14:58:34 -07:00
TreeHugger Robot
efbfcb838d Merge "Sanitizing various search container ids and layout names" into ub-launcher3-dorval-polish 2017-07-04 09:06:53 +00:00
Jon Miranda
35cb8aefea Polish for all apps physics.
By adjusting the start value based on the direction of the scroll,
the springs will appear more smooth.

This only changes the appearance of the spring when scrolling down,
since the start value has always been 1 and thus looked fine when
scrolling up.

Bug: 38349031
Change-Id: I563e6e7cfdbc74c4a95adb22f90d5efe17dfa453
2017-06-29 08:49:10 -07:00
Sunny Goyal
c7b8df8329 Sanitizing various search container ids and layout names
Bug: 63014381
Change-Id: Ia75a8a048c7a85c6324f8861abd2bcf1721032fa
2017-06-27 11:11:32 -07:00
Jon Miranda
ad3194ec81 Add overscroll w/ physics to All Apps.
Bug: 62628421
Bug: 38349031

Change-Id: If3ba6dfbbd3a4b1c87e69df0066f801f963752aa
2017-06-26 22:45:53 -07:00
Sunny Goyal
89d5c5a31b Updating fast scrollbar UI in Landscape
Creating a separate view for FastScrollBar and moving all the relavant logic in
the view.
For protrait, the touch handling is delegated by the recycler view just like before.
For landscape, the dcrollbar does not overlay with recyclerView and handles the touch
itself

Bug: 37015359
Change-Id: Ie1981326457ba739bdf0ac8063db1065f395f133
2017-06-26 14:56:36 -07:00
Mario Bertschler
cd04c89f89 Removing view.isInTouchMode() because plaform returns false when
using a mouse on long click.

Bug: 38204847

Change-Id: I5b10e8251f4f0a7b148c0404d5939a0fa8325a46
2017-06-22 09:29:46 -07:00
Sunny Goyal
5606e07059 Removing long press support from page-indicator
Bug: 62445549
Bug: 38163974
Change-Id: Ic0ae44ded7e4755c5401f327ce0d98a9ea96b2ab
2017-06-15 14:25:12 -07:00
Jon Miranda
5c83e7cdc5 Refactor and generalize SpringAnimationHandler.
SpringAnimationHandler is only responsible for motion tracking and
updating the list of springs it is handling.

Spring initialization and updates are handled by the AnimationFactory
interface.

This is done in preparation for future CLs where SpringAnimationHandler
will be used in more cases.

Bug: 38349031
Change-Id: I5ebce710cc05e4e88b708ceea5d2cfefbd0eb3d0
2017-06-07 15:45:45 -07:00
Jon Miranda
75de76f917 Fix bug where physics appears not to run in all apps.
ie. When scrolling up from the bottom, the animation will immediately
start since the last visible item condition is true — and by the time
it reaches the top the spring is done moving.

Bug: 38349031
Change-Id: I344deef47c50b33405345dd3a137ccdb12aeae02
2017-06-07 13:17:19 -07:00
Jon Miranda
4e11c2738a Add physics motion to items in all apps.
Motion applied to:
- Icons
- Prediction icons
- Prediction divider

Bug: 38349031
Change-Id: I376e6e39080c8c80463a0ce8b104b05e4d576f17
2017-05-23 10:02:51 -07:00
Sunny Goyal
dc19a07aba Adding support for top padding in BaseRecyclerView. The scrollbar is
drawn below the top padding.
Also adding callback for getting the all-apps vertical pull range
so that it can be controlled by SearchUiManager

Bug: 37616877
Change-Id: Ib4642073f3e92f6676caede3bddd652fda89c86f
2017-05-15 14:14:04 -07:00
Sunny Goyal
161f96bc77 Moving apps search related logic into a custom layout file
This will allow derivative projects to easily change the search behavior
by simply overriding the xml file

Bug: 37616877
Change-Id: Ib8d6a2dab06819a52611e9a3d97c70c5a49bbf97
2017-05-08 14:43:32 -07:00
Mario Bertschler
48198d004a All Apps transition with gradient and scrim.
The transition is behind a feature flag and
turned off by default.

Change-Id: I155840ba82b5a573d874376797db5f739a52d706
2017-05-03 10:32:57 -07:00
Tony Wickham
ca0cc05076 Merge "Fix updateIconBadges() in All Apps" into ub-launcher3-dorval
am: d570c0401c

Change-Id: Ife54bfe7a33d98bae7e71cecdc577e70fe6997e6
2017-04-26 15:50:58 +00:00
Tony Wickham
4926ebfe6d Fix updateIconBadges() in All Apps
Instead of notifyItemChanged(), we iterate over children of the
RecyclerView itself and call applyBadgeState() on affected icons.
This is the same logic we do for the workspace.

Issues this fixes:
- Icons flash when dismissing notifications
- Badge reappears on the icon while popup is open

Change-Id: I5c69d5c6bd47630c0241666b5f7f6f7ca97118f9
2017-04-26 08:39:12 -07:00
Mario Bertschler
08ffaae3b6 Show promise app icon progress in All Apps and setup market intent
on clicking promise app icon in All Apps.

Only the progress will be changed with animation on progress update,
no relayout is performed. If the icon is newly bound, the progress
will not be animated.

Bug: 23952570
Change-Id: I98d3f945f08a2abadf53f20e6007c15e56d5d410
2017-03-20 16:02:24 -07:00
Mario Bertschler
0fc6f684e7 App discovery integration in All Apps search
This is the basis for app discovery integration while searching in all apps.
This does NOT include binding to the actual service and retrieving results,
but instead provides all the UI to show suggested instant apps and apps
from a store with star rating and pricing.

Change-Id: I1605b52848491acee4ac1d15c0112e6a768363f6
2017-03-03 13:05:57 -08:00
Sunny Goyal
1f3f07d47c Simplifying some launcher themes
> Replacing some colors with theme attributes
> Simplifying styles definition by removing unnecessary inheritance and inlining some definitions

Change-Id: Ifa167515cae6a7fd3720f1a52ff9ce11abb4495f
2017-02-16 15:24:37 -08:00
Tony Wickham
18a1b5da36 Gracefully ignore items that don't support notifications
PackageUserKey is only meant to be used for items that support
notifications, so when trying to update it for an item that
doesn't, we don't use it to check if the item has notifications.

This fixes a crash that happens when trying to update notifications
for a legacy shortcut, as such a shortcut doesn't have a component
on its intent, which we were trying to use to populate PackageUserKey.

Bug: 34842278
Change-Id: I8c69ccebbf9d93505d5b29ecd25d76c65610ddc4
2017-02-02 15:37:18 -08:00
Tony Wickham
010d255018 Add NotificationListener to launcher.
- NotificationListener extends NotificationListenerService, and is
  added to the manifest.
- Added PopupDataProvider, which contains logic for storing and
  interacting with data that goes into the long-press popup menu
  (shortcuts and notifications). A follow-up CL will rename
  DeepShortcutsContainer to a generic PopupContainerWithArrow.
- If Launcher has notification access, NotificationListener will
  get callbacks when notifications are posted and removed; upon
  receiving these callbacks, NotificationListener passes them to
  PopupDataProvider via a NotificationsChangedListener interface.
- Upon receiving the changed notifications, PopupDataProvider maps
  them to the corresponding package/user and tells launcher to
  update relevant icons on the workspace and all apps.

This is guarded by FeatureFlags.BADGE_ICONS.

Bug: 32410600
Change-Id: I59aeb31a7f92399c9c4b831ab551e51e13f44f5c
2017-01-25 09:51:06 -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
f5440cbd6c Removing FeatureFlag.LAUNCHER3_LEGACY_WORKSPACE_DND and corresponding logic
Change-Id: Ie10c087b4f72ee27be5bf12e2c81be5b7a3a6176
2016-12-15 08:05:09 -08:00
Sunny Goyal
8f03c86b3a Merge "Refactoring FlingToDelete" into ub-launcher3-master 2016-12-14 22:10:31 +00: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 Wickham
d3e02eba13 Merge "Don't let AllAppsTransitionController intercept when a floating view is open." into ub-launcher3-master 2016-12-14 05:06:09 +00:00
Tony
139a25a7a8 Don't let AllAppsTransitionController intercept when a floating view is open.
Previously we checked for deep shortcuts when closing all apps by swiping
down. Now we check any AbstractFloatingView, and when swiping up.

Bug: 33542711
Change-Id: I860eb55c69567a92cd626e966bf881b7d1bffc6e
2016-12-12 22:23:28 -08:00
Hyunyoung Song
df9f14746c nav bar on all apps container should use light theme.
b/33553066
Change-Id: Ic9eb796a01eaa8d00fbeedeb5456876b668e6db2
2016-12-12 14:34:10 -08: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
Sunny Goyal
db36437931 Moving saving state transtion listener logic to individual views
Change-Id: If5402b6961d7d6be0c50778f27a8746ed6f1bbfb
2016-11-14 17:43:31 -08:00
Jon Miranda
145435ef6e Using dimension defined for all apps search bar height.
In portrait multi-window mode, hotseat cell height is
too small. Found that there was already a resource for
all_apps_search_bar_height so using that instead.

Change-Id: I56647eb55a7808e93bdcbb3334b1513f6ac23d7c
2016-11-11 14:35:20 -08:00
Jon Miranda
f92af1d440 Use insets and hotseatCellHeightPx to set search container height.
In a previous refactor, I mistakenly used hotseatBarHeightPx instead of
hotseatCellHeightPx.

Bug: 32176631
Change-Id: I53ef8fa29a6980dcb33bb979d1bed98317c8ade2
2016-11-07 17:05:14 -08:00
Sunny Goyal
47564ca3a1 Merge "Simplifying mapCoordInSelfToDescendant" into ub-launcher3-master 2016-11-07 18:09:39 +00:00
Sunny Goyal
8b16b96b38 Fixing same drawable instance being used with 2 views
Drawable contain a reference to the view which is used to invalidate the view.
If the same drawable is used with two views, only once view will get invalidated.

Bug: 32575647
Change-Id: Ia22310a6bda55ce0a591712761ec8ab1cdbaccdf
2016-11-01 14:49:38 -07:00
Sunny Goyal
5e0e94f0b2 Simplifying mapCoordInSelfToDescendant
> Removing new object creation (during draw and touch handling)
> Simplifying matrix operation to call invert only once at the end

Change-Id: Iffadd6e9d84997baa36719ed688a7c3c1027e839
2016-10-28 10:24:40 -07: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