Commit Graph

18584 Commits

Author SHA1 Message Date
Kevin eda02641a2 Move clear all to recycler view (1/2)
First part of moving clear all button to recycler view.  This CL adds
support in the recycler view adapter for a clear all holder type and
hooks it up to the previous clear all animation.

Adding this breaks several assumptions made externally on the type of
the item and index which will be addressed in the second part.

Bug: 114136250
Test: Builds, testing pending 2nd part
Change-Id: Ib16790028d4e9f520945a987b3dace40d19f2468
(cherry pick from 8573ff04b4)
2019-04-23 19:25:05 +00:00
Kevin 56abdd7ade Only switch item animator on content fill if needed
We currently switch to a different recycler view item animator for a
special content fill animation when we have loading item UI up and want
to animate to the actual content. However, it's possible if the task
content loading is fast enough, we may return before the adapter
changes have actually propogated to the recycler view layout. In this
case there is no loading UI to fill and we should not switch item
animators.

Bug: 130820737
Test: Go from app => overview, try to remove, remove animation occurs
properly
Change-Id: Ic95854d04df98023f444daf967c58bdd8177722a
(cherry picked from commit 035f0d2157)
2019-04-23 19:24:58 +00:00
Kevin 1866ecf638 Fix NPE and make getTask return Optional
Fix an NPE when attempting to update the thumbnail in IconRecentsView.
If the task item is binding the loading UI, it has no task so the app
will crash, so we just need to ensure the task is actually present
first.

While we're here, also change the API to return an Optional<Task> and
make a tighter contract, making it harder to make this mistake in the
future.

Bug: 130746661
Fix: 130746661
Test: Go from app => overview on recents Go
Change-Id: I1402fcd2e58bdeb703c7dcc1b9dcf0d258808b3d
(cherry picked from commit 77f01524bd)
2019-04-23 19:24:52 +00:00
Kevin 532fb48331 Fix ViewTreeObserver crash on Recents Go
The view tree we originally attach the onGlobalLayout listener to may no
longer be alive when we get the callback as the view tree observer
merges when the view attaches to a view hierarchy, giving us an
exception. Instead, we should request the view tree observer again and
remove it from there.

Bug: 130740246
Fix: 130740246
Test: Manual test, no longer crashes
Change-Id: Idb982022e72db75b8e20fd5bea00655212dc0258
(cherry picked from commit 60f21a8d3a)
2019-04-23 19:24:43 +00:00
Kevin a94154970a Fix snapshots not updating on app => overview.
Previously we were only updating the model on snapshot update and not
the view itself, so the view would have an outdated snapshot if it
loaded everything before the data updated itself.

Bug: 114136250
Fixes: 130635650
Test: Go from app to overview, transitions properly with new snapshot
Change-Id: Ife9cae7a700a855788b5d25b05d78e562e1b27f0
(cherry picked from commit 025799ba9c)
2019-04-23 19:24:32 +00:00
Kevin 9c91de5a9d Fix views not being visible on Recents Go.
If we bind the loading task views but then on the tasks being loaded
realize there are no items, it's possible to animate from the empty
content view to the regular content view and then back. Currently, this
leads to updateContentView not being called properly the second time
since both views are still visible during the animation, so this CL
fixes that and cancels any on-going crossfade animations.

Bug: 114136250
Fixes: 130580680
Test: Remove last item from recents, go to recents again, empty view
shown
Change-Id: If1a4caab15f9b6d7ccd3abbc06f5866e06650db8
(cherry picked from commit cce954f334)
2019-04-23 19:24:22 +00:00
Kevin 3f343b7b53 Smarter task laying out based off onMeasure
Previously laid out via calls to layoutParams. This isn't as optimized
as being baked into the measure + layout system and has the issue of
being less flexible. For example, if the device profile changes (e.g.
orientation change), we'd have to apply new layout params for all the
views. With this CL, we would only need to do this for top-level views
and the children will resolve themselves.

Bug: 114136250
Test: Check layout on marlin + walleye
Change-Id: Iddd503a8844bdde7724d3f804660da61719d5c90
(cherry picked from commit c98f116b77)
2019-04-23 19:24:13 +00:00
Kevin f17917fab3 Change layout size to be dependent on device size
This CL changes the layout sizes to be dependent on device height as
opposed to static values so that it works on different decides out of
the box.

Bug: 114136250
Test: Tested how layout looks on marlin_svelte and walleye
Change-Id: Ie000bc797d7dd2e38cd705d54f3e09c79e1a2176
(cherry picked from c06522c826)
2019-04-23 19:24:05 +00:00
Kevin e47543d03f Update Go recents visibility based off adapter
View visibility should be based off adapter since that's what the layout
items are based off of.

Bug: 130440957
Test: Loading UI is shown when going to recents Go
Change-Id: I1f167553b6fdce757865c739b9793b63a20e7f57
(cherry picked from commit f1a47a0fe6)
2019-04-23 19:23:57 +00:00
Kevin 29cdac41f1 Animate content fill animation to Recents Go
This CL adds the animation that occurs when transitioning from a set of
empty views to the actual task list after it is loaded. This is done by
setting a one-shot item animator that animates changes, for item views
that fade from empty to filled, and removes, for when we have too many
empty views.

Bug: 114136250
Test: Artificially increase task list load time and see animation fill
Change-Id: Ibbc09db702e591063ceea61df2359f18a3fcf8f9
(cherry picked from commit 987799dfa1)
2019-04-23 19:23:44 +00:00
Kevin 1060a0d7fc Animate to bottom view in app => overview
We always want to animate to the bottom so we should just do that if we
have the view laid out even if at the time the app task doesn't actually
match the view.

Bug: 114136250
Test: Go to recents, press overview twice quickly, see it animate
correctly
Change-Id: I0516ef127ff6ef0f865c85314c9ffe4a7c6ef9e3
(cherry picked from commit 86957f28ff)
2019-04-23 19:23:25 +00:00
Kevin 6f927ecd8e Differentiate empty UI from default in recents Go
Use the "empty" drawable as the initial UI until the recents task list
and order is loaded, then switch to default/filled UI.

Bug: 114136250
Test: Manual test; see empty UI when loading takes time
Change-Id: I85b72e6d40d7224b28217cbf4e05515ec1e9451b
(cherry picked from commit a2c4200cde)
2019-04-23 19:22:42 +00:00
Kevin 2ee78b7310 Add task content animation property
Add API to animate task item content transition from one set of task
content (icon, thumbnail) to another. To do this, we provide two things
to the caller: startContentAnimation which allows the caller to set the
icon, thumbnail, and label to animate to and the
CONTENT_TRANSITION_PROGRESS property which the caller can use to control
the transition progress.

We will eventually hook this up to onBindViewHolder for the task adapter
when there is a data change event to prepare to animate content in.
Currently it still changes immediately.

Bug: 114136250
Test: Builds
Change-Id: I16e9b757ee91be54fe8cba6780b399e3cc313e3e
(cherry picked from commit a3d80d102e)
2019-04-23 19:21:58 +00:00
Kevin 7b42d2287a Fix transition progress not applying to drawables
TaskLayerDrawable should reapply UI changes from the transition progress
when there is a new drawable. In addition, the transition should check
if the drawable in the front and back are the same (i.e. on
initialization when both are showing the empty drawable) so that it only
applies the front-drawable alpha.

Bug: 114136250
Test: Builds
Change-Id: I74836b5043da555358742ba0a3f46f170f590904
(cherry picked from commit 1531982d1e)
2019-04-23 09:27:46 -07:00
Kevin fbe9182b75 Change layout anim from Animation => Animator
Change the layout animation to use animators instead of the built-in
animation-based layout animation. Animator-based animations are more
flexible and can act on the view properties themselves, making it
easier to deal with if we need to cancel the animation later from a
conflicting animation (i.e. we find out we need to animate a view
out).

Bug: 114136250
Test: Go to recents, see items animate in
Change-Id: Id8227cd50e81999cac98912ac58cd2d6864c40af
(cherry picked from commit 26ad999b10)
2019-04-23 09:26:52 -07:00
Kevin 6092a6ee1e Add drawable for default thumbnail for Recents Go
This CL adds a drawable for the default thumbnail view and
refactors the logic to get the default icon/thumbnail/label if
null to separate methods for re-use in later CLs.

Bug: 114136250
Test: Manual; Go to icon recents
Change-Id: I511ea40ace040fc53ffc69c27149f24d69bda7b0
(cherry picked from commit 34ee30c4f9)
2019-04-23 09:25:54 -07:00
TreeHugger Robot 3cccc666b6 Merge "Add task layer drawable class for Recents Go." into ub-launcher3-qt-dev 2019-04-23 01:16:56 +00:00
Vadim Tryshev 2e63330386 Merge "Annotating ignored tests with requests to enable them" into ub-launcher3-qt-dev 2019-04-23 00:56:56 +00:00
Kevin e6e1463ed2 Add task layer drawable class for Recents Go.
Add a custom drawable class that provides a hook to the caller to
control a crossfade animation between two drawables. This will be
helpful going forward to sync up all the animations to the controller.

Note that this CL only adds the class and does not replace the current
implementation.

Bug: 114136250
Test: Builds
Change-Id: I3cc6be79cb2ca5d64c8cc2945ff7f2ebd49632b6
(cherry picked from commit bb956bd028)
2019-04-23 00:42:49 +00:00
vadimt 677abe2117 Annotating ignored tests with requests to enable them
Bug: 117106893
Change-Id: Ib8e578913ceebee44a507b5e333e7da07c6120d0
2019-04-22 17:34:29 -07:00
vadimt 736982d74b Small cleanup in StartLauncherViaGestureTests
Bug: 117106893
Change-Id: Iba0a571dd1c20a776fcbe1f305f163cada22befb
2019-04-22 17:09:10 -07:00
Vadim Tryshev b226f28a8c Merge "Not using browser app in testing. It may not start." into ub-launcher3-qt-dev 2019-04-22 22:58:32 +00:00
TreeHugger Robot 67e52822a4 Merge "Removing ShortcutInfoCompat and directly using ShortcutInfo" into ub-launcher3-qt-dev 2019-04-22 22:51:27 +00:00
Sunny Goyal 6bbf6004f8 Removing ShortcutInfoCompat and directly using ShortcutInfo
Change-Id: I2842689e192a206c0d31558c8126eae1c7904598
2019-04-22 15:39:40 -07:00
vadimt 1256912237 Not using browser app in testing. It may not start.
Change-Id: I48b129d84ea9cf8f97193bcb769ba20738046ef5
2019-04-22 15:36:18 -07:00
Vadim Tryshev d5f95bf852 Merge "Logging TAPL interaction model" into ub-launcher3-qt-dev 2019-04-22 22:15:11 +00:00
Vadim Tryshev e028324d0a Merge "Verifying that test initialization switched to workspace" into ub-launcher3-qt-dev 2019-04-22 21:42:09 +00:00
vadimt a7cb479954 Logging TAPL interaction model
Change-Id: I7c44d1b145677919991338fa87e736712587a695
2019-04-22 14:41:12 -07:00
vadimt 24c7c0af98 Verifying that test initialization switched to workspace
Change-Id: I4d33f831a6fbb6632dc21d056fb239d9d1dcddd8
2019-04-22 14:07:23 -07:00
TreeHugger Robot f31848fe8d Merge "Skip state animation if animations are disabled" into ub-launcher3-qt-dev 2019-04-22 19:36:44 +00:00
Vadim Tryshev 4c8d7a0401 Merge "Adopt shell permission only to set and unset time limit." into ub-launcher3-qt-dev 2019-04-22 19:20:10 +00:00
vadimt b647866cd0 Adopt shell permission only to set and unset time limit.
We don't want this permission to "help" Launcher with calling other
APIs.

Bug: 130914022
Change-Id: I649dede958aa6e4a67ccf332151a15cad53b0e9f
2019-04-22 11:32:43 -07:00
vadimt 2ff40b0cfb Disabling all DefaultLayoutProviderTest tests
See the bug for details. The problem is probably in
DefaultLayoutProviderTest.writeLayout.

Bug: 130562632
Change-Id: Ic1a14c9dd3cac4a4cf644c6bc9619d631295f92b
2019-04-22 10:32:21 -07:00
Sunny Goyal 7368fa4369 Skip state animation if animations are disabled
> Also update the animation disabled check to use new-API

Bug: 118678948
Change-Id: Ib709844e34bdb7e369b368a7c33f2e8ff120024b
2019-04-22 10:00:01 -07:00
Sunny Goyal 8b0cb4113f Listening only for "android" package for overlay changes
Bug: 130917995
Change-Id: I37160a886a0afdc02dca8f7da6e8aa54c795882d
2019-04-22 09:02:08 -07:00
TreeHugger Robot bf81b2ca0c Merge "Adding wellbeing toast test" into ub-launcher3-qt-dev 2019-04-22 15:30:28 +00:00
vadimt 736adde1c7 Adding wellbeing toast test
Bug: 130914022
Change-Id: I777440884c122ec040e5e00bfbed41f2eb86b5b0
2019-04-19 19:15:37 -07:00
TreeHugger Robot a22c2b5d08 Merge "Jump to the nearest page to launch when swiping down on shelf" into ub-launcher3-qt-dev 2019-04-19 23:48:40 +00:00
Tony 52a0d7712e Jump to the nearest page to launch when swiping down on shelf
Bug: 78240090
Change-Id: I1e26f66242fa3b45a4b6241721f0ff0465770aaf
2019-04-19 16:34:30 -07:00
Tony 72eadbad80 Add touch slop before sending home intent from DeviceLockedInputConsumer
Bug: 128808922
Change-Id: I4eaa5ba627f123022310c23663b6711c0eb62518
2019-04-19 16:32:31 -07:00
Jon Miranda de0093dfa5 Add ListenerView so that we can fast finish the FloatingIconView fade anim.
This change allows us to quickly end the animation if the user begins
interacting with launcher before the animation is over. This can currently
happen when the user swipes up to go home, and then quickly swipes up again
to enter overview.

Bug: 129421279
Change-Id: I88c7d55ef8ac09f999c082317de3bb3693c11466
2019-04-19 15:13:10 -07:00
TreeHugger Robot 0f8c7c0e91 Merge "Disabling DefaultLayoutProviderTest due to flakiness" into ub-launcher3-qt-dev 2019-04-19 21:14:36 +00:00
vadimt 1048100581 Disabling DefaultLayoutProviderTest due to flakiness
Bug: 130562632
Change-Id: I332f06b52e94919612f4cb96e59528886364837f
2019-04-19 13:53:54 -07:00
TreeHugger Robot a87f601cf1 Merge "Revert "Add overlayable.xml to res"" into ub-launcher3-qt-dev 2019-04-19 20:22:30 +00:00
Amin Shaikh 13a229c318 Revert "Add overlayable.xml to res"
This reverts commit 520d9133a3.

Reason for revert: b/130438597#6 outlines why we can't yet check this in.

Change-Id: Id7a00e926b16ca2ffc3396cbfae19c753b4b7ee9
2019-04-19 20:12:00 +00:00
Vadim Tryshev 9ccc21b637 Merge "Add more test diags" into ub-launcher3-qt-dev 2019-04-19 19:11:54 +00:00
vadimt 9c3b6bbe04 Add more test diags
Bug: 129434166
Change-Id: I1e2646e2e878eb3f7c93840937b33b2837aa31ac
2019-04-19 11:51:55 -07:00
Miranda Kephart b177185af2 Merge "Remove obsolete ChipsContainer" into ub-launcher3-qt-dev 2019-04-19 18:35:21 +00:00
Miranda Kephart 6b31012350 Merge "Don't shrink overview bitmap for chips" into ub-launcher3-qt-dev 2019-04-19 18:10:40 +00:00
Miranda Kephart bbc2b688a7 Remove obsolete ChipsContainer
Overview chips are now shown on top of the SuggestView, so there is
no need to implement them separately in Launcher (now they live in
the AiAi UI library).

Change-Id: I49bfdcae7ed5ea3f1c40a539217579dfce5b3172
2019-04-19 14:01:25 -04:00