Also fix a bug where we logged workspace swipe upon clicking undo, since
rebinding the pages causes us to reset mCurrentPage = 0 followed by
setCurrentPage(pageBoundFirst). Since the page isn't actually visibly
changing, we shouldn't log in that case.
Bug: 118758133
Change-Id: Ie87164a8c7c278680f67dee75657210bd33408a4
When we load the task content (icons, snapshots, etc), oftentimes, we
are still in the middle of the layout animation where items are fading
in from bottom to top. At this point, we start a second content-fill
animation from bottom to top that fades from empty => filled after the
first animation. However, we can improve this so that empty views
aren't shown for a split second for some of the later laid out views.
If the first animation has not finished and we would animate a content
change from empty => filled but the view is currently still not visible,
we should just complete the content transition on the spot so that the
layout animation lays out the filled version instead.
Bug: 131339235
Test: Go to recents, observe lay out animation does not continue to lay
out the empty view first
Change-Id: I936a81e6cf8b3552cdee90c183fc841f50ec9ea8
Writing to disk hapens on the worker thread, so if we create content values on
UI thread, some values can change before it is written to disk.
This happens in case of shortcuts, where the badge is applied after the icon is queued,
but before it is written
Bug: 131303610
Change-Id: Ic35b17071d4ed3e5c5fee9f003a225e4ffdc74f3
Previously we used the bottom most view in recents list to launch the
recent task when the user pressed the overview button. However, if
the user is in landscape and scrolls up so the bottom view is not
attached, pressing overview command will launch whatever the bottom task
is visually which is incorrect. Instead, we get the actual task from the
model to launch and only use the "view => app" animation if the view for
that task is attached. If it isn't, we use the basic animation.
Bug: 130735711
Test: Go to landscape, scroll up, hit command, launches correct task
Change-Id: Idff88054443259e917bbec1b47d78efbb1544283
Before, the soonest we initTransitionEndpoints() is in
onRecentsAnimationStart(), which might be too late if launcher was
killed. (In that case, the gesture might end before we ever get
onRecentsAnimationStart(), and thus will never consider the distance
traveled great enough to trigger recents since we don't have endpoints.)
Bug: 129723135
Change-Id: I349f62244aaba8369926b14f90acd994fd40a93a
- Add support for mMinScrollX to PagedView
- Add RECENTS_CLEAR_ALL_BUTTON as a state-specified visible element
- In BackgroundAppState, set Clear all invisible and bound RecentsView
scroll to the last task
Test:
- Open an app, quick switch until reaching the end, ensure Clear all
does not show up and an overscroll effect is performed
- Enter overview, scroll to the end and ensure Clear all shows up
- Same tests in RTL and 3rd party launcher
Bug: 130160876
Change-Id: I5fb958744d0055b83ced1f8b0d7face0e06a0cc5
There are 2 conditions that we force the MotionPauseDetector to treat
the motion as not paused:
1. If we haven't passed a small displacement (48dp before, 36dp now)
2. If we have moved mostly orthogonally
These existed soley for the OtherActivityInputConsumer case, because
1. We only need the displacement requirement to make room for the
peeking shelf, which doesn't exist in other cases (it's already there on
home for example)
2. We can only move orthogonally for quick switch, which again doesn't
exist for other users of MotionPauseDetector.
So now instead of checking min displacement and orthogonal distance
inside MotionPauseDetector, we let callers setDisallowPause()
before adding positions to their MotionPauseDetector.
The only user visible change is that you no longer have to swipe up 48dp
before we allow pause to overview from home. This also paves the way to
using the same logic that determines to disallowPause to also detach
recents from the window while swiping up from an app.
Bug: 129985827
Change-Id: Ie690aa314da3260aff2209341a29638604f9501c
Frame width is not used because navigation bar is always on the bottom.
Test: manual
Bug: 113952590
Change-Id: I48c29ffa4ca982a7aa20e2cced019e50580fe302
(cherry picked from commit 69a329e79e)
=> Using the drag slop (currently 10dp), which is the appropriate slop when comparing to the other gestures. Touch slop (which was being used for the Assistant) is only being used for gestures starting from the back button. This means that the delegate was getting triggered much too often (unfair slop competition). This prevents that.
=> Fixed additional bugs with the consumer delegate / sharedState; the shared state notion really only applies to the OtherActivityInputConumer, and it wasn't being propagated from the AssistantConsumer.In addition, the isActive() method is only being used as a proxy for whether or not to use the shared state, so clarified the naming. This fixes another case where touch could become completely stuck and you could no longer swipe up.
=> Modified the effective angle to be 90 degrees down to 20 above the horizontal.
=> Reduced the drag threshold to 55 dps.
=> Known issue: the time threshold requires motion events to be triggered. In practice, this works because the finger doesn't stay completely still, but we should add a timer to update the progress smoothly.
=> Removed pause detector.
Change-Id: Ie23e836c6d778914594774b830c3cd2e7b94eca4
A previous change [1] introduced the material library as a static library
for the SecondaryDisplayLauncher. The material library defines a
resource "attr/iconSize" with format="dimension" while Launcher3 defines
a resource of the same name with format="float". The material resource
is being overriden by the Launcher3 resource and is preventing aapt2
from disallowing multiple definitions of the same attribute with
different formats.
This change renames the Launcher3 iconSize so it will not collide with
the material resource.
[1] If183dd35a1d197c4a9a8225a021e36c4f1662587
Bug: 129146717
Test: build success and inspection of generated apk
Change-Id: I5eb54ea606ddcfb47d5150b44906a8707203e905
Hook up the thumbnail drawable created in the first CL to the task
thumbnail so that the drawable automatically rotates and resizes based
off the device orientation.
Bug: 114136250
Bug: 131095241
Test: Go to app in landscape, go to recents, rotate => thumbnail rotates
Change-Id: Ib58e45ab3e94aeb080e47b1d5b38c221acce5ef3
Add vertical margins to clear all button and add horizontal padding.
Bug: 114136250
Test: Manual test on marlin_svelte and emulated tablet (1280 x 800)
Change-Id: Iae8d6609ca1031947e8e8d90f526d9cbda070ee5
* changes:
Clear all button should not be swipable
Use custom drawable for Recents Go thumbnails (1/2)
Add clear all view that scales off device height
Ensure recents scrolled to first task in landscape
Enable landscape mode for Recents Go.
Remove old recyclerview layout logic
Calculate task height directly off portrait height
Fix task adapter notify merge conflict
Move clear all to recycler view (2/2)
Move clear all to recycler view (1/2)
Only switch item animator on content fill if needed
Fix NPE and make getTask return Optional
Fix ViewTreeObserver crash on Recents Go
Fix snapshots not updating on app => overview.
Fix views not being visible on Recents Go.
Smarter task laying out based off onMeasure
Change layout size to be dependent on device size
Update Go recents visibility based off adapter
Animate content fill animation to Recents Go
Animate to bottom view in app => overview
Differentiate empty UI from default in recents Go
Add task content animation property
Fix transition progress not applying to drawables
Change layout anim from Animation => Animator
Add drawable for default thumbnail for Recents Go
This move resolves privapp-permissions whitelist issue and multiple Launcher3 apks on the device.
Bug: 131102753
Test: Built, flashed crosshatch_svelte-eng target on a Pixel 3 device and the device boots successfully.
Change-Id: Iee0e12737cd26acddf8d1d3e057a613febb3d7e0
Unlike other task items in the recycler view, the clear all button
should not be swipable as you obviously can't remove the button.
Bug: 114136250
Test: Go to recents, attempt to swipe clear all, does not work
Change-Id: I0ab00c03b697f2174431b69bbf758c3ff104db97
(cherry picked from commit cd88cf8d1c)
In order to support rotated thumbnails based off the device orientation,
we should create a custom drawable that supports drawing a rotated
bitmap based off some requested orientation. This CL adds this class,
and we'll use it in a later CL.
By baking this directly into the drawable, we prevent unnecessary
allocations of rotated bitmaps.
Bug: 114136250
Bug: 131095241
Test: Builds
Change-Id: Ib4e83e3619028c583e10f1b8d743a365ec310346
(cherry picked from commit 518ff10856)
Add a custom clear all view that scales its height based off the height
of the device in portrait. This view holds and lays out the actual
button.
Bug: 114136250
Test: Task items + clear all scale to fit flush with screen size
Change-Id: I72b175681c104588970d57cde34cebc0f06b55a0
(cherry picked from commit a2b8ca8830)
The app should animate to the bottom view which means we should ensure
the bottom view is scrolled to be visible at the bottom when we animate
in. Note that this is only a consideration in landscape since in
portrait, all tasks are always visible and the recyclver view is not
scrollable.
Bug: 114136250
Test: Go to recents Go from app in landscape mode
Change-Id: If4ea35759cc881f2c32565368d031620b62a45dd
(cherry picked from commit 64bb5bbb78)